{"version":3,"sources":["jsdelivr-header.js","/npm/@panoramax/web-viewer@4.4.0/webpack/universalModuleDefinition","/npm/@panoramax/web-viewer@4.4.0/build/components/core/Basic.js","/npm/@panoramax/web-viewer@4.4.0/build/components/core/CoverageMap.js","/npm/@panoramax/web-viewer@4.4.0/build/components/core/Editor.js","/npm/@panoramax/web-viewer@4.4.0/build/components/core/PhotoViewer.js","/npm/@panoramax/web-viewer@4.4.0/build/components/core/Viewer.js","/npm/@panoramax/web-viewer@4.4.0/build/components/layout/BottomDrawer.js","/npm/@panoramax/web-viewer@4.4.0/build/components/layout/CorneredGrid.js","/npm/@panoramax/web-viewer@4.4.0/build/components/layout/Mini.js","/npm/@panoramax/web-viewer@4.4.0/build/components/layout/Tabs.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/LocationPrecisionDoc.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/MapBackground.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/MapFilters.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/MapLayers.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/MapLegend.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/MiniPictureLegend.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/PictureLegend.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/PictureMetadata.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/PlayerOptions.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/QualityScoreDoc.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/ReportForm.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/SemanticsDoc.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/SemanticsDownload.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/SemanticsFilters.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/SemanticsList.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/SemanticsMetadata.js","/npm/@panoramax/web-viewer@4.4.0/build/components/menus/Share.js","/npm/@panoramax/web-viewer@4.4.0/build/components/styles.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/AnnotationsSwitch.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Button.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/ButtonGroup.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/CopyButton.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Grade.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/GradeFilter.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/LinkButton.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/ListGroup.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/ListItem.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Loader.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Map.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/MapMore.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Photo.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Popup.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/ProgressBar.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/QualityScore.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/SearchBar.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/SemanticsEditor.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/SemanticsTable.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/Switch.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/TogglableGroup.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/CopyCoordinates.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/GeoSearch.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/Legend.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/LevelSelect.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/MapFiltersButton.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/MapLayersButton.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/OSMEditors.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/PictureLegendActions.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/Player.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/SemanticsFiltersButton.js","/npm/@panoramax/web-viewer@4.4.0/build/components/ui/widgets/Zoom.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/API.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/InitParameters.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/PanoraMapProtocol.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/PhotoAdapter.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/PresetsManager.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/SemanticsMapProtocol.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/URLHandler.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/geocoder.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/i18n.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/indoor.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/map.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/picture.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/semantics.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/services.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/utils.js","/npm/@panoramax/web-viewer@4.4.0/build/utils/widgets.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-regular-svg-icons/faStar.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faArrowLeft.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faArrowRight.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faAt.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faBackward.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCalendar.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCalendarAlt.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCalendarDays.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCamera.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCaretDown.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCaretUp.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCheck.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faChevronDown.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faChevronRight.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faChevronUp.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCircleExclamation.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCircleInfo.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCircleNotch.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCommentDots.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faCopy.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faDownload.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faEarthEurope.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faEllipsisV.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faEllipsisVertical.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faEraser.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faExternalLinkAlt.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faFloppyDisk.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faForward.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faImage.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faImages.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faInfoCircle.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faLayerGroup.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faLightbulb.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faLink.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faLocationDot.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faMagnifyingGlass.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faMap.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faMapMarkerAlt.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faMedal.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faMinus.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPalette.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPanorama.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPaperPlane.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPause.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPen.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPersonBiking.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPlay.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPlus.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faPlusSquare.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faQuestion.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faRocket.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faSatelliteDish.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faScroll.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faShareAlt.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faShareNodes.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faSliders.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faSquarePlus.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faStar.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faTags.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faTimes.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faTrash.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faTriangleExclamation.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faUpRightFromSquare.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faUser.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faUserLock.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faVectorSquare.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/free-solid-svg-icons/faXmark.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/data/constants.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/arrow.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/browser.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/close.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/download.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/fullscreen-in.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/fullscreen-out.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/info.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/menu.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/zoom-in.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/zoom-out.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/math.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/misc.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/PSVError.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/psv.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/Animation.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/Dynamic.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/MultiDynamic.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/PressHandler.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/utils/Slider.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/events.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/lib/TypedEventTarget.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/adapters/AbstractAdapter.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/data/system.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/adapters/EquirectangularAdapter.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/adapters/DualFisheyeAdapter.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/AbstractComponent.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/AbstractButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/CustomButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/DescriptionButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/DownloadButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/FullscreenButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/MenuButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/AbstractMoveButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/MoveDownButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/MoveLeftButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/MoveRightButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/MoveUpButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/AbstractZoomButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/ZoomInButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/ZoomOutButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/buttons/ZoomRangeButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/plugins/AbstractPlugin.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/data/config.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/NavbarCaption.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Navbar.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/data/cache.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Loader.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Notification.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Overlay.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Panel.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/components/Tooltip.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/AbstractService.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/DataHelper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/EventsHandler.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/gesture.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/mousewheel.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/Renderer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/lib/ImageLoader.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/TextureLoader.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/ViewerDynamics.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/services/ViewerState.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/Viewer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/core/src/icons/error.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/Queue.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/tiles-utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/equirectangular-tiles-adapter/src/utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/equirectangular-tiles-adapter/src/EquirectangularTilesAdapter.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/events.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/MarkersButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/icons/pin.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/icons/pin-list.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/constants.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/MarkersListButton.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/node_modules/three/examples/jsm/renderers/CSS3DRenderer.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/CSS3DContainer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/MarkerType.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/Marker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/AbstractDomMarker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/AbstractStandardMarker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/ChromaKeyMaterial.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/shaders/chromaKey.vertex.glsl","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/shaders/chromaKey.fragment.glsl","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/Marker3D.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/shared/video-utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/MarkerCSS3D.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/MarkerNormal.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/MarkerPolygon.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/markers/MarkerSvg.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/MarkersPlugin.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/markers-plugin/src/index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/events.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/constants.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/arrow.svg","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/ArrowsRenderer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/datasources/AbstractDataSource.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/datasources/ClientSideDatasource.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/datasources/ServerSideDatasource.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@photo-sphere-viewer/virtual-tour-plugin/src/VirtualTourPlugin.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/fflate/esm/browser.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/json5/dist/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/query-selector-shadow-dom/src/normalize.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/query-selector-shadow-dom/src/querySelectorDeep.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/tslib/tslib.es6.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/point-geometry/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/unitbezier/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/offscreen_canvas_supported.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/offscreen_canvas_distorted.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/common.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec4.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/extent.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/util.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/transferable_grid_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/maplibre-gl-style-spec/dist/index.mjs","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/abort_error.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/config.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/protocol_crud.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/ajax.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/web_worker_transfer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/throttled_invoker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/actor.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/evented.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/validate_style.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/zoom_history.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/unicode_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/script_detection.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/rtl_text_plugin_worker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/evaluation_parameters.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/properties.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/struct_array.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/array_types.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/circle_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/segment.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/encode_attribute.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/pattern_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/dash_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/murmurhash-js/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/murmurhash-js/murmurhash3_gc.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/murmurhash-js/murmurhash2_gc.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/feature_position_map.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/uniform_binding.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/program_configuration.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/load_geometry.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/evaluation_feature.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/circle_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/intersection_tests.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/query_utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/circle_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/circle_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/heatmap_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/heatmap_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/image.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/heatmap_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/color_ramp.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/hillshade_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/hillshade_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/color_relief_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/texture.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/dem_data.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/color_relief_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/fill_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/pattern_bucket_features.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/earcut/src/earcut.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/subdivision_granularity_settings.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/subdivision.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/fill_large_mesh_arrays.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/fill_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/fill_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/fill_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/fill_extrusion_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/vector-tile/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/fill_extrusion_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/fill_extrusion_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/line_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/line_attributes_ext.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/line_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/line_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/line_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/symbol_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/transform_text.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/one_em.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/verticalize_punctuation.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/tagged_string.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/pbf/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/potpack/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/image_atlas.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/shaping.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/parse_glyph_pbf.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/symbol_size.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/overlap_mode.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket/symbol_bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/merge_lines.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/symbol_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/format_section_override.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/symbol_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/resolve_tokens.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/background_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/background_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/raster_style_layer_properties.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/vectorType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/vertexBufferType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/raster_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/custom_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/create_style_layer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/dictionary_coder.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/vectortile_to_geojson.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/vector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/fixedSizeVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/intFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/doubleFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/sequenceVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/intSequenceVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/constant/intConstVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/featureTable.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/intWrapper.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/integerDecodingUtils.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/bitVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/integerStreamDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/longFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/sequence/longSequenceVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/topologyVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/zOrderCurve.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryVectorConverter.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/geometryVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/constGeometryVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/flatGeometryVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/gpuVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/constGpuVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/geometry/flatGpuVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/geometryDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/booleanFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/floatFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/constant/longConstVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/decodingUtils.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/variableSizeVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/flat/stringFlatVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/dictionary/stringDictionaryVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/fsstDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/propertyDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/tilesetMetadata.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/decoding/stringDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/typeMap.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/mlt/dist/mltDecoder.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/vector_tile_mlt.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/vt-pbf/dist/index.es.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/feature_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/anchor.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/check_max_angle.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/get_anchors.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/clip_line.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/quads.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/collision_feature.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/tinyqueue/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/find_pole_of_inaccessibility.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_layer/variable_text_anchor.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/symbol_layout.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/glyph_atlas.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/whoots-js/index.mjs","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/lng_lat.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/mercator_coordinate.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_id.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/world_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/worker_tile.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_cache.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/performance.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/vector_tile_overzoomed.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/vector_tile_worker_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/raster_dem_tile_worker_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/geojson-rewind/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/kdbush/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/supercluster/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@maplibre/geojson-vt/dist/geojson-vt.mjs","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/geojson_source_diff.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/geojson_worker_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/worker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat3.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat4.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec3.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/quat.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec2.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/pixels_to_tile_units.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat2.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/browser.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/time_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/dom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/webp_supported.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/image_request.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/request_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/style.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/load_sprite.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style_image.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/image_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/glyph_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/load_glyph_range.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/light.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/sky.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/line_atlas.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/worker_pool.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/web_worker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/global_worker_pool.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/dispatcher.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/query_features.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/load_tilejson.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/lng_lat_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/vector_tile_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/raster_tile_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/raster_dem_tile_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/geojson_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/geojson_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_id_to_lng_lat_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/image_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/video_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/canvas_source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/source.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/rtl_text_plugin_status.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/rtl_text_plugin_main_thread.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/bucket.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/source/source_state.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/mercator_utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/covering_tiles.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/extent_bounds.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_manager_raster.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_manager_raster_dem.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_manager_in_view_tiles.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/tile_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/path_interpolator.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/grid_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/projection.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/collision_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/placement.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/pauseable_placement.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/symbol/cross_tile_symbol_index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/_prelude.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/clipping_mask.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/shaders.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/_prelude.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/_projection_mercator.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/_projection_globe.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/background.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/background.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/background_pattern.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/background_pattern.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/circle.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/circle.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/clipping_mask.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/heatmap.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/heatmap.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/heatmap_texture.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/heatmap_texture.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/collision_box.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/collision_box.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/collision_circle.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/collision_circle.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/color_relief.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/color_relief.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/debug.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/debug.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/depth.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_outline.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_outline.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_outline_pattern.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_outline_pattern.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_pattern.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_pattern.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_extrusion.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_extrusion.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/hillshade_prepare.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/hillshade_prepare.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/hillshade.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/hillshade.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_gradient.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_gradient.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_pattern.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_pattern.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_sdf.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_sdf.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_gradient_sdf.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/line_gradient_sdf.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/raster.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/raster.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_icon.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_icon.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_sdf.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_sdf.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain_depth.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain_depth.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain_coords.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/terrain_coords.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/projection_error_measurement.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/projection_error_measurement.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/atmosphere.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/atmosphere.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/sky.fragment.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/shaders/sky.vertex.glsl.g.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/mesh.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/pos_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/mercator_projection.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/edge_insets.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/transform_helper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/primitives/aabb.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/mercator_covering_tiles_details_provider.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/primitives/frustum.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/mercator_transform.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/camera_helper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/mercator_camera_helper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/color_mode.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/cull_face_mode.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/depth_mode.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/stencil_mode.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/projection_error_measurement_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/webgl2.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_projection_error_measurement.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/create_tile_mesh.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/vertical_perspective_projection.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_projection.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_utils.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/primitives/bounding_volume_cache.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/primitives/convex_volume.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_covering_tiles_details_provider.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/vertical_perspective_transform.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_transform.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/vertical_perspective_camera_helper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/globe_camera_helper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/style/style.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/geo/projection/projection_factory.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/raster_bounds_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/vertex_array_object.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/terrain_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/projection_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/pattern.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/fill_extrusion_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/fill_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/circle_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/collision_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/debug_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/heatmap_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/hillshade_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/color_relief_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/line_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/raster_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/symbol_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/background_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/program_uniforms.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/atmosphere_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/program/sky_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/index_buffer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/vertex_buffer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/value.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/framebuffer_error.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/framebuffer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/context.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_collision_debug.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_symbol.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_heatmap.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_line.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/update_pattern_positions_in_program.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_fill.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_fill_extrusion.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_hillshade.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_color_relief.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_raster.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_debug.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_terrain.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_sky.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/painter.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_circle.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_background.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/draw_custom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/throttle.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/hash.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler_inertia.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/events.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/map_event.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/transform-provider.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/box_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/handler_util.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/tap_recognizer.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/tap_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/drag_handler.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/drag_move_state_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/mouse.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/touch_pan.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/two_fingers_touch.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/keyboard.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/scroll_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/shim/dblclick_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/click_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/tap_drag_zoom.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/shim/drag_pan.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/shim/drag_rotate.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/shim/two_fingers_touch.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler/cooperative_gestures.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/handler_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/camera.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/attribution_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/logo_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/task_queue.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/data/pos3d_attributes.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/tile/terrain_tile_manager.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/terrain.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/gl/render_pool.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/render/render_to_texture.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/default_locale.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/map.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/navigation_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/geolocation_support.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/util/smart_wrap.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/anchor.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/marker.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/geolocate_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/scale_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/popup.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/fullscreen_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/globe_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/src/ui/control/terrain_control.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/maplibre-gl/build/rollup/maplibregl.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@fortawesome/fontawesome-svg-core/index.mjs","/npm/@panoramax/web-viewer@4.4.0/node_modules/@lit/reactive-element/src/css-tag.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@lit/reactive-element/src/reactive-element.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@mapbox/point-geometry/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@mapbox/vector-tile/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/@maplibre/vt-pbf/lib/geojson_wrapper.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/@maplibre/vt-pbf/index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/clip.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/convert.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/feature.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/simplify.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/tile.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/transform.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/geojson-vt/src/wrap.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/iconify-icon/dist/iconify-icon.mjs","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-element/src/lit-element.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-html/src/directive.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-html/src/directives/class-map.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-html/src/directives/map.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-html/src/lit-html.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/lit-html/src/static.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/pbf/index.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/pmtiles/src/adapters.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/pmtiles/src/index.ts","/npm/@panoramax/web-viewer@4.4.0/node_modules/three/build/three.core.js","/npm/@panoramax/web-viewer@4.4.0/node_modules/three/build/three.module.js","/npm/@panoramax/web-viewer@4.4.0/webpack/bootstrap","/npm/@panoramax/web-viewer@4.4.0/webpack/runtime/compat get default export","/npm/@panoramax/web-viewer@4.4.0/webpack/runtime/define property getters","/npm/@panoramax/web-viewer@4.4.0/webpack/runtime/hasOwnProperty shorthand","/npm/@panoramax/web-viewer@4.4.0/webpack/runtime/make namespace object"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;CCNA,SAA2C,EAAM,GAC1B,iBAAZ,SAA0C,iBAAX,OACxC,OAAO,QAAU,IACQ,mBAAX,QAAyB,OAAO,IAC9C,OAAO,YAAa,GAAI,GACE,iBAAZ,QACd,QAAmB,UAAI,IAEvB,EAAgB,UAAI,GACrB,CATD,CASG,UACH,M,iKCoBe,MAAM,UAAc,KAwBlC,cAA8B,IAAlB,EAAO,UAAA,OAAA,YAAA,UAAA,IAAA,UAAA,GAClB,QAGA,KAAK,MAAQ,CAAC,YACd,KAAK,aAAe,KAAK,aAAa,iBAAgB,cACtD,KAAK,KAAO,KAAK,aAAa,SAAW,KACzC,KAAK,SAAW,KAAK,aAAa,aAAe,KACjD,KAAK,QAAU,KAAK,aAAa,YAAc,KAC/C,KAAK,SAAW,KAAK,aAAa,aAAe,KAGjD,QAAQ,KAAK,gBAAgB,KAAK,4BAA4B,kDAEjC,UAE1B,IAGH,KAAK,gBAAkB,QACvB,oBAAiB,MAAK,GAAU,KAAK,gBAAkB,IACxD,CAEA,oBACC,MAAM,oBAGN,KAAK,MAAK,mBAAgB,KAAK,MAG/B,KAAK,UAAS,iBAAc,aAAc,CAAC,QAAS,KAAM,cAAY,kBAGnE,KAAK,WAAa,KAAK,UAAY,KAAK,YAAc,KAAK,UACxD,KAAK,KAAO,KAAK,IAAI,YAAc,KAAK,WAC1C,KAAK,YAEL,KAAK,WAAa,KAAK,cAClB,KAAK,WACL,KAAK,WAEb,KAAK,aAIN,OACE,QAAQ,CAAE,IAAK,cAAe,IAAK,cAAe,aAAc,gBAAiB,SAAU,cAC3F,SAAQ,IAAa,IAAX,EAAG,GAAE,EACZ,KAAK,aAAa,IACpB,QAAQ,MAAM,wBAAwB,6BAA6B,sBAAsB,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ACG,YAAa,CAChB,GAEE,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,UACN,WACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,gBAAiB,CAChB,KAAM,UACN,WACA,SAAU,CACT,aACA,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,0BAA2B,CAC1B,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,EACG,KAAM,CACT,GAEE,QAAW,OACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,YAAa,CACZ,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,mCACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,gBAAiB,CAChB,KAAM,OACN,OAAQ,CACP,KAAM,CACT,EACG,MAAO,CACV,EACG,OAAQ,CACX,EACG,KAAM,CACT,GAEE,QAAW,OACX,SAAU,CACT,aACA,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,EACA,EACA,GAED,MAAO,SACP,SAAU,CACT,aACA,aACA,CACC,gBAAiB,CAChB,OACA,QACA,YAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,aAAc,CACb,KAAM,gBACN,UACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,OAAQ,IACR,MAAO,UACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,eAAgB,CACf,KAAM,UACN,QAAW,CACV,GAED,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,oBAAqB,CACpB,KAAM,UACN,WACA,SAAU,CACT,aACA,CACC,0BAA2B,OAE5B,CACC,mBAAoB,CACnB,OACA,iBAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,cAAe,CACd,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,OACN,OAAQ,CACP,OAAQ,CACX,EACG,KAAM,CACT,EACG,MAAO,CACV,EACG,IAAK,CACR,EACG,OAAQ,CACX,EACG,WAAY,CACf,EACG,YAAa,CAChB,EACG,cAAe,CAClB,EACG,eAAgB,CACnB,GAEE,QAAW,SACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,uBAAwB,CACvB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,EACG,KAAM,CACT,GAEE,QAAW,OACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,uBAAwB,CACvB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,EACG,KAAM,CACT,GAEE,QAAW,OACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,0BAA2B,CAC1B,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,EACG,iBAAkB,CACrB,EACG,KAAM,CACT,GAEE,QAAW,OACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,aAAc,CACb,KAAM,YACN,QAAW,GACX,UACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,YAAa,CACZ,KAAM,QACN,MAAO,SACP,QAAW,CACV,oBACA,4BAED,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,YAAa,CACZ,KAAM,SACN,QAAW,GACX,QAAS,EACT,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,GACX,QAAS,EACT,MAAO,MACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,mBAAoB,CACnB,KAAM,SACN,QAAW,IACX,MAAO,MACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,sBAAuB,CACtB,KAAM,SACN,QAAW,EACX,MAAO,MACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,eAAgB,CACf,KAAM,OACN,OAAQ,CACP,KAAM,CACT,EACG,KAAM,CACT,EACG,OAAQ,CACX,EACG,MAAO,CACV,GAEE,QAAW,SACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,qBAAsB,CACrB,KAAM,SACN,MAAO,MACP,QAAW,EACX,SAAU,CACT,cAED,gBAAiB,cACjB,WAAY,CACX,gBACA,WAAY,CACX,OACA,aAIH,uBAAwB,CACvB,KAAM,QACN,MAAO,OACP,OAAQ,CACP,OAAQ,CACX,EACG,KAAM,CACT,EACG,MAAO,CACV,EACG,IAAK,CACR,EACG,OAAQ,CACX,EACG,WAAY,CACf,EACG,YAAa,CAChB,EACG,cAAe,CAClB,EACG,eAAgB,CACnB,GAEE,SAAU,CACT,aACA,CACC,mBAAoB,CACnB,WAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,8BAA+B,CAC9B,KAAM,iCACN,SAAU,CACT,aACA,CACC,mBAAoB,CACnB,WAIH,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,OACN,OAAQ,CACP,OAAQ,CACX,EACG,KAAM,CACT,EACG,MAAO,CACV,EACG,IAAK,CACR,EACG,OAAQ,CACX,EACG,WAAY,CACf,EACG,YAAa,CAChB,EACG,cAAe,CAClB,EACG,eAAgB,CACnB,GAEE,QAAW,SACX,SAAU,CACT,aACA,CACC,IAAK,yBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,GACX,MAAO,UACP,SAAU,CACT,aACA,CACC,mBAAoB,CACnB,OACA,iBAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,oBAAqB,CACpB,KAAM,QACN,MAAO,OACP,OAAQ,CACP,WAAY,CACf,EACG,SAAU,CACb,GAEE,SAAU,CACT,aACA,CACC,mBAAoB,CACnB,WAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,OAAQ,IACR,MAAO,UACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,oBAAqB,CACpB,KAAM,UACN,WACA,SAAU,CACT,aACA,CACC,0BAA2B,OAE5B,CACC,mBAAoB,CACnB,OACA,iBAIH,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,iBAAkB,CACjB,KAAM,OACN,OAAQ,CACP,KAAM,CACT,EACG,UAAW,CACd,EACG,UAAW,CACd,GAEE,QAAW,OACX,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,QACN,MAAO,SACP,MAAO,MACP,OAAQ,EACR,QAAW,CACV,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ACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAo8CD,IAj8CS,CACT,YAAa,CACZ,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,gBAAiB,CAChB,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,YAAa,CACZ,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,mBAAoB,CACnB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,oBAAqB,CACpB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,oBAAqB,CACpB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,mBAAoB,CACnB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAu2CD,QAp2Ca,CACb,OAAQ,CACP,KAAM,SACN,aAED,aAAc,CACb,KAAM,SACN,QAAS,EACT,QAAW,IA61CZ,WA11CgB,CAChB,KAAM,CACL,KAAM,uBACN,QAAW,WACX,gBAAiB,gBACjB,cACA,WAAY,CACX,gBACA,WAAY,CACX,WAk1CH,MA70CW,CACX,aACA,aACA,eACA,gBACA,uBACA,eACA,eACA,kBACA,qBACA,oBAo0CA,WAl0CgB,CAChB,iBAAkB,CACjB,KAAM,UACN,WACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,qBAAsB,CACrB,KAAM,QACN,cACA,SAAU,CACT,CACC,IAAK,gBAEN,CACC,sBAGF,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,4BA+sClB,uBAAwB,CACxB,yBAA0B,CACzB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,uBAAwB,CACvB,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,2BAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,2BAA4B,CAC3B,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,kCAAmC,CAClC,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,4BAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,yBAA0B,CACzB,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,wBAAyB,CACxB,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,SACP,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,sBAAuB,CACtB,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,SACP,cACA,SAAU,CACT,yBAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,mCAAoC,CACnC,KAAM,UACN,WACA,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAGlB,WAh1CgB,CAChB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,aAAc,CACb,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,YAAa,CACZ,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,QAAS,EACT,cACA,MAAO,cACP,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,eAAgB,CACf,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,gBAAiB,CAChB,KAAM,QACN,cACA,SAAU,CACT,CACC,IAAK,kBAEN,CACC,IAAK,gBAEN,CACC,OAAQ,UACR,IAAK,CACJ,kBAIH,WAAY,CACX,gBACA,WAAY,CACX,kBAGF,gBAAiB,eAipClB,aA9oCkB,CAClB,gBAAiB,CAChB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,eAAgB,CACf,KAAM,QACN,QAAW,UACX,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,mBAAoB,CACnB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,0BAA2B,CAC1B,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,oBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,qBAAsB,CACrB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,yBAA0B,CACzB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,WACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,sBAAuB,CACtB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,sBAAuB,CACtB,KAAM,QACN,QAAW,UACX,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,wBAAyB,CACxB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,gBA89BlB,cA39BmB,CACnB,iBAAkB,CACjB,KAAM,SACN,QAAW,GACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,oBAAqB,CACpB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,gBAAiB,CAChB,KAAM,QACN,QAAW,CACV,cACA,CACC,UAED,CACC,mBAED,EACA,qBACA,GACA,YACA,GACA,OACA,GACA,OACA,GACA,SACA,EACA,OAED,cACA,WAAY,CACX,gBACA,WAAY,CACX,oBAGF,gBAAiB,cAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAm4BlB,aAh4BkB,CAClB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,QACN,QAAW,mBACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,aACA,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,eACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,QACN,QAAW,mBACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CACR,EACG,SAAU,CACb,GAEE,QAAW,MACX,SAAU,CACT,aACA,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAunBlB,aApnBkB,CAClB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,oBAAqB,CACpB,KAAM,SACN,QAAW,EACX,OAAQ,IACR,cACA,MAAO,UACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,oBAAqB,CACpB,KAAM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vB,CAAC,KAAM,UAAW,WAAY,EAAG,KAAM,gBEtH3C,IAAA,GAAe,GCAR,MAAM,GAA2B,CACpC,IAAK,IACL,IAAK,IACL,EAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,KAAM,IACN,IAAK,IACL,IAAK,IACL,EAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KC/CH,GAEF,CACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,QACA,QACA,QACA,SAOE,GAEF,CACA,OAGJ,SAAS,GACL,EACA,EACA,EAKA,EACA,EACA,GAEA,GAAI,cAAe,EAAS,CACxB,MAAM,EAAY,EAAS,EAAQ,WAC7B,EAAQ,GAAa,EAAU,GACrC,OAAK,EACE,EAAM,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CACX,gBACA,WAAY,CACX,UAIH,SAAU,CACT,KAAM,QACN,QAAW,CACV,KACA,IACA,IAED,OAAQ,EACR,MAAO,SACP,gBAAiB,gBACjB,cACA,WAAY,CACX,gBACA,WAAY,CACX,UAIH,MAAO,CACN,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,UAAW,CACV,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAo8CD,IAj8CS,CACT,YAAa,CACZ,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,gBAAiB,CAChB,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,YAAa,CACZ,KAAM,QACN,gBAAiB,gBACjB,QAAW,UACX,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,mBAAoB,CACnB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,oBAAqB,CACpB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,oBAAqB,CACpB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,eAED,mBAAoB,CACnB,KAAM,SACN,gBAAiB,gBACjB,QAAW,GACX,QAAS,EACT,QAAS,EACT,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAu2CD,QAp2Ca,CACb,OAAQ,CACP,KAAM,SACN,aAED,aAAc,CACb,KAAM,SACN,QAAS,EACT,QAAW,IA61CZ,WA11CgB,CAChB,KAAM,CACL,KAAM,uBACN,QAAW,WACX,gBAAiB,gBACjB,cACA,WAAY,CACX,gBACA,WAAY,CACX,WAk1CH,MA70CW,CACX,aACA,aACA,eACA,gBACA,uBACA,eACA,eACA,kBACA,qBACA,oBAo0CA,WAl0CgB,CAChB,iBAAkB,CACjB,KAAM,UACN,WACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,qBAAsB,CACrB,KAAM,QACN,cACA,SAAU,CACT,CACC,IAAK,gBAEN,CACC,sBAGF,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CAAC,EAEN,SAAU,CAAC,GAGZ,QAAW,MACX,SAAU,CACT,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,4BA+sClB,uBAAwB,CACxB,yBAA0B,CACzB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,uBAAwB,CACvB,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,2BAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,2BAA4B,CAC3B,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,kCAAmC,CAClC,KAAM,OACN,OAAQ,CACP,IAAK,CAAC,EAEN,SAAU,CAAC,GAGZ,QAAW,MACX,SAAU,CACT,4BAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,yBAA0B,CACzB,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,wBAAyB,CACxB,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,SACP,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,sBAAuB,CACtB,KAAM,SACN,QAAW,EACX,QAAS,EACT,MAAO,SACP,cACA,SAAU,CACT,yBAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,mCAAoC,CACnC,KAAM,UACN,WACA,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAGlB,WAh1CgB,CAChB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CAAC,EAEN,SAAU,CAAC,GAGZ,QAAW,MACX,SAAU,CACT,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,aAAc,CACb,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,YAAa,CACZ,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,QAAS,EACT,cACA,MAAO,cACP,SAAU,CACT,CACC,IAAK,iBAGP,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,eAAgB,CACf,KAAM,gBACN,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,YAGF,gBAAiB,2BAElB,gBAAiB,CAChB,KAAM,QACN,cACA,SAAU,CACT,CACC,IAAK,kBAEN,CACC,IAAK,gBAEN,CACC,OAAQ,UACR,IAAK,CACJ,kBAIH,WAAY,CACX,gBACA,WAAY,CACX,kBAGF,gBAAiB,eAipClB,aA9oCkB,CAClB,gBAAiB,CAChB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,eAAgB,CACf,KAAM,QACN,QAAW,UACX,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,cAAe,CACd,KAAM,SACN,QAAW,EACX,cACA,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,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B,oBAAqB,CACpB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,gBAAiB,CAChB,KAAM,QACN,QAAW,CACV,cACA,CACC,UAED,CACC,mBAED,EACA,qBACA,GACA,YACA,GACA,OACA,GACA,OACA,GACA,SACA,EACA,OAED,cACA,WAAY,CACX,gBACA,WAAY,CACX,oBAGF,gBAAiB,cAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAm4BlB,aAh4BkB,CAClB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,QACN,QAAW,mBACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CAAC,EAEN,SAAU,CAAC,GAGZ,QAAW,MACX,SAAU,CACT,aACA,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,eAAgB,CACf,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,aAAc,CACb,KAAM,QACN,QAAW,UACX,cACA,eACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,QACN,QAAW,mBACX,cACA,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,kBAAmB,CAClB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,OACA,UACA,kBAGF,gBAAiB,eAElB,iBAAkB,CACjB,KAAM,QACN,MAAO,SACP,OAAQ,EACR,QAAW,CACV,EACA,GAED,cACA,MAAO,SACP,SAAU,CACT,cAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,wBAAyB,CACxB,KAAM,OACN,OAAQ,CACP,IAAK,CAAC,EAEN,SAAU,CAAC,GAGZ,QAAW,MACX,SAAU,CACT,aACA,kBAED,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,kBAunBlB,aApnBkB,CAClB,iBAAkB,CACjB,KAAM,SACN,QAAW,EACX,QAAS,EACT,QAAS,EACT,cACA,WAAY,CACX,gBACA,WAAY,CACX,SAGF,gBAAiB,iBAElB,oBAAqB,CACpB,KAAM,SACN,QAAW,EACX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B,GAC1E,EAAG,iBAAmB,MAAgB,sBAEvC,I,imyLCv2jBG,EAA2B,CAAC,EAGhC,SAAS,EAAoB,GAE5B,IAAI,EAAe,EAAyB,GAC5C,YAAI,EACH,OAAO,EAAa,QAGrB,IAAI,EAAS,EAAyB,GAAY,CAGjD,QAAS,CAAC,GAOX,OAHA,EAAoB,GAAU,KAAK,EAAO,QAAS,EAAQ,EAAO,QAAS,GAGpE,EAAO,OACf,CCrBA,EAAoB,EAAK,IACxB,IAAI,EAAS,GAAU,EAAO,WAC7B,IAAO,EAAiB,QACxB,IAAM,EAEP,OADA,EAAoB,EAAE,EAAQ,CAAE,EAAG,IAC5B,GCLR,EAAoB,EAAI,CAAC,EAAS,KACjC,IAAI,IAAI,KAAO,EACX,EAAoB,EAAE,EAAY,KAAS,EAAoB,EAAE,EAAS,IAC5E,OAAO,eAAe,EAAS,EAAK,CAAE,cAAkB,IAAK,EAAW,MCJ3E,EAAoB,EAAI,CAAC,EAAK,IAAU,OAAO,UAAU,eAAe,KAAK,EAAK,GCClF,EAAoB,EAAK,IACH,oBAAX,QAA0B,OAAO,aAC1C,OAAO,eAAe,EAAS,OAAO,YAAa,CAAE,MAAO,WAE7D,OAAO,eAAe,EAAS,aAAc,CAAE,UAAO,E,4NptBKvD","file":"/npm/@panoramax/web-viewer@4.4.0/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@panoramax/web-viewer@4.4.0/build/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Panoramax\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Panoramax\"] = factory();\n\telse\n\t\troot[\"Panoramax\"] = factory();\n})(this, () => {\nreturn ","import { LitElement, html } from \"lit\";\nimport API from \"../../utils/API\";\nimport { getTranslations } from \"../../utils/i18n\";\nimport { MapTiles } from \"../../utils/services\";\nimport { createWebComp } from \"../../utils/widgets\";\nimport { isInIframe, isInternetFast } from \"../../utils/utils\";\nimport JSON5 from \"json5\";\nimport PACKAGE_JSON from \"../../../package.json\";\nimport \"@fontsource/atkinson-hyperlegible-next\";\nimport \"./Basic.css\";\n\n/**\n * Event for overlaying menu opening\n * @event Panoramax.components.core.Basic#menu-opened\n * @type {CustomEvent}\n * @property {Element} detail.menu The opened menu\n */\n\n/**\n * Basic core component is a basic container for common functions through all core components.\n * It is not intended to be used directly, it's only to be extended by other core components.\n * @class Panoramax.components.core.Basic\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.core.Basic#select\n * @fires Panoramax.components.core.Basic#ready\n * @fires Panoramax.components.core.Basic#broken\n * @fires Panoramax.components.core.Basic#menu-opened\n * @property {Panoramax.components.ui.Loader} loader The loader screen\n * @property {Panoramax.utils.API} api The API manager\n */\nexport default class Basic extends LitElement {\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.core.Basic#\n\t * @type {Object}\n\t * @mixin\n\t * @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))\n\t * @property {string} [picture] The picture ID to display\n\t * @property {string} [sequence] The sequence ID of the picture displayed\n\t * @property {object} [fetch-options] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n\t * @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as \"geovisio\")\n\t * @property {string|object} [map-style] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.\n\t * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.\n\t */\n\tstatic properties = {\n\t\tpicture: {type: String, reflect: true},\n\t\tsequence: {type: String, reflect: true},\n\t\t\"fetch-options\": {converter: Basic.GetJSONConverter()},\n\t\tusers: {type: Array, reflect: true},\n\t\t\"map-style\": {type: String},\n\t\tlang: {type: String},\n\t\tendpoint: {type: String},\n\t};\n\n\tconstructor(testing = false) {\n\t\tsuper();\n\n\t\t// Some defaults\n\t\tthis.users = [\"geovisio\"];\n\t\tthis[\"map-style\"] = this.getAttribute(\"map-style\") || MapTiles();\n\t\tthis.lang = this.getAttribute(\"lang\") || null;\n\t\tthis.endpoint = this.getAttribute(\"endpoint\") || null; // No default\n\t\tthis.picture = this.getAttribute(\"picture\") || null;\n\t\tthis.sequence = this.getAttribute(\"sequence\") || null;\n\n\t\t// Display version in logs\n\t\tconsole.info(`📷 Panoramax ${this.getClassName()} - Version ${PACKAGE_JSON.version} (${__COMMIT_HASH__})\n\n🆘 Issues can be reported at ${PACKAGE_JSON.repository.url}`);\n\n\t\tif(testing) { return; }\n\n\t\t// Internet speed check\n\t\tthis._isInternetFast = null;\n\t\tisInternetFast().then(isFast => this._isInternetFast = isFast);\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\t// Translations\n\t\tthis._t = getTranslations(this.lang);\n\n\t\t// Show loader\n\t\tthis.loader = createWebComp(\"pnx-loader\", {_parent: this, \"no-label\": isInIframe() });\n\n\t\tif(\n\t\t\t!(this._loadsAPI && this.endpoint && this._loadsAPI === this.endpoint)\n\t\t\t&& !(this.api && this.api._endpoint === this.endpoint)\n\t\t\t&& this.endpoint\n\t\t) {\n\t\t\tif(this._loadsAPI || this.api) {\n\t\t\t\tdelete this.api;\n\t\t\t\tdelete this._loadsAPI;\n\t\t\t}\n\t\t\tthis._setupAPI();\n\t\t}\n\n\t\t// Warn for outdate attributes\n\t\tObject\n\t\t\t.entries({ map: \"map-options\", psv: \"psv-options\", fetchOptions: \"fetch-options\", mapstyle: \"map-style\"})\n\t\t\t.forEach(([k, v]) => {\n\t\t\t\tif(this.getAttribute(k)) {\n\t\t\t\t\tconsole.error(`Component attribute \"${k}\" has been renamed into \"${v}\". Old attribute \"${k}\" is ignored.`);\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\tif(isInIframe()) { this.classList.add(\"pnx-iframed\"); }\n\t}\n\n\t/**\n\t * Creates API and wait for initial loading\n\t * @private\n\t */\n\t_setupAPI() {\n\t\t// Loader init\n\t\tthis.loader = this.loader || createWebComp(\"pnx-loader\", {_parent: this});\n\n\t\tif(!this.endpoint) {\n\t\t\tconsole.warn(\"No endpoint is defined\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis._loadsAPI = this.endpoint;\n\t\tlet myLoadAPI = this.endpoint;\n\n\t\t// Check if mapstyle is not a unparsed JSON\n\t\ttry {\n\t\t\tthis[\"map-style\"] = JSON.parse(this[\"map-style\"]);\n\t\t} catch(e) { /* empty */ }\n\t\t\n\t\t// API init\n\t\ttry {\n\t\t\tthis.api = new API(this.endpoint, {\n\t\t\t\tusers: this.users,\n\t\t\t\tfetch: this[\"fetch-options\"],\n\t\t\t\tstyle: this[\"map-style\"],\n\t\t\t});\n\t\t\tthis.api.onceReady()\n\t\t\t\t.then(() => {\n\t\t\t\t\tif(myLoadAPI != this._loadsAPI || !this.api) { return; }\n\n\t\t\t\t\tlet unavailable = this.api.getUnavailableFeatures();\n\t\t\t\t\tlet available = this.api.getAvailableFeatures();\n\t\t\t\t\tavailable = unavailable.length === 0 ? \"✅ All features available\" : \"✅ Available features: \"+available.join(\", \");\n\t\t\t\t\tunavailable = unavailable.length === 0 ? \"\" : \"🚫 Unavailable features: \"+unavailable.join(\", \");\n\t\t\t\t\tconsole.info(`🌐 Connected to API \"${this.api._metadata.name}\" (${this.api._endpoint})\nℹ️ API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version ? \"& GeoVisio \"+this.api._metadata.geovisio_version : \"\"}\n   ${available}\n   ${unavailable}\n`.trim());\n\t\t\t\t})\n\t\t\t\t.catch(e => this.loader.dismiss(e, this._t.pnx.error_api))\n\t\t\t\t.finally(() => delete this._loadsAPI);\n\t\t}\n\t\tcatch(e) {\n\t\t\tdelete this._loadsAPI;\n\t\t\tif(this.loader?.dismiss) {\n\t\t\t\tthis.loader.dismiss(e, this._t.pnx.error_api);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Waits for component to have its first loading done.\n\t * \n\t * Each inheriting class must override this method.\n\t * @memberof Panoramax.components.core.Basic#\n\t * @returns {Promise}\n\t * @fulfil {null} When initialization is complete.\n\t * @reject {string} Error message\n\t */\n\tonceReady() {\n\t\tthrow new Error(\"You must override this method on sub-class\");\n\t}\n\n\t/**\n\t * Waits for initial API setup.\n\t * @memberof Panoramax.components.core.Basic#\n\t * @returns {Promise}\n\t * @fulfil {null} When API is ready.\n\t * @reject {string} Error message\n\t */\n\tonceAPIReady() {\n\t\tif(this.api) {\n\t\t\treturn this.api.onceReady();\n\t\t}\n\t\telse {\n\t\t\treturn new Promise(resolve => setTimeout(resolve, 100)).then(this.onceAPIReady.bind(this));\n\t\t}\n\t}\n\n\t/** @private */\n\tcreateRenderRoot() {\n\t\treturn this;\n\t}\n\n\t/** @private */\n\tattributeChangedCallback(name, _old, value) {\n\t\tsuper.attributeChangedCallback(name, _old, value);\n\t\t\n\t\tif(name === \"endpoint\") {\n\t\t\tif(\n\t\t\t\t!(this._loadsAPI && value && this._loadsAPI === value)\n\t\t\t\t&& !(this.api && this.api._endpoint === value)\n\t\t\t\t&& value\n\t\t\t) {\n\t\t\t\tif(this._loadsAPI || this.api) {\n\t\t\t\t\tdelete this.api;\n\t\t\t\t\tdelete this._loadsAPI;\n\t\t\t\t}\n\t\t\t\tthis._setupAPI();\n\t\t\t}\n\t\t}\n\t\tif([\"picture\", \"sequence\"].includes(name)) {\n\t\t\tlet seqId, picId, prevSeqId, prevPicId;\n\n\t\t\tif(name === \"picture\") {\n\t\t\t\tseqId = this.sequence;\n\t\t\t\tprevSeqId = this.sequence;\n\t\t\t\tpicId = value;\n\t\t\t\tprevPicId = _old;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tseqId = value;\n\t\t\t\tprevSeqId = _old;\n\t\t\t\tpicId = this.picture;\n\t\t\t\tprevPicId = this.picture;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Event for sequence/picture selection\n\t\t\t * @event Panoramax.components.core.Basic#select\n\t\t\t * @type {CustomEvent}\n\t\t\t * @property {string} detail.seqId The selected sequence ID\n\t\t\t * @property {string} detail.picId The selected picture ID (or null if not a precise picture clicked)\n\t\t\t * @property {string} [detail.prevSeqId] The previously selected sequence ID (or null if none)\n\t\t\t * @property {string} [detail.prevPicId] The previously selected picture ID (or null if none)\n\t\t\t */\n\t\t\tthis.dispatchEvent(new CustomEvent(\"select\", {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t\tdetail: {\n\t\t\t\t\tseqId,\n\t\t\t\t\tpicId,\n\t\t\t\t\tprevSeqId,\n\t\t\t\t\tprevPicId,\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t}\n\n\t/**\n\t * This allows to retrieve an always correct class name.\n\t * This is crap, but avoids issues with Webpack & so on.\n\t * \n\t * Each inheriting class must override this method.\n\t * @returns {string} The class name (for example \"Basic\")\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\tgetClassName() {\n\t\treturn \"Basic\";\n\t}\n\n\t/**\n\t * Change the currently picture and/or sequence.\n\t * Calling the method without parameters unselects.\n\t * @param {string} [seqId] The sequence UUID\n\t * @param {string} [picId] The picture UUID\n\t * @param {boolean} [force=false] Force select even if already selected\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\tselect(seqId = null, picId = null, force = false) {\n\t\tif(force) {\n\t\t\tthis.picture = null;\n\t\t\tthis.sequence = null;\n\t\t}\n\t\tthis.picture = picId;\n\t\tthis.sequence = seqId;\n\t}\n\n\t/**\n\t * Is the view running in a small container (small embed or smartphone)\n\t * @returns {boolean} True if container is small\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\tisWidthSmall() {\n\t\treturn this?.offsetWidth < 576;\n\t}\n\n\t/**\n\t * Is the view running in a small-height container (small embed or smartphone)\n\t * @returns {boolean} True if container height is small\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\tisHeightSmall() {\n\t\treturn this?.offsetHeight < 400;\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`;\n\t}\n\n\t/**\n\t * List names of sub-components (like loader, api, map, psv) available in this component.\n\t * @returns {string[]} Sub-components names.\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\tgetSubComponentsNames() {\n\t\treturn [\"loader\", \"api\"];\n\t}\n\n\t/**\n\t * Listen to events from this components or one of its sub-components.\n\t * \n\t * For example, you can listen to `map` events using prefix `map:`.\n\t * \n\t * ```js\n\t * me.addEventListener(\"map:move\", doSomething);\n\t * ```\n\t * @param {string} type The event type to listen for\n\t * @param {function} listener The event handler\n\t * @param {object} [options] [Any original addEventListener available options](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#options)\n\t * @memberof Panoramax.components.core.Basic#\n\t */\n\taddEventListener(type, listener, options) {\n\t\t// Check if listener is for sub-component\n\t\tlet prefix = type.split(\":\").shift();\n\t\tif(prefix && this.getSubComponentsNames().includes(prefix)) {\n\t\t\tconst subType = type.substring(prefix.length+1);\n\n\t\t\t// Add directly if available\n\t\t\tif(this[prefix]?.addEventListener) {\n\t\t\t\tthis[prefix].addEventListener(subType, listener, options);\n\t\t\t}\n\t\t\t// Wait for addEventListener to be available\n\t\t\telse {\n\t\t\t\tsetTimeout(() => this.addEventListener(type, listener, options), 50);\n\t\t\t}\n\t\t}\n\t\t// Otherwise, reuse classic function\n\t\telse {\n\t\t\tsuper.addEventListener(type, listener, options);\n\t\t}\n\t}\n\n\t/** @private */\n\tstatic GetJSONConverter() {\n\t\treturn {\n\t\t\tfromAttribute: (value) => {\n\t\t\t\tif(value === null || value === \"\") { return null; }\n\t\t\t\telse if(typeof value === \"object\" || Array.isArray(value)) { return value; }\n\t\t\t\telse { return JSON5.parse(value); }\n\t\t\t},\n\t\t\ttoAttribute: (value) => {\n\t\t\t\tif(value === null || value === \"\") { return \"\"; }\n\t\t\t\telse if(typeof value === \"string\") { return value; }\n\t\t\t\telse { return JSON5.stringify(value); }\n\t\t\t}\n\t\t};\n\t}\n}\n","import Basic from \"./Basic\";\nimport Map from \"../ui/Map\";\nimport { getUserLayerId } from \"../../utils/map\";\nimport { NavigationControl } from \"!maplibre-gl\"; // DO NOT REMOVE THE \"!\": bundled builds breaks otherwise !!!\nimport \"./CoverageMap.css\";\nimport { default as InitParameters, alterMapState } from \"../../utils/InitParameters\";\n\n\n/**\n * Coverage Map is a basic map showing Panoramax coverage.\n * \n * Make sure to set width/height through CSS for proper display.\n * @class Panoramax.components.core.CoverageMap\n * @element pnx-coverage-map\n * @extends Panoramax.components.core.Basic\n * @fires Panoramax.components.core.Basic#select\n * @fires Panoramax.components.core.Basic#ready\n * @fires Panoramax.components.core.Basic#broken\n * @property {Panoramax.components.ui.Loader} loader The loader screen\n * @property {Panoramax.utils.API} api The API manager\n * @property {Panoramax.components.ui.Map} map The MapLibre GL map itself\n * @example\n * ```html\n * <pnx-coverage-map\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   map-options='{\"bounds\": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'\n *   style=\"width: 300px; height: 250px\"\n * />\n * ```\n */\nexport default class CoverageMap extends Basic {\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.core.CoverageMap#\n\t * @type {Object}\n\t * @mixes Panoramax.components.core.Basic#properties\n\t * @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))\n\t * @property {string} [picture] The picture ID to display\n\t * @property {string} [sequence] The sequence ID of the picture displayed\n\t * @property {object} [fetch-options] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n\t * @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as \"geovisio\")\n\t * @property {string|object} [map-style] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.\n\t * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.\n\t * @property {object} [map-options] [Any map option available in Map class](#Panoramax.components.ui.Map).<br />Example: `map-options='{\"bounds\": [[-73.9876, 40.7661], [-73.9397, 40.8002]]}'`\n\t */\n\tstatic properties = {\n\t\t\"map-options\": {converter: Basic.GetJSONConverter()},\n\t\t...Basic.properties\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._mapContainer = document.createElement(\"div\");\n\t\tthis.onceAPIReady().then(() => {\n\t\t\tthis.loader.setAttribute(\"value\", 30);\n\t\t\tthis._initParams = new InitParameters(InitParameters.GetComponentProperties(CoverageMap, this));\n\t\t\tthis._initMap();\n\t\t});\n\t}\n\n\t/** @private */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.map?.destroy();\n\t}\n\n\tgetClassName() {\n\t\treturn \"CoverageMap\";\n\t}\n\n\tonceReady() {\n\t\tif(this.map && this.map.waitForEnoughMapLoaded) {\n\t\t\treturn this.map.waitForEnoughMapLoaded();\n\t\t}\n\t\telse {\n\t\t\treturn new Promise(resolve => setTimeout(resolve, 100)).then(this.onceReady.bind(this));\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn [this.loader, this._mapContainer];\n\t}\n\n\tgetSubComponentsNames() {\n\t\tconst scn = super.getSubComponentsNames();\n\t\tscn.push(\"map\");\n\t\treturn scn;\n\t}\n\n\t/**\n\t * Creates map object\n\t * @private\n\t */\n\t_initMap() {\n\t\tthis.map = new Map(this, this._mapContainer, Object.assign({}, this._initParams.getMapInit(), { hash: true }));\n\t\tthis.map.addControl(new NavigationControl({ showCompass: false }));\n\t\tthis.loader.setAttribute(\"value\", 70);\n\n\t\tthis.addEventListener(\"select\", this._onSelect.bind(this));\n\t\tthis.map.on(\"picture-click\", e => this.select(e.seqId, e.picId));\n\t\tthis.map.on(\"sequence-click\", e => this.select(e.seqId));\n\n\t\tthis.map.waitForEnoughMapLoaded().then(async () => {\n\t\t\tawait alterMapState(this.map, this._initParams.getMapPostInit());\n\t\t\tthis.map.reloadLayersStyles();\n\t\t\tthis.loader.dismiss();\n\t\t});\n\t}\n\n\t/**\n\t * Select event handler\n\t * @private\n\t * @param {object} e Event details\n\t */\n\t_onSelect(e) {\n\t\t// Move thumbnail to match selected element\n\t\tif(e.detail.picId || e.detail.seqId) {\n\t\t\tconst layer = e.detail.picId ? \"pictures\" : \"sequences\";\n\t\t\tconst features = this.map.queryRenderedFeatures({\n\t\t\t\tlayers: [...this.map._userLayers].map(l => getUserLayerId(l, layer)),\n\t\t\t\tfilter: [\"==\", [\"get\", \"id\"], e.detail.picId || e.detail.seqId]\n\t\t\t});\n\n\t\t\tif(features.length >= 0 && features[0] != null) {\n\t\t\t\tthis.map._attachPreviewToPictures({ features }, layer);\n\t\t\t}\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-coverage-map\", CoverageMap);\n","/* eslint-disable no-unused-vars */\nimport \"./Editor.css\";\nimport Basic from \"./Basic\";\nimport Map from \"../ui/Map\";\nimport Photo from \"../ui/Photo\";\nimport { apiFeatureToPSVNode } from \"../../utils/picture\";\nimport { linkMapAndPhoto } from \"../../utils/map\";\nimport { VECTOR_STYLES_NOCROWD as VECTOR_STYLES } from \"../../utils/map\";\nimport { SYSTEM as PSSystem } from \"@photo-sphere-viewer/core\";\nimport { createWebComp } from \"../../utils/widgets\";\n\nconst LAYER_HEADING_ID = \"sequence-headings\";\n\n/**\n * Editor allows to focus on a single sequence, and preview what you edits would look like.\n * It shows both picture and map.\n * \n * Make sure to set width/height through CSS for proper display.\n * \n * This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.\n * @class Panoramax.components.core.Editor\n * @element pnx-editor\n * @extends Panoramax.components.core.Basic\n * @fires Panoramax.components.core.Basic#select\n * @fires Panoramax.components.core.Basic#ready\n * @fires Panoramax.components.core.Basic#broken\n * @property {Panoramax.components.ui.Loader} loader The loader screen\n * @property {Panoramax.utils.API} api The API manager\n * @property {Panoramax.components.ui.Map} map The MapLibre GL map itself\n * @property {Panoramax.components.ui.Photo} psv The Photo Sphere Viewer component itself\n * @property {Panoramax.components.layout.CorneredGrid} grid The grid layout manager\n * @slot `top-left` The top-left corner\n * @slot `top` The top middle corner\n * @slot `top-right` The top-right corner\n * @slot `bottom-left` The bottom-left corner\n * @slot `bottom` The bottom middle corner\n * @slot `bottom-right` The bottom-right corner\n * @example\n * ```html\n * <!-- Basic example -->\n * <pnx-editor\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * />\n * \n * <!-- With slotted widgets -->\n * <pnx-editor\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * >\n *   <p slot=\"top-right\">My custom text</p>\n * </pnx-editor>\n * ```\n */\nexport default class Editor extends Basic {\n\t/**\n\t * Component properties. All of [Basic properties](#Panoramax.components.core.Basic+properties) are available as well.\n\t * @memberof Panoramax.components.core.Editor#\n\t * @mixes Panoramax.components.core.Basic#properties\n\t * @type {Object}\n\t * @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))\n\t * @property {string} [picture] The picture ID to display\n\t * @property {string} [sequence] The sequence ID of the picture displayed\n\t * @property {object} [fetch-options] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n\t * @property {string|object} [map-style] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.\n\t * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.\n\t * @property {object} [raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).\n\t * @property {string} [background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.\n\t */\n\tstatic properties = {\n\t\traster: {converter: Basic.GetJSONConverter()},\n\t\tbackground: {type: String},\n\t\t...Basic.properties\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.raster = null;\n\t\tthis.background = \"streets\";\n\t\tthis.users = []; // Avoid default map data showing up\n\n\t\t// Create sub-containers\n\t\tthis._psvContainer = document.createElement(\"div\");\n\t\tthis._psvContainer.setAttribute(\"slot\", \"bg\");\n\t\tthis._mapContainer = document.createElement(\"div\");\n\t\tthis._mapContainer.setAttribute(\"slot\", \"bg\");\n\n\t\tthis.grid = createWebComp(\"pnx-cornered-grid\");\n\t\tthis.grid.appendChild(this._psvContainer);\n\t\tthis.grid.appendChild(this._mapContainer);\n\n\t\tthis.onceAPIReady().then(() => {\n\t\t\tthis.loader.setAttribute(\"value\", 30);\n\n\t\t\t// Check sequence ID is set\n\t\t\tif(!this.sequence) { this.loader.dismiss({}, \"No sequence is selected\"); }\n\n\t\t\t// Events\n\t\t\tthis.addEventListener(\"select\", this._onSelect.bind(this));\n\n\t\t\tthis._initPSV();\n\t\t\tthis._initMap();\n\t\t});\n\t}\n\n\t/** @private */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.map?.destroy();\n\t\tthis.psv?.destroy();\n\t}\n\n\tgetClassName() {\n\t\treturn \"Editor\";\n\t}\n\n\tonceReady() {\n\t\tif(this.map && this.psv && this.map.loaded?.()) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\telse {\n\t\t\treturn new Promise(resolve => setTimeout(resolve, 100)).then(this.onceReady.bind(this));\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tif(Array.isArray(this.users) && this.users.length > 0) {\n\t\t\tconsole.warn(\"Parameters users can't be changed in Editor, only selected sequence can be visible\");\n\t\t\tthis.users = [];\n\t\t}\n\t\tsuper.connectedCallback();\n\n\t\tthis._moveChildToGrid();\n\t\twindow.addEventListener(\"DOMContentLoaded\", () => {\n\t\t\tthis._moveChildToGrid();\n\t\t}, { once: true });\n\t}\n\n\tattributeChangedCallback(name, old, value) {\n\t\tif(name === \"users\" && Array.isArray(value) && value.length > 0) {\n\t\t\tconsole.warn(\"Parameters users can't be changed in Editor, only selected sequence can be visible\");\n\t\t}\n\t\telse {\n\t\t\tsuper.attributeChangedCallback(name, old, value);\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn [this.loader, this.grid];\n\t}\n\n\tgetSubComponentsNames() {\n\t\treturn super.getSubComponentsNames().concat([\"map\", \"psv\", \"grid\"]);\n\t}\n\n\t/** @private */\n\t_initPSV() {\n\t\ttry {\n\t\t\tthis.psv = new Photo(this, this._psvContainer);\n\t\t\tthis.psv._myVTour.datasource.nodeResolver = this._getNode.bind(this);\n\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-player\", {\n\t\t\t\tslot: \"top\",\n\t\t\t\t_parent: this,\n\t\t\t\tclass: \"pnx-only-psv pnx-print-hidden\",\n\t\t\t\tsize: \"xl\",\n\t\t\t\tmore: \"never\"\n\t\t\t}));\n\t\t}\n\t\tcatch(e) {\n\t\t\tlet err = !PSSystem.isWebGLSupported ? this._t.pnx.error_webgl : this._t.pnx.error_psv;\n\t\t\tthis.loader.dismiss(e, err);\n\t\t}\n\t}\n\n\t/** @private */\n\t_initMap() {\n\t\ttry {\n\t\t\tthis.map = new Map(this, this._mapContainer, {\n\t\t\t\traster: this.raster,\n\t\t\t\tbackground: this.background,\n\t\t\t\tsupplementaryStyle: this._createMapStyle(),\n\t\t\t\tzoom: 15, // Hack to avoid _initMapPosition call\n\t\t\t\tpicMarkerDraggable: true,\n\t\t\t});\n\t\t\tlinkMapAndPhoto(this);\n\t\t\tthis.loader.setAttribute(\"value\", 50);\n\t\t\tthis._loadSequence();\n\t\t\tthis.map.once(\"load\", () => {\n\t\t\t\tif(this.map.hasTwoBackgrounds()) { this._addMapBackgroundWidget(); }\n\t\t\t\tthis._bindPicturesEvents();\n\t\t\t});\n\n\t\t\t// Override picMarker setRotation for heading preview\n\t\t\tconst oldRot = this.map._picMarker.setRotation.bind(this.map._picMarker);\n\t\t\tthis.map._picMarker.setRotation = h => {\n\t\t\t\th = this._lastRelHeading === undefined ? h : h + this._lastRelHeading - this.psv.getPictureRelativeHeading();\n\t\t\t\treturn oldRot(h);\n\t\t\t};\n\t\t}\n\t\tcatch(e) {\n\t\t\tthis.loader.dismiss(e, this._t.pnx.error_psv);\n\t\t}\n\t}\n\n\t/**\n\t * Create style for GeoJSON sequence data.\n\t * @private\n\t */\n\t_createMapStyle() {\n\t\treturn {\n\t\t\tsources: {\n\t\t\t\tgeovisio_editor_sequences: {\n\t\t\t\t\ttype: \"geojson\",\n\t\t\t\t\tdata: {\"type\": \"FeatureCollection\", \"features\": [] }\n\t\t\t\t}\n\t\t\t},\n\t\t\tlayers: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"geovisio_editor_sequences\",\n\t\t\t\t\t\"type\": \"line\",\n\t\t\t\t\t\"source\": \"geovisio_editor_sequences\",\n\t\t\t\t\t\"layout\": {\n\t\t\t\t\t\t...VECTOR_STYLES.SEQUENCES.layout\n\t\t\t\t\t},\n\t\t\t\t\t\"paint\": {\n\t\t\t\t\t\t...VECTOR_STYLES.SEQUENCES.paint\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"geovisio_editor_pictures\",\n\t\t\t\t\t\"type\": \"circle\",\n\t\t\t\t\t\"source\": \"geovisio_editor_sequences\",\n\t\t\t\t\t\"layout\": {\n\t\t\t\t\t\t...VECTOR_STYLES.PICTURES.layout\n\t\t\t\t\t},\n\t\t\t\t\t\"paint\": {\n\t\t\t\t\t\t...VECTOR_STYLES.PICTURES.paint\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\t}\n\n\t/**\n\t * Creates events handlers on pictures layer\n\t * @private\n\t */\n\t_bindPicturesEvents() {\n\t\t// Pictures events\n\t\tthis.map.on(\"mousemove\", \"geovisio_editor_pictures\", () => {\n\t\t\tthis.map.getCanvas().style.cursor = \"pointer\";\n\t\t});\n\n\t\tthis.map.on(\"mouseleave\", \"geovisio_editor_pictures\", () => {\n\t\t\tthis.map.getCanvas().style.cursor = \"\";\n\t\t});\n\n\t\tthis.map.on(\"click\", \"geovisio_editor_pictures\", this.map._onPictureClick.bind(this.map));\n\t}\n\n\t/**\n\t * Displays currently selected sequence on map\n\t * @private\n\t */\n\t_loadSequence() {\n\t\tthis.loader.setAttribute(\"value\", 60);\n\t\treturn this.api.getSequenceItems(this.sequence).then(seq => {\n\t\t\tthis.loader.setAttribute(\"value\", 80);\n\n\t\t\t// Hide loader after source load\n\t\t\tthis.map.once(\"sourcedata\", () => {\n\t\t\t\tthis.map.setPaintProperty(\"geovisio_editor_sequences\", \"line-color\", this.map._getLayerColorStyle(\"sequences\"));\n\t\t\t\tthis.map.setPaintProperty(\"geovisio_editor_pictures\", \"circle-color\", this.map._getLayerColorStyle(\"pictures\"));\n\t\t\t\tthis.map.setLayoutProperty(\"geovisio_editor_sequences\", \"visibility\", \"visible\");\n\t\t\t\tthis.map.setLayoutProperty(\"geovisio_editor_pictures\", \"visibility\", \"visible\");\n\t\t\t\tthis.map.once(\"styledata\", () => this.loader.dismiss());\n\t\t\t});\n\n\t\t\t// Create data source\n\t\t\tthis._sequenceData = seq.features;\n\t\t\tthis.map.getSource(\"geovisio_editor_sequences\").setData({\n\t\t\t\t\"type\": \"FeatureCollection\",\n\t\t\t\t\"features\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": this.sequence,\n\t\t\t\t\t\t\"type\": \"Feature\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"id\": this.sequence,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"geometry\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"type\": \"LineString\",\n\t\t\t\t\t\t\t\"coordinates\": seq.features.map(p => p.geometry.coordinates)\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t...seq.features.map(f => {\n\t\t\t\t\t\tf.properties.id = f.id;\n\t\t\t\t\t\tf.properties.sequences = [this.sequence];\n\t\t\t\t\t\treturn f;\n\t\t\t\t\t})\n\t\t\t\t]\n\t\t\t});\n\n\t\t\t// Select picture if any\n\t\t\tif(this.picture) {\n\t\t\t\tconst pic = seq.features.find(p => p.id === this.picture);\n\t\t\t\tif(pic) {\n\t\t\t\t\tthis.select(this.sequence, this.picture, true);\n\t\t\t\t\tthis.map.jumpTo({ center: pic.geometry.coordinates, zoom: 18 });\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Picture with ID\", pic, \"was not found\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Show area of sequence otherwise\n\t\t\telse {\n\t\t\t\tconst bbox = [\n\t\t\t\t\t...seq.features[0].geometry.coordinates,\n\t\t\t\t\t...seq.features[0].geometry.coordinates\n\t\t\t\t];\n\n\t\t\t\tfor(let i=1; i < seq.features.length; i++) {\n\t\t\t\t\tconst c = seq.features[i].geometry.coordinates;\n\t\t\t\t\tif(c[0] < bbox[0]) { bbox[0] = c[0]; }\n\t\t\t\t\tif(c[1] < bbox[1]) { bbox[1] = c[1]; }\n\t\t\t\t\tif(c[0] > bbox[2]) { bbox[2] = c[0]; }\n\t\t\t\t\tif(c[1] > bbox[3]) { bbox[3] = c[1]; }\n\t\t\t\t}\n\n\t\t\t\tthis.map.fitBounds(bbox, {animate: false});\n\t\t\t}\n\t\t}).catch(e => this.loader.dismiss(e, this._t.pnx.error_api));\n\t}\n\n\t/**\n\t * Get the PSV node for wanted picture.\n\t * \n\t * @param {string} picId The picture ID\n\t * @returns The PSV node\n\t * @private\n\t */\n\t_getNode(picId) {\n\t\tconst f = this._sequenceData.find(f => f.properties.id === picId);\n\t\tconst n = f ? apiFeatureToPSVNode(f, this._t, this._isInternetFast, undefined, u => this.api.cleanResourceURL(u)) : null;\n\t\tif(n) { delete n.links; }\n\t\treturn n;\n\t}\n\n\t/**\n\t * Creates the widget to switch between aerial and streets imagery\n\t * @private\n\t */\n\t_addMapBackgroundWidget() {\n\t\t// Container\n\t\tconst pnlLayers = createWebComp(\"pnx-map-background\", {_parent: this, size: \"sm\", slot: \"bottom-left\"});\n\t\tthis.grid.appendChild(pnlLayers);\n\t}\n\n\t/** @private */\n\t_moveChildToGrid() {\n\t\tconst slotContent = Array.from(this.querySelectorAll(\"[slot]\"));\n\n\t\tslotContent.forEach(n => {\n\t\t\t// Add parent + translation for our components\n\t\t\tif(n.tagName?.toLowerCase().startsWith(\"pnx-\")) {\n\t\t\t\tn._parent = this;\n\t\t\t\tn._t = this._t;\n\t\t\t}\n\n\t\t\tthis.grid.appendChild(n);\n\t\t});\n\t}\n\n\t/**\n\t * Preview on map how the new relative heading would reflect on all pictures.\n\t * This doesn't change anything on API-side, it's just a preview.\n\t * @memberof Panoramax.components.core.Editor#\n\t * @param {number} [relHeading] The new relative heading compared to sequence path. In degrees, between -180 and 180 (0 = front, -90 = left, 90 = right). Set to null to remove preview.\n\t */\n\tpreviewSequenceHeadingChange(relHeading) {\n\t\tconst layerExists = this.map.getLayer(LAYER_HEADING_ID) !== undefined;\n\t\tthis.map._picMarkerPreview.remove();\n\n\t\t// If no value set, remove layer\n\t\tif(relHeading === undefined) {\n\t\t\tdelete this._lastRelHeading;\n\t\t\tif(layerExists) {\n\t\t\t\tthis.map.setLayoutProperty(LAYER_HEADING_ID, \"visibility\", \"none\");\n\t\t\t}\n\t\t\t// Update selected picture marker\n\t\t\tif(this.picture) {\n\t\t\t\tthis.map._picMarker.setRotation(this.psv.getXY().x);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tthis._lastRelHeading = relHeading;\n\n\t\t// Create preview layer\n\t\tif(!layerExists) {\n\t\t\tthis.map.addLayer({\n\t\t\t\t\"id\": LAYER_HEADING_ID,\n\t\t\t\t\"type\": \"symbol\",\n\t\t\t\t\"source\": \"geovisio_editor_sequences\",\n\t\t\t\t\"layout\": {\n\t\t\t\t\t\"icon-image\": \"pnx-marker\",\n\t\t\t\t\t\"icon-overlap\": \"always\",\n\t\t\t\t\t\"icon-size\": 0.8,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t// Change heading\n\t\tconst currentRelHeading = - this.psv.getPictureRelativeHeading();\n\t\tthis.map.setLayoutProperty(LAYER_HEADING_ID, \"visibility\", \"visible\");\n\t\tthis.map.setLayoutProperty(\n\t\t\tLAYER_HEADING_ID,\n\t\t\t\"icon-rotate\",\n\t\t\t[\"+\", [\"get\", \"view:azimuth\"], currentRelHeading, relHeading ]\n\t\t);\n\n\t\t// Skip selected picture and linestring geom\n\t\tconst filters = [[\"==\", [\"geometry-type\"], \"Point\"]];\n\t\tif(this.picture) { filters.push([\"!=\", [\"get\", \"id\"], this.picture]); }\n\t\tthis.map.setFilter(LAYER_HEADING_ID, [\"all\", ...filters]);\n\n\t\t// Update selected picture marker\n\t\tif(this.picture) {\n\t\t\tthis.map._picMarker.setRotation(this.psv.getXY().x);\n\t\t}\n\t}\n\n\t/**\n\t * Event handler for picture loading\n\t * @private\n\t */\n\t_onSelect() {\n\t\t// Update preview of heading change\n\t\tif(this._lastRelHeading !== undefined) {\n\t\t\tthis.previewSequenceHeadingChange(this._lastRelHeading);\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-editor\", Editor);\n","/* eslint-disable import/no-unused-modules */\n/* eslint-disable no-unused-vars */\n\nimport \"./PhotoViewer.css\";\nimport { SYSTEM as PSSystem, DEFAULTS as PSDefaults } from \"@photo-sphere-viewer/core\";\nimport URLHandler from \"../../utils/URLHandler\";\nimport Basic from \"./Basic\";\nimport Photo, { PSV_DEFAULT_ZOOM, PSV_ANIM_DURATION } from \"../ui/Photo\";\nimport { createWebComp } from \"../../utils/widgets\";\nimport { isNullId, isInIframe, DISABLE_ANNOTATIONS_PARAM } from \"../../utils/utils\";\nimport { default as InitParameters, alterPSVState, alterMapState, alterPhotoViewerState } from \"../../utils/InitParameters\";\nimport PresetManager from \"../../utils/PresetsManager\";\n\n\nexport const PSV_ZOOM_DELTA = 20;\nconst PSV_MOVE_DELTA = Math.PI / 6;\nexport const KEYBOARD_SKIP_FOCUS_WIDGETS = [\"pnx-mini\", \"pnx-widget-player\", \"pnx-widget-zoom\"];\n\n\n/**\n * Photo Viewer is a component showing pictures (without any map).\n * \n * This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.\n * \n * If you need a viewer with map, checkout [Viewer component](#Panoramax.components.core.Viewer).\n * \n * Make sure to set width/height through CSS for proper display.\n * @class Panoramax.components.core.PhotoViewer\n * @element pnx-photo-viewer\n * @extends Panoramax.components.core.Basic\n * @property {Panoramax.components.ui.Loader} loader The loader screen\n * @property {Panoramax.utils.API} api The API manager\n * @property {Panoramax.components.ui.Photo} psv The Photo Sphere Viewer component itself\n * @property {Panoramax.components.layout.CorneredGrid} grid The grid layout manager\n * @property {Panoramax.components.ui.Popup} popup The popup container\n * @property {Panoramax.utils.URLHandler} urlHandler The URL query parameters manager\n * @property {Panoramax.utils.PresetsManager} presetsManager The semantics presets manager\n * @fires Panoramax.components.core.Basic#select\n * @fires Panoramax.components.core.Basic#ready\n * @fires Panoramax.components.core.Basic#broken\n * @slot `top-left` The top-left corner\n * @slot `top` The top middle corner\n * @slot `top-right` The top-right corner\n * @slot `bottom-left` The bottom-left corner\n * @slot `bottom` The bottom middle corner\n * @slot `bottom-right` The bottom-right corner\n * @slot `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).\n * @example\n * ```html\n * <!-- Basic example -->\n * <pnx-photo-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * />\n * \n * <!-- With slotted widgets -->\n * <pnx-photo-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * >\n *   <p slot=\"top-right\">My custom text</p>\n *   <p slot=\"editors\"><a href=\"https://my.own.tool/\">Edit in my own tool</a></p>\n * </pnx-photo-viewer>\n * \n * <!-- With only your custom widgets -->\n * <pnx-photo-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n *   widgets=\"false\"\n * >\n *   <p slot=\"top-right\">My custom text</p>\n * </pnx-photo-viewer>\n * ```\n */\nexport default class PhotoViewer extends Basic {\n\t/**\n\t * Component properties. All of [Basic properties](#Panoramax.components.core.Basic+properties) are available as well.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t * @mixes Panoramax.components.core.Basic#properties\n\t * @type {Object}\n\t * @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))\n\t * @property {object} [psv-options] [Any option to pass to Photo component](#Panoramax.components.ui.Photo) as an object.<br />Example: `psv-options=\"{'transitionDuration': 500, 'picturesNavigation': 'pic'}\"`\n\t * @property {string} [widgets=true] Use default set of widgets ? Set to false to avoid any widget to show up, and use slots to populate as you like.\n\t * @property {string} [picture] The picture ID to display\n\t * @property {string} [sequence] The sequence ID of the picture displayed\n\t * @property {object} [fetch-options] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n\t * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.\n\t * @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?\n\t * @property {string} [keyboard-shortcuts=true] Should keyboard shortcuts be enabled ? Set to \"false\" to fully disable any keyboard shortcuts.\n\t * @property {string} [skip-tags-menu-opening=false] Should the \"Tags\" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening.\n\t * @property {string} [share-base-url] Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool.\n\t */\n\tstatic properties = {\n\t\t\"psv-options\": {converter: Basic.GetJSONConverter()},\n\t\twidgets: {type: String},\n\t\t\"url-parameters\": {type: String},\n\t\t\"keyboard-shortcuts\": {type: String},\n\t\ttabindex: {type: Number},\n\t\t\"skip-tags-menu-opening\": {type: String},\n\t\t\"share-base-url\": {type: String},\n\t\t...Basic.properties\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Defaults\n\t\tthis[\"psv-options\"] = {};\n\t\tthis[\"url-parameters\"] = this.getAttribute(\"url-parameters\") || \"true\";\n\t\tthis[\"keyboard-shortcuts\"] = this.getAttribute(\"keyboard-shortcuts\") || \"true\";\n\t\tthis[\"skip-tags-menu-opening\"] = (this.getAttribute(\"skip-tags-menu-opening\") || \"false\") !== \"true\";\n\t\tthis[\"share-base-url\"] = this.getAttribute(\"share-base-url\") || null;\n\t\tthis.widgets = this.getAttribute(\"widgets\") || \"true\";\n\n\t\t// Init DOM containers\n\t\tthis.grid = createWebComp(\"pnx-cornered-grid\");\n\t\tthis.psvContainer = document.createElement(\"div\");\n\t\tthis.psvContainer.setAttribute(\"slot\", \"bg\");\n\t\tthis.grid.appendChild(this.psvContainer);\n\t\tthis.popup = createWebComp(\"pnx-popup\", {_parent: this, onclose: this._onPopupClose.bind(this)});\n\t\tthis.tabindex = 0;\n\n\t\t// Cache for sequences metadata\n\t\t// Used by semantics metadata component to avoid re-downloads\n\t\tthis._sequencesMetadata = {};\n\t}\n\n\t/** @private */\n\t_createInitParamsHandler() {\n\t\tthis._initParams = new InitParameters(\n\t\t\tInitParameters.GetComponentProperties(PhotoViewer, this),\n\t\t\tObject.assign({}, this.urlHandler?.currentURLParams(), this.urlHandler?.currentURLParams(true)),\n\t\t\t{ disableAnnotations: localStorage.getItem(DISABLE_ANNOTATIONS_PARAM) },\n\t\t);\n\t}\n\n\t/** @private */\n\t_initWidgets() {\n\t\tif(this._initParams.getParentPostInit().widgets !== \"false\") {\n\t\t\tif(!isInIframe()) {\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-player\", {\n\t\t\t\t\tslot: \"top\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-psv pnx-print-hidden\",\n\t\t\t\t\tsize: this.isHeightSmall() ? \"md\": \"xl\",\n\t\t\t\t}));\n\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-annotations-switch\", {\n\t\t\t\t\tslot: \"top\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-psv pnx-print-hidden\",\n\t\t\t\t\tsize: this.isHeightSmall() ? \"md\": \"xl\",\n\t\t\t\t}));\n\t\t\t}\n\n\t\t\tif(isInIframe()) {\n\t\t\t\tthis.legend = createWebComp(\"pnx-widget-legend\", {\n\t\t\t\t\tslot: \"bottom-right\",\n\t\t\t\t\tlight: true,\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tfocus: this._initParams.getParentPostInit().focus,\n\t\t\t\t\tpicture: this._initParams.getParentPostInit().picture,\n\t\t\t\t});\n\t\t\t\tthis.grid.appendChild(this.legend);\n\t\t\t}\n\t\t\telse if(!this.isWidthSmall()) {\n\t\t\t\tthis.legend = createWebComp(\"pnx-widget-legend\", {\n\t\t\t\t\tslot: !this.isWidthSmall() ? \"top-left\" : undefined,\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tfocus: this._initParams.getParentPostInit().focus,\n\t\t\t\t\tpicture: this._initParams.getParentPostInit().picture,\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-zoom\", {\n\t\t\t\t\tslot: \"bottom-right\",\n\t\t\t\t\tclass: \"pnx-print-hidden\",\n\t\t\t\t\t_parent: this\n\t\t\t\t}));\n\t\t\t\tthis.grid.appendChild(this.legend);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.legend = createWebComp(\"pnx-picture-legend\", { _parent: this });\n\t\t\t\tthis.bottomDrawer = createWebComp(\"pnx-bottom-drawer\", {\n\t\t\t\t\tslot: \"bottom\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: this._initParams.getParentPostInit().willLoadPicture ? undefined: \"pnx-hidden\",\n\t\t\t\t});\n\t\t\t\tthis.bottomDrawer.appendChild(this.legend);\n\t\t\t\tthis.grid.appendChild(this.bottomDrawer);\n\t\t\t\tthis.addEventListener(\"select\", e => {\n\t\t\t\t\tif(isNullId(e.detail.picId)) { this.bottomDrawer.classList.add(\"pnx-hidden\"); }\n\t\t\t\t\telse { this.bottomDrawer.classList.remove(\"pnx-hidden\"); }\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tthis.presetsManager = new PresetManager(this.lang);\n\n\t\tif(this[\"url-parameters\"] !== \"false\") {\n\t\t\tthis.urlHandler = new URLHandler(this);\n\t\t\tthis.onceReady().then(() => {\n\t\t\t\tthis.urlHandler.listenToChanges();\n\t\t\t\tthis.urlHandler._onParentChange();\n\t\t\t});\n\t\t}\n\n\t\tthis.onceAPIReady().then(this._postAPIInit.bind(this));\n\n\t\tthis._moveChildToGrid();\n\t\twindow.addEventListener(\"DOMContentLoaded\", () => {\n\t\t\tthis._moveChildToGrid();\n\t\t}, { once: true });\n\t}\n\n\t/** @private */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.urlHandler?.destroy();\n\t\tthis.psv?.destroy();\n\t\tdocument.body.removeEventListener(\"click\", this._toggleKeyboardBasedOnFocus);\n\t\twindow.removeEventListener(\"keypress\", this._toggleKeyboardBasedOnFocus);\n\t}\n\n\tgetClassName() {\n\t\treturn \"PhotoViewer\";\n\t}\n\n\t/**\n\t * Waits for PhotoViewer to be completely ready (map & PSV loaded, first picture also if one is wanted)\n\t * @returns {Promise} When viewer is ready\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tonceReady() {\n\t\treturn this.oncePSVReady().then(() => {\n\t\t\tif(this._initParams.getParentPostInit().willLoadPicture && !this.psv.getPictureMetadata()) { return this.onceFirstPicLoaded(); }\n\t\t\telse { return Promise.resolve(); }\n\t\t});\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn [this.loader, this.grid, this.popup];\n\t}\n\n\tgetSubComponentsNames() {\n\t\treturn super.getSubComponentsNames().concat([\"psv\", \"grid\", \"popup\", \"urlHandler\"]);\n\t}\n\n\t/**\n\t * Waiting for Photo Sphere Viewer to be available.\n\t * @returns {Promise} When PSV is ready to use\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\toncePSVReady() {\n\t\tlet waiter;\n\t\treturn new Promise(resolve => {\n\t\t\twaiter = setInterval(() => {\n\t\t\t\tif(this.psv && typeof this.psv === \"object\") {\n\t\t\t\t\tif(this.psv.container) {\n\t\t\t\t\t\tclearInterval(waiter);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.psv.addEventListener) {\n\t\t\t\t\t\tthis.psv.addEventListener(\"ready\", () => {\n\t\t\t\t\t\t\tclearInterval(waiter);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t}, {once: true});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 250);\n\t\t});\n\t}\n\n\t/**\n\t * Waits for first picture to display on PSV.\n\t * @returns {Promise}\n\t * @fulfil {undefined} When picture is shown\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tonceFirstPicLoaded() {\n\t\treturn this.oncePSVReady().then(() => {\n\t\t\tif(this.psv.getPictureMetadata()) { return Promise.resolve(); }\n\t\t\telse {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tthis.psv.addEventListener(\"picture-loaded\", resolve, {once: true});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @private */\n\tasync _postAPIInit() {\n\t\tthis.loader.setAttribute(\"value\", 30);\n\t\tthis._createInitParamsHandler();\n\n\t\tconst myPostInitParams = this._initParams.getParentPostInit();\n\n\t\tthis._initPSV();\n\t\tthis._initWidgets();\n\t\talterPhotoViewerState(this, myPostInitParams);\n\t\t\n\t\tif(myPostInitParams.keyboardShortcuts) {\n\t\t\tthis._handleKeyboardManagement();\n\t\t}\n\t\t\n\t\tif(myPostInitParams.willLoadPicture) {\n\t\t\tif(this.psv.getPictureMetadata()) {\n\t\t\t\tthis.loader.dismiss();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.psv.addEventListener(\"picture-loaded\", () => this.loader.dismiss(), {once: true});\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis.loader.dismiss();\n\t\t}\n\t}\n\n\t/** @private */\n\t_initPSV() {\n\t\ttry {\n\t\t\tthis.psv = new Photo(this, this.psvContainer, {\n\t\t\t\tshouldGoFast: this._psvShouldGoFast.bind(this),\n\t\t\t\tkeyboard: \"always\",\n\t\t\t\tkeyboardActions: {\n\t\t\t\t\t...PSDefaults.keyboardActions,\n\t\t\t\t\t\"8\": \"ROTATE_UP\",\n\t\t\t\t\t\"2\": \"ROTATE_DOWN\",\n\t\t\t\t\t\"4\": \"ROTATE_LEFT\",\n\t\t\t\t\t\"6\": \"ROTATE_RIGHT\",\n\n\t\t\t\t\t\"PageUp\": () => this.psv.goToNextPicture(),\n\t\t\t\t\t\"9\": () => this.psv.goToNextPicture(),\n\n\t\t\t\t\t\"PageDown\": () => this.psv.goToPrevPicture(),\n\t\t\t\t\t\"3\": () => this.psv.goToPrevPicture(),\n\n\t\t\t\t\t\"5\": () => this.moveCenter(),\n\t\t\t\t\t\"*\": () => this.moveCenter(),\n\n\t\t\t\t\t\"Home\": () => this._toggleFocus?.(),\n\t\t\t\t\t\"7\": () => this._toggleFocus?.(),\n\n\t\t\t\t\t\"End\": () => this.mini.toggleAttribute(\"collapsed\"),\n\t\t\t\t\t\"1\": () => this.mini.toggleAttribute(\"collapsed\"),\n\n\t\t\t\t\t\" \": () => this.psv.toggleSequencePlaying(),\n\t\t\t\t\t\"0\": () => this.psv.toggleSequencePlaying(),\n\t\t\t\t},\n\t\t\t\t...this._initParams.getPSVInit()\n\t\t\t});\n\t\t\tthis.oncePSVReady().then(() => {\n\t\t\t\tthis.loader.setAttribute(\"value\", 50);\n\t\t\t\talterPSVState(this.psv, this._initParams.getPSVPostInit());\n\t\t\t});\n\n\t\t\t// Show class when PSV is playing sequence\n\t\t\tthis.psv.addEventListener(\"sequence-playing\", () => this.classList.add(\"pnx-playing\"));\n\t\t\tthis.psv.addEventListener(\"sequence-stopped\", () => this.classList.remove(\"pnx-playing\"));\n\n\t\t\t// One-click focusing\n\t\t\tthis.psv.addEventListener(\"dblclick\", () => clearTimeout(this._gridFocus));\n\t\t\tthis.psv.addEventListener(\"click\", e => {\n\t\t\t\tclearTimeout(this._gridFocus);\n\t\t\t\t\n\t\t\t\tif(e.data.target.tagName === \"CANVAS\") {\n\t\t\t\t\tif(!this.isMapWide || (this.isMapWide && !this.isMapWide())) {\n\t\t\t\t\t\tthis._gridFocus = setTimeout(() => {\n\t\t\t\t\t\t\tif(this.grid.toggleAway()) {\n\t\t\t\t\t\t\t\tthis.classList.add(\"pnx-grid-toggled\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthis.classList.remove(\"pnx-grid-toggled\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 250);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.psvContainer.addEventListener(\"mousemove\", () => {\n\t\t\t\tif(this.grid._hidden) {\n\t\t\t\t\tclearTimeout(this._gridFocus);\n\t\t\t\t\tthis.grid.toggleAway(true);\n\t\t\t\t\tthis.classList.remove(\"pnx-grid-toggled\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcatch(e) {\n\t\t\tlet err = !PSSystem.isWebGLSupported ? this._t.pnx.error_webgl : this._t.pnx.error_psv;\n\t\t\tthis.loader.dismiss(e, err);\n\t\t}\n\t}\n\n\t/** @private */\n\t_enableKeyboard() {\n\t\tthis.psv.startKeyboardControl();\n\t}\n\n\t/** @private */\n\t_disableKeyboard() {\n\t\tthis.psv.stopKeyboardControl();\n\t}\n\n\t/** @private */\n\t_toggleKeyboardBasedOnFocus(e) {\n\t\tconst target = e?.target || document.activeElement;\n\t\tif(this.contains(target)) {\n\t\t\t// Check if focus is not in a widget\n\t\t\tfor(let cn of this.grid.childNodes) {\n\t\t\t\tif(\n\t\t\t\t\tcn.getAttribute(\"slot\") !== \"bg\"\n\t\t\t\t\t&& !KEYBOARD_SKIP_FOCUS_WIDGETS.includes(cn.tagName.toLowerCase())\n\t\t\t\t) {\n\t\t\t\t\tif(cn.contains(target)) {\n\t\t\t\t\t\tthis._disableKeyboard();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Skip if popup is opened\n\t\t\tif(this.popup.getAttribute(\"visible\") !== null) {\n\t\t\t\tthis._disableKeyboard();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._enableKeyboard();\n\t\t}\n\t\telse {\n\t\t\tthis._disableKeyboard();\n\t\t}\n\t}\n\n\t/** @private */\n\t_handleKeyboardManagement() {\n\t\t// General\n\t\twindow.addEventListener(\"click\", e => this._toggleKeyboardBasedOnFocus(e));\n\t\twindow.addEventListener(\"keypress\", this._toggleKeyboardBasedOnFocus.bind(this));\n\n\t\t// Popup\n\t\tthis.popup.addEventListener(\"open\", this._disableKeyboard.bind(this));\n\t\tthis.popup.addEventListener(\"close\", this._enableKeyboard.bind(this));\n\t\tthis.psv.addEventListener(\"click\", this._enableKeyboard.bind(this));\n\n\t\t// Widgets\n\t\tfor(let cn of this.grid.childNodes) {\n\t\t\tif(\n\t\t\t\tcn.getAttribute(\"slot\") !== \"bg\"\n\t\t\t\t&& !KEYBOARD_SKIP_FOCUS_WIDGETS.includes(cn.tagName.toLowerCase())\n\t\t\t) {\n\t\t\t\tcn.addEventListener(\"focusin\", this._disableKeyboard.bind(this));\n\t\t\t\tcn.addEventListener(\"focusout\", () => {\n\t\t\t\t\tif(this.popup.getAttribute(\"visible\") === null) {\n\t\t\t\t\t\tthis._enableKeyboard();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Given context, should tiles be loaded in PSV.\n\t * @private\n\t */\n\t_psvShouldGoFast() {\n\t\treturn (this.psv._sequencePlaying && this.psv.getTransitionDuration() < 1000);\n\t}\n\n\t/** @private */\n\t_moveChildToGrid() {\n\t\tconst slotContent = Array.from(this.querySelectorAll(\"[slot]\"));\n\n\t\tslotContent.forEach(n => {\n\t\t\t// Add parent + translation for our components\n\t\t\tif(n.tagName?.toLowerCase().startsWith(\"pnx-\")) {\n\t\t\t\tn._parent = this;\n\t\t\t\tn._t = this._t;\n\t\t\t}\n\n\t\t\t// Editors slot -> legend\n\t\t\tif(n.getAttribute(\"slot\") === \"editors\") {\n\t\t\t\tthis.onceReady().then(() => this.legend?.appendChild(n));\n\t\t\t}\n\t\t\t// Add to grid else\n\t\t\telse {\n\t\t\t\tthis.grid.appendChild(n);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Change full-page popup visibility and content\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t * @param {boolean} visible True to make it appear\n\t * @param {string|Element[]} [content] The new popup content\n\t */\n\tsetPopup(visible, content = null) {\n\t\tif(visible) { this.popup.setAttribute(\"visible\", \"\"); }\n\t\telse { this.popup.removeAttribute(\"visible\"); }\n\t\t\n\t\tthis.popup.innerHTML = \"\";\n\t\tif(typeof content === \"string\") { this.popup.innerHTML = content; }\n\t\telse if(Array.isArray(content)) { content.forEach(c => this.popup.appendChild(c)); }\n\t}\n\n\t/** @private */\n\t_onPopupClose() {\n\t\tthis.dispatchEvent(new CustomEvent(\"focus-changed\", { detail: { focus: this.map && this.isMapWide() ? \"map\" : \"pic\" } }));\n\t}\n\n\t/** @private */\n\t_showQualityScoreDoc() {\n\t\tthis.setPopup(true, [createWebComp(\"pnx-quality-score-doc\", {_t: this._t})]);\n\t}\n\n\t/** @private */\n\t_showReportForm() {\n\t\tif(!this.psv.getPictureMetadata()) { throw new Error(\"No picture currently selected\"); }\n\t\tthis.setPopup(true, [createWebComp(\"pnx-report-form\", {_parent: this})]);\n\t}\n\n\t/** @private */\n\t_showShareOptions() {\n\t\tthis.setPopup(true, [createWebComp(\"pnx-share-menu\", {_parent: this, \"base-url\": this[\"share-base-url\"]})]);\n\t}\n\n\t/** @private */\n\t_showSemanticsDoc() {\n\t\tthis.setPopup(true, [createWebComp(\"pnx-semantics-doc\", {_t: this._t})]);\n\t}\n\n\t/** @private */\n\t_showSemanticsDownload() {\n\t\tthis.setPopup(true, [createWebComp(\"pnx-semantics-download\", {_t: this._t})]);\n\t}\n\n\t/**\n\t * Move the view of main component to its center.\n\t * For map, center view on selected picture.\n\t * For picture, center view on image center.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tmoveCenter() {\n\t\tconst meta = this.psv.getPictureMetadata();\n\t\tif(!meta) { return; }\n\n\t\tthis._psvAnimate({\n\t\t\tspeed: PSV_ANIM_DURATION,\n\t\t\tyaw: 0,\n\t\t\tpitch: 0,\n\t\t\tzoom: PSV_DEFAULT_ZOOM\n\t\t});\n\t}\n\n\t/**\n\t * Moves the view of main component slightly to the left.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tmoveLeft() {\n\t\tthis._moveToDirection(\"left\");\n\t}\n\n\t/**\n\t * Moves the view of main component slightly to the right.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tmoveRight() {\n\t\tthis._moveToDirection(\"right\");\n\t}\n\n\t/**\n\t * Moves the view of main component slightly to the top.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tmoveUp() {\n\t\tthis._moveToDirection(\"up\");\n\t}\n\n\t/**\n\t * Moves the view of main component slightly to the bottom.\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\tmoveDown() {\n\t\tthis._moveToDirection(\"down\");\n\t}\n\n\t/**\n\t * Moves map or picture viewer to given direction.\n\t * @param {string} dir Direction to move to (up, left, down, right)\n\t * @private\n\t */\n\t_moveToDirection(dir) {\n\t\tlet pos = this.psv.getPosition();\n\t\tswitch(dir) {\n\t\tcase \"up\":\n\t\t\tpos.pitch += PSV_MOVE_DELTA;\n\t\t\tbreak;\n\t\tcase \"left\":\n\t\t\tpos.yaw -= PSV_MOVE_DELTA;\n\t\t\tbreak;\n\t\tcase \"down\":\n\t\t\tpos.pitch -= PSV_MOVE_DELTA;\n\t\t\tbreak;\n\t\tcase \"right\":\n\t\t\tpos.yaw += PSV_MOVE_DELTA;\n\t\t\tbreak;\n\t\t}\n\t\tthis._psvAnimate({ speed: PSV_ANIM_DURATION, ...pos });\n\t}\n\n\t/**\n\t * Overrided PSV animate function to ensure a single animation plays at once.\n\t * @param {object} options PSV animate options\n\t * @private\n\t */\n\t_psvAnimate(options) {\n\t\tif(this._lastPsvAnim) { this._lastPsvAnim.cancel(); }\n\t\tthis._lastPsvAnim = this.psv.animate(options);\n\t}\n\n\t/**\n\t * Listen to events from this components or one of its sub-components.\n\t * \n\t * For example, you can listen to `psv` events using prefix `psv:`.\n\t * \n\t * ```js\n\t * me.addEventListener(\"psv:picture-loading\", doSomething);\n\t * ```\n\t * @param {string} type The event type to listen for\n\t * @param {function} listener The event handler\n\t * @param {object} [options] [Any original addEventListener available options](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#options)\n\t * @memberof Panoramax.components.core.PhotoViewer#\n\t */\n\taddEventListener(type, listener, options) {\n\t\tsuper.addEventListener(type, listener, options);\n\t}\n}\n\ncustomElements.define(\"pnx-photo-viewer\", PhotoViewer);\n","/* eslint-disable no-unused-vars */\n\nimport \"./Viewer.css\";\nimport { linkMapAndPhoto, saveMapParamsToLocalStorage, getMapParamsFromLocalStorage } from \"../../utils/map\";\nimport PhotoViewer, {KEYBOARD_SKIP_FOCUS_WIDGETS} from \"./PhotoViewer\";\nimport MapMore from \"../ui/MapMore\";\nimport { initMapKeyboardHandler, mapFiltersFormValues } from \"../../utils/map\";\nimport { isNullId, isInIframe, DISABLE_ANNOTATIONS_PARAM } from \"../../utils/utils\";\nimport { createWebComp } from \"../../utils/widgets\";\nimport { fa } from \"../../utils/widgets\";\nimport { faPanorama } from \"@fortawesome/free-solid-svg-icons/faPanorama\";\nimport { faMap } from \"@fortawesome/free-solid-svg-icons/faMap\";\nimport { querySelectorDeep } from \"query-selector-shadow-dom\";\nimport { default as InitParameters, alterMapState, alterViewerState } from \"../../utils/InitParameters\";\n\n\nconst MAP_MOVE_DELTA = 100;\n\n\n/**\n * Viewer is the main component of Panoramax JS library, showing pictures and map.\n * \n * This component has a [CorneredGrid](#Panoramax.components.layout.CorneredGrid) layout, you can use directly any slot element to pass custom widgets.\n * \n * If you need a viewer without map, checkout [Photo Viewer component](#Panoramax.components.core.PhotoViewer).\n * \n * Make sure to set width/height through CSS for proper display.\n * @class Panoramax.components.core.Viewer\n * @element pnx-viewer\n * @extends Panoramax.components.core.PhotoViewer\n * @property {Panoramax.components.ui.Loader} loader The loader screen\n * @property {Panoramax.utils.API} api The API manager\n * @property {Panoramax.components.ui.MapMore} map The MapLibre GL map itself\n * @property {Panoramax.components.ui.Photo} psv The Photo Sphere Viewer component itself\n * @property {Panoramax.components.layout.CorneredGrid} grid The grid layout manager\n * @property {Panoramax.components.layout.Mini} mini The reduced/collapsed map/photo component\n * @property {Panoramax.components.ui.Popup} popup The popup container\n * @property {Panoramax.utils.URLHandler} urlHandler The URL query parameters manager\n * @property {Panoramax.utils.PresetsManager} presetsManager The semantics presets manager\n * @fires Panoramax.components.core.Basic#select\n * @fires Panoramax.components.core.Basic#ready\n * @fires Panoramax.components.core.Basic#broken\n * @fires Panoramax.components.core.Viewer#focus-changed\n * @slot `top-left` The top-left corner\n * @slot `top` The top middle corner\n * @slot `top-right` The top-right corner\n * @slot `bottom-left` The bottom-left corner\n * @slot `bottom` The bottom middle corner\n * @slot `bottom-right` The bottom-right corner\n * @slot `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).\n * @example\n * ```html\n * <!-- Basic example -->\n * <pnx-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * />\n * \n * <!-- With slotted widgets -->\n * <pnx-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n * >\n *   <p slot=\"top-right\">My custom text</p>\n *   <p slot=\"editors\"><a href=\"https://my.own.tool/\">Edit in my own tool</a></p>\n * </pnx-viewer>\n * \n * <!-- With only your custom widgets -->\n * <pnx-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n *   widgets=\"false\"\n * >\n *   <p slot=\"top-right\">My custom text</p>\n * </pnx-viewer>\n * \n * <!-- With map options -->\n * <pnx-viewer\n *   endpoint=\"https://panoramax.openstreetmap.fr/\"\n *   style=\"width: 300px; height: 250px\"\n *   map-options=\"{'maxZoom': 15, 'background': 'aerial', 'raster': '...'}\"\n * />\n * ```\n */\nexport default class Viewer extends PhotoViewer {\n\t/**\n\t * Component properties. All of [Basic properties](#Panoramax.components.core.Basic+properties) are available as well.\n\t * @memberof Panoramax.components.core.Viewer#\n\t * @mixes Panoramax.components.core.PhotoViewer#properties\n\t * @type {Object}\n\t * @property {string} endpoint URL to API to use (must be a [STAC API](https://github.com/radiantearth/stac-api-spec/blob/main/overview.md))\n\t * @property {object} [map-options] An object with [any map option available in Map or MapMore class](#Panoramax.components.ui.MapMore).<br />Example: `map-options=\"{'background': 'aerial', 'theme': 'age'}\"`\n\t * @property {object} [psv-options] [Any option to pass to Photo component](#Panoramax.components.ui.Photo) as an object.<br />Example: `psv-options=\"{'transitionDuration': 500, 'picturesNavigation': 'pic'}\"`\n\t * @property {string} [url-parameters=true] Should the component add and update URL query parameters to save viewer state ?\n\t * @property {string} [keyboard-shortcuts=true] Should keyboard shortcuts be enabled ? Set to \"false\" to fully disable any keyboard shortcuts.\n\t * @property {string} [focus=pic] The component showing up as main component (pic, map)\n\t * @property {string} [geocoder=nominatim] The geocoder engine to use (nominatim, ban, or URL to a standard [GeocodeJSON-compliant](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md) API)\n\t * @property {string} [widgets=true] Use default set of widgets ? Set to false to avoid any widget to show up, and use slots to populate as you like.\n\t * @property {string} [picture] The picture ID to display\n\t * @property {string} [sequence] The sequence ID of the picture displayed\n\t * @property {object} [fetch-options] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n\t * @property {string[]} [users=[geovisio]] List of users IDs to use for map display (defaults to general map, identified as \"geovisio\")\n\t * @property {string|object} [map-style] The map's MapLibre style. This can be an a JSON object conforming to the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL string pointing to one. Defaults to OSM vector tiles.\n\t * @property {string} [lang] To override language used for labels. Defaults to using user's preferred languages.\n\t * @property {string} [skip-tags-menu-opening=false] Should the \"Tags\" menu automatically open when you toggle Annotations switch ? Set true to avoid auto-opening.\n\t * @property {string} [share-base-url] Override the default base URL (current page) for the Share widget. Useful to lead to a public page when viewer is used in a closed tool.\n\t */\n\tstatic properties = {\n\t\t\"map-options\": {converter: PhotoViewer.GetJSONConverter()},\n\t\tfocus: {type: String, reflect: true},\n\t\tgeocoder: {type: String},\n\t\ttabindex: {type: Number},\n\t\t...PhotoViewer.properties\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Defaults\n\t\tthis[\"map-options\"] = true;\n\t\tthis.geocoder = this.getAttribute(\"geocoder\") || \"nominatim\";\n\n\t\t// Init DOM containers\n\t\tthis.mini = createWebComp(\"pnx-mini\", {\n\t\t\tslot: \"bottom-left\",\n\t\t\t_parent: this,\n\t\t\tonexpand: this._onMiniExpand.bind(this),\n\t\t\tcollapsed: isNullId(this.picture) ? true : undefined\n\t\t});\n\t\tthis.mini.addEventListener(\"expand\", this._toggleFocus.bind(this));\n\t\tthis.grid.appendChild(this.mini);\n\t\tthis.mapContainer = document.createElement(\"div\");\n\t\tthis.tabindex = 0;\n\t}\n\n\t/** @private */\n\t_createInitParamsHandler() {\n\t\tthis._initParams = new InitParameters(\n\t\t\tInitParameters.GetComponentProperties(Viewer, this),\n\t\t\tObject.assign({}, this.urlHandler?.currentURLParams(), this.urlHandler?.currentURLParams(true)),\n\t\t\t{\n\t\t\t\tmap: getMapParamsFromLocalStorage(),\n\t\t\t\tdisableAnnotations: localStorage.getItem(DISABLE_ANNOTATIONS_PARAM)\n\t\t\t},\n\t\t);\n\t}\n\n\t/** @private */\n\t_initWidgets() {\n\t\tif(this._initParams.getParentPostInit().widgets !== \"false\") {\n\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-zoom\", {\n\t\t\t\tslot: this.isWidthSmall() ? \"top-left\" : \"bottom-right\",\n\t\t\t\tclass: this.isWidthSmall() ? \"pnx-only-map pnx-print-hidden\" : \"pnx-print-hidden\",\n\t\t\t\t_parent: this\n\t\t\t}));\n\t\t\t\n\t\t\tif(isInIframe()) {\n\t\t\t\tthis.legend = createWebComp(\"pnx-widget-legend\", {\n\t\t\t\t\tslot: \"bottom-right\",\n\t\t\t\t\tlight: true,\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tfocus: this._initParams.getParentPostInit().focus,\n\t\t\t\t\tpicture: this._initParams.getParentPostInit().picture,\n\t\t\t\t});\n\t\t\t\tthis.grid.appendChild(this.legend);\n\t\t\t}\n\t\t\telse if(!this.isWidthSmall()) {\n\t\t\t\tthis.legend = createWebComp(\"pnx-widget-legend\", {\n\t\t\t\t\tslot: this.isWidthSmall() ? \"top\" : \"top-left\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tfocus: this._initParams.getParentPostInit().focus,\n\t\t\t\t\tpicture: this._initParams.getParentPostInit().picture,\n\t\t\t\t});\n\t\t\t\tthis._miniPicLegend = createWebComp(\"pnx-mini-picture-legend\", { _parent: this });\n\t\t\t\tthis.grid.appendChild(this.legend);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.legend = createWebComp(\"pnx-picture-legend\", { _parent: this });\n\t\t\t\tthis.bottomDrawer = createWebComp(\"pnx-bottom-drawer\", {\n\t\t\t\t\tslot: \"bottom\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: this._initParams.getParentPostInit().willLoadPicture ? undefined: \"pnx-hidden\",\n\t\t\t\t});\n\t\t\t\tthis.bottomDrawer.appendChild(this.legend);\n\t\t\t\tthis.grid.appendChild(this.bottomDrawer);\n\t\t\t\tthis.addEventListener(\"select\", e => {\n\t\t\t\t\tif(isNullId(e.detail.picId)) { this.bottomDrawer.classList.add(\"pnx-hidden\"); }\n\t\t\t\t\telse { this.bottomDrawer.classList.remove(\"pnx-hidden\"); }\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif(!isInIframe()) {\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-player\", {\n\t\t\t\t\tslot: \"top\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-psv pnx-print-hidden\",\n\t\t\t\t\tsize: this.isHeightSmall() ? \"md\": \"xl\",\n\t\t\t\t}));\n\t\t\t\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-annotations-switch\", {\n\t\t\t\t\tslot: \"top\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-psv pnx-print-hidden\",\n\t\t\t\t\tsize: this.isHeightSmall() ? \"md\": \"xl\",\n\t\t\t\t}));\n\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-geosearch\", {\n\t\t\t\t\tslot: this.isWidthSmall() ? \"top-right\" : \"top-left\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-map pnx-print-hidden\",\n\t\t\t\t\tgeocoder: this._initParams.getParentPostInit().geocoder,\n\t\t\t\t}));\n\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-mapfilters\", {\n\t\t\t\t\tslot: this.isWidthSmall() ? \"top-right\" : \"top-left\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\t\"user-search\": this.api._endpoints.user_search !== null && this.api._endpoints.user_tiles !== null,\n\t\t\t\t\t\"quality-score\": this.map?._hasQualityScore?.() || false,\n\t\t\t\t\tclass: \"pnx-only-map pnx-print-hidden\",\n\t\t\t\t}));\n\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-semantics-filters\", {\n\t\t\t\t\tslot: this.isWidthSmall() ? \"top-right\" : \"top-left\",\n\t\t\t\t\t_parent: this,\n\t\t\t\t\tclass: \"pnx-only-map pnx-print-hidden\",\n\t\t\t\t}));\n\t\t\t\t\n\t\t\t\tthis.grid.appendChild(createWebComp(\"pnx-widget-maplayers\", { slot: \"top-right\", _parent: this, class: \"pnx-only-map pnx-print-hidden\" }));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis.map?.destroy();\n\t}\n\n\tgetClassName() {\n\t\treturn \"Viewer\";\n\t}\n\n\tgetSubComponentsNames() {\n\t\treturn super.getSubComponentsNames().concat([\"mini\", \"map\"]);\n\t}\n\n\t/**\n\t * Waits for Viewer to be completely ready (map & PSV loaded, first picture also if one is wanted)\n\t * @returns {Promise} When viewer is ready\n\t * @memberof Panoramax.components.core.Viewer#\n\t */\n\tonceReady() {\n\t\treturn Promise.all([this.oncePSVReady(), this.onceMapReady()])\n\t\t\t.then(() => {\n\t\t\t\tif(this._initParams.getParentPostInit().willLoadPicture && !this.psv.getPictureMetadata()) { return this.onceFirstPicLoaded(); }\n\t\t\t\telse { return Promise.resolve(); }\n\t\t\t});\n\t}\n\n\t/** @private */\n\tattributeChangedCallback(name, old, value) {\n\t\tsuper.attributeChangedCallback(name, old, value);\n\n\t\tif(name === \"picture\") {\n\t\t\tthis.legend?.setAttribute?.(\"picture\", value);\n\t\t\t\n\t\t\t// First pic load : show map in mini component\n\t\t\tif(isNullId(old) && !isNullId(value)) {\n\t\t\t\tthis.mini.removeAttribute(\"collapsed\");\n\t\t\t}\n\n\t\t\t// Unselect -> show map wide instead\n\t\t\tif(isNullId(value)) {\n\t\t\t\tif(this.map && this.isMapWide()) { this.mini.classList.add(\"pnx-hidden\"); }\n\t\t\t\telse if(this.map && !this.isMapWide()) { this._setFocus(\"map\"); }\n\t\t\t}\n\t\t\t// Check if it's not first load from seq=* URL parameter\n\t\t\telse if(\n\t\t\t\tisNullId(old)\n\t\t\t\t&& this.sequence == this._initParams.getParentPostInit().sequence\n\t\t\t\t&& !this._initParams.getParentPostInit().picture\n\t\t\t) {\n\t\t\t\tthis.mini.classList.remove(\"pnx-hidden\");\n\t\t\t\tthis.mini.removeAttribute(\"collapsed\");\n\t\t\t\tif(this.bottomDrawer?.getAttribute?.(\"openness\") === \"closed\") {\n\t\t\t\t\tthis.bottomDrawer.setAttribute(\"openness\", \"half-opened\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Select after none selected -> show pic wide\n\t\t\telse {\n\t\t\t\tthis.mini.classList.remove(\"pnx-hidden\");\n\t\t\t\tif(isNullId(old)) {\n\t\t\t\t\tthis._setFocus(\"pic\");\n\t\t\t\t\tif(this.bottomDrawer?.getAttribute?.(\"openness\") === \"closed\") {\n\t\t\t\t\t\tthis.bottomDrawer.setAttribute(\"openness\", \"half-opened\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(name === \"focus\") {\n\t\t\tthis._setFocus(value);\n\t\t}\n\t}\n\n\t/**\n\t * Waiting for map to be available.\n\t * @returns {Promise} When map is ready to use\n\t * @memberof Panoramax.components.core.Viewer#\n\t */\n\tonceMapReady() {\n\t\tif(!this[\"map-options\"]) { return Promise.resolve(); }\n\t\t\n\t\tlet waiter;\n\t\treturn new Promise(resolve => {\n\t\t\twaiter = setInterval(() => {\n\t\t\t\tif(typeof this.map === \"object\") {\n\t\t\t\t\tif(this.map?.loaded?.()) {\n\t\t\t\t\t\tclearInterval(waiter);\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t}\n\t\t\t\t\telse if(this.map?.once) {\n\t\t\t\t\t\tthis.map.once(\"render\", () => {\n\t\t\t\t\t\t\tclearInterval(waiter);\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 250);\n\t\t});\n\t}\n\n\t/**\n\t * Inits MapLibre GL component\n\t *\n\t * @private\n\t * @returns {Promise} Resolves when map is ready\n\t */\n\tasync _initMap() {\n\t\tawait new Promise(resolve => {\n\t\t\tthis.map = new MapMore(this, this.mapContainer, this._initParams.getMapInit());\n\t\t\tsaveMapParamsToLocalStorage(this.map);\n\t\t\tthis.map.once(\"users-changed\", () => {\n\t\t\t\tthis.loader.setAttribute(\"value\", 75);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\n\t\tawait alterMapState(this.map, this._initParams.getMapPostInit());\n\t\tinitMapKeyboardHandler(this);\n\t\tlinkMapAndPhoto(this);\n\t}\n\n\t/** @private */\n\tasync _postAPIInit() {\n\t\tthis.loader.setAttribute(\"value\", 30);\n\t\tthis._createInitParamsHandler();\n\n\t\tconst myPostInitParams = this._initParams.getParentPostInit();\n\n\t\tthis._initPSV();\n\t\tawait this._initMap();\n\t\tthis._initWidgets();\n\n\t\t// Re-launch slot move (for those depending on widgets)\n\t\tthis._moveChildToGrid();\n\n\t\talterViewerState(this, myPostInitParams);\n\t\t\n\t\tif(myPostInitParams.keyboardShortcuts) {\n\t\t\tthis._handleKeyboardManagement();\n\t\t}\n\t\t\n\t\tif(myPostInitParams.willLoadPicture) {\n\t\t\tthis.psv.addEventListener(\"picture-loaded\", e => {\n\t\t\t\talterViewerState(this, myPostInitParams); // Do it again for forcing focus\n\t\t\t\tthis.loader.dismiss();\n\t\t\t}, {once: true});\n\t\t}\n\t\telse {\n\t\t\tthis.loader.dismiss();\n\t\t}\n\t}\n\n\t/** @private */\n\t_enableKeyboard() {\n\t\tif(this.map && this.isMapWide()) { this._enableKeyboardMap(); }\n\t\telse { this._enableKeyboardPSV(); }\n\t}\n\n\t/** @private */\n\t_enableKeyboardMap() {\n\t\tthis.psv.stopKeyboardControl();\n\t\tthis.map.keyboard.enable();\n\t}\n\n\t/** @private */\n\t_enableKeyboardPSV() {\n\t\tthis.psv.startKeyboardControl();\n\t\tthis.map.keyboard.disable();\n\t}\n\n\t/** @private */\n\t_disableKeyboard() {\n\t\tthis.psv.stopKeyboardControl();\n\t\tthis.map.keyboard.disable();\n\t}\n\n\t/** @private */\n\t_handleKeyboardManagement() {\n\t\t// General\n\t\twindow.addEventListener(\"click\", e => this._toggleKeyboardBasedOnFocus(e));\n\t\twindow.addEventListener(\"keypress\", this._toggleKeyboardBasedOnFocus.bind(this));\n\t\tthis.addEventListener(\"focus-changed\", e => {\n\t\t\tif(this.popup.getAttribute(\"visible\")) { this._disableKeyboard(); }\n\t\t\telse if(e.detail.focus === \"map\") { this._enableKeyboardMap(); }\n\t\t\telse { this._enableKeyboardPSV(); }\n\t\t});\n\n\t\t// Popup\n\t\tthis.popup.addEventListener(\"open\", this._disableKeyboard.bind(this));\n\t\tthis.popup.addEventListener(\"close\", this._enableKeyboard.bind(this));\n\t\tthis.psv.addEventListener(\"click\", this._enableKeyboardPSV.bind(this));\n\n\t\t// Widgets\n\t\tfor(let cn of this.grid.childNodes) {\n\t\t\tif(\n\t\t\t\tcn.getAttribute(\"slot\") !== \"bg\"\n\t\t\t\t&& !KEYBOARD_SKIP_FOCUS_WIDGETS.includes(cn.tagName.toLowerCase())\n\t\t\t) {\n\t\t\t\tcn.addEventListener(\"focusin\", this._disableKeyboard.bind(this));\n\t\t\t\tcn.addEventListener(\"focusout\", () => {\n\t\t\t\t\tif(this.popup.getAttribute(\"visible\") === null) {\n\t\t\t\t\t\tthis._enableKeyboard();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Move the view of main component to its center.\n\t * For map, center view on selected picture.\n\t * For picture, center view on image center.\n\t * @memberof Panoramax.components.core.Viewer#\n\t */\n\tmoveCenter() {\n\t\tconst meta = this.psv.getPictureMetadata();\n\t\tif(!meta) { return; }\n\n\t\tif(this.map && this.isMapWide()) {\n\t\t\tthis.map.flyTo({ center: meta.gps, zoom: 20 });\n\t\t}\n\t\telse {\n\t\t\tsuper.moveCenter();\n\t\t}\n\t}\n\n\t/**\n\t * Moves map or picture viewer to given direction.\n\t * @param {string} dir Direction to move to (up, left, down, right)\n\t * @private\n\t */\n\t_moveToDirection(dir) {\n\t\tif(this.map && this.isMapWide()) {\n\t\t\tlet pan;\n\t\t\tswitch(dir) {\n\t\t\tcase \"up\":\n\t\t\t\tpan = [0, -MAP_MOVE_DELTA];\n\t\t\t\tbreak;\n\t\t\tcase \"left\":\n\t\t\t\tpan = [-MAP_MOVE_DELTA, 0];\n\t\t\t\tbreak;\n\t\t\tcase \"down\":\n\t\t\t\tpan = [0, MAP_MOVE_DELTA];\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tpan = [MAP_MOVE_DELTA, 0];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.map.panBy(pan);\n\t\t}\n\t\telse {\n\t\t\tsuper._moveToDirection(dir);\n\t\t}\n\t}\n\n\t/**\n\t * Is the map shown as main element instead of viewer (wide map mode) ?\n\t * @memberof Panoramax.components.core.Viewer#\n\t * @returns {boolean} True if map is wider than viewer\n\t */\n\tisMapWide() {\n\t\treturn this.mapContainer.parentNode == this.grid;\n\t}\n\n\t/**\n\t * Change the viewer focus (either on picture or map)\n\t * @memberof Panoramax.components.core.Viewer#\n\t * @param {string} focus The object to focus on (map, pic)\n\t * @param {boolean} [skipEvent=false] True to not send focus-changed event\n\t * @param {boolean} [skipDupCheck=false] True to avoid duplicate calls check\n\t * @private\n\t */\n\t_setFocus(focus, skipEvent = false, skipDupCheck = false) {\n\t\tif(focus === \"map\" && !this.map) { throw new Error(\"Map is not enabled\"); }\n\t\tif(![\"map\", \"pic\"].includes(focus)) { throw new Error(\"Invalid focus value (should be pic or map)\"); }\n\t\t\n\t\tthis.focus = focus;\n\n\t\tif(!skipDupCheck && (\n\t\t\t(focus === \"map\" && this.map && this.isMapWide())\n\t\t\t|| (focus === \"pic\" && (!this.map || !this.isMapWide()))\n\t\t)) { return; }\n\n\t\tif(focus === \"map\") {\n\t\t\t// Remove PSV from grid\n\t\t\tif(this.psvContainer.parentNode == this.grid) {\n\t\t\t\tthis.grid.removeChild(this.psvContainer);\n\t\t\t\tthis.psvContainer.removeAttribute(\"slot\");\n\t\t\t}\n\n\t\t\t// Remove map from mini\n\t\t\tif(this.mapContainer.parentNode == this.mini) {\n\t\t\t\tthis.mini.removeChild(this.mapContainer);\n\t\t\t}\n\n\t\t\t// Add map to grid\n\t\t\tthis.mapContainer.setAttribute(\"slot\", \"bg\");\n\t\t\tthis.grid.appendChild(this.mapContainer);\n\t\t\t\n\t\t\t// Add PSV to mini\n\t\t\tthis.mini.appendChild(this.psvContainer);\n\t\t\tthis.mini.icon = fa(faPanorama);\n\t\t\tif(this._miniPicLegend) { this.mini.appendChild(this._miniPicLegend); }\n\n\t\t\t// Hide mini icon if no picture selected\n\t\t\tif(isNullId(this.picture)) { this.mini.classList.add(\"pnx-hidden\"); }\n\t\t\telse { this.mini.classList.remove(\"pnx-hidden\"); }\n\t\t\t\n\t\t\tthis.map.getCanvas().focus();\n\t\t}\n\t\telse {\n\t\t\t// Remove map from grid\n\t\t\tif(this.mapContainer.parentNode == this.grid) {\n\t\t\t\tthis.grid.removeChild(this.mapContainer);\n\t\t\t\tthis.mapContainer.removeAttribute(\"slot\");\n\t\t\t}\n\n\t\t\t// Remove PSV from mini\n\t\t\tif(this.psvContainer.parentNode == this.mini) {\n\t\t\t\tthis.mini.removeChild(this.psvContainer);\n\t\t\t\tif(this._miniPicLegend) { this.mini.removeChild(this._miniPicLegend); }\n\t\t\t}\n\n\t\t\t// Add PSV to grid\n\t\t\tthis.psvContainer.setAttribute(\"slot\", \"bg\");\n\t\t\tthis.grid.appendChild(this.psvContainer);\n\t\t\t\n\t\t\t// Add map to mini\n\t\t\tthis.mini.classList.remove(\"pnx-hidden\");\n\t\t\tthis.mini.appendChild(this.mapContainer);\n\t\t\tthis.mini.icon = fa(faMap);\n\n\t\t\tthis.psvContainer.focus();\n\t\t}\n\n\t\tthis?.map?.resize?.();\n\t\tthis.psv.autoSize();\n\t\tthis.psv.forceRefresh();\n\t\tthis.legend?.setAttribute?.(\"focus\", this.focus);\n\n\t\tif(!skipEvent) {\n\t\t\t/**\n\t\t\t * Event for focus change (either map or picture is shown wide)\n\t\t\t * @event Panoramax.components.core.Viewer#focus-changed\n\t\t\t * @type {CustomEvent}\n\t\t\t * @property {string} detail.focus Component now focused on (map, pic)\n\t\t\t */\n\t\t\tconst event = new CustomEvent(\"focus-changed\", { detail: { focus } });\n\t\t\tthis.dispatchEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Toggle the viewer focus (either on picture or map)\n\t * @memberof Panoramax.components.core.Viewer#\n\t * @private\n\t */\n\t_toggleFocus() {\n\t\tthis._setFocus(this.isMapWide() ? \"pic\" : \"map\");\n\t}\n\n\t/** @private */\n\t_onMiniExpand() {\n\t\tthis.map.resize();\n\t\tthis.psv.autoSize();\n\t}\n\n\t/**\n\t * Send viewer new map filters values.\n\t * @private\n\t */\n\t_onMapFiltersChange() {\n\t\tconst mapFiltersMenu = querySelectorDeep(\"#pnx-map-filters-menu\");\n\t\tconst fMapTheme = querySelectorDeep(\"#pnx-map-theme\");\n\t\tconst values = mapFiltersFormValues(mapFiltersMenu, fMapTheme, this.map?._hasQualityScore());\n\n\t\tthis.map.setFilters(values);\n\t}\n\n\n\t/** @private */\n\t_showLocationPrecisionDoc() {\n\t\tthis.setPopup(true, [createWebComp(\"pnx-location-precision-doc\", {_t: this._t})]);\n\t}\n}\n\ncustomElements.define(\"pnx-viewer\", Viewer);\n","import { LitElement, html, css } from \"lit\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\n\nconst OPENNESS_Y_PCT = { \"opened\": 0, \"half-opened\": 0.7, \"closed\": 1 };\n\n/**\n * BottomDrawer layout offers a mobile-like drawer menu, coming from bottom of the screen.\n * @class Panoramax.components.layout.BottomDrawer\n * @element pnx-bottom-drawer\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `default` The drawer content\n * @example\n * ```html\n * <pnx-bottom-drawer openness=\"opened\">\n *   <p>My drawer content</p>\n * </pnx-bottom-drawer>\n * ```\n */\nexport default class BottomDrawer extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tposition: fixed;\n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\tz-index: 130;\n\t\t\tpointer-events: none;\n\t\t\ttouch-action: none;\n\t\t}\n\n\t\t.drawer {\n\t\t\tbackground: var(--widget-bg);\n\t\t\tborder-top-left-radius: 16px;\n\t\t\tborder-top-right-radius: 16px;\n\t\t\tbox-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\ttransition: transform 0.3s ease;\n\t\t\twill-change: transform;\n\t\t\ttouch-action: auto;\n\t\t\tpointer-events: auto;\n\t\t}\n\n\t\t.drawer.dragging { transition: none; }\n\t\t.drawer.closed { transform: translateY(calc(100% - 30px)); }\n\t\t.drawer.half-opened { transform: translateY(70%); }\n\t\t.drawer.half-opened .content { overflow-y: hidden; }\n\t\t.drawer.opened { transform: translateY(0%); }\n\n\t\t.handle {\n\t\t\theight: 30px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t.handle-bar {\n\t\t\twidth: 40px;\n\t\t\theight: 5px;\n\t\t\tbackground: var(--grey-pale);\n\t\t\tborder-radius: 3px;\n\t\t}\n\n\t\t.content {\n\t\t\toverflow: auto;\n\t\t\tflex: 1;\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.layout.BottomDrawer#\n\t * @type {Object}\n\t * @property {string} [openness=half-opened] How much the drawer should be opened (closed, half-opened, opened)\n\t */\n\tstatic properties = {\n\t\t_fingerY: {state: true},\n\t\t_deltaFingerY: {state: true},\n\t\t_drawerY: {state: true},\n\t\t_isDragging: {state: true},\n\t\t_drawerHeight: {state: true},\n\t\topenness: {type: String, reflect: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._isDragging = false;\n\t\tthis.openness = \"half-opened\";\n\t}\n\n\t/** @private */\n\tfirstUpdated() {\n\t\tsuper.firstUpdated();\n\n\t\tthis._boundTouchMove = this._onTouchMove.bind(this);\n\t\tthis._boundTouchEnd = this._onTouchEnd.bind(this);\n\n\t\tthis._drawerHeight = window.innerHeight - 30;\n\n\t\tconst drawer = this._getDrawer();\n\t\tif (!drawer) { return; }\n\t\tdrawer.style.height = `${this._drawerHeight}px`;\n\t\tdrawer.style.maxHeight = `${this._drawerHeight}px`;\n\n\t\tonceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {\n\t\t\tthis._parent.map?.addEventListener(\"click\", () => this.openness = \"closed\");\n\t\t\tthis._parent.psv?.addEventListener(\"click\", () => this.openness = \"closed\");\n\t\t});\n\t}\n\n\t/** @private */\n\tattributeChangedCallback(name, old, value) {\n\t\tsuper.attributeChangedCallback(name, old, value);\n\n\t\tif(name === \"openness\") {\n\t\t\t// If not fully opened, force content scroll back to top\n\t\t\tif(value !== \"opened\") {\n\t\t\t\tconst content = this.shadowRoot.querySelector(\".content\");\n\t\t\t\tif(content) { content.scrollTop = 0; }\n\t\t\t}\n\n\t\t\t// Remove hand-defined transform\n\t\t\tconst drawer = this._getDrawer();\n\t\t\tif (drawer) { drawer.style.transform = null; }\n\t\t}\n\t}\n\n\t/** @private */\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis._cleanupTouchListeners();\n\t}\n\n\t/** @private */\n\t_getDrawer() {\n\t\treturn this.shadowRoot?.querySelector(\".drawer\");\n\t}\n\n\t/** @private */\n\t_onHandleClick() {\n\t\tif(this.openness === \"opened\") { this.openness = \"closed\"; }\n\t\telse if(this.openness === \"half-opened\") { this.openness = \"opened\"; }\n\t\telse if(this.openness === \"closed\") { this.openness = \"half-opened\"; }\n\t}\n\n\t/** @private */\n\t_onTouchStart(e) {\n\t\tthis._isDragging = true;\n\t\tthis._startFingerY = e.touches[0].clientY;\n\t\tthis._deltaFingerY = 0;\n\t\tthis._drawerY = this._drawerHeight * OPENNESS_Y_PCT[this.openness];\n\t\twindow.addEventListener(\"touchmove\", this._boundTouchMove, { passive: true });\n\t\twindow.addEventListener(\"touchend\", this._boundTouchEnd);\n\t\twindow.addEventListener(\"touchcancel\", this._boundTouchEnd);\n\t}\n\n\t/** @private */\n\t_onTouchMove(e) {\n\t\tif (!this._isDragging) return;\n\n\t\t// Check if content has scroll bar, then only move if top scrolled\n\t\tconst content = this.shadowRoot.querySelector(\".content\");\n\t\tif(content.scrollHeight > content.offsetHeight && content.scrollTop > 0) {\n\t\t\tthis._updateDrawerTransform(0);\t\n\t\t\treturn;\n\t\t}\n\n\t\tthis._deltaFingerY = e.touches[0].clientY - this._startFingerY;\n\t\tthis._updateDrawerTransform(this._drawerY + this._deltaFingerY);\n\t}\n\n\t/** @private */\n\t_onTouchEnd(e) {\n\t\t// Touchend is also called when \"clicking\" on mobile\n\t\tif ((!this._isDragging || Math.abs(this._deltaFingerY) < 30) && !e.target.closest(\".handle\")) { return; }\n\t\te.preventDefault();\n\n\t\tthis._isDragging = false;\n\n\t\tif(this._deltaFingerY === 0 && this.openness === \"closed\") {\n\t\t\tthis.openness = \"half-opened\";\n\t\t}\n\t\telse {\n\t\t\tthis._updateDrawerTransform(this._drawerY + this._deltaFingerY, true);\n\t\t}\n\n\t\tthis._cleanupTouchListeners();\n\t\tthis._startFingerY = null;\n\t\tthis._deltaFingerY = null;\n\t}\n\n\t/** @private */\n\t_cleanupTouchListeners() {\n\t\twindow.removeEventListener(\"touchmove\", this._boundTouchMove);\n\t\twindow.removeEventListener(\"touchend\", this._boundTouchEnd);\n\t\twindow.removeEventListener(\"touchcancel\", this._boundTouchCancel);\n\t}\n\n\t/** @private */\n\t_updateDrawerTransform(y, snap = false) {\n\t\tconst drawer = this._getDrawer();\n\t\tif (!drawer) { return; }\n\n\t\ty = Math.max(0, Math.min(y, this._drawerHeight - 30));\n\n\t\t// Snap to nearest static position\n\t\tif(snap) {\n\t\t\t// Gesture goes up\n\t\t\tif(this._deltaFingerY < 0) {\n\t\t\t\tif(this.openness === \"closed\") {\n\t\t\t\t\t// How much it goes up ?\n\t\t\t\t\tif(Math.abs(this._deltaFingerY) > this._drawerHeight * (1-OPENNESS_Y_PCT[\"half-opened\"])) {\n\t\t\t\t\t\tthis.openness = \"opened\";\n\t\t\t\t\t}\n\t\t\t\t\telse { this.openness = \"half-opened\"; }\n\t\t\t\t}\n\t\t\t\telse { this.openness = \"opened\"; }\n\t\t\t}\n\t\t\t// Gesture goes down\n\t\t\telse { this.openness = \"closed\"; }\n\n\t\t\tthis._drawerY = null;\n\t\t\ty = Math.max(0, Math.min(OPENNESS_Y_PCT[this.openness] * this._drawerHeight, this._drawerHeight - 30));\n\t\t}\n\n\t\tdrawer.style.transform = `translateY(${y}px)`;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst classes = {\n\t\t\t\"drawer\": true,\n\t\t\t[this.openness]: true,\n\t\t\t\"dragging\": this._isDragging,\n\t\t};\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classMap(classes)}\n\t\t\t\t@touchstart=\"${this._onTouchStart}\"\n\t\t\t\t@touchmove=\"${this._onTouchMove}\"\n\t\t\t\t@touchend=\"${this._onTouchEnd}\"\n\t\t\t>\n\t\t\t\t<div class=\"handle\" @click=${this._onHandleClick}>\n\t\t\t\t\t<div class=\"handle-bar\"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-bottom-drawer\", BottomDrawer);\n","import { LitElement, html, css } from \"lit\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\n/**\n * CorneredGrid layout offers a convenient way to display overlay widgets on top of a background component.\n * This is useful for showing buttons in corners over a map or picture display.\n * Grid layout is organised through many slots (background and corners) : two rows (top, bottom) and three columns (right, middle, left).\n * @class Panoramax.components.layout.CorneredGrid\n * @element pnx-cornered-grid\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `bg` The full size background component\n * @slot `top-left` The top-left corner\n * @slot `top` The top middle corner\n * @slot `top-right` The top-right corner\n * @slot `bottom-left` The bottom-left corner\n * @slot `bottom` The bottom middle corner\n * @slot `bottom-right` The bottom-right corner\n * @example\n * ```html\n * <pnx-cornered-grid>\n *   <pnx-map slot=\"bg\" />\n *   <pnx-button slot=\"top-left\" />\n *   <pnx-button slot=\"top-left\" />\n *   <pnx-legend slot=\"bottom\" />\n * </pnx-cornered-grid>\n * ```\n */\nexport default class CorneredGrid extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 5px;\n\t\t\tflex-wrap: no-wrap;\n\t\t}\n\n\t\t.bg {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tz-index: 0;\n\t\t}\n\n\t\t.row {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\tflex: 1 1 50%;\n\t\t\tpointer-events: none;\n\t\t\ttransition: margin 0.5s ease-in-out;\n\t\t}\n\n\t\t.row.bottom { align-items: flex-end; }\n\n\t\t.row.top.toggled { margin: -100% 0 200% 0; }\n\t\t.row.bottom.toggled { margin: 200% 0 -100% 0; }\n\t\t@media screen and (min-width: 576px) {\n\t\t\t.row.top.toggled { margin: -50% 0 100% 0; }\n\t\t\t.row.bottom.toggled { margin: 100% 0 -50% 0; }\n\t\t}\n\n\t\t.corner {\n\t\t\tposition: relative;\n\t\t\tflex: 1 1 33%;\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\theight: min-content;\n\t\t}\n\n\t\t.corner slot {\n\t\t\tpointer-events: auto;\n\t\t\tposition: relative;\n\t\t\tz-index: 120;\n\t\t}\n\n\t\t.row.bottom .corner:not(.middle) { flex-direction: column; }\n\t\t.row.bottom .corner.left { flex-direction: column-reverse; justify-content: flex-start; align-items: flex-start; }\n\t\t.row.bottom .corner.middle { justify-content: center; align-items: flex-end; }\n\t\t.row.bottom .corner.right { justify-content: flex-end; align-items: flex-end; }\n\n\t\t.row.top .corner { flex-direction: row; }\n\t\t.row.top .corner.left { justify-content: flex-start; align-items: flex-start; }\n\t\t.row.top .corner.middle { justify-content: center; }\n\t\t.row.top .corner.right { justify-content: flex-end; align-items: flex-start; }\n\t`;\n\n\t/** @private */\n\tstatic properties = {\n\t\t_hidden: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._hidden = false;\n\t}\n\n\t/**\n\t * Make all overlay components go away smoothly (one-click \"focus\")\n\t * @param {boolean} [newState] True to make widgets visible, false to hide, undefined to invert\n\t * @returns {boolean} True if widgets are hidden\n\t */\n\ttoggleAway(newState) {\n\t\tthis._hidden = newState === null || newState === undefined ? !this._hidden : !newState;\n\t\treturn this._hidden;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tthis.renderRoot.host.className = this._hidden ? \"toggled\" : \"\";\n\t\treturn html`\n\t\t\t<div class=\"bg\">\n\t\t\t\t<slot name=\"bg\"></slot>\n\t\t\t</div>\n\t\t\t<div class=${classMap({row: true, top: true, toggled: this._hidden})}>\n\t\t\t\t<div class=\"corner left\" part=\"corner-top-left\">\n\t\t\t\t\t<slot name=\"top-left\"></slot>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"corner middle\" part=\"corner-top\">\n\t\t\t\t\t<slot name=\"top\"></slot>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"corner right\" part=\"corner-top-right\">\n\t\t\t\t\t<slot name=\"top-right\"></slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=${classMap({row: true, bottom: true, toggled: this._hidden})}>\n\t\t\t\t<div class=\"corner left\" part=\"corner-bottom-left\">\n\t\t\t\t\t<slot name=\"bottom-left\"></slot>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"corner middle\" part=\"corner-bottom\">\n\t\t\t\t\t<slot name=\"bottom\"></slot>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"corner right\" part=\"corner-bottom-right\">\n\t\t\t\t\t<slot name=\"bottom-right\"></slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-cornered-grid\", CorneredGrid);\n","import { LitElement, html, css } from \"lit\";\nimport SwitchBig from \"../../img/switch_big.svg\";\nimport SwitchMini from \"../../img/switch_mini.svg\";\n\n/**\n * Mini layout allows to show a reduced or collapsed component in a corner of a main component.\n * For example, show a reduced map on top of a photo display.\n * @class Panoramax.components.layout.Mini\n * @element pnx-mini\n * @slot `default` The component to display.\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.layout.Mini#expand\n * @example\n * ```html\n * <pnx-mini icon=${fa(faMap)} ._parent=${viewer}>\n *   <pnx-map />\n * </pnx-mini>\n * ```\n */\nexport default class Mini extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tpointer-events: none;\n\t\t}\n\n\t\tslot {\n\t\t\tz-index: 120;\n\t\t\tpointer-events: auto;\n\t\t}\n\n\t\tpnx-button {\n\t\t\tz-index: 121;\n\t\t\tposition: absolute;\n\t\t\tpointer-events: auto;\n\t\t}\n\n\t\tpnx-button img {\n\t\t\theight: 20px;\n\t\t}\n\n\t\tpnx-button:not([size=\"xxl\"])::part(btn) {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.layout.Mini#\n\t * @type {Object}\n\t * @property {string} [icon] The icon to use in collapsed button.\n\t * @property {boolean} [collapsed=false] Collapsed displays only a simple button.\n\t */\n\tstatic properties = {\n\t\ticon: {type: String},\n\t\tcollapsed: {type: Boolean, reflect: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.collapsed = false;\n\t\tthis.icon = null;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst isSmall = this._parent?.isWidthSmall() || this._parent?.isHeightSmall();\n\n\t\t/**\n\t\t * Event when user ask for component expand\n\t\t * @event Panoramax.components.layout.Mini#expand\n\t\t * @type {Event}\n\t\t */\n\t\tconst onExpand = () => this.dispatchEvent(new Event(\"expand\", {bubbles: true, composed: true}));\n\t\t\n\t\tif(this.collapsed || isSmall) {\n\t\t\tconst click = isSmall ? onExpand : () => this.collapsed = false;\n\t\t\treturn html`<pnx-button\n\t\t\t\tkind=\"flat\"\n\t\t\t\tsize=\"xxl\"\n\t\t\t\tstyle=\"bottom: 0\"\n\t\t\t\t@click=${click}\n\t\t\t>${this.icon}</pnx-button>`;\n\t\t}\n\t\telse {\n\t\t\treturn html`\n\t\t\t\t<slot></slot>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.expand_info}\n\t\t\t\t\tstyle=\"top: 0; right: 0\"\n\t\t\t\t\t@click=${onExpand}\n\t\t\t\t>\n\t\t\t\t\t<img src=${SwitchBig} alt=\"\" />\n\t\t\t\t\t${this._parent?._t.pnx.expand}\n\t\t\t\t</pnx-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"flat\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.minimize}\n\t\t\t\t\tstyle=\"bottom: 0; left: 0\"\n\t\t\t\t\t@click=${() => this.collapsed = true}\n\t\t\t\t>\n\t\t\t\t\t<img src=${SwitchMini} alt=\"\" />\n\t\t\t\t</pnx-button>\n\t\t\t`;\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-mini\", Mini);\n","import { LitElement, html, css, nothing } from \"lit\";\n\n/**\n * Tabs offers a nice paged content rendering based on tabs buttons.\n * The list of tab names are passed through `title` slots, and content using `content` slots.\n * Note that tab names and contents should respect a coherent order.\n * @class Panoramax.components.layout.Tabs\n * @element pnx-tabs\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `title` A single tab name\n * @slot `content` A single tab content\n * @example\n * ```html\n * <pnx-tabs>\n *   <h4 slot=\"title\">Tab 1</h4>\n *   <div slot=\"content\">Tab 1 content</div>\n * \n *   <h4 slot=\"title\">Tab 2</h4>\n *   <div slot=\"content\">Tab 2 content</div>\n * \n *   <h4 slot=\"title\">Tab 3</h4>\n *   <div slot=\"content\">Tab 3 content</div>\n * </pnx-tabs>\n * ```\n */\nexport default class Tabs extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t/* Tabs */\n\t\tnav {\n\t\t\tdisplay: flex;\n\t\t\tgap: 5px;\n\t\t\talign-items: stretch;\n\t\t\toverflow-x: auto;\n\t\t\ttouch-action: pan-x;\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tbackground: white;\n\t\t\tz-index: 125;\n\t\t}\n\t\tnav ::slotted(*) {\n\t\t\tcolor: var(--grey-dark);\n\t\t\tborder-bottom: 2px solid rgba(0,0,0,0);\n\t\t\tcursor: pointer;\n\t\t\ttransition: all 0.1s;\n\t\t\tflex: 1;\n\t\t}\n\t\tnav ::slotted(*:hover:not(.active)) { background-color: var(--blue-pale); }\n\t\tnav ::slotted(*.active) {\n\t\t\tcolor: var(--blue-dark);\n\t\t\tborder-bottom: 2px solid var(--blue-dark);\n\t\t}\n\n\t\t/* Content */\n\t\t.contents ::slotted(div) { display: none !important; }\n\t\t.contents ::slotted(.active) { display: block !important; }\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.layout.Tabs#\n\t * @type {Object}\n\t * @property {string} [activeTabIndex=0] The selected tab index\n\t * @property {boolean} [hideNav=false] Hide nav\n\t */\n\tstatic properties = {\n\t\tactiveTabIndex: {type: Number, reflect: true},\n\t\thideNav: {type: Boolean},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.activeTabIndex = 0;\n\t\tthis.hideNav = false;\n\t}\n\n\t/** @private */\n\t_getTabs() {\n\t\treturn this.shadowRoot.querySelector(\"slot[name='title']\")?.assignedNodes() || [];\n\t}\n\n\t/** @private */\n\t_getContents() {\n\t\treturn this.shadowRoot.querySelector(\"slot[name='content']\")?.assignedNodes() || [];\n\t}\n\n\t/** @private */\n\t_changeTab(tabTarget, tabIndex) {\n\t\tconst tabs = this._getTabs();\n\t\tconst contents = this._getContents();\n\n\t\t// Check if tab change is possible\n\t\tif(tabTarget !== undefined || tabIndex !== undefined) {\n\t\t\t// For tab target, check if a nav tab has really been clicked\n\t\t\tif(tabTarget) { tabIndex = tabs.findIndex(tab => (\n\t\t\t\ttab === tabTarget || tab === tabTarget.parentNode\n\t\t\t)); }\n\n\t\t\tif(!isNaN(tabIndex) && tabIndex >= 0 && tabIndex < tabs.length) {\n\t\t\t\ttabs.forEach((tab, index) => {\n\t\t\t\t\tif (index == tabIndex) {\n\t\t\t\t\t\tthis.activeTabIndex = index;\n\t\t\t\t\t\tcontents[index].classList.add(\"active\");\n\t\t\t\t\t\ttab.classList.add(\"active\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontents[index].classList.remove(\"active\");\n\t\t\t\t\t\ttab.classList.remove(\"active\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\n\t/** @private */\n\t_handleTabClick(event) {\n\t\tthis._changeTab(event.target);\n\t}\n\n\t/** @private */\n\tupdated(changedProperties) {\n\t\tif(changedProperties.has(\"activeTabIndex\")) {\n\t\t\tthis._changeTab(undefined, this.activeTabIndex);\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t${!this.hideNav ? html`<nav @click=\"${this._handleTabClick}\">\n\t\t\t\t<slot name=\"title\" @slotchange=${() => this.activeTabIndex = 0}></slot>\n\t\t\t</nav>` : nothing}\n\t\t\t<div class=\"contents\">\n\t\t\t\t<slot name=\"content\"></slot>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-tabs\", Tabs);\n","import { LitElement, html } from \"lit\";\nimport { faSvg, titles, docPopup } from \"../styles\";\nimport { fa } from \"../../utils/widgets\";\nimport { faMapMarkerAlt } from \"@fortawesome/free-solid-svg-icons/faMapMarkerAlt\";\nimport { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons/faExternalLinkAlt\";\nimport { QUALITYSCORE_GPS_VALUES } from \"../../utils/utils\";\n\n/**\n * Location Precision Doc displays a synthetic summary of how Location Precision filter and map theme works.\n * @class Panoramax.components.menus.LocationPrecisionDoc\n * @element pnx-location-precision-doc\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-location-precision-doc ._t=${viewer._t} />\n * ```\n */\nexport default class LocationPrecisionDoc extends LitElement {\n\tstatic styles = [ titles, faSvg, docPopup ];\n\n\trender() {\n\t\t/* eslint-disable indent */\n\t\treturn html`\n\t\t\t<h4>${fa(faMapMarkerAlt)} ${this._t?.pnx.filter_gps_precision}</h4>\n\t\t\t<p>${this._t?.pnx.filter_gps_precision_help_1}</p>\n\t\t\t<p>${this._t?.pnx.filter_gps_precision_help_2}</p>\n\t\t\t<pnx-grade-filter grade=\"\"></pnx-grade-filter>\n\t\t\t<p>${this._t?.pnx.filter_gps_precision_help_3\n\t\t\t\t.replace(\"{p5}\", QUALITYSCORE_GPS_VALUES[1])\n\t\t\t\t.replace(\"{p1}\", QUALITYSCORE_GPS_VALUES[7])\n\t\t\t\t.replace(/\\.01/g, \"\")\n\t\t\t}</p>\n\t\t\t<p>${this._t?.pnx.filter_gps_precision_help_4}</p>\n\t\t\t<pnx-link-button\n\t\t\t\thref=\"https://docs.panoramax.fr/pictures-metadata/quality_score/#gps-position-accuracy\"\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\tkind=\"outline\"\n\t\t\t\tstyle=\"width: 100%\"\n\t\t\t>${fa(faExternalLinkAlt)} ${this._t?.pnx.popup_details_link}</pnx-link-button>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-location-precision-doc\", LocationPrecisionDoc);\n","import { LitElement, html, css } from \"lit\";\nimport BackgroundAerial from \"../../img/bg_aerial.jpg\";\nimport BackgroundStreets from \"../../img/bg_streets.jpg\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\n\n\n/**\n * Map Background menu allows user to select background.\n * @class Panoramax.components.menus.MapBackground\n * @element pnx-map-background\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-map-background size=\"sm\" _parent=${viewer} />\n * ```\n */\nexport default class MapBackground extends LitElement {\n\t/** @private */\n\tstatic styles = [ css`\n\t\t:host {\n\t\t\tjustify-content: space-evenly;\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t}\n\t\tinput { display: none; }\n\t\tlabel { cursor: pointer; }\n\n\t\timg {\n\t\t\twidth: 40px;\n\t\t\tborder-radius: 5px;\n\t\t\tvertical-align: middle;\n\t\t\tmargin-right: 5px;\n\t\t\tborder: 2px solid var(--widget-bg);\n\t\t}\n\n\t\timg.sm {\n\t\t\twidth: 32px;\n\t\t}\n\n\t\tinput:checked + label img {\n\t\t\toutline: 3px solid var(--widget-border-btn);\n\t\t}\n\t` ];\n\n\t/**\n     * Component properties.\n\t * @memberof Panoramax.components.menus.MapBackground#\n     * @type {Object}\n     * @property {string} [size=md] The size of the button (sm, md)\n     */\n\tstatic properties = {\n\t\tbg: {state: true},\n\t\tsize: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.size = \"md\";\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this).then(() => {\n\t\t\tthis._parent.map?.on(\"background-changed\", e => {\n\t\t\t\tthis.bg = e.background;\n\t\t\t});\n\t\t\tthis.bg = this._parent.map?.getBackground();\n\t\t});\n\t}\n\n\t/** @private */\n\t_onBgSelect(e) {\n\t\tthis.bg = e.target.value;\n\t\tthis._parent?.map?.setBackground(this.bg);\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tid=\"bg-streets\"\n\t\t\t\tname=\"bg\"\n\t\t\t\tvalue=\"streets\"\n\t\t\t\t@change=${this._onBgSelect}\n\t\t\t\t.checked=${this.bg == \"streets\"}\n\t\t\t/>\n\t\t\t<label for=\"bg-streets\">\n\t\t\t\t<img src=${BackgroundStreets} class=${this.size} alt=\"\" />\n\t\t\t\t${this._parent?._t.pnx.map_background_streets}\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tid=\"bg-aerial\"\n\t\t\t\tname=\"bg\"\n\t\t\t\tvalue=\"aerial\"\n\t\t\t\t@change=${this._onBgSelect}\n\t\t\t\t.checked=${this.bg == \"aerial\"}\n\t\t\t/>\n\t\t\t<label for=\"bg-aerial\">\n\t\t\t\t<img src=${BackgroundAerial} class=${this.size} alt=\"\" />\n\t\t\t\t${this._parent?._t.pnx.map_background_aerial}\n\t\t\t</label>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-map-background\", MapBackground);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { getUserAccount } from \"../../utils/utils\";\nimport { faSvg, titles } from \"../styles\";\nimport { faImage } from \"@fortawesome/free-solid-svg-icons/faImage\";\nimport { faCalendar } from \"@fortawesome/free-solid-svg-icons/faCalendar\";\nimport { faArrowRight } from \"@fortawesome/free-solid-svg-icons/faArrowRight\";\nimport { faMedal } from \"@fortawesome/free-solid-svg-icons/faMedal\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport { faUser } from \"@fortawesome/free-solid-svg-icons/faUser\";\nimport { faMapMarkerAlt } from \"@fortawesome/free-solid-svg-icons/faMapMarkerAlt\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\nimport { QUALITYSCORE_GPS_VALUES } from \"../../utils/utils\";\n\n/**\n * Map Filters menu allows user to select map data they want displayed.\n * @class Panoramax.components.menus.MapFilters\n * @element pnx-map-filters-menu\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-map-filters-menu user-search=\"\" _parent=${viewer} />\n * ```\n */\nexport default class MapFilters extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, titles, css`\n\t\t.pnx-input-group {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 5px;\n\t\t}\n\n\t\t/* Filter block */\n\t\t.pnx-filter-block {\n\t\t\tposition: relative;\n\t\t\tpadding: 10px 15px;\n\t\t\tborder-bottom: 2px solid var(--widget-border-div);\n\t\t}\n\t\t.pnx-filter-block:first-child {\n\t\t\tpadding-top: 15px;\n\t\t}\n\t\t.pnx-filter-block:last-child {\n\t\t\tborder-bottom: none;\n\t\t\tpadding-bottom: 15px;\n\t\t}\n\t\t.pnx-filter-block h4 {\n\t\t\tmargin-bottom: 5px;\n\t\t}\n\t\t.pnx-filter-zoomin {\n\t\t\tz-index: 131;\n\t\t\tbackground-color: rgba(255,255,255,0.8);\n\t\t\ttext-align: center;\n\t\t\tfont-weight: 800;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tleft: 0;\n\t\t\tbottom: 0;\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tborder-radius: 25px;\n\t\t}\n\t\t.pnx-filter-zoomin.hidden {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t/* Input styles */\n\t\t.pnx-filter-active,\n\t\tpnx-search-bar.pnx-filter-active::part(container),\n\t\tpnx-search-bar.pnx-filter-active::part(input) {\n\t\t\tbackground-color: var(--widget-bg-active) !important;\n\t\t\tborder-color: var(--widget-bg-active) !important;\n\t\t\tcolor: var(--widget-font-active) !important;\n\t\t}\n\t\tinput[type=date] {\n\t\t\tmin-width: 0;\n\t\t\tflex-grow: 2;\n\t\t\tpadding: 2px 0;\n\t\t\ttext-align: center;\n\t\t\tbackground-color: var(--widget-bg);\n\t\t\tcolor: var(--widget-font);\n\t\t\tborder: 1px solid var(--widget-border-div);\n\t\t\tborder-radius: 20px;\n\t\t\tfont-family: var(--font-family);\n\t\t}\n\n\t\t/* Input shortcuts */\n\t\t.pnx-input-shortcuts {\n\t\t\tmargin-top: 0px;\n\t\t\tmargin-bottom: 5px;\n\t\t}\n\t\t.pnx-input-shortcuts button {\n\t\t\tborder: none;\n\t\t\tfont-size: 0.75em;\n\t\t\tpadding: 2px 6px;\n\t\t\tvertical-align: middle;\n\t\t\tbackground-color: var(--grey-pale);\n\t\t\tcolor: var(--black);\n\t\t\tborder-radius: 10px;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: var(--font-family);\n\t\t}\n\t\t.pnx-input-shortcuts button:hover {\n\t\t\tbackground-color: #d9dcd9;\n\t\t}\n\n\t\t/* Checkbox looking like buttons */\n\t\t.pnx-input-group.pnx-checkbox-btns {\n\t\t\tgap: 0;\n\t\t\talign-items: stretch;\n\t\t}\n\t\t.pnx-checkbox-btns label {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 2px 7px;\n\t\t\tbackground: none;\n\t\t\tborder: 1px solid var(--widget-border-btn);\n\t\t\tcolor: var(--widget-font-direct);\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 16px;\n\t\t\ttext-decoration: none;\n\t\t\tborder-left-width: 0px;\n\t\t}\n\t\t.pnx-checkbox-btns label:hover {\n\t\t\tbackground-color: var(--widget-bg-hover);\n\t\t}\n\t\t.pnx-checkbox-btns label:first-of-type {\n\t\t\tborder-top-left-radius: 8px;\n\t\t\tborder-bottom-left-radius: 8px;\n\t\t\tborder-left-width: 1px;\n\t\t}\n\t\t.pnx-checkbox-btns label:last-of-type {\n\t\t\tborder-top-right-radius: 8px;\n\t\t\tborder-bottom-right-radius: 8px;\n\t\t}\n\t\t.pnx-checkbox-btns input[type=\"radio\"] { display: none; }\n\t\t.pnx-checkbox-btns input[type=\"radio\"]:checked + label {\n\t\t\tbackground-color: var(--widget-bg-active);\n\t\t\tcolor: var(--widget-font-active);\n\t\t}\n\t\t.pnx-checkbox-btns input[type=\"radio\"]:checked + label:first-of-type {\n\t\t\tborder-right-color: white;\n\t\t}\n\n\t\t/* Force user search width */\n\t\t#pnx-filter-search-user::part(container) { width: 100%; }\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.MapFilters#\n\t * @type {Object}\n\t * @property {boolean} [user-search=false] Should user search filter show up ?\n\t * @property {boolean} [quality-score=false] Should quality score filter show up ?\n\t * @property {boolean} [no-date=false] Should date filters be hidden ?\n\t * @property {boolean} [no-picture-type=false] Should picture type filter be hidden ?\n\t * @property {boolean} [no-gps=false] Should GPS precision filter be hidden ?\n\t */\n\tstatic properties = {\n\t\t\"quality-score\": {type: Boolean},\n\t\t\"user-search\": {type: Boolean},\n\t\t\"no-date\": {type: Boolean},\n\t\t\"no-picture-type\": {type: Boolean},\n\t\t\"no-gps\": {type: Boolean},\n\t\tshowZoomIn: {state: true},\n\t\tminDate: {state: true},\n\t\tmaxDate: {state: true},\n\t\ttype: {state: true},\n\t\tscore: {state: true},\n\t\tuser: {state: true},\n\t\tgps: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._formDelay = null;\n\t\tthis.showZoomIn = true;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\t// Input changes\n\t\tfor(let i of this.shadowRoot.querySelectorAll(\"input\")) {\n\t\t\ti.addEventListener(\"change\", this._onFormChange.bind(this));\n\t\t\ti.addEventListener(\"keypress\", this._onFormChange.bind(this));\n\t\t\ti.addEventListener(\"paste\", this._onFormChange.bind(this));\n\t\t\ti.addEventListener(\"input\", this._onFormChange.bind(this));\n\t\t}\n\n\t\t// Map zoom\n\t\tonceParentAvailable(this).then(() => this._parent.onceMapReady?.().then(async () => {\n\t\t\tthis._parent.map.on(\"zoomend\", this._onMapZoom.bind(this));\n\t\t\tthis._parent.map.on(\"filters-changed\", this._onParentFilterChange.bind(this));\n\t\t\tthis._onMapZoom();\n\t\t\tthis._onParentFilterChange(this._parent.map._mapFilters);\n\n\t\t\t// Load default users filter\n\t\t\tconst vu = this._parent.map.getVisibleUsers();\n\t\t\tif(vu?.length > 0 && vu[0] != \"geovisio\") {\n\t\t\t\tthis.user = vu[0];\n\t\t\t\tconst username = await this._parent.api.getUserName(vu[0]);\n\t\t\t\tif(username) { this.user = username; }\n\t\t\t}\n\t\t}));\n\t}\n\n\t/**\n\t * Map zoom event handler: show/hide \"zoom in\" labels\n\t * @private\n\t */\n\t_onMapZoom() {\n\t\tthis.showZoomIn = this._parent.map.getZoom() < 7;\n\t}\n\n\t/**\n\t * Filter changes on parent: update input fields\n\t * @private\n\t */\n\t_onParentFilterChange(e) {\n\t\tthis.minDate = e?.minDate || null;\n\t\tthis.maxDate = e?.maxDate || null;\n\n\t\t// Sanity check for date\n\t\tif(this.minDate && this.maxDate && this.minDate > this.maxDate) {\n\t\t\tconst prevMin = this.minDate;\n\t\t\tthis.minDate = this.maxDate;\n\t\t\tthis.maxDate = prevMin;\n\t\t\tthis._onFormChange();\n\t\t}\n\n\t\tthis.score = Array.isArray(e?.qualityscore) ? e.qualityscore.join(\",\") : \"\";\n\t\tthis.gps = e?.gps && Array.isArray(e.gps) ? e.gps.join(\",\") : (e?.gps?.length > 0 ? e.gps : \"\");\n\n\t\tthis.type = \"\";\n\t\tif(e?.pic_type && e.pic_type != \"\") {\n\t\t\tthis.type = e.pic_type == \"flat\" ? \"flat\" : \"equirectangular\";\n\t\t}\n\t}\n\n\t/** @private */\n\t_onSubmit(e) {\n\t\te.preventDefault();\n\t\tthis._onFormChange();\n\t\treturn false;\n\t}\n\n\t/** @private */\n\t_onFormChange() {\n\t\tif(this._formDelay) { clearTimeout(this._formDelay); }\n\t\tthis._formDelay = setTimeout(() => this._parent?._onMapFiltersChange(), 250);\n\t}\n\n\t/** @private */\n\t_userSearch(value) {\n\t\treturn this?._parent.api.searchUsers(value)\n\t\t\t.then(data => ((data || [])\n\t\t\t\t.map(f => ({\n\t\t\t\t\ttitle: f.label,\n\t\t\t\t\tdata: f\n\t\t\t\t}))\n\t\t\t));\n\t}\n\n\t/** @private */\n\t_onUserSearchResult(e) {\n\t\tif(e.detail) { e.target.classList.add(\"pnx-filter-active\"); }\n\t\telse { e.target.classList.remove(\"pnx-filter-active\"); }\n\t\treturn this._parent?.map?.setVisibleUsers(e.detail?.data ? [e.detail.data.id] : [\"geovisio\"]);\n\t}\n\n\t/** @private */\n\t_onReset() {\n\t\tthis.shadowRoot.querySelector(\"#pnx-filter-qualityscore\")?.setAttribute(\"grade\", \"\");\n\t\tthis.shadowRoot.querySelector(\"#pnx-filter-search-user\")?.reset();\n\t\tthis.shadowRoot.querySelector(\"#pnx-filter-gps\")?.setAttribute(\"grade\", \"\");\n\t\tthis.minDate = null;\n\t\tthis.maxDate = null;\n\t\tthis.type = \"\";\n\t\tthis.score = null;\n\t\tthis.user = null;\n\t\tthis._onFormChange();\n\t}\n\n\t/** @private */\n\t_onDateShortcut(date) {\n\t\tconst dateFromField = this.shadowRoot.getElementById(\"pnx-filter-date-from\");\n\t\tconst dateToField = this.shadowRoot.getElementById(\"pnx-filter-date-end\");\n\n\t\tif(dateFromField) {\n\t\t\tif(dateFromField.value !== date) { dateFromField.value = date; }\n\t\t\telse { dateFromField.value = \"\"; }\n\t\t}\n\n\t\tif(dateToField) { dateToField.value = \"\"; }\n\t}\n\n\t/** @private */\n\t_onMeUserSearch() {\n\t\tconst userAccount = getUserAccount();\n\t\tif(!userAccount) { return; }\n\n\t\tconst userField = this.shadowRoot.getElementById(\"pnx-filter-search-user\");\n\t\tif(!this._parent?.map?.getVisibleUsers().includes(userAccount.id)) {\n\t\t\tuserField?._onResultClick({title: userAccount.name, data: {id: userAccount.id }});\n\t\t}\n\t\telse {\n\t\t\tuserField?._onResultClick();\n\t\t}\n\t}\n\t\n\t/** @private */\n\trender() {\n\t\tconst userAccount = getUserAccount();\n\n\t\tconst gpsPrecLabels = {\n\t\t\t\"1\": this._parent?._t.pnx.filter_gps_precision_morethan\n\t\t\t\t.replace(\"{n}\", QUALITYSCORE_GPS_VALUES[7])\n\t\t\t\t.replace(/\\.01/g, \"\"),\n\t\t\t\"2\": this._parent?._t.pnx.filter_gps_precision_between\n\t\t\t\t.replace(\"{n1}\", QUALITYSCORE_GPS_VALUES[5])\n\t\t\t\t.replace(\"{n2}\", QUALITYSCORE_GPS_VALUES[7])\n\t\t\t\t.replace(/\\.01/g, \"\"),\n\t\t\t\"3\": this._parent?._t.pnx.filter_gps_precision_between\n\t\t\t\t.replace(\"{n1}\", QUALITYSCORE_GPS_VALUES[3])\n\t\t\t\t.replace(\"{n2}\", QUALITYSCORE_GPS_VALUES[5])\n\t\t\t\t.replace(/\\.01/g, \"\"),\n\t\t\t\"4\": this._parent?._t.pnx.filter_gps_precision_between\n\t\t\t\t.replace(\"{n1}\", QUALITYSCORE_GPS_VALUES[1])\n\t\t\t\t.replace(\"{n2}\", QUALITYSCORE_GPS_VALUES[3])\n\t\t\t\t.replace(/\\.01/g, \"\"),\n\t\t\t\"5\": this._parent?._t.pnx.filter_gps_precision_lessthan\n\t\t\t\t.replace(\"{n}\", QUALITYSCORE_GPS_VALUES[1])\n\t\t\t\t.replace(/\\.01/g, \"\"),\n\t\t};\n\n\t\treturn html`<form\n\t\t\t@reset=${this._onReset}\n\t\t\t@change=${this._onFormChange}\n\t\t\t@submit=${this._onSubmit}\n\t\t>\n\t\t\t${this[\"no-date\"] ? \"\" : html`<div class=\"pnx-filter-block\">\n\t\t\t\t<div class=\"pnx-filter-zoomin ${this.showZoomIn ? \"\" : \"hidden\"}\">${this._parent?._t.pnx.filter_zoom_in}</div>\n\t\t\t\t<h4>${fa(faCalendar)} ${this._parent?._t.pnx.filter_date}</h4>\n\t\t\t\t<div class=\"pnx-input-shortcuts\">\n\t\t\t\t\t<button\n\t\t\t\t\t\t@click=${() => this._onDateShortcut(new Date(new Date().setMonth(new Date().getMonth() - 1)).toISOString().split(\"T\")[0])}\n\t\t\t\t\t>${this._parent?._t.pnx.filter_date_1month}</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\t@click=${() => this._onDateShortcut(new Date(new Date().setMonth(new Date().getMonth() - 6)).toISOString().split(\"T\")[0])}\n\t\t\t\t\t>${this._parent?._t.pnx.filter_date_6months}</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\t@click=${() => this._onDateShortcut(new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString().split(\"T\")[0])}\n\t\t\t\t\t>${this._parent?._t.pnx.filter_date_1year}</button>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"pnx-input-group\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\tid=\"pnx-filter-date-from\"\n\t\t\t\t\t\t.value=${this.minDate}\n\t\t\t\t\t\tclass=${this.minDate && this.minDate != \"\" ? \"pnx-filter-active\" : \"\"}\n\t\t\t\t\t/>\n\t\t\t\t\t${fa(faArrowRight)}\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"date\"\n\t\t\t\t\t\tid=\"pnx-filter-date-end\"\n\t\t\t\t\t\t.value=${this.maxDate}\n\t\t\t\t\t\tclass=${this.maxDate && this.maxDate != \"\" ? \"pnx-filter-active\" : \"\"}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>`}\n\n\t\t\t${this[\"no-picture-type\"] ? \"\" : html`<div class=\"pnx-filter-block\">\n\t\t\t\t<h4>${fa(faImage)} ${this._parent?._t.pnx.filter_picture}</h4>\n\t\t\t\t<div class=\"pnx-input-group pnx-checkbox-btns\" style=\"justify-content: center;\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tid=\"pnx-filter-type-all\"\n\t\t\t\t\t\tname=\"pnx-filter-type\"\n\t\t\t\t\t\tvalue=\"\"\n\t\t\t\t\t\t.checked=${!this.type || this.type === \"\"}\n\t\t\t\t\t/>\n\t\t\t\t\t<label for=\"pnx-filter-type-all\">${this._parent?._t.pnx.picture_all}</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tid=\"pnx-filter-type-flat\"\n\t\t\t\t\t\tname=\"pnx-filter-type\"\n\t\t\t\t\t\tvalue=\"flat\"\n\t\t\t\t\t\t.checked=${this.type === \"flat\"}\n\t\t\t\t\t/>\n\t\t\t\t\t<label for=\"pnx-filter-type-flat\">${this._parent?._t.pnx.picture_flat}</label>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tid=\"pnx-filter-type-360\"\n\t\t\t\t\t\tname=\"pnx-filter-type\"\n\t\t\t\t\t\tvalue=\"equirectangular\"\n\t\t\t\t\t\t.checked=${this.type === \"equirectangular\"}\n\t\t\t\t\t/>\n\t\t\t\t\t<label for=\"pnx-filter-type-360\">${this._parent?._t.pnx.picture_360}</label>\n\t\t\t\t</div>\n\t\t\t</div>`}\n\n\t\t\t${this[\"quality-score\"] ? html`\n\t\t\t\t<div class=\"pnx-filter-block\">\n\t\t\t\t\t<div class=\"pnx-filter-zoomin ${this.showZoomIn ? \"\" : \"hidden\"}\">${this._parent?._t.pnx.filter_zoom_in}</div>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t${fa(faMedal)} ${this._parent?._t.pnx.filter_qualityscore}\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\ttitle=\"${this._parent?._t.pnx.metadata_quality_help}\"\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\t@click=${() => this._parent?._showQualityScoreDoc()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faInfoCircle)}\n\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t</h4>\n\t\t\t\t\t<div class=\"pnx-input-group\">\n\t\t\t\t\t\t<pnx-quality-score\n\t\t\t\t\t\t\tid=\"pnx-filter-qualityscore\"\n\t\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\t\tinput=\"pnx-filter-qualityscore\"\n\t\t\t\t\t\t\tgrade=${this.score}\n\t\t\t\t\t\t\t@change=${this._onFormChange}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t</pnx-quality-score>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t` : nothing}\n\n\t\t\t${this[\"no-gps\"] ? \"\" : html`\n\t\t\t\t<div class=\"pnx-filter-block\">\n\t\t\t\t\t<div class=\"pnx-filter-zoomin ${this.showZoomIn ? \"\" : \"hidden\"}\">${this._parent?._t.pnx.filter_zoom_in}</div>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t${fa(faMapMarkerAlt)} ${this._parent?._t.pnx.filter_gps_precision}\n\t\t\t\t\t\t${this._parent._showLocationPrecisionDoc ? html`\n\t\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\t\ttitle=\"${this._parent?._t.pnx.filter_gps_precision_help}\"\n\t\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\t\t@click=${() => this._parent._showLocationPrecisionDoc()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${fa(faInfoCircle)}\n\t\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t` : nothing}\n\t\t\t\t\t</h4>\n\t\t\t\t\t<div class=\"pnx-input-group\">\n\t\t\t\t\t\t<pnx-grade-filter\n\t\t\t\t\t\t\tid=\"pnx-filter-gps\"\n\t\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\t\tinput=\"pnx-filter-gps\"\n\t\t\t\t\t\t\tgrade=${this.gps}\n\t\t\t\t\t\t\t@change=${this._onFormChange}\n\t\t\t\t\t\t\t.labels=${gpsPrecLabels}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t</pnx-grade-filter>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t`}\n\n\t\t\t${this[\"user-search\"] ? html`\n\t\t\t\t<div class=\"pnx-filter-block\">\n\t\t\t\t\t<h4>${fa(faUser)} ${this._parent?._t.pnx.filter_user}</h4>\n\t\t\t\t\t${userAccount ? html`\n\t\t\t\t\t\t<div class=\"pnx-input-shortcuts\">\n\t\t\t\t\t\t\t<button @click=${this._onMeUserSearch}>\n\t\t\t\t\t\t\t\t${this._parent?._t.pnx.filter_user_mypics}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t` : nothing}\n\t\t\t\t\t<pnx-search-bar\n\t\t\t\t\t\tid=\"pnx-filter-search-user\"\n\t\t\t\t\t\tplaceholder=${this._parent?._t.pnx.search_user}\n\t\t\t\t\t\tclass=${this.user ? \"pnx-filter-active\" : \"\"}\n\t\t\t\t\t\tvalue=${this.user}\n\t\t\t\t\t\t@result=${this._onUserSearchResult}\n\t\t\t\t\t\t.searcher=${this._userSearch.bind(this)}\n\t\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t\t\tno-menu-closure\n\t\t\t\t\t>\n\t\t\t\t\t</pnx-search-bar>\n\t\t\t\t</div>\n\t\t\t` : nothing}\n\t\t</form>`;\n\t}\n}\n\ncustomElements.define(\"pnx-map-filters-menu\", MapFilters);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { faSvg, titles, select } from \"../styles\";\nimport { COLORS, GPS_VALUES } from \"../../utils/utils\";\nimport { faEarthEurope } from \"@fortawesome/free-solid-svg-icons/faEarthEurope\";\nimport { faPalette } from \"@fortawesome/free-solid-svg-icons/faPalette\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\nimport { MAP_THEMES } from \"../../utils/map\";\nimport { DISABLED_LEVEL } from \"../../utils/indoor\";\n\n/**\n * Map Layers menu allows user to select background and map theme.\n * @class Panoramax.components.menus.MapLayers\n * @element pnx-map-layers-menu\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-map-layers-menu _parent=${viewer} />\n * ```\n */\nexport default class MapLayers extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, titles, select, css`\n\t\t.legend {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tmargin-top: 5px;\n\t\t\tjustify-content: space-evenly;\n\t\t}\n\n\t\t.legend-entry {\n\t\t\tmargin: 10px 8px 5px 0px;\n\t\t\tline-height: 12px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tfont-size: 1.0em;\n\t\t}\n\n\t\t.legend-color {\n\t\t\tdisplay: inline-block;\n\t\t\twidth: 15px;\n\t\t\theight: 15px;\n\t\t\tborder-radius: 3px;\n\t\t\tmargin-right: 5px;\n\t\t}\n\n\t\t.legend-score {\n\t\t\tjustify-content: center;\n\t\t\tgap: 0;\n\t\t}\n\t` ];\n\n\t/** @private */\n\tstatic properties = {\n\t\ttheme: {state: true},\n\t};\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this._parent?.onceMapReady?.().then(() => {\n\t\t\tthis.theme = this._parent.map._mapFilters.theme;\n\t\t\tthis._parent.map.on(\"filters-changed\", e => this.theme = e.theme);\n\t\t\tthis._parent.map.indoorEqual?.on(\"levelschange\", () => this.requestUpdate());\n\t\t\tthis._parent.map.indoorEqual?.on(\"levelchange\", () => this.requestUpdate());\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onThemeSelect(e) {\n\t\tthis.theme = e.target.value;\n\t\tthis._parent?._onMapFiltersChange();\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst parts = [];\n\n\t\t// Background selector\n\t\tif(this._parent?.map?.hasTwoBackgrounds?.()) {\n\t\t\tparts.push(html`\n\t\t\t\t<h4>${fa(faEarthEurope)} ${this._parent?._t.pnx.map_background}</h4>\n\t\t\t\t<pnx-map-background ._parent=${this._parent}></pnx-map-background>\n\t\t\t`);\n\t\t}\n\n\t\t// Level selector for indoor=\n\t\tif(this._parent?.map?.indoorEqual) {\n\t\t\tconst ieq = this._parent.map.indoorEqual;\n\t\t\tparts.push(html`\n\t\t\t\t<pnx-switch\n\t\t\t\t\t.checked=${ieq.level !== DISABLED_LEVEL}\n\t\t\t\t\t.disabled=${ieq.levels.length === 0}\n\t\t\t\t\t@change=${e => ieq.setLevel(e.target.checked ? \"0\" : DISABLED_LEVEL)}\n\t\t\t\t\tstyle=\"display: block; margin: 15px 0;\"\n\t\t\t\t\tname=\"pnx-level-switch\"\n\t\t\t\t>\n\t\t\t\t\t${this._parent?._t.pnx.indoor_switch}\n\t\t\t\t</pnx-switch>\n\t\t\t`);\n\t\t}\n\n\t\t// Map theme selector\n\t\tparts.push(html`\n\t\t\t<h4>${fa(faPalette)} ${this._parent?._t.pnx.map_theme}</h4>\n\t\t\t<select id=\"pnx-map-theme\" style=\"width: 100%;\" @change=${this._onThemeSelect}>\n\t\t\t\t<option value=${MAP_THEMES.DEFAULT} .selected=${this.theme == MAP_THEMES.DEFAULT}>${this._parent?._t.pnx.map_theme_default}</option>\n\t\t\t\t<option value=${MAP_THEMES.AGE} .selected=${this.theme == MAP_THEMES.AGE}>${this._parent?._t.pnx.map_theme_age}</option>\n\t\t\t\t<option value=${MAP_THEMES.TYPE} .selected=${this.theme == MAP_THEMES.TYPE}>${this._parent?._t.pnx.map_theme_type}</option>\n\t\t\t\t${this._parent?.map?._hasQualityScore?.() && html`\n\t\t\t\t\t<option value=${MAP_THEMES.SCORE} .selected=${this.theme == MAP_THEMES.SCORE}>${this._parent?._t.pnx.map_theme_score}</option>\n\t\t\t\t\t<option value=${MAP_THEMES.GPS} .selected=${this.theme == MAP_THEMES.GPS}>${this._parent?._t.pnx.map_theme_gps}</option>\n\t\t\t\t`}\n\t\t\t</select>\n\t\t`);\n\n\t\t// Map legend\n\t\tparts.push(html`<div class=\"legend\">\n\t\t\t${this.theme == MAP_THEMES.AGE ? html`\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${COLORS[\"PALETTE_4\"]}\"></span>\n\t\t\t\t\t\t${this._parent?._t.pnx[\"map_theme_age_4\"]}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${COLORS[\"PALETTE_3\"]}\"></span>\n\t\t\t\t\t\t${this._parent?._t.pnx[\"map_theme_age_3\"]}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${COLORS[\"PALETTE_2\"]}\"></span>\n\t\t\t\t\t\t${this._parent?._t.pnx[\"map_theme_age_2\"]}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${COLORS[\"PALETTE_1\"]}\"></span>\n\t\t\t\t\t\t${this._parent?._t.pnx[\"map_theme_age_1\"]}\n\t\t\t\t\t</div>\n\t\t\t\t</div>` : nothing}\n\t\t\t\n\t\t\t${this.theme == MAP_THEMES.TYPE ? html`\n\t\t\t \t<div class=\"legend-entry\">\n\t\t\t \t\t<span class=\"legend-color\" style=\"background-color: ${COLORS.QUALI_1}\"></span>\n\t\t\t \t\t${this._parent?._t.pnx.picture_360}\n\t\t\t \t</div>\n\t\t\t \t<div class=\"legend-entry\">\n\t\t\t \t\t<span class=\"legend-color\" style=\"background-color: ${COLORS.QUALI_2}\"></span>\n\t\t\t \t\t${this._parent?._t.pnx.picture_flat}\n\t\t\t \t</div>` : nothing}\n\t\t\t\n\t\t\t${this.theme == MAP_THEMES.SCORE ? html`<div>\n\t\t\t\t<pnx-quality-score></pnx-quality-score>\n\t\t\t\t<pnx-button\n\t\t\t\t\ttitle=\"${this._parent?._t.pnx.metadata_quality_help}\"\n\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t@click=${() => this._parent?._showQualityScoreDoc()}\n\t\t\t\t>\n\t\t\t\t\t${fa(faInfoCircle)}\n\t\t\t\t</pnx-button></div>` : nothing}\n\t\t\t\n\t\t\t${this.theme == MAP_THEMES.GPS ? html`\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${GPS_VALUES[0].color}\"></span>\n\t\t\t\t\t\t${GPS_VALUES[0].label}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${GPS_VALUES[2].color}\"></span>\n\t\t\t\t\t\t${GPS_VALUES[2].label}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${GPS_VALUES[4].color}\"></span>\n\t\t\t\t\t\t${GPS_VALUES[4].label}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${GPS_VALUES[1].color}\"></span>\n\t\t\t\t\t\t${GPS_VALUES[1].label}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"legend-entry\">\n\t\t\t\t\t\t<span class=\"legend-color\" style=\"background-color: ${GPS_VALUES[3].color}\"></span>\n\t\t\t\t\t\t${GPS_VALUES[3].label}\n\t\t\t\t\t</div>\n\t\t\t</div>` : nothing}\n\t\t</div>`);\n\n\t\treturn parts;\n\t}\n}\n\ncustomElements.define(\"pnx-map-layers-menu\", MapLayers);\n","import {LitElement, html, nothing, css} from \"lit\";\nimport {onceParentAvailable} from \"../../utils/widgets\";\n\n/**\n * Map legend displays information about map sources.\n * @class Panoramax.components.menus.MapLegend\n * @element pnx-map-legend\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-map-legend ._parent=${viewer} />\n * ```\n */\nexport default class MapLegend extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tfont-size: 0.7em;\n\t\t}\n\t\tsmall {\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.maplibregl-ctrl-attrib-inner {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.MapLegend#\n\t * @type {Object}\n\t * @property {boolean} [light=false] Lighter version (for iframes)\n\t */\n\tstatic properties = {\n\t\tlight: {type: Boolean},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.light = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this.requestUpdate());\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tconst mapAttrib = this._parent?.map?._attribution?._innerContainer;\n\t\tconst mapLabelParts = this._parent?._t.map.map_data.split(\"{m}\");\n\n\t\treturn this.light ?\n\t\t\t(mapAttrib && mapAttrib.innerHTML.length > 0 ? mapAttrib : nothing)\n\t\t\t: html`\n\t\t\t\t${mapAttrib && mapAttrib.innerHTML.length > 0\n\t\t\t\t\t? html`${mapLabelParts.shift()}${mapAttrib}${mapLabelParts.shift()}`\n\t\t\t\t\t: nothing}\n\t\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-map-legend\", MapLegend);\n","import { LitElement, nothing, css, html } from \"lit\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\nimport { panel } from \"../styles\";\n\n/**\n * Mini picture legend shows info about picture capture date, when seen in mini component of viewer.\n * @class Panoramax.components.menus.MiniPictureLegend\n * @element pnx-mini-picture-legend\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-mini-picture-legend ._parent=${viewer} />\n * ```\n */\nexport default class MiniPictureLegend extends LitElement {\n\t/** @private */\n\tstatic styles = [panel, css`\n\t\t.pnx-panel {\n\t\t\tbottom: 0;\n\t\t\tright: 0;\n\t\t\twidth: unset;\n\t\t\tmin-width: unset;\n\t\t\tborder-radius: 10px;\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-right: none;\n\t\t\tborder-bottom: none;\n\t\t\tpadding: 2px 5px;\n\t\t\tfont-size: 0.7em;\n\t\t}\n\t`];\n\n\t/** @private */\n\tstatic properties = {\n\t\t_caption: {state: true},\n\t};\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this)\n\t\t\t.then(() => this._parent.onceReady())\n\t\t\t.then(() => {\n\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\t});\n\t\t\t\tthis._parent.psv.addEventListener(\"sequence-stopped\", () => {\n\t\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\t});\n\t\t\t});\n\t}\n\n\t/** @private */\n\t_onPicChange(picMeta) {\n\t\tthis._caption = picMeta?.caption;\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\treturn this._caption?.date ?\n\t\t\thtml`<div class=\"pnx-panel\">${\n\t\t\t\tthis._caption.date.toLocaleDateString(\n\t\t\t\t\tthis._parent?.lang || window.navigator.language,\n\t\t\t\t\t{ year: \"numeric\", month: \"long\", day: \"numeric\" }\n\t\t\t\t)\n\t\t\t}</div>`\n\t\t\t: nothing;\n\t}\n}\n\ncustomElements.define(\"pnx-mini-picture-legend\", MiniPictureLegend);\n","import { LitElement, nothing, css } from \"lit\";\nimport { html, unsafeStatic } from \"lit/static-html.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\nimport { faArrowLeft } from \"@fortawesome/free-solid-svg-icons/faArrowLeft\";\nimport { faChevronUp } from \"@fortawesome/free-solid-svg-icons/faChevronUp\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons/faChevronDown\";\nimport { faUser } from \"@fortawesome/free-solid-svg-icons/faUser\";\nimport { faUserLock } from \"@fortawesome/free-solid-svg-icons/faUserLock\";\nimport { faCalendarAlt } from \"@fortawesome/free-solid-svg-icons/faCalendarAlt\";\nimport { faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons/faTriangleExclamation\";\nimport { faShareNodes } from \"@fortawesome/free-solid-svg-icons/faShareNodes\";\nimport { placeholder, panel, hidden } from \"../styles\";\nimport { reverseGeocodingNominatim } from \"../../utils/geocoder\";\nimport { PanoramaxMetaCatalogURL } from \"../../utils/services\";\n\n/**\n * Picture legend shows info about picture author, capture date, address, and access to metadata popup.\n * @class Panoramax.components.menus.PictureLegend\n * @element pnx-picture-legend\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).\n * @example\n * ```html\n * <pnx-picture-legend ._parent=${viewer} />\n * ```\n */\nexport default class PictureLegend extends LitElement {\n\t/** @private */\n\tstatic styles = [placeholder, panel, hidden, css`\n\t\t:host {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tmargin: 0;\n\t\t\tfont-family: var(--font-family);\n\t\t\tflex-wrap: nowrap;\n\t\t}\n\n\t\t@media screen and (min-width: 576px) {\n\t\t\t:host {\n\t\t\t\tmax-height: 70vh;\n\t\t\t}\n\t\t}\n\n\t\t/* Top bar */\n\t\t.headline {\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\talign-items: center;\n\t\t\tmargin: 10px 10px 5px 10px;\n\t\t\tjustify-content: space-between;\n\t\t\tflex: 1;\n\t\t}\n\n\t\t.headline-buttons {\n\t\t\tdisplay: flex;\n\t\t\tgap: 5px;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t/* Address line */\n\t\t#pic-legend-addr {\n\t\t\tline-height: 1.2em;\n\t\t\tfont-size: 1em;\n\t\t\tmargin-bottom: 2px;\n\t\t\tflex-grow: 5;\n\t\t\tfont-weight: 800;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n  \t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t#pic-legend-addr span {\n\t\t\tdisplay: inline-block;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t/* Visibility badge */\n\t\t.visibility-badge {\n\t\t\tcursor: help;\n\t\t\tbackground: var(--blue);\n\t\t\tcolor: var(--white);\n\t\t\tborder-radius: 10px;\n\t\t\theight: 20px;\n\t\t\tdisplay: inline-flex;\n\t\t\tfont-size: 0.8em;\n\t\t\tpadding: 0 5px;\n  \t\t\tgap: 3px;\n\t\t\tfont-size: 0.7em;\n  \t\t\talign-items: center;\n\t\t}\n\n\t\t.visibility-badge svg {\n\t\t\theight: 1em;\n\t\t}\n\n\t\t/* Minimal info block */\n\t\t#pic-legend-info {\n\t\t\tmargin: 10px;\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: space-around;\n\t\t}\n\t\t.info-block {\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 1;\n\t\t\tgap: 5px;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\talign-items: center;\n\t\t}\n\t\t.info-block svg { height: 18px; }\n\n\t\t/* Expand button */\n\t\t#pic-legend-expand {\n\t\t\tdisplay: block;\n\t\t\tmargin-top: 5px;\n\t\t\tmax-width: 100%;\n\t\t\tflex: 1;\n\t\t}\n\t\t#pic-legend-expand::part(btn) {\n\t\t\tborder-radius: 10px;\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-top-left-radius: 0;\n\t\t}\n\n\t\t/* Details block */\n\t\tpnx-picture-metadata {\n\t\t\tmargin: 5px 10px;\n\t\t\tdisplay: block;\n\t\t\tbox-sizing: border-box;\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t}\n\n\t\t/* Details actions */\n\t\t#pic-legend-cta {\n\t\t\tdisplay: flex;\n\t\t\tmargin: 5px 10px;\n\t\t\tborder-bottom-left-radius: 10px;\n\t\t\tborder-bottom-right-radius: 10px;\n\t\t\tgap: 5px;\n\t\t\tflex-wrap: wrap;\n\t\t\tflex: 1;\n\t\t}\n\n\t\t/* More options menu */\n\t\t#pnx-legend-opts { min-width: unset; }\n\n\t\t/* Editors */\n\t\t#pic-legend-editors { margin: 0 10px; }\n\n\t\t/* Light version */\n\t\t.pnx-picture-legend-light {\n\t\t\twidth: max-content;\n\t\t\tfont-size: 10px;\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.PictureLegend#\n\t * @type {Object}\n\t * @property {boolean} [light=false] Lighter version (for iframes)\n\t */\n\tstatic properties = {\n\t\tlight: {type: Boolean},\n\t\t_caption: { state: true },\n\t\t_addr: { state: true },\n\t\t_expanded: { state: true },\n\t\t_blockOnEditor: { state: true },\n\t\t_visibility: { state: true },\n\t\tcollapsable: { type: Boolean },\n\t};\n\n\t/** @private */\n\tconstructor() {\n\t\tsuper();\n\t\tthis._expanded = true;\n\t\tthis.collapsable = false;\n\t\tthis.light = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tthis._expanded = !this.collapsable;\n\t\tthis._prevSearches = {};\n\n\t\tonceParentAvailable(this)\n\t\t\t.then(() => this._parent.onceReady())\n\t\t\t.then(() => {\n\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\t});\n\t\t\t\tthis._parent.psv.addEventListener(\"sequence-stopped\", () => {\n\t\t\t\t\tthis._onPicChange(this._parent.psv.getPictureMetadata());\n\t\t\t\t});\n\t\t\t\tthis._parent.psv.addEventListener(\"annotation-focused\", () => {\n\t\t\t\t\tthis._expanded = true;\n\t\t\t\t});\n\t\t\t\tif(!this._parent._initParams.getParentPostInit().skipTagsMenuOpening) {\n\t\t\t\t\tthis._parent.psv.addEventListener(\"annotations-toggled\", e => {\n\t\t\t\t\t\tif(e.detail.visible) { this._expanded = true; }\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(this._parent.psv.getSelectedAnnotations().length > 0) {\n\t\t\t\t\tthis._expanded = true;\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/** @private */\n\t_onPicChange(picMeta) {\n\t\tclearTimeout(this._addrTimer1);\n\t\tthis._caption = picMeta?.caption;\n\t\t\n\t\tif(picMeta) {\n\t\t\tthis._visibility = picMeta.properties?.[\"geovisio:visibility\"] || null;\n\t\t\tif(this._visibility === \"anyone\") { this._visibility = null; }\n\n\t\t\tconst coordsHash = `${picMeta.gps[0].toFixed(4)}/${picMeta.gps[1].toFixed(4)}`;\n\t\t\tif(this._prevSearches[coordsHash]) {\n\t\t\t\tthis._addr = this._prevSearches[coordsHash];\n\t\t\t}\n\t\t\telse if(!this._parent.psv._sequencePlaying) {\n\t\t\t\tthis._addr = \"\";\n\t\t\t\tthis._addrTimer1 = setTimeout(() => {\n\t\t\t\t\treverseGeocodingNominatim(picMeta.gps[1], picMeta.gps[0])\n\t\t\t\t\t\t.then(addr => {\n\t\t\t\t\t\t\tclearTimeout(this._addrTimer2);\n\t\t\t\t\t\t\tthis._addr = addr;\n\t\t\t\t\t\t\tthis._prevSearches[coordsHash] = addr;\n\t\t\t\t\t\t});\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthis._visibility = null;\n\t\t\tthis._addr = \"\";\n\t\t}\n\t}\n\n\t/** @private */\n\t_onBackClick() {\n\t\tif(this._parent.isWidthSmall() && this._parent.focus === \"map\") {\n\t\t\tthis._parent.select();\n\t\t}\n\t\telse {\n\t\t\tthis._parent._setFocus?.(\"map\");\n\t\t}\n\t}\n\n\t/**\n\t * Force legend to not go anywhere beyond tags editor.\n\t * @memberof Panoramax.components.menus.PictureLegend#\n\t * @param {boolean} enabled Set to true to block legend, false to unblock\n\t */\n\tblockOnEditing(enabled) {\n\t\tthis._blockOnEditor = enabled;\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tif(!this._caption) { return nothing; }\n\n\t\tconst lang = this._parent?.lang || window.navigator.language;\n\t\tconst hiddenExpanded = classMap({\"pnx-hidden\": this._expanded});\n\t\tconst shownExpanded = classMap({\"pnx-hidden\": !this._expanded});\n\n\t\tif(this.light) {\n\t\t\treturn html`<div class=\"pnx-picture-legend-light\">\n\t\t\t\t${this._caption.producer?.length > 0 ? html`\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=${PanoramaxMetaCatalogURL()+\"/?pic=\"+this._parent.psv.getPictureMetadata().id}\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\ttitle=${this._parent?._t.pnx.share_page}\n\t\t\t\t\t>${this._caption.producer[this._caption.producer.length-1]}</a>\n\t\t\t\t</div>` : nothing}\n\n\t\t\t\t${this._caption.producer?.length > 0 && this._caption.date ? \"-\" : \"\"}\n\n\t\t\t\t${this._caption.date ? new Intl.DateTimeFormat(lang, {\n\t\t\t\t\ttimeZone: this._caption.tz,\n\t\t\t\t\tdateStyle: \"short\"\n\t\t\t\t}).format(this._caption.date) : nothing}\n\n\t\t\t\t${(this._caption.producer?.length > 0 || this._caption.date) && this._caption?.license ? \"|\" : \"\"}\n\n\t\t\t\t${this._caption?.license ? html`${unsafeStatic(this._caption.license)}` : nothing}\n\t\t\t`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<div class=${classMap({ \"headline\": true, \"pnx-hidden\": this._blockOnEditor })}>\n\t\t\t\t${this._parent._setFocus ? html`\n\t\t\t\t\t<pnx-button\n\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t@click=${this._onBackClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t${fa(faArrowLeft)}\n\t\t\t\t\t</pnx-button>\n\t\t\t\t` : nothing}\n\n\t\t\t\t<div id=\"pic-legend-addr\" title=${this._addr || \"\"}>\n\t\t\t\t\t${this._addr?.length > 0 ? this._addr : html`<span class=\"pnx-placeholder-loading\">&nbsp;</span>`}\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"headline-buttons\">\n\t\t\t\t\t${this._visibility ? html`\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"visibility-badge\"\n\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx[\"visibility_title_\"+this._visibility]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faUserLock, {transform: {size: 16}})}\n\t\t\t\t\t\t\t${this._parent?._t.pnx[\"visibility_\"+this._visibility]}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t` : nothing}\n\n\t\t\t\t\t<pnx-button\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tclass=${hiddenExpanded}\n\t\t\t\t\t\ttitle=${this._parent?._t.pnx.share}\n\t\t\t\t\t\t@click=${() => this._parent._showShareOptions()}\n\t\t\t\t\t>\n\t\t\t\t\t\t${fa(faShareNodes)}\n\t\t\t\t\t</pnx-button>\n\n\t\t\t\t\t<pnx-picture-legend-actions\n\t\t\t\t\t\t@click=${e => e.stopPropagation()}\n\t\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t\t\t?full=${this._expanded}\n\t\t\t\t\t></pnx-picture-legend-actions>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div id=\"pic-legend-info\" class=${hiddenExpanded}>\n\t\t\t\t${this._caption.producer?.length > 0 ? html`<div class=\"info-block\">\n\t\t\t\t\t${fa(faUser)}\n\t\t\t\t\t${this._caption.producer[this._caption.producer.length-1]}\n\t\t\t\t</div>` : nothing}\n\n\t\t\t\t${this._caption.date ? html`<div class=\"info-block\">\n\t\t\t\t\t${fa(faCalendarAlt)}\n\t\t\t\t\t${this._caption.date.toLocaleDateString(this._parent?.lang || window.navigator.language, { year: \"numeric\", month: \"long\", day: \"numeric\" })}\t\t\t\t</div>` : nothing}\n\t\t\t</div>\n\n\t\t\t<div id=\"pic-legend-cta\" class=${classMap({ \"pnx-hidden\": !this._expanded || this._blockOnEditor })}>\n\t\t\t\t<pnx-button size=\"sm\" @click=${() => this._parent._showShareOptions()}>\n\t\t\t\t\t${fa(faShareNodes)} ${this._parent?._t.pnx.share}\n\t\t\t\t</pnx-button>\n\n\t\t\t\t${this._parent.api._endpoints.report ? html`\n\t\t\t\t\t\t<pnx-button kind=\"fullwarn\" size=\"sm\" @click=${() => this._parent._showReportForm()}>\n\t\t\t\t\t\t\t${fa(faTriangleExclamation)} ${this._parent?._t.pnx.report}\n\t\t\t\t\t\t</pnx-button>\n\t\t\t\t` : nothing}\n\n\t\t\t\t<slot name=\"editors\">\n\t\t\t\t\t<pnx-widget-osmeditors ._parent=${this._parent} />\n\t\t\t\t</slot>\n\t\t\t</div>\n\n\t\t\t<pnx-picture-metadata\n\t\t\t\tclass=${shownExpanded}\n\t\t\t\t.block-editor=${this._blockOnEditor}\n\t\t\t\t._parent=${this._parent}\n\t\t\t></pnx-picture-metadata>\n\n\t\t\t${this.collapsable && !this._blockOnEditor ? html`<pnx-button\n\t\t\t\tkind=\"inline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tid=\"pic-legend-expand\"\n\t\t\t\t@click=${() => this._expanded = !this._expanded}\n\t\t\t>${this._expanded ? fa(faChevronUp) : fa(faChevronDown)}</pnx-button>` : nothing}\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-picture-legend\", PictureLegend);\n","import { LitElement, nothing, css } from \"lit\";\nimport { html, unsafeStatic } from \"lit/static-html.js\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\nimport { faLocationDot } from \"@fortawesome/free-solid-svg-icons/faLocationDot\";\nimport { faMedal } from \"@fortawesome/free-solid-svg-icons/faMedal\";\nimport { faCamera } from \"@fortawesome/free-solid-svg-icons/faCamera\";\nimport { faImage } from \"@fortawesome/free-solid-svg-icons/faImage\";\nimport { faImages } from \"@fortawesome/free-solid-svg-icons/faImages\";\nimport { faScroll } from \"@fortawesome/free-solid-svg-icons/faScroll\";\nimport { faQuestion } from \"@fortawesome/free-solid-svg-icons/faQuestion\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport { faTags } from \"@fortawesome/free-solid-svg-icons/faTags\";\nimport { faSvg, titles, textarea, hidden, dataBlocks } from \"../styles\";\nimport { createWebComp } from \"../../utils/widgets\";\nimport { getGPSPrecision } from \"../../utils/picture\";\nimport { PanoramaxMetaCatalogURL } from \"../../utils/services\";\nimport {\n\tgetGrade, QUALITYSCORE_GPS_VALUES, QUALITYSCORE_RES_360_VALUES,\n\tQUALITYSCORE_RES_FLAT_VALUES, QUALITYSCORE_POND_GPS, QUALITYSCORE_POND_RES\n} from \"../../utils/utils\";\n\nconst missing = () => fa(faQuestion, {styles: {height: \"16px\"}});\n\n/**\n * Picture metadata displays detailed info about a single picture (ID, capture context, EXIF attributes...).\n * @class Panoramax.components.menus.PictureMetadata\n * @element pnx-picture-metadata\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-picture-metadata ._parent=${viewer} />\n * ```\n */\nexport default class PictureMetadata extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, titles, textarea, hidden, dataBlocks, css`\n\t\tdiv[slot=\"content\"] {\n\t\t\tpadding: 5px 10px;\n\t\t\tbackground-color: #ededed;\n\t\t}\n\n\t\t.data-block {\n\t\t\tmin-width: 50%;\n\t\t}\n\n\t\tpnx-semantics-table {\n\t\t\toverflow-x: auto;\n  \t\t\tdisplay: block;\n\t\t}\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.PictureMetadata#\n\t * @type {Object}\n\t * @property {boolean} [block-editor=false] Set to true to avoid going beyond semantics editor\n\t */\n\tstatic properties = {\n\t\t_meta: {state: true},\n\t\t\"block-editor\": { type: Boolean },\n\t};\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tconst gototags = () => {\n\t\t\tconst tabs = this.shadowRoot.querySelector(\"pnx-tabs\");\n\t\t\tif(tabs) { tabs.setAttribute(\"activeTabIndex\", 4); }\n\t\t};\n\n\t\twindow.navigation?.addEventListener(\"navigate\", () => {\n\t\t\tthis.requestUpdate();\n\t\t});\n\n\t\tonceParentAvailable(this).then(() => {\n\t\t\tthis._meta = this._parent?.psv?.getPictureMetadata();\n\t\t\tthis._parent?.oncePSVReady?.().then(() => {\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._meta = this._parent.psv.getPictureMetadata();\n\t\t\t\t});\n\t\t\t\tif(!this._parent._initParams.getParentPostInit().skipTagsMenuOpening) {\n\t\t\t\t\tthis._parent.psv.addEventListener(\"annotation-focused\", gototags);\n\t\t\t\t\tthis._parent.psv.addEventListener(\"annotations-toggled\", e => {\n\t\t\t\t\t\tif(e.detail.visible) {\n\t\t\t\t\t\t\tgototags();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(this._parent.psv.getSelectedAnnotations().length > 0) {\n\t\t\t\t\t\tgototags();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t/** @private */\n\t_onQualityScoreClick() {\n\t\tconst qsTab = this.shadowRoot.querySelector(\"pnx-tabs\");\n\t\tif(qsTab) {\n\t\t\tqsTab.setAttribute(\"activeTabIndex\", 3);\n\t\t}\n\t}\n\n\t/** @private */\n\t_onCaptureDateClick() {\n\t\tconst qsTab = this.shadowRoot.querySelector(\"pnx-tabs\");\n\t\tif(qsTab) {\n\t\t\tqsTab.setAttribute(\"activeTabIndex\", 1);\n\t\t}\n\t}\n\n\t/** @private */\n\t_toTab(title, data) {\n\t\treturn html`\n\t\t\t<h4 slot=\"title\">${title}</h4>\n\t\t\t<div slot=\"content\" class=\"data-blocks\">\n\t\t\t\t${data.filter(b => b).map(b => html`<div class=\"data-block\" style=${b.style}>\n\t\t\t\t\t<h5>${b.title}</h5>\n\t\t\t\t\t<div style=${b.content_style} @click=${b.click}>${b.content}</div>\n\t\t\t\t</div>`)}\n\t\t\t</div>\n\t\t`;\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tif(!this._meta) { return nothing; }\n\n\t\tconst lang = this._parent?.lang || window.navigator.language;\n\n\t\t// Generic information\n\t\tconst persOrient = this._meta?.properties?.[\"pers:interior_orientation\"];\n\t\tconst makeModel = [persOrient.camera_manufacturer, persOrient.camera_model].filter(v => v).join(\" \");\n\t\tconst focal = persOrient?.focal_length ? `${persOrient?.focal_length} mm` : missing();\n\t\tlet resmp = persOrient?.[\"sensor_array_dimensions\"];\n\t\tif(resmp) { resmp = `${resmp[0]} x ${resmp[1]} px (${Math.floor(resmp[0] * resmp[1] / 1000000)} Mpx)`;}\n\t\tlet pictype = this._parent?._t.pnx.picture_flat;\n\t\tlet pictypelong = this._parent?._t.pnx.picture_flat_long;\n\t\tlet picFov = persOrient?.[\"field_of_view\"]; // Use raw value instead of horizontalFov to avoid default showing up\n\t\tif(picFov !== null && picFov !== undefined) {\n\t\t\tif(picFov === 360) {\n\t\t\t\tpictype = this._parent?._t.pnx.picture_360;\n\t\t\t\tpictypelong = this._parent?._t.pnx.picture_360_long;\n\t\t\t}\n\t\t\telse { pictype += ` (${picFov}°)`; }\n\t\t}\n\n\t\t// Camera tab\n\t\tconst cameraData = [\n\t\t\t{ title: this._parent?._t.pnx.metadata_camera_make, content: persOrient?.camera_manufacturer || missing() },\n\t\t\t{ title: this._parent?._t.pnx.metadata_camera_model, content: persOrient?.camera_model || missing() },\n\t\t\t{ title: this._parent?._t.pnx.metadata_camera_type, content: pictype },\n\t\t\t{ title: this._parent?._t.pnx.metadata_camera_resolution, content: resmp || missing() },\n\t\t\t{ title: this._parent?._t.pnx.metadata_camera_focal_length, content: focal },\n\t\t\t// Capture date\n\t\t\tthis._meta?.caption?.date && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_date,\n\t\t\t\tcontent: html`\n\t\t\t\t\t<strong>${new Intl.DateTimeFormat(lang, {\n\t\t\t\t\t\ttimeZone: this._meta.caption.tz,\n\t\t\t\t\t\tdateStyle: \"short\"\n\t\t\t\t\t}).format(this._meta.caption.date)}</strong>\n\t\t\t\t\t<br />${new Intl.DateTimeFormat(lang, {\n\t\t\t\t\t\ttimeZone: this._meta.caption.tz,\n\t\t\t\t\t\thour: \"numeric\",\n\t\t\t\t\t\tminute: \"numeric\",\n\t\t\t\t\t\tsecond: \"numeric\",\n\t\t\t\t\t\tfractionalSecondDigits: 3,\n\t\t\t\t\t\ttimeZoneName: \"longOffset\"\n\t\t\t\t\t}).format(this._meta.caption.date)}\n\t\t\t\t`\n\t\t\t}\n\t\t];\n\n\t\t// Location tab\n\t\tconst orientation = this._meta?.properties?.[\"view:azimuth\"] !== undefined && `${this._meta.properties[\"view:azimuth\"]}°`;\n\t\tconst locationData = [\n\t\t\t{\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_location_coordinates,\n\t\t\t\tcontent: html`\n\t\t\t\t\t${this._meta.gps[0].toFixed(5)}, ${this._meta.gps[1].toFixed(5)}\n\t\t\t\t\t<pnx-copy-coordinates\n\t\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t\t\t.gps=${this._meta.gps}\n\t\t\t\t\t\tstyle=\"margin-left: 10px\"\n\t\t\t\t\t></pnx-copy-coordinates>\n\t\t\t\t`,\n\t\t\t\tstyle: \"width: 100%\"\n\t\t\t},\n\t\t\t{ title: this._parent?._t.pnx.metadata_location_orientation, content: orientation || missing() },\n\t\t\t{ title: this._parent?._t.pnx.metadata_location_precision, content: getGPSPrecision(this._meta) || missing() },\n\t\t];\n\n\t\t// Quality tab\n\t\tconst hasQualityScore = (\n\t\t\tthis._parent?.map?._hasQualityScore?.()\n\t\t\t|| this._meta?.properties?.[\"quality:horizontal_accuracy\"]\n\t\t\t|| this._meta?.properties?.[\"panoramax:horizontal_pixel_density\"]\n\t\t);\n\t\tlet qualityData, generalGrade;\n\t\tif(hasQualityScore) {\n\t\t\tconst gpsGrade = getGrade(QUALITYSCORE_GPS_VALUES, this._meta?.properties?.[\"quality:horizontal_accuracy\"]);\n\t\t\tconst resGrade = getGrade(\n\t\t\t\tthis._meta?.horizontalFov === 360 ? QUALITYSCORE_RES_360_VALUES : QUALITYSCORE_RES_FLAT_VALUES,\n\t\t\t\tthis._meta?.properties?.[\"panoramax:horizontal_pixel_density\"]\n\t\t\t);\n\n\t\t\t// Note: score is also calculated in utils/map code\n\t\t\tgeneralGrade = Math.round((resGrade || 1) * QUALITYSCORE_POND_RES + (gpsGrade || 1) * QUALITYSCORE_POND_GPS);\n\n\t\t\tqualityData = [\n\t\t\t\t{\n\t\t\t\t\ttitle: html`\n\t\t\t\t\t\t${this._parent?._t.pnx.metadata_quality_score}\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\ttitle=\"${this._parent?._t.pnx.metadata_quality_help}\"\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\t@click=${() => this._parent?._showQualityScoreDoc()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faInfoCircle)}\n\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t`,\n\t\t\t\t\tcontent: html`<pnx-quality-score grade=${generalGrade} style=\"font-size: 16px\"></pnx-quality-score>`,\n\t\t\t\t\tstyle: \"width: 100%\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttitle: this._parent?._t.pnx.metadata_quality_gps_score,\n\t\t\t\t\tcontent: createWebComp(\"pnx-grade\", { stars: gpsGrade, _t: this._parent?._t })\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttitle: this._parent?._t.pnx.metadata_quality_resolution_score,\n\t\t\t\t\tcontent: createWebComp(\"pnx-grade\", { stars: resGrade, _t: this._parent?._t })\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\t// EXIF data\n\t\tconst exifData = Object.entries(this._meta.properties.exif)\n\t\t\t.sort()\n\t\t\t.filter(([, value]) => value)\n\t\t\t.map(([key, value]) => {\n\t\t\t\tif(JSON.stringify(value).includes(\"\\\\u\")) {\n\t\t\t\t\tvalue = JSON.stringify(value).replace(/\\\\u[0-9A-Fa-f]{4}/g, unicode => (\n\t\t\t\t\t\t\" 0x\" + parseInt(unicode.slice(2), 16).toString(16).toUpperCase().padStart(4, \"0\")\n\t\t\t\t\t)).slice(1, -1).trim();\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttitle: key,\n\t\t\t\t\tcontent: value.length > 30 ? html`<textarea readonly .value=${value}></textarea>`: value,\n\t\t\t\t\tstyle: value.length > 30 ? \"width: 100%\" : undefined\n\t\t\t\t};\n\t\t\t});\n\t\texifData.unshift({\n\t\t\tcontent: html`\n\t\t\t\t<pnx-link-button\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\thref=\"https://exiv2.org/metadata.html\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.metadata_exif_doc_title}\n\t\t\t\t>${fa(faInfoCircle)} ${this._parent?._t.pnx.metadata_exif_doc}</pnx-link-button>\n\t\t\t`,\n\t\t\tstyle: \"width: 100%\"\n\t\t});\n\n\t\t// General metadata\n\t\tconst overview = [\n\t\t\t// Producer\n\t\t\tthis._meta?.caption?.producer?.length > 0 && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_author,\n\t\t\t\tcontent: html`\n\t\t\t\t\t<strong>${this._meta.caption.producer[this._meta.caption.producer.length - 1]}</strong>\n\t\t\t\t\t${this._meta.caption.producer.length > 1 ? html`<br />${this._meta.caption.producer.slice(0, -1).join(\", \")}` : nothing}\n\t\t\t\t`\n\t\t\t},\n\t\t\t// Capture date\n\t\t\tthis._meta?.caption?.date && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_date,\n\t\t\t\tclick: this._onCaptureDateClick,\n\t\t\t\tcontent_style: \"cursor: pointer\",\n\t\t\t\tcontent: html`\n\t\t\t\t\t<strong>${new Intl.DateTimeFormat(lang, {timeZone: this._meta.caption.tz, dateStyle: \"long\"}).format(this._meta.caption.date)}</strong>\n\t\t\t\t\t<br />${new Intl.DateTimeFormat(lang, {timeZone: this._meta.caption.tz, hour: \"numeric\",minute:\"numeric\", second: \"numeric\"}).format(this._meta.caption.date)}\n\t\t\t\t`\n\t\t\t},\n\t\t\t// Camera\n\t\t\tpersOrient && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_camera,\n\t\t\t\tcontent: html`\n\t\t\t\t\t<strong>${makeModel.length > 0 ? makeModel : missing()}</strong>\n\t\t\t\t\t<br />${pictypelong}\n\t\t\t\t`\n\t\t\t},\n\t\t\t// License\n\t\t\tthis._meta?.caption?.license && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_license,\n\t\t\t\tcontent: html`${unsafeStatic(this._meta.caption.license)}`\n\t\t\t},\n\t\t\t// Quality score\n\t\t\thasQualityScore && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_quality,\n\t\t\t\tclick: this._onQualityScoreClick,\n\t\t\t\tcontent: html`<pnx-quality-score\n\t\t\t\t\tgrade=${generalGrade}\n\t\t\t\t\tstyle=\"font-size: 14px; cursor: pointer\"\n\t\t\t\t/>`\n\t\t\t},\n\t\t\t// Copy ID\n\t\t\t{\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_copy_id,\n\t\t\t\tcontent_style: \"display: flex; gap: 5px;\",\n\t\t\t\tcontent: html`\n\t\t\t\t\t<pnx-copy-button\n\t\t\t\t\t\tkind=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\ttext=${this._meta.id}\n\t\t\t\t\t\ttitle=${this._meta.id}\n\t\t\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${fa(faImage)} ${this._parent?._t.pnx.metadata_general_picid}\n\t\t\t\t\t</pnx-copy-button>\n\t\t\t\t\t<pnx-copy-button\n\t\t\t\t\t\tkind=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\ttext=${this._meta.sequence.id}\n\t\t\t\t\t\ttitle=${this._meta.sequence.id}\n\t\t\t\t\t\tstyle=\"flex: 1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${fa(faImages)} ${this._parent?._t.pnx.metadata_general_seqid}\n\t\t\t\t\t</pnx-copy-button>\n\t\t\t\t`\n\t\t\t},\n\t\t\tthis._meta?.origInstance && {\n\t\t\t\ttitle: this._parent?._t.pnx.metadata_general_instance,\n\t\t\t\tcontent: html`<strong>\n\t\t\t\t\t<a href=${this._meta.origInstance.href+window.location.search} target=\"_blank\" style=\"text-decoration: none\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc=${PanoramaxMetaCatalogURL()+\"/api/instances/\"+this._meta.origInstance.instance_name+\"/logo\"}\n\t\t\t\t\t\t\tstyle=\"height: 30px; max-width: 150px; vertical-align: middle\"\n\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span style=\"text-decoration: underline\">\n\t\t\t\t\t\t\t${this._meta.origInstance.instance_name || this._meta.origInstance.href.replace(/^http.?:\\/\\//, \"\")}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</a>\n\t\t\t\t</strong>`\n\t\t\t}\n\t\t];\n\n\t\treturn html`<pnx-tabs .hideNav=${this[\"block-editor\"]}>\n\t\t\t${this._toTab( // General\n\t\t\t\thtml`${fa(faImage)} ${this._parent?._t.pnx.metadata_summary}`,\n\t\t\t\toverview\n\t\t\t)}\n\n\t\t\t${this._toTab( // Camera\n\t\t\t\thtml`${fa(faCamera)} ${this._parent?._t.pnx.metadata_camera}`,\n\t\t\t\tcameraData\n\t\t\t)}\n\n\t\t\t${this._toTab( // Position\n\t\t\t\thtml`${fa(faLocationDot)} ${this._parent?._t.pnx.metadata_location}`,\n\t\t\t\tlocationData\n\t\t\t)}\n\n\t\t\t${hasQualityScore ? this._toTab( // Quality\n\t\t\t\thtml`${fa(faMedal)} ${this._parent?._t.pnx.metadata_quality}`,\n\t\t\t\tqualityData\n\t\t\t) : nothing}\n\n\t\t\t<h4 slot=\"title\">${fa(faTags)} ${this._parent?._t.pnx.semantics_title}</h4>\n\t\t\t<div slot=\"content\" class=\"data-blocks\">\n\t\t\t\t<pnx-semantics-metadata ._parent=${this._parent}></pnx-semantics-metadata>\n\t\t\t</div>\n\n\t\t\t${this._meta.properties?.exif ? this._toTab( // EXIF\n\t\t\t\thtml`${fa(faScroll)} ${this._parent?._t.pnx.metadata_exif}`,\n\t\t\t\texifData\n\t\t\t) : nothing}\n\t\t</pnx-tabs>`;\n\t}\n}\n\ncustomElements.define(\"pnx-picture-metadata\", PictureMetadata);\n","import { LitElement, html, css } from \"lit\";\nimport { faSvg } from \"../styles\";\nimport { faRocket } from \"@fortawesome/free-solid-svg-icons/faRocket\";\nimport { faLightbulb } from \"@fortawesome/free-solid-svg-icons/faLightbulb\";\nimport { faPersonBiking } from \"@fortawesome/free-solid-svg-icons/faPersonBiking\";\nimport { PIC_MAX_STAY_DURATION } from \"../ui/Photo\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\n\n/**\n * Player Options menu displays player speed and contrast settings.\n * @class Panoramax.components.menus.PlayerOptions\n * @element pnx-player-options\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-player-options ._parent=${viewer} />\n * ```\n */\nexport default class PlayerOptions extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, css`\n\t\t:host {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 15px;\n\t\t\tpadding: 5px 15px;\n\t\t}\n\n\t\t.pnx-input-range {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 10px;\n\t\t\talign-items: center;\n\t\t\twidth: 100%;\n\t\t}\n\t` ];\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this._parent?.psv?.addEventListener(\"transition-duration-changed\", e => {\n\t\t\tthis.renderRoot.querySelector(\"#pnx-player-speed\").value = PIC_MAX_STAY_DURATION - e.detail.value;\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onSpeedChange(e) {\n\t\tconst newSpeed = PIC_MAX_STAY_DURATION - e.target.value;\n\t\tthis._parent?.psv?.setTransitionDuration(newSpeed);\n\t}\n\n\t/** @private */\n\t_onContrastClick() {\n\t\tconst btn = this.renderRoot.querySelector(\"#pnx-player-contrast\");\n\t\tif(btn.getAttribute(\"active\") == \"true\") {\n\t\t\tbtn.removeAttribute(\"active\");\n\t\t\tthis._parent?.psv?.setHigherContrast(false);\n\t\t}\n\t\telse {\n\t\t\tbtn.setAttribute(\"active\", \"true\");\n\t\t\tthis._parent?.psv?.setHigherContrast(true);\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"pnx-input-range\" title=\"${this._parent?._t.pnx.sequence_speed}\">\n\t\t\t\t${fa(faPersonBiking)}\n\t\t\t\t<input\n\t\t\t\t\tid=\"pnx-player-speed\"\n\t\t\t\t\ttype=\"range\" name=\"speed\"\n\t\t\t\t\tmin=\"0\" max=\"${PIC_MAX_STAY_DURATION - 100}\"\n\t\t\t\t\tvalue=\"${PIC_MAX_STAY_DURATION - this._parent?.psv.getTransitionDuration()}\"\n\t\t\t\t\ttitle=\"${this._parent?._t.pnx.sequence_speed}\"\n\t\t\t\t\tstyle=\"width: 100%;\"\n\t\t\t\t\t@change=${this._onSpeedChange}\n\t\t\t\t/>\n\t\t\t\t${fa(faRocket)}\n\t\t\t</div>\n\t\t\t<pnx-button\n\t\t\t\tid=\"pnx-player-contrast\"\n\t\t\t\ttitle=\"${this._parent?._t.pnx.contrast}\"\n\t\t\t\tkind=\"outline\"\n\t\t\t\t@click=${this._onContrastClick}\n\t\t\t>\n\t\t\t\t${fa(faLightbulb)}\n\t\t\t</pnx-button>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-player-options\", PlayerOptions);\n","import { LitElement, html } from \"lit\";\nimport { faSvg, titles, docPopup } from \"../styles\";\nimport { fa } from \"../../utils/widgets\";\nimport { faMedal } from \"@fortawesome/free-solid-svg-icons/faMedal\";\nimport { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons/faExternalLinkAlt\";\n\n/**\n * Quality Score Doc displays a synthetic summary of how Quality Score is computed.\n * @class Panoramax.components.menus.QualityScoreDoc\n * @element pnx-quality-score-doc\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-quality-score-doc ._t=${viewer._t} />\n * ```\n */\nexport default class QualityScoreDoc extends LitElement {\n\tstatic styles = [ titles, faSvg, docPopup ];\n\n\trender() {\n\t\treturn html`\n\t\t\t<h4>${fa(faMedal)} ${this._t?.pnx.filter_qualityscore}</h4>\n\t\t\t<p>${this._t?.pnx.qualityscore_doc_1}</p>\n\t\t\t<p>${this._t?.pnx.qualityscore_doc_2}</p>\n\t\t\t<pnx-quality-score grade=\"\"></pnx-quality-score>\n\t\t\t<p>${this._t?.pnx.qualityscore_doc_3}</p>\n\t\t\t<p>${this._t?.pnx.qualityscore_doc_4}</p>\n\t\t\t<ul>\n\t\t\t\t<li>${this._t?.pnx.qualityscore_doc_41}</li>\n\t\t\t\t<li>${this._t?.pnx.qualityscore_doc_42}</li>\n\t\t\t</ul>\n\t\t\t<p>${this._t?.pnx.qualityscore_doc_5}</p>\n\t\t\t<pnx-link-button\n\t\t\t\thref=\"https://docs.panoramax.fr/pictures-metadata/quality_score/\"\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\tkind=\"outline\"\n\t\t\t\tstyle=\"width: 100%\"\n\t\t\t>${fa(faExternalLinkAlt)} ${this._t?.pnx.popup_details_link}</pnx-link-button>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-quality-score-doc\", QualityScoreDoc);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { faSvg, titles, select, textarea, input } from \"../styles\";\nimport { fa } from \"../../utils/widgets\";\nimport { faAt } from \"@fortawesome/free-solid-svg-icons/faAt\";\nimport { faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons/faTriangleExclamation\";\nimport { faCircleInfo } from \"@fortawesome/free-solid-svg-icons/faCircleInfo\";\nimport { faCommentDots } from \"@fortawesome/free-solid-svg-icons/faCommentDots\";\nimport { faPaperPlane } from \"@fortawesome/free-solid-svg-icons/faPaperPlane\";\nimport { getUserAccount } from \"../../utils/utils\";\n\nconst REPORT_NATURE = [\n\t\"\", \"blur_missing\", \"blur_excess\", \"inappropriate\", \"privacy\",\n\t\"picture_low_quality\", \"mislocated\", \"copyright\", \"other\"\n];\n\n/**\n * Report Form displays a form to send issues about pictures.\n * @class Panoramax.components.menus.ReportForm\n * @element pnx-report-form\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-report-form ._parent=${viewer} />\n * ```\n */\nexport default class ReportForm extends LitElement {\n\t/** @private */\n\tstatic styles = [ titles, faSvg, select, textarea, input, css`\n\t\t.group {\n\t\t\tmargin-bottom: 10px;\n\t\t}\n\n\t\t.group:not(.group-inline) label {\n\t\t\tmargin-bottom: 5px;\n\t\t\tdisplay: inline-block;\n\t\t}\n\t` ];\n\n\t/** @private */\n\tstatic properties = {\n\t\tmode: {state: true},\n\t\tfailure: {state: true},\n\t};\n\n\t/** @private */\n\t_onSubmit(e) {\n\t\te.preventDefault();\n\n\t\tconst picMeta = this._parent?.psv?.getPictureMetadata();\n\t\tconst data = Object.fromEntries(new FormData(e.target));\n\t\tconst params = {\n\t\t\tissue: data.issue,\n\t\t\tpicture_id: data[\"whole-sequence\"] ? null : picMeta?.id,\n\t\t\treporter_comments: data.comments,\n\t\t\treporter_email: data.email,\n\t\t\tsequence_id: picMeta?.sequence?.id\n\t\t};\n\n\t\tthis.mode = \"wait\";\n\n\t\t// Call API\n\t\tthis._parent?.api.sendReport(params).then(() => {\n\t\t\tthis.mode = \"success\";\n\t\t}).catch(e => {\n\t\t\tconsole.error(e);\n\t\t\tthis.mode = \"failure\";\n\t\t\tthis.failure = e;\n\t\t});\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst userAccount = getUserAccount();\n\n\t\tif(this.mode) {\n\t\t\treturn html`\n\t\t\t\t<h4>${fa(faTriangleExclamation)} ${this._parent?._t.pnx.report}</h4>\n\t\t\t\t<p>\n\t\t\t\t\t${this.mode === \"wait\" ? this._parent?._t.pnx.report_wait : nothing}\n\t\t\t\t\t${this.mode === \"success\" ? this._parent?._t.pnx.report_success : nothing}\n\t\t\t\t\t${this.mode === \"failure\" ? this._parent?._t.pnx.report_failure.replace(\"{e}\", this.failure) : nothing}\n\t\t\t\t</p>\n\t\t\t`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<h4>${fa(faTriangleExclamation)} ${this._parent?._t.pnx.report}</h4>\n\n\t\t\t${userAccount && this._parent?._t ? html`\n\t\t\t\t<p>${this._parent?._t.pnx.report_auth.replace(\"{a}\", userAccount.name)}</p>\n\t\t\t` : nothing}\n\n\t\t\t<form @submit=${this._onSubmit.bind(this)}>\n\t\t\t\t<div class=\"group\">\n\t\t\t\t\t<label for=\"issue\">${fa(faCircleInfo)} ${this._parent?._t.pnx.report_nature_label}</label>\n\t\t\t\t\t<select name=\"issue\" id=\"issue\" required class=\"pnx-100w\">\n\t\t\t\t\t\t${REPORT_NATURE.map(nature => html`\n\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\tvalue=${nature}\n\t\t\t\t\t\t\t\t${nature === \"\" ? html`disabled selected hidden` : nothing}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${this._parent?._t.pnx.report_nature[nature]}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t`)}\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"group group-inline\">\n\t\t\t\t\t<input name=\"whole-sequence\" id=\"whole-sequence\" type=\"checkbox\" />\n\t\t\t\t\t<label for=\"whole-sequence\">${this._parent?._t.pnx.report_whole_sequence}</label>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"group\">\n\t\t\t\t\t<label for=\"comments\">${fa(faCommentDots)} ${this._parent?._t.pnx.report_details}</label>\n\t\t\t\t\t<textarea name=\"comments\" id=\"comments\" placeholder=${this._parent?._t.pnx.report_details_placeholder}></textarea>\n\t\t\t\t</div>\n\n\t\t\t\t${!userAccount ? html`\n\t\t\t\t\t<div class=\"group\">\n\t\t\t\t\t\t<label for=\"email\">${fa(faAt)} ${this._parent?._t.pnx.report_email}</label>\n\t\t\t\t\t\t<input type=\"email\" name=\"email\" id=\"email\" placeholder=${this._parent?._t.pnx.report_email_placeholder} class=\"pnx-100w\" />\n\t\t\t\t\t</div>\n\t\t\t\t`: nothing}\n\n\t\t\t\t<pnx-button type=\"submit\" style=\"width: 100%\">\n\t\t\t\t\t${fa(faPaperPlane)} ${this._parent?._t.pnx.report_submit}\n\t\t\t\t</pnx-button>\n\t\t\t</form>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-report-form\", ReportForm);\n","import { LitElement, html } from \"lit\";\nimport { faSvg, titles, docPopup } from \"../styles\";\nimport { fa } from \"../../utils/widgets\";\nimport { faTags } from \"@fortawesome/free-solid-svg-icons/faTags\";\nimport { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons/faExternalLinkAlt\";\n\n/**\n * Semantics Doc displays a synthetic summary of what are semantics and how to use it.\n * @class Panoramax.components.menus.SemanticsDoc\n * @element pnx-semantics-doc\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-semantics-doc ._t=${viewer._t} />\n * ```\n */\nexport default class SemanticsDoc extends LitElement {\n\tstatic styles = [ titles, faSvg, docPopup ];\n\n\trender() {\n\t\treturn html`\n\t\t\t<h4>${fa(faTags)} ${this._t?.pnx.semantics_title}</h4>\n\t\t\t<p>${this._t?.pnx.semantics_doc_info1}</p>\n\t\t\t<ul style=\"padding-left: 1.5em;\">\n\t\t\t\t<li>${this._t?.pnx.semantics_doc_info1u1}</li>\n\t\t\t\t<li>${this._t?.pnx.semantics_doc_info2}</li>\n\t\t\t</ul>\n\t\t\t<p>${this._t?.pnx.semantics_doc_info3}</p>\n\t\t\t<pnx-link-button\n\t\t\t\thref=\"https://docs.panoramax.fr/tags/\"\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\tkind=\"outline\"\n\t\t\t\tstyle=\"width: 100%\"\n\t\t\t>${fa(faExternalLinkAlt)} ${this._t?.pnx.popup_details_link}</pnx-link-button>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-doc\", SemanticsDoc);\n","import { LitElement, html } from \"lit\";\nimport { faSvg, titles } from \"../styles\";\nimport { fa } from \"../../utils/widgets\";\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons/faDownload\";\n\n/**\n * Semantics Download docs displays a synthetic summary of you can download semantics metadata.\n * @class Panoramax.components.menus.SemanticsDownload\n * @element pnx-semantics-download\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-semantics-download ._t=${viewer._t} />\n * ```\n */\nexport default class SemanticsDownload extends LitElement {\n\tstatic styles = [ titles, faSvg ];\n\n\trender() {\n\t\treturn html`\n\t\t\t<h4>${fa(faDownload)} ${this._t?.pnx.semantics_download_title}</h4>\n\t\t\t<p>${this._t?.pnx.semantics_download_info}</p>\n\t\t\t<pnx-link-button\n\t\t\t\thref=\"https://docs.panoramax.fr/federated-catalog/data_export/\"\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\tkind=\"outline\"\n\t\t\t\tstyle=\"width: 100%\"\n\t\t\t>${this._t?.pnx.semantics_download_cta}</pnx-link-button>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-download\", SemanticsDownload);\n","import { LitElement, html, css } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport { faDownload } from \"@fortawesome/free-solid-svg-icons/faDownload\";\nimport { SEMANTICS_OVERLAY_MINZOOM } from \"../../utils/SemanticsMapProtocol\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\n\n/**\n * Semantics Filters menu allows user to show/hide specific semantic tags over the map.\n * @class Panoramax.components.menus.SemanticsFilters\n * @element pnx-map-semantics-filters-menu\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.menus.SemanticsFilters#change\n * @example\n * ```html\n * <pnx-map-semantics-filters-menu _parent=${viewer} />\n * ```\n */\nexport default class SemanticsFilters extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t.pnx-tags-zoomin {\n\t\t\tz-index: 131;\n\t\t\tbackground-color: rgba(255,255,255,0.8);\n\t\t\ttext-align: center;\n\t\t\tfont-weight: 800;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tleft: 0;\n\t\t\tbottom: 0;\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\t\t\tborder-radius: 25px;\n\t\t}\n\t\t.pnx-tags-zoomin.hidden {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pnx-tags-cta {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n  \t\t\tjustify-content: end;\n\t\t}\n\t\tpnx-switch {\n\t\t\tdisplay: block;\n\t\t\tmargin: 5px 0;\n\t\t}\n\t`;\n\n\t/** @private */\n\tstatic properties = {\n\t\t_showZoomIn: {state: true},\n\t\t_layers: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.showZoomIn = true;\n\t\tthis._layers = [];\n\n\t\t// Map zoom\n\t\tonceParentAvailable(this).then(() => this._parent.onceMapReady?.().then(async () => {\n\t\t\tthis._parent.map.on(\"zoomend\", this._onMapZoom.bind(this));\n\t\t\tthis._parent.map.on(\"render\", this._onLayersChange.bind(this));\n\t\t\tthis._onMapZoom();\n\t\t\tthis._onLayersChange();\n\t\t}));\n\t}\n\n\t/** @private */\n\t_layersToSet(layers) {\n\t\treturn layers.map(l => l.id+\"/\"+l.layout?.visibility).sort().join(\"|\");\n\t}\n\n\t/** @private */\n\t_onLayersChange() {\n\t\tclearTimeout(this._debouncedChange);\n\t\tthis._debouncedChange = setTimeout(\n\t\t\t() => {\n\t\t\t\tconst newlayers = this._parent?.map?.getSemanticOverlays();\n\t\t\t\tif(this._layersToSet(newlayers) != this._layersToSet(this._layers)) {\n\t\t\t\t\tthis._layers = newlayers;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Event for semantics overlay visibility changes\n\t\t\t\t\t * @event Panoramax.components.menus.SemanticsFilters#change\n\t\t\t\t\t * @type {CustomEvent}\n\t\t\t\t\t * @property {object[]} detail.layers List of semantics layers, from MapLibre\n\t\t\t\t\t */\n\t\t\t\t\tthis.dispatchEvent(new CustomEvent(\"change\", {\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\tdetail: { layers: newlayers }\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t},\n\t\t\t10\n\t\t);\n\t}\n\n\t/**\n\t * Map zoom event handler: show/hide \"zoom in\" labels\n\t * @private\n\t */\n\t_onMapZoom() {\n\t\tthis._showZoomIn = this._parent.map.getZoom() < SEMANTICS_OVERLAY_MINZOOM;\n\t}\n\t\n\t/** @private */\n\trender() {\n\t\tif(!this._layers || this._layers.length === 0) { return; }\n\n\t\treturn html`\n\t\t\t<div class=\"pnx-tags-zoomin ${this._showZoomIn ? \"\" : \"hidden\"}\">\n\t\t\t\t${this._parent?._t.pnx.semantics_zoom_in}\n\t\t\t</div>\n\n\t\t\t<div class=\"pnx-tags-cta\">\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"full\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t@click=${() => this._parent?._showSemanticsDownload()}\n\t\t\t\t>${fa(faDownload)} ${this._parent?._t.pnx.semantics_download}</pnx-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tid=\"pnx-semfilt-doc\"\n\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\tsize=\"md\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_doc}\n\t\t\t\t\t@click=${() => this._parent?._showSemanticsDoc()}\n\t\t\t\t>${fa(faInfoCircle)}</pnx-button>\n\t\t\t</div>\n\n\t\t\t${this._layers.filter(l => l.metadata).map(l => html`\n\t\t\t\t<pnx-switch\n\t\t\t\t\tname=${\"pnx-semfilt-\"+l.id}\n\t\t\t\t\t.checked=${l.layout?.visibility !== \"none\"}\n\t\t\t\t\t@change=${e => this._parent.map.setLayoutProperty(l.id, \"visibility\", e.target.checked ? \"visible\" : \"none\")}\n\t\t\t\t>${this._parent?._t.pnx.semantics_overlays[l.id] || l.metadata.name || l.id}</pnx-switch>\n\t\t\t`)}\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-map-semantics-filters-menu\", SemanticsFilters);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { faSvg, iconify, badgeCount } from \"../styles\";\nimport { fa, moreIcons } from \"../../utils/widgets\";\nimport { semanticsToString } from \"../../utils/semantics\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons/faChevronRight\";\nimport { faPen } from \"@fortawesome/free-solid-svg-icons/faPen\";\nimport { faTrash } from \"@fortawesome/free-solid-svg-icons/faTrash\";\nimport { faArrowLeft } from \"@fortawesome/free-solid-svg-icons/faArrowLeft\";\nimport { faImages } from \"@fortawesome/free-solid-svg-icons/faImages\";\nimport { faVectorSquare } from \"@fortawesome/free-solid-svg-icons/faVectorSquare\";\nimport { faCopy } from \"@fortawesome/free-solid-svg-icons/faCopy\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons/faCheck\";\nimport { onceParentAvailable } from \"../../utils/widgets\";\nimport { groupByPrefix } from \"../../utils/semantics\";\nimport \"iconify-icon\";\n\n/**\n * Semantics list shows listing of both picture tags and annotations.\n * It uses the parent component currently selected picture.\n * \n * @class Panoramax.components.menus.SemanticsList\n * @element pnx-semantics-list\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.menus.SemanticsList#select\n * @fires Panoramax.components.menus.SemanticsList#edit-click\n * @fires Panoramax.components.menus.SemanticsList#delete-click\n * @example\n * ```html\n * <pnx-semantics-list _parent=${viewer} />\n * ```\n */\nexport default class SemanticsList extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, iconify, badgeCount, css`\n\t\t.annotation { background: var(--white); }\n\t\tpnx-list-item {\n\t\t\tdisplay: block;\n\t\t\tmargin: 5px 0;\n\t\t}\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.SemanticsList#\n\t * @type {Object}\n\t * @property {boolean} [editable=false] Show an \"Edit\" button ?\n\t */\n\tstatic properties = {\n\t\teditable: {type: Boolean},\n\t\t_meta: {state: true},\n\t\t_seqMeta: {state: true},\n\t\t_entries: {state: true},\n\t\t_selectedEntry: {state: true},\n\t\t_annotPresets: {state: true},\n\t\t_picPresets: {state: true},\n\t\t_seqPresets: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._meta = {};\n\t\tthis._seqMeta = {};\n\t\tthis._selectedEntry = null;\n\t\tthis._annotPresets = {};\n\t\tthis._picPresets = [];\n\t\tthis._seqPresets = [];\n\t\tthis._entries = null;\n\t\tthis.editable = false;\n\t\tmoreIcons();\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tthis._onPicChange();\n\t\t\n\t\tonceParentAvailable(this).then(() => {\n\t\t\tthis._parent.psv?.addEventListener(\"picture-loaded\", this._onPicChange.bind(this));\n\t\t\tthis._parent.psv?.addEventListener(\"annotation-focused\", e => this.showAnnotation(e.detail.annotationId));\n\t\t\tthis._parent.psv?.addEventListener(\"annotations-unfocused\", () => this._onListItemClick(null));\n\t\t\tthis._parent.psv?.addEventListener(\"semantics-unfocused\", () => this._onListItemClick(null));\n\n\t\t\tconst selectedAnnots = this._parent.psv.getSelectedAnnotations();\n\t\t\tif(selectedAnnots.length > 0) {\n\t\t\t\tthis.showAnnotation(selectedAnnots[0]);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Display a specific annotation details.\n\t * @param {string} id The annotation UUID\n\t * @memberof Panoramax.components.menus.SemanticsList#\n\t */\n\tshowAnnotation(id) {\n\t\tif(!this._entries) { setTimeout(() => this.showAnnotation(id), 200); }\n\t\telse { this._onListItemClick(this._entries.find(e => e.type === \"annotation\" && e.annotation.id == id)); }\n\t}\n\n\t/**\n\t * Display a specific tag group details.\n\t * @param {object} tags The tags to find\n\t * @memberof Panoramax.components.menus.SemanticsList#\n\t */\n\tshowTagsGroup(tags) {\n\t\tif(!this._entries) { setTimeout(() => this.showTagsGroup(tags), 200); }\n\t\telse {\n\t\t\tthis._onListItemClick(this._entries.find(e => {\n\t\t\t\tif(e?.type === \"annotation\") { return false; }\n\t\t\t\tfor(let i=0; i < tags.length; i++) {\n\t\t\t\t\tif(!e.tagGroup.semantics.find(s => tags[i].key === s.key && tags[i].value === s.value)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}));\n\t\t}\n\t}\n\n\t/** @private */\n\t_onPicChange() {\n\t\tthis._meta = this._parent?.psv?.getPictureMetadata();\n\t\tthis._getSeqMeta();\n\t\tdelete this._prevPsvView;\n\t\tthis._selectedEntry = null;\n\t\tthis._entries = null;\n\t\tthis.dispatchEvent(new CustomEvent(\"select\", { detail: { item: null } }));\n\n\t\t// Load presets\n\t\tif(this._meta && this._parent?.presetsManager) {\n\t\t\tthis._annotPresets = {};\n\t\t\tthis._picPresets = [];\n\n\t\t\t// Picture tags\n\t\t\tthis._parent.presetsManager.getPresets(this._meta.properties).then(p => {\n\t\t\t\tthis._picPresets = p;\n\t\t\t\tthis._computeEntries();\n\t\t\t});\n\n\t\t\t// Annotations\n\t\t\tif(this._meta.properties?.annotations?.length > 0) {\n\t\t\t\tPromise.all(this._meta.properties.annotations.map(a => this._parent.presetsManager.getPreset(a).then(p => {\n\t\t\t\t\tthis._annotPresets[a.id] = p;\n\t\t\t\t}))).then(() => this._computeEntries());\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\tasync _getSeqMeta() {\n\t\tconst seqId = this._meta?.sequence?.id;\n\n\t\t// If no cache, call API\n\t\tif(seqId && !this._parent._sequencesMetadata[seqId]) {\n\t\t\tthis._parent._sequencesMetadata[seqId] = await this._parent.api.getSequenceMetadata(seqId);\n\t\t}\n\n\t\tthis._seqMeta = this._parent._sequencesMetadata[seqId];\n\t\tthis._seqPresets = [];\n\n\t\tif(this._seqMeta?.semantics?.length > 0) {\n\t\t\tconst p = await this._parent.presetsManager.getPresets(this._seqMeta);\n\t\t\tthis._seqPresets = p;\n\t\t\tthis._computeEntries();\n\t\t}\n\t}\n\n\t/** @private */\n\t_getGroupedTags(semantics, type, unknownTagId, presets) {\n\t\tconst entries = [];\n\t\tconst groupToList = (t, pkey) => {\n\t\t\tconst g = [ {key: pkey, value: t.value} ];\n\t\t\tif(t.qualifiers) { t.qualifiers.forEach(q => g.push({key: q.key, value: q.value})); }\n\t\t\treturn g;\n\t\t};\n\n\t\tconst tagsGroups = groupByPrefix(semantics);\n\t\tconst nonMatchingTags = [];\n\t\ttagsGroups.forEach(g => {\n\t\t\tconst usedTags = {};\n\t\t\tg.tags.forEach(t => {\n\t\t\t\tconst pkey = g.prefix != \"\" ? `${g.prefix}|${t.key}` : t.key;\n\n\t\t\t\t// Skip if tag found in a previous preset\n\t\t\t\tif(usedTags[`${pkey}=${t.value}`]) {\n\t\t\t\t\tgroupToList(t, pkey).forEach(v => usedTags[`${pkey}=${t.value}`].push(v));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Check if a picture preset matches this tag\n\t\t\t\tconst preset = presets.find(p => [\"*\", t.value].includes(p.tags[pkey]));\n\t\t\t\tif(preset) {\n\t\t\t\t\tconst groupTags = groupToList(t, pkey);\n\n\t\t\t\t\t// Add all used tags for this preset into used ones\n\t\t\t\t\tlet usedTagsCount = 0;\n\t\t\t\t\tObject.entries(preset.tags).forEach(([prk, prv]) => {\n\t\t\t\t\t\tlet utv = prv;\n\t\t\t\t\t\tif(prv === \"*\") {\n\t\t\t\t\t\t\tutv = this._meta.properties.semantics.find(s => s.key === pkey)?.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tusedTags[prk+\"=\"+utv] = groupTags;\n\t\t\t\t\t\tusedTagsCount++;\n\t\t\t\t\t});\n\n\t\t\t\t\tentries.push({\n\t\t\t\t\t\ttitle: preset.name,\n\t\t\t\t\t\ticon: preset.iconify || \"fa6-solid:cube\",\n\t\t\t\t\t\tassociatedTags: (t.qualifiers?.length || 0) + usedTagsCount,\n\t\t\t\t\t\ttagGroup: { semantics: groupTags },\n\t\t\t\t\t\ttype: type,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnonMatchingTags.push({key: pkey, value: t.value});\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tif(nonMatchingTags.length > 0) {\n\t\t\tentries.push({\n\t\t\t\ttitle: this._parent?._t.pnx.semantics_features_default_title.replace(\"{nb}\", unknownTagId++),\n\t\t\t\ticon: \"fa6-solid:tag\",\n\t\t\t\tassociatedTags: nonMatchingTags.length,\n\t\t\t\ttagGroup: { semantics: nonMatchingTags },\n\t\t\t\ttype: type,\n\t\t\t});\n\t\t}\n\n\t\treturn [ entries, unknownTagId ];\n\t}\n\n\t/** @private */\n\t_computeEntries() {\n\t\tlet unknownTagId = 1;\n\t\tlet entries = [];\n\t\tlet entries2 = [];\n\n\t\t// Sequence tags\n\t\tif(this._seqMeta?.semantics?.length > 0) {\n\t\t\t[ entries, unknownTagId ] = this._getGroupedTags(this._seqMeta.semantics, \"seqtags\", unknownTagId, this._seqPresets);\n\t\t}\n\n\t\t// Picture tags\n\t\t[ entries2, unknownTagId ] = this._getGroupedTags(this._meta.properties?.semantics, \"pictags\", unknownTagId, this._picPresets);\n\t\tentries = entries.concat(entries2);\n\n\t\t// Annotations\n\t\tentries = entries.concat(this._meta.properties?.annotations?.map(a => ({\n\t\t\ttitle: this._annotPresets[a.id]?.name || this._parent?._t.pnx.semantics_features_default_title.replace(\"{nb}\", unknownTagId++),\n\t\t\ticon: this._annotPresets[a.id]?.iconify || \"fa6-solid:cube\",\n\t\t\tassociatedTags: a.semantics.filter(s => s.action !== \"delete\").length,\n\t\t\ttype: \"annotation\",\n\t\t\tannotation: a,\n\t\t})) || []);\n\n\t\tthis._entries = entries;\n\t}\n\n\t/** @private */\n\t_onListItemHover(item) {\n\t\tif(item?.type === \"annotation\") {\n\t\t\t// Save position before hover to allow reset after\n\t\t\tif(!this._prevPsvView) { this._prevPsvView = [this._parent.psv.getZoomLevel(), this._parent.psv.getPosition()]; }\n\n\t\t\tthis._parent.psv.focusOnAnnotation(item.annotation.id, undefined, true);\n\t\t}\n\t\telse {\n\t\t\tthis._parent.psv.unfocusAnnotation();\n\n\t\t\t// Restore previous PSV position\n\t\t\tif(this._prevPsvView) {\n\t\t\t\tthis._parent.psv.zoom(this._prevPsvView[0]);\n\t\t\t\tthis._parent.psv.rotate(this._prevPsvView[1]);\n\t\t\t\tdelete this._prevPsvView;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\t_onListItemClick(item) {\n\t\tthis._selectedEntry = item;\n\t\tthis._onListItemHover(item);\n\n\t\t/**\n\t\t * Event for item selection\n\t\t *\n\t\t * @event Panoramax.components.menus.SemanticsList#select\n\t\t * @type {CustomEvent}\n\t\t * @property {object} detail.item The selected annotation/tag group (or null if none)\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"select\", {\n\t\t\tdetail: { item }\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onItemEditClick(e) {\n\t\te.stopPropagation();\n\n\t\t/**\n\t\t * Event for edit button click\n\t\t *\n\t\t * @event Panoramax.components.menus.SemanticsList#edit-click\n\t\t * @type {CustomEvent}\n\t\t * @property {object} detail.item The annotation/tag group to edit\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"edit-click\", {\n\t\t\tdetail: { item: this._selectedEntry }\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onItemDeleteClick(e) {\n\t\te.stopPropagation();\n\n\t\t/**\n\t\t * Event for delete button click\n\t\t *\n\t\t * @event Panoramax.components.menus.SemanticsList#delete-click\n\t\t * @type {CustomEvent}\n\t\t * @property {object} detail.item The annotation/tag group to delete\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"delete-click\", {\n\t\t\tdetail: { item: this._selectedEntry }\n\t\t}));\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tif(!this._meta) { return nothing; }\n\n\t\t// Selected entry\n\t\tif(this._selectedEntry) {\n\t\t\treturn html`<div class=\"annotation\">\n\t\t\t\t<pnx-list-item\n\t\t\t\t\ttitle=${this._selectedEntry.title}\n\t\t\t\t\t@click=${() => this._onListItemClick(null)}\n\t\t\t\t>\n\t\t\t\t\t${fa(faArrowLeft, {transform: {size: 24}, attributes: {slot: \"icon\"}})}\n\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\tslot=\"icon\"\n\t\t\t\t\t\ticon=${this._selectedEntry.icon}\n\t\t\t\t\t\tstyle=\"font-size: 1.5em\"\n\t\t\t\t\t></iconify-icon>\n\n\t\t\t\t\t<pnx-copy-button\n\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\ttext=${semanticsToString((this._selectedEntry?.annotation || this._selectedEntry?.tagGroup)?.semantics)}\n\t\t\t\t\t\tslot=\"action\"\n\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_copy}\n\t\t\t\t\t>\n\t\t\t\t\t\t${fa(faCopy, {transform: {size: 18}})}\n\t\t\t\t\t\t${fa(faCheck, {attributes: {slot: \"oncopy\"}, transform: {size: 18}})}\n\t\t\t\t\t</pnx-copy-button>\n\t\t\t\t\t\n\t\t\t\t\t${this.editable && this._selectedEntry.type !== \"seqtags\" ? html`\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_edit}\n\t\t\t\t\t\t\tslot=\"action\"\n\t\t\t\t\t\t\t@click=${this._onItemEditClick}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faPen, {transform: {size: 18}})}\n\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_delete_annotation}\n\t\t\t\t\t\t\tslot=\"action\"\n\t\t\t\t\t\t\t@click=${this._onItemDeleteClick}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faTrash, {transform: {size: 18}})}\n\t\t\t\t\t\t</pnx-button>`\n\t\t\t\t\t: nothing}\n\t\t\t\t</pnx-list-item>\n\t\t\t\t<pnx-semantics-table\n\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t.source=${this._selectedEntry?.type === \"annotation\" ? this._selectedEntry.annotation : this._selectedEntry.tagGroup}\n\t\t\t\t/>\n\t\t\t</div>`;\n\t\t}\n\t\t// General listing\n\t\telse {\n\t\t\tconst titles = {\n\t\t\t\t\"seqtags\": this._parent?._t.pnx.semantics_sequence_tags,\n\t\t\t\t\"pictags\": this._parent?._t.pnx.semantics_picture_tags,\n\t\t\t\t\"annotation\": this._parent?._t.pnx.semantics_annotation_tags\n\t\t\t};\n\n\t\t\treturn html`<div class=\"list\">\n\t\t\t\t${(this._entries || []).map(e => html`\n\t\t\t\t\t<pnx-list-item\n\t\t\t\t\t\ttitle=${e.title}\n\t\t\t\t\t\ttooltip=${titles[e.type]}\n\t\t\t\t\t\t@click=${() => this._onListItemClick(e)}\n\t\t\t\t\t\t@mouseover=${() => this._onListItemHover(e)}\n\t\t\t\t\t\t@mouseout=${() => this._onListItemHover(null)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<iconify-icon\n\t\t\t\t\t\t\tslot=\"icon\"\n\t\t\t\t\t\t\ticon=${e.icon}\n\t\t\t\t\t\t\tstyle=\"font-size: 1.5em\"\n\t\t\t\t\t\t></iconify-icon>\n\t\t\t\t\t\t${e.associatedTags > 1 ? html`\n\t\t\t\t\t\t\t<span slot=\"icon\" class=\"pnx-badge-count\">${e.associatedTags}</span>\n\t\t\t\t\t\t` : nothing}\n\t\t\t\t\t\t${e?.type === \"annotation\" ? fa(faVectorSquare, {transform: {size: 20}, styles: { \"margin-right\": \"20px\" }, attributes: {slot: \"action\"}}) : nothing}\n\t\t\t\t\t\t${e?.type === \"seqtags\" ? fa(faImages, {transform: {size: 20}, styles: { \"margin-right\": \"20px\" }, attributes: {slot: \"action\"}}) : nothing}\n\t\t\t\t\t\t${fa(faChevronRight, {transform: {size: 20}, attributes: {slot: \"action\"}})}\n\t\t\t\t\t</pnx-list-item>\n\t\t\t\t`)}\n\t\t\t</div>`;\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-list\", SemanticsList);\n","import { LitElement, html, nothing, css } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\nimport { faFloppyDisk } from \"@fortawesome/free-solid-svg-icons/faFloppyDisk\";\nimport { faTimes } from \"@fortawesome/free-solid-svg-icons/faTimes\";\nimport { faPlusSquare } from \"@fortawesome/free-solid-svg-icons/faPlusSquare\";\nimport { faEraser } from \"@fortawesome/free-solid-svg-icons/faEraser\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport { hidden, dataBlocks } from \"../styles\";\nimport { getUserAccount } from \"../../utils/utils\";\n\n/**\n * Semantics metadata displays detailed info about semantic attributes of a single picture.\n * @class Panoramax.components.menus.SemanticsMetadata\n * @element pnx-semantics-metadata\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-semantics-metadata ._parent=${viewer}></pnx-semantics-metadata>\n * ```\n */\nexport default class SemanticsMetadata extends LitElement {\n\t/** @private */\n\tstatic styles = [ hidden, dataBlocks, css`\n\t\t.top-btns, pnx-semantics-list {\n\t\t\tfont-size: 0.8em;\n\t\t}\n\t\t.top-btns {\n\t\t\tdisplay: flex;\n\t\t\tmargin: 5px 0;\n\t\t\tgap: 5px;\n\t\t}\n\t\t.top-btns > * {\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.top-btns > *::part(btn) {\n\t\t\theight: unset;\n\t\t}\n\t\t.data-block {\n\t\t\twidth: 100%;\n\t\t}\n\t\t.data-block h5 {\n\t\t\tjustify-content: space-between;\n\t\t}\n\t` ];\n\n\t/** @private */\n\tstatic properties = {\n\t\t_meta: {state: true},\n\t\t_prevPSVPicNav: {state: true},\n\t\t_authUrl: {state: true},\n\t\t_showLinks: {state: true},\n\n\t\t_addTag: {state: true},\n\t\t_editTag: {state: true},\n\t\t_addTagGeom: {state: true},\n\t\t_editTagSem: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._meta = {};\n\t\tthis._prevPSVPicNav = null;\n\t\tthis._authUrl = null;\n\t\tthis._showLinks = true;\n\n\t\tthis._addTag = false;\n\t\tthis._editTag = null;\n\t\tthis._addTagGeom = null;\n\t\tthis._editTagSem = null;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this).then(() => {\n\t\t\tthis._meta = this._parent?.psv?.getPictureMetadata();\n\t\t\tthis._parent?.oncePSVReady?.().then(() => {\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._meta = this._parent.psv.getPictureMetadata();\n\t\t\t\t});\n\t\t\t\tthis._parent.psv.addEventListener(\"annotation-focused\", () => {\n\t\t\t\t\tconst tabs = this.shadowRoot.querySelector(\"pnx-tabs\");\n\t\t\t\t\tif(tabs) { tabs.setAttribute(\"activeTabIndex\", 4); }\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis._parent.api.getAuthURL().then(res => this._authUrl = res);\n\t\t});\n\t}\n\n\t/** @private */\n\t_blockPicChange(block) {\n\t\tthis._parent?.legend?.renderRoot.querySelector(\"pnx-picture-legend\")?.blockOnEditing(block);\n\t\tif(this._parent?.mini) { this._parent.mini.style.display = block ? \"none\" : null; }\n\t\tconst answ = this._parent.renderRoot.querySelector(\"pnx-annotations-switch\");\n\t\tif(answ) { answ.style.display = block ? \"none\": null; }\n\n\t\tif(block) {\n\t\t\tthis._prevPSVPicNav = this._parent.psv.getPicturesNavigation();\n\t\t\tthis._parent.psv.setPicturesNavigation(\"pic\");\n\t\t\tthis._parent._disableKeyboard();\n\t\t\twindow.addEventListener(\"beforeunload\", this._onBrowserQuit);\n\t\t}\n\t\telse {\n\t\t\tthis._parent.psv.setPicturesNavigation(this._prevPSVPicNav);\n\t\t\tthis._parent._enableKeyboard();\n\t\t\twindow.removeEventListener(\"beforeunload\", this._onBrowserQuit);\n\t\t}\n\t}\n\n\t/** @private */\n\t_onBrowserQuit(e) {\n\t\te.preventDefault();\n\t\te.returnValue = true;\n\t}\n\n\t/** @private */\n\t_checkCanEdit() {\n\t\tif(!this._meta.origInstance && getUserAccount() !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\tif(this._meta.origInstance && confirm((this._parent?._t.pnx.semantics_login_needed || \"\").replace(\"{n}\", this._meta.origInstance.instance_name || this._meta.origInstance.href))) {\n\t\t\t\twindow.location.href = this._meta.origInstance.href + window.location.search.replace(/&?nav=pic/, \"\");\n\t\t\t}\n\t\t\telse if(!this._meta.origInstance && confirm((this._parent?._t.pnx.semantics_login_needed || \"\").replace(\"{n}\", this._parent.api._metadata.name))) {\n\t\t\t\twindow.location.href = this._authUrl.replace(\"<CBURL>\", encodeURIComponent(window.location.href));\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\t_startAddTag() {\n\t\tif(!this._checkCanEdit()) { return; }\n\n\t\tthis._blockPicChange(true);\n\t\tthis._addTag = true;\n\t\tthis._editTag = false;\n\t\tthis._addTagGeom = null;\n\t\tthis._editTagSem = null;\n\n\t\tthis._addTagGeomListener = e => this._addTagGeom = e.detail.shape;\n\t\tthis._parent.psv.addEventListener(\"annotation-drawn\", this._addTagGeomListener);\n\t\tthis._parent.psv.startDrawAnnotation();\n\t}\n\n\t/** @private */\n\t_onTagSemChange(e) {\n\t\tthis._editTagSem = e.detail;\n\t}\n\n\t/** @private */\n\t_onSaveTag() {\n\t\tconst field = this.renderRoot.querySelector(\"#pnx-sem-editor\");\n\n\t\t// Check field validity\n\t\tif(!field || !field.checkValidity() || !this._editTagSem || !this._editTagSem.delta || this._editTagSem.delta.length === 0) {\n\t\t\tfield.reportValidity();\n\t\t\treturn;\n\t\t}\n\n\t\t// Edit an annotation\n\t\tif(this._editTag?.type === \"annotation\") {\n\t\t\tthis._parent?.api.editPictureAnnotation(this._editTag.annotation.id, this._editTagSem.delta).then(newAnnot => {\n\t\t\t\tconst annotPos = this._meta.properties.annotations.findIndex(a => a.id === newAnnot.id);\n\t\t\t\tthis._meta.properties.annotations[annotPos] = newAnnot;\n\t\t\t\tthis._onCancelEditTag(newAnnot);\n\t\t\t}).catch(e => {\n\t\t\t\tconsole.error(\"Can't send annotation\", e);\n\t\t\t\tthis._onCancelEditTag(this._editTag.annotation);\n\t\t\t\talert(this._parent?._t.pnx.semantics_send_fail);\n\t\t\t});\n\t\t}\n\t\t// Create annotation if a geom exists\n\t\telse if(this._addTag && this._addTagGeom) {\n\t\t\tthis._parent.psv.fixDrawAnnotation();\n\t\t\tthis._parent?.api.createPictureAnnotation(this._meta, this._addTagGeom, this._editTagSem.delta).then(newAnnot => {\n\t\t\t\tthis._meta.properties.annotations.push(newAnnot);\n\t\t\t\tthis._onCancelEditTag(newAnnot, true);\n\t\t\t}).catch(e => {\n\t\t\t\tconsole.error(\"Can't send annotation\", e);\n\t\t\t\talert(this._parent?._t.pnx.semantics_send_fail);\n\t\t\t\tthis._onCancelEditTag();\n\t\t\t});\n\t\t}\n\t\t// Create picture tag or edit a tag group\n\t\telse if(this._addTag || (this._editTag && this._editTag.type !== \"annotation\")) {\n\t\t\tthis._parent?.api.sendPictureSemantics(this._meta, this._editTagSem.delta).then(newPic => {\n\t\t\t\tthis._meta.properties.semantics = newPic.properties.semantics;\n\t\t\t\tthis._onCancelEditTag(this._editTagSem.delta);\n\t\t\t}).catch(e => {\n\t\t\t\talert(this._parent?._t.pnx.semantics_send_fail);\n\t\t\t\tconsole.error(\"Can't send semantics\", e);\n\t\t\t\tthis._onCancelEditTag();\n\t\t\t});\n\t\t}\n\t}\n\n\t/** @private */\n\t_onEraseDrawnAnnotation() {\n\t\tthis._parent.psv.stopDrawAnnotation();\n\t\tthis._addTagGeom = null;\n\t\tthis._parent.psv.startDrawAnnotation();\n\t}\n\n\t/** @private */\n\t_onEditTag(e) {\n\t\tif(!this._checkCanEdit()) { return; }\n\n\t\tthis._blockPicChange(true);\n\t\tthis._addTag = false;\n\t\tthis._addTagGeom = null;\n\t\tthis._editTagSem = e.detail.item?.type === \"annotation\" ? { semantics: e.detail.item.annotation.semantics } : e.detail.item.tagGroup;\n\t\tthis._editTag = e.detail.item;\n\n\t\tif(e.detail.item?.type === \"annotation\") {\n\t\t\tthis._parent.psv.focusOnAnnotation(e.detail.item.annotation.id, true);\n\t\t}\n\t}\n\n\t/** @private */\n\t_onCancelEditTag(item = null, skipStopDraw = false) {\n\t\t// Force hiding of report status on tag editor\n\t\tthis.renderRoot.querySelector(\"#pnx-sem-editor\").reset();\n\n\t\tthis._addTag = false;\n\t\tthis._addTagGeom = null;\n\t\tthis._editTag = null;\n\t\tif(!skipStopDraw) { this._parent.psv.stopDrawAnnotation(); }\n\t\tthis._blockPicChange(false);\n\n\t\t// Select back item in list\n\t\tthis.getUpdateComplete().then(() => {\n\t\t\tconst list = this.renderRoot.querySelector(\"#pnx-sem-list\");\n\t\t\tif(item && list) {\n\t\t\t\tif(item.id) { list.showAnnotation(item.id); }\n\t\t\t\telse { list.showTagsGroup(item); }\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @private */\n\t_onDeleteTag(e) {\n\t\tif(!this._checkCanEdit()) { return; }\n\n\t\tif(confirm(this._parent?._t.pnx.semantics_delete_annotation_confirm)) {\n\t\t\tconst item = e.detail.item;\n\t\t\t// Annotation deleting\n\t\t\tif(item?.type === \"annotation\") {\n\t\t\t\tthis._parent?.api.deletePictureAnnotation(item.annotation.id).then(() => {\n\t\t\t\t\t// Remove from current metadata\n\t\t\t\t\tconst newMeta = Object.assign({}, this._meta);\n\t\t\t\t\tnewMeta.properties.annotations = this._meta.properties.annotations.filter(a => a.id != item.annotation.id);\n\t\t\t\t\tthis._meta = newMeta;\n\n\t\t\t\t\t// Remove from PSV\n\t\t\t\t\tthis._parent.psv.toggleAllAnnotations(true);\n\n\t\t\t\t\t// Remove from annotations list\n\t\t\t\t\tthis.renderRoot.querySelector(\"pnx-semantics-list\")?._onPicChange();\n\t\t\t\t}).catch(e => {\n\t\t\t\t\tconsole.error(\"Can't send annotation\", e);\n\t\t\t\t\talert(this._parent?._t.pnx.semantics_send_fail);\n\t\t\t\t});\n\t\t\t}\n\t\t\t// Tag group deletion\n\t\t\telse {\n\t\t\t\tconst semDiff = item.tagGroup.semantics.map(t => Object.assign({action: \"delete\"}, t));\n\t\t\t\tthis._parent?.api.sendPictureSemantics(this._meta, semDiff).then(newPic => {\n\t\t\t\t\tthis._meta.properties.semantics = newPic.properties.semantics;\n\t\t\t\t\tthis.renderRoot.querySelector(\"pnx-semantics-list\")?._onPicChange();\n\t\t\t\t}).catch(e => {\n\t\t\t\t\talert(this._parent?._t.pnx.semantics_send_fail);\n\t\t\t\t\tconsole.error(\"Can't send semantics\", e);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tif(!this._meta?.properties) { return; }\n\n\t\tconst canEdit = !this._meta.origInstance && (this._authUrl || getUserAccount() !== null);\n\n\t\treturn html`\n\t\t\t${(this._addTag || this._editTag) ? html`\n\t\t\t\t<div class=\"data-block\">\n\t\t\t\t\t<h5>\n\t\t\t\t\t\t${this._addTag ? this._parent?._t.pnx.semantics_add_annotation : this._parent?._t.pnx.semantics_edit}\n\n\t\t\t\t\t\t<pnx-button-group>\n\t\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\t\tkind=\"fullsuccess\"\n\t\t\t\t\t\t\t\tstyle=\"margin-right: 3px\"\n\t\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_save}\n\t\t\t\t\t\t\t\t@click=${this._onSaveTag}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${fa(faFloppyDisk)}\n\t\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\t\tkind=\"fullwarn\"\n\t\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx.semantics_undo}\n\t\t\t\t\t\t\t\t@click=${() => this._onCancelEditTag(this._editTag?.annotation || this._editTag)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${fa(faTimes)}\n\t\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t</pnx-button-group>\n\t\t\t\t\t</h5>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t${this._addTag ? this._parent?._t.pnx.semantics_draw_annotation : nothing}\n\t\t\t\t\t\t${this._addTag && this._addTagGeom ? html`<pnx-button\n\t\t\t\t\t\t\t\tkind=\"full\"\n\t\t\t\t\t\t\t\tstyle=\"margin-top: 5px; width: 100%\"\n\t\t\t\t\t\t\t\t@click=${this._onEraseDrawnAnnotation}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faEraser)} ${this._parent?._t.pnx.semantics_erase_annotation}\n\t\t\t\t\t\t</pnx-button>` : nothing}\n\n\t\t\t\t\t\t<pnx-semantics-editor\n\t\t\t\t\t\t\tid=\"pnx-sem-editor\"\n\t\t\t\t\t\t\tstyle=\"display: block; margin-top: 5px\"\n\t\t\t\t\t\t\t.semantics=${this._editTagSem?.semantics || []}\n\t\t\t\t\t\t\t._t=${this._parent._t}\n\t\t\t\t\t\t\t@change=${this._onTagSemChange}\n\t\t\t\t\t\t></pnx-semantics-editor>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t` : html`\n\t\t\t\t${this._showLinks ? html `\n\t\t\t\t\t<div class=\"top-btns\">\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\tkind=\"full\"\n\t\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\t\tstyle=\"flex: 2 1\"\n\t\t\t\t\t\t\t@click=${this._startAddTag}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faPlusSquare)} ${this._parent?._t.pnx.semantics_add_annotation}\n\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\tkind=\"full\"\n\t\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\t\tstyle=\"flex: 1 1\"\n\t\t\t\t\t\t\t@click=${() => this._parent?._showSemanticsDoc()}\n\t\t\t\t\t\t>${fa(faInfoCircle)} ${this._parent?._t.pnx.semantics_doc}</pnx-button>\n\t\t\t\t\t</div>\n\t\t\t\t` : nothing}\n\t\t\t\t\n\t\t\t\t<pnx-semantics-list\n\t\t\t\t\tid=\"pnx-sem-list\"\n\t\t\t\t\t.editable=${canEdit}\n\t\t\t\t\t@select=${e => this._showLinks = e.detail.item == null}\n\t\t\t\t\t@edit-click=${this._onEditTag}\n\t\t\t\t\t@delete-click=${this._onDeleteTag}\n\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t/>\n\t\t\t`}\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-metadata\", SemanticsMetadata);\n","import { LitElement, css, html } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\nimport { faSvg, textarea, titles, input } from \"../styles\";\nimport { faMap } from \"@fortawesome/free-solid-svg-icons/faMap\";\nimport { faCircleInfo } from \"@fortawesome/free-solid-svg-icons/faCircleInfo\";\nimport { faShareAlt } from \"@fortawesome/free-solid-svg-icons/faShareAlt\";\nimport { faLink } from \"@fortawesome/free-solid-svg-icons/faLink\";\n\n/**\n * Share Menu displays links for quick picture sharing.\n * @class Panoramax.components.menus.ShareMenu\n * @element pnx-share-menu\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-share-menu ._parent=${viewer} />\n * ```\n */\nexport default class ShareMenu extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, input, textarea, titles, css`\n\t\tdiv[slot=\"content\"] {\n\t\t\tmargin-top: 10px;\n\t\t}\n\t\t.links {\n\t\t\tdisplay: flex;\n\t\t\tgap: 5px;\n\t\t}\n\t\t.embed {\n\t\t\tdisplay: flex;\n\t\t\tgap: 5px;\n\t\t\talign-items: center;\n\t\t\tflex-direction: column;\n\t\t}\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.menus.ShareMenu#\n\t * @type {Object}\n\t * @property {string} [base-url] Override the default base URL (current page)\n\t */\n\tstatic properties = {\n\t\t_url: {state: true},\n\t\t\"base-url\": {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._onUrlChange();\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {\n\t\t\tthis._onUrlChange();\n\t\t\tthis._parent.urlHandler.addEventListener(\"url-changed\", this._onUrlChange.bind(this));\n\t\t});\n\t}\n\n\t/** @private */\n\t_onUrlChange() {\n\t\tconst baseUrl = (this[\"base-url\"] || window.location.href).replace(/\\/$/, \"\");\n\t\tthis._url = this._parent?.urlHandler?.nextShortLink(baseUrl) || baseUrl;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst iframe = `<iframe src=\"${this._url}\" style=\"border: none; width: 500px; height: 300px\"></iframe>`;\n\n\t\treturn html`\n\t\t\t<h4>${fa(faShareAlt)} ${this._parent?._t.pnx.share}</h4>\n\t\t\t<pnx-tabs>\n\t\t\t\t<h4 slot=\"title\">${fa(faLink)} ${this._parent?._t.pnx.share_page}</h4>\n\t\t\t\t<div slot=\"content\">\n\t\t\t\t\t<div class=\"links\">\n\t\t\t\t\t\t<input type=\"text\" readonly value=${this._url} style=\"flex: 2\" />\n\t\t\t\t\t\t<pnx-copy-button ._t=${this._parent?._t} text=${this._url}></pnx-copy-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t<h4 slot=\"title\">${fa(faMap)} ${this._parent?._t.pnx.share_embed}</h4>\n\t\t\t\t<div slot=\"content\">\n\t\t\t\t\t<div class=\"embed\">\n\t\t\t\t\t\t<pnx-link-button\n\t\t\t\t\t\t\thref=\"https://docs.panoramax.fr/web-viewer/03_URL_settings/\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faCircleInfo)} ${this._parent?._t.pnx.share_embed_docs}\n\t\t\t\t\t\t</pnx-link-button>\n\t\t\t\t\t\t<textarea readonly .value=${iframe}></textarea>\n\t\t\t\t\t\t<pnx-copy-button\n\t\t\t\t\t\t\t._t=${this._parent?._t}\n\t\t\t\t\t\t\ttext=${iframe}\n\t\t\t\t\t\t\tstyle=\"width: 100%\"\n\t\t\t\t\t\t></pnx-copy-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</pnx-tabs>`;\n\t}\n}\n\ncustomElements.define(\"pnx-share-menu\", ShareMenu);\n","import { css } from \"lit\";\n\n/* eslint-disable import/no-unused-modules */\n\n// Classic panel\nexport const panel = css`\n\t.pnx-panel {\n\t\tposition: absolute;\n\t\ttransition: opacity 0.2s 0.1s;\n\t\tborder-radius: 25px;\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tbackground-color: var(--widget-bg);\n\t\tcolor: var(--widget-font);\n\t\tmin-width: 250px;\n\t\tbox-sizing: border-box;\n\t\tfont-family: var(--font-family);\n\t}\n\n\t.pnx-panel.pnx-hidden {\n\t\topacity: 0;\n\t\tdisplay: block !important;\n\t\tpointer-events: none;\n\t}\n\n\t.pnx-panel.pnx-padded {\n\t\tpadding: 15px;\n\t}\n`;\n\n// Hidden\nexport const hidden = css`\n\t.pnx-hidden { display: none !important; }\n`;\n\n// Font Awesome SVG\nexport const faSvg = css`\n\t.svg-inline--fa {\n\t\tdisplay: var(--fa-display, inline-block);\n\t\theight: 1em;\n\t\toverflow: visible;\n\t\tvertical-align: -0.125em;\n\t}\n\tsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n\t\toverflow: visible;\n\t\tbox-sizing: content-box;\n\t}\n\t@keyframes fa-spin {\n\t\tfrom {transform:rotate(0deg);}\n\t\tto {transform:rotate(360deg);}\n\t}\n\t.fa-spin {\n\t\tanimation: fa-spin 2s infinite linear;\n\t}\n`;\n\n// Textarea\nexport const textarea = css`\n\ttextarea {\n\t\tbackground-color: var(--widget-bg);\n\t\tcolor: var(--widget-font);\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tborder-radius: 10px;\n\t\tpadding: 5px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tfont-family: var(--font-family);\n\t\tresize: vertical;\n\t}\n`;\n\n// Select\nexport const select = css`\n\tselect {\n\t\tbackground-color: var(--widget-bg);\n\t\tcolor: var(--widget-font);\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tborder-radius: 20px;\n\t\tfont-size: 16px;\n\t\tpadding: 2px 10px;\n\t\tfont-family: var(--font-family);\n\t}\n\n\tselect[disabled] {\n\t\tbackground-color: var(--widget-bg-inactive);\n\t}\n\n\tselect.pnx-100w {\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t}\n`;\n\n// Input\nexport const input = css`\n\tinput {\n\t\tbackground-color: var(--widget-bg);\n\t\tcolor: var(--widget-font);\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tborder-radius: 20px;\n\t\tfont-size: 16px;\n\t\tpadding: 2px 10px;\n\t\tfont-family: var(--font-family);\n\t}\n\n\tinput.pnx-100w {\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t}\n`;\n\n// Buttons\nexport const btn = css`\n\t:host {\n\t\tdisplay: inline-flex;\n\t}\n\t\n\t/* Common properties */\n\t.pnx-btn {\n\t\twhite-space: nowrap;\n\t\tfont-size: 1em;\n\t\tfont-family: var(--font-family);\n\t\tflex-grow: 1;\n\t\tflex-shrink: 1;\n\t\ttext-align: center;\n\t\tpadding: 5px;\n\t\tfont-weight: 600;\n\t\tflex-basis: 30%;\n\t\tline-height: 18px;\n\t\tjustify-content: center;\n\t\tborder-radius: 8px;\n\t\tcursor: pointer;\n\t\ttext-decoration: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmin-width: 26px;\n\t}\n\n\t.pnx-btn:disabled { color: var(--widget-bg-inactive); }\n\n\t.pnx-btn.pnx-btn-active,\n\t.pnx-btn.pnx-btn-active:hover,\n\t.pnx-btn.pnx-btn-full.pnx-btn-active:hover,\n\t.pnx-btn.pnx-btn-outline.pnx-btn-active:hover {\n\t\tbackground-color: var(--widget-bg-active);\n\t\tborder-color: var(--widget-bg-active);\n\t\tcolor: var(--widget-font-active);\n\t}\n\n\t.pnx-btn .svg-inline--fa,\n\t.pnx-btn ::slotted(.svg-inline--fa),\n\t.pnx-btn slot .svg-inline--fa {\n\t\theight: 16px;\n\t\tpointer-events: none;\n\t}\n\n\t/* Sizing */\n\t.pnx-btn-sm {\n\t\tborder-radius: 6px;\n\t\tline-height: 12px;\n\t\tfont-size: 12px;\n\t\tmin-width: unset;\n\t}\n\n\t.pnx-btn.pnx-btn-sm .svg-inline--fa,\n\t.pnx-btn.pnx-btn-sm ::slotted(.svg-inline--fa) {\n\t\theight: 12px;\n\t}\n\n\t.pnx-btn-l {\n\t\tborder-radius: 12px;\n\t\theight: 24px;\n\t\tline-height: 24px;\n\t\tfont-size: 20px;\n\t\tmin-width: 24px;\n\t}\n\n\t.pnx-btn-xl {\n\t\tborder-radius: 20px;\n\t\theight: 40px;\n\t\tline-height: 40px;\n\t\tfont-size: 16px;\n\t\tfont-weight: 500;\n\t\tmin-width: 40px;\n\t\tpadding: 0 10px;\n\t\tgap: 8px;\n\t}\n\n\t.pnx-btn.pnx-btn-xl .svg-inline--fa,\n\t.pnx-btn.pnx-btn-xl ::slotted(.svg-inline--fa) {\n\t\theight: 16px;\n\t}\n\n\t.pnx-btn-xxl {\n\t\tborder-radius: 28px;\n\t\theight: 56px;\n\t\tline-height: 56px;\n\t\tfont-size: 24px;\n\t\tmin-width: 56px;\n\t}\n\n\t.pnx-btn.pnx-btn-xxl .svg-inline--fa,\n\t.pnx-btn.pnx-btn-xxl ::slotted(.svg-inline--fa) {\n\t\theight: 24px;\n\t}\n\n\t/* Fully-filled style */\n\t.pnx-btn-full {\n\t\tbackground-color: var(--widget-bg-primary);\n\t\tcolor: var(--widget-font-direct);\n\t\tborder: none;\n\t}\n\n\t.pnx-btn-full:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-primary-hover);\n\t}\n\n\t/* Fully-filled warning style */\n\t.pnx-btn-fullwarn {\n\t\tbackground-color: var(--widget-bg-warn);\n\t\tcolor: var(--widget-font-warn);\n\t\tborder: none;\n\t}\n\n\t.pnx-btn-fullwarn:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-warn);\n\t}\n\n\t/* Fully-filled success style */\n\t.pnx-btn-fullsuccess {\n\t\tbackground-color: var(--widget-bg-success);\n\t\tcolor: var(--widget-font-success);\n\t\tborder: none;\n\t}\n\n\t.pnx-btn-fullsuccess:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-success);\n\t}\n\n\t/* Outline style */\n\t.pnx-btn-outline {\n\t\tborder: 1px solid var(--widget-border-btn);\n\t\tcolor: var(--widget-font-direct);\n\t\tbackground-color: var(--widget-bg);\n\t}\n\n\t.pnx-btn-outline:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-hover);\n\t}\n\n\t/* Flat style */\n\t.pnx-btn-flat,\n\t.pnx-btn-flat.pnx-btn-active,\n\t.pnx-btn-flat.pnx-btn-active:hover,\n\t.pnx-btn-flat:not(:disabled):hover {\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tcolor: var(--widget-font);\n\t\tbackground-color: var(--widget-bg);\n\t}\n\n\t.pnx-btn-flat:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-hover);\n\t}\n\n\t/* Superflat style */\n\t.pnx-btn-superflat,\n\t.pnx-btn-superflat.pnx-btn-active,\n\t.pnx-btn-superflat.pnx-btn-active:hover,\n\t.pnx-btn-superflat:not(:disabled):hover {\n\t\tborder: 1px solid var(--widget-border-div);\n\t\tcolor: var(--widget-font-direct);\n\t\tbackground-color: var(--widget-bg);\n\t}\n\n\t.pnx-btn-superflat:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-hover);\n\t}\n\n\t/* Inline style */\n\t.pnx-btn-inline,\n\t.pnx-btn-inline.pnx-btn-active,\n\t.pnx-btn-inline.pnx-btn-active:hover,\n\t.pnx-btn-inline:not(:disabled):hover,\n\t.pnx-btn-superinline,\n\t.pnx-btn-superinline.pnx-btn-active,\n\t.pnx-btn-superinline.pnx-btn-active:hover,\n\t.pnx-btn-superinline:not(:disabled):hover {\n\t\tborder: none;\n\t\tcolor: var(--widget-font);\n\t\tbackground: none;\n\t}\n\n\t.pnx-btn-inline:not(:disabled):hover,\n\t.pnx-btn-superinline:not(:disabled):hover {\n\t\tbackground-color: var(--widget-bg-hover);\n\t}\n\n\t/* Superinline style */\n\t.pnx-btn-superinline,\n\t.pnx-btn-superinline.pnx-btn-active,\n\t.pnx-btn-superinline.pnx-btn-active:hover,\n\t.pnx-btn-superinline:not(:disabled):hover {\n\t\tcolor: var(--widget-font-direct);\n\t}\n`;\n\n// Button group\nexport const btngroup = css`\n\tpnx-button-group > pnx-button {\n\t\tdisplay: inline-flex;\n\t}\n\n\tpnx-button-group > pnx-button::part(btn) {\n\t\theight: unset;\n\t}\n\n\t/* Togglable in group */\n\tpnx-button-group > pnx-togglable-group > pnx-button {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t/* Row */\n\tpnx-button-group[dir=\"row\"] > :not(:first-child):not(:last-child)::part(btn),\n\tpnx-button-group[dir=\"row\"] > :not(:first-child):not(:last-child) > ::part(btn) {\n\t\tborder-radius: 0;\n\t\tborder-left: none;\n\t\tborder-right: none;\n\t}\n\n\tpnx-button-group[dir=\"row\"] > :first-child::part(btn),\n\tpnx-button-group[dir=\"row\"] > :first-child > ::part(btn) {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right: none;\n\t}\n\n\tpnx-button-group[dir=\"row\"] > :last-child::part(btn),\n\tpnx-button-group[dir=\"row\"] > :last-child > ::part(btn) {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left: none;\n\t}\n\n\t/* Column */\n\tpnx-button-group[dir=\"column\"] > :not(:first-child):not(:last-child)::part(btn),\n\tpnx-button-group[dir=\"column\"] > :not(:first-child):not(:last-child) > ::part(btn) {\n\t\tborder-radius: 0;\n\t\tborder-top: none;\n\t\tborder-bottom: none;\n\t}\n\n\tpnx-button-group[dir=\"column\"] > :first-child::part(btn),\n\tpnx-button-group[dir=\"column\"] > :first-child > ::part(btn) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-bottom: none;\n\t}\n\n\tpnx-button-group[dir=\"column\"] > :last-child::part(btn),\n\tpnx-button-group[dir=\"column\"] > :last-child > ::part(btn) {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t\tborder-top: none;\n\t}\n`;\n\n// Titles\nexport const titles = css`\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-family: var(--font-family);\n\t}\n\t\n\th3 {\n\t\tfont-size: 1.1em;\n\t\tline-height: 1.1em;\n\t\tfont-weight: 500;\n\t\tmargin: 10px 0 10px 0;\n\t}\n\n\th4 {\n\t\tfont-size: 1.0em;\n\t\tline-height: 1.0em;\n\t\tfont-weight: 500;\n\t\tmargin: 15px 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-start;\n\t\tgap: 5px;\n\t}\n\n\th4:first-of-type { margin-top: 0; }\n\n\th4 > svg.svg-inline--fa {\n\t\theight: 18px;\n\t}\n\n\th4[slot=\"title\"] {\n\t\tmargin: 0;\n\t\tjustify-content: center;\n\t\tfont-size: 0.8em;\n\t\tline-height: 2em;\n\t\tpadding: 0.5em 0;\n\t}\n\th4[slot=\"title\"] svg.svg-inline--fa {\n\t\theight: 14px;\n\t}\n`;\n\n// Active icon badge\nexport const activeIcon = css`\n\t.pnx-active-icon {\n\t\tbox-sizing: border-box;\n\t\tbackground-color: var(--orange);\n\t\tborder: 3px solid #fff;\n\t\tborder-radius: 8px;\n\t\theight: 15px;\n\t\tleft: 20px;\n\t\tposition: absolute;\n\t\ttop: 5px;\n\t\twidth: 15px;\n\t}\n`;\n\n// Counting badge\nexport const badgeCount = css`\n\t.pnx-badge-count {\n\t\tbox-sizing: border-box;\n\t\tbackground-color: var(--grey-pale);\n\t\tborder-radius: 8px;\n\t\tright: -6px;\n\t\tposition: absolute;\n\t\ttop: -6px;\n\t\twidth: 12px;\n\t\theight: 12px;\n\t\tfont-size: 10px;\n\t\ttext-align: center;\n\t\tline-height: 12px;\n\t\tfont-weight: 800;\n\t}\n`;\n\n// Placeholder background\nexport const placeholder = css`\n\t@keyframes animatedBackground {\n\t\tfrom {\n\t\t\tbackground-position: 0 0;\n\t\t}\n\t\tto {\n\t\t\tbackground-position: 1000px 0;\n\t\t}\n\t}\n\n\t.pnx-placeholder-loading {\n\t\twidth: 100px;\n\t\theight: 100px;\n\t\tbackground-image: linear-gradient(\n\t\t\t90deg,\n\t\t\t#e4e4e4 0%,\n\t\t\t#f1f1f1 40%,\n\t\t\t#ededed 60%,\n\t\t\t#e4e4e4 100%\n\t\t);\n\t\tbackground-position: 0px 0px;\n\t\tbackground-repeat: repeat;\n\t\tanimation: animatedBackground 5s linear infinite;\n\t}\n`;\n\n// Expandable block\nexport const expandable = css`\n\tdetails summary {\n\t\tfont-size: 1.0em;\n\t\tline-height: 1.0em;\n\t\tfont-weight: 500;\n\t\tmargin: 15px 0;\n\t\tcursor: pointer;\n\t}\n\n\tdetails summary svg {\n\t\theight: 18px;\n\t\tvertical-align: sub;\n\t\tmargin-right: 2px;\n\t}\n`;\n\n// Print hidden\nexport const noprint = css`\n\t@media print {\n\t\t.pnx-print-hidden { display: none !important; }\n\t}\n`;\n\n// Data table\nexport const table = css`\n\ttable {\n\t\tborder-collapse: collapse;\n\t\tfont-size: 0.9rem;\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\tfont-family: var(--font-family);\n\t\tbackground: var(--white);\n\t}\n\n\tth, td {\n\t\tpadding: 10px;\n\t\ttext-align: left;\n\t\tborder-bottom: 1px solid #ddd;\n\t}\n\n\tth { font-weight: 600; }\n`;\n\n// Iconify icons\nexport const iconify = css`\n\ticonify-icon {\n\t\tdisplay: inline-block;\n\t\twidth: 1em;\n\t\theight: 1em;\n\t}\n`;\n\n// Tabbed-legend data blocks\nexport const dataBlocks = css`\n\t.data-block {\n\t\tdisplay: inline-block;\n\t\tmargin: 8px 0;\n\t\tbox-sizing: border-box;\n\t\tvertical-align: top;\n\t}\n\t.data-block h5 {\n\t\tfont-size: 0.8em;\n\t\tfont-weight: 400;\n\t\tcolor: var(--blue-dark);\n\t\tmargin: 0 0 5px 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t}\n\t.data-block h5 pnx-button { vertical-align: middle; }\n\t.data-block h5 svg.svg-inline--fa { height: 14px; }\n\t.data-block div {\n\t\tfont-size: 0.8em;\n\t}\n`;\n\n// Documentation popup\nexport const docPopup = css`\n\th4 {\n\t\tfont-size: 1.3em;\n\t\tfont-weight: 600;\n\t\tborder-bottom: 3px solid var(--grey-pale);\n\t\tpadding-bottom: 10px;\n  \t\tpadding-top: 5px;\n\t}\n`;","import { LitElement, html, css, nothing } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../utils/widgets\";\nimport { faTags } from \"@fortawesome/free-solid-svg-icons/faTags\";\nimport { faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons/faTriangleExclamation\";\nimport { hasAnnotations } from \"../../utils/picture\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { panel } from \"../styles\";\nimport { DISABLE_ANNOTATIONS_PARAM } from \"../../utils/utils\";\n\n/**\n * AnnotationsSwitch component allows to switch on/off pictures annotations.\n * @class Panoramax.components.ui.AnnotationsSwitch\n * @element pnx-annotations-switch\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-annotations-switch ._parent=${viewer} />\n * ```\n */\nexport default class AnnotationsSwitch extends LitElement {\n\t/** @private */\n\tstatic styles = [ panel, css`\n\t\t.pnx-panel {\n\t\t\tpadding: 5px;\n\t\t\tmargin-top: 5px;\n\t\t\twidth: max-content;\n  \t\t\tmin-width: unset;\n\t\t}\n\n\t\t/* Custom button look */\n\t\tpnx-button::part(btn) {\n\t\t\tborder-radius: 8px;\n\t\t\theight: 26px;\n\t\t\twidth: 26px;\n\t\t}\n\n\t\tpnx-button[size=\"xl\"]::part(btn) {\n\t\t\tborder-radius: 8px;\n\t\t\theight: 38px;\n\t\t\twidth: 38px;\n\t\t}\n\n\t\tpnx-button[active]::part(btn),\n\t\tpnx-button[active]:hover::part(btn) {\n\t\t\tbackground-color: var(--widget-bg-active) !important;\n\t\t\tborder-color: var(--widget-bg-active) !important;\n\t\t\tcolor: var(--widget-font-active) !important;\n\t\t}\n\n\t\t/* No-annotations badge */\n\t\t.pnx-annotations-switch-empty {\n\t\t\tposition: absolute;\n\t\t\ttop: 1px;\n\t\t\tright: 1px;\n\t\t\tcolor: var(--orange);\n\t\t\theight: 8px;\n\t\t}\n\n\t\tpnx-button[size=\"xl\"] .pnx-annotations-switch-empty {\n\t\t\ttop: 2px;\n\t\t\tright: 2px;\n\t\t\theight: 12px;\n\t\t}\n\n\t\tpnx-button[active] .pnx-annotations-switch-empty {\n\t\t\tcolor: var(--yellow);\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.AnnotationsSwitch#\n\t * @type {Object}\n\t * @property {string} [size=xl] Button size (md, xl)\n\t */\n\tstatic properties = {\n\t\tsize: {type: String},\n\t\t_annotationsToggled: {state: true},\n\t\t_warnNoAnnot: {state: true},\n\t\t_warnNoAnnotTooltip: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._annotationsToggled = false;\n\t\tthis._warnNoAnnot = false;\n\t\tthis._warnNoAnnotTooltip = false;\n\t\tthis.size = \"xl\";\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this).then(() => {\n\t\t\tthis._parent.onceReady().then(() => {\n\t\t\t\tthis._parent.psv.addEventListener(\"annotations-toggled\", e => {\n\t\t\t\t\tthis._annotationsToggled = e.detail.visible;\n\t\t\t\t\tthis._persistAnnotationsLocalStorage(this._annotationsToggled);\n\t\t\t\t});\n\n\t\t\t\tthis._warnNoAnnot = !hasAnnotations(this._parent.psv.getPictureMetadata());\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._warnNoAnnot = !hasAnnotations(this._parent.psv.getPictureMetadata());\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis._parent.onceFirstPicLoaded().then(() => {\n\t\t\t\tthis._annotationsToggled = this._parent.psv.areAnnotationsVisible() || false;\n\t\t\t\tthis._persistAnnotationsLocalStorage(this._annotationsToggled);\n\t\t\t});\n\t\t});\n\t}\n\n\t/** @private */\n\t_persistAnnotationsLocalStorage(isAnnotToggled) {\n\t\tlocalStorage.setItem(DISABLE_ANNOTATIONS_PARAM, isAnnotToggled ? \"false\": \"true\");\n\t}\n\n\t/** @private */\n\t_onClick() {\n\t\tif(!this._annotationsToggled && this._warnNoAnnot) {\n\t\t\tthis._warnNoAnnotTooltip = true;\n\t\t\tsetTimeout(() => this._warnNoAnnotTooltip = false, 2000);\n\t\t}\n\t\tthis._persistAnnotationsLocalStorage(!this._annotationsToggled);\n\t\tthis._parent.psv.toggleAllAnnotations(!this._annotationsToggled);\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tconst panelClasses = {\n\t\t\t\"pnx-panel\": true,\n\t\t\t\"pnx-hidden\": !this._warnNoAnnotTooltip,\n\t\t};\n\n\t\treturn html`\n\t\t\t<pnx-button\n\t\t\t\tkind=\"superflat\"\n\t\t\t\tsize=${this.size}\n\t\t\t\tstyle=\"vertical-align: middle\"\n\t\t\t\tclass=\"pnx-print-hidden\"\n\t\t\t\ttitle=${this._annotationsToggled ? this._parent._t?.pnx.semantics_hide_annotations : this._parent._t?.pnx.semantics_show_annotations}\n\t\t\t\tactive=${this._annotationsToggled ? \"\" : nothing}\n\t\t\t\t@click=${this._onClick}\n\t\t\t>\n\t\t\t\t${fa(faTags, { styles: { \"height\": \"20px\" }})}\n\t\t\t\t${this._warnNoAnnot ? fa(faTriangleExclamation, { classes: \"pnx-annotations-switch-empty\" }) : nothing}\n\t\t\t</pnx-button>\n\t\t\t<div\n\t\t\t\tclass=${classMap(panelClasses)}\n\t\t\t\t@click=${() => this._warnNoAnnotTooltip = false}\n\t\t\t>\n\t\t\t\t${this._parent._t?.pnx.semantics_zero_annotations}\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-annotations-switch\", AnnotationsSwitch);\n","import { LitElement } from \"lit\";\nimport { btn } from \"../styles\";\n\n/**\n * Button element displays a direct action button.\n * Binds to a HTML button, so you can use any events offered by it.\n * @class Panoramax.components.ui.Button\n * @element pnx-button\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-button kind=\"flat\" size=\"l\" @click=${() => alert(\"click!\")}>\n *    Click on me\n * </pnx-button>\n * ```\n */\nexport default class Button extends LitElement {\n\t/** @private */\n\tstatic styles = btn;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.Button#\n\t * @type {Object}\n\t * @property {boolean} [active=false] Whether the button is in an active state.\n\t * @property {string} [kind=full] The style variation of the button (full, fullwarn, fullsuccess, outline, flat, superflat, inline, superinline)\n\t * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)\n\t * @property {boolean} [disabled=false] Whether the button is disabled.\n\t * @property {string} [type] The button type (e.g., 'submit').\n\t * @property {string} [title] Tooltip text displayed when hovering over the button\n\t */\n\tstatic properties = {\n\t\tactive: {type: Boolean},\n\t\tkind: {type: String},\n\t\tsize: {type: String},\n\t\tdisabled: {type: Boolean},\n\t\ttype: {type: String},\n\t\ttitle: { type: String },\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.active = false;\n\t\tthis.disabled = false;\n\t\tthis.kind = \"full\";\n\t\tthis.size = \"md\";\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tif(this.type === \"submit\") {\n\t\t\tthis.addEventListener(\"click\", () => this.closest(\"FORM\")?.requestSubmit());\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst b = document.createElement(\"button\");\n\t\tb.setAttribute(\"part\", \"btn\");\n\n\t\tthis.constructor.observedAttributes\n\t\t\t.filter(k => this[k] !== undefined && this[k] !== false && ![\"active\", \"kind\", \"size\"].includes(k))\n\t\t\t.forEach(k => b.setAttribute(k, this[k]));\n\n\t\tb.classList.add(\"pnx-btn\", `pnx-btn-${this.kind}`, `pnx-btn-${this.size}`);\n\t\tif(this.active) { b.classList.add(\"pnx-btn-active\"); }\n\n\t\tconst slot = document.createElement(\"slot\");\n\t\tb.appendChild(slot);\n\n\t\treturn b;\n\t}\n}\n\ncustomElements.define(\"pnx-button\", Button);\n","import { LitElement, css, html } from \"lit\";\nimport \"./ButtonGroup.css\";\n\n/**\n * Button Group element allows to merge many button in a single bar.\n * @class Panoramax.components.ui.ButtonGroup\n * @element pnx-button-group\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-button-group id=\"pnx-widget-player\" dir=\"row\" size=\"xl\" class=\"pnx-print-hidden\">\n *   <pnx-button>B1</pnx-button>\n *   <pnx-button>B2</pnx-button>\n * </pnx-button-group>\n * ```\n */\nexport default class ButtonGroup extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\tdiv {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t\talign-items: stretch;\n\t\t\talign-content: stretch;\n\t\t\tjustify-content: center;\n\t\t}\n\n\t\tdiv.row { flex-direction: row; }\n\t\tdiv.column { flex-direction: column; }\n\n\t\tdiv.xl { line-height: 38px; font-size: 20px; }\n\t\tdiv.row.xl { height: 38px; }\n\t\tdiv.column.xl { width: 38px; }\n\n\t\tdiv.row ::slotted(*) { height: 100%; min-width: 24px; }\n\t\tdiv.column ::slotted(*) { width: 100%; min-height: 24px; }\n\n\t\tdiv.row.xl ::slotted(*) { min-width: 38px; }\n\t\tdiv.column.xl ::slotted(*) { min-height: 38px; }\n\t`;\n\n\t/**\n     * Component properties.\n\t * @memberof Panoramax.components.ui.ButtonGroup#\n     * @type {Object}\n     * @property {string} [dir] Group direction (row, column)\n     * @property {string} [size] Group size (md, xl)\n     */\n\tstatic properties = {\n\t\tdir: {type: String},\n\t\tsize: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.dir = \"row\";\n\t\tthis.size = \"md\";\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`<div class=\"${this.dir} ${this.size}\">\n\t\t\t<slot></slot>\n\t\t</div>`;\n\t}\n}\n\ncustomElements.define(\"pnx-button-group\", ButtonGroup);\n","import { LitElement, html, css } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { faCheck } from \"@fortawesome/free-solid-svg-icons/faCheck\";\nimport { faCopy } from \"@fortawesome/free-solid-svg-icons/faCopy\";\nimport { btn, faSvg } from \"../styles\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\n/**\n * Copy Button element allows top copy in clipboard some text.\n * @class Panoramax.components.ui.CopyButton\n * @element pnx-copy-button\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `oncopy` The content to display after user click\n * @example\n * ```html\n * <pnx-copy-button text=\"content to copy\" ._t=${viewer._t}>\n *   Copy me !\n *   <img src=\"success.jpg\" slot=\"oncopy\" />\n * </pnx-copy-button>\n * ```\n */\nexport default class CopyButton extends LitElement {\n\t/** @private */\n\tstatic styles = [faSvg, btn, css`\n\t\t.pnx-btn-unstyled {\n\t\t\tborder: none;\n\t\t\tbackground: none;\n\t\t\tfont-family: var(--font-family);\n\t\t\tfont-size: 1em;\n\t\t\tcolor: var(--widget-font);\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t}\n\t`];\n\n\t/**\n     * Component properties.\n\t * @memberof Panoramax.components.ui.CopyButton#\n     * @type {Object}\n     * @property {string} [text] Text to copy in clipboard on click (use either this parameter or input, not both)\n\t * @property {input} [input] ID of a HTML input field to copy content from in clipboard (use either this parameter or text, not both)\n\t * @property {string} [kind=full] The style variation of the button (full, fullwarn, fullsuccess, outline, flat, superflat, inline, superinline)\n\t * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)\n\t * @property {boolean} [unstyled=false] Disable all styling (for list group integration)\n\t * @property {string} [title] Tooltip text displayed when hovering over the button\n     */\n\tstatic properties = {\n\t\ttext: {type: String},\n\t\tinput: {type: String},\n\t\tkind: {type: String},\n\t\tsize: {type: String},\n\t\tunstyled: {type: Boolean},\n\t\ttitle: { type: String },\n\t\t_active: {state: true, type: Boolean},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.data = \"\";\n\t\tthis.input = \"\";\n\t\tthis.unstyled = false;\n\t\tthis.kind = \"full\";\n\t\tthis.size = \"md\";\n\t\tthis._active = false;\n\t\tthis.addEventListener(\"click\", this._onClick);\n\t}\n\n\t/** @private */\n\t_onClick(e) {\n\t\te.stopPropagation();\n\n\t\tlet textToCopy;\n\t\tif(this.input !== \"\") {\n\t\t\tconst inputField = document.getElementById(this.input);\n\t\t\ttextToCopy = inputField.innerText || inputField.value;\n\t\t}\n\t\telse if(this.text !== \"\") {\n\t\t\ttextToCopy = this.text;\n\t\t}\n\n\t\tif(!navigator?.clipboard) {\n\t\t\talert(\"Clipboard is not available\");\n\t\t}\n\t\telse {\n\t\t\tnavigator.clipboard.writeText(textToCopy);\n\t\t\tthis._active = true;\n\t\t\tsetTimeout(() => this._active = false, 2000);\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tconst classes = {\n\t\t\t\"pnx-btn\": !this.unstyled,\n\t\t\t\"pnx-btn-full\": !this.unstyled,\n\t\t\t\"pnx-btn-active\": !this.unstyled && this._active,\n\t\t\t\"pnx-btn-unstyled\": this.unstyled,\n\t\t\t[`pnx-btn-${this.kind}`]: !this.unstyled,\n\t\t\t[`pnx-btn-${this.size}`]: !this.unstyled,\n\t\t};\n\t\treturn html`<button title=${this.title} class=${classMap(classes)} part=\"btn\">\n\t\t\t${this._active ?\n\t\t\t\thtml`<slot name=\"oncopy\">${this._t?.pnx.copied || \"\"} ${fa(faCheck)}</slot>` :\n\t\t\t\thtml`<slot>${fa(faCopy)} ${this._t?.pnx.copy || \"\"}</slot>`\n\t\t\t}\n\t\t</button>`;\n\t}\n}\n\ncustomElements.define(\"pnx-copy-button\", CopyButton);\n","import { LitElement, html, css } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { faStar } from \"@fortawesome/free-solid-svg-icons/faStar\";\nimport { faStar as farStar } from \"@fortawesome/free-regular-svg-icons/faStar\";\nimport { faSvg } from \"../styles\";\n\n/**\n * Grade element displays a 5-star rating.\n * @class Panoramax.components.ui.Grade\n * @element pnx-grade\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-grade stars=\"5\" .t=${viewer._t} />\n * ```\n */\nexport default class Grade extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, css`\n\t\tspan { color: var(--orange); }\n\t`];\n\n\t/**\n     * Component properties.\n\t * @memberof Panoramax.components.ui.Grade#\n     * @type {Object}\n     * @property {number} [stars=0] 1 to 5 grade (or 0 for unknown value)\n     */\n\tstatic properties = {\n\t\tstars: {type: Number},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.stars = 0;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst nbStars = this.stars || 0;\n\t\tconst fastars = [];\n\t\tfor(let i=1; i <= nbStars; i++) {\n\t\t\tfastars.push(fa(faStar));\n\t\t}\n\t\tfor(let i=nbStars+1; i <= 5; i++) {\n\t\t\tfastars.push(fa(farStar));\n\t\t}\n\t\treturn html`<span>\n\t\t\t${fastars}\n\t\t</span> (${this.stars ? this.stars+\"/5\" : this._t?.pnx.metadata_quality_missing || \"?\"})`;\n\t}\n}\n\ncustomElements.define(\"pnx-grade\", Grade);\n","import { LitElement, html, css } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { faStar } from \"@fortawesome/free-solid-svg-icons/faStar\";\n\n/**\n * Grade Filter allows to filter picture by their grade (for example, precision grade)\n * @class Panoramax.components.ui.GradeFilter\n * @element pnx-grade-filter\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.GradeFilter#change\n * @example\n * ```html\n * <pnx-grade-filter grade=\"5\" input=\"pnx-g-input\" @change=${() => alert('changed')} ._t=${viewer._t} />\n * ```\n */\nexport default class GradeFilter extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tgap: 0;\n\t\t\talign-items: stretch;\n\t\t\tdisplay: flex;\n\t\t}\n\t\tlabel {\n\t\t\tdisplay: inline-flex;\n\t\t\tpadding: 2px 7px;\n\t\t\tbackground: none;\n\t\t\tborder: 1px solid var(--widget-border-btn);\n\t\t\tcolor: var(--widget-font-direct);\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 16px;\n\t\t\ttext-decoration: none;\n\t\t\tborder-left-width: 0px;\n\t\t}\n\t\tlabel:hover {\n\t\t\tbackground-color: var(--widget-bg-hover);\n\t\t}\n\t\tlabel:first-of-type {\n\t\t\tborder-top-left-radius: 8px;\n\t\t\tborder-bottom-left-radius: 8px;\n\t\t\tborder-left-width: 1px;\n\t\t}\n\t\tlabel:last-of-type {\n\t\t\tborder-top-right-radius: 8px;\n\t\t\tborder-bottom-right-radius: 8px;\n\t\t}\n\t\tlabel svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 0.8em;\n\t\t}\n\t\tinput[type=\"checkbox\"] { display: none; }\n\t\tinput[type=\"checkbox\"]:checked + label {\n\t\t\tbackground-color: var(--widget-bg-active);\n\t\t\tcolor: var(--widget-font-active);\n\t\t}\n\t\tinput[type=\"checkbox\"]:checked + label:first-of-type {\n\t\t\tborder-right-color: white;\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.GradeFilter#\n\t * @type {Object}\n\t * @property {string} input ID prefix for input fields\n\t * @property {number|string} [grade=0] The grade (5 to 1 = precise grade, 0 = none selected), or a list of grades\n\t * @property {Object} labels Helper labels for each grade, as {\"1\": \"L1\", \"2\": \"L2\", ...}\n\t */\n\tstatic properties = {\n\t\tgrade: {type: String},\n\t\tinput: {type: String},\n\t\tlabels: {type: Object},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.grade = 0;\n\t\tthis.input = \"\";\n\t\tthis.labels = {};\n\t}\n\n\t/** @private */\n\t_onInput() {\n\t\t// List all checked boxes\n\t\tconst newgrade = [];\n\t\tfor(let i of this.renderRoot.querySelectorAll(\"input\")) {\n\t\t\tif(i.checked) { newgrade.push(i.value); }\n\t\t}\n\t\tthis.grade = newgrade.join(\",\");\n\n\t\t/**\n\t\t * Event for grade change\n\t\t * @event Panoramax.components.ui.GradeFilter#change\n\t\t * @type {CustomEvent}\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"change\", {bubbles: true, composed: true}));\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst grades = `${this.grade}`.split(\",\").map(v => parseInt(v)).filter(v => !isNaN(v));\n\n\t\treturn [5,4,3,2,1].map(v => html`\n\t\t\t<input\n\t\t\t\tid=\"${this.input}-${v}\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tname=${this.input}\n\t\t\t\tvalue=${v}\n\t\t\t\t@change=\"${this._onInput}\"\n\t\t\t\t.checked=${grades.includes(v)}\n\t\t\t/>\n\t\t\t<label\n\t\t\t\tfor=\"${this.input}-${v}\"\n\t\t\t\ttitle=${this.labels?.[v] ? this.labels[v] : null}\n\t\t\t>\n\t\t\t\t${v} ${fa(faStar)}\n\t\t\t</label>\n\t\t`);\n\t}\n}\n\ncustomElements.define(\"pnx-grade-filter\", GradeFilter);\n","import { LitElement } from \"lit\";\nimport { btn } from \"../styles\";\n\n/**\n * Link Button element displays a HTML `<a>` anchor with a button style.\n * @class Panoramax.components.ui.LinkButton\n * @element pnx-link-button\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-link-button\n *   title=\"Redirect to other website\"\n *   kind=\"outline\"\n *   href=\"https://panoramax.fr\"\n *   target=\"_blank\"\n * >\n *   Click to go on Panoramax\n * </pnx-link-button>\n * ```\n */\nexport default class LinkButton extends LitElement {\n\t/** @private */\n\tstatic styles = btn;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.LinkButton#\n\t * @type {Object}\n\t * @property {string} [href] The URL the button should navigate to when clicked\n\t * @property {string} [target] Specifies where to open the linked document (e.g., '_blank')\n\t * @property {string} [title] Tooltip text displayed when hovering over the button\n\t * @property {string} [download] Indicates if the linked resource should be downloaded\n\t * @property {string} [class] Custom CSS class for additional styling\n\t * @property {string} [kind=full] The style variation of the button (full, fullwarn, fullsuccess, outline, flat, superflat)\n\t * @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)\n\t */\n\tstatic properties = {\n\t\thref: { type: String },\n\t\ttarget: { type: String },\n\t\ttitle: { type: String },\n\t\tdownload: { type: String },\n\t\tclass: { type: String },\n\t\tkind: {type: String},\n\t\tsize: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.kind = \"full\";\n\t\tthis.size = \"md\";\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst a = document.createElement(\"a\");\n\t\ta.setAttribute(\"part\", \"btn\");\n\t\tthis.constructor.observedAttributes\n\t\t\t.filter(k => this[k] !== undefined)\n\t\t\t.forEach(k => a.setAttribute(k, this[k]));\n\t\ta.classList.add(\"pnx-btn\", `pnx-btn-${this.kind}`, `pnx-btn-${this.size}`);\n\t\tconst slot = document.createElement(\"slot\");\n\t\ta.appendChild(slot);\n\t\treturn a;\n\t}\n}\n\ncustomElements.define(\"pnx-link-button\", LinkButton);\n","import { LitElement, html, css } from \"lit\";\nimport { panel } from \"../styles\";\n\n/**\n * List Group element displays a menu having a list of rapid actions (links, buttons).\n * \n * Note that you may only want to use basic HTML elements (`a`, `button`) instead of Panoramax ones.\n * The list group overrides style, so using `pnx-*` component may conflict on styling.\n * @class Panoramax.components.ui.ListGroup\n * @element pnx-list-group\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `default` Any element you want to add in list.\n * @example\n * ```html\n * <pnx-list-group>\n *   <a href=\"https://web.site/\">First link</a>\n *   <button>Second button</button>\n * </pnx-list-group>\n * ```\n */\nexport default class ListGroup extends LitElement {\n\t/** @private */\n\tstatic styles = [ panel, css`\n\t\t:host ::slotted(*) {\n\t\t\ttext-decoration: none;\n\t\t\tborder: none;\n\t\t\tborder-bottom: 1px solid var(--widget-border-div);\n\t\t\tbackground: none;\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tcolor: var(--widget-font);\n\t\t\tfont-family: var(--font-family);\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 1em;\n\t\t\tfont-weight: 400;\n\t\t\tline-height: 18px;\n\t\t\tpadding: 5px 10px;\n  \t\t\tmin-width: 150px;\n\t\t\twidth: 100%;\n\t\t\ttext-align: left;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\t:host ::slotted(*:hover) {\n\t\t\tbackground-color: var(--widget-bg-hover);\n\t\t}\n\n\t\t:host ::slotted(*:first-child) {\n\t\t\tborder-top-left-radius: 5px;\n\t\t\tborder-top-right-radius: 5px;\n\t\t}\n\n\t\t:host ::slotted(*:last-child) {\n\t\t\tborder: none;\n\t\t\tborder-bottom-left-radius: 5px;\n\t\t\tborder-bottom-right-radius: 5px;\n\t\t}\n\t` ];\n\n\t/** @private */\n\trender() {\n\t\treturn html`<slot></slot>`;\n\t}\n}\n\ncustomElements.define(\"pnx-list-group\", ListGroup);\n","import { LitElement, html, css } from \"lit\";\n\n/**\n * ListItem is a list entry, in a Material Design fashion.\n * @class Panoramax.components.ui.ListItem\n * @element pnx-list-item\n * @slot `icon` The left icon (symbol for this item)\n * @slot `action` The right icon (symbol for an interactive action)\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-list-item title=\"My feature\" subtitle=\"It is very cool\">\n *   <img src=\"...\" slot=\"icon\" />\n *   <img src=\"...\" slot=\"action\" />\n * </pnx-list-item>\n * ```\n */\nexport default class ListItem extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t.list-item {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 8px 16px;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #ddd;\n\t\t\tfont-family: var(--font-family);\n\t\t\tbackground: var(--white);\n\t\t\tmin-height: 40px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.list-item:hover { background: var(--widget-bg-hover); }\n\t\t.icon {\n\t\t\tmargin-right: 16px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t\tposition: relative;\n\t\t}\n\t\t.action {\n\t\t\tmargin-left: 16px;\n\t\t\tdisplay: flex;\n  \t\t\tgap: 5px;\n\t\t}\n\t\t.content {\n\t\t\tflex: 1;\n\t\t}\n\t\t.title {\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.subtitle {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--grey-dark);\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.ListItem#\n\t * @type {Object}\n\t * @property {string} title The item title\n\t * @property {string} [subtitle] The item subtitle\n\t * @property {string} [tooltip] A display-on-hover label\n\t */\n\tstatic properties = {\n\t\ttitle: { type: String },\n\t\tsubtitle: { type: String },\n\t\ttooltip: { type: String },\n\t};\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"list-item\" title=${this.tooltip}>\n\t\t\t\t<div class=\"icon\">\n\t\t\t\t\t<slot name=\"icon\"></slot>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"content\">\n\t\t\t\t\t<div class=\"title\">${this.title}</div>\n\t\t\t\t\t<div class=\"subtitle\">${this.subtitle}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"action\">\n\t\t\t\t\t<slot name=\"action\"></slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-list-item\", ListItem);\n","import { LitElement, html, css, unsafeCSS, nothing } from \"lit\";\nimport LogoDead from \"../../img/logo_dead.svg\";\nimport LoaderBg from \"../../img/loader_base.jpg\";\nimport { inRangeRandom } from \"../../utils/utils\";\n\n/**\n * Loader component display a full page covering for user waiting.\n * @class Panoramax.components.ui.Loader\n * @element pnx-loader\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-loader ._parent=${this.viewer} />\n * ```\n */\nexport default class Loader extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tposition: absolute;\n\t\t\tinset: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tjustify-content: center;\n\t\t\tgap: 10px;\n\t\t\talign-items: center;\n\t\t\tbackground-image: url('${unsafeCSS(LoaderBg)}');\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-size: cover;\n\t\t\tbackground-position: center; \n\t\t\tz-index: 200;\n\t\t\tfont-family: var(--font-family);\n\t\t\tfont-weight: 550;\n\t\t\tcolor: var(--black);\n\t\t\tfont-size: 1.4em;\n\t\t\ttext-align: center;\n\t\t\tvisibility: hidden;\n\t\t\topacity: 0;\n\t\t}\n\t\t:host(*[visible]) {\n\t\t\tvisibility: visible;\n\t\t\topacity: 1;\n\t\t}\n\n\t\tdiv.label {\n\t\t\tbackground-color: rgba(255,255,255,0.5);\n\t\t\tbox-shadow: white 0 0 10px;\n\t\t\tpadding: 3px 10px;\n\t\t\tborder-radius: 50px;\n\t\t}\n\t\t/* Logo */\n\t\timg.logo-dead { width: 100px; }\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.Loader#\n\t * @type {Object}\n\t * @property {boolean} [visible=true] Is the loader visible to user ?\n\t * @property {boolean} [no-label=false] Set to true to avoid loading label display\n\t * @property {number} [value] Progress bar percentage (0-100)\n\t */\n\tstatic properties = {\n\t\t_mode: {state: true},\n\t\t_label: {state: true},\n\t\t_isLabelFun: {state: true},\n\t\tvisible: {type: Boolean, reflect: true},\n\t\t\"no-label\": {type: Boolean},\n\t\tvalue: {type: Number},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.visible = true;\n\t\tthis[\"no-label\"] = false;\n\t\tthis._mode = \"loading\";\n\t\tthis._isLabelFun = false;\n\t\tthis.value = -1;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._nextLabel();\n\t}\n\n\t/**\n\t * Is the loader currently visible ?\n\t * @returns {boolean} True if visible\n\t * @memberof Panoramax.components.ui.Loader#\n\t */\n\tisVisible() {\n\t\treturn this.visible;\n\t}\n\n\t/**\n\t * Dismiss loader, or show error\n\t * @param {object} [err] Optional error object to show in browser console\n\t * @param {str} [errMeaningful] Optional error message to show to user\n\t * @param {fct} [next] Optional function to run after loader dismiss\n\t * @memberof Panoramax.components.ui.Loader#\n\t */\n\tdismiss(err = null, errMeaningful = null, next = null) {\n\t\tclearTimeout(this._loaderLabelChanger);\n\n\t\tif(!err) {\n\t\t\tthis.value = 100;\n\t\t\tthis._mode = \"done\";\n\t\t\tthis.visible = false;\n\t\t\tthis.style.transition = \"all 0.5s\";\n\t\t\tsetTimeout(() => this.parentNode.removeChild(this), 2000);\n\n\t\t\t/**\n\t\t\t * Event when component is ready to use.\n\t\t\t * This happens when loader screen disappear, with picture and map loaded.\n\t\t\t * \n\t\t\t * To follow more precisely loading steps, you can also watch for sub-components `ready` events.\n\t\t\t * ```js\n\t\t\t * // Watch API-readiness\n\t\t\t * viewer.addEventListener(\"api:ready\", ...); // From parent\n\t\t\t * viewer.api.addEventListener(\"ready\", ...); // Or on sub-component\n\t\t\t * ```\n\t\t\t * @event Panoramax.components.core.Basic#ready\n\t\t\t * @type {CustomEvent}\n\t\t\t */\n\t\t\tconst readyEvt = new CustomEvent(\"ready\");\n\t\t\tthis._parent.dispatchEvent(readyEvt);\n\n\t\t\tif(next) { next(); }\n\t\t}\n\t\telse {\n\t\t\tif(err !== true) { console.error(err); }\n\n\t\t\tlet errHtml = [ this._parent?._t.pnx.error, html`<br />` ];\n\n\t\t\tif(errMeaningful) { errHtml.push(errMeaningful, html`<br />`); }\n\n\t\t\tif(next) {\n\t\t\t\terrHtml.push(html`<pnx-button kind=\"full\">${this._parent?._t.pnx.error_click}</pnx-button>`);\n\t\t\t\tthis.addEventListener(\"click\", next);\n\t\t\t}\n\t\t\telse { errHtml.push(html`<small>${this._parent?._t.pnx.error_retry}</small>`); }\n\n\t\t\tthis._mode = \"error\";\n\t\t\tthis._label = errHtml;\n\n\t\t\tconst errLabel = errMeaningful || \"Panoramax JS had a blocking exception\";\n\n\t\t\t/**\n\t\t\t * Event for viewer failing to initially load.\n\t\t\t * \n\t\t\t * To follow more precisely loading failures, you can also watch for sub-components `broken` events.\n\t\t\t * ```js\n\t\t\t * // Watch API breaks\n\t\t\t * viewer.addEventListener(\"api:broken\", ...); // From parent\n\t\t\t * viewer.api.addEventListener(\"broken\", ...); // Or on sub-component\n\t\t\t * ```\n\t\t\t * @event Panoramax.components.core.Basic#broken\n\t\t\t * @type {CustomEvent}\n\t\t\t * @property {string} detail.error The user-friendly error message to display\n\t\t\t */\n\t\t\tconst brokenEvt = new CustomEvent(\"broken\", {\n\t\t\t\tdetail: { error: errLabel }\n\t\t\t});\n\t\t\tthis._parent.dispatchEvent(brokenEvt);\n\n\t\t\t// Throw error\n\t\t\tthrow new Error(errLabel);\n\t\t}\n\t}\n\n\t/** @private */\n\t_nextLabel() {\n\t\tif(!this._isLabelFun) {\n\t\t\tthis._label = this._parent?._t.pnx.loading_labels_serious[inRangeRandom(0, this._parent?._t.pnx.loading_labels_serious.length-1)];\n\t\t\tthis._isLabelFun = true;\n\t\t}\n\t\telse {\n\t\t\tthis._label = this._parent?._t.pnx.loading_labels_fun[inRangeRandom(0, this._parent?._t.pnx.loading_labels_fun.length-1)];\n\t\t}\n\t\tthis._loaderLabelChanger = setTimeout(this._nextLabel.bind(this), inRangeRandom(500, 1500));\n\t}\n\n\t/** @private */\n\trender() {\n\t\tif(this._mode == \"error\") {\n\t\t\treturn html`\n\t\t\t\t<img class=\"logo-dead\" src=${LogoDead} alt=\"\" title=${this._parent?._t.map.loading} />\n\t\t\t\t${this._label}\n\t\t\t`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<pnx-progress-bar .value=${this.value}></pnx-progress-bar>\n\t\t\t${this[\"no-label\"] ? nothing : html`<div class=\"label\">${this._label}</div>`}\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-loader\", Loader);\n","import \"./Map.css\";\nimport {\n\tVECTOR_STYLES, TILES_PICTURES_ZOOM, getThumbGif, RASTER_LAYER_ID, combineStyles,\n\tgetMissingLayerStyles, isLabelLayer, getUserLayerId, getUserSourceId, isNullCoordinates,\n} from \"../../utils/map\";\nimport { COLORS } from \"../../utils/utils\";\nimport MarkerBaseSVG from \"../../img/marker.svg\";\nimport MarkerSelectedSVG from \"../../img/marker_blue.svg\";\nimport SemanticsMapProtocol from \"../../utils/SemanticsMapProtocol\";\nimport PanoraMapProtocol from \"../../utils/PanoraMapProtocol\";\nimport { initIndoorEqualOnMap } from \"../../utils/indoor\";\n\n// MapLibre imports\nimport \"maplibre-gl/dist/maplibre-gl.css\";\nimport maplibregl from \"!maplibre-gl\"; // DO NOT REMOVE THE \"!\": bundled builds breaks otherwise !!!\nimport maplibreglWorker from \"maplibre-gl/dist/maplibre-gl-csp-worker\";\nimport * as pmtiles from \"pmtiles\";\nmaplibregl.workerClass = maplibreglWorker;\nmaplibregl.addProtocol(\"pmtiles\", new pmtiles.Protocol().tile);\nmaplibregl.addProtocol(\"panora\", new PanoraMapProtocol().tile());\nmaplibregl.addProtocol(\"panoras\", new PanoraMapProtocol().tile());\n\n\n/**\n * Map is the component showing pictures and sequences geolocation.\n * \n * Note that all functions of [MapLibre GL JS class Map](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) are also available.\n * \n * A more complete version of Map (with filters & themes) is available through [MapMore class](#Panoramax.components.ui.MapMore)\n * \n * ⚠️ This class doesn't inherit from [EventTarget](https://developer.mozilla.org/fr/docs/Web/API/EventTarget), so it doesn't have `addEventListener` and `dispatchEvent` functions.\n * It uses instead [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#on) and `fire` functions from MapLibre Map class.\n * `fire` function doesn't take directly [`Event`](https://developer.mozilla.org/fr/docs/Web/API/Event) objects, but a string and object data.\n * A shorthand `addEventListener` function is added for simpler usage.\n * @class Panoramax.components.ui.Map\n * @extends [maplibregl.Map](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/)\n * @param {Panoramax.components.core.Basic} parent The parent view\n * @param {Element} container The DOM element to create into\n * @param {object} [options] The map options (any of [MapLibre GL settings](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/) or any supplementary option defined here)\n * @param {object} [options.raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).\n * @param {string} [options.background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.\n * @param {string} [options.attributionControl.customAttribution] To override default map attribution.\n * @param {boolean} [options.picMarkerDraggable] To make the picture marker draggable, default to false.\n * @param {object} [options.indoor] The indoor= MapLibre plugin options. This must be a JSON object following [IndoorEqual parameters](https://indoorequal.com/doc/maplibre-gl-indoorequal/api#parameters). Note that this is only available if [maplibre-gl-indoorequal](https://indoorequal.com/doc/maplibre-gl-indoorequal) plugin is loaded in your web page.\n * @param {string} [options.indoor.level] (only if indoor= plugin is enabled) The initial indoor level to display. Defaults to ground or disabled depending on indoor map availability.\n * @fires Panoramax.components.ui.Map#background-changed\n * @fires Panoramax.components.ui.Map#users-changed\n * @fires Panoramax.components.ui.Map#sequence-hover\n * @fires Panoramax.components.ui.Map#sequence-click\n * @fires Panoramax.components.ui.Map#picture-click\n * @fires Panoramax.components.ui.Map#ready\n * @example\n * const map = new Panoramax.components.ui.Map(viewer, mapNode, {center: {lat: 48.7, lng: -1.7}});\n */\nexport default class Map extends maplibregl.Map {\n\tconstructor(parent, container, options = {}) {\n\t\tsuper({\n\t\t\tcontainer: container,\n\t\t\tstyle: combineStyles(parent, options),\n\t\t\tcenter: [0,0],\n\t\t\tzoom: 0,\n\t\t\tmaxZoom: 24,\n\t\t\tattributionControl: false,\n\t\t\tdragRotate: false,\n\t\t\tpitchWithRotate: false,\n\t\t\ttouchZoomRotate: true,\n\t\t\ttouchPitch: false,\n\t\t\tdoubleClickZoom: false,\n\t\t\tcanvasContextAttributes: {\n\t\t\t\tpreserveDrawingBuffer: !parent.isWidthSmall(),\n\t\t\t},\n\t\t\ttransformRequest: parent.api._getMapRequestTransform(),\n\t\t\tlocale: parent._t.maplibre,\n\t\t\thash: false,\n\t\t\t...options\n\t\t});\n\n\t\tmaplibregl.addProtocol(\"sem\", new SemanticsMapProtocol(parent.api).tile());\n\t\tthis._loadMarkerImages();\n\n\t\tthis._parent = parent;\n\t\tthis._options = options;\n\t\tthis.getContainer().classList.add(\"pnx-map\");\n\n\t\t// Disable touch rotate\n\t\tif(options.touchZoomRotate === undefined) {\n\t\t\tthis?.touchZoomRotate?.disableRotation();\n\t\t}\n\n\t\t// Handle raster source\n\t\tif(this._options.raster) {\n\t\t\tthis._options.background = this._options.background || \"streets\";\n\t\t}\n\n\t\tinitIndoorEqualOnMap(this);\n\n\t\tthis._attribution = new maplibregl.AttributionControl({ compact: false, ...options.attributionControl });\n\t\tthis.addControl(this._attribution);\n\n\t\tthis._initMapPosition();\n\n\t\t// Widgets and markers\n\t\tthis._picMarker = this._getPictureMarker();\n\t\tthis._picMarkerPreview = this._getPictureMarker(false);\n\n\t\t// Cache for pictures and sequences thumbnails\n\t\tthis._picThumbUrl = {};\n\t\tthis._seqPictures = {};\n\n\t\t// Sequences and pictures per users\n\t\tthis._userLayers = new Set();\n\n\t\t// Parent selection\n\t\tthis._parent.addEventListener(\"select\", this.reloadLayersStyles.bind(this));\n\n\t\t// Timeout for initial loading\n\t\tsetTimeout(() => {\n\t\t\tif(!this.loaded() && this._parent?.loader.isVisible()) {\n\t\t\t\tthis._parent.loader.dismiss({}, this._parent._t.map.slow_loading, async () => {\n\t\t\t\t\tawait this._postLoad();\n\t\t\t\t\tthis._parent.loader.dismiss();\n\t\t\t\t});\n\t\t\t}\n\t\t}, 15000);\n\n\t\tthis.waitForEnoughMapLoaded().then(async () => await this._postLoad());\n\t}\n\n\t/**\n\t * @private\n\t */\n\tasync _postLoad() {\n\t\tthis.resize();\n\t\tawait this.setVisibleUsers(this._parent.users);\n\t\tthis.reloadLayersStyles();\n\n\t\t/**\n\t\t * Event when map is ready to display.\n\t\t * This includes Maplibre initial load, enough map data display and styling.\n\t\t * @event Panoramax.components.ui.Map#ready\n\t\t * @type {maplibregl.util.evented.Event}\n\t\t */\n\t\tthis.fire(\"ready\");\n\t}\n\n\t/**\n\t * Destroy any form of life in this component\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\tdestroy() {\n\t\tthis.remove();\n\t\tdelete this._parent;\n\t\tdelete this._options;\n\t\tdelete this._attribution;\n\t\tdelete this._picMarker;\n\t\tdelete this._picMarkerPreview;\n\t\tdelete this._picThumbUrl;\n\t\tdelete this._seqPictures;\n\t\tdelete this._userLayers;\n\t}\n\n\t/**\n\t * Helper to know when enough map background and Panoramax tiles are loaded for a proper display.\n\t * @returns {Promise} Resolves when enough is loaded\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\twaitForEnoughMapLoaded() {\n\t\treturn new Promise((resolve) => {\n\t\t\tlet nbBgTiles = 0;\n\t\t\tlet nbFgTiles = 0;\n\t\t\tlet nbLoadedBgTiles = 0;\n\t\t\tlet nbLoadedFgTiles = 0;\n\n\t\t\tconst onSourceDataLoading = e => {\n\t\t\t\tif(e.dataType === \"source\" && e.tile) {\n\t\t\t\t\tif(e.sourceId.startsWith(\"geovisio\")) {\n\t\t\t\t\t\tnbFgTiles++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnbBgTiles++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst onSourceData = e => {\n\t\t\t\tif(e.dataType === \"source\" && e.tile) {\n\t\t\t\t\tif(e.sourceId.startsWith(\"geovisio\")) {\n\t\t\t\t\t\tnbLoadedFgTiles++;\n\t\t\t\t\t\tif(e.isSourceLoaded) { nbLoadedFgTiles = nbFgTiles; }\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnbLoadedBgTiles++;\n\t\t\t\t\t\tif(e.isSourceLoaded) { nbLoadedBgTiles = nbBgTiles; }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcheckEnoughLoaded();\n\t\t\t};\n\n\t\t\tconst checkEnoughLoaded = () => {\n\t\t\t\tif(nbLoadedBgTiles / nbBgTiles >= 0.75 && (nbFgTiles === 0 || nbLoadedFgTiles / nbFgTiles >= 0.75)) {\n\t\t\t\t\tthis.off(\"sourcedata\", onSourceData);\n\t\t\t\t\tthis.off(\"sourcedataloading\", onSourceDataLoading);\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.on(\"sourcedataloading\", onSourceDataLoading);\n\t\t\tthis.on(\"sourcedata\", onSourceData);\n\t\t});\n\t}\n\n\t/**\n\t * Sets map view based on returned API bbox (if no precise option given by user).\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_initMapPosition() {\n\t\tif(\n\t\t\tisNullCoordinates(this._options.center)\n\t\t\t&& (!this._options.zoom || this._options.zoom === 0)\n\t\t\t&& (!this._options.hash)\n\t\t) {\n\t\t\tthis._parent.onceAPIReady().then(() => {\n\t\t\t\tlet bbox = this._parent?.api?.getDataBbox();\n\t\t\t\tif(bbox) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbbox = new maplibregl.LngLatBounds(bbox);\n\t\t\t\t\t\tif(this.loaded()) { this.fitBounds(bbox, { \"animate\": false }); }\n\t\t\t\t\t\telse { this.waitForEnoughMapLoaded().then(() => this.fitBounds(bbox, { \"animate\": false })); }\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {\n\t\t\t\t\t\tconsole.warn(\"Received invalid bbox: \"+bbox);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Load markers into map for use in map layers.\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_loadMarkerImages() {\n\t\t[\n\t\t\t{ id: \"pnx-marker\", img: MarkerBaseSVG },\n\t\t].forEach(m => {\n\t\t\tconst img = new Image(64, 64);\n\t\t\timg.onload = () => this.addImage(m.id, img);\n\t\t\timg.src = m.img;\n\t\t});\n\t}\n\n\t/**\n\t * Is Quality Score available in vector tiles ?\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_hasQualityScore() {\n\t\tconst fields = this.getStyle()?.metadata?.[\"panoramax:fields\"] || {};\n\t\treturn fields?.pictures?.includes(\"gps_accuracy\") && fields?.pictures?.includes(\"h_pixel_density\");\n\t}\n\n\t/**\n\t * Are 360/flat pictures stats available in vector tiles for grid layer ?\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_hasGridStats() {\n\t\tconst fields = this.getStyle()?.metadata?.[\"panoramax:fields\"] || {};\n\t\treturn fields?.grid?.includes(\"nb_360_pictures\") && fields?.grid?.includes(\"nb_flat_pictures\")\n\t\t\t&& fields?.grid?.includes(\"coef_360_pictures\") && fields?.grid?.includes(\"coef_flat_pictures\");\n\t}\n\n\t/**\n\t * Are specific 360/flat pictures stats available for logged-in users in vector tiles for grid layer ?\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_hasLoggedGridStats() {\n\t\tconst fields = this.getStyle()?.metadata?.[\"panoramax:fields\"] || {};\n\t\treturn fields?.grid?.includes(\"logged_coef_360_pictures\")\n\t\t\t&& fields?.grid?.includes(\"logged_coef_flat_pictures\")\n\t\t\t&& fields?.grid?.includes(\"logged_coef\");\n\t}\n\n\t/**\n\t * Force refresh of vector tiles data\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\treloadVectorTiles() {\n\t\t[...this._userLayers].forEach(dl => {\n\t\t\tconst s = this.getSource(getUserSourceId(dl));\n\t\t\ts.setTiles(s.tiles);\n\t\t});\n\t}\n\n\t/**\n\t * Check if map offers aerial imagery as well as streets rendering.\n\t * @returns {boolean} True if aerial imagery is available for display\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\thasTwoBackgrounds() {\n\t\treturn this.getLayer(RASTER_LAYER_ID) !== undefined;\n\t}\n\n\t/**\n\t * Get the currently selected map background\n\t * @returns {string} aerial or streets\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\tgetBackground() {\n\t\tif(!this.getLayer(RASTER_LAYER_ID)) {\n\t\t\treturn \"streets\";\n\t\t}\n\n\t\tconst aerialVisible = this.getLayoutProperty(RASTER_LAYER_ID, \"visibility\") == \"visible\";\n\t\treturn aerialVisible ? \"aerial\" : \"streets\";\n\t}\n\n\t/**\n\t * Change the shown background in map.\n\t * @param {string} bg The new background to display (aerial or streets)\n\t * @memberof Panoramax.components.ui.Map#\n\t * @throws {Error} If not aerial imagery is available\n\t */\n\tsetBackground(bg) {\n\t\tif(!this.getLayer(RASTER_LAYER_ID) && bg === \"aerial\") { throw new Error(\"No aerial imagery available\"); }\n\t\tif(this.getLayer(RASTER_LAYER_ID)) {\n\t\t\tthis.setLayoutProperty(RASTER_LAYER_ID, \"visibility\", bg === \"aerial\" ? \"visible\" : \"none\");\n\n\t\t\t/**\n\t\t\t * Event for map background changes\n\t\t\t *\n\t\t\t * @event Panoramax.components.ui.Map#background-changed\n\t\t\t * @type {maplibregl.util.evented.Event}\n\t\t\t * @property {string} [background] The new selected background (aerial, streets)\n\t\t\t */\n\t\t\tthis.fire(\"background-changed\", { background: bg || \"streets\" });\n\t\t}\n\t}\n\n\t/**\n\t * Get the currently visible users\n\t * @returns {string[]} List of visible users\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\tgetVisibleUsers() {\n\t\treturn [...this._userLayers].filter(l => (\n\t\t\tthis.getLayer(getUserLayerId(l, \"pictures\"))\n\t\t\t&& this.getLayoutProperty(getUserLayerId(l, \"pictures\"), \"visibility\") === \"visible\"\n\t\t));\n\t}\n\n\t/**\n\t * Wait for a given map layer to be really available.\n\t * @param {string} layerId the layer ID\n\t * @returns {Promise}\n\t * @fulfil {null} When layer is ready.\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\tonceLayerReady(layerId) {\n\t\tif(this.getLayer(layerId)) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t\telse {\n\t\t\treturn new Promise(resolve => {\n\t\t\t\tsetTimeout(resolve, 250);\n\t\t\t}).then(() => this.onceLayerReady(layerId));\n\t\t}\n\t}\n\n\t/**\n\t * Make given user layers visible on map, and hide all others (if any)\n\t * @memberof Panoramax.components.ui.Map#\n\t * @param {string|string[]} visibleIds The user layers IDs to display\n\t */\n\tasync setVisibleUsers(visibleIds = []) {\n\t\tif(typeof visibleIds === \"string\") { visibleIds = [visibleIds]; }\n\t\telse if(visibleIds === null) { visibleIds = []; }\n\n\t\t// Create any missing user layer\n\t\tawait Promise.all(\n\t\t\tvisibleIds\n\t\t\t\t.filter(id => id != \"\" && !this._userLayers.has(id))\n\t\t\t\t.map(id => {\n\t\t\t\t\tthis._createPicturesTilesLayer(id);\n\t\t\t\t\treturn this.onceLayerReady(getUserLayerId(id, \"pictures\"));\n\t\t\t\t})\n\t\t);\n\n\t\t// Switch visibility\n\t\tconst layersSuffixes = [\"pictures\", \"sequences\", \"sequences_plus\", \"grid\"];\n\t\t[...this._userLayers].forEach(l => {\n\t\t\tlayersSuffixes.forEach(suffix => {\n\t\t\t\tconst layerId = getUserLayerId(l, suffix);\n\t\t\t\tif(this.getLayer(layerId)) {\n\t\t\t\t\tthis.setLayoutProperty(layerId, \"visibility\", visibleIds.includes(l) ? \"visible\" : \"none\");\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Force style reload\n\t\tthis.reloadLayersStyles();\n\n\t\t/**\n\t\t * Event for visible users changes\n\t\t *\n\t\t * @event Panoramax.components.ui.Map#users-changed\n\t\t * @type {maplibregl.util.evented.Event}\n\t\t * @property {string[]} [usersIds] The list of newly selected users\n\t\t */\n\t\tthis.fire(\"users-changed\", { usersIds: visibleIds });\n\t}\n\n\t/**\n\t * Filter the visible data content in all visible map layers\n\t * @param {string} dataType sequences or pictures\n\t * @param {object} filter The MapLibre GL filter rule to apply\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\tfilterUserLayersContent(dataType, filter) {\n\t\t[...this._userLayers].forEach(l => {\n\t\t\tif(!this.getLayer(getUserLayerId(l, dataType))) {\n\t\t\t\tconsole.warn(\"Layer\", getUserLayerId(l, dataType), \"not ready\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.setFilter(getUserLayerId(l, dataType), filter);\n\t\t\tif(dataType === \"sequences\" && this.getLayer(getUserLayerId(l, \"sequences_plus\"))) {\n\t\t\t\tthis.setFilter(getUserLayerId(l, \"sequences_plus\"), filter);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Shows on map a picture position and heading.\n\t * \n\t * If no longitude & latitude are set, marker is removed from map.\n\t * @memberof Panoramax.components.ui.Map#\n\t * @param {number} lon The longitude\n\t * @param {number} lat The latitude\n\t * @param {number} heading The heading\n\t * @param {boolean} [skipCenter=false] Set to true to avoid map centering on marker\n\t * @param {string} [picId=null] The picture Id\n\t */\n\tdisplayPictureMarker(lon, lat, heading, skipCenter = false, picId = null) {\n\t\tthis._picMarkerPreview.remove();\n\n\t\t// Show marker corresponding to selection\n\t\tif(lon !== undefined && lat !== undefined) {\n\t\t\tthis._picMarker\n\t\t\t\t.setLngLat([lon, lat])\n\t\t\t\t.setRotation(heading)\n\t\t\t\t.addTo(this);\n\t\t\tthis._picMarker.picId = picId ;\n\t\t}\n\t\telse {\n\t\t\tthis._picMarker.remove();\n\t\t}\n\t\t\n\t\t// Update map style to see selected sequence\n\t\tthis.reloadLayersStyles();\n\n\t\t// Move map to picture coordinates\n\t\tif(!skipCenter && lon !== undefined && lat !== undefined) {\n\t\t\tthis.jumpTo({ // No animation to avoid conflict on seq=* load\n\t\t\t\tcenter: [lon, lat],\n\t\t\t\tzoom: this.getZoom() < TILES_PICTURES_ZOOM+2 ? TILES_PICTURES_ZOOM+2 : this.getZoom(),\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Forces reload of pictures/sequences layer styles.\n\t * This is useful after a map theme change.\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\treloadLayersStyles() {\n\t\tconst updateStyle = (layer, style) => {\n\t\t\t[...this._userLayers].forEach(l => {\n\t\t\t\tconst layerId = getUserLayerId(l, layer);\n\t\t\t\tif(!this.getLayer(layerId)) {\n\t\t\t\t\tconsole.warn(\"Layer\", layerId, \"not ready\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfor(let p in style.layout) {\n\t\t\t\t\tthis.setLayoutProperty(layerId, p, style.layout[p]);\n\t\t\t\t}\n\t\t\t\tfor(let p in style.paint) {\n\t\t\t\t\tthis.setPaintProperty(layerId, p, style.paint[p]);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\t[\"pictures\", \"sequences\"].forEach(l => {\n\t\t\tupdateStyle(l, this._getLayerStyleProperties(l));\n\t\t});\n\t}\n\n\t/**\n\t * Get the ID of the first Panoramax sequence/picture layer.\n\t * Useful for addLayer's beforeId parameter.\n\t * @returns {string} First Panoramax sequence layer ID\n\t */\n\tgetFirstPictureLayerID() {\n\t\treturn this.getLayersOrder().find(l => l.startsWith(\"geovisio_\") || l.endsWith(\"_sequences\"));\n\t}\n\n\t/**\n\t * Adds a new map layer.\n\t * This is an override of MapLibre's addLayer function in order to make sure all layers without beforeId are put between map background and Panoramax data.\n\t */\n\taddLayer(layer, beforeId, beforeSequences = true) {\n\t\t// Override beforeId to insert either before or after Panoramax own layers\n\t\tif(!beforeId && beforeSequences) {\n\t\t\t// Do not change for own Panoramax layers or semantics layers\n\t\t\tif(\n\t\t\t\t!layer.id.startsWith(\"geovisio_\")\n\t\t\t\t&& layer.id !== RASTER_LAYER_ID\n\t\t\t\t&& !layer.source.startsWith(\"sem-\")\n\t\t\t) {\n\t\t\t\tbeforeId = this.getFirstPictureLayerID();\n\t\t\t}\n\t\t}\n\n\t\tsuper.addLayer(layer, beforeId);\n\t}\n\n\t/**\n\t * Adds a new source.\n\t * This is an override of MapLibre's addSource function in order to tweak some attributions.\n\t */\n\taddSource(id, source) {\n\t\t// Shorten indoor= attribution\n\t\tif(this.indoorEqual && id === this.indoorEqual.source.sourceId) {\n\t\t\tsource.attribution = \"<a href=\\\"https://indoorequal.org/\\\" target=\\\"_blank\\\">© indoor=</a>\";\n\t\t}\n\n\t\tsuper.addSource(id, source);\n\t}\n\n\t/**\n\t * Creates source and layers for pictures and sequences.\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t * @param {string} id The source and layer ID prefix\n\t */\n\tasync _createPicturesTilesLayer(id) {\n\t\tthis._userLayers.add(id);\n\t\tconst firstLabelLayerId = this.getStyle().layers.find(isLabelLayer);\n\n\t\t// Load style from API\n\t\tif(id !== \"geovisio\" && !this.getSource(`geovisio_${id}`)) {\n\t\t\tconst style = await this._parent.api.getUserMapStyle(id);\n\t\t\tObject.entries(style.sources).forEach(([sId, s]) => this.addSource(sId, s));\n\t\t\tstyle.layers = style.layers || [];\n\t\t\tconst layers = style.layers.concat(getMissingLayerStyles(style.sources, style.layers));\n\t\t\tlayers.filter(l => Object.keys(l).length > 0).forEach(l => this.addLayer(l, firstLabelLayerId?.id));\n\t\t}\n\n\t\t// Map interaction events\n\t\t// Popup\n\t\tthis._picPreviewTimer = null;\n\t\tthis._picPopup = new maplibregl.Popup({\n\t\t\tcloseButton: false,\n\t\t\tcloseOnClick: !this._parent.isWidthSmall(),\n\t\t\toffset: 15\n\t\t});\n\n\t\tconst dropPreview = (delayed) => {\n\t\t\tclearTimeout(this._picDropPreviewTimer);\n\t\t\tif(delayed) {\n\t\t\t\tthis._picDropPreviewTimer = setTimeout(dropPreview, 250);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tclearTimeout(this._picPreviewTimer);\n\t\t\t\tdelete this._picPopup._picId;\n\t\t\t\tdelete this._picPopup._loading;\n\t\t\t\tthis._picPopup.remove();\n\t\t\t\tthis._picMarkerPreview.remove();\n\t\t\t}\n\t\t};\n\n\t\t// Pictures\n\t\tconst picLayerId = getUserLayerId(id, \"pictures\");\n\t\tthis.on(\"mousemove\", picLayerId, e => {\n\t\t\tthis.getCanvas().style.cursor = \"pointer\";\n\t\t\tconst eCopy = Object.assign({}, e);\n\t\t\tthis._attachPreviewToPictures(eCopy, picLayerId);\n\t\t});\n\n\t\tthis.on(\"mouseleave\", picLayerId, () => {\n\t\t\tthis.getCanvas().style.cursor = \"\";\n\t\t});\n\n\t\tthis.on(\"click\", picLayerId, this._onPictureClick.bind(this));\n\n\t\t// Sequences\n\t\tconst seqPlusLayerId = getUserLayerId(id, \"sequences_plus\");\n\t\tthis.on(\"mousemove\", seqPlusLayerId, e => {\n\t\t\tthis._onSequenceHover(e);\n\t\t\tthis.getCanvas().style.cursor = \"pointer\";\n\t\t\tif(e.features[0].properties.id) {\n\t\t\t\tconst eCopy = Object.assign({}, e);\n\t\t\t\tthis._attachPreviewToPictures(eCopy, seqPlusLayerId);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(\"mouseleave\", seqPlusLayerId, () => {\n\t\t\tthis.getCanvas().style.cursor = \"\";\n\t\t\tdropPreview(true);\n\t\t});\n\n\t\tthis.on(\"click\", seqPlusLayerId, e => {\n\t\t\te.preventDefault();\n\t\t\tthis._onSequenceClick(e);\n\t\t});\n\n\t\t// Grid\n\t\tif(id === \"geovisio\" && this.getLayer(\"geovisio_grid\")) {\n\t\t\tthis.on(\"mousemove\", \"geovisio_grid\", e => {\n\t\t\t\tif(this.getZoom() <= TILES_PICTURES_ZOOM+1) {\n\t\t\t\t\tthis.getCanvas().style.cursor = \"pointer\";\n\t\t\t\t\tconst eCopy = Object.assign({}, e);\n\t\t\t\t\tthis._attachPreviewToPictures(eCopy, \"geovisio_grid\");\n\t\t\t\t}\n\t\t\t});\n\t\n\t\t\tthis.on(\"mouseleave\", \"geovisio_grid\", () => {\n\t\t\t\tdropPreview();\n\t\t\t\tthis.getCanvas().style.cursor = \"\";\n\t\t\t});\n\t\n\t\t\tthis.on(\"click\", \"geovisio_grid\", e => {\n\t\t\t\te.preventDefault();\n\t\t\t\tthis.flyTo({ center: e.lngLat, zoom: TILES_PICTURES_ZOOM-6 });\n\t\t\t});\n\t\t}\n\n\t\t// Map background click\n\t\tthis.on(\"dblclick\", () => clearTimeout(this._gridFocus));\n\t\tthis.on(\"click\", (e) => {\n\t\t\tclearTimeout(this._gridFocus);\n\n\t\t\tif(e.defaultPrevented === false) {\n\t\t\t\tdropPreview();\n\t\t\t\tif(this._parent.isMapWide?.()) {\n\t\t\t\t\tthis._gridFocus = setTimeout(() => this._parent?.grid?.toggleAway(), 250);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Untoggle away widgets\n\t\tconst untoggleGridWidgets = () => {\n\t\t\tif(this._parent.isMapWide?.() && this._parent?.grid?._hidden) {\n\t\t\t\tclearTimeout(this._gridFocus);\n\t\t\t\tthis._parent.grid.toggleAway(true);\n\t\t\t}\n\t\t};\n\t\tthis.on(\"mousemove\", untoggleGridWidgets);\n\t\tthis.on(\"touchmove\", untoggleGridWidgets);\n\t}\n\n\t/**\n\t * MapLibre paint/layout properties for specific layer\n\t * This is useful when selected picture changes to allow partial update\n\t *\n\t * @returns {object} Paint/layout properties\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getLayerStyleProperties(layer) {\n\t\tconst prefixes = {\n\t\t\t\"pictures\": \"circle\",\n\t\t\t\"sequences\": \"line\",\n\t\t};\n\t\tconst res = {\n\t\t\t\"paint\": Object.assign({\n\t\t\t\t[`${prefixes[layer]}-color`]: this._getLayerColorStyle(layer),\n\t\t\t\t// [`${prefixes[layer]}-stroke-color`]: this._getLayerColorStyle(layer),\n\t\t\t}, VECTOR_STYLES[layer.toUpperCase()].paint),\n\t\t\t\"layout\": Object.assign({\n\t\t\t\t[`${prefixes[layer]}-sort-key`]: this._getLayerSortStyle(layer),\n\t\t\t}, VECTOR_STYLES[layer.toUpperCase()].layout)\n\t\t};\n\n\t\tif(layer === \"pictures\") {\n\t\t\tres.paint[\"circle-stroke-color\"] = this._getLayerColorStyle(layer);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Retrieve map layer color scheme according to selected theme.\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getLayerColorStyle(layer) {\n\t\t// Hidden style\n\t\tconst s = [\"case\",\n\t\t\t[\"==\", [\"get\", \"hidden\"], true], COLORS.HIDDEN,\n\t\t\t[\"==\", [\"get\", \"geovisio:status\"], \"hidden\"], COLORS.HIDDEN,\n\t\t];\n\n\t\t// Selected sequence style\n\t\tconst seqId = this._parent.sequence;\n\t\tif(layer == \"sequences\" && seqId) {\n\t\t\ts.push([\"==\", [\"get\", \"id\"], seqId], COLORS.SELECTED);\n\t\t}\n\t\telse if(layer.startsWith(\"pictures\") && seqId) {\n\t\t\ts.push([\"in\", seqId, [\"get\", \"sequences\"]], COLORS.SELECTED);\n\t\t}\n\t\t\n\t\t// Classic style\n\t\ts.push(COLORS.BASE);\n\n\t\treturn s;\n\t}\n\n\t/**\n\t * Retrieve map sort key according to selected theme.\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getLayerSortStyle(layer) {\n\t\t// Values\n\t\t//  - 100 : on top / selected feature\n\t\t//  - 90  : hidden feature\n\t\t//  - 20-80 : custom ranges\n\t\t//  - 10  : basic feature\n\t\t//  - 0   : on bottom / feature with undefined property\n\t\t// Hidden style\n\t\tconst s = [\"case\",\n\t\t\t[\"==\", [\"get\", \"hidden\"], true], 90\n\t\t];\n\n\t\t// Selected sequence style\n\t\tconst seqId = this._parent.sequence;\n\t\tif(layer == \"sequences\" && seqId) {\n\t\t\ts.push([\"==\", [\"get\", \"id\"], seqId], 100);\n\t\t}\n\t\telse if(layer.startsWith(\"pictures\") && seqId) {\n\t\t\ts.push([\"in\", seqId, [\"get\", \"sequences\"]], 100);\n\t\t}\n\n\t\ts.push(10);\n\t\treturn s;\n\t}\n\n\t/**\n\t * Creates popup manager for preview of pictures.\n\t * @private\n\t * @param {object} e The event thrown by MapLibre\n\t * @param {string} from The event source layer\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_attachPreviewToPictures(e, from) {\n\t\tlet f = e.features.pop();\n\t\tif(!f || f.properties.id == this._picPopup._picId) { return; }\n\n\t\tclearTimeout(this._picPreviewTimer);\n\t\tclearTimeout(this._picDropPreviewTimer);\n\t\tthis._picPopup._loading = f.properties.id;\n\t\tthis._picPopup._picId = f.properties.id;\n\t\tdelete this._picPopup._seqId;\n\t\t\n\n\t\t/*\n\t\t * Display picture preview marker\n\t\t */\n\n\t\tlet picPreview = null;\n\t\tif(from.includes(\"_pictures\")) { // From picture hover\n\t\t\tpicPreview = f;\n\t\t}\n\t\telse if(from.includes(\"_sequences\")) { // From sequence hover\n\t\t\t// Look for nearest picture in vector tiles\n\t\t\tconst picLayer = this.getLayersOrder().find(lid => lid.endsWith(\"_pictures\"));\n\t\t\tif(picLayer) {\n\t\t\t\tconst nearbyPics = this.queryRenderedFeatures(\n\t\t\t\t\tthis.getBounds(),\n\t\t\t\t\t{\n\t\t\t\t\t\tlayers: [picLayer],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tlet prevDist = null;\n\t\t\t\tfor(let i=0; i < nearbyPics.length; i++) {\n\t\t\t\t\tlet dist = e.lngLat.distanceTo(new maplibregl.LngLat(...nearbyPics[i].geometry.coordinates));\n\t\t\t\t\tif(!prevDist || dist < prevDist) {\n\t\t\t\t\t\tpicPreview = nearbyPics[i];\n\t\t\t\t\t\tprevDist = dist;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(picPreview) {\n\t\t\tthis._picPopup._seqId = picPreview.properties.first_sequence;\n\t\t\tthis._picMarkerPreview\n\t\t\t\t.setLngLat?.(picPreview.geometry.coordinates)\n\t\t\t\t.setRotation(picPreview.properties.heading || 0)\n\t\t\t\t.addTo(this);\n\t\t}\n\t\telse { this._picMarkerPreview?.remove?.(); }\n\n\n\t\t/*\n\t\t * Display thumbnail popup\n\t\t */\n\n\t\tlet thumbCoords = picPreview ? picPreview.geometry.coordinates : e.lngLat;\n\t\tthis._picPopup\n\t\t\t.setLngLat(thumbCoords)\n\t\t\t.addTo(this);\n\t\t\n\t\t// Only show GIF loader if thumbnail is not in browser cache\n\t\tif(!picPreview && !this._picThumbUrl[f.properties.id]) {\n\t\t\tthis._picPopup.setDOMContent(getThumbGif(this._parent._t));\n\t\t}\n\n\t\tconst displayThumb = thumbUrl => {\n\t\t\tif(this._picPopup._loading === f.properties.id) {\n\t\t\t\tif(thumbUrl) {\n\t\t\t\t\tlet content = document.createElement(\"img\");\n\t\t\t\t\tcontent.classList.add(\"pnx-map-thumb\");\n\t\t\t\t\tcontent.alt = this._parent._t.map.thumbnail;\n\t\t\t\t\tlet img = new Image();\n\t\t\t\t\timg.src = thumbUrl;\n\n\t\t\t\t\timg.addEventListener(\"load\", () => {\n\t\t\t\t\t\tif(this._picPopup._loading !== f.properties.id) { return; }\n\n\t\t\t\t\t\tif(f.properties.hidden) {\n\t\t\t\t\t\t\tcontent.children[0].src = img.src;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcontent.src = img.src;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._picPopup.setDOMContent(content);\n\t\t\t\t\t\tdelete this._picPopup._loading;\n\t\t\t\t\t});\n\n\t\t\t\t\tif(f.properties.hidden) {\n\t\t\t\t\t\tconst legend = document.createElement(\"div\");\n\t\t\t\t\t\tlegend.classList.add(\"pnx-map-thumb-legend\");\n\t\t\t\t\t\tlegend.appendChild(document.createTextNode(this._parent._t.map.not_public));\n\t\t\t\t\t\tconst container = document.createElement(\"div\");\n\t\t\t\t\t\tcontainer.appendChild(content);\n\t\t\t\t\t\tcontainer.appendChild(legend);\n\t\t\t\t\t\tcontent = container;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis._picPopup.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tif(this._picPopup._loading !== f.properties.id) { return; }\n\n\t\t// Hover on cached thumbnail\n\t\tif(this._picThumbUrl[picPreview?.properties?.id || f.properties.id]) {\n\t\t\tdisplayThumb(this._picThumbUrl[picPreview?.properties?.id || f.properties.id]);\n\t\t}\n\t\t// Throttled call to API\n\t\telse {\n\t\t\tclearTimeout(this._picPreviewTimer);\n\t\t\tthis._picPreviewTimer = setTimeout(() => {\n\t\t\t\tif(this._picPopup._loading !== f.properties.id) { return; }\n\n\t\t\t\t// Hover on a single picture\n\t\t\t\tif(picPreview) {\n\t\t\t\t\tthis._getPictureThumbURL(picPreview.properties.id, picPreview.properties.collection).then(displayThumb);\n\t\t\t\t}\n\t\t\t\t// Hover on a grid cell\n\t\t\t\telse if(from.endsWith(\"_grid\")) {\n\t\t\t\t\tthis._getThumbURL(thumbCoords).then(displayThumb);\n\t\t\t\t}\n\t\t\t\t// Hover on a sequence\n\t\t\t\telse if(from.includes(\"_sequences\")) {\n\t\t\t\t\tthis._getSequenceThumbURL(f.properties.id, thumbCoords).then(displayThumb);\n\t\t\t\t}\n\t\t\t}, 50);\n\t\t}\n\t}\n\n\t/**\n\t * Get picture thumbnail URL at given coordinates\n\t *\n\t * @param {LngLat} coordinates The map coordinates\n\t * @returns {Promise} Promise resolving on picture thumbnail URL, or null on timeout\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getThumbURL(coordinates) {\n\t\treturn this._parent.api.getPicturesAroundCoordinates(coordinates.lat, coordinates.lng, 0.1, 1).then(res => {\n\t\t\tconst p = res?.features?.pop();\n\t\t\treturn p ? this._parent.api.findThumbnailInPictureFeature(p) : null;\n\t\t});\n\t}\n\t\n\n\t/**\n\t * Get picture thumbnail URL for a given sequence ID\n\t *\n\t * @param {string} seqId The sequence ID\n\t * @param {LngLat} [coordinates] The map coordinates\n\t * @returns {Promise} Promise resolving on picture thumbnail URL, or null on timeout\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getSequenceThumbURL(seqId, coordinates) {\n\t\tif(coordinates) {\n\t\t\treturn this._parent.api.getPicturesAroundCoordinates(coordinates.lat, coordinates.lng, 1, 1, seqId)\n\t\t\t\t.then(results => {\n\t\t\t\t\tif(results?.features?.length > 0) {\n\t\t\t\t\t\treturn this._parent.api.findThumbnailInPictureFeature(results.features[0]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn this._parent.api.getPictureThumbnailURLForSequence(seqId);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t\telse {\n\t\t\treturn this._parent.api.getPictureThumbnailURLForSequence(seqId);\n\t\t}\n\t}\n\n\t/**\n\t * Get picture thumbnail URL for a given picture ID.\n\t * It handles a client-side cache based on raw API responses.\n\t *\n\t * @param {string} picId The picture ID\n\t * @param {string} [seqId] The sequence ID (can speed up search if available)\n\t * @returns {Promise} Promise resolving on picture thumbnail URL, or null on timeout\n\t * @memberof Panoramax.components.ui.Map#\n\t * @private\n\t */\n\t_getPictureThumbURL(picId, seqId) {\n\t\tlet res = null;\n\n\t\tif(picId) {\n\t\t\tif(this._picThumbUrl[picId] !== undefined) {\n\t\t\t\tres = typeof this._picThumbUrl[picId] === \"string\" ? Promise.resolve(this._picThumbUrl[picId]) : this._picThumbUrl[picId];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._picThumbUrl[picId] = this._parent.api.getPictureThumbnailURL(picId, seqId).then(url => {\n\t\t\t\t\tif(url) {\n\t\t\t\t\t\tthis._picThumbUrl[picId] = url;\n\t\t\t\t\t\treturn url;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis._picThumbUrl[picId] = null;\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t\t.catch(() => {\n\t\t\t\t\t\tthis._picThumbUrl[picId] = null;\n\t\t\t\t\t});\n\t\t\t\tres = this._picThumbUrl[picId];\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Create a ready-to-use picture marker\n\t *\n\t * @returns {maplibregl.Marker} The generated marker\n\t * @private\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_getPictureMarker(selected = true) {\n\t\tconst img = document.createElement(\"img\");\n\t\timg.src = selected ? MarkerSelectedSVG : MarkerBaseSVG;\n\t\timg.alt = \"\";\n\t\treturn new maplibregl.Marker({\n\t\t\telement: img,\n\t\t\tpicId: null\n\t\t})\n\t\t\t// only picMarker could be draggable, don't for picMarkerPreview.\n\t\t\t.setDraggable(selected && this._options.picMarkerDraggable)\n\t\t;\n\t}\n\n\t/**\n\t * Event handler for sequence hover\n\t * @private\n\t * @param {object} e Event data\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_onSequenceHover(e) {\n\t\te.preventDefault();\n\t\tif(e.features.length > 0 && e.features[0].properties?.id) {\n\t\t\t/**\n\t\t\t * Event when a sequence on map is hovered (not selected)\n\t\t\t *\n\t\t\t * @event Panoramax.components.ui.Map#sequence-hover\n\t\t\t * @type {maplibregl.util.evented.Event}\n\t\t\t * @property {string} seqId The hovered sequence ID\n\t\t\t */\n\t\t\tthis.fire(\"sequence-hover\", { seqId: e.features[0].properties.id });\n\t\t}\n\t}\n\n\t/**\n\t * Event handler for sequence click\n\t * @private\n\t * @param {object} e Event data\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_onSequenceClick(e) {\n\t\te.preventDefault();\n\t\te.originalEvent.stopImmediatePropagation();\n\n\t\t// Skip if pictures navigation is set to \"pic\"\n\t\tif(this._parent.psv?.getPicturesNavigation() === \"pic\") {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(e.features.length > 0) {\n\t\t\tlet seq = e.features[0];\n\t\t\t\n\t\t\t// If clicks on many sequences, prefer the one corresponding to picture thumbnail preview\n\t\t\tif(e.features.length > 1 && this._picPopup._seqId) {\n\t\t\t\tseq = e.features.find(s => s.properties.id === this._picPopup._seqId) || seq;\n\t\t\t}\n\n\t\t\tif(seq.properties?.id) {\n\t\t\t\t/**\n\t\t\t\t * Event when a sequence on map is clicked\n\t\t\t\t * @event Panoramax.components.ui.Map#sequence-click\n\t\t\t\t * @type {maplibregl.util.evented.Event}\n\t\t\t\t * @property {string} seqId The clicked sequence ID\n\t\t\t\t * @property {maplibregl.LngLat} coordinates The coordinates of user click\n\t\t\t\t */\n\t\t\t\tthis.fire(\"sequence-click\", {\n\t\t\t\t\tseqId: seq.properties.id,\n\t\t\t\t\tcoordinates: e.lngLat\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Event handler for picture click\n\t * @private\n\t * @param {object} e Event data\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\t_onPictureClick(e) {\n\t\te.preventDefault();\n\t\te.originalEvent.stopImmediatePropagation();\n\n\t\t// Skip if pictures navigation is set to \"pic\"\n\t\tif(this._parent.psv?.getPicturesNavigation() === \"pic\") {\n\t\t\treturn;\n\t\t}\n\n\t\t// Skip if click happens as well on a semantic layer\n\t\tconst features = this.queryRenderedFeatures(e.point);\n\t\tif(features.length > 1) {\n\t\t\tif(features.find(f => f?.source?.startsWith(\"sem-\"))) { return; }\n\t\t}\n\n\t\tconst f = e?.features?.length > 0 ? e.features[0] : null;\n\t\tif(f?.properties?.id) {\n\t\t\t// Look for a potential sequence ID\n\t\t\tlet seqId = null;\n\t\t\ttry {\n\t\t\t\tif(f.properties.sequences) {\n\t\t\t\t\tif(!Array.isArray(f.properties.sequences)) { f.properties.sequences = JSON.parse(f.properties.sequences); }\n\t\t\t\t\tseqId = f.properties.sequences.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(e) {\n\t\t\t\tconsole.log(\"Sequence ID is not available in vector tiles for picture \"+f.properties.id);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Event when a picture on map is clicked\n\t\t\t *\n\t\t\t * @event Panoramax.components.ui.Map#picture-click\n\t\t\t * @type {maplibregl.util.evented.Event}\n\t\t\t * @property {string} picId The clicked picture ID\n\t\t\t * @property {string} seqId The clicked picture's sequence ID\n\t\t\t * @property {object} feature The GeoJSON feature of the picture\n\t\t\t */\n\t\t\tthis.fire(\"picture-click\", {\n\t\t\t\tpicId: f.properties.id,\n\t\t\t\tseqId,\n\t\t\t\tfeature: f\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Listen to map events.\n\t * This is a binder to [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#on) and [`once`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#once) MapLibre GL functions.\n\t * @param {string} type The event type to listen for\n\t * @param {function} listener The event handler\n\t * @param {boolean} [options.once=false] Set to true to only listen to first event.\n\t * @memberof Panoramax.components.ui.Map#\n\t */\n\taddEventListener(type, listener, options = {}) {\n\t\tif(options?.once) { this.once(type, listener); }\n\t\telse { this.on(type, listener); }\n\t}\n}\n","import Map from \"./Map\";\nimport { COLORS, QUALITYSCORE_VALUES, GPS_VALUES } from \"../../utils/utils\";\nimport {\n\tMAP_EXPR_QUALITYSCORE, switchCoefValue, MAP_THEMES,\n\tmapFiltersToLayersFilters, MAP_EXPR_QUALITYSCORE_GPS\n} from \"../../utils/map\";\nimport { SEMANTICS_OVERLAYS } from \"../../utils/semantics\";\nimport { SEMANTICS_OVERLAY_MINZOOM, SEMANTICS_OVERLAY_MAXZOOM } from \"../../utils/SemanticsMapProtocol\";\nimport { getUserAccount } from \"../../utils/utils\";\n\nexport const MAP_FILTERS = [ \"minDate\", \"maxDate\", \"pic_type\", \"camera\", \"theme\", \"qualityscore\", \"gps\"];\n\n\n/**\n * MapMore is a more complete version of [Map UI component](#Panoramax.components.ui.Map).\n * \n * It offers advanced features like themes, filters and more.\n * \n * Note that all functions of [MapLibre GL JS class Map](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) are also available.\n * \n * ⚠️ This class doesn't inherit from [EventTarget](https://developer.mozilla.org/fr/docs/Web/API/EventTarget), so it doesn't have `addEventListener` and `dispatchEvent` functions.\n * It uses instead [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#on) and `fire` functions from MapLibre Map class.\n * `fire` function doesn't take directly [`Event`](https://developer.mozilla.org/fr/docs/Web/API/Event) objects, but a string and object data.\n * @class Panoramax.components.ui.MapMore\n * @extends Panoramax.components.ui.Map\n * @param {Panoramax.components.core.Basic} parent The parent view\n * @param {Element} container The DOM element to create into\n * @param {object} [options] The map options (any of [MapLibre GL settings](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/) or any supplementary option defined here)\n * @param {object} [options.raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).\n * @param {string} [options.background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to streets.\n * @param {string} [options.attributionControl.customAttribution] To override default map attribution.\n * @param {boolean} [options.picMarkerDraggable] To make the picture marker draggable, default to false.\n * @param {object} [options.indoor] The indoor= MapLibre plugin options. This must be a JSON object following [IndoorEqual parameters](https://indoorequal.com/doc/maplibre-gl-indoorequal/api#parameters). Note that this is only available if [maplibre-gl-indoorequal](https://indoorequal.com/doc/maplibre-gl-indoorequal) plugin is loaded in your web page.\n * @param {string} [options.indoor.level] (only if indoor= plugin is enabled) The initial indoor level to display. Defaults to ground or disabled depending on indoor map availability.\n * @param {string} [options.theme=default] The map theme (default, age, score, type)\n * @fires Panoramax.components.ui.Map#background-changed\n * @fires Panoramax.components.ui.Map#users-changed\n * @fires Panoramax.components.ui.Map#sequence-hover\n * @fires Panoramax.components.ui.Map#sequence-click\n * @fires Panoramax.components.ui.Map#picture-click\n * @fires Panoramax.components.ui.MapMore#filters-changed\n * @example\n * const map = new Panoramax.components.ui.MapMore(viewer, mapNode, {center: {lat: 48.7, lng: -1.7}});\n */\nexport default class MapMore extends Map {\n\tconstructor(parent, container, options = {}) {\n\t\tsuper(parent, container, options);\n\n\t\t// Map theme\n\t\tthis._mapFilters = {};\n\t\tif(this._options.theme) { this._mapFilters = { theme: this._options.theme }; }\n\n\t\t// Features restrictions\n\t\tthis._featuresRestrict = { pictures: {}, sequences: {} };\n\t}\n\n\t/** @private */\n\tasync _postLoad() {\n\t\tif(this._parent.api._endpoints.queryables) {\n\t\t\tSEMANTICS_OVERLAYS.forEach(so => this.addSemanticOverlay(...so));\n\t\t}\n\t\tawait super._postLoad();\n\t}\n\n\treloadLayersStyles() {\n\t\tsuper.reloadLayersStyles();\n\n\t\t// Also handle the grid stats\n\t\tif(this._hasGridStats()) {\n\t\t\tlet newType = \"coef\";\n\t\t\tif(this._mapFilters.pic_type) {\n\t\t\t\tnewType = this._mapFilters.pic_type == \"flat\" ? \"coef_flat_pictures\" : \"coef_360_pictures\";\n\t\t\t\tif(this._hasLoggedGridStats() && getUserAccount()) {\n\t\t\t\t\tnewType = \"logged_\" + newType;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.getStyle().layers\n\t\t\t\t.filter(l => l.id.endsWith(\"_grid\"))\n\t\t\t\t.forEach(l => {\n\t\t\t\t\tconst newl = switchCoefValue(l, newType);\n\t\t\t\t\tfor(let p in newl.layout) {\n\t\t\t\t\t\tthis.setLayoutProperty(l.id, p, newl.layout[p]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(let p in newl.paint) {\n\t\t\t\t\t\tthis.setPaintProperty(l.id, p, newl.paint[p]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Computes dates to use for map theme by picture/sequence age\n\t * @private\n\t */\n\t_getDatesForLayerColors() {\n\t\tconst oneDay = 24 * 60 * 60 * 1000;\n\t\tconst d0 = Date.now();\n\t\tconst d1 = d0 - 30 * oneDay;\n\t\tconst d2 = d0 - 365 * oneDay;\n\t\tconst d3 = d0 - 2 * 365 * oneDay;\n\t\treturn [d1, d2, d3].map(d => new Date(d).toISOString().split(\"T\")[0]);\n\t}\n\n\t/**\n\t * Retrieve map layer color scheme according to selected theme.\n\t * @private\n\t */\n\t_getLayerColorStyle(layer) {\n\t\t// Hidden style\n\t\tconst s = [\"case\",\n\t\t\t[\"==\", [\"get\", \"hidden\"], true], COLORS.HIDDEN\n\t\t];\n\n\t\t// Selected sequence style\n\t\tconst picId = this._parent.psv?._myVTour?.state?.loadingNode || this._parent.psv?._myVTour?.state?.currentNode?.id;\n\t\tconst seqId = picId ? this._parent.psv?._picturesSequences[picId] : null;\n\t\tif(layer == \"sequences\" && seqId) {\n\t\t\ts.push([\"==\", [\"get\", \"id\"], seqId], COLORS.SELECTED);\n\t\t}\n\t\telse if(layer == \"pictures\" && seqId) {\n\t\t\ts.push([\"in\", seqId, [\"get\", \"sequences\"]], COLORS.SELECTED);\n\t\t}\n\t\t\n\t\t// Themes styles\n\t\tif(this._mapFilters.theme == MAP_THEMES.AGE) {\n\t\t\tconst prop = layer == \"sequences\" ? \"date\" : \"ts\";\n\t\t\tconst dt = this._getDatesForLayerColors();\n\n\t\t\ts.push(\n\t\t\t\t[\"!\", [\"has\", prop]], COLORS.BASE,\n\t\t\t\t[\">=\", [\"get\", prop], dt[0]], COLORS.PALETTE_4,\n\t\t\t\t[\">=\", [\"get\", prop], dt[1]], COLORS.PALETTE_3,\n\t\t\t\t[\">=\", [\"get\", prop], dt[2]], COLORS.PALETTE_2,\n\t\t\t\tCOLORS.PALETTE_1\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.TYPE) {\n\t\t\ts.push(\n\t\t\t\t[\"!\", [\"has\", \"type\"]], COLORS.BASE,\n\t\t\t\t[\"==\", [\"get\", \"type\"], \"equirectangular\"], COLORS.QUALI_1,\n\t\t\t\tCOLORS.QUALI_2\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.SCORE) {\n\t\t\ts.push(\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 5], QUALITYSCORE_VALUES[0].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 4], QUALITYSCORE_VALUES[1].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 3], QUALITYSCORE_VALUES[2].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 2], QUALITYSCORE_VALUES[3].color,\n\t\t\t\tQUALITYSCORE_VALUES[4].color,\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.GPS) {\n\t\t\ts.push(\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 5], GPS_VALUES[0].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 4], GPS_VALUES[1].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 3], GPS_VALUES[2].color,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 2], GPS_VALUES[3].color,\n\t\t\t\tGPS_VALUES[4].color,\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\ts.push(COLORS.BASE);\n\t\t}\n\n\t\treturn s;\n\t}\n\n\t/**\n\t * Retrieve map sort key according to selected theme.\n\t * @private\n\t */\n\t_getLayerSortStyle(layer) {\n\t\t// Values\n\t\t//  - 100 : on top / selected feature\n\t\t//  - 90  : hidden feature\n\t\t//  - 20-80 : custom ranges\n\t\t//  - 10  : basic feature\n\t\t//  - 0   : on bottom / feature with undefined property\n\n\t\t// Hidden style\n\t\tconst s = [\"case\",\n\t\t\t[\"==\", [\"get\", \"hidden\"], true], 90\n\t\t];\n\n\t\t// Selected sequence style\n\t\tconst picId = this._parent.psv?._myVTour?.state?.loadingNode || this._parent.psv?._myVTour?.state?.currentNode?.id;\n\t\tconst seqId = picId ? this._parent.psv?._picturesSequences[picId] : null;\n\t\tif(layer == \"sequences\" && seqId) {\n\t\t\ts.push([\"==\", [\"get\", \"id\"], seqId], 100);\n\t\t}\n\t\telse if(layer == \"pictures\" && seqId) {\n\t\t\ts.push([\"in\", seqId, [\"get\", \"sequences\"]], 100);\n\t\t}\n\n\t\t// Themes styles\n\t\tif(this._mapFilters.theme == MAP_THEMES.AGE) {\n\t\t\tconst prop = layer == \"sequences\" ? \"date\" : \"ts\";\n\t\t\tconst dt = this._getDatesForLayerColors();\n\t\t\ts.push(\n\t\t\t\t[\"!\", [\"has\", prop]], 0,\n\t\t\t\t[\">=\", [\"get\", prop], dt[0]], 50,\n\t\t\t\t[\">=\", [\"get\", prop], dt[1]], 49,\n\t\t\t\t[\">=\", [\"get\", prop], dt[2]], 48,\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.TYPE) {\n\t\t\ts.push(\n\t\t\t\t[\"!\", [\"has\", \"type\"]], 0,\n\t\t\t\t[\"==\", [\"get\", \"type\"], \"equirectangular\"], 50,\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.SCORE) {\n\t\t\ts.push(\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 5], 80,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 4], 65,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 3], 50,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 2], 35,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE, 1], 20,\n\t\t\t);\n\t\t}\n\t\telse if(this._mapFilters.theme == MAP_THEMES.GPS) {\n\t\t\ts.push(\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 5], 80,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 4], 65,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 3], 50,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 2], 35,\n\t\t\t\t[\"==\", MAP_EXPR_QUALITYSCORE_GPS, 1], 20,\n\t\t\t);\n\t\t}\n\n\t\ts.push(10);\n\t\treturn s;\n\t}\n\n\t/**\n\t * Change the map filters\n\t * @param {object} filters Filtering values\n\t * @param {string} [filters.minDate] Start date for pictures (format YYYY-MM-DD)\n\t * @param {string} [filters.maxDate] End date for pictures (format YYYY-MM-DD)\n\t * @param {string} [filters.pic_type] Type of picture to keep (flat, equirectangular)\n\t * @param {string} [filters.camera] Camera make and model to keep\n\t * @param {string} [filters.theme] Map theme to use\n\t * @param {number[]} [filters.qualityscore] QualityScore values, as a list of 1 to 5 grades\n\t * @param {number[]} [filters.gps] GPS precision grades, as a list of 1 to 5 grades\n\t * @param {boolean} [skipZoomIn=false] If true, doesn't force zoom in to map level >= 7\n\t * @memberof Panoramax.components.core.MapMore#\n\t */\n\tsetFilters(filters, skipZoomIn = false) {\n\t\tlet { mapFilters, mapSeqFilters, mapPicFilters, reloadMapStyle } = mapFiltersToLayersFilters(filters, this._hasGridStats(), this._featuresRestrict);\n\n\t\tthis._mapFilters = mapFilters;\n\t\tif(reloadMapStyle) {\n\t\t\tthis.reloadLayersStyles();\n\t\t}\n\n\t\tconst allUsers = this.getVisibleUsers().includes(\"geovisio\");\n\t\tif(mapSeqFilters && allUsers) {\n\t\t\tmapSeqFilters = [\"step\", [\"zoom\"],\n\t\t\t\ttrue,\n\t\t\t\t7, mapSeqFilters\n\t\t\t];\n\t\t}\n\n\t\tthis.filterUserLayersContent(\"sequences\", mapSeqFilters);\n\t\tthis.filterUserLayersContent(\"pictures\", mapPicFilters);\n\n\t\tif(\n\t\t\t!skipZoomIn\n\t\t\t&& (\n\t\t\t\tmapSeqFilters !== null\n\t\t\t\t|| mapPicFilters !== null\n\t\t\t\t|| (this._mapFilters.theme !== null && this._mapFilters.theme !== MAP_THEMES.DEFAULT)\n\t\t\t)\n\t\t\t&& allUsers\n\t\t\t&& this.getZoom() < 7\n\t\t\t&& !this._hasGridStats()\n\t\t) {\n\t\t\tthis.easeTo({ zoom: 7 });\n\t\t}\n\n\t\t/**\n\t\t * Event for filters changes\n\t\t * @event Panoramax.components.ui.MapMore#filters-changed\n\t\t * @type {maplibregl.util.evented.Event}\n\t\t * @property {string} [minDate] The minimum date in time range (ISO format)\n\t\t * @property {string} [maxDate] The maximum date in time range (ISO format)\n\t\t * @property {string} [pic_type] Camera type (equirectangular, flat, null/empty string for both)\n\t\t * @property {string} [camera] Camera make and model\n\t\t * @property {string} [theme] Map theme\n\t\t * @property {number[]} [qualityscore] QualityScore values, as a list of 1 to 5 grades\n\t\t * @property {number[]} [gps] GPS precision grades, as a list of 1 to 5 grades\n\t\t */\n\t\tthis.fire(\"filters-changed\", Object.assign({}, this._mapFilters));\n\t}\n\n\t/**\n\t * Restrict the visible pictures or sequences on map.\n\t * @param {string} restriction \"keep\" or \"hide\"\n\t * @param {string} type \"pictures\" or \"sequences\"\n\t * @param {string[]} features The list of features UUIDs concerned by this rule\n\t */\n\trestrictVisibleFeatures(restriction, type, features) {\n\t\tthis._featuresRestrict[type] = { rule: restriction, features };\n\n\t\t// Force reload of styles & filters\n\t\tlet { mapSeqFilters, mapPicFilters, reloadMapStyle } = mapFiltersToLayersFilters(this._mapFilters, this._hasGridStats(), this._featuresRestrict);\n\t\tif(reloadMapStyle) { this.reloadLayersStyles(); }\n\t\tthis.filterUserLayersContent(\"sequences\", mapSeqFilters);\n\t\tthis.filterUserLayersContent(\"pictures\", mapPicFilters);\n\t}\n\n\t/**\n\t * Make given user layers visible on map, and hide all others (if any)\n\t * @memberof Panoramax.components.ui.Map#\n\t * @param {string|string[]} visibleIds The user layers IDs to display\n\t */\n\tasync setVisibleUsers(visibleIds = []) {\n\t\tawait super.setVisibleUsers(visibleIds);\n\t\t\n\t\t// Force reload of styles & filters\n\t\tlet { mapSeqFilters, mapPicFilters, reloadMapStyle } = mapFiltersToLayersFilters(this._mapFilters, this._hasGridStats(), this._featuresRestrict);\n\n\t\tif(reloadMapStyle) {\n\t\t\tthis.reloadLayersStyles();\n\t\t}\n\n\t\tconst allUsers = visibleIds.includes(\"geovisio\");\n\t\tif(mapSeqFilters && allUsers) {\n\t\t\tmapSeqFilters = [\"step\", [\"zoom\"],\n\t\t\t\ttrue,\n\t\t\t\t7, mapSeqFilters\n\t\t\t];\n\t\t}\n\n\t\tthis.filterUserLayersContent(\"sequences\", mapSeqFilters);\n\t\tthis.filterUserLayersContent(\"pictures\", mapPicFilters);\n\t}\n\n\t/**\n\t * Add a new semantic overlay on map\n\t * @param {string} id The layer ID\n\t * @param {string} apiFilter The API filter for semantics, [as documented in API](https://api.panoramax.xyz/redoc#tag/Items/operation/get_api-search-5769f3316ef291861415451c98c2e33f)\n\t * @param {object} layerStyle The [MapLibre GL layer style](https://maplibre.org/maplibre-style-spec/layers/) to apply, including default visibility. Note that a \"metadata\" property is required to properly show it in Tags widget. If no metadata is set, layer is added as a \"secret\" layer (for internal mechanics).\n\t * @param {object} [sprites] The optional sprites to load\n\t * @memberof Panoramax.components.core.MapMore#\n\t */\n\taddSemanticOverlay(id, apiFilter, layerStyle, sprites = {}) {\n\t\tif(!this._parent.api._endpoints.queryables) {\n\t\t\tthrow new Error(\"Semantics overlay are not available on API\");\n\t\t}\n\n\t\t// Sprites\n\t\tObject.entries(sprites || {}).forEach(([k,v]) => this.addSprite(k, v));\n\n\t\t// Overlay source & layer\n\t\tconst srcId = \"sem-\"+id;\n\t\tthis.addSource(srcId, {\n\t\t\ttype: \"vector\",\n\t\t\ttiles: [`sem:///${apiFilter}/{z}/{x}/{y}`],\n\t\t\tminzoom: SEMANTICS_OVERLAY_MINZOOM,\n\t\t\tmaxzoom: SEMANTICS_OVERLAY_MAXZOOM\n\t\t});\n\t\tthis.addLayer({\n\t\t\tid,\n\t\t\tsource: srcId,\n\t\t\t\"source-layer\": \"layer\",\n\t\t\t...layerStyle\n\t\t});\n\n\t\t// Click event\n\t\tthis.on(\"click\", id, e => {\n\t\t\te.preventDefault();\n\t\t\tif(e?.features?.length > 0) {\n\t\t\t\tconst f = e.features[0];\n\t\t\t\tthis._parent.select(f.properties.seqid, f.properties.picid);\n\t\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tconst picMeta = this._parent.psv.getPictureMetadata();\n\t\t\t\t\tif(picMeta.properties?.annotations?.length === 1) {\n\t\t\t\t\t\tthis._parent.psv.focusOnAnnotation(picMeta.properties.annotations[0].id);\n\t\t\t\t\t}\n\t\t\t\t}, { once: true });\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * List existing semantic overlays, either visible or not.\n\t * @memberof Panoramax.components.core.MapMore#\n\t * @returns {object[]} List of MapLibre layers\n\t */\n\tgetSemanticOverlays() {\n\t\treturn this.getStyle().layers.filter(l => l.source?.startsWith(\"sem-\"));\n\t}\n\n\t/**\n\t * Change visibility of all semantics overlays at once.\n\t * @param {boolean} visible True to make all visible\n\t * @memberof Panoramax.components.core.MapMore#\n\t */\n\ttoggleAllSemanticOverlays(visible) {\n\t\tthis.getSemanticOverlays().forEach(l => l.metadata && this.setLayoutProperty(l.id, \"visibility\", visible ? \"visible\" : \"none\"));\n\t}\n}\n","import \"./Photo.css\";\nimport LoaderImgBase from \"../../img/loader_base.jpg\";\nimport LogoDead from \"../../img/logo_dead.svg\";\nimport {\n\tgetDistance, positionToXYZ, xyzToPosition,\n\tgetRelativeHeading, BASE_PANORAMA_ID, isNullId,\n} from \"../../utils/utils\";\nimport { apiFeatureToPSVNode } from \"../../utils/picture\";\n\n// Photo Sphere Viewer imports\nimport \"@photo-sphere-viewer/core/index.css\";\nimport \"@photo-sphere-viewer/virtual-tour-plugin/index.css\";\nimport \"@photo-sphere-viewer/gallery-plugin/index.css\";\nimport \"@photo-sphere-viewer/markers-plugin/index.css\";\nimport { Viewer as PSViewer, CONSTANTS } from \"@photo-sphere-viewer/core\";\nimport { VirtualTourPlugin } from \"@photo-sphere-viewer/virtual-tour-plugin\";\nimport { MarkersPlugin } from \"@photo-sphere-viewer/markers-plugin\";\nimport PhotoAdapter from \"../../utils/PhotoAdapter\";\n\n\n// Default panorama (logo)\nconst BASE_PANORAMA = {\n\tbaseUrl: LoaderImgBase,\n\twidth: 1280,\n\tcols: 2,\n\trows: 1,\n\ttileUrl: () => null,\n};\nconst BASE_PANORAMA_NODE = {\n\tid: BASE_PANORAMA_ID,\n\tcaption: \"\",\n\tpanorama: BASE_PANORAMA,\n\tlinks: [],\n\tgps: [0,0],\n\tsequence: {},\n\tsphereCorrection: {},\n\thorizontalFov: 360,\n\tproperties: {},\n};\n\nexport const PSV_DEFAULT_ZOOM = 30; // eslint-disable-line import/no-unused-modules\nexport const PSV_ANIM_DURATION = 250;\nexport const PIC_MAX_STAY_DURATION = 3000;\n\nconst DRAW_ANNOT_1ST = \"draw-annotation-1\";\nconst DRAW_ANNOT_2ND = \"draw-annotation-2\";\nconst DRAW_ANNOT_RECT = \"draw-annotation-r\";\nconst DRAW_ANNOT_COLORS = {\n\tCORNER_STROKE: \"rgb(224, 64, 251)\",\n\tCORNER_FILL: \"rgb(224, 64, 251, 0.5)\",\n\tRECT_STROKE: \"rgb(123, 31, 162)\",\n\tRECT_FILL: \"rgba(123, 31, 162, 0.5)\",\n};\n\nPSViewer.useNewAnglesOrder = true;\n\n/**\n * Triggered once when the panorama image has been loaded and the viewer is ready to perform the first render.\n * @see {@link https://photo-sphere-viewer.js.org/guide/events.html#ready|Photo Sphere Viewer documentation}\n * @event Panoramax.components.ui.Photo#ready\n * @memberof Panoramax.components.ui.Photo\n * @type {Event}\n */\n\n/**\n * Photo is the component showing a single picture.\n * It uses Photo Sphere Viewer as a basis, and pre-configure dialog with STAC API.\n * \n * Note that all functions of [PhotoSphereViewer Viewer class](https://photo-sphere-viewer.js.org/api/classes/core.viewer) are available as well.\n * \n * @class Panoramax.components.ui.Photo\n * @extends [photo-sphere-viewer.core.Viewer](https://photo-sphere-viewer.js.org/api/classes/Core.Viewer.html)\n * @param {Panoramax.components.core.basic} parent The parent view\n * @param {Element} container The DOM element to create into\n * @param {object} [options] The viewer options. Can be any of [Photo Sphere Viewer options](https://photo-sphere-viewer.js.org/guide/config.html#standard-options)\n * @param {number} [options.transitionDuration] The number of milliseconds the transition animation should be.\n * @param {number[]} [options.position] Initial geographical coordinates (as [latitude, longitude]) to find picture nearby. Only used if no picture ID is set.\n * @param {function} [options.shouldGoFast] Function returning a boolean to indicate if we may skip loading HD images.\n * @param {string} [options.picturesNavigation=any] The allowed pictures navigation (\"any\": no restriction, \"seq\": only pictures in same sequence, \"pic\": only selected picture)\n * @param {boolean} [options.displayAnnotations=false] Should pictures annotations show up automatically if they are present ? Set to true to enable.\n * @fires Panoramax.components.ui.Photo#picture-loading\n * @fires Panoramax.components.ui.Photo#picture-preview-started\n * @fires Panoramax.components.ui.Photo#picture-preview-stopped\n * @fires Panoramax.components.ui.Photo#view-rotated\n * @fires Panoramax.components.ui.Photo#picture-loaded\n * @fires Panoramax.components.ui.Photo#picture-tiles-loaded\n * @fires Panoramax.components.ui.Photo#transition-duration-changed\n * @fires Panoramax.components.ui.Photo#sequence-playing\n * @fires Panoramax.components.ui.Photo#sequence-stopped\n * @fires Panoramax.components.ui.Photo#pictures-navigation-changed\n * @fires Panoramax.components.ui.Photo#ready\n * @fires Panoramax.components.ui.Photo#annotations-toggled\n * @fires Panoramax.components.ui.Photo#annotation-click\n * @fires Panoramax.components.ui.Photo#annotation-focused\n * @fires Panoramax.components.ui.Photo#annotations-unfocused\n * @example\n * const psv = new Panoramax.components.ui.Photo(viewer, psvNode, {transitionDuration: 500})\n */\nexport default class Photo extends PSViewer {\n\tconstructor(parent, container, options = {}) {\n\t\tsuper({\n\t\t\tcontainer,\n\t\t\tadapter: [PhotoAdapter, {\n\t\t\t\tshowErrorTile: false,\n\t\t\t\tbaseBlur: false,\n\t\t\t\tresolution: parent.isWidthSmall() ? 32 : 64,\n\t\t\t\tshouldGoFast: options?.shouldGoFast || (() => false),\n\t\t\t\tuseXmpData: false,\n\t\t\t}],\n\t\t\twithCredentials: parent.api._getPSVWithCredentials(),\n\t\t\trequestHeaders: parent?.[\"fetch-options\"]?.headers,\n\t\t\tpanorama: BASE_PANORAMA,\n\t\t\tlang: parent._t.psv,\n\t\t\tminFov: 5,\n\t\t\tloadingTxt: \"&nbsp;\",\n\t\t\tnavbar:\tnull,\n\t\t\trendererParameters: {\n\t\t\t\tpreserveDrawingBuffer: !parent.isWidthSmall(),\n\t\t\t},\n\t\t\tplugins: [\n\t\t\t\t[VirtualTourPlugin, {\n\t\t\t\t\tdataMode: \"server\",\n\t\t\t\t\tpositionMode: \"gps\",\n\t\t\t\t\trenderMode: \"3d\",\n\t\t\t\t\tpreload: true,\n\t\t\t\t\tgetNode: () => {},\n\t\t\t\t\ttransitionOptions: () => {},\n\t\t\t\t\tarrowsPosition: {\n\t\t\t\t\t\tlinkOverlapAngle: Math.PI / 6,\n\t\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\t[MarkersPlugin, {}],\n\t\t\t],\n\t\t\t...options\n\t\t});\n\n\t\tthis._parent = parent;\n\t\tthis._options = options;\n\t\tcontainer.classList.add(\"pnx-psv\");\n\t\tthis._shouldGoFast = options?.shouldGoFast || (() => false);\n\t\tthis._transitionDuration = options?.transitionDuration || PSV_ANIM_DURATION;\n\t\tthis._myVTour = this.getPlugin(VirtualTourPlugin);\n\t\tthis._myVTour.datasource.nodeResolver = this._getNodeFromAPI.bind(this);\n\t\tthis._myVTour.config.transitionOptions = this._psvNodeTransition.bind(this);\n\t\tthis._clearArrows = this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer);\n\t\tthis._myVTour.arrowsRenderer.clear = () => {};\n\t\tthis._myMarkers = this.getPlugin(MarkersPlugin);\n\t\tthis._annotationsVisible = this._options.displayAnnotations === true;\n\t\tthis._drawingAnnotation = null;\n\t\tthis._sequencePlaying = false;\n\t\tthis._picturesNavigation = this._options.picturesNavigation || \"any\";\n\n\t\t// Cache to find sequence ID for a single picture\n\t\tthis._picturesSequences = {};\n\n\t\t// Offer various custom events\n\t\tthis._myVTour.addEventListener(\"enter-arrow\", this._onEnterArrow.bind(this));\n\t\tthis._myVTour.addEventListener(\"leave-arrow\", this._onLeaveArrow.bind(this));\n\t\tthis._myVTour.addEventListener(\"node-changed\", this._onNodeChanged.bind(this));\n\t\tthis._myMarkers.addEventListener(\"select-marker\", this._onSelectMarker.bind(this));\n\t\tthis.addEventListener(\"position-updated\", this._onPositionUpdated.bind(this));\n\t\tthis.addEventListener(\"zoom-updated\", this._onZoomUpdated.bind(this));\n\t\tthis.addEventListener(\"dblclick\", this._onDoubleClick.bind(this));\n\t\tthis._parent.addEventListener(\"select\", this._onSelect.bind(this));\n\n\t\t// Fix for loader circle background not showing up\n\t\tthis.loader.size = 150;\n\t\tthis.loader.color = \"rgba(61, 61, 61, 0.5)\";\n\t\tthis.loader.textColor = \"rgba(255, 255, 255, 0.7)\";\n\t\tthis.loader.border = 5;\n\t\tthis.loader.thickness = 10;\n\t\tthis.loader.canvas.setAttribute(\"viewBox\", \"0 0 150 150\");\n\t\tthis.loader.__updateContent();\n\n\t\t// Handle initial parameters\n\t\tif(this._options.position && !this._parent.picture) {\n\t\t\tthis.goToPosition(...this._options.position);\n\t\t}\n\t}\n\n\t/**\n\t * Calls API to retrieve a certain picture, then transforms into PSV format\n\t *\n\t * @private\n\t * @param {string} picId The picture UUID\n\t * @returns {Promise} Resolves on PSV node metadata\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tasync _getNodeFromAPI(picId) {\n\t\tif(isNullId(picId)) { return BASE_PANORAMA_NODE; }\n\n\t\tconst picApiResponse = await fetch(\n\t\t\tthis._parent.api.getPictureMetadataUrl(picId, this._picturesSequences[picId]),\n\t\t\tthis._parent.api._getFetchOptions()\n\t\t);\n\t\tlet metadata = await picApiResponse.json();\n\n\t\tif(metadata.features) { metadata = metadata.features.pop(); }\n\t\tif(!metadata || Object.keys(metadata).length === 0 || !picApiResponse.ok) {\n\t\t\tif(this._parent.loader) {\n\t\t\t\tthis._parent.loader.dismiss(true, this._parent._t.pnx.error_pic);\n\t\t\t}\n\t\t\tthrow new Error(\"Picture with ID \" + picId + \" was not found\");\n\t\t}\n\n\t\tthis._picturesSequences[picId] = metadata.collection;\n\t\tconst node = apiFeatureToPSVNode(\n\t\t\tmetadata,\n\t\t\tthis._parent._t,\n\t\t\tthis._parent._isInternetFast,\n\t\t\tthis._picturesNavFilter.bind(this),\n\t\t\tthis._parent.api.cleanResourceURL.bind(this._parent.api)\n\t\t);\n\t\tif(node?.sequence?.prevPic) { this._picturesSequences[node?.sequence?.prevPic] = metadata.collection; }\n\t\tif(node?.sequence?.nextPic) { this._picturesSequences[node?.sequence?.nextPic] = metadata.collection; }\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * PSV node transition handler\n\t * @param {*} toNode Next loading node\n\t * @param {*} [fromNode] Currently shown node (previous)\n\t * @param {*} [fromLink] Link clicked by user to go from current to next node\n\t * @private\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_psvNodeTransition(toNode, fromNode, fromLink) {\n\t\tlet nodeTransition = {};\n\n\t\tconst animationDuration = this._shouldGoFast() ? 0 : Math.min(PSV_ANIM_DURATION, this._transitionDuration);\n\t\tconst animated = animationDuration > 100;\n\t\tconst following = (fromLink || fromNode?.links.find(a => a.nodeId == toNode.id)) != null;\n\t\tconst sameSequence = fromNode && toNode.sequence.id === fromNode.sequence.id;\n\t\tconst fromNodeHeading = (fromNode?.properties?.[\"view:azimuth\"] || 0) * (Math.PI / 180);\n\t\tconst toNodeHeading = (toNode?.properties?.[\"view:azimuth\"] || 0) * (Math.PI / 180);\n\t\tconst toNodeRelHeading = getRelativeHeading(toNode) * (Math.PI / 180);\n\n\t\tthis.setOption(\"maxFov\", Math.min(toNode.horizontalFov * 3/4, 90));\n\n\t\tconst forwardNoAnim = {\n\t\t\tshowLoader: false,\n\t\t\teffect: \"none\",\n\t\t\tspeed: 0,\n\t\t\trotation: false,\n\t\t\trotateTo: { pitch: 0, yaw: -toNodeRelHeading },\n\t\t\tzoomTo: PSV_DEFAULT_ZOOM\n\t\t};\n\n\t\t// Going to 360\n\t\tif(toNode.horizontalFov == 360) {\n\t\t\t// No previous sequence -> Point to center + no animation\n\t\t\tif(!fromNode) {\n\t\t\t\tnodeTransition = forwardNoAnim;\n\t\t\t}\n\t\t\t// Has a previous sequence\n\t\t\telse {\n\t\t\t\t// Far away sequences -> Point to center + no animation\n\t\t\t\tif(getDistance(fromNode.gps, toNode.gps) >= 0.001) {\n\t\t\t\t\tnodeTransition = forwardNoAnim;\n\t\t\t\t}\n\t\t\t\t// Nearby sequences -> Keep orientation\n\t\t\t\telse {\n\t\t\t\t\tnodeTransition = {\n\t\t\t\t\t\tspeed: animationDuration,\n\t\t\t\t\t\teffect: following && animated ? \"fade\" : \"none\",\n\t\t\t\t\t\trotation: following && sameSequence && animated,\n\t\t\t\t\t\trotateTo: this.getPosition()\n\t\t\t\t\t};\n\t\t\t\t\t// Constant direction related to North\n\t\t\t\t\t// nodeTransition.rotateTo.yaw += fromNodeHeading - toNodeHeading;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Going to flat\n\t\telse {\n\t\t\t// Same sequence -> Point to center + animation if following pics + not vomiting\n\t\t\tif(sameSequence) {\n\t\t\t\tconst fromYaw = this.getPosition().yaw;\n\t\t\t\tconst fovMaxYaw = (fromNode.horizontalFov * (Math.PI / 180)) / 2;\n\t\t\t\tconst keepZoomPos = fromYaw <= fovMaxYaw || fromYaw >= (2 * Math.PI - fovMaxYaw);\n\t\t\t\tconst notTooMuchRotation = Math.abs(fromNodeHeading - toNodeHeading) <= Math.PI / 4;\n\t\t\t\tnodeTransition = {\n\t\t\t\t\tspeed: animationDuration,\n\t\t\t\t\teffect: following && notTooMuchRotation && animated ? \"fade\" : \"none\",\n\t\t\t\t\trotation: following && notTooMuchRotation && animated,\n\t\t\t\t\trotateTo: keepZoomPos ? this.getPosition() : { pitch: 0, yaw: 0 },\n\t\t\t\t\tzoomTo: keepZoomPos ? this.getZoomLevel() :  PSV_DEFAULT_ZOOM,\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Different sequence -> Point to center + no animation\n\t\t\telse {\n\t\t\t\tnodeTransition = Object.assign(forwardNoAnim, {\n\t\t\t\t\trotateTo: { pitch: 0, yaw: 0 },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif(nodeTransition.effect === \"fade\" && nodeTransition.speed >= 150) {\n\t\t\tsetTimeout(this._clearArrows, nodeTransition.speed-100);\n\t\t}\n\t\telse {\n\t\t\tthis._clearArrows();\n\t\t}\n\n\n\t\t/**\n\t\t * Event for picture starting to load\n\t\t *\n\t\t * @event Panoramax.components.ui.Photo#picture-loading\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.picId The picture unique identifier\n\t\t * @property {number} detail.lon Longitude (WGS84)\n\t\t * @property {number} detail.lat Latitude (WGS84)\n\t\t * @property {number} detail.x New x position (in degrees, 0-360), corresponds to heading (0° = North, 90° = East, 180° = South, 270° = West)\n\t\t * @property {number} detail.y New y position (in degrees)\n\t\t * @property {number} detail.z New z position (0-100)\n\t\t * @property {boolean} detail.first True if first picture loaded\n\t\t */\n\t\tconst event = new CustomEvent(\"picture-loading\", {\n\t\t\tdetail: {\n\t\t\t\t...Object.assign({},\n\t\t\t\t\tthis.getXYZ(),\n\t\t\t\t\tnodeTransition.rotateTo ? { x: (toNodeHeading + nodeTransition.rotateTo.yaw) * 180 / Math.PI } : null,\n\t\t\t\t\tnodeTransition.zoomTo ? { z: nodeTransition.zoomTo } : null\n\t\t\t\t),\n\t\t\t\tpicId: toNode.id,\n\t\t\t\tlon: toNode.gps[0],\n\t\t\t\tlat: toNode.gps[1],\n\t\t\t\tfirst: this._parent._initParams?.getParentPostInit().picture == toNode.id,\n\t\t\t}\n\t\t});\n\t\tthis.dispatchEvent(event);\n\n\t\treturn nodeTransition;\n\t}\n\n\t/**\n\t * Event handler for PSV arrow hover.\n\t * It creates a custom event \"picture-preview-started\"\n\t * @private\n\t * @param {object} e The event data\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onEnterArrow(e) {\n\t\tconst fromLink = e.link;\n\t\tconst fromNode = e.node;\n\n\t\t// Find probable direction for previewed picture\n\t\tlet direction;\n\t\tif(fromNode) {\n\t\t\tif(fromNode.horizontalFov === 360) {\n\t\t\t\tdirection = (this.getPictureOriginalHeading() + this.getPosition().yaw * 180 / Math.PI) % 360;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdirection = this.getPictureOriginalHeading();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Event for picture preview\n\t\t *\n\t\t * @event Panoramax.components.ui.Photo#picture-preview-started\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.picId The picture ID\n\t\t * @property {number[]} detail.coordinates [x,y] coordinates\n\t\t * @property {number} detail.direction The theoretical picture orientation\n\t\t */\n\t\tconst event = new CustomEvent(\"picture-preview-started\", { detail: {\n\t\t\tpicId: fromLink.nodeId,\n\t\t\tcoordinates: fromLink.gps,\n\t\t\tdirection,\n\t\t}});\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Event handler for PSV arrow end of hovering.\n\t * It creates a custom event \"picture-preview-stopped\"\n\t * @private\n\t * @param {object} e The event data\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onLeaveArrow(e) {\n\t\tconst fromLink = e.link;\n\t\t\n\t\t/**\n\t\t * Event for end of picture preview\n\t\t * @event Panoramax.components.ui.Photo#picture-preview-stopped\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.picId The picture ID\n\t\t */\n\t\tconst event = new CustomEvent(\"picture-preview-stopped\", { detail: {\n\t\t\tpicId: fromLink.nodeId,\n\t\t}});\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Event handler for position update in PSV.\n\t * Allows to send a custom \"view-rotated\" event.\n\t * @private\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onPositionUpdated({position}) {\n\t\tconst pos = positionToXYZ(position, this.getZoomLevel());\n\t\tpos.x += this.getPictureOriginalHeading();\n\t\tpos.x = pos.x % 360;\n\n\t\t/**\n\t\t * Event for viewer rotation\n\t\t * @event Panoramax.components.ui.Photo#view-rotated\n\t\t * @type {CustomEvent}\n\t\t * @property {number} detail.x New x position (in degrees, 0-360), corresponds to heading (0° = North, 90° = East, 180° = South, 270° = West)\n\t\t * @property {number} detail.y New y position (in degrees)\n\t\t * @property {number} detail.z New Z position (between 0 and 100)\n\t\t */\n\t\tconst event = new CustomEvent(\"view-rotated\", { detail: pos });\n\t\tthis.dispatchEvent(event);\n\n\t\tthis._onTilesStartLoading();\n\t}\n\n\t/**\n\t * Event handler for zoom updates in PSV.\n\t * Allows to send a custom \"view-rotated\" event.\n\t * @private\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onZoomUpdated({zoomLevel}) {\n\t\tconst event = new CustomEvent(\"view-rotated\", { detail: { ...this.getXY(), z: zoomLevel} });\n\t\tthis.dispatchEvent(event);\n\n\t\tthis._onTilesStartLoading();\n\t}\n\n\t/**\n\t * Event handler for double click\n\t * @private\n\t */\n\t_onDoubleClick() {\n\t\tthis.unfocusAnnotation(false, true);\n\t}\n\n\t/**\n\t * Event handler for node change in PSV.\n\t * Allows to send a custom \"picture-loaded\" event.\n\t * @private\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onNodeChanged(e) {\n\t\t// Clean up clicked arrows\n\t\tfor(let d of document.getElementsByClassName(\"pnx-psv-tour-arrows\")) {\n\t\t\td.classList.remove(\"pnx-clicked\");\n\t\t}\n\t\t\n\t\tif(e.node.id) {\n\t\t\tconst isFirst = this._parent._initParams?.getParentPostInit().picture == e.node.id;\n\t\t\tthis._parent.select(e.node?.sequence?.id, e.node.id);\n\t\t\tconst picMeta = this.getPictureMetadata();\n\t\t\tif(!picMeta) {\n\t\t\t\tthis.dispatchEvent(new CustomEvent(\"picture-loaded\", {detail: {}}));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._prevSequence = picMeta.sequence.id;\n\n\t\t\t/**\n\t\t\t * Event for picture load (low-resolution image is loaded)\n\t\t\t * @event Panoramax.components.ui.Photo#picture-loaded\n\t\t\t * @type {CustomEvent}\n\t\t\t * @property {string} detail.picId The picture unique identifier\n\t\t\t * @property {number} detail.lon Longitude (WGS84)\n\t\t\t * @property {number} detail.lat Latitude (WGS84)\n\t\t\t * @property {number} detail.x New x position (in degrees, 0-360), corresponds to heading (0° = North, 90° = East, 180° = South, 270° = West)\n\t\t\t * @property {number} detail.y New y position (in degrees)\n\t\t\t * @property {number} detail.z New z position (0-100)\n\t\t\t * @property {boolean} detail.first True if first picture loaded\n\t\t\t */\n\t\t\tconst event = new CustomEvent(\"picture-loaded\", {\n\t\t\t\tdetail: {\n\t\t\t\t\t...this.getXYZ(),\n\t\t\t\t\tpicId: e.node.id,\n\t\t\t\t\tlon: picMeta.gps[0],\n\t\t\t\t\tlat: picMeta.gps[1],\n\t\t\t\t\tfirst: isFirst\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.dispatchEvent(event);\n\n\t\t\t// Change download URL\n\t\t\tif(picMeta.panorama.hdUrl) {\n\t\t\t\tthis.setOption(\"downloadUrl\", picMeta.panorama.hdUrl);\n\t\t\t\tthis.setOption(\"downloadName\", e.node.id+\".jpg\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.setOption(\"downloadUrl\", null);\n\t\t\t}\n\n\t\t\t// Show annotations\n\t\t\tif(this._annotationsVisible) {\n\t\t\t\tthis.toggleAllAnnotations(true);\n\t\t\t}\n\t\t}\n\n\t\tthis._onTilesStartLoading();\n\t}\n\n\t/**\n\t * Event handler for marker select\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @private\n\t */\n\t_onSelectMarker(e) {\n\t\tif(!e.marker) { return; }\n\t\tif(e.marker.id?.startsWith(\"annotation-\")) {\n\t\t\t// Check if there is no blocked focus on\n\t\t\tconst ba = this.getSelectedAnnotations().find(a => this._myMarkers.markers[\"annotation-\"+a]?.config?.data?.blockFocus);\n\t\t\tif(ba) { return; }\n\t\t\tthis.focusOnAnnotation(e.marker.data.id);\n\t\t}\n\t}\n\n\t/**\n\t * Event handler for loading a new range of tiles\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @private\n\t */\n\t_onTilesStartLoading() {\n\t\tif(this._tilesQueueTimer) {\n\t\t\tclearInterval(this._tilesQueueTimer);\n\t\t\tdelete this._tilesQueueTimer;\n\t\t}\n\t\tthis._tilesQueueTimer = setInterval(() => {\n\t\t\tif(Object.keys(this.adapter.queue.tasks).length === 0) {\n\t\t\t\tif(this._myVTour.state.currentNode) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Event launched when all visible tiles of a picture are loaded\n\t\t\t\t\t * @event Panoramax.components.ui.Photo#picture-tiles-loaded\n\t\t\t\t\t * @type {CustomEvent}\n\t\t\t\t\t * @property {string} detail.picId The picture unique identifier\n\t\t\t\t\t */\n\t\t\t\t\tconst event = new CustomEvent(\"picture-tiles-loaded\", { detail: { picId: this._myVTour.state.currentNode.id }});\n\t\t\t\t\tthis.dispatchEvent(event);\n\t\t\t\t}\n\t\t\t\tclearInterval(this._tilesQueueTimer);\n\t\t\t\tdelete this._tilesQueueTimer;\n\t\t\t}\n\t\t}, 100);\n\t}\n\n\t/**\n\t * Access currently shown picture metadata\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {object} Picture metadata\n\t */\n\tgetPictureMetadata() {\n\t\tif(isNullId(this._myVTour?.state?.currentNode?.id)) { return null; }\n\t\treturn this._myVTour.state.currentNode ? Object.assign({}, this._myVTour.state.currentNode) : null;\n\t}\n\n\t/**\n\t * Get current picture ID, or loading picture ID if any.\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {string|null} Picture ID (current or loading), or null if none is selected.\n\t */\n\tgetPictureId() {\n\t\tconst id = this._myVTour?.state?.loadingNode || this._myVTour?.state?.currentNode?.id;\n\t\treturn isNullId(id) ? null : id;\n\t}\n\n\t/**\n\t * Handler for select event.\n\t * @private\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\t_onSelect(e) {\n\t\tif(e.detail.seqId) {\n\t\t\tthis._picturesSequences[e.detail.picId] = e.detail.seqId;\n\t\t}\n\n\t\tif(e.detail.seqId && !e.detail.picId) {\n\t\t\t// Call API to find first picture ID in sequence\n\t\t\tthis.loader.show();\n\t\t\tthis._parent.api.getSequenceItems(e.detail.seqId, null, null, 1)\n\t\t\t\t.then(data => {\n\t\t\t\t\tif(data?.features?.length > 0) {\n\t\t\t\t\t\tconst picId = data.features[0].id;\n\t\t\t\t\t\tthis._picturesSequences[picId] = e.detail.seqId;\n\t\t\t\t\t\tthis._parent.select(e.detail.seqId, picId);\n\t\t\t\t\t}\n\t\t\t\t}).catch(e => this.showErrorOverlay(e, this._parent._t.pnx.error_pic, true));\n\t\t}\n\t\telse if(!e.detail.picId) {\n\t\t\tthis._myVTour.setCurrentNode(null);\n\t\t\tthis._myVTour.state.currentNode.id = null;\n\t\t\tthis._myVTour.state.loadingNode = null;\n\t\t}\n\t\telse if(this.getPictureId() !== e.detail.picId) {\n\t\t\tthis.loader.show();\n\t\t\tthis._myVTour.setCurrentNode(e.detail.picId).catch(e => {\n\t\t\t\tthis.showErrorOverlay(e, this._parent._t.pnx.error_pic, true);\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Displays next picture in current sequence (if any)\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @throws {Error} If no picture is selected, or no next picture available\n\t */\n\tgoToNextPicture() {\n\t\tif(!this.getPictureMetadata()) {\n\t\t\tthrow new Error(\"No picture currently selected\");\n\t\t}\n\n\t\tif(this._picturesNavigation == \"pic\") {\n\t\t\tthrow new Error(\"Pictures navigation is locked to current picture\");\n\t\t}\n\n\t\tconst next = this.getPictureMetadata().sequence.nextPic;\n\t\tif(next) {\n\t\t\tthis._parent.select(this.getPictureMetadata().sequence.id, next);\n\t\t}\n\t\telse {\n\t\t\tthrow new Error(\"No next picture available\");\n\t\t}\n\t}\n\n\t/**\n\t * Displays previous picture in current sequence (if any)\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @throws {Error} If no picture is selected, or no previous picture available\n\t */\n\tgoToPrevPicture() {\n\t\tif(!this.getPictureMetadata()) {\n\t\t\tthrow new Error(\"No picture currently selected\");\n\t\t}\n\n\t\tif(this._picturesNavigation == \"pic\") {\n\t\t\tthrow new Error(\"Pictures navigation is locked to current picture\");\n\t\t}\n\n\t\tconst prev = this.getPictureMetadata().sequence.prevPic;\n\t\tif(prev) {\n\t\t\tthis._parent.select(this.getPictureMetadata().sequence.id, prev);\n\t\t}\n\t\telse {\n\t\t\tthrow new Error(\"No previous picture available\");\n\t\t}\n\t}\n\n\t/**\n\t * Displays in viewer a picture near to given coordinates\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @param {number} lat Latitude (WGS84)\n\t * @param {number} lon Longitude (WGS84)\n\t * @returns {Promise}\n\t * @fulfil {string} Picture ID if picture found\n\t * @reject {Error} If no picture found\n\t */\n\tasync goToPosition(lat, lon) {\n\t\tif(this._picturesNavigation == \"pic\") {\n\t\t\tthrow new Error(\"Pictures navigation is locked to current picture\");\n\t\t}\n\t\t\n\t\treturn this._parent.api.getPicturesAroundCoordinates(lat, lon)\n\t\t\t.then(res => {\n\t\t\t\tif(res.features.length > 0) {\n\t\t\t\t\tconst f = res.features.pop();\n\t\t\t\t\tthis._parent.select(\n\t\t\t\t\t\tf?.collection,\n\t\t\t\t\t\tf.id\n\t\t\t\t\t);\n\t\t\t\t\treturn f.id;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn Promise.reject(new Error(\"No picture found nearby given coordinates\"));\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\t/**\n\t * Get 2D position of sphere currently shown to user\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {object} Position in format { x: heading in degrees (0° = North, 90° = East, 180° = South, 270° = West), y: top/bottom position in degrees (-90° = bottom, 0° = front, 90° = top) }\n\t */\n\tgetXY() {\n\t\tconst pos = positionToXYZ(this.getPosition());\n\t\tpos.x = (pos.x + this.getPictureOriginalHeading()) % 360;\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Get 3D position of sphere currently shown to user\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {object} Position in format { x: heading in degrees (0° = North, 90° = East, 180° = South, 270° = West), y: top/bottom position in degrees (-90° = bottom, 0° = front, 90° = top), z: zoom (0 = wide, 100 = zoomed in) }\n\t */\n\tgetXYZ() {\n\t\tconst pos = this.getXY();\n\t\tpos.z = this.getZoomLevel();\n\t\treturn pos;\n\t}\n\n\t/**\n\t * Get capture orientation of current picture, based on its GPS.\n\t * @returns {number} Picture original heading in degrees (0 to 360°)\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tgetPictureOriginalHeading() {\n\t\treturn this.getPictureMetadata()?.properties?.[\"view:azimuth\"] || 0;\n\t}\n\n\t/**\n\t * Computes the relative heading of currently selected picture.\n\t * This gives the angle of capture compared to sequence path (vehicle movement).\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {number} Relative heading in degrees (-180 to 180)\n\t */\n\tgetPictureRelativeHeading() {\n\t\treturn getRelativeHeading(this.getPictureMetadata());\n\t}\n\n\t/**\n\t * Clears the Photo Sphere Viewer metadata cache.\n\t * It is useful when current picture or sequence has changed server-side after first load.\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tclearPictureMetadataCache() {\n\t\tconst oldPicId = this.getPictureMetadata()?.id;\n\t\tconst oldSeqId = this.getPictureMetadata()?.sequence?.id;\n\n\t\t// Force deletion of cached metadata in PSV\n\t\tthis._myVTour.state.currentTooltip?.hide();\n\t\tthis._myVTour.state.currentTooltip = null;\n\t\tthis._myVTour.state.currentNode = null;\n\t\tthis._myVTour.state.preload = {};\n\t\tthis._myVTour.datasource.nodes = {};\n\n\t\t// Reload current picture if one was selected\n\t\tif(oldPicId) {\n\t\t\tthis._parent.select(oldSeqId, oldPicId);\n\t\t}\n\t}\n\n\t/**\n\t * Change the shown position in picture\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @param {number} x X position (in degrees)\n\t * @param {number} y Y position (in degrees)\n\t * @param {number} z Z position (0-100)\n\t */\n\tsetXYZ(x, y, z) {\n\t\tconst coords = xyzToPosition(x - this.getPictureOriginalHeading(), y, z);\n\t\tthis.rotate({ yaw: coords.yaw, pitch: coords.pitch });\n\t\tthis.zoom(coords.zoom);\n\t}\n\n\t/**\n\t * Enable or disable higher contrast on picture\n\t * @param {boolean} enable True to enable higher contrast\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tsetHigherContrast(enable) {\n\t\tthis.renderer.renderer.toneMapping = enable ? 3 : 0;\n\t\tthis.renderer.renderer.toneMappingExposure = enable ? 2 : 1;\n\t\tthis.needsUpdate();\n\t}\n\n\t/**\n\t * Get the duration of stay on a picture during a sequence play.\n\t * @returns {number} The duration (in milliseconds)\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tgetTransitionDuration() {\n\t\treturn this._transitionDuration;\n\t}\n\n\t/**\n\t * Changes the duration of stay on a picture during a sequence play.\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @param {number} value The new duration (in milliseconds, between 100 and 3000)\n\t */\n\tsetTransitionDuration(value) {\n\t\tvalue = parseFloat(value);\n\t\tif(value < 100 || value > PIC_MAX_STAY_DURATION) {\n\t\t\tthrow new Error(\"Invalid transition duration (should be between 100 and \"+PIC_MAX_STAY_DURATION+\")\");\n\t\t}\n\t\tthis._transitionDuration = value;\n\n\t\t/**\n\t\t * Event for transition duration change\n\t\t * @event Panoramax.components.ui.Photo#transition-duration-changed\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.duration New duration (in milliseconds)\n\t\t */\n\t\tconst event = new CustomEvent(\"transition-duration-changed\", { detail: { value } });\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/** @private */\n\tsetPanorama(path, options) {\n\t\tif(path.baseUrl.startsWith(\"data:\")) { return Promise.resolve(); }\n\n\t\tconst onFailure = e => this.showErrorOverlay(e, this._parent?._t.pnx.error_pic, true);\n\t\ttry {\n\t\t\treturn super.setPanorama(path, options).catch(onFailure);\n\t\t}\n\t\tcatch(e) {\n\t\t\tonFailure(e);\n\t\t}\n\t}\n\n\t/**\n\t * Display an error message to user on screen\n\t * @param {object} e The initial error\n\t * @param {str} label The main error label to display\n\t * @param {boolean} dissmisable Is error dissmisable\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tshowErrorOverlay(e, label, dissmisable) {\n\t\tif(this._parent?.loader.isVisible() || !this.overlay.isVisible()) {\n\t\t\tthis._parent?.loader.dismiss(\n\t\t\t\te,\n\t\t\t\tlabel,\n\t\t\t\tdissmisable ? () => {\n\t\t\t\t\tthis._parent?.loader.dismiss();\n\t\t\t\t\tthis.overlay.hide();\n\t\t\t\t} : undefined\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\tconsole.error(e);\n\t\t\tthis.overlay.show({\n\t\t\t\timage: `<img style=\"width: 200px\" src=\"${LogoDead}\" alt=\"\" />`,\n\t\t\t\ttitle: this._parent?._t.pnx.error, \n\t\t\t\ttext: label + \"<br />\" + this._parent?._t.pnx.error_click,\n\t\t\t\tdissmisable,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Goes continuously to next picture in sequence as long as possible\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tplaySequence() {\n\t\tthis._sequencePlaying = true;\n\t\tthis.container.classList.add(\"pnx-psv-playing\");\n\n\t\t/**\n\t\t * Event for sequence starting to play\n\t\t * @event Panoramax.components.ui.Photo#sequence-playing\n\t\t * @type {CustomEvent}\n\t\t */\n\t\tconst event = new Event(\"sequence-playing\", {bubbles: true, composed: true});\n\t\tthis.dispatchEvent(event);\n\n\t\tconst nextPicturePlay = () => {\n\t\t\tif(this._sequencePlaying) {\n\t\t\t\tthis.addEventListener(\"picture-loaded\", () => {\n\t\t\t\t\tthis._playTimer = setTimeout(() => {\n\t\t\t\t\t\tnextPicturePlay();\n\t\t\t\t\t}, this.getTransitionDuration());\n\t\t\t\t}, { once: true });\n\n\t\t\t\ttry {\n\t\t\t\t\tthis.goToNextPicture();\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tthis.stopSequence();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Stop playing if user clicks on image\n\t\tthis.addEventListener(\"click\", () => this.stopSequence());\n\n\t\tnextPicturePlay();\n\t}\n\n\t/**\n\t * Stops playing current sequence\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tstopSequence() {\n\t\tthis._sequencePlaying = false;\n\t\tthis.container.classList.remove(\"pnx-psv-playing\");\n\n\t\t// Next picture timer is pending\n\t\tif(this._playTimer) {\n\t\t\tclearTimeout(this._playTimer);\n\t\t\tdelete this._playTimer;\n\t\t}\n\n\t\t// Force refresh of PSV to eventually load tiles\n\t\tthis.forceRefresh();\n\n\t\t/**\n\t\t * Event for sequence stopped playing\n\t\t * @event Panoramax.components.ui.Photo#sequence-stopped\n\t\t * @type {CustomEvent}\n\t\t */\n\t\tconst event = new Event(\"sequence-stopped\", {bubbles: true, composed: true});\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Is there any sequence being played right now ?\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @returns {boolean} True if sequence is playing\n\t */\n\tisSequencePlaying() {\n\t\treturn this._sequencePlaying;\n\t}\n\n\t/**\n\t * Starts/stops the reading of pictures in a sequence\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\ttoggleSequencePlaying() {\n\t\tif(this.isSequencePlaying()) {\n\t\t\tthis.stopSequence();\n\t\t}\n\t\telse {\n\t\t\tthis.playSequence();\n\t\t}\n\t}\n\n\t/**\n\t * Get current pictures navigation mode.\n\t * @returns {string} The picture navigation mode (\"any\": no restriction, \"seq\": only pictures in same sequence, \"pic\": only selected picture)\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tgetPicturesNavigation() {\n\t\treturn this._picturesNavigation;\n\t}\n\n\t/**\n\t * Switch the allowed navigation between pictures.\n\t * @param {string} pn The picture navigation mode (\"any\": no restriction, \"seq\": only pictures in same sequence, \"pic\": only selected picture)\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tsetPicturesNavigation(pn) {\n\t\tif(pn === \"none\") { pn = \"pic\"; }\n\t\tthis._picturesNavigation = pn;\n\n\t\t// Immediate switch of navigation arrows\n\t\tconst arrows = this.container.querySelector(\".psv-virtual-tour-arrows\");\n\t\tif(arrows) {\n\t\t\tarrows.style.display = pn == \"pic\" ? \"none\" : null;\n\t\t}\n\n\t\t/**\n\t\t * Event for pictures navigation mode change\n\t\t * @event Panoramax.components.ui.Photo#pictures-navigation-changed\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.value New mode (any, pic, seq)\n\t\t */\n\t\tconst event = new CustomEvent(\"pictures-navigation-changed\", { detail: { value: pn } });\n\t\tthis.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Filter function\n\t * @param {object} link A STAC next/prev/related link definition\n\t * @returns {boolean} True if link should be kept\n\t * @private\n\t */\n\t_picturesNavFilter(link) {\n\t\tswitch(this._picturesNavigation) {\n\t\tcase \"seq\":\n\t\t\treturn [\"next\", \"prev\"].includes(link.rel);\n\t\tcase \"pic\":\n\t\tcase \"none\":\n\t\t\treturn false;\n\t\tcase \"any\":\n\t\tdefault:\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t/**\n\t * Are there any picture annotations shown ?\n\t * @returns {boolean} True if annotations are visible\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tareAnnotationsVisible() {\n\t\treturn this._annotationsVisible;\n\t}\n\n\t/**\n\t * Get all selected annotations\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @return {string[]} List of selected annotations IDs\n\t */\n\tgetSelectedAnnotations() {\n\t\treturn Object.keys(this._myMarkers.markers)\n\t\t\t.filter(id => id.startsWith(\"annotation-\") && this._myMarkers.markers[id]?.config?.data?.selected)\n\t\t\t.map(id => id.replace(\"annotation-\", \"\"));\n\t}\n\n\t/**\n\t * Toggle visibility of picture annotations\n\t * @param {boolean} visible True to make visible, false to hide\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\ttoggleAllAnnotations(visible) {\n\t\tconst meta = this.getPictureMetadata();\n\t\tconst skipEvent = this._annotationsVisible == visible;\n\t\tif(!meta) {\n\t\t\tthis._myMarkers.clearMarkers();\n\t\t\tthrow new Error(\"No picture currently selected\");\n\t\t}\n\n\t\tif(!visible) { this._myMarkers.clearMarkers(); }\n\t\telse {\n\t\t\tlet annotations = meta.properties.annotations || [];\n\t\t\tif(annotations?.length === 0) { console.warn(\"No annotation available on picture\", meta.id); }\n\n\t\t\tannotations = annotations.map(a => {\n\t\t\t\t// Get original HD picture dimensions\n\t\t\t\tconst origPicDim = meta.properties[\"pers:interior_orientation\"].sensor_array_dimensions;\n\n\t\t\t\tif(!origPicDim) {\n\t\t\t\t\tconsole.warn(\"Picture lacks pers:interior_orientation.sensor_array_dimensions property, can't compute marker\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst shape = a.shape.coordinates.map(c1 => c1.map(c2 => {\n\t\t\t\t\tconst crop = meta.panorama?.cropData;\n\t\t\t\t\tconst tc = {\n\t\t\t\t\t\ttextureX: c2[0] + (crop?.croppedX || 0),\n\t\t\t\t\t\ttextureY: c2[1] + (crop?.croppedY || 0)\n\t\t\t\t\t};\n\t\t\t\t\treturn this.dataHelper.textureCoordsToSphericalCoords(tc);\n\t\t\t\t}));\n\n\t\t\t\treturn {\n\t\t\t\t\tid: `annotation-${a.id}`,\n\t\t\t\t\tpolygon: shape,\n\t\t\t\t\tdata: { id: a.id },\n\t\t\t\t\tclassName: \"pnx-psv-annotation\",\n\t\t\t\t\tsvgStyle: {\n\t\t\t\t\t\tstroke: \"var(--orange)\",\n\t\t\t\t\t\tstrokeWidth: \"3px\",\n\t\t\t\t\t\tfill: \"var(--orange-transparent)\",\n\t\t\t\t\t\tcursor: \"pointer\",\n\t\t\t\t\t},\n\t\t\t\t\ttooltip: this._parent._t.pnx.semantics_annotation_tooltip,\n\t\t\t\t};\n\t\t\t});\n\t\t\tthis._myMarkers.setMarkers(annotations);\n\t\t}\n\n\t\tthis._annotationsVisible = visible;\n\n\t\t/**\n\t\t * Event for pictures annotation visibility change\n\t\t * @event Panoramax.components.ui.Photo#annotations-toggled\n\t\t * @type {CustomEvent}\n\t\t * @property {boolean} detail.visible True if they are visible\n\t\t */\n\t\tif(!skipEvent) {\n\t\t\tthis.dispatchEvent(new CustomEvent(\"annotations-toggled\", { detail: { visible } }));\n\t\t}\n\t}\n\t\n\t/**\n\t * Make view centered and zoomed on given annotation.\n\t * @param {string} id The annotation UUID\n\t * @param {boolean} [blockFocus=false] Set to true to disable user unselect\n\t * @param {boolean} [skipEvent=false] Set to true to avoid launching annotation-focused event\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tfocusOnAnnotation(id, blockFocus = false, skipEvent = false) {\n\t\t// Check if given annotation is not already focused\n\t\tconst selected = this.getSelectedAnnotations();\n\t\tif(id && selected.length === 1 && selected[0] === id) { return; }\n\n\t\t// Show annotations if they are hidden\n\t\tif(!this.areAnnotationsVisible()) { this.toggleAllAnnotations(true); }\n\t\tthis.unfocusAnnotation(true);\n\n\t\t// Check if annotations exists\n\t\tconst annotationId = `annotation-${id}`;\n\t\tif(!this._myMarkers.markers[annotationId]) {\n\t\t\t// Wait for it to be visible\n\t\t\tsetTimeout(() => this.focusOnAnnotation(id, blockFocus, skipEvent), 100);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._myMarkers.updateMarker({\n\t\t\tid: annotationId,\n\t\t\tsvgStyle: {\n\t\t\t\tstroke: \"var(--red)\",\n\t\t\t\tstrokeWidth: \"3px\",\n\t\t\t\tfill: \"var(--red-transparent)\",\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tselected: true,\n\t\t\t\tblockFocus\n\t\t\t}\n\t\t});\n\t\tthis._myMarkers.gotoMarker(annotationId, 0);\n\t\tthis.zoom(65);\n\n\t\t/**\n\t\t * Event launched on annotation focus\n\t\t * @event Panoramax.components.ui.Photo#annotation-focused\n\t\t * @type {CustomEvent}\n\t\t * @property {string} detail.annotationId The annotation UUID\n\t\t */\n\t\tif(!skipEvent) {\n\t\t\tconst event = new CustomEvent(\"annotation-focused\", { detail: { annotationId: id }});\n\t\t\tthis.dispatchEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Remove focus styling on annotations.\n\t * @memberof Panoramax.components.ui.Photo#\n\t * @param {boolean} [skipEvent=false] Set to true to avoid launching annotations-unfocused event\n\t * @param {boolean} [skipBlocked=false] Set to true to not unfocus blocked annotations\n\t */\n\tunfocusAnnotation(skipEvent = false, skipBlocked = false) {\n\t\tconst selectedAnnotations = this.getSelectedAnnotations();\n\t\t\n\t\tif(selectedAnnotations.length > 0) {\n\t\t\tlet allBlocked = 0;\n\t\t\tselectedAnnotations.forEach(id => {\n\t\t\t\tconst aid = \"annotation-\"+id;\n\t\t\t\tif(skipBlocked && this._myMarkers.markers[aid]?.config?.data?.blockFocus) {\n\t\t\t\t\tallBlocked++;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\tid: aid,\n\t\t\t\t\tsvgStyle: {\n\t\t\t\t\t\tstroke: \"var(--orange)\",\n\t\t\t\t\t\tstrokeWidth: \"3px\",\n\t\t\t\t\t\tfill: \"var(--orange-transparent)\",\n\t\t\t\t\t},\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tselected: false,\n\t\t\t\t\t\tblockFocus: false,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tif(!skipEvent && allBlocked < selectedAnnotations.length) {\n\t\t\t\t/**\n\t\t\t\t * Event for pictures annotation unfocus\n\t\t\t\t * @event Panoramax.components.ui.Photo#annotations-unfocused\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.dispatchEvent(new Event(\"annotations-unfocused\"));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Starts the drawing of a user-defined annotation.\n\t */\n\tstartDrawAnnotation() {\n\t\tthis.toggleAllAnnotations(false);\n\t\tthis._drawingAnnotation = [];\n\t\tthis._drawingMoves = 0;\n\n\t\t// Preview rectangle\n\t\tthis._myMarkers.addMarker({\n\t\t\tid: DRAW_ANNOT_RECT,\n\t\t\tpolygon: [{yaw: 0, pitch: 0}, {yaw: 0, pitch: 0}, {yaw: 0, pitch: 0}],\n\t\t\tsvgStyle: {\n\t\t\t\tfill: DRAW_ANNOT_COLORS.RECT_FILL,\n\t\t\t\tstroke: DRAW_ANNOT_COLORS.RECT_STROKE,\n\t\t\t\tstrokeWidth: \"2px\"\n\t\t\t},\n\t\t\tvisible: false,\n\t\t});\n\n\t\t// First point\n\t\tthis._myMarkers.addMarker({\n\t\t\tid: DRAW_ANNOT_1ST,\n\t\t\tcircle: 5,\n\t\t\tposition: {yaw: 0, pitch: 0},\n\t\t\tstyle: {\n\t\t\t\tcursor: \"pointer\",\n\t\t\t},\n\t\t\tsvgStyle: {\n\t\t\t\tfill: DRAW_ANNOT_COLORS.CORNER_FILL,\n\t\t\t\tstroke: DRAW_ANNOT_COLORS.CORNER_STROKE,\n\t\t\t\tstrokeWidth: \"3px\"\n\t\t\t}\n\t\t});\n\n\t\t// Second point\n\t\tthis._myMarkers.addMarker({\n\t\t\tid: DRAW_ANNOT_2ND,\n\t\t\tcircle: 5,\n\t\t\tposition: {yaw: 0, pitch: 0},\n\t\t\tstyle: {\n\t\t\t\tcursor: \"pointer\",\n\t\t\t},\n\t\t\tsvgStyle: {\n\t\t\t\tfill: DRAW_ANNOT_COLORS.CORNER_FILL,\n\t\t\t\tstroke: DRAW_ANNOT_COLORS.CORNER_STROKE,\n\t\t\t\tstrokeWidth: \"3px\"\n\t\t\t},\n\t\t\tvisible: false,\n\t\t});\n\n\t\t// First vertex move handler\n\t\tconst firstMove = e => {\n\t\t\tconst pos = this.getPositionFromEvent(e);\n\t\t\tif(pos && this._myMarkers.markers[DRAW_ANNOT_1ST]) {\n\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\tid: DRAW_ANNOT_1ST,\n\t\t\t\t\tposition: pos,\n\t\t\t\t\tstyle: { cursor: \"grab\" },\n\t\t\t\t});\n\n\t\t\t\tif(this._drawingAnnotation.length == 2 && this._myMarkers.markers[DRAW_ANNOT_RECT]) {\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_RECT,\n\t\t\t\t\t\tpolygon: [\n\t\t\t\t\t\t\tpos,\n\t\t\t\t\t\t\t{ yaw: pos.yaw, pitch: this._drawingAnnotation[1].pitch },\n\t\t\t\t\t\t\tthis._drawingAnnotation[1],\n\t\t\t\t\t\t\t{ yaw: this._drawingAnnotation[1].yaw, pitch: pos.pitch }\n\t\t\t\t\t\t],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Second vertex move handler\n\t\tconst secMove = e => {\n\t\t\tconst pos = this.getPositionFromEvent(e);\n\t\t\tif(pos && this._myMarkers.markers[DRAW_ANNOT_2ND]) {\n\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\tid: DRAW_ANNOT_2ND,\n\t\t\t\t\tposition: pos,\n\t\t\t\t\tstyle: { cursor: \"grab\" },\n\t\t\t\t});\n\n\t\t\t\tif(this._drawingAnnotation.length >= 1 && this._myMarkers.markers[DRAW_ANNOT_RECT]) {\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_RECT,\n\t\t\t\t\t\tpolygon: [\n\t\t\t\t\t\t\tthis._drawingAnnotation[0],\n\t\t\t\t\t\t\t{ yaw: this._drawingAnnotation[0].yaw, pitch: pos.pitch },\n\t\t\t\t\t\t\tpos,\n\t\t\t\t\t\t\t{ yaw: pos.yaw, pitch: this._drawingAnnotation[0].pitch }\n\t\t\t\t\t\t],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis._drawListeners = [firstMove, secMove];\n\t\tthis.parent.addEventListener(\"mousemove\", firstMove);\n\t\tthis._drawingMoves = 1;\n\n\t\t// Handle click\n\t\tthis._drawListenerClick = e => {\n\t\t\tlet sendRectEvent = false;\n\n\t\t\t// Click on first vertex\n\t\t\tif(this._drawingMoves !== 2 && e.marker.id === DRAW_ANNOT_1ST) {\n\t\t\t\t// First time ? Start moving second vertex\n\t\t\t\tif(this._drawingAnnotation.length == 0) {\n\t\t\t\t\tthis._drawingAnnotation.push({ yaw: e.marker.config.position.yaw, pitch: e.marker.config.position.pitch });\n\t\t\t\t\tthis.parent.removeEventListener(\"mousemove\", firstMove);\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_1ST,\n\t\t\t\t\t\tstyle: { cursor: \"pointer\" },\n\t\t\t\t\t});\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_2ND,\n\t\t\t\t\t\tvisible: true,\n\t\t\t\t\t\tposition: { yaw: e.marker.config.position.yaw, pitch: e.marker.config.position.pitch },\n\t\t\t\t\t});\n\t\t\t\t\tthis._myMarkers.updateMarker({ id: DRAW_ANNOT_RECT, visible: true });\n\t\t\t\t\tthis.parent.addEventListener(\"mousemove\", secMove);\n\t\t\t\t\tthis._drawingMoves = 2;\n\t\t\t\t}\n\t\t\t\t// Not moving ? start moving\n\t\t\t\telse if(this._drawingMoves === 0) {\n\t\t\t\t\tthis.parent.addEventListener(\"mousemove\", firstMove);\n\t\t\t\t\tthis._drawingMoves = 1;\n\t\t\t\t}\n\t\t\t\t// Moving ? Update 1st rectangle coordinates\n\t\t\t\telse {\n\t\t\t\t\tthis._drawingAnnotation[0] = { yaw: e.marker.config.position.yaw, pitch: e.marker.config.position.pitch };\n\t\t\t\t\tthis.parent.removeEventListener(\"mousemove\", firstMove);\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_1ST,\n\t\t\t\t\t\tstyle: { cursor: \"pointer\" },\n\t\t\t\t\t});\n\t\t\t\t\tthis._drawingMoves = 0;\n\t\t\t\t\tsendRectEvent = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Click on second vertex\n\t\t\telse if(this._drawingMoves !== 1 && e.marker.id === DRAW_ANNOT_2ND) {\n\t\t\t\t// First time ? Fix rectangle\n\t\t\t\tif(this._drawingAnnotation.length == 1) {\n\t\t\t\t\tthis._drawingAnnotation.push({ yaw: e.marker.config.position.yaw, pitch: e.marker.config.position.pitch });\n\t\t\t\t\tthis.parent.removeEventListener(\"mousemove\", secMove);\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_2ND,\n\t\t\t\t\t\tstyle: { cursor: \"pointer\" },\n\t\t\t\t\t});\n\t\t\t\t\tthis._drawingMoves = 0;\n\t\t\t\t\tsendRectEvent = true;\n\t\t\t\t}\n\t\t\t\t// Vertex moving ? Update 2nd rectangle coordinates\n\t\t\t\telse if(this._drawingMoves === 2) {\n\t\t\t\t\tthis._drawingAnnotation[1] = { yaw: e.marker.config.position.yaw, pitch: e.marker.config.position.pitch };\n\t\t\t\t\tthis.parent.removeEventListener(\"mousemove\", secMove);\n\t\t\t\t\tthis._myMarkers.updateMarker({\n\t\t\t\t\t\tid: DRAW_ANNOT_2ND,\n\t\t\t\t\t\tstyle: { cursor: \"pointer\" },\n\t\t\t\t\t});\n\t\t\t\t\tthis._drawingMoves = 0;\n\t\t\t\t\tsendRectEvent = true;\n\t\t\t\t}\n\t\t\t\t// Otherwise, start moving vertex\n\t\t\t\telse {\n\t\t\t\t\tthis.parent.addEventListener(\"mousemove\", secMove);\n\t\t\t\t\tthis._drawingMoves = 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Send valid rectangle through event\n\t\t\tif(sendRectEvent) {\n\t\t\t\t// Get texture coordinates (corresponding to a full 360° sphere)\n\t\t\t\tconst minxy = this.dataHelper.sphericalCoordsToTextureCoords(this._drawingAnnotation[0]);\n\t\t\t\tconst maxxy = this.dataHelper.sphericalCoordsToTextureCoords(this._drawingAnnotation[1]);\n\t\t\t\tlet shape = [\n\t\t\t\t\tminxy.textureX,\n\t\t\t\t\tminxy.textureY,\n\t\t\t\t\tmaxxy.textureX,\n\t\t\t\t\tmaxxy.textureY\n\t\t\t\t];\n\n\t\t\t\t// Re-compute original texture coordinates (flat or cropped images)\n\t\t\t\tconst crop = this.getPictureMetadata()?.panorama?.cropData;\n\t\t\t\tif(crop) {\n\t\t\t\t\tshape[0] -= crop.croppedX;\n\t\t\t\t\tshape[1] -= crop.croppedY;\n\t\t\t\t\tshape[2] -= crop.croppedX;\n\t\t\t\t\tshape[3] -= crop.croppedY;\n\n\t\t\t\t\t// Check if annotations doesn't go outside of picture\n\t\t\t\t\tif(shape[0] < 0 || shape[0] > crop.croppedWidth) { shape = null; }\n\t\t\t\t\telse if(shape[1] < 0 || shape[1] > crop.croppedHeight) { shape = null; }\n\t\t\t\t\telse if(shape[2] < 0 || shape[2] > crop.croppedWidth) { shape = null; }\n\t\t\t\t\telse if(shape[3] < 0 || shape[3] > crop.croppedHeight) { shape = null; }\n\t\t\t\t}\n\n\t\t\t\t// Check coordinates order\n\t\t\t\tif(shape[0] >= shape[2] && shape[1] >= shape[3]) {\n\t\t\t\t\tlet maxx = shape[0];\n\t\t\t\t\tlet minx = shape[2];\n\t\t\t\t\tlet maxy = shape[1];\n\t\t\t\t\tlet miny = shape[3];\n\t\t\t\t\tshape = [minx, miny, maxx, maxy];\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Event for annotation drawn\n\t\t\t\t *\n\t\t\t\t * @event Panoramax.components.ui.Photo#annotation-drawn\n\t\t\t\t * @type {CustomEvent}\n\t\t\t\t * @property {string} detail.shape The annotation geometry, or null if latest draw is invalid\n\t\t\t\t */\n\t\t\t\tconst event = new CustomEvent(\"annotation-drawn\", {\n\t\t\t\t\tdetail: { shape }\n\t\t\t\t});\n\t\t\t\tthis.dispatchEvent(event);\n\t\t\t}\n\t\t};\n\t\tthis._myMarkers.addEventListener(\"select-marker\", this._drawListenerClick);\n\t}\n\n\t/**\n\t * Keeps currently drawn annotation, but without possibility to edit it.\n\t * Useful for previewing during tag editing.\n\t */\n\tfixDrawAnnotation() {\n\t\t[DRAW_ANNOT_1ST, DRAW_ANNOT_2ND].forEach(mid => {\n\t\t\ttry { this._myMarkers.removeMarker(mid); }\n\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t});\n\t\t(this._drawListeners || []).forEach(l => this.parent.removeEventListener(\"mousemove\", l));\n\t\tthis._myMarkers.removeEventListener(\"select-marker\", this._drawListenerClick);\n\t\tthis._myMarkers.updateMarker({\n\t\t\tid: DRAW_ANNOT_RECT,\n\t\t\tsvgStyle: {\n\t\t\t\tstroke: \"var(--red)\",\n\t\t\t\tstrokeWidth: \"3px\",\n\t\t\t\tfill: \"var(--red-transparent)\",\n\t\t\t\tcursor: \"pointer\",\n\t\t\t},\n\t\t});\n\t\t\n\t\tthis._drawingMoves = 0;\n\t}\n\n\t/**\n\t * Removes artifacts from a previous user drawing.\n\t */\n\tstopDrawAnnotation() {\n\t\t[DRAW_ANNOT_1ST, DRAW_ANNOT_2ND, DRAW_ANNOT_RECT].forEach(mid => {\n\t\t\ttry { this._myMarkers.removeMarker(mid); }\n\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t});\n\t\t(this._drawListeners || []).forEach(l => this.parent.removeEventListener(\"mousemove\", l));\n\t\tthis._myMarkers.removeEventListener(\"select-marker\", this._drawListenerClick);\n\t\t\n\t\tdelete this._drawingMoves;\n\t\tthis._drawingAnnotation = null;\n\t}\n\n\t/**\n\t * Computes yaw/pitch based on MouseEvent with clientX/clientY data.\n\t * @param {Event} e The mouse event\n\t * @returns {object} { yaw, pitch } or null if can't compute position.\n\t */\n\tgetPositionFromEvent(e) {\n\t\tconst boundingRect = this.container.getBoundingClientRect();\n\t\tconst viewerX = e.clientX - boundingRect.left;\n\t\tconst viewerY = e.clientY - boundingRect.top;\n\t\tconst intersections = this.renderer.getIntersections({ x: viewerX, y: viewerY });\n\t\tconst sphereIntersection = intersections.find(i => i.object.userData[CONSTANTS.VIEWER_DATA]);\n\t\tif(!sphereIntersection) { return; }\n\t\treturn this.dataHelper.vector3ToSphericalCoords(sphereIntersection.point);\n\t}\n\n\t/**\n\t * Force reload of texture and tiles.\n\t * @memberof Panoramax.components.ui.Photo#\n\t */\n\tforceRefresh() {\n\t\tconst cn = this._myVTour.getCurrentNode();\n\n\t\t// Refresh mode for flat pictures\n\t\tif(cn && cn.panorama.baseUrl !== cn?.panorama?.origBaseUrl) {\n\t\t\tconst prevZoom = this.getZoomLevel();\n\t\t\tconst prevPos = this.getPosition();\n\t\t\tthis._myVTour.state.currentNode = null;\n\t\t\tthis._myVTour.setCurrentNode(cn.id, {\n\t\t\t\tzoomTo: prevZoom,\n\t\t\t\trotateTo: prevPos,\n\t\t\t\tfadeIn: false,\n\t\t\t\tspeed: 0,\n\t\t\t\trotation: false,\n\t\t\t});\n\t\t}\n\n\t\t// Refresh mode for 360 pictures\n\t\tif(cn && cn.panorama.rows > 1) {\n\t\t\tthis.adapter.__refresh();\n\t\t}\n\t}\n}\n","import { LitElement, html, css } from \"lit\";\nimport { fa } from \"../../utils/widgets\";\nimport { panel, faSvg } from \"../styles\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons/faXmark\";\n\n/**\n * Popup Element displays a full overlay container.\n * @class Panoramax.components.ui.Popup\n * @element pnx-popup\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.Popup#open\n * @fires Panoramax.components.ui.Popup#close\n * @example\n * ```html\n * <pnx-popup @close=${() => alert(\"closed\")}>\n *    <h3>Popup content</h3>\n * </pnx-popup>\n * ```\n */\nexport default class Popup extends LitElement {\n\t/** @private */\n\tstatic styles = [ panel, faSvg, css`\n\t\t/* Backdrop */\n\t\t:host {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tleft: 0;\n\t\t\tbottom: 0;\n\t\t\topacity: 0;\n\t\t\tvisibility: hidden;\n\t\t\tpointer-events: none;\n\t\t\ttransition: all 0.2s;\n\t\t\tbackground: rgba(0, 0, 0, 0.85);\n\t\t}\n\t\t:host(*[visible]) {\n\t\t\topacity: 1;\n\t\t\tvisibility: visible;\n\t\t\tpointer-events: unset;\n\t\t\tz-index: 200;\n\t\t}\n\n\t\t/* Content backgroud */\n\t\t.pnx-panel {\n\t\t\tbox-sizing: border-box;\n\t\t\tposition: relative;\n\t\t\twidth: 90%;\n\t\t\tmax-height: 90%;\n\t\t\tmax-width: 400px;\n\t\t\toverflow-y: auto;\n\t\t}\n\n\t\t.btn-close {\n\t\t\tposition: absolute;\n\t\t\ttop: 15px;\n\t\t\tright: 15px;\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.Popup#\n\t * @type {Object}\n\t * @property {boolean} [visible=true] Is the popup visible to user ?\n\t */\n\tstatic properties = {\n\t\tvisible: {type: Boolean, reflect: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.visible = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\t// Backdrop closing\n\t\tthis.addEventListener(\"click\", e => {\n\t\t\tif(e.target === this) { this.close(); }\n\t\t});\n\n\t\t// Esc closing\n\t\tdocument.addEventListener(\"keyup\", e => {\n\t\t\tif(e.key === \"Escape\" && this.visible) {\n\t\t\t\tthis.close();\n\t\t\t}\n\t\t});\n\t}\n\n\t/** @private */\n\tattributeChangedCallback(name, _old, value) {\n\t\tsuper.attributeChangedCallback(name, _old, value);\n\n\t\tif(name == \"visible\") {\n\t\t\tif(value === \"\" || value === true) {\n\t\t\t\t/**\n\t\t\t\t * Event for popup opening\n\t\t\t\t * @event Panoramax.components.ui.Popup#open\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.dispatchEvent(new Event(\"open\"));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Close popup\n\t * @memberof Panoramax.components.ui.Popup#\n\t */\n\tclose() {\n\t\tthis.visible = false;\n\n\t\t/**\n\t\t * Event for popup closing\n\t\t * @event Panoramax.components.ui.Popup#close\n\t\t * @type {Event}\n\t\t */\n\t\tthis.dispatchEvent(new Event(\"close\"));\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"pnx-panel pnx-padded\">\n\t\t\t\t<pnx-button\n\t\t\t\t\tclass=\"btn-close\"\n\t\t\t\t\tkind=\"inline\"\n\t\t\t\t\tsize=\"l\"\n\t\t\t\t\t@click=${this.close.bind(this)}\n\t\t\t\t>\n\t\t\t\t\t${fa(faXmark)}\n\t\t\t\t</pnx-button>\n\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-popup\", Popup);\n","import { LitElement, css, html, nothing } from \"lit\";\n\n/**\n * Progress bar with nice styling.\n * @class Panoramax.components.ui.ProgressBar\n * @element pnx-progress-bar\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-loader value=\"42\" ._t=${viewer._t} />\n * ```\n */\nexport default class ProgressBar extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\tprogress {\n\t\t\tmax-width: 80vh;\n\t\t\twidth: 300px;\n\t\t\theight: 16px;\n\t\t\tappearance: none;\n\t\t\t-webkit-appearance: none;\n\t\t\tborder: 1px solid var(--grey-semi-dark);\n\t\t\tbackground-color: var(--grey);\n\t\t\tborder-radius: 8px;\n\t\t\toverflow: hidden;\n\t\t\tpadding: 3px;\n\t\t\tbox-sizing: border-box;\n\t\t\tdisplay: block;\n\t\t}\n\n\t\tprogress::-webkit-progress-bar {\n\t\t\tbackground-color: var(--grey);\n\t\t}\n\n\t\t/* Don't merge with -moz below, for some f*ing reason a list selector doesn't work with Chrome */\n\t\tprogress::-webkit-progress-value {\n\t\t\tbackground-color: var(--blue);\n\t\t\tborder-radius: 5px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tprogress::-moz-progress-bar {\n\t\t\tbackground-color: var(--blue);\n\t\t\tborder-radius: 5px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\n\t\tprogress[value=\"\"]::-moz-progress-bar,\n\t\tprogress:not([value])::-moz-progress-bar {\n\t\t\tanimation: indeterminateAnimation 1.5s infinite linear;\n\t\t}\n\n\t\tprogress.indeterminate {\n\t\t\tposition: relative;\n\t\t\tbackground-color: var(--grey);\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\tprogress.indeterminate::after {\n\t\t\tcontent: \"\";\n\t\t\tposition: absolute;\n\t\t\tleft: 3px;\n\t\t\ttop: 3px;\n\t\t\tbottom: 3px;\n\t\t\twidth: 20%;\n\t\t\tbackground-color: var(--blue);\n\t\t\tborder-radius: 5px;\n\t\t\tanimation: indeterminateAnimation 1.5s infinite linear;\n\t\t\tpointer-events: none;\n\t\t}\n\n\t\t@keyframes indeterminateAnimation {\n\t\t\t0%   { margin-left: 0%; width: 2%; }\n\t\t\t15%  { margin-left: 0%; width: 20%; }\n\t\t\t50%  { margin-left: 40%; width: 20%; }\n\t\t\t85%  { margin-left: 80%; width: 20%; }\n\t\t\t100% { margin-left: 98%; width: 2%; }\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.ProgressBar#\n\t * @type {Object}\n\t * @property {number} [value] Progress bar percentage (0-100) or empty for indeterminate state\n\t */\n\tstatic properties = {\n\t\tvalue: {type: Number},\n\t};\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<progress\n\t\t\t\tvalue=${this.value >= 0 ? this.value : nothing}\n\t\t\t\tclass=${this.value >= 0 ? nothing : \"indeterminate\"}\n\t\t\t\tmax=\"100\"\n\t\t\t\ttitle=${this._t?.map.loading}\n\t\t\t></progress>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-progress-bar\", ProgressBar);\n","import { LitElement, html, css } from \"lit\";\nimport { QUALITYSCORE_VALUES } from \"../../utils/utils\";\n\n/**\n * Quality Score element displays the picture quality grade.\n * @class Panoramax.components.ui.QualityScore\n * @element pnx-quality-score\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.QualityScore#change\n * @example\n * ```html\n * <!-- Read-only -->\n * <pnx-quality-score grade=\"5\" ._t=${viewer._t} />\n * \n * <!-- Input -->\n * <pnx-quality-score grade=\"5\" input=\"pnx-qs-input\" @change=${() => alert('changed')} ._t=${viewer._t} />\n * ```\n */\nexport default class QualityScore extends LitElement {\n\t/** @private */\n\tstatic styles = css`\n\t\t:host {\n\t\t\tgap: 0px;\n\t\t\tjustify-content: center;\n\t\t\theight: 2em;\n\t\t\tfont-size: 18px;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tcolor: white;\n\t\t}\n\t\n\t\t/* Single letter */\n\t\tspan, label {\n\t\t\twidth: 1.2em;\n\t\t\theight: 1.5em;\n\t\t\tline-height: 1.5em;\n\t\t\tdisplay: inline-block;\n\t\t\tborder: 0.05em solid white;\n\t\t\ttext-align: center;\n\t\t\tbackground-color: gray;\n\t\t\tcolor: rgba(255,255,255,0.9);\n\t\t\tfont-family: var(--font-family);\n\t\t\tfont-weight: 800;\n\t\t\tvertical-align: middle;\n\t\t}\n\n\t\t/* Rounded corners for first/last */\n\t\tspan:first-of-type, label:first-of-type {\n\t\t\tborder-top-left-radius: 0.4em;\n\t\t\tborder-bottom-left-radius: 0.4em;\n\t\t}\n\n\t\tspan:last-of-type, label:last-of-type {\n\t\t\tborder-top-right-radius: 0.4em;\n\t\t\tborder-bottom-right-radius: 0.4em;\n\t\t}\n\n\t\t/* Selected letter */\n\t\t.selected, input[type=\"checkbox\"]:checked + label {\n\t\t\tfont-size: 1.3em;\n\t\t\theight: 1.6em;\n\t\t\tline-height: 1.6em;\n\t\t\tborder-radius: 0.3em !important;\n\t\t}\n\n\t\t/* Clickable letter for input */\n\t\tlabel { cursor: pointer; }\n\n\t\tlabel:hover {\n\t\t\tfont-size: 1.2em;\n\t\t\theight: 1.6em;\n\t\t\tline-height: 1.6em;\n\t\t\tborder-radius: 0.3em !important;\n\t\t}\n\n\t\tinput[type=\"checkbox\"] { display: none; }\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.QualityScore#\n\t * @type {Object}\n\t * @property {number|string} [grade=0] The grade (5=A, 1=E, 0=none selected), or a list of grades\n \t * @property {string} [input=false] If set, score is an input and value is used as ID prefix\n\t */\n\tstatic properties = {\n\t\tgrade: {type: String},\n\t\tinput: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.grade = 0;\n\t\tthis.input = false;\n\t}\n\n\t/** @private */\n\t_onInput() {\n\t\t// List all checked boxes\n\t\tconst newgrade = [];\n\t\tfor(let i of this.renderRoot.querySelectorAll(\"input\")) {\n\t\t\tif(i.checked) { newgrade.push(i.value); }\n\t\t}\n\t\tthis.grade = newgrade.join(\",\");\n\n\t\t/**\n\t\t * Event for grade change\n\t\t * @event Panoramax.components.ui.QualityScore#change\n\t\t * @type {CustomEvent}\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"change\", {bubbles: true, composed: true}));\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst grades = `${this.grade}`.split(\",\").map(v => parseInt(v)).filter(v => !isNaN(v));\n\t\tif(this.input) {\n\t\t\treturn QUALITYSCORE_VALUES.map((pv, index) => {\n\t\t\t\treturn html`\n\t\t\t\t<input\n\t\t\t\t\tid=\"${this.input}-${pv.label}\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tname=\"qualityscore\"\n\t\t\t\t\tvalue=\"${5-index}\"\n\t\t\t\t\t@change=\"${this._onInput}\"\n\t\t\t\t\t.checked=${grades.includes(5-index)}\n\t\t\t\t/>\n\t\t\t\t<label\n\t\t\t\t\tfor=\"${this.input}-${pv.label}\"\n\t\t\t\t\ttitle=\"${this._t?.pnx.filter_qualityscore_help}\"\n\t\t\t\t\tstyle=\"background-color: ${pv.color}\"\n\t\t\t\t>\n\t\t\t\t\t${pv.label}\n\t\t\t\t</label>\n\t\t\t`;});\n\t\t}\n\t\telse {\n\t\t\treturn QUALITYSCORE_VALUES.map((pv, index) => html`\n\t\t\t\t<span class=\"${grades.includes(5-index) ? \"selected\" : \"\"}\" style=\"background-color: ${pv.color}\">\n\t\t\t\t\t${pv.label}\n\t\t\t\t</span>\n\t\t\t`);\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-quality-score\", QualityScore);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { map } from \"lit/directives/map.js\";\nimport { fa, listenForMenuClosure } from \"../../utils/widgets\";\nimport { faSvg } from \"../styles\";\nimport { faCircleExclamation } from \"@fortawesome/free-solid-svg-icons/faCircleExclamation\";\nimport { faMagnifyingGlass } from \"@fortawesome/free-solid-svg-icons/faMagnifyingGlass\";\nimport { faCircleNotch } from \"@fortawesome/free-solid-svg-icons/faCircleNotch\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons/faXmark\";\n\n\n/**\n * Search Bar Element displays an interactive search widget.\n * @class Panoramax.components.ui.SearchBar\n * @element pnx-search-bar\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.SearchBar#result\n * @example\n * ```html\n * <pnx-search-bar\n *   id=\"my-search-bar\"\n *   placeholder=\"Search something...\"\n *   .searcher=${mysearchfct}\n *   ._parent=${viewer}\n *   reduceable=\"false\"\n *   reduced=\"false\"\n *   size=\"xxl\" @result=${e => console.log(e.detail)}\n * >\n *   <!-- Optional icon for display on left-side of search bar -->\n * </pnx-search-bar>\n * ```\n */\nexport default class SearchBar extends LitElement {\n\t/** @private */\n\tstatic styles = [ faSvg, css`\n\t\t/* Container */\n\t\t.sb {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 5px;\n\t\t\tborder: 1px solid var(--widget-border-div);\n\t\t\tborder-radius: 5px;\n\t\t\tbackground-color: var(--widget-bg);\n\t\t\tcolor: var(--widget-font);\n\t\t\theight: 30px;\n\t\t\tborder-radius: 20px;\n\t\t\tposition: relative;\n\t\t\tpadding: 0 0 0 10px;\n\t\t\twidth: fit-content;\n\t\t\tmax-width: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tfont-family: var(--font-family);\n\t\t}\n\t\t.sb.sb-xxl {\n\t\t\theight: 40px;\n\t\t\tline-height: 40px;\n\t\t}\n\t\t.sb.sb-reduceable {\n\t\t\twidth: 360px;\n\t\t}\n\t\t.sb.sb-reduceable.sb-reduced {\n\t\t\twidth: fit-content;\n\t\t\tpadding: 0;\n\t\t\tgap: 0;\n\t\t}\n\n\t\t/* Text field */\n\t\t.sb input {\n\t\t\tbackground: none;\n\t\t\tborder: none !important;\n\t\t\toutline: none;\n\t\t\theight: 20px;\n\t\t\twidth: 100%;\n\t\t\tfont-family: var(--font-family);\n\t\t}\n\t\t.sb.sb-xxl input {\n\t\t\tfont-size: 1.1em;\n\t\t}\n\t\t.sb.sb-reduceable.sb-reduced input {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t/* Status icon */\n\t\t.sb-icon {\n\t\t\tcursor: pointer;\n\t\t\theight: 30px;\n\t\t\tline-height: 30px;\n\t\t\twidth: 30px;\n\t\t\tmin-width: 30px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.sb.sb-xxl .sb-icon {\n\t\t\theight: 40px;\n\t\t\tline-height: 40px;\n\t\t\twidth: 40px;\n\t\t\tmin-width: 40px;\n\t\t}\n\t\t.sb-icon svg {\n\t\t\tpointer-events: none;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t/* Search results */\n\t\t.sb-results {\n\t\t\tposition: absolute;\n\t\t\ttop: 35px;\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tmax-width: calc(100% - 20px);\n\t\t\tborder: 1px solid var(--widget-border-div);\n\t\t\tborder-radius: 10px;\n\t\t\tbackground-color: var(--widget-bg);\n\t\t\tcolor: var(--widget-font);\n\t\t\tz-index: 130;\n\t\t\tfont-size: 1.05em;\n  \t\t\tline-height: normal;\n\t\t\tfont-family: var(--font-family);\n\t\t}\n\t\t.sb.sb-xxl .sb-results {\n\t\t\ttop: 45px;\n\t\t}\n\t\t.sb-result,\n\t\t.sb-empty {\n\t\t\tdisplay: block;\n\t\t\tpadding: 5px 15px;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t.sb-result:hover {\n\t\t\tbackground-color: var(--widget-bg-hover);\n\t\t}\n\t\t.sb-result:first-child {\n\t\t\tborder-top-right-radius: 10px;\n\t\t\tborder-top-left-radius: 10px;\n\t\t\tpadding-top: 15px;\n\t\t}\n\t\t.sb-result:last-child {\n\t\t\tborder-bottom-right-radius: 10px;\n\t\t\tborder-bottom-left-radius: 10px;\n\t\t\tpadding-bottom: 15px;\n\t\t}\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.SearchBar#\n\t * @type {Object}\n\t * @property {string} [id] The ID attribute set on component and prefix for input as well\n\t * @property {string} [placeholder] Default text to display on empty field\n\t * @property {boolean} [reduceable=false] Can the search bar be collapsed (for mobile view)\n\t * @property {boolean} [reduced=false] Is the search bar currently collapsed ?\n\t * @property {string} [value] The default input value\n\t * @property {string} [size=md] The component sizing (md, xxl)\n\t * @property {function} [searcher] Search callback, function that takes as parameter the input text value, and resolves on list of results ({title, subtitle} and any other data you'd like to get on validation)\n\t * @property {boolean} [no-menu-closure=false] Set to true to ignore menu closure events\n\t */\n\tstatic properties = {\n\t\tid: {type: String},\n\t\tplaceholder: {type: String},\n\t\treduceable: {type: Boolean, reflect: true},\n\t\treduced: {type: Boolean, reflect: true},\n\t\tvalue: {type: String},\n\t\tsize: {type: String},\n\t\t_icon: {state: true},\n\t\t_results: {state: true},\n\t\tsearcher: {type: Function},\n\t\t\"no-menu-closure\": {type: Boolean},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// State properties\n\t\tthis.reduceable = false;\n\t\tthis.reduced = false;\n\t\tthis.placeholder = nothing;\n\t\tthis.size = \"md\";\n\t\tthis._icon = \"search\";\n\t\tthis._results = null;\n\t\tthis[\"no-menu-closure\"] = false;\n\n\t\t// Other properties\n\t\tthis._throttler = null;\n\t\tdelete this._lastSearch;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tif(!this[\"no-menu-closure\"]) { listenForMenuClosure(this, this.reset.bind(this)); }\n\t}\n\n\t/** @private */\n\tattributeChangedCallback(name, _old, value) {\n\t\tsuper.attributeChangedCallback(name, _old, value);\n\t\tif(name == \"value\" && this._icon == \"search\") {\n\t\t\tthis._icon = \"empty\";\n\t\t}\n\t}\n\n\t/** @private */\n\t_onIconClick() {\n\t\tif([\"empty\", \"warn\"].includes(this._icon)) {\n\t\t\tthis.reset();\n\t\t}\n\t\tif(this.reduceable && this._icon == \"search\") {\n\t\t\tthis.reduced = !this.reduced;\n\t\t}\n\t}\n\n\t/** @private */\n\t_onInputChange(e) {\n\t\tthis.value = e.target.value;\n\t\tthis._throttledSearch();\n\t}\n\n\t/** @private */\n\t_onResultClick(item) {\n\t\t/**\n\t\t * Event for search result clicked\n\t\t * @event Panoramax.components.ui.SearchBar#result\n\t\t * @type {CustomEvent}\n\t\t * @property {object|null} detail The data associated to clicked item (format based on searcher function results), or null on reset\n\t\t */\n\t\tthis.dispatchEvent(new CustomEvent(\"result\", {bubbles: true, composed: true, detail: item}));\n\n\t\tthis._results = null;\n\t\tif(this._throttler) {\n\t\t\tclearTimeout(this._throttler);\n\t\t\tthis._throttler = null;\n\t\t}\n\n\t\tif(!this.reduceable && item) {\n\t\t\tthis.value = item?.title;\n\t\t\tthis._icon = \"empty\";\n\t\t}\n\t\telse {\n\t\t\tthis.value = \"\";\n\t\t\tthis._icon = \"search\";\n\t\t\tif(this.reduceable) { this.reduced = true; }\n\t\t}\n\t}\n\n\t/**\n\t * Limit search calls to every 500ms\n\t * @private\n\t */\n\t_throttledSearch() {\n\t\tif(this._throttler) {\n\t\t\tclearTimeout(this._throttler);\n\t\t\tdelete this._throttler;\n\t\t}\n\n\t\tthis._throttler = setTimeout(this._search.bind(this), 500);\n\t}\n\n\t/**\n\t * Perform real search\n\t * @private\n\t */\n\t_search() {\n\t\tif(!this.value || this.value.length == 0) {\n\t\t\tthis.reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif(!this.searcher) {\n\t\t\tconsole.warn(\"No search handler defined\");\n\t\t\treturn;\n\t\t}\n\n\t\tthis._icon = \"loading\";\n\t\tthis._results = null;\n\n\t\tthis.searcher(this.value).then(data => {\n\t\t\tif(this._icon !== \"loading\") { return; }\n\n\t\t\tthis._icon = \"empty\";\n\t\t\tif(!data || data.length == 0) {\n\t\t\t\tthis._results = [];\n\t\t\t}\n\t\t\telse if(data === true) {\n\t\t\t\tthis._results = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._results = data;\n\t\t\t\tif(!this[\"no-menu-closure\"]) {\n\t\t\t\t\tthis._parent?.dispatchEvent(new CustomEvent(\"menu-opened\", { detail: { menu: this }}));\n\t\t\t\t}\n\t\t\t}\n\t\t}).catch(e => {\n\t\t\tconsole.error(e);\n\t\t\tthis._icon = \"warn\";\n\t\t});\n\t}\n\n\t/**\n\t * Empty results list and reset search bar content.\n\t */\n\treset() {\n\t\tthis._onResultClick(null);\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst classes = {\n\t\t\tsb: true,\n\t\t\t\"sb-xxl\": this.size === \"xxl\",\n\t\t\t\"sb-reduceable\": this.reduceable,\n\t\t\t\"sb-reduced\": this.reduced,\n\t\t};\n\n\t\treturn html`<div\n\t\t\tid=${this.id}\n\t\t\tclass=${classMap(classes)}\n\t\t\tpart=\"container\"\n\t\t>\n\t\t\t<slot name=\"pre\" class=${classMap({\"sb-reduced\": this.reduced})}></slot>\n\n\t\t\t<input\n\t\t\t\tid=\"${this.id}-input\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\t@change=${this._onInputChange.bind(this)}\n\t\t\t\t@keypress=${this._onInputChange.bind(this)}\n\t\t\t\t@paste=${this._onInputChange.bind(this)}\n\t\t\t\t@input=${this._onInputChange.bind(this)}\n\t\t\t\t.value=${this.value || \"\"}\n\t\t\t\tpart=\"input\"\n\t\t\t/>\n\n\t\t\t<span\n\t\t\t\tclass=\"sb-icon\"\n\t\t\t\t@click=${this._onIconClick.bind(this)}\n\t\t\t>\n\t\t\t\t${this._icon == \"search\" ? fa(faMagnifyingGlass) : nothing}\n\t\t\t\t${this._icon == \"loading\" ? fa(faCircleNotch, { classes: [\"fa-spin\"] }) : nothing}\n\t\t\t\t${this._icon == \"empty\" ? fa(faXmark) : nothing}\n\t\t\t\t${this._icon == \"warn\" ? fa(faCircleExclamation) : nothing}\n\t\t\t</span>\n\n\t\t\t${!this.reduced && this._results ? html`\n\t\t\t\t<div class=\"sb-results\">\n\t\t\t\t\t${this._results.length === 0 ? html`\n\t\t\t\t\t\t<div class=\"sb-empty\">${this._parent?._t?.pnx.search_empty}</div>\n\t\t\t\t\t` : nothing}\n\n\t\t\t\t\t${map(this._results, i => html`\n\t\t\t\t\t\t<div class=\"sb-result\" @click=${() => this._onResultClick(i)}>\n\t\t\t\t\t\t\t${i.title}\n\t\t\t\t\t\t\t${i.subtitle && i.subtitle != \"\" ? html`<br /><small>${i.subtitle}</small>` : nothing}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`)}\n\t\t\t\t</div>\n\t\t\t` : nothing}\n\t\t</div>`;\n\t}\n}\n\ncustomElements.define(\"pnx-search-bar\", SearchBar);\n","import { LitElement, html, css } from \"lit\";\nimport Basic from \"../core/Basic\";\nimport { parseSemanticsString, computeDiffTags, semanticsToString } from \"../../utils/semantics\";\nimport { textarea } from \"../styles\";\nimport JSON5 from \"json5\";\n\n/**\n * Semantics Editor offer an easy-to-use input for adding or editing semantics tags.\n * \n * It manipulates list of `{key: \"mypanokey\", value: \"myvalue\"}` entries through `semantics` attribute.\n * \n * @class Panoramax.components.ui.SemanticsEditor\n * @element pnx-semantics-editor\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.SemanticsEditor#change\n * @example\n * ```html\n * <!-- Basic example -->\n * <pnx-semantics-editor\n *    id=\"editor\"\n *    semantics=${mypic.semantics}\n *    ._t=${viewer._t}\n *    onchange=${e => console.log(e.detail.semantics)}\n * />\n * \n * <!-- You can access editor and check its validity through native web browser functions -->\n * <script>\n *    const editor = document.getElementById(\"editor\");\n *    console.log(editor.checkValidity()); // True if input is valid\n * </script>\n * \n * <!-- You can change specifically style of textarea -->\n * <style>\n *   pnx-semantics-editor::part(text) {\n *      color: blue;\n *   }\n * </style>\n * ```\n */\nexport default class SemanticsEditor extends LitElement {\n\tstatic styles = [textarea, css`\n\t\ttextarea:invalid {\n\t\t\tborder: 2px solid var(--red);\n\t\t\tbackground-color:var(--beige);\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.SemanticsEditor#\n\t * @type {Object}\n\t * @property {object} [semantics] The `semantics` field of a picture or annotation feature. It is updated when field changes, but reflect the whole list of new tags (not delta needed by API). If you want delta, please use getDiff function.\n\t * @property {number} [rows=3] The amount of rows shown for textarea\n\t */\n\tstatic properties = {\n\t\tsemantics: {converter: Basic.GetJSONConverter(), reflect: true},\n\t\trows: {type: Number},\n\t\t_valid: {state: true},\n\t\t_t: {converter: Basic.GetJSONConverter()},\n\t\t_firstSemantics: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.semantics = null;\n\t\tthis._valid = true;\n\t\tthis._firstSemantics = null;\n\t\tthis.rows = 3;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._firstSemantics = this.semantics === null ? [] : JSON5.parse(JSON5.stringify(this.semantics));\n\t}\n\n\t/**\n\t * Get current delta between initial tags and user changes.\n\t * @memberof Panoramax.components.ui.SemanticsEditor#\n\t * @returns {object[]} The list of tag changes (in API format)\n\t */\n\tgetDiff() {\n\t\treturn computeDiffTags(this._firstSemantics || [], this.semantics);\n\t}\n\t\n\t/**\n\t * Check if input is having a valid value.\n\t * @memberof Panoramax.components.ui.SemanticsEditor#\n\t * @returns {boolean} True if it's valid\n\t */\n\tcheckValidity() {\n\t\treturn this._valid;\n\t}\n\n\t/**\n\t * Force display of invalid input\n\t * @memberof Panoramax.components.ui.SemanticsEditor#\n\t */\n\treportValidity() {\n\t\tthis.renderRoot.querySelector(\"textarea\")?.reportValidity();\n\t}\n\n\t/**\n\t * Forces Editor to goes back to its empty, initial state.\n\t * @param {object} [baseSemantics=null] Initial existing semantics you want to show in editor. This is useful for getting a diff of only new semantic entries. Leave empty if no tags pre-exist.\n\t * @memberof Panoramax.components.ui.SemanticsEditor#\n\t */\n\treset(baseSemantics = null) {\n\t\tthis.semantics = null;\n\t\tthis._valid = true;\n\n\t\tconst txt = this.renderRoot.querySelector(\"textarea\");\n\t\ttxt?.setCustomValidity(\"\");\n\t\ttxt?.reportValidity();\n\t\t\n\t\tthis._firstSemantics = baseSemantics;\n\t\tthis.semantics = baseSemantics;\n\t}\n\t\n\t/** @private */\n\t_onInput(e) {\n\t\tconst tarea = e.target;\n\t\ttry {\n\t\t\tthis.semantics = parseSemanticsString(tarea.value) || [];\n\t\t\tthis._valid = true;\n\t\t} catch (err) {\n\t\t\tif(err.message !== \"Invalid tags\") { console.error(err); }\n\t\t\tthis._valid = false;\n\t\t}\n\t}\n\t\n\t/** @private */\n\t_onBlur(e) {\n\t\tconst prevValidity = e.target.checkValidity();\n\n\t\tif(this._valid) {\n\t\t\te.target.setCustomValidity(\"\");\n\n\t\t\t/**\n\t\t\t * Event for value change.\n\t\t\t * \n\t\t\t * Note that this event is launched only on valid input.\n\t\t\t *\n\t\t\t * @event Panoramax.components.ui.SemanticsEditor#change\n\t\t\t * @type {CustomEvent}\n\t\t\t * @property {object[]} detail.semantics The new tags list (in API semantics property format)\n\t\t\t * @property {object[]} detail.delta The delta between old and current tags (expected by API)\n\t\t\t */\n\t\t\tthis.dispatchEvent(new CustomEvent(\"change\", {\n\t\t\t\tdetail: {\n\t\t\t\t\tsemantics: this.semantics || [],\n\t\t\t\t\tdelta: computeDiffTags(this._firstSemantics || [], this.semantics),\n\t\t\t\t}\n\t\t\t}));\n\t\t}\n\t\telse if(prevValidity) { // Do not call again if already shows up, to fix Chrome issue\n\t\t\te.target.setCustomValidity(this._t?.pnx.semantics_editor_error || \"Invalid syntax\");\n\t\t\te.target.reportValidity();\n\t\t}\n\t}\n\t\n\t/** @private */\n\trender() {\n\t\t/* eslint-disable indent */\n\t\treturn html`\n\t\t\t<textarea\n\t\t\t\tpart=\"text\"\n\t\t\t\tautocomplete=\"off\"\n\t\t\t\tautocorrect=\"off\"\n\t\t\t\tautocapitalize=\"off\"\n\t\t\t\tspellcheck=\"false\"\n\t\t\t\tplaceholder=${this._t?.pnx.semantics_editor_example || \"key1=value1\\nprefix|key2=value2\"}\n\t\t\t\t@input=${this._onInput}\n  \t\t\t\t@blur=${this._onBlur}\n\t\t\t\trows=${this.rows}\n\t\t\t\t.value=${semanticsToString(this.semantics)}\n\t\t\t></textarea>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-editor\", SemanticsEditor);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { table } from \"../styles\";\nimport { groupByPrefix } from \"../../utils/semantics\";\n\n/**\n * Semantics Tables display all semantics tags from either a picture or an annotation.\n * \n * @class Panoramax.components.ui.SemanticsTable\n * @element pnx-semantics-table\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-semantics-table source=${picture.properties} ._t=${viewer._t} />\n * ```\n */\nexport default class SemanticsTable extends LitElement {\n\t/** @private */\n\tstatic styles = [ table, css`\n\t\t:host { display: block; }\n\t\tth:first-child, td:first-child { width: 40%; }\n\t\ttd { vertical-align: top; }\n\n\t\ttd small { color: var(--grey-semi-dark); }\n\t\ttd a small { color: unset; }\n\t\t.qualifiers { margin-top: 5px; }\n\t\t.qualifiers > b { margin: 8px 0; }\n\t\t.qualifiers ul {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0px 0px 0px 15px;\n\t\t\tpadding: 0;\n\t\t}\n\n\t\timg.prefix-logo {\n\t\t\tmax-width: 15px;\n\t\t\tmax-height: 15px;\n\t\t\taspect-ratio: 1;\n\t\t\tvertical-align: middle;\n\t\t}\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.SemanticsTable#\n\t * @type {Object}\n\t * @property {object} [source] The picture or annotation feature (having a `semantics` property)\n\t */\n\tstatic properties = {\n\t\tsource: {type: Object},\n\t};\n\n\trender() {\n\t\t/* eslint-disable indent */\n\t\tif(!this.source) { return nothing; }\n\n\t\tconst groups = groupByPrefix(this.source.semantics);\n\n\t\treturn html`<table>\n\t\t\t<thead>\n\t\t\t\t<tr><th>${this._t.pnx.semantics_key}</th><th>${this._t.pnx.semantics_value}</th></tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t${groups.map(g => g.tags.map(tag => html`\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t${g.prefix != \"\"\n\t\t\t\t\t\t\t\t? (g.logo\n\t\t\t\t\t\t\t\t\t? html`<img src=${g.logo} class=\"prefix-logo\" alt=${g.prefix} title=${g.title} />`\n\t\t\t\t\t\t\t\t\t: html`<small>(${g.prefix})</small>`)\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t${g.key_transform ? g.key_transform(tag, this._t) : tag.key}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t${g.value_transform ? g.value_transform(tag, this._t) : tag.value}\n\t\t\t\t\t\t\t${tag.qualifiers ? html`<div class=\"qualifiers\">\n\t\t\t\t\t\t\t\t<b>${this._t.pnx.semantics_qualifiers}</b>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t${tag.qualifiers.map(q => html`<li>${q.subkey} = ${q.value}</li>`)}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>` : nothing}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t`))}\n\t\t\t</tbody>\n\t\t</table>`;\n\t}\n}\n\ncustomElements.define(\"pnx-semantics-table\", SemanticsTable);\n","import { LitElement, html, css } from \"lit\";\n\n/**\n * Switch button, based on a native checkbox.\n * @class Panoramax.components.ui.Switch\n * @element pnx-switch\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @fires Panoramax.components.ui.Switch#change\n * @example\n * ```html\n * <pnx-switch\n *   checked=\"true\"\n *   name=\"my-switch\"\n *   @change=${doSomething}\n * >\n *   Label text\n * </pnx-switch>\n * ```\n */\nexport default class Switch extends LitElement {\n\tstatic styles = css`\n\t\t.toggle {\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t.toggle-switch {\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #ccc;\n\t\t\tborder-radius: 11px;\n\t\t\twidth: 42px;\n\t\t\theight: 22px;\n\t\t\tposition: relative;\n\t\t\tvertical-align: middle;\n\t\t\ttransition: background 0.25s;\n\t\t}\n\t\t.toggle-switch:before, .toggle-switch:after {\n\t\t\tcontent: \"\";\n\t\t}\n\t\t.toggle-switch:before {\n\t\t\tdisplay: block;\n\t\t\tbackground: linear-gradient(to bottom, #fff 0%, #eee 100%);\n\t\t\tborder-radius: 50%;\n\t\t\tbox-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tposition: absolute;\n\t\t\ttop: 3px;\n\t\t\tleft: 3px;\n\t\t\ttransition: left 0.25s;\n\t\t}\n\t\t.toggle:hover .toggle-switch:before {\n\t\t\tbackground: linear-gradient(to bottom, #fff 0%, #fff 100%);\n\t\t\tbox-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);\n\t\t}\n\t\t.toggle-checkbox:checked + .toggle-switch {\n\t\t\tbackground: var(--widget-bg-active);\n\t\t}\n\t\t.toggle-checkbox:disabled + .toggle-switch:before,\n\t\t.toggle-checkbox:disabled:hover + .toggle-switch:before {\n\t\t\tbackground: var(--grey-pale);\n\t\t\tbox-shadow: none;\n\t\t}\n\t\t.toggle-checkbox:disabled + .toggle-switch {\n\t\t\tbackground: var(--grey);\n\t\t\tbox-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n\t\t}\n\t\t.toggle-checkbox:checked + .toggle-switch:before {\n\t\t\tleft: 23px;\n\t\t}\n\n\t\t.toggle-checkbox {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t}\n\n\t\t.toggle-label {\n\t\t\tmargin-left: 5px;\n\t\t\tposition: relative;\n\t\t\ttop: 2px;\n\t\t}\n\t`;\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.Switch#\n\t * @type {Object}\n\t * @property {boolean} checked True if checked\n\t * @property {boolean} disabled Inactive if true\n\t * @property {boolean} value The current switch value\n\t * @property {string} name The switch name (also serves as ID)\n\t */\n\tstatic properties = {\n\t\tchecked: {type: Boolean, reflect: true},\n\t\tdisabled: {type: Boolean, reflect: true},\n\t\tname: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.checked = false;\n\t\tthis.disabled = false;\n\t\tthis.name = \"pnx-switch-1\"; // Default name+ID to avoid issues\n\t}\n\n\t/** @private */\n\t_onChange(e) {\n\t\tthis.checked = e.target.checked;\n\t\t/**\n\t\t * Event for switch status change\n\t\t * @event Panoramax.components.ui.Switch#change\n\t\t * @type {Event}\n\t\t */\n\t\tthis.dispatchEvent(new Event(\"change\"));\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<label class=\"toggle\" for=${this.name}>\n\t\t\t\t<input\n\t\t\t\t\tclass=\"toggle-checkbox\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tid=${this.name}\n\t\t\t\t\tname=${this.name}\n\t\t\t\t\t.checked=${this.checked}\n\t\t\t\t\t.disabled=${this.disabled}\n\t\t\t\t\t@change=${this._onChange}\n\t\t\t\t/>\n\t\t\t\t<div class=\"toggle-switch\"></div>\n\t\t\t\t<span class=\"toggle-label\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</span>\n\t\t\t</label>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-switch\", Switch);\n","import { LitElement, html, css } from \"lit\";\nimport { panel } from \"../styles\";\nimport { listenForMenuClosure } from \"../../utils/widgets\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\n/**\n * Togglable Group element allows to make a menu appear/disappear based on button click.\n * @class Panoramax.components.ui.TogglableGroup\n * @element pnx-togglable-group\n * @slot `button` The button on which click leads to open/close menu\n * @slot `default` The menu to make shown/hidden on button click\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-togglable-group padded=\"false\" ._parent=${viewer}>\n *   <pnx-button slot=\"button\">\n *     Open menu\n *   </pnx-button>\n *   <div>Menu content</div>\n * </pnx-togglable-group>\n * ```\n */\nexport default class TogglableGroup extends LitElement {\n\t/** @private */\n\tstatic styles = [ panel, css`\n\t\tdiv.container {\n\t\t\tposition: relative;\n\t\t\theight: 100%;\n\t\t}\n\n\t\t.pnx-panel { z-index: 130; }\n\t\t.pnx-panel-fixed { position: fixed; }\n\t` ];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.TogglableGroup#\n\t * @type {Object}\n\t * @property {string} [padded] If set, adds a 15px padding to the menu panel.\n\t */\n\tstatic properties = {\n\t\t_opened: {state: true},\n\t\tpadded: {type: String},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._opened = false;\n\t}\n\n\t/** @private */\n\topen() {\n\t\tthis._opened = true;\n\t\tthis._parent?.dispatchEvent(new CustomEvent(\"menu-opened\", { detail: { menu: this }}));\n\t\tthis.adjustMenuPosition(this._btn);\n\t\tif(this._chevron) { this._chevron.style.rotate = \"180deg\"; }\n\t}\n\n\t/** @private */\n\tclose() {\n\t\tthis._opened = false;\n\t\tif(this._chevron) { this._chevron.style.rotate = \"\"; }\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tlistenForMenuClosure(this, this.close.bind(this));\n\t}\n\n\t/** @private */\n\thandleButtonSlotChange(e) {\n\t\tthis._btn = e.target.assignedNodes().pop();\n\t\tif(this._btn) {\n\t\t\t// Chevron\n\t\t\tthis._chevron = this._btn.querySelector(\"svg.fa-chevron-down\");\n\t\t\tif(this._chevron) {\n\t\t\t\tthis._chevron.style.transition = \"rotate 0.2s\";\n\t\t\t\tthis._chevron.style.rotate = this._opened ? \"180deg\" : \"\";\n\t\t\t}\n\n\t\t\tthis._btn.addEventListener(\"click\", () => {\n\t\t\t\tif(this._opened) { this.close(); }\n\t\t\t\telse { this.open(); }\n\t\t\t});\n\t\t}\n\t}\n\n\t/** @private */\n\tadjustMenuPosition(btn) {\n\t\tconst btnMenuMargin = 5;\n\t\tconst borderMargin = 10;\n\n\t\t// Reset menu position\n\t\tconst menu = this.shadowRoot.querySelector(\"div[part='menu']\");\n\t\tmenu.style.top = null;\n\t\tmenu.style.bottom = null;\n\t\tmenu.style.right = null;\n\t\tmenu.style.left = null;\n\t\tmenu.style.overflowY = null;\n\t\tmenu.style.marginTop = null;\n\n\t\t// Get positions on screen\n\t\tconst btnRect = btn.getBoundingClientRect();\n\t\tlet menuRect = menu.getBoundingClientRect();\n\t\tconst fitsWidth = menuRect.right <= window.innerWidth - borderMargin;\n\t\tconst fitsHeight = menuRect.bottom <= window.innerHeight - borderMargin;\n\n\t\t// No overflow = space a bit under button\n\t\tif(fitsWidth && fitsHeight) {\n\t\t\tmenu.style.top = `${btnRect.bottom+btnMenuMargin}px`;\n\t\t}\n\t\t// Overflows width+height = put at button's top+left\n\t\telse if(!fitsWidth && !fitsHeight) {\n\t\t\tmenu.style.right = `${window.innerWidth - btnRect.left + btnMenuMargin}px`;\n\t\t\tmenu.style.bottom = `${window.innerHeight - btnRect.bottom}px`;\n\t\t\t\n\t\t\t// Check if it doesn't overflow on top\n\t\t\tmenuRect = menu.getBoundingClientRect();\n\t\t\tif(menuRect.top - borderMargin < 0) {\n\t\t\t\tmenu.style.bottom = `${borderMargin}px`;\n\t\t\t\tmenu.style.top = `${btnRect.top}px`;\n\t\t\t\tmenu.style.overflowY = \"auto\";\n\t\t\t}\n\t\t}\n\t\t// Overflows height = limit height\n\t\telse if(!fitsHeight) {\n\t\t\tmenu.style.bottom = `${borderMargin}px`;\n\t\t\tmenu.style.top = `${btnRect.bottom+btnMenuMargin}px`;\n\t\t\tmenu.style.overflowY = \"auto\";\n\t\t}\n\t\t// Overflows width = move to left\n\t\telse if(!fitsWidth) {\n\t\t\tmenu.style.marginTop = `${btnMenuMargin}px`;\n\t\t\tmenu.style.right = `${window.innerWidth - btnRect.right}px`;\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst panelClasses = {\n\t\t\t\"pnx-panel\": true,\n\t\t\t\"pnx-panel-fixed\": true,\n\t\t\t\"pnx-hidden\": !this._opened,\n\t\t\t\"pnx-padded\": this.padded !== \"false\",\n\t\t};\n\n\t\treturn html`<div class=\"container\" @click=${e => e.stopPropagation()}>\n\t\t\t<slot name=\"button\" @slotchange=${this.handleButtonSlotChange}></slot>\n\t\t\t<div class=${classMap(panelClasses)} part=\"menu\">\n\t\t\t\t<slot></slot>\n\t\t\t</div>\n\t\t</div>`;\n\t}\n}\n\ncustomElements.define(\"pnx-togglable-group\", TogglableGroup);\n","import { LitElement, html, css } from \"lit\";\nimport { degToDms } from \"../../../utils/utils\";\nimport { fa } from \"../../../utils/widgets\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons/faChevronDown\";\nimport { btngroup } from \"../../styles\";\n\n/**\n * Copy Coordinates button allows easy copy of several format of map coordinates.\n * @class Panoramax.components.ui.widgets.CopyCoordinates\n * @element pnx-copy-coordinates\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-copy-coordinates gps=${[-1.7, 48.6]} _parent=${viewer} />\n * ```\n */\nexport default class CopyCoordinates extends LitElement {\n\t/** @private */\n\tstatic styles = [btngroup, css`\n\t\tpnx-togglable-group::part(menu) {\n\t\t\tborder-radius: 5px;\n\t\t\tmin-width: unset;\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.CopyCoordinates#\n\t * @type {Object}\n\t * @property {number[]} gps GPS/map coordinates, as [lon, lat]\n\t */\n\tstatic properties = {\n\t\tgps: {type: Array},\n\t};\n\n\t/** @private */\n\trender() {\n\t\tconst dmslonval = degToDms(this.gps[0]);\n\t\tconst dmslon = dmslonval.d < 0 ? `${Math.abs(dmslonval.d)}°${dmslonval.m}'${dmslonval.s}\"W` : `${dmslonval.d}°${dmslonval.m}'${dmslonval.s}\"E`;\n\t\tconst dmslatval = degToDms(this.gps[1]);\n\t\tconst dmslat = dmslatval.d < 0 ? `${Math.abs(dmslatval.d)}°${dmslatval.m}'${dmslatval.s}\"S` : `${dmslatval.d}°${dmslatval.m}'${dmslatval.s}\"N`;\n\n\t\tconst values = {\n\t\t\tddeclatlon: `${this.gps[1].toFixed(5)}, ${this.gps[0].toFixed(5)}`,\n\t\t\tddeclonlat: `${this.gps[0].toFixed(5)}, ${this.gps[1].toFixed(5)}`,\n\t\t\tddmslonlat: `${dmslon}, ${dmslat}`,\n\t\t\tddmslatlon: `${dmslat}, ${dmslon}`,\n\t\t};\n\n\t\treturn html`<pnx-button-group style=\"display: inline-block; vertical-align: baseline\" dir=\"row\">\n\t\t\t<pnx-copy-button\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttext=${values.ddeclonlat}\n\t\t\t\ttitle=${this._parent?._t.pnx.metadata_location_copy.replace(\"{v}\", values.ddeclonlat)}\n\t\t\t></pnx-copy-button>\n\n\t\t\t<pnx-togglable-group padded=\"false\" ._parent=${this._parent}>\n\t\t\t\t<pnx-button\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tslot=\"button\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.metadata_location_copy_more}\n\t\t\t\t>${fa(faChevronDown)}</pnx-button>\n\t\t\t\t<pnx-list-group>\n\t\t\t\t\t${Object.values(values).map(text => html`\n\t\t\t\t\t\t<pnx-copy-button unstyled text=${text} ._t=${this._parent._t}>\n\t\t\t\t\t\t\t${this._parent?._t.pnx.metadata_location_copy.replace(\"{v}\", text)}\n\t\t\t\t\t\t</pnx-copy-button>\n\t\t\t\t\t`)}\n\t\t\t\t</pnx-list-group>\n\t\t\t</pnx-togglable-group>\n\t\t</pnx-button-group>`;\n\t}\n}\n\ncustomElements.define(\"pnx-copy-coordinates\", CopyCoordinates);\n","// DO NOT REMOVE THE \"!\": bundled builds breaks otherwise !!!\nimport maplibregl from \"!maplibre-gl\";\n\nimport { LitElement, html } from \"lit\";\nimport { forwardGeocodingBAN, forwardGeocodingStandard, forwardGeocodingNominatim } from \"../../../utils/geocoder\";\nimport { onceParentAvailable } from \"../../../utils/widgets\";\nimport \"./GeoSearch.css\";\n\nconst GEOCODER_ENGINES = {\n\t\"ban\": forwardGeocodingBAN,\n\t\"standard\": forwardGeocodingStandard,\n\t\"nominatim\": forwardGeocodingNominatim\n};\n\n/**\n * Ready-to-use geocoder search bar.\n * @class Panoramax.components.ui.widgets.GeoSearch\n * @element pnx-widget-geosearch\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <!-- Default geocoder -->\n * <pnx-widget-geosearch _parent=${viewer} />\n * \n * <!-- Custom-URL geocoder -->\n * <pnx-widget-geosearch geocoder=\"https://photon.komoot.io/api\" _parent=${viewer} />\n * ```\n */\nexport default class GeoSearch extends LitElement {\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.GeoSearch#\n\t * @type {Object}\n\t * @property {string} [geocoder=nominatim] The geocoder engine to use (nominatim, ban, or URL to a standard [GeocodeJSON-compliant](https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md) API)\n\t */\n\tstatic properties = {\n\t\tgeocoder: {type: String},\n\t\t_geolocate: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.geocoder = \"nominatim\";\n\t\t\n\t\tthis._geolocateCtrl = new maplibregl.GeolocateControl({\n\t\t\tpositionOptions: {\n\t\t\t\tenableHighAccuracy: true,\n\t\t\t\ttimeout: 60000, // Max 1 minute for first position\n\t\t\t\tmaximumAge: 300000, // Accepts 5 minutes old position\n\t\t\t},\n\t\t\tshowAccuracyCircle: true,\n\t\t\tshowUserLocation: true,\n\t\t\ttrackUserLocation: true,\n\t\t});\n\t}\n\n\t/** @private */\n\tcreateRenderRoot() {\n\t\treturn this;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tthis._geocoderEngine = GEOCODER_ENGINES[this.geocoder] || (config => GEOCODER_ENGINES.standard(config, this.geocoder));\n\t\tonceParentAvailable(this).then(() => this._parent?.onceMapReady?.().then(() => {\n\t\t\tif(!this._geolocate) {\n\t\t\t\tthis._geolocate = this._geolocateCtrl.onAdd(this._parent.map);\n\t\t\t\tthis._geolocate.setAttribute(\"slot\", \"pre\");\n\t\t\t}\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onInput(query) {\n\t\tconst rgxCoords = /([-+]?\\d{1,2}\\.\\d+),\\s*([-+]?\\d{1,3}\\.\\d+)/;\n\t\tconst coordsMatch = query.match(rgxCoords);\n\t\tconst rgxUuid = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/;\n\t\tconst uuidMatch = query.match(rgxUuid);\n\t\n\t\tif(coordsMatch) {\n\t\t\tconst lat = parseFloat(coordsMatch[1]);\n\t\t\tconst lon = parseFloat(coordsMatch[2]);\n\t\t\tthis._parent.map.jumpTo({\n\t\t\t\tcenter: [lon, lat],\n\t\t\t\tzoom: 16,\n\t\t\t});\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\t\telse if(uuidMatch) {\n\t\t\tthis._parent.select(null, query);\n\t\t\treturn Promise.resolve(true);\n\t\t}\n\t\telse {\n\t\t\treturn this._geocoderEngine({\n\t\t\t\tquery,\n\t\t\t\tlimit: 5,\n\t\t\t\t//bbox: this._parent.map.getBounds().toArray().map(d => d.join(\",\")).join(\",\"),\n\t\t\t\tproximity: this._parent.map.getCenter().lat+\",\"+this._parent.map.getCenter().lng,\n\t\t\t}).then(data => {\n\t\t\t\tdata = data.features.map(f => ({\n\t\t\t\t\ttitle: f.place_name.split(\",\")[0],\n\t\t\t\t\tsubtitle: f.place_name.split(\",\").slice(1).join(\", \"),\n\t\t\t\t\tdata: f\n\t\t\t\t}));\n\t\t\t\treturn data;\n\t\t\t});\n\t\t}\n\t}\n\n\t/** @private */\n\t_onSelect(e) {\n\t\tconst entry = e.detail;\n\t\tif(entry) {\n\t\t\tif(entry.data.bounds) {\n\t\t\t\tthis._parent?.map.fitBounds(entry.data.bounds, {animate: false});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._parent?.map.jumpTo({\n\t\t\t\t\tcenter: entry.data.center,\n\t\t\t\t\tzoom: entry.data.zoom || 13,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst isSmall = this._parent?.isWidthSmall() || false;\n\n\t\treturn html`\n\t\t\t<pnx-search-bar\n\t\t\t\tid=\"pnx-widget-search-bar\"\n\t\t\t\tplaceholder=${this._parent?._t.pnx.search_address}\n\t\t\t\t._parent=${this._parent}\n\t\t\t\t.searcher=${this._onInput.bind(this)}\n\t\t\t\t.reduceable=${isSmall}\n\t\t\t\t.reduced=${isSmall}\n\t\t\t\tsize=\"xxl\"\n\t\t\t\tclass=\"pnx-print-hidden\"\n\t\t\t\t@result=${this._onSelect.bind(this)}\n\t\t\t>\n\t\t\t\t${this._geolocate}\n\t\t\t</pnx-search-bar>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-geosearch\", GeoSearch);\n","import { LitElement, html, css, nothing } from \"lit\";\nimport { panel } from \"../../styles\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons/faInfoCircle\";\nimport PanoramaxImg from \"../../../img/panoramax.svg\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { PanoramaxWebsiteURL } from \"../../../utils/services\";\n\n/**\n * Legend widget, handling switch between map and photo components.\n * Also displays a default \"About Panoramax\" message.\n * @class Panoramax.components.ui.widgets.Legend\n * @element pnx-widget-legend\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @slot `editors` External links to map editors, or any tool that may be helpful. Defaults to OSM tools (iD & JOSM).\n * @example\n * ```html\n * <!-- Default legend -->\n * <pnx-widget-legend\n *   _parent=${viewer}\n *   focus=\"map\"\n *   picture=\"PICTURE-ID-IF-ANY\"\n * ></pnx-widget-legend>\n * \n * <!-- With custom editor links -->\n * <pnx-widget-legend\n *   _parent=${viewer}\n *   focus=\"map\"\n *   picture=\"PICTURE-ID-IF-ANY\"\n * >\n *   <div slot=\"editors\"><a href=\"http://my.own.tool\">Edit in my own tool</a></div>\n * </pnx-widget-legend>\n * \n * <!-- Lighter version -->\n * <pnx-widget-legend\n *   _parent=${viewer}\n *   focus=\"pic\"\n *   picture=\"PICTURE-ID-IF-ANY\"\n *   light\n * ></pnx-widget-legend>\n * ```\n */\nexport default class Legend extends LitElement {\n\t/** @private */\n\tstatic styles = [panel, css`\n\t\t:host {\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pnx-panel[part=\"panel\"] {\n\t\t\tborder-radius: 10px;\n\t\t\tposition: relative;\n\t\t\tmax-width: 450px;\n\t\t\tz-index: 121; /* To appear above mini component */\n\t\t\tmin-width: unset;\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pnx-panel[part=\"panel\"].pnx-padded {\n\t\t\tpadding: 10px;\n\t\t\twidth: 250px;\n\t\t}\n\t\t.presentation {\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1em;\n\t\t\tdisplay: flex;\n\t\t\tgap: 5px;\n\t\t\talign-items: center;\n\t\t}\n\t\t.logo {\n\t\t\twidth: 45px;\n\t\t}\n\t\tpnx-map-legend {\n\t\t\tdisplay: block;\n\t\t\tmargin-top: 5px;\n\t\t}\n\n\t\t/* Lighter/smaller version */\n\t\t.pnx-panel[part=\"panel\"].pnx-legend-light {\n\t\t\tdisplay: flex;\n\t\t\tgap: 3px;\n\t\t\tpadding: 3px 8px 3px 3px;\n\t\t\twidth: unset;\n\t\t\tmin-width: unset;\n\t\t\talign-items: center;\n\t\t\tfont-size: 10px;\n\t\t\tmargin-right: -10px;\n\t\t\tmargin-bottom: -10px;\n\t\t\tborder-radius: 0;\n\t\t\tborder-top-left-radius: 5px;\n\t\t\tborder-right: none;\n  \t\t\tborder-bottom: none;\n\t\t}\n\t\t.pnx-legend-light a,\n\t\t.pnx-legend-light .presentation {\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t.pnx-legend-light .logo {\n\t\t\twidth: 15px;\n\t\t}\n\n\t\t.pnx-legend-light pnx-map-legend {\n\t\t\twidth: max-content;\n\t\t\tmargin-top: unset;\n\t\t\tfont-size: 10px;\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.Legend#\n\t * @type {Object}\n\t * @property {string} [focus] The focused main component (map, pic)\n\t * @property {string} [picture] The picture ID\n\t * @property {boolean} [light=false] Lighter version (for iframes)\n\t */\n\tstatic properties = {\n\t\tfocus: {type: String},\n\t\tpicture: {type: String},\n\t\tlight: {type: Boolean},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.light = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this.requestUpdate());\n\t}\n\n\trender() {\n\t\tconst classes = {\n\t\t\t\"pnx-panel\": true,\n\t\t\t\"pnx-padded\": this.focus == \"map\",\n\t\t\t\"pnx-legend-light\": this.light,\n\t\t};\n\n\t\treturn html`<div class=${classMap(classes)} part=\"panel\">\n\t\t\t<div\n\t\t\t\tclass=\"presentation\"\n\t\t\t\tstyle=${!this.light && this.focus != \"map\" && this.picture ? \"display: none\": \"\"}\n\t\t\t>\n\t\t\t\t<img class=\"logo\" src=${PanoramaxImg} alt=\"\" />\n\n\t\t\t\t${this.light ? html`\n\t\t\t\t\t&copy; <a\n\t\t\t\t\t\thref=${PanoramaxWebsiteURL()}\n\t\t\t\t\t\ttitle=${this._parent?._t.map.more_panoramax}\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t>${this._parent?._t.pnx.panoramax}</a> |\n\t\t\t\t` : html`\n\t\t\t\t\t<div>\n\t\t\t\t\t\t${this._parent?._t.pnx.whats_panoramax}\n\t\t\t\t\t\t<pnx-link-button\n\t\t\t\t\t\t\ttitle=${this._parent?._t.map.more_panoramax}\n\t\t\t\t\t\t\tkind=\"superinline\"\n\t\t\t\t\t\t\thref=${PanoramaxWebsiteURL()}\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t${fa(faInfoCircle)}\n\t\t\t\t\t\t</pnx-link-button>\n\t\t\t\t\t</div>\n\t\t\t\t`}\n\t\t\t</div>\n\t\t\t<pnx-picture-legend\n\t\t\t\t._parent=${this._parent}\n\t\t\t\tstyle=${this.focus == \"map\" ? \"display: none\": \"\"}\n\t\t\t\tcollapsable\n\t\t\t\tlight=${this.light || nothing}\n\t\t\t>\n\t\t\t\t<slot slot=\"editors\" name=\"editors\">\n\t\t\t\t\t<pnx-widget-osmeditors ._parent=${this._parent} />\n\t\t\t\t</slot>\n\t\t\t</pnx-picture-legend>\n\t\t\t<pnx-map-legend\n\t\t\t\t._parent=${this._parent}\n\t\t\t\tstyle=${this.focus != \"map\" ? \"display: none\": \"\"}\n\t\t\t\tlight=${this.light || nothing}\n\t\t\t></pnx-map-legend>\n\t\t</div>`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-legend\", Legend);\n","import { LitElement, html, nothing } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { DISABLED_LEVEL } from \"../../../utils/indoor\";\nimport { faCaretUp } from \"@fortawesome/free-solid-svg-icons/faCaretUp\";\nimport { faCaretDown } from \"@fortawesome/free-solid-svg-icons/faCaretDown\";\nimport { faTimes } from \"@fortawesome/free-solid-svg-icons/faTimes\";\nimport \"../ButtonGroup.css\";\nimport \"./LevelSelect.css\";\n\n/**\n * Widget for indoor level selecting over map.\n * It relies on indoor= MapLibre plugin to work, so this should be enabled before calling this widget.\n * @class Panoramax.components.ui.widgets.LevelSelect\n * @element pnx-level-select\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-level-select _parent=${viewer} />\n * ```\n */\nexport default class LevelSelect extends LitElement {\n\t/** @private */\n\tstatic properties = {\n\t\t_expanded: {state: true},\n\t};\n\n\t/** @private */\n\tcreateRenderRoot() {\n\t\treturn this;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this)\n\t\t\t.then(this._parent.onceMapReady?.())\n\t\t\t.then(() => {\n\t\t\t\tthis._parent.map.indoorEqual.on(\"levelchange\", () => this.requestUpdate());\n\t\t\t\tthis._parent.map.indoorEqual.on(\"levelschange\", () => this.requestUpdate());\n\t\t\t});\n\t}\n\n\t/** @private */\n\tupdated(changedProps) {\n\t\tsuper.updated(changedProps);\n\n\t\t// Make level list scroll to see currently selected level\n\t\tif(this._expanded) {\n\t\t\tif(changedProps?.has(\"_expanded\")) {\n\t\t\t\tthis._scrollToCurrentLevel(false, \"instant\");\n\t\t\t} else {\n\t\t\t\tthis._scrollToCurrentLevel(true, \"smooth\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\t_scrollToCurrentLevel(immediate, behavior) {\n\t\tconst lvlSelected = this.renderRoot.querySelector(\".pnx-level-active\");\n\t\tsetTimeout(\n\t\t\t() => lvlSelected?.scrollIntoView({behavior, block: \"center\", container: \"nearest\"}),\n\t\t\timmediate ? 0 : 50\n\t\t);\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst ieq = this._parent.map.indoorEqual;\n\n\t\t// Disabled level = hide\n\t\tif(ieq.level === DISABLED_LEVEL || ieq.levels.length === 0) { return nothing; }\n\n\t\t// Find upper/lower level\n\t\t// Note that levels are reverse sorted\n\t\tconst lvlId = ieq.levels.findIndex(l => l == ieq.level);\n\t\tconst lvlUpId = lvlId > 0 ? lvlId - 1 : null;\n\t\tconst lvlUp = lvlUpId !== null ? ieq.levels[lvlUpId] : null;\n\t\tconst lvlDownId = lvlId < ieq.levels.length - 1 ? lvlId + 1 : null;\n\t\tconst lvlDown = lvlDownId !== null ? ieq.levels[lvlDownId] : null;\n\n\t\treturn html`\n\t\t\t<pnx-button-group\n\t\t\t\tdir=\"column\"\n\t\t\t\tsize=\"xl\"\n\t\t\t\tclass=\"pnx-print-hidden\"\n\t\t\t>\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\t@click=${() => ieq.setLevel(lvlUp)}\n\t\t\t\t\t.disabled=${lvlUp === null}\n\t\t\t\t\tclass=\"pnx-level-minimal\"\n\t\t\t\t\ttitle=${this._parent?._t?.pnx.indoor_selector_levelup}\n\t\t\t\t>${fa(faCaretUp)}</pnx-button>\n\n\t\t\t\t${this._expanded ? html`\n\t\t\t\t\t<pnx-button-group\n\t\t\t\t\t\tdir=\"column\"\n\t\t\t\t\t\tsize=\"xl\"\n\t\t\t\t\t\tclass=\"pnx-print-hidden pnx-level-scroller\"\n\t\t\t\t\t>\n\t\t\t\t\t\t${ieq.levels.map(l => html`\n\t\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\t\t\t\t@click=${() => ieq.setLevel(l)}\n\t\t\t\t\t\t\t\tclass=${l.length > 2 ? \"pnx-level-long\" : null}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t${ieq.level == l ? html`<span class=\"pnx-level-active\">${l}</span>`: l}\n\t\t\t\t\t\t\t</pnx-button>\n\t\t\t\t\t\t`)}\n\t\t\t\t\t</pnx-button-group>\n\t\t\t\t` : html`\n\t\t\t\t\t<pnx-button\n\t\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\t\tclass=\"pnx-level-minimal\"\n\t\t\t\t\t\ttitle=${this._parent?._t?.pnx.indoor_selector_expand}\n\t\t\t\t\t\t@click=${ieq.levels.length > 1 ? () => this._expanded = true : null}\n\t\t\t\t\t>${ieq.level}</pnx-button>\n\t\t\t\t`}\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\t@click=${() => ieq.setLevel(lvlDown)}\n\t\t\t\t\t.disabled=${lvlDown === null}\n\t\t\t\t\tclass=\"pnx-level-minimal\"\n\t\t\t\t\ttitle=${this._parent?._t?.pnx.indoor_selector_leveldown}\n\t\t\t\t>${fa(faCaretDown)}</pnx-button>\n\n\t\t\t\t${this._expanded ? html`\n\t\t\t\t\t<pnx-button\n\t\t\t\t\t\tkind=\"flat\"\n\t\t\t\t\t\tclass=\"pnx-level-shrink\"\n\t\t\t\t\t\t@click=${() => this._expanded = false}\n\t\t\t\t\t\ttitle=${this._parent?._t?.pnx.indoor_selector_shrink}\n\t\t\t\t\t>${fa(faTimes)}</pnx-button>\n\t\t\t\t` : nothing}\n\t\t\t</pnx-button-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-level-select\", LevelSelect);\n","import { LitElement, html, nothing } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faSliders } from \"@fortawesome/free-solid-svg-icons/faSliders\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons/faChevronDown\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons/faXmark\";\nimport { activeIcon } from \"../../styles\";\nimport { MAP_FILTERS } from \"../MapMore\";\n\n/**\n * Collapsible button showing off map filters menus.\n * @class Panoramax.components.ui.widgets.MapFiltersButton\n * @element pnx-widget-mapfilters\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-mapfilters user-search=\"\" _parent=${viewer} />\n * ```\n */\nexport default class MapFiltersButton extends LitElement {\n\t/** @private */\n\tstatic styles = [activeIcon];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.MapFiltersButton#\n\t * @type {Object}\n\t * @property {boolean} [user-search=false] Should user search filter show up ?\n\t * @property {boolean} [quality-score=false] Should quality score filter show up ?\n\t */\n\tstatic properties = {\n\t\t\"user-search\": {type: Boolean},\n\t\t\"quality-score\": {type: Boolean},\n\t\t_active: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis[\"user-search\"] = false;\n\t\tthis[\"quality-score\"] = false;\n\t\tthis._active = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\t// Listen to user visibility changes to switch the filter active icon\n\t\tonceParentAvailable(this).then(() => this._parent?.onceMapReady?.().then(() => {\n\t\t\tthis._active = (\n\t\t\t\tObject.keys(this._parent.map._mapFilters).filter(d => d && d !== \"theme\").length > 0\n\t\t\t\t|| this._parent.map.getVisibleUsers().filter(u => u !== \"geovisio\").length > 0\n\t\t\t);\n\t\t\t\n\t\t\tthis._parent.map.on(\"filters-changed\", e => {\n\t\t\t\tthis._active = (\n\t\t\t\t\tObject.keys(e).filter(d => d && MAP_FILTERS.includes(d) && d != \"theme\").length > 0\n\t\t\t\t\t|| this._parent.map.getVisibleUsers().filter(u => u !== \"geovisio\").length > 0\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tthis._parent.map.on(\"users-changed\", e => {\n\t\t\t\tthis._active = (\n\t\t\t\t\tObject.keys(this._parent.map._mapFilters).filter(d => d && d !== \"theme\").length > 0\n\t\t\t\t\t|| e.usersIds.filter(u => u !== \"geovisio\").length > 0\n\t\t\t\t);\n\t\t\t});\n\t\t}));\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst isSmall = this._parent?.isWidthSmall();\n\t\tconst resetIcon = fa(faXmark, {styles: {\"pointer-events\": \"auto\"}});\n\t\tresetIcon.addEventListener(\"click\", e => {\n\t\t\te.stopPropagation();\n\t\t\tthis.shadowRoot.querySelector(\"pnx-map-filters-menu\")._onReset();\n\t\t\tthis.shadowRoot.querySelector(\"#pnx-widget-filter\")._opened = false;\n\t\t});\n\n\t\treturn html`\n\t\t\t<pnx-togglable-group\n\t\t\t\tid=\"pnx-widget-filter\"\n\t\t\t\tpadded=\"false\"\n\t\t\t\tclass=\"pnx-only-map pnx-print-hidden\"\n\t\t\t\t._parent=${this._parent}\n\t\t\t>\n\t\t\t\t<pnx-button kind=\"flat\" size=\"xl\" slot=\"button\">\n\t\t\t\t\t${fa(faSliders)}\n\t\t\t\t\t${this._active ? html`<span class=\"pnx-active-icon\"></span>` : nothing}\n\t\t\t\t\t${isSmall ? nothing : this._parent?._t.pnx.filters}\n\t\t\t\t\t${isSmall ? nothing : (this._active ? resetIcon : fa(faChevronDown))}\n\t\t\t\t</pnx-button>\n\t\t\t\t<pnx-map-filters-menu\n\t\t\t\t\tid=\"pnx-map-filters-menu\"\n\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t\tuser-search=${this[\"user-search\"]}\n\t\t\t\t\tquality-score=${this[\"quality-score\"]}\n\t\t\t\t></pnx-map-filters-menu>\n\t\t\t</pnx-togglable-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-mapfilters\", MapFiltersButton);\n","import { LitElement, html, nothing } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faLayerGroup } from \"@fortawesome/free-solid-svg-icons/faLayerGroup\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons/faChevronDown\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons/faXmark\";\nimport { activeIcon } from \"../../styles\";\n\n/**\n * Collapsible button showing off map filters menus.\n * @class Panoramax.components.ui.widgets.MapLayersButton\n * @element pnx-widget-maplayers\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-maplayers _parent=${viewer} />\n * ```\n */\nexport default class MapLayersButton extends LitElement {\n\t/** @private */\n\tstatic styles = [activeIcon];\n\n\t/** @private */\n\tstatic properties = {\n\t\t_active: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._active = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tconst nullThemes = [undefined, null, \"\", \"default\"];\n\n\t\tonceParentAvailable(this).then(() => this._parent?.onceMapReady?.().then(() => {\n\t\t\tthis._active = !nullThemes.includes(this._parent.map._mapFilters.theme);\n\t\t\tthis._parent.map.on(\"filters-changed\", e => {\n\t\t\t\tthis._active = !nullThemes.includes(e.theme);\n\t\t\t});\n\t\t}));\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst isSmall = this._parent?.isWidthSmall();\n\t\tconst resetIcon = fa(faXmark, {styles: {\"pointer-events\": \"auto\"}});\n\t\tresetIcon.addEventListener(\"click\", e => {\n\t\t\te.stopPropagation();\n\t\t\tconst menu = this.shadowRoot.querySelector(\"pnx-map-layers-menu\");\n\t\t\tmenu.shadowRoot.querySelector(\"#pnx-map-theme\").value = \"default\";\n\t\t\tmenu._onThemeSelect({target: {value: \"default\"}});\n\t\t\tthis.shadowRoot.querySelector(\"#pnx-widget-map-layers\")._opened = false;\n\t\t});\n\n\t\treturn html`\n\t\t\t<pnx-togglable-group\n\t\t\t\tid=\"pnx-widget-map-layers\"\n\t\t\t\tclass=\"pnx-print-hidden\"\n\t\t\t\t._parent=${this._parent}\n\t\t\t>\n\t\t\t\t<pnx-button kind=\"flat\" size=\"xl\" slot=\"button\">\n\t\t\t\t\t${fa(faLayerGroup)}\n\t\t\t\t\t${this._active ? html`<span class=\"pnx-active-icon\"></span>` : nothing}\n\t\t\t\t\t${isSmall ? nothing : this._parent?._t.pnx.layers}\n\t\t\t\t\t${isSmall ? nothing : (this._active ? resetIcon : fa(faChevronDown))}\n\t\t\t\t</pnx-button>\n\t\t\t\t<pnx-map-layers-menu\n\t\t\t\t\tid=\"pnx-map-layers-menu\"\n\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t></pnx-map-layers-menu>\n\t\t\t</pnx-togglable-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-maplayers\", MapLayersButton);\n","import { LitElement, html, nothing, css } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { josmBboxParameters } from \"../../../utils/utils\";\nimport { IdEditorURL } from \"../../../utils/services\";\nimport { faLocationDot } from \"@fortawesome/free-solid-svg-icons/faLocationDot\";\nimport { faSatelliteDish } from \"@fortawesome/free-solid-svg-icons/faSatelliteDish\";\nimport { faExternalLinkAlt } from \"@fortawesome/free-solid-svg-icons/faExternalLinkAlt\";\n\nconst JOSM_REMOTE_URL = \"http://127.0.0.1:8111\";\n\n/**\n * OSM Editors component offers direct links to OpenStreetMap's iD and JOSM editors.\n * @class Panoramax.components.ui.widgets.OSMEditors\n * @element pnx-widget-osmeditors\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-osmeditors _parent=${viewer} />\n * ```\n */\nexport default class OSMEditors extends LitElement {\n\t/** @private */\n\tstatic properties = {\n\t\t_pic: {state: true},\n\t\t_josm: {state: true},\n\t};\n\n\t/** @private */\n\tstatic styles = css`\n\t\t:host { display: inline-flex; gap: 5px; }\n\t\t:host > * { flex: 1; }\n\t\tpnx-link-button::part(btn) { height: auto; }\n\t`;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._josm = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {\n\t\t\tthis._parent.onceFirstPicLoaded().then(this._onPictureLoad.bind(this));\n\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", this._onPictureLoad.bind(this));\n\t\t});\n\t}\n\n\t/** @private */\n\t_onPictureLoad() {\n\t\tthis._pic = this._parent?.psv?.getPictureMetadata();\n\t}\n\n\t/**\n\t * Enable or disable JOSM live editing using [Remote](https://josm.openstreetmap.de/wiki/Help/RemoteControlCommands)\n\t * @private\n\t */\n\t_toggleJOSMLive() {\n\t\tthis._josm = !this._josm;\n\n\t\tif(this._josm) {\n\t\t\t// Check if JOSM remote is enabled\n\t\t\tfetch(JOSM_REMOTE_URL+\"/version\")\n\t\t\t\t.then(() => {\n\t\t\t\t\t// First loading : download + zoom\n\t\t\t\t\tconst p1 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());\n\t\t\t\t\tif(p1) {\n\t\t\t\t\t\tconst url = `${JOSM_REMOTE_URL}/load_and_zoom?${p1}`;\n\t\t\t\t\t\tfetch(url).catch(e => {\n\t\t\t\t\t\t\tconsole.warn(e);\n\t\t\t\t\t\t\tthis._toggleJOSMLive();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable event listening\n\t\t\t\t\tthis._josmListener = () => {\n\t\t\t\t\t\tconst p2 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());\n\t\t\t\t\t\tif(p2) {\n\t\t\t\t\t\t\t// Next loadings : just zoom\n\t\t\t\t\t\t\t//   This avoids desktop focus to go on JOSM instead of\n\t\t\t\t\t\t\t//   staying on web browser\n\t\t\t\t\t\t\tconst url = `${JOSM_REMOTE_URL}/zoom?${p2}`;\n\t\t\t\t\t\t\tfetch(url).catch(e => {\n\t\t\t\t\t\t\t\tconsole.warn(e);\n\t\t\t\t\t\t\t\tthis._toggleJOSMLive();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tthis._parent?.psv?.addEventListener?.(\"picture-loaded\", this._josmListener);\n\t\t\t\t\tthis._parent?.psv?.addEventListener?.(\"picture-loading\", this._josmListener);\n\t\t\t\t})\n\t\t\t\t.catch(e => {\n\t\t\t\t\tconsole.warn(e);\n\t\t\t\t\talert(this._parent?._t.pnx.error_josm);\n\t\t\t\t\tthis._toggleJOSMLive();\n\t\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tif(this._josmListener) {\n\t\t\t\tthis._parent?.psv?.removeEventListener?.(\"picture-loading\", this._josmListener);\n\t\t\t\tthis._parent?.psv?.removeEventListener?.(\"picture-loaded\", this._josmListener);\n\t\t\t\tdelete this._josmListener;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\tif(!this._pic) { return nothing; }\n\n\t\t// Mobile -> Geo URI\n\t\tif(this._parent?.isWidthSmall()) {\n\t\t\treturn html`\n\t\t\t\t<pnx-link-button\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\thref=\"geo:${this._pic.gps[1]},${this._pic.gps[0]};u=3\"\n\t\t\t\t>\n\t\t\t\t\t${fa(faExternalLinkAlt)} ${this._parent?._t.pnx.geo_uri}\n\t\t\t\t</pnx-link-button>\n\t\t\t`;\n\t\t}\n\t\telse {\n\t\t\tconst idOpts = {\n\t\t\t\t\"map\": `19/${this._pic.gps[1]}/${this._pic.gps[0]}`,\n\t\t\t\t\"source\": \"Panoramax\",\n\t\t\t\t\"photo_overlay\": \"panoramax\",\n\t\t\t\t\"photo\": `panoramax/${this._pic.id}`,\n\t\t\t};\n\t\t\tconst idUrl = idOpts && `${IdEditorURL()}#${new URLSearchParams(idOpts).toString()}`;\n\n\t\t\treturn html`\n\t\t\t\t<pnx-link-button\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\thref=${idUrl}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\ttitle=\"${this._parent?._t.pnx.contribute_id}\"\n\t\t\t\t>\n\t\t\t\t\t${fa(faLocationDot)} ${this._parent?._t.pnx.id}\n\t\t\t\t</pnx-link-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tid=\"pnx-edit-josm\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tactive=${this._josm ? \"\" : nothing}\n\t\t\t\t\t@click=${this._toggleJOSMLive}\n\t\t\t\t\ttitle=\"${this._parent?._t.pnx.josm_live}\"\n\t\t\t\t>\n\t\t\t\t\t${fa(faSatelliteDish)} ${this._parent?._t.pnx.josm}\n\t\t\t\t</pnx-button>\n\t\t\t`;\n\t\t}\n\t}\n}\n\ncustomElements.define(\"pnx-widget-osmeditors\", OSMEditors);\n","import { LitElement, html, nothing, css } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faEllipsisV } from \"@fortawesome/free-solid-svg-icons/faEllipsisV\";\nimport { noprint } from \"../../styles\";\n\n/**\n * Picture Legend Actions is a menu showing up complementary actions for picture legend.\n * @class Panoramax.components.ui.widgets.PictureLegendActions\n * @element pnx-picture-legend-actions\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-picture-legend-actions _parent=${viewer} />\n * ```\n */\nexport default class PictureLegendActions extends LitElement {\n\t/** @private */\n\tstatic styles = [ noprint, css`\n\t\tpnx-togglable-group::part(menu) {\n\t\t\tborder-radius: 5px;\n\t\t\tmin-width: unset;\n\t\t}\n\t`];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.PictureLegendActions#\n\t * @type {Object}\n\t * @property {boolean} [full=false] Show advanced actions\n\t */\n\tstatic properties = {\n\t\tfull: { type: Boolean },\n\t\t_meta: { state: true },\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.full = false;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {\n\t\t\tthis._meta = this._parent.psv.getPictureMetadata();\n\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\tthis._meta = this._parent.psv.getPictureMetadata();\n\t\t\t});\n\t\t});\n\t}\n\n\t/** @private */\n\t_onPrint() {\n\t\tthis._closeGroup();\n\t\twindow.print();\n\t}\n\n\t/** @private */\n\t_closeGroup() {\n\t\tthis.renderRoot.querySelector(\"#pic-legend-headline-menu\").close();\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`<pnx-togglable-group padded=\"false\" id=\"pic-legend-headline-menu\" ._parent=${this._parent}>\n\t\t\t<pnx-button slot=\"button\" kind=\"inline\">${fa(faEllipsisV)}</pnx-button>\n\t\t\t<pnx-list-group class=\"pnx-print-hidden\" @click=${this._closeMenu}>\n\t\t\t\t${this._meta ? html`<pnx-copy-button ._t=${this._parent?._t} text=${this._meta.id} unstyled>\n\t\t\t\t\t${this._parent?._t.pnx.metadata_general_copy_picid}\n\t\t\t\t</pnx-copy-button>` : nothing}\n\n\t\t\t\t<a\n\t\t\t\t\tdownload\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\thref=${this._meta?.panorama?.hdUrl}\n\t\t\t\t\t@click=${this._closeGroup}\n\t\t\t\t>${this._parent?._t.pnx.share_image}</a>\n\n\t\t\t\t${this._parent.isWidthSmall() ? nothing : html`<button @click=${this._onPrint}>\n\t\t\t\t\t${this._parent?._t.pnx.share_print}\n\t\t\t\t</button>`}\n\n\t\t\t\t${this._parent?.api?.getRSSURL() && html`\n\t\t\t\t\t<a\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\thref=${this._parent?.api.getRSSURL(this._parent?.map?.getBounds?.())}\n\t\t\t\t\t\ttitle=${this._parent?._t.pnx.share_rss_title}\n\t\t\t\t\t\t@click=${this._closeGroup}\n\t\t\t\t\t>\n\t\t\t\t\t\t${this._parent?._t.pnx.share_rss}\n\t\t\t\t\t</a>\n\t\t\t\t`}\n\t\t\t</pnx-list-group>\n\t\t</pnx-togglable-group>`;\n\t}\n}\n\ncustomElements.define(\"pnx-picture-legend-actions\", PictureLegendActions);\n","import { LitElement, html, nothing } from \"lit\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faBackward } from \"@fortawesome/free-solid-svg-icons/faBackward\";\nimport { faPlay } from \"@fortawesome/free-solid-svg-icons/faPlay\";\nimport { faPause } from \"@fortawesome/free-solid-svg-icons/faPause\";\nimport { faForward } from \"@fortawesome/free-solid-svg-icons/faForward\";\nimport { faEllipsisVertical } from \"@fortawesome/free-solid-svg-icons/faEllipsisVertical\";\nimport \"./Player.css\";\n\n/**\n * Player widget shows prev/play/pause/next/more buttons in a unified toolbar.\n * @class Panoramax.components.ui.widgets.Player\n * @element pnx-widget-player\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-player _parent=${viewer} />\n * ```\n */\nexport default class Player extends LitElement {\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.Player#\n\t * @type {Object}\n\t * @property {boolean} [playing=false] Is sequence currently playing ?\n\t * @property {string} [size=xl] Group size (md, xl)\n\t * @property {string} [more=depends] Should we display the \"more options\" button (\"always\", \"never\", \"depends\" = only on large screens (default))\n\t */\n\tstatic properties = {\n\t\tplaying: {type: Boolean, reflect: true},\n\t\tsize: {type: String},\n\t\tmore: {type: String},\n\t\t_activePrev: {state: true},\n\t\t_activePlay: {state: true},\n\t\t_activeNext: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.playing = false;\n\t\tthis.size = \"xl\";\n\t\tthis.more = \"depends\";\n\t\tthis._activePrev = true;\n\t\tthis._activePlay = true;\n\t\tthis._activeNext = true;\n\t}\n\n\t/** @private */\n\tcreateRenderRoot() {\n\t\treturn this;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tonceParentAvailable(this).then(() => this._parent?.oncePSVReady?.().then(() => {\n\t\t\tthis._parent.psv.addEventListener(\"sequence-playing\", () => this.playing = true);\n\t\t\tthis._parent.psv.addEventListener(\"sequence-stopped\", () => this.playing = false);\n\t\t\tthis._parent.psv.addEventListener(\"picture-loaded\", this._changeActiveStates.bind(this));\n\t\t\tthis._parent.psv.addEventListener(\"pictures-navigation-changed\", this._changeActiveStates.bind(this));\n\t\t\tthis._changeActiveStates();\n\t\t}));\n\t}\n\n\t/** @private */\n\t_changeActiveStates() {\n\t\tif(this._parent.psv.getPicturesNavigation?.() === \"pic\") {\n\t\t\tthis._activeNext = false;\n\t\t\tthis._activePlay = false;\n\t\t\tthis._activePrev = false;\n\t\t}\n\t\telse {\n\t\t\tthis._activePrev = this._parent.psv.getPictureMetadata()?.sequence?.prevPic != null;\n\n\t\t\tif(this._parent.psv.getPictureMetadata()?.sequence?.nextPic != null) {\n\t\t\t\tthis._activeNext = true;\n\t\t\t\tthis._activePlay = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._activeNext = false;\n\t\t\t\tthis._activePlay = false;\n\t\t\t}\n\t\t}\n\t\tthis.requestUpdate();\n\t}\n\n\t/** @private */\n\t_onPlayClick() {\n\t\tif(this._parent?.psv?.isSequencePlaying()) {\n\t\t\tthis.playing = false;\n\t\t\tthis._parent?.psv?.stopSequence();\n\t\t}\n\t\telse {\n\t\t\tthis.playing = true;\n\t\t\tthis._parent?.psv?.playSequence();\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\tif(!this._parent?.psv?.addEventListener) { return nothing; }\n\n\t\treturn html`\n\t\t\t<pnx-button-group\n\t\t\t\tid=\"pnx-widget-player\"\n\t\t\t\tdir=\"row\"\n\t\t\t\tsize=${this.size}\n\t\t\t\tclass=\"pnx-print-hidden\"\n\t\t\t\tstyle=${!this._activePrev && !this._activePlay && !this._activeNext ? \"display: none\": \"\"}\n\t\t\t>\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\tid=\"pnx-player-prev\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.sequence_prev}\n\t\t\t\t\t@click=${() => this._parent?.psv?.goToPrevPicture()}\n\t\t\t\t\t.disabled=${!this._activePrev}\n\t\t\t\t>${fa(faBackward)}</pnx-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\tid=\"pnx-player-play\"\n\t\t\t\t\ttitle=${this.playing ? this._parent?._t.pnx.sequence_pause : this._parent?._t.pnx.sequence_play}\n\t\t\t\t\t.disabled=${!this._activePlay}\n\t\t\t\t\t@click=${this._onPlayClick.bind(this)}\n\t\t\t\t>${this.playing ? fa(faPause) : fa(faPlay)}</pnx-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\tid=\"pnx-player-next\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.sequence_next}\n\t\t\t\t\t.disabled=${!this._activeNext}\n\t\t\t\t\t@click=${() => this._parent?.psv?.goToNextPicture()}\n\t\t\t\t>${fa(faForward)}</pnx-button>\n\n\t\t\t\t${this.more === \"never\" || (this.more !== \"always\" && this._parent?.isWidthSmall()) ? nothing : html`\n\t\t\t\t\t<pnx-togglable-group padded=\"false\" ._parent=${this._parent}>\n\t\t\t\t\t\t<pnx-button\n\t\t\t\t\t\t\tkind=\"flat\"\n\t\t\t\t\t\t\tid=\"pnx-player-more\"\n\t\t\t\t\t\t\ttitle=${this._parent?._t.pnx.sequence_more}\n\t\t\t\t\t\t\tclass=${this.more === \"depends\" ? \"pnx-xs-hidden\" : \"\"}\n\t\t\t\t\t\t\tslot=\"button\"\n\t\t\t\t\t\t>${fa(faEllipsisVertical)}</pnx-button>\n\n\t\t\t\t\t\t<pnx-player-options ._parent=${this._parent}></pnx-player-options>\n\t\t\t\t\t</pnx-togglable-group>\n\t\t\t\t`}\n\t\t\t</pnx-button-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-player\", Player);\n","import { LitElement, html, nothing } from \"lit\";\nimport { fa } from \"../../../utils/widgets\";\nimport { faChevronDown } from \"@fortawesome/free-solid-svg-icons/faChevronDown\";\nimport { faXmark } from \"@fortawesome/free-solid-svg-icons/faXmark\";\nimport { faTags } from \"@fortawesome/free-solid-svg-icons/faTags\";\nimport { activeIcon } from \"../../styles\";\n\n/**\n * Collapsible button showing off tags filters menus.\n * @class Panoramax.components.ui.widgets.SemanticsFiltersButton\n * @element pnx-widget-semantics-filters\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-semantics-filters _parent=${viewer} />\n * ```\n */\nexport default class SemanticsFiltersButton extends LitElement {\n\t/** @private */\n\tstatic styles = [activeIcon];\n\n\t/**\n\t * Component properties.\n\t * @memberof Panoramax.components.ui.widgets.SemanticsFiltersButton#\n\t * @type {Object}\n\t */\n\tstatic properties = {\n\t\t_active: {state: true},\n\t};\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis._active = false;\n\t}\n\n\t/** @private */\n\t_onLayersChange(e) {\n\t\tthis._active = e.detail?.layers?.filter(l => l.metadata && l.layout?.visibility != \"none\").length > 0;\n\t}\n\n\t/** @private */\n\trender() {\n\t\tconst o = this._parent.map?.getSemanticOverlays?.();\n\t\tif(!o || o.length === 0) { return; }\n\t\t\n\t\tconst isSmall = this._parent?.isWidthSmall();\n\t\tconst resetIcon = fa(faXmark, {styles: {\"pointer-events\": \"auto\"}});\n\t\tresetIcon.addEventListener(\"click\", e => {\n\t\t\te.stopPropagation();\n\t\t\tthis._parent?.map?.toggleAllSemanticOverlays(false);\n\t\t});\n\n\t\treturn html`\n\t\t\t<pnx-togglable-group\n\t\t\t\tid=\"pnx-widget-semantics-filter\"\n\t\t\t\tclass=\"pnx-only-map pnx-print-hidden\"\n\t\t\t\t._parent=${this._parent}\n\t\t\t>\n\t\t\t\t<pnx-button kind=\"flat\" size=\"xl\" slot=\"button\">\n\t\t\t\t\t${fa(faTags)}\n\t\t\t\t\t${this._active ? html`<span class=\"pnx-active-icon\"></span>` : nothing}\n\t\t\t\t\t${isSmall ? nothing : this._parent?._t.pnx.semantics_title}\n\t\t\t\t\t${isSmall ? nothing : (this._active ? resetIcon : fa(faChevronDown))}\n\t\t\t\t</pnx-button>\n\t\t\t\t<pnx-map-semantics-filters-menu\n\t\t\t\t\tid=\"pnx-map-semantics-filters-menu\"\n\t\t\t\t\t._parent=${this._parent}\n\t\t\t\t\t@change=${this._onLayersChange}\n\t\t\t\t></pnx-map-semantics-filters-menu>\n\t\t\t</pnx-togglable-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-semantics-filters\", SemanticsFiltersButton);\n","import { LitElement, html } from \"lit\";\nimport { PSV_DEFAULT_ZOOM, PSV_ANIM_DURATION } from \"../Photo\";\nimport { PSV_ZOOM_DELTA } from \"../../core/PhotoViewer\";\nimport { fa, onceParentAvailable } from \"../../../utils/widgets\";\nimport { faPlus } from \"@fortawesome/free-solid-svg-icons/faPlus\";\nimport { faMinus } from \"@fortawesome/free-solid-svg-icons/faMinus\";\nimport \"../ButtonGroup.css\";\n\n/**\n * Widget for +/- zoom on PSV or Map.\n * @class Panoramax.components.ui.widgets.Zoom\n * @element pnx-widget-zoom\n * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)\n * @example\n * ```html\n * <pnx-widget-zoom _parent=${viewer} />\n * ```\n */\nexport default class Zoom extends LitElement {\n\t/** @private */\n\tstatic properties = {\n\t\t_lastWantedZoom: {state: true},\n\t};\n\n\t/** @private */\n\tcreateRenderRoot() {\n\t\treturn this;\n\t}\n\n\t/** @private */\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tonceParentAvailable(this).then(() => this._parent?.oncePSVReady?.().then(() => {\n\t\t\tthis._lastWantedZoom = this._parent?.psv?.getZoomLevel() || PSV_DEFAULT_ZOOM;\n\t\t}));\n\t}\n\n\t/** @private */\n\t_onClick(e, zoomIn) {\n\t\tif(this._parent.map && this._parent.isMapWide()) {\n\t\t\tif(zoomIn) { this._parent.map.zoomIn({}, {originalEvent: e}); }\n\t\t\telse { this._parent.map.zoomOut({}, {originalEvent: e}); }\n\t\t}\n\t\telse {\n\t\t\tif(this._parent.lastPsvAnim) { this._parent.lastPsvAnim.cancel(); }\n\t\t\tconst goToZoom = zoomIn ?\n\t\t\t\tMath.min(100, this._lastWantedZoom + PSV_ZOOM_DELTA)\n\t\t\t\t: Math.max(0, this._lastWantedZoom - PSV_ZOOM_DELTA);\n\t\t\tthis._parent.lastPsvAnim = this._parent.psv.animate({\n\t\t\t\tspeed: PSV_ANIM_DURATION,\n\t\t\t\tzoom: goToZoom\n\t\t\t});\n\t\t\tthis._lastWantedZoom = goToZoom;\n\t\t}\n\t}\n\n\t/** @private */\n\trender() {\n\t\treturn html`\n\t\t\t<pnx-button-group\n\t\t\t\tid=\"pnx-widget-zoom\"\n\t\t\t\tdir=\"column\"\n\t\t\t\tsize=\"xl\"\n\t\t\t\tclass=\"pnx-mobile-hidden pnx-print-hidden\"\n\t\t\t>\n\t\t\t\t<pnx-button\n\t\t\t\t\tid=\"pnx-zoom-in\"\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.zoomIn}\n\t\t\t\t\t@click=${e => this._onClick(e, true)}\n\t\t\t\t>${fa(faPlus)}</pnx-button>\n\n\t\t\t\t<pnx-button\n\t\t\t\t\tid=\"pnx-zoom-out\"\n\t\t\t\t\tkind=\"superflat\"\n\t\t\t\t\ttitle=${this._parent?._t.pnx.zoomOut}\n\t\t\t\t\t@click=${e => this._onClick(e, false)}\n\t\t\t\t>${fa(faMinus)}</pnx-button>\n\t\t\t</pnx-button-group>\n\t\t`;\n\t}\n}\n\ncustomElements.define(\"pnx-widget-zoom\", Zoom);\n","import { isNullId } from \"./utils\";\n\n// Do not use ./map import to avoid bundling Maplibre for PhotoViewer\nconst TILES_PICTURES_ZOOM = 15;\n\n/**\n * API contains various utility functions to communicate with Panoramax/STAC API\n *\n * @class Panoramax.utils.API\n * @typicalname api\n * @fires Panoramax.utils.API#ready\n * @fires Panoramax.utils.API#broken\n * @param {string} endpoint The endpoint. It corresponds to the <a href=\"https://github.com/radiantearth/stac-api-spec/blob/main/overview.md#example-landing-page\">STAC landing page</a>, with all links describing the API capabilities.\n * @param {object} [options] Options\n * @param {string|object} [options.style] General map style\n * @param {string} [options.tiles] API route serving pictures & sequences vector tiles\n * @param {boolean} [options.skipReadLanding=false] True to not call API landing page automatically\n * @param {object} [options.fetch] Set custom options for fetch calls made against API ([same syntax as fetch options parameter](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters))\n * @param {string[]} [options.users] List of initial user IDs to load map styles for\n */\nexport default class API extends EventTarget {\n\tconstructor(endpoint, options = {}) {\n\t\tsuper();\n\t\t\n\t\tif(endpoint === null || endpoint === undefined || typeof endpoint !== \"string\") {\n\t\t\tconst e = new Error(\"endpoint parameter is empty or not a valid string\");\n\t\t\tthis.dispatchEvent(new CustomEvent(\"broken\", {detail: {error: e}}));\n\t\t\tthrow e;\n\t\t}\n\n\t\t// Parse local endpoints\n\t\tif(endpoint.startsWith(\"/\")) {\n\t\t\tendpoint = window.location.href.split(\"/\").slice(0, 3).join(\"/\") + endpoint;\n\t\t}\n\n\t\t// Check endpoint\n\t\tif(!API.isValidHttpUrl(endpoint)) {\n\t\t\tconst e = new Error(`endpoint parameter is not a valid URL: ${endpoint}`);\n\t\t\tthis.dispatchEvent(new CustomEvent(\"broken\", {detail: {error: e}}));\n\t\t\tthrow e;\n\t\t}\n\n\t\tthis._endpoint = endpoint;\n\t\tthis._isReady = 0;\n\t\tthis._dataBbox = null;\n\t\tthis._fetchOpts = options?.fetch || {};\n\t\tthis._metadata = {};\n\t\tthis._configuration = null;\n\n\t\tif(options.skipReadLanding) { return; }\n\t\tthis._readLanding = fetch(endpoint, this._getFetchOptions())\n\t\t\t.then(res => res.json())\n\t\t\t.then(landing => this._parseLanding(landing, options))\n\t\t\t.catch(e => {\n\t\t\t\tthis._isReady = -1;\n\t\t\t\tconsole.error(e);\n\n\t\t\t\t/**\n\t\t\t\t * Event when API is broken.\n\t\t\t\t * This happens on any API loading or map styling issue.\n\t\t\t\t * @event Panoramax.utils.API#broken\n\t\t\t\t * @type {CustomEvent}\n\t\t\t\t * @property {Error} detail.error The original error\n\t\t\t\t */\n\t\t\t\tthis.dispatchEvent(new CustomEvent(\"broken\", {detail: {error: e}}));\n\n\t\t\t\treturn Promise.reject(\"Viewer failed to communicate with API\");\n\t\t\t})\n\t\t\t.then(() => this._loadMapStyles(options.style, options.users))\n\t\t\t.then(() => {\n\t\t\t\tthis._isReady = 1;\n\n\t\t\t\t/**\n\t\t\t\t * Event when API is ready to use.\n\t\t\t\t * This happens after initial API read and map styles load.\n\t\t\t\t * @event Panoramax.utils.API#ready\n\t\t\t\t * @type {Event}\n\t\t\t\t */\n\t\t\t\tthis.dispatchEvent(new Event(\"ready\"));\n\n\t\t\t\treturn \"API is ready\";\n\t\t\t});\n\t}\n\n\t/**\n\t * Resolves when the API is ready to be used.\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {Promise}\n\t * @fulfil {string} \"API is ready\" when initialization is complete.\n\t * @reject {string} Error message\n\t */\n\tonceReady() {\n\t\tif(this._isReady == -1) {\n\t\t\treturn Promise.reject(\"Viewer failed to communicate with API\");\n\t\t}\n\t\telse if(this._isReady == 1) {\n\t\t\treturn Promise.resolve(\"API is ready\");\n\t\t}\n\t\telse {\n\t\t\treturn this._readLanding;\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the API is ready to be used.\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {boolean} True if the API is ready, false otherwise.\n\t */\n\tisReady() {\n\t\treturn this._isReady == 1;\n\t}\n\n\t/**\n\t * List of available features offered by API\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {string[]} Keywords of enabled features\n\t */\n\tgetAvailableFeatures() {\n\t\treturn Object.entries(this._endpoints).filter(e => e[1] !== null).map(e => e[0]);\n\t}\n\n\t/**\n\t * List of unavailable features on API\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {string[]} Keywords of disabled features\n\t */\n\tgetUnavailableFeatures() {\n\t\treturn Object.entries(this._endpoints).filter(e => e[1] === null).map(e => e[0]);\n\t}\n\n\t/**\n\t * Interprets JSON landing page and store important information\n\t * @memberOf Panoramax.utils.API#\n\t * @private\n\t */\n\t_parseLanding(landing, options) {\n\t\tthis._endpoints = {\n\t\t\t\"collections\": null,\n\t\t\t\"search\": null,\n\t\t\t\"style\": null,\n\t\t\t\"user_style\": null,\n\t\t\t\"tiles\": options?.tiles || null,\n\t\t\t\"user_tiles\": null,\n\t\t\t\"user_search\": null,\n\t\t\t\"collection_preview\": null,\n\t\t\t\"item_preview\": null,\n\t\t\t\"rss\": null,\n\t\t\t\"report\": null,\n\t\t\t\"queryables\": null,\n\t\t};\n\n\t\tif(!landing || !landing.links || !Array.isArray(landing.links)) {\n\t\t\tthrow new Error(\"API Landing page doesn't contain 'links' list\");\n\t\t}\n\n\t\tif(!landing.stac_version.startsWith(\"1.\")) {\n\t\t\tthrow new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${landing.stac_version})`);\n\t\t}\n\n\t\t// Read metadata\n\t\tthis._metadata.name = landing.title || \"Unnamed\";\n\t\tthis._metadata.stac_version = landing.stac_version;\n\t\tthis._metadata.geovisio_version = landing.geovisio_version;\n\n\t\t// Read links\n\t\tconst supportedLinks = [\n\t\t\t{\n\t\t\t\trel: \"search\",\n\t\t\t\ttype: \"application/geo+json\",\n\t\t\t\tendpointId: \"search\",\n\t\t\t\tmandatory: true,\n\t\t\t\tmissingIssue: \"No direct access to pictures metadata.\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"data\",\n\t\t\t\ttype: \"application/json\",\n\t\t\t\tendpointId: \"collections\",\n\t\t\t\tmandatory: true,\n\t\t\t\tmissingIssue: \"No way for viewer to access sequences.\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"data\",\n\t\t\t\ttype: \"application/rss+xml\",\n\t\t\t\tendpointId: \"rss\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"xyz\",\n\t\t\t\ttype: \"application/vnd.mapbox-vector-tile\",\n\t\t\t\tendpointId: \"tiles\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"xyz-style\",\n\t\t\t\ttype: \"application/json\",\n\t\t\t\tendpointId: \"style\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"user-xyz-style\",\n\t\t\t\ttype: \"application/json\",\n\t\t\t\tendpointId: \"user_style\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"user-xyz\",\n\t\t\t\ttype: \"application/vnd.mapbox-vector-tile\",\n\t\t\t\tendpointId: \"user_tiles\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"user-search\",\n\t\t\t\ttype: \"application/json\",\n\t\t\t\tendpointId: \"user_search\",\n\t\t\t\tmissingIssue: \"Filter map data by user name will not be available.\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"collection-preview\",\n\t\t\t\ttype: \"image/jpeg\",\n\t\t\t\tendpointId: \"collection_preview\",\n\t\t\t\tmissingIssue: \"Display of thumbnail could be slower.\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"item-preview\",\n\t\t\t\ttype: \"image/jpeg\",\n\t\t\t\tendpointId: \"item_preview\",\n\t\t\t\tmissingIssue: \"Display of thumbnail could be slower.\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"report\",\n\t\t\t\ttype: \"application/json\",\n\t\t\t\tendpointId: \"report\"\n\t\t\t},\n\t\t\t{\n\t\t\t\trel: \"http://www.opengis.net/def/rel/ogc/1.0/queryables\",\n\t\t\t\ttype: \"application/schema+json\",\n\t\t\t\tendpointId: \"queryables\",\n\t\t\t\tmissingIssue: \"Tags map overlay will not be available.\"\n\t\t\t}\n\t\t];\n\n\t\tconst blockingIssues = [];\n\t\tconst warningIssues = [];\n\n\t\tsupportedLinks.forEach(sl => {\n\t\t\t// Find link in landing\n\t\t\tconst ll = landing.links.find(ll => ll.rel == sl.rel && ll.type == sl.type);\n\n\t\t\t// No link found\n\t\t\tif(!ll) {\n\t\t\t\tif(!this._endpoints[sl.endpointId]) {\n\t\t\t\t\tlet label = `API doesn't offer a '${sl.rel}' (${sl.type}) endpoint in its links`;\n\t\t\t\t\tif(sl.missingIssue) { label += `\\n${sl.missingIssue}`; }\n\n\t\t\t\t\t// Display issue (either blocking or not)\n\t\t\t\t\tif(sl.mandatory) { blockingIssues.push(label); }\n\t\t\t\t\telse if(sl.missingIssue) { warningIssues.push(label); }\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Link found\n\t\t\telse {\n\t\t\t\t// Invalid link\n\t\t\t\tif(!API.isValidHttpUrl(ll.href)) {\n\t\t\t\t\tthrow new Error(`API endpoint '${ll.rel}' (${ll.type}) is not a valid URL: ${ll.href}`);\n\t\t\t\t}\n\n\t\t\t\t// Valid link -> stored in endpoints\n\t\t\t\tif(!this._endpoints[sl.endpointId]) {\n\t\t\t\t\tthis._endpoints[sl.endpointId] = ll.href;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Complex checks\n\t\tif(!this._endpoints.style && !this._endpoints.tiles) {\n\t\t\twarningIssues.push(\"API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\\nMap widget will not be available.\");\n\t\t}\n\t\tif(!this._endpoints.user_style && !this._endpoints.user_tiles) {\n\t\t\twarningIssues.push(\"API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\\nFilter map data by user ID will not be available.\");\n\t\t}\n\n\t\t// Display warnings & errors\n\t\twarningIssues.forEach(w => console.warn(w));\n\t\tif(blockingIssues.length > 0) {\n\t\t\tthrow new Error(blockingIssues.join(\"\\n\"));\n\t\t}\n\n\t\t// Look for data BBox\n\t\tconst bbox = landing?.extent?.spatial?.bbox;\n\t\tthis._dataBbox = (\n\t\t\tbbox &&\n\t\t\tArray.isArray(bbox) &&\n\t\t\tbbox.length > 0 &&\n\t\t\tArray.isArray(bbox[0]) && bbox[0].length === 4\n\t\t) ?\n\t\t\t[[bbox[0][0], bbox[0][1]], [bbox[0][2], bbox[0][3]]]\n\t\t\t: null;\n\t}\n\n\t/**\n\t * Loads all MapLibre Styles JSON needed at start.\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string|object} style General map style\n\t * @param {string[]} users List of user IDs to handle. Should include special user \"geovisio\" for general tiles loading.\n\t * @returns {Promise} \n\t * @fulfil {null} When style is ready.\n\t * @private\n\t */\n\t_loadMapStyles(style, users) {\n\t\tconst mapUsers = new Set(users || []);\n\n\t\t// Load all necessary map styles\n\t\tthis.mapStyle = { version: 8, sources: {}, layers: [], metadata: {} };\n\t\tconst stylePromises = [ this.getMapStyle() ];\n\n\t\t// General map style\n\t\tif(typeof style === \"string\") {\n\t\t\tconst fetchOpts = style.startsWith(this._endpoint) ? this._getFetchOptions() : undefined;\n\t\t\tstylePromises.push(fetch(style, fetchOpts).then(res => res.json()));\n\t\t}\n\t\telse if(typeof style === \"object\") {\n\t\t\tstylePromises.push(Promise.resolve(style));\n\t\t}\n\n\t\t// By-user style\n\t\t[...mapUsers].filter(mu => mu !== \"geovisio\").forEach(mu => {\n\t\t\tstylePromises.push(this.getUserMapStyle(mu, true));\n\t\t});\n\n\t\treturn Promise.all(stylePromises)\n\t\t\t.then(styles => {\n\t\t\t\tconst overridableProps = [\n\t\t\t\t\t\"bearing\", \"center\", \"glyphs\", \"light\", \"name\",\n\t\t\t\t\t\"pitch\", \"sky\", \"sprite\", \"terrain\", \"transition\", \"zoom\"\n\t\t\t\t];\n\n\t\t\t\tstyles.forEach(style => {\n\t\t\t\t\toverridableProps.forEach(p => {\n\t\t\t\t\t\tif(style[p]) { this.mapStyle[p] = style[p] || this.mapStyle[p]; }\n\t\t\t\t\t});\n\t\t\t\t\tObject.assign(this.mapStyle.sources, style?.sources || {});\n\t\t\t\t\tObject.assign(this.mapStyle.metadata, style?.metadata || {});\n\t\t\t\t\tthis.mapStyle.layers = this.mapStyle.layers.concat(style?.layers || []);\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(e => console.error(e));\n\t}\n\n\t/**\n\t * Get the defaults fetch options to pass during API calls\n\t * @memberOf Panoramax.utils.API#\n\t * @param {boolean} [noTimeout=false] Set to true to avoid default timeout\n\t * @private\n\t * @returns {object} The fetch options\n\t */\n\t_getFetchOptions(noTimeout=false) {\n\t\treturn Object.assign({\n\t\t\tsignal: noTimeout ? undefined : AbortSignal.timeout(15000)\n\t\t}, this._fetchOpts);\n\t}\n\n\t/**\n\t * Get the RequestTransformFunction for MapLibre to handle fetch options\n\t * @memberOf Panoramax.utils.API#\n\t * @private\n\t * @returns {function} The RequestTransformFunction\n\t */\n\t_getMapRequestTransform() {\n\t\tconst fetchOpts = this._getFetchOptions();\n\t\tdelete fetchOpts.signal;\n\t\t// Only if tiles endpoint is enabled and fetch options set\n\t\tif(Object.keys(fetchOpts).length > 0) {\n\t\t\treturn (url) => {\n\t\t\t\t// As MapLibre will use this function for all its calls\n\t\t\t\t// We must make sure fetch options are sent only for\n\t\t\t\t// the STAC API calls, particularly the tiles endpoint\n\t\t\t\tif(url.startsWith(this._endpoint)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\turl,\n\t\t\t\t\t\t...fetchOpts\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Get the withCredentials function for PhotoSphereViewer to handle fetch credentials parameter.\n\t * @memberOf Panoramax.utils.API#\n\t * @private\n\t * @returns {function} The withCredentials function\n\t */\n\t_getPSVWithCredentials() {\n\t\tconst fetchOpts = this._getFetchOptions();\n\t\tif(fetchOpts.credentials === \"include\") {\n\t\t\treturn (url) => url.startsWith(this._endpoint);\n\t\t}\n\t\telse {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Get absolute URL from a relative version\n\t * @param {string} url The relative URL\n\t * @returns {string} The absolute URL, using API endpoint\n\t */\n\tcleanResourceURL(url) {\n\t\tif(!url) { return; }\n\t\tconst endpoint = new URL(this._endpoint);\n\t\tif(url.startsWith(\"/\")) { return endpoint.protocol + \"//\" + endpoint.host + url; }\n\t\telse if(url.startsWith(\"./\")) { return this._endpoint + url.substring(1); }\n\t\telse { return url; }\n\t}\n\n\t/**\n\t * Get sequence GeoJSON representation\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} seqId The sequence ID\n\t * @param {string} [next] The next link URL (only for internals)\n\t * @param {object} [data] The previous dataset (only for internals)\n\t * @param {number} [limit] How many items to retrieve (defaults to unset). If set, pages are not looked through.\n\t * @returns {Promise}\n\t * @fulfil {object} Sequence GeoJSON\n\t * @reject {Error} If API is not ready or for any network issue\n\t */\n\tasync getSequenceItems(seqId, next = null, data = null, limit = null) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\ttry {\n\t\t\tAPI.isIdValid(seqId);\n\t\t\treturn fetch(\n\t\t\t\tnext || `${this._endpoints.collections}/${seqId}/items${limit ? \"?limit=\"+limit : \"\"}`,\n\t\t\t\tthis._getFetchOptions(true)\n\t\t\t)\n\t\t\t\t.then(res => res.json())\n\t\t\t\t.then(res => {\n\t\t\t\t\t// Merge previous data with current page\n\t\t\t\t\tlet nextData = res;\n\t\t\t\t\tif(data) { nextData.features = data.features.concat(nextData.features); }\n\n\t\t\t\t\t// Handle pagination for next link\n\t\t\t\t\tconst nextLink = res.links.find(l => l.rel === \"next\");\n\t\t\t\t\tif(!limit && nextLink) { return this.getSequenceItems(seqId, nextLink.href, nextData); }\n\t\t\t\t\telse { return nextData; }\n\t\t\t\t});\n\t\t}\n\t\tcatch(e) {\n\t\t\treturn Promise.reject(e);\n\t\t}\n\t}\n\n\t/**\n\t * Get full URL for listing pictures around a specific location\n\t * @memberOf Panoramax.utils.API#\n\t * @param {number} lat Latitude\n\t * @param {number} lon Longitude\n\t * @param {number} [factor] The radius to search around (in degrees)\n\t * @param {number} [limit] Max amount of pictures to retrieve\n\t * @param {string} [seqId] The sequence ID to filter on (by default, no filter)\n\t * @returns {string} The corresponding URL\n\t */\n\tgetPicturesAroundCoordinatesUrl(lat, lon, factor = 0.0005, limit, seqId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\n\t\tif(isNaN(parseFloat(lat)) || isNaN(parseFloat(lon))) {\n\t\t\tthrow new Error(\"lat and lon parameters should be valid numbers\");\n\t\t}\n\n\t\tconst bbox = [ lon - factor, lat - factor, lon + factor, lat + factor ].map(d => d.toFixed(7)).join(\",\");\n\t\tconst lim = limit ? `&limit=${limit}` : \"\";\n\t\tconst seq = seqId ? `&collections=${seqId}`: \"\";\n\t\treturn `${this._endpoints.search}?bbox=${bbox}${lim}${seq}`;\n\t}\n\n\t/**\n\t * Get list of pictures around a specific location\n\t * @memberOf Panoramax.utils.API#\n\t * @param {number} lat Latitude\n\t * @param {number} lon Longitude\n\t * @param {number} [factor] The radius to search around (in degrees)\n\t * @param {number} [limit] Max amount of pictures to retrieve\n\t * @param {string} [seqId] The sequence ID to filter on (by default, no filter)\n\t * @returns {Promise}\n\t * @fulfil {object} The GeoJSON feature collection\n\t */\n\tgetPicturesAroundCoordinates(lat, lon, factor, limit, seqId) {\n\t\treturn fetch(this.getPicturesAroundCoordinatesUrl(lat, lon, factor, limit, seqId), this._getFetchOptions())\n\t\t\t.then(res => res.json());\n\t}\n\n\t/**\n\t * Get full URL for retrieving a specific picture metadata\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} picId The picture unique identifier\n\t * @param {string} [seqId] The sequence ID\n\t * @returns {string} The corresponding URL\n\t * @throws {Error} If API is not ready\n\t */\n\tgetPictureMetadataUrl(picId, seqId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\n\t\tif(API.isIdValid(picId)) {\n\t\t\tif(seqId) { return `${this._endpoints.collections}/${seqId}/items/${picId}`; }\n\t\t\telse { return `${this._endpoints.search}?ids=${picId}`; }\n\t\t}\n\t}\n\n\t/**\n\t * Get JSON style for general vector tiles\n\t * @memberOf Panoramax.utils.API#\n\t * @return {Promise|object} Promise if first load, MapLibre JSON style otherwise\n\t * @fulfil {object} The MapLibre JSON style\n\t * @reject {Error} If API is not ready, or no style defined.\n\t */\n\tgetMapStyle() {\n\t\tif(this.isReady()) { return this.mapStyle; }\n\n\t\tlet res;\n\t\t// Directly available style\n\t\tif(this._endpoints.style) {\n\t\t\tres = this._endpoints.style;\n\t\t}\n\t\t// Vector tiles URL, embed in a minimal JSON style\n\t\telse if(this._endpoints.tiles) {\n\t\t\tres = {\n\t\t\t\t\"version\": 8,\n\t\t\t\t\"sources\": {\n\t\t\t\t\t\"geovisio\": {\n\t\t\t\t\t\t\"type\": \"vector\",\n\t\t\t\t\t\t\"tiles\": [ this._endpoints.tiles ],\n\t\t\t\t\t\t\"minzoom\": 0,\n\t\t\t\t\t\t\"maxzoom\": TILES_PICTURES_ZOOM\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t// No endpoints : try fallback for GeoVisio API <= 2.0.1\n\t\telse {\n\t\t\tres = fetch(`${this._endpoint}/map/14/0/0.mvt`, this._getFetchOptions()).then(() => {\n\t\t\t\tthis._endpoints.tiles = `${this._endpoint}/map/{z}/{x}/{y}.mvt`;\n\t\t\t\tconsole.log(\"Using fallback endpoint for vector tiles\");\n\t\t\t\treturn this.getMapStyle();\n\t\t\t}).catch(e => {\n\t\t\t\tconsole.error(e);\n\t\t\t\treturn Promise.reject(new Error(\"API doesn't offer a vector tiles endpoint\"));\n\t\t\t});\n\t\t}\n\n\t\t// Post-process sources to change protocol\n\t\tconst afterJson = r => {\n\t\t\tObject.values(r?.sources || {}).forEach(s => s.tiles = s.tiles.map(t => t.replace(/^http/, \"panora\")));\n\t\t\treturn r;\n\t\t};\n\n\t\t// Call fetch if URL\n\t\tif(typeof res === \"string\") {\n\t\t\treturn fetch(res, this._getFetchOptions())\n\t\t\t\t.then(res => res.json())\n\t\t\t\t.then(afterJson);\n\t\t}\n\t\t// Send JSON style directly\n\t\telse {\n\t\t\treturn Promise.resolve(res)\n\t\t\t\t.then(afterJson);\n\t\t}\n\t}\n\n\t/**\n\t * Get JSON style for specific-user vector tiles\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} userId The user UUID\n\t * @param {boolean} [skipReadyCheck=false] Skip check for API readyness\n\t * @return {Promise}\n\t * @fulfil {object} The MapLibre JSON style\n\t * @reject {Error} If API is not ready, or no style defined.\n\t */\n\tgetUserMapStyle(userId, skipReadyCheck = false) {\n\t\tif(!skipReadyCheck && !this.isReady()) { return Promise.reject(new Error(\"API is not ready to use\")); }\n\t\tif(!userId) { return Promise.reject(new Error(\"Parameter userId is empty\")); }\n\n\t\tlet res;\n\t\t// Directly available style\n\t\tif(this._endpoints.user_style) {\n\t\t\tres = this._endpoints.user_style.replace(/\\{userId\\}/g, userId);\n\t\t}\n\t\t// Vector tiles URL, embed in a minimal JSON style\n\t\telse if(this._endpoints.user_tiles) {\n\t\t\tres = {\n\t\t\t\t\"version\": 8,\n\t\t\t\t\"sources\": {\n\t\t\t\t\t[`geovisio_${userId}`]: {\n\t\t\t\t\t\t\"type\": \"vector\",\n\t\t\t\t\t\t\"tiles\": [ this._endpoints.user_tiles.replace(/\\{userId\\}/g, userId) ],\n\t\t\t\t\t\t\"minzoom\": 0,\n\t\t\t\t\t\t\"maxzoom\": TILES_PICTURES_ZOOM\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tif(!res) {\n\t\t\treturn Promise.reject(new Error(\"API doesn't offer map style for specific user\"));\n\t\t}\n\t\t// Call fetch if URL\n\t\telse if(typeof res === \"string\") {\n\t\t\treturn fetch(res, this._getFetchOptions()).then(res => res.json());\n\t\t}\n\t\t// Send JSON style directly\n\t\telse {\n\t\t\treturn Promise.resolve(res);\n\t\t}\n\t}\n\n\t/**\n\t * Find the thumbnail URL for a given picture\n\t * @memberOf Panoramax.utils.API#\n\t * @param {object} picture The picture GeoJSON feature\n\t * @returns {string} The thumbnail URL, or null if not found\n\t * @throws {Error} If API is not ready\n\t * @private\n\t */\n\tfindThumbnailInPictureFeature(picture) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!picture || !picture.assets) { return null; }\n\n\t\tlet visualFallback = null;\n\t\tfor(let a of Object.values(picture.assets)) {\n\t\t\tif(a.roles.includes(\"thumbnail\") && a.type == \"image/jpeg\" && API.isValidHttpUrl(a.href)) {\n\t\t\t\treturn this.cleanResourceURL(a.href);\n\t\t\t}\n\t\t\telse if(a.roles.includes(\"visual\") && a.type == \"image/jpeg\" && API.isValidHttpUrl(a.href)) {\n\t\t\t\tvisualFallback = this.cleanResourceURL(a.href);\n\t\t\t}\n\t\t}\n\t\treturn visualFallback;\n\t}\n\n\t/**\n\t * Get a picture thumbnail URL for a given sequence\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} seqId The sequence ID\n\t * @param {object} [seq] The sequence metadata (with links) if already loaded\n\t * @returns {Promise}\n\t * @fulfil {string|null} Promise resolving on the picture thumbnail URL, or null if not found\n\t * @throws {Error} If API is not ready\n\t */\n\tgetPictureThumbnailURLForSequence(seqId, seq) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\n\t\t// Look for a dedicated endpoint in API\n\t\tif(this._endpoints.collection_preview) {\n\t\t\treturn Promise.resolve(this._endpoints.collection_preview.replace(\"{id}\", seqId));\n\t\t}\n\n\t\t// Check if a preview link exists in sequence metadata\n\t\tif(seq && Array.isArray(seq.links) && seq.links.length > 0) {\n\t\t\tlet preview = seq.links.find(l => l.rel === \"preview\" && l.type === \"image/jpeg\");\n\t\t\tif(preview && API.isValidHttpUrl(preview.href)) {\n\t\t\t\treturn Promise.resolve(preview.href);\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise, search for a single picture in collection\n\t\tconst url = `${this._endpoints.search}?limit=1&collections=${seqId}`;\n\n\t\treturn fetch(url, this._getFetchOptions())\n\t\t\t.then(res => res.json())\n\t\t\t.then(res => {\n\t\t\t\tif(!Array.isArray(res.features) || res.features.length == 0) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn this.findThumbnailInPictureFeature(res.features.pop());\n\t\t\t});\n\t}\n\n\t/**\n\t * Get thumbnail URL for a specific picture\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} picId The picture unique identifier\n\t * @param {string} [seqId] The sequence ID\n\t * @returns {Promise}\n\t * @fulfil {string|null} The corresponding URL on resolve, or null if no thumbnail could be found\n\t * @throws {Error} If API is not ready\n\t */\n\tgetPictureThumbnailURL(picId, seqId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\t\n\t\tif(!picId) { return Promise.resolve(null); }\n\n\t\t// Look for a dedicated endpoint in API\n\t\tif(this._endpoints.item_preview) {\n\t\t\treturn Promise.resolve(this._endpoints.item_preview.replace(\"{id}\", picId));\n\t\t}\n\n\t\t// Pic + sequence IDs defined -> use direct item metadata\n\t\tif(picId && seqId) {\n\t\t\treturn fetch(`${this._endpoints.collections}/${seqId}/items/${picId}`, this._getFetchOptions())\n\t\t\t\t.then(res => res.json())\n\t\t\t\t.then(picture => {\n\t\t\t\t\treturn picture ? this.findThumbnailInPictureFeature(picture) : null;\n\t\t\t\t});\n\t\t}\n\n\t\t// Picture ID only -> use search as fallback\n\t\treturn fetch(`${this._endpoints.search}?ids=${picId}`, this._getFetchOptions())\n\t\t\t.then(res => res.json())\n\t\t\t.then(res => {\n\t\t\t\tif(!res || !Array.isArray(res.features) || res.features.length == 0) { return null; }\n\t\t\t\treturn this.findThumbnailInPictureFeature(res.features.pop());\n\t\t\t});\n\t}\n\n\t/**\n\t * Get the RSS feed URL with map parameters (if map is enabled)\n\t * @memberOf Panoramax.utils.API#\n\t * @param {LngLatBounds} [bbox] The map current bounding box, or null if not available\n\t * @returns {string|null} The URL, or null if no RSS feed is available\n\t * @throws {Error} If API is not ready\n\t */\n\tgetRSSURL(bbox) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\t\n\t\tif(this._endpoints.rss) {\n\t\t\tlet url = this._endpoints.rss;\n\t\t\tif(bbox) {\n\t\t\t\turl += url.includes(\"?\") ? \"&\": \"?\";\n\t\t\t\turl += \"bbox=\" + [bbox.getWest(), bbox.getSouth(), bbox.getEast(), bbox.getNorth()].join(\",\");\n\t\t\t}\n\t\t\treturn url;\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * Get full URL for retrieving a specific sequence metadata\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} seqId The sequence ID\n\t * @returns {string} The corresponding URL\n\t * @throws {Error} If API is not ready\n\t */\n\tgetSequenceMetadataUrl(seqId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\treturn `${this._endpoints.collections}/${seqId}`;\n\t}\n\n\t/**\n\t * Retrieve metadata for a specific sequence\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} seqId The sequence ID\n\t * @returns {Promise}\n\t * @fulfil {object|null} Sequence metadata\n\t * @throws {Error} If API is not ready\n\t */\n\tgetSequenceMetadata(seqId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\n\t\treturn fetch(this.getSequenceMetadataUrl(seqId), this._getFetchOptions())\n\t\t\t.then(res => res.json());\n\t}\n\n\t/**\n\t * Get available data bounding box\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {LngLatBoundsLike} The bounding box or null if not available\n\t * @throws {Error} If API is not ready\n\t */\n\tgetDataBbox() {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\n\t\treturn this._dataBbox;\n\t}\n\n\t/**\n\t * Look for user ID based on user name query\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} query The user name to look for\n\t * @returns {Promise}\n\t * @fulfil {object|null} List of potential users\n\t * @throws {Error} If API is not ready or user search not available\n\t */\n\tsearchUsers(query) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!this._endpoints.user_search) { throw new Error(\"User search is not available\"); }\n\n\t\treturn fetch(`${this._endpoints.user_search}?q=${query}`, this._getFetchOptions())\n\t\t\t.then(res => res.json())\n\t\t\t.then(res => {\n\t\t\t\treturn res?.features || null;\n\t\t\t});\n\t}\n\n\t/**\n\t * Get user name based on its ID\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} userId The user UUID\n\t * @returns {Promise}\n\t * @throws {Error} If API is not ready\n\t * @fulfil {string|null} The user name (or null if not found)\n\t */\n\tgetUserName(userId) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!this._endpoints.user_search) { throw new Error(\"User search is not available\"); }\n\n\t\treturn fetch(this._endpoints.user_search.replace(/\\/search$/, `/${userId}`), this._getFetchOptions())\n\t\t\t.then(res => res.json())\n\t\t\t.then(res => {\n\t\t\t\treturn res?.label || res?.name || null;\n\t\t\t});\n\t}\n\n\t/**\n\t * Send a report to API\n\t * @memberOf Panoramax.utils.API#\n\t * @param {object} data The input form data\n\t * @returns {Promise}\n\t * @fulfil {object} The JSON API response\n\t */\n\tsendReport(data) {\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!this._endpoints.report) { throw new Error(\"Report sending is not available\"); }\n\n\t\tconst opts = {\n\t\t\t...this._getFetchOptions(),\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t};\n\t\treturn fetch(this._endpoints.report, opts)\n\t\t\t.then(async res => {\n\t\t\t\tif(res.status >= 400) {\n\t\t\t\t\tlet txt = await res.text();\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttxt = JSON.parse(txt)[\"message\"];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t\t\t\treturn Promise.reject(txt);\n\t\t\t\t}\n\t\t\t\treturn res.json();\n\t\t\t});\n\t}\n\n\t/**\n\t * Send picture semantics change to origin API.\n\t * @memberOf Panoramax.utils.API#\n\t * @param {object} picMeta The picture metadata\n\t * @param {object} semanticsDiff The difference in semantics compared to original data\n\t * @returns {Promise}\n\t * @fulfil {object} The JSON API response\n\t */\n\tsendPictureSemantics(picMeta, semanticsDiff) {\n\t\t// Fake send version\n\t\t// const newMeta = Object.assign({}, picMeta);\n\t\t// newMeta.properties.semantics = newMeta.properties.semantics.concat(semanticsDiff).filter(t => (\n\t\t// \tt.action != \"delete\"\n\t\t// \t&& !semanticsDiff.find(t2 => t.key == t2.key && t.value == t2.value && t2.action == \"delete\")\n\t\t// ));\n\t\t// return Promise.resolve(newMeta);\n\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!picMeta?.sequence?.id || !picMeta?.id) { throw new Error(\"Missing IDs from picture\"); }\n\n\t\t// Check if it's from metacatalog\n\t\tlet picLink = this.getPictureMetadataUrl(picMeta.id, picMeta.sequence.id);\n\t\tif(picMeta?.origInstance) {\n\t\t\tpicLink = `${picMeta.origInstance.href}/api/collections/${picMeta.sequence.id}/items/${picMeta.id}`;\n\t\t}\n\n\t\tconst opts = {\n\t\t\t...this._getFetchOptions(),\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify({ semantics: semanticsDiff }),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t};\n\t\t\n\t\treturn fetch(picLink, opts)\n\t\t\t.then(async res => {\n\t\t\t\tif(res.status >= 400) {\n\t\t\t\t\tlet txt = await res.text();\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttxt = JSON.parse(txt)[\"message\"];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t\t\t\treturn Promise.reject(txt);\n\t\t\t\t}\n\t\t\t\treturn res.json();\n\t\t\t});\n\t}\n\n\t/**\n\t * Create new annotation for a given picture on its origin API.\n\t * @memberOf Panoramax.utils.API#\n\t * @param {object} picMeta The picture metadata\n\t * @param {object} shape The annotation shape\n\t * @param {object} semanticsDiff The difference in semantics compared to original data\n\t * @returns {Promise}\n\t * @fulfil {object} The JSON API response\n\t */\n\tcreatePictureAnnotation(picMeta, shape, semanticsDiff) {\n\t\t// Fake send version\n\t\t// return Promise.resolve({\n\t\t// \t\"id\": \"fe298d59-a9c6-4680-8e76-6efe82d97f48\",\n\t\t// \t\"semantics\": semanticsDiff,\n\t\t// \t\"shape\": { \"type\": \"Polygon\", \"coordinates\": [[\n\t\t// \t\t[shape[0], shape[1]],\n\t\t// \t\t[shape[0], shape[3]],\n\t\t// \t\t[shape[2], shape[3]],\n\t\t// \t\t[shape[2], shape[1]],\n\t\t// \t\t[shape[0], shape[1]],\n\t\t// \t]] }\n\t\t// });\n\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tif(!picMeta?.sequence?.id || !picMeta?.id) { throw new Error(\"Missing IDs from picture\"); }\n\n\t\t// Check if it's from metacatalog\n\t\tlet picLink = this.getPictureMetadataUrl(picMeta.id, picMeta.sequence.id)+\"/annotations\";\n\t\tif(picMeta?.origInstance) {\n\t\t\tpicLink = `${picMeta.origInstance.href}/api/collections/${picMeta.sequence.id}/items/${picMeta.id}/annotations`;\n\t\t}\n\n\t\tconst opts = {\n\t\t\t...this._getFetchOptions(),\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tsemantics: semanticsDiff,\n\t\t\t\tshape: shape\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t};\n\t\t\n\t\treturn fetch(picLink, opts)\n\t\t\t.then(async res => {\n\t\t\t\tif(res.status >= 400) {\n\t\t\t\t\tlet txt = await res.text();\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttxt = JSON.parse(txt)[\"message\"];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t\t\t\treturn Promise.reject(txt);\n\t\t\t\t}\n\t\t\t\treturn res.json();\n\t\t\t});\n\t}\n\n\t/**\n\t * Edit semantics of an existing annotation on its origin API.\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} annotationId The annotation UUID\n\t * @param {object} semanticsDiff The difference in semantics compared to original data\n\t * @returns {Promise}\n\t * @fulfil {object} The JSON API response\n\t */\n\teditPictureAnnotation(annotationId, semanticsDiff) {\n\t\t// Fake send version\n\t\t// return Promise.resolve({\n\t\t// \t\"id\": annotationId,\n\t\t// \t\"semantics\": semanticsDiff,\n\t\t// \t\"shape\": {\n\t\t// \t\t\"coordinates\": [[[2296,946],[2336,946],[2336,978],[2296,978],[2296,946]]],\n\t\t// \t\t\"type\": \"Polygon\"\n\t\t// \t}\n\t\t// });\n\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tlet annotLink = `${this._endpoint}/annotations/${annotationId}`;\n\n\t\tconst opts = {\n\t\t\t...this._getFetchOptions(),\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify({ semantics: semanticsDiff }),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t};\n\t\t\n\t\treturn fetch(annotLink, opts)\n\t\t\t.then(async res => {\n\t\t\t\tif(res.status >= 400) {\n\t\t\t\t\tlet txt = await res.text();\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttxt = JSON.parse(txt)[\"message\"];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t\t\t\treturn Promise.reject(txt);\n\t\t\t\t}\n\t\t\t\treturn res.json();\n\t\t\t});\n\t}\n\n\t/**\n\t * Delete a single annotation on its origin API.\n\t * @memberOf Panoramax.utils.API#\n\t * @param {string} annotationId The annotation UUID\n\t * @returns {Promise}\n\t * @fulfil {object} The JSON API response\n\t */\n\tdeletePictureAnnotation(annotationId) {\n\t\t// Fake send version\n\t\t// console.log(\"Delete\", annotationId);\n\t\t// return Promise.resolve(true);\n\n\t\tif(!this.isReady()) { throw new Error(\"API is not ready to use\"); }\n\t\tlet annotLink = `${this._endpoint}/annotations/${annotationId}`;\n\n\t\tconst opts = {\n\t\t\t...this._getFetchOptions(),\n\t\t\tmethod: \"DELETE\",\n\t\t};\n\t\t\n\t\treturn fetch(annotLink, opts)\n\t\t\t.then(async res => {\n\t\t\t\tif(res.status >= 400) {\n\t\t\t\t\tlet txt = await res.text();\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttxt = JSON.parse(txt)[\"message\"];\n\t\t\t\t\t}\n\t\t\t\t\tcatch(e) {} // eslint-disable-line no-empty\n\t\t\t\t\treturn Promise.reject(txt);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t}\n\n\t/**\n\t * Get the URL for user to log-in.\n\t * @memberOf Panoramax.utils.API#\n\t * @returns {Promise}\n\t * @fulfil {string|boolean} The log-in URL, or false if no login is available\n\t */\n\tgetAuthURL() {\n\t\tif(this._configuration) {\n\t\t\treturn Promise.resolve(\n\t\t\t\tthis._configuration?.auth?.enabled\n\t\t\t\t\t? `${this._endpoint}/auth/login?next_url=<CBURL>`\n\t\t\t\t\t: false\n\t\t\t);\n\t\t}\n\t\telse if(this._configuration === null) {\n\t\t\treturn fetch(this._endpoint+\"/configuration\", this._getFetchOptions())\n\t\t\t\t.then(res => res.json())\n\t\t\t\t.then(res => {\n\t\t\t\t\tthis._configuration = res;\n\t\t\t\t\treturn this.getAuthURL();\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tthis._configuration = false;\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t}\n\t\telse {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\t}\n\n\t/**\n\t * Checks URL string validity\n\t * @memberOf Panoramax.utils.API\n\t * @param {string} str The URL to check\n\t * @returns {boolean} True if valid\n\t */\n\tstatic isValidHttpUrl(str) {\n\t\tlet url;\n\n\t\ttry {\n\t\t\turl = new URL(str);\n\t\t} catch (_) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn url.protocol === \"http:\" || url.protocol === \"https:\";\n\t}\n\n\t/**\n\t * Checks picture or sequence ID validity\n\t * @memberOf Panoramax.utils.API\n\t * @param {string} id The ID to check\n\t * @returns {boolean} True if valid\n\t * @throws {Error} If not valid\n\t */\n\tstatic isIdValid(id) {\n\t\tif(isNullId(id)) {\n\t\t\tthrow new Error(\"id should be a valid picture unique identifier\");\n\t\t}\n\t\treturn true;\n\t}\n}\n","export const MAP_FILTERS_JS2URL = {\n\t\"minDate\": \"date_from\",\n\t\"maxDate\": \"date_to\",\n\t\"pic_type\": \"pic_type\",\n\t\"camera\": \"camera\",\n\t\"theme\": \"theme\",\n\t\"qualityscore\": \"pic_score\",\n\t\"gps\": \"gps\"\n};\n\nconst MAP_FILTERS_URL2JS = Object.fromEntries(Object.entries(MAP_FILTERS_JS2URL).map(v => [v[1], v[0]]));\nconst MAP_NONE = [\"none\", \"null\", \"false\", false];\n\nconst MAPLIBRE_OPTIONS = [\n\t\"antialias\", \"bearing\", \"bearingSnap\", \"bounds\",\n\t\"boxZoom\", \"clickTolerance\", \"collectResourceTiming\",\n\t\"cooperativeGestures\", \"crossSourceCollisions\", \"doubleClickZoom\", \"dragPan\",\n\t\"dragRotate\", \"fadeDuration\", \"failIfMajorPerformanceCaveat\", \"fitBoundsOptions\",\n\t\"hash\", \"interactive\", \"localIdeographFontFamily\", \"locale\", \"logoPosition\",\n\t\"maplibreLogo\", \"maxBounds\", \"maxCanvasSize\", \"maxPitch\", \"maxTileCacheSize\",\n\t\"maxTileCacheZoomLevels\", \"maxZoom\", \"minPitch\", \"minZoom\", \"pitch\", \"pitchWithRotate\",\n\t\"pixelRatio\", \"preserveDrawingBuffer\", \"refreshExpiredTiles\", \"renderWorldCopies\",\n\t\"scrollZoom\", \"touchPitch\", \"touchZoomRotate\", \"trackResize\",\n\t\"transformCameraUpdate\", \"transformRequest\", \"validateStyle\"\n];\n\nfunction filterMapLibreOptions(opts) {\n\treturn Object.fromEntries(Object.entries(opts).filter(([key]) => MAPLIBRE_OPTIONS.includes(key)));\n}\n\n\n/**\n * Merges all URL parameters and component attributes into a single set of coherent settings.\n * \n * @class Panoramax.utils.InitParameters\n * @param {object} [componentAttrs] HTML attributes from parent component\n * @param {object} [urlParams] Parameters extracted from URL\n * @param {object} [browserStorage] Parameters read from local/session storage\n */\nexport default class InitParameters { // eslint-disable-line import/no-unused-modules\n\tconstructor(componentAttrs = {}, urlParams = {}, browserStorage = {}) {\n\t\t// Skip URL parameters if disabled by component\n\t\tif(componentAttrs[\"url-parameters\"] === \"false\") { urlParams = {}; }\n\n\t\t// Sanitize PSV parameters\n\t\tlet componentPsv = {};\n\t\tif(typeof componentAttrs?.[\"psv-options\"] === \"object\") { componentPsv = componentAttrs[\"psv-options\"]; }\n\n\t\t// Sanitize Map parameters\n\t\tlet componentMap = {};\n\t\tif(typeof componentAttrs?.[\"map-options\"] === \"object\") { componentMap = componentAttrs[\"map-options\"]; }\n\t\tlet browserMap = {};\n\t\tif(typeof browserStorage?.map === \"object\") { browserMap = browserStorage.map; }\n\n\t\t// Extract map position from URL\n\t\tlet urlMap = urlParams.map && urlParams.map !== \"none\" ? getMapPositionFromString(urlParams.map) : null;\n\n\t\t// Parse and prioritize all parameters\n\t\t//  - Overlapping between URL & component\n\t\tlet map = MAP_NONE.includes(urlParams.map) || MAP_NONE.includes(componentAttrs[\"map-options\"]) ? false : true;\n\t\tlet focus = urlParams.focus || componentAttrs.focus;\n\t\tlet picture = urlParams.pic || componentAttrs.picture;\n\t\tlet sequence = urlParams.seq || componentAttrs.sequence;\n\t\tlet users = urlParams.users || componentAttrs.users;\n\t\tlet psv_speed = urlParams.speed || componentPsv?.transitionDuration;\n\t\tlet psv_nav = urlParams.nav || componentPsv?.picturesNavigation;\n\t\tlet map_theme = urlParams.theme || browserMap?.theme || componentMap.theme;\n\t\tlet map_background = urlParams.background || browserMap?.background || componentMap.background;\n\t\tlet map_center = urlMap?.center || (!picture && (browserMap?.center || componentMap.center)) || [0,0];\n\t\tlet map_zoom = urlMap?.zoom || browserMap?.zoom || componentMap.zoom;\n\t\tlet map_pitch = urlMap?.pitch || componentMap.pitch;\n\t\tlet map_bearing = urlMap?.bearing || componentMap.bearing;\n\t\tlet map_indoor_level = urlParams.level || componentMap.indoor?.level; \n\t\t\n\t\t//  - Component only\n\t\tlet geocoder = componentAttrs.geocoder;\n\t\tlet widgets = componentAttrs.widgets;\n\t\tlet fetchOptions = componentAttrs[\"fetch-options\"];\n\t\tlet style = componentAttrs.style;\n\t\tlet lang = componentAttrs.lang;\n\t\tlet endpoint = componentAttrs.endpoint;\n\t\tlet map_raster = componentMap.raster;\n\t\tlet map_indoor = componentMap.indoor;\n\t\tlet map_attribution = componentMap.attributionControl;\n\t\tlet map_others = filterMapLibreOptions(componentMap);\n\t\tlet keyboardShortcuts = componentAttrs[\"keyboard-shortcuts\"];\n\t\tlet skipTagsMenuOpening = componentAttrs[\"skip-tags-menu-opening\"];\n\n\t\t//  - Overlapping between browser storage & component\n\t\tlet psv_displayAnnotations = browserStorage?.disableAnnotations === \"false\" || componentPsv?.displayAnnotations || false;\n\n\t\t//  - URL only\n\t\tlet psv_xyz = urlParams.xyz;\n\t\tlet map_date_from = urlParams.date_from;\n\t\tlet map_date_to = urlParams.date_to;\n\t\tlet map_pic_type = urlParams.pic_type;\n\t\tlet map_camera = urlParams.camera;\n\t\tlet map_pic_score = urlParams.pic_score;\n\t\tlet map_gps = urlParams.gps;\n\t\tlet map_overlay = urlParams.overlay;\n\t\tlet psv_xywh = urlParams.xywh;\n\t\tlet psv_annot = urlParams.annot;\n\n\t\t// Check coherence\n\t\tif(map && !picture && !sequence) {\n\t\t\tfocus = \"map\";\n\t\t}\n\t\telse if(![\"map\", \"pic\"].includes(focus)) {\n\t\t\tconsole.warn(\"Invalid value for parameter focus:\", focus);\n\t\t\tfocus = map && (!picture && !sequence) ? \"map\" : \"pic\";\n\t\t}\n\t\telse if(focus === \"map\" && !map) {\n\t\t\tconsole.warn(\"Parameter focus can't be 'map' as map is disabled\");\n\t\t\tfocus = \"pic\";\n\t\t}\n\t\t\n\t\tif(map_background == \"aerial\" && !map_raster) {\n\t\t\tconsole.warn(\"Parameter background can't be 'aerial' as no aerial imagery is available\");\n\t\t\tmap_background = \"streets\";\n\t\t}\n\t\tif(map_indoor_level && !map_indoor) {\n\t\t\tconsole.error(\"Can't set indoor level if indoor= plugin is not available\");\n\t\t}\n\t\tif(!psv_displayAnnotations && psv_annot) {\n\t\t\tpsv_displayAnnotations = true;\n\t\t}\n\t\tif(psv_annot && !picture) {\n\t\t\t// Related to https://gitlab.com/panoramax/clients/web-viewer/-/issues/347\n\t\t\tconsole.error(\"Parameter annot can only be used in combination with 'picture'\");\n\t\t}\n\n\t\t// Put all attributes in appropriate container\n\t\tthis._parentInit = { map, users, fetchOptions, style, lang, endpoint };\n\t\tthis._parentPostInit = {\n\t\t\tfocus, picture, sequence, geocoder, widgets,\n\t\t\tforceFocus: true, keyboardShortcuts: true,\n\t\t\twillLoadPicture: (picture || sequence) !== undefined,\n\t\t\tskipTagsMenuOpening: skipTagsMenuOpening === \"true\"\n\t\t};\n\n\t\tthis._psvInit = Object.assign(\n\t\t\tObject.fromEntries(\n\t\t\t\tObject.entries(componentPsv).filter(\n\t\t\t\t\t([k,]) => ![\"transitionDuration\", \"picturesNavigation\", \"displayAnnotations\"].includes(k)\n\t\t\t\t)\n\t\t\t),\n\t\t\t{\n\t\t\t\tdisplayAnnotations: psv_displayAnnotations\n\t\t\t}\n\t\t);\n\n\t\tthis._psvAny = {\n\t\t\ttransitionDuration: psv_speed,\n\t\t\tpicturesNavigation: psv_nav,\n\t\t};\n\t\tthis._psvPostInit = { xyz: psv_xyz, xywh: psv_xywh, annotation: psv_annot };\n\n\t\tthis._mapInit = {\n\t\t\traster: map_raster,\n\t\t\tindoor: map_indoor,\n\t\t\tattributionControl: map_attribution,\n\t\t\t...map_others\n\t\t};\n\n\t\tthis._mapAny = {\n\t\t\ttheme: map_theme,\n\t\t\tbackground: map_background,\n\t\t\tcenter: map_center,\n\t\t\tzoom: map_zoom,\n\t\t\tpitch: map_pitch,\n\t\t\tbearing: map_bearing,\n\t\t\tusers,\n\t\t};\n\t\tthis._mapPostInit = {\n\t\t\tdate_from: map_date_from,\n\t\t\tdate_to: map_date_to,\n\t\t\tpic_type: map_pic_type,\n\t\t\tcamera: map_camera,\n\t\t\tpic_score: map_pic_score,\n\t\t\tgps: map_gps,\n\t\t\toverlay: map_overlay,\n\t\t\tlevel: map_indoor_level,\n\t\t};\n\n\t\tif(keyboardShortcuts === \"false\") {\n\t\t\tthis._psvInit.keyboard = false;\n\t\t\tthis._psvInit.keyboardActions = {};\n\t\t\tthis._mapInit.keyboard = false;\n\t\t\tthis._parentPostInit.keyboardShortcuts = false;\n\t\t}\n\t}\n\n\t/**\n\t * Cleans out undefined values from object.\n\t * @param {object} obj The input object\n\t * @returns {object} Clean object without undefined values\n\t * @private\n\t */\n\t_sanitize(obj) {\n\t\treturn Object.fromEntries(Object.entries(obj).filter(([,v]) => v !== undefined));\n\t}\n\n\t/**\n\t * Get core component initialization parameters.\n\t * They must be passed as soon as possible.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetParentInit() {\n\t\treturn this._sanitize(this._parentInit);\n\t}\n\n\t/**\n\t * Get core component post-initialization parameters.\n\t * They must be passed after first rendering or init.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetParentPostInit() {\n\t\treturn this._sanitize(this._parentPostInit);\n\t}\n\n\t/**\n\t * Get Photo Sphere Viewer initialization parameters.\n\t * They must be passed as soon as possible.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetPSVInit() {\n\t\treturn this._sanitize(Object.assign({}, this._psvInit, this._psvAny));\n\t}\n\n\t/**\n\t * Get Photo Sphere Viewer post-initialization parameters.\n\t * They must be passed after first rendering or init.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetPSVPostInit() {\n\t\treturn this._sanitize(Object.assign({}, this._psvPostInit, this._psvAny));\n\t}\n\n\t/**\n\t * Get MapLibre GL initialization parameters.\n\t * They must be passed as soon as possible.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetMapInit() {\n\t\treturn this._sanitize(Object.assign({}, this._mapInit, this._mapAny));\n\t}\n\n\t/**\n\t * Get MapLibre GL post-initialization parameters.\n\t * They must be passed after first rendering or init.\n\t * @memberof Panoramax.utils.InitParameters#\n\t */\n\tgetMapPostInit() {\n\t\treturn this._sanitize(Object.assign({}, this._mapPostInit, this._mapAny));\n\t}\n\n\t/**\n\t * Reads public properties from LitElement and returns a classic key-value object.\n\t * @param {class} compClass The component class (with static `properties` definition)\n\t * @param {LitElement} comp The component itself\n\t */\n\tstatic GetComponentProperties(compClass, comp) {\n\t\tconst props = {};\n\t\tfor(let classK in compClass.properties) {\n\t\t\tlet classV = compClass.properties[classK];\n\t\t\tif(!classV.state && comp[classK] != null) {\n\t\t\t\tprops[classK] = comp[classK];\n\t\t\t}\n\t\t}\n\t\treturn props;\n\t}\n}\n\n/**\n * Extracts map center, zoom & more from formatted string.\n * @param {string} str The map position as hash string\n * @param {Panoramax.components.ui.Map} [map] The current map\n * @returns {object} { center, zoom, pitch, bearing }\n * @private\n */\nexport function getMapPositionFromString(str, map) {\n\tconst loc = (str || \"\").split(\"/\");\n\tif (loc.length >= 3 && !loc.some(v => isNaN(v))) {\n\t\tconst res = {\n\t\t\tcenter: [+loc[2], +loc[1]],\n\t\t\tzoom: +loc[0],\n\t\t\tpitch: +(loc[4] || 0)\n\t\t};\n\n\t\tif(map) {\n\t\t\tres.bearing = map.dragRotate.isEnabled() && map.touchZoomRotate.isEnabled() ? +(loc[3] || 0) : map.getBearing();\n\t\t}\n\n\t\treturn res;\n\t}\n\telse { return null; }\n}\n\n/**\n * Extracts from string xyz position\n * @param {string} str The xyz position as hash string\n * @returns {object} { x, y, z }\n * @private\n */\nexport function xyzParamToPSVPosition(str) {\n\tconst loc = (str || \"\").split(\"/\");\n\tif (loc.length === 3 && !loc.some(v => isNaN(v))) {\n\t\tconst res = {\n\t\t\tx: +loc[0],\n\t\t\ty: +loc[1],\n\t\t\tz: +loc[2]\n\t\t};\n\n\t\treturn res;\n\t}\n\telse { return null; }\n}\n\n/**\n * Extracts from string xywh position\n * @param {string} str The xywh position as hash string\n * @param {object} [picmeta] The current picture metadata, used to compute zoom based on image size\n * @returns {object} { textureX, textureY, z }\n * @private\n */\nfunction xywhParamToPSVPosition(str, picmeta) {\n\tlet loc = (str || \"\").split(\",\");\n\tif (loc.length === 4 && !loc.some(v => isNaN(v))) {\n\t\tlet [ locX, locY, locW, locH ] = loc.map(v => parseFloat(v));\n\t\tlet basePanoData = picmeta.panorama.basePanoData;\n\t\tif(typeof basePanoData === \"function\") {\n\t\t\tconst size = picmeta?.properties?.[\"pers:interior_orientation\"]?.sensor_array_dimensions;\n\t\t\tif(size && size.length == 2) { basePanoData = basePanoData({width: size[0], height: size[1]}); }\n\t\t\telse { basePanoData = null; }\n\t\t}\n\n\t\tif(!basePanoData?.fullWidth || !basePanoData?.fullHeight) { return null; }\n\n\t\tconst croppedX = basePanoData?.croppedX || 0;\n\t\tconst croppedY = basePanoData?.croppedY || 0;\n\n\t\t// Compute offset from texture center\n\t\tconst xOffsetPx = croppedX + locX + locW / 2 - basePanoData.fullWidth / 2;\n\t\tconst yOffsetPx = -(croppedY + locY + locH / 2 - basePanoData.fullHeight / 2);\n\t\tconst xOffsetPct = xOffsetPx / basePanoData.fullWidth;\n\t\tconst yOffsetPct = yOffsetPx / basePanoData.fullHeight;\n\t\tconst xSizePct = locW / basePanoData.fullWidth;\n\t\tconst ySizePct = locH / basePanoData.fullHeight;\n\t\tconst sizePct = (xSizePct + ySizePct) / 2;\n\n\t\tconst res = {\n\t\t\tyaw: xOffsetPct * 2 * Math.PI,\n\t\t\tpitch: yOffsetPct * Math.PI,\n\t\t\tz: (1 - sizePct) * 100\n\t\t};\n\n\t\treturn res;\n\t}\n\telse { return null; }\n}\n\n/**\n * Extracts from hash parsed keys all map filters values\n * @param {*} vals Hash keys\n * @returns {object} Map filters\n * @private\n */\nexport function paramsToMapFilters(vals) {\n\tconst newMapFilters = {};\n\tfor(let k in MAP_FILTERS_URL2JS) {\n\t\tif(vals[k]) {\n\t\t\tnewMapFilters[MAP_FILTERS_URL2JS[k]] = vals[k];\n\t\t}\n\t}\n\tif(newMapFilters.qualityscore) {\n\t\tlet values = newMapFilters.qualityscore.split(\"\");\n\t\tconst mapping = {\"A\": 5, \"B\": 4, \"C\": 3, \"D\": 2, \"E\": 1};\n\t\tnewMapFilters.qualityscore = values.map(v => mapping[v]);\n\t}\n\treturn newMapFilters;\n}\n\n/**\n * Change PSV current state based on standardized parameters.\n * @param {Photo} psv The Photo Sphere Viewer component to change.\n * @param {object} params The parameters to apply.\n */\nexport function alterPSVState(psv, params) {\n\t// Change xyz position\n\tif(params.xyz) {\n\t\tpsv.addEventListener(\"picture-loaded\", () => {\n\t\t\tconst coords = xyzParamToPSVPosition(params.xyz);\n\t\t\tpsv.setXYZ(coords.x, coords.y, coords.z);\n\t\t}, {once: true});\n\t}\n\n\t// Change xywh position\n\tif(params.xywh) {\n\t\tpsv.addEventListener(\"picture-loaded\", () => {\n\t\t\tconst coords = xywhParamToPSVPosition(params.xywh, psv.getPictureMetadata());\n\t\t\tpsv.rotate(coords);\n\t\t\tpsv.zoom(coords.z);\n\t\t}, {once: true});\n\t}\n\n\t// Select focused annotation\n\tif(params.annotation) {\n\t\tif(psv.getPictureMetadata()) {\n\t\t\tpsv.focusOnAnnotation(params.annotation);\n\t\t}\n\t\telse {\n\t\t\tpsv.addEventListener(\"picture-loaded\", () => {\n\t\t\t\tpsv.focusOnAnnotation(params.annotation);\n\t\t\t}, {once: true});\n\t\t}\n\t}\n\n\t// Change transitionDuration\n\tlet td = params.transitionDuration || params.speed;\n\tif(td !== undefined) {\n\t\tpsv.setTransitionDuration(td);\n\t}\n\n\t// Change pictures navigation mode\n\tlet nav = params.picturesNavigation || params.nav;\n\tif([\"none\", \"pic\", \"any\", \"seq\"].includes(nav)) {\n\t\tpsv.setPicturesNavigation(nav);\n\t}\n}\n\n/**\n * Change MapLibre GL current state based on standardized parameters.\n * @param {Map} map The MapLibre component to change.\n * @param {object} params The parameters to apply.\n */\nexport async function alterMapState(map, params) {\n\t// Map position\n\tconst mapOpts = getMapPositionFromString(params.map, map);\n\tif(mapOpts) {\n\t\tmap.jumpTo(mapOpts);\n\t}\n\n\t// Visible users\n\tlet vu = Array.isArray(params.users) ? params.users : (params.users || \"\").split(\",\");\n\tif(vu.length === 0 || (vu.length === 1 && vu[0].trim() === \"\")) { vu = [\"geovisio\"]; }\n\tawait map.setVisibleUsers(vu);\n\n\t// Change map filters\n\tmap.setFilters?.(paramsToMapFilters(params));\n\n\t// Change map background\n\tif([\"aerial\", \"streets\"].includes(params.background)) {\n\t\tmap.setBackground(params.background);\n\t}\n\n\t// Change overlays\n\tif(params.overlay) {\n\t\tparams.overlay.split(\",\").forEach(o => {\n\t\t\tconst waitForLayer = () => {\n\t\t\t\tif(map.getLayer(o)) { map.setLayoutProperty(o, \"visibility\", \"visible\"); }\n\t\t\t\telse { setTimeout(waitForLayer, 200); }\n\t\t\t};\n\t\t\twaitForLayer();\n\t\t});\n\t}\n}\n\n/**\n * Change PhotoViewer current state based on standardized parameters.\n * @param {PhotoViewer} viewer The PhotoViewer component to change.\n * @param {object} params The parameters to apply.\n */\nexport function alterPhotoViewerState(viewer, params) {\n\t// Restore selected picture\n\tlet pic = params.picture || params.pic;\n\tlet seq = params.sequence || params.seq || null;\n\tif(pic) {\n\t\tconst picIds = pic.split(\";\"); // Handle multiple IDs coming from OSM\n\t\tif(picIds.length > 1) {\n\t\t\tconsole.warn(\"Multiple picture IDs passed in URL, only first one kept\");\n\t\t}\n\n\t\tviewer.select(\n\t\t\tpicIds.length === 1 ? seq : null,\n\t\t\tpicIds[0],\n\t\t\ttrue\n\t\t);\n\t}\n\telse if(seq) {\n\t\tviewer.select(seq, null, true);\n\t}\n\telse {\n\t\tviewer.select();\n\t}\n}\n\n/**\n * Change Viewer current state based on standardized parameters.\n * @param {Viewer} viewer The Viewer component to change.\n * @param {object} params The parameters to apply.\n */\nexport function alterViewerState(viewer, params) {\n\talterPhotoViewerState(viewer, params);\n\n\t// Change focus\n\tif(params.focus === \"map\" && viewer?.map) {\n\t\tviewer.setPopup(false);\n\t\tviewer._setFocus(\"map\", null, params.forceFocus);\n\t}\n\telse if(params.focus === \"pic\" && viewer?.mini) {\n\t\tviewer.setPopup(false);\n\t\tviewer._setFocus(\"pic\", null, params.forceFocus);\n\t}\n\telse if(params.focus && params.focus === \"meta\" && viewer?.mini) {\n\t\tviewer._setFocus(\"pic\", null, params.forceFocus);\n\t}\n}\n","import Protobuf from \"pbf\";\nimport {VectorTile} from \"@mapbox/vector-tile\";\nimport {fromVectorTileJs} from \"@maplibre/vt-pbf\";\n\n// Minimum amount of pictures in a tile to consider it \"crowded\"\nconst CROWDED_TILE_SIZE = 5000;\n\n/**\n * PanoraMap Protocol adds a new URI scheme \"panora://\" (or \"panoras://\") to MapLibre.\n * It allows adding custom information on top of existing Panoramax Vector Tiles.\n * @class Panoramax.utils.PanoraMapProtocol\n * @typicalname panoraMapProtocol\n */\nexport default class PanoraMapProtocol {\n\t/**\n\t * Get a single tile\n\t * @param {object} params MapLibre parameters \n\t * @param {AbortController} abort The abort signal handler\n\t * @returns {object} The tile, as expected by MapLibre\n\t * @memberof Panoramax.utils.PanoraMapProtocol#\n\t */\n\ttile() {\n\t\treturn (params, abort) => {\n\t\t\tabort = abort || new AbortController();\n\t\t\tconst url = params.url.replace(/^panora/, \"http\");\n\t\t\treturn fetch(url, { signal: abort.signal })\n\t\t\t\t.then((response) => response.arrayBuffer())\n\t\t\t\t.then((data) => new VectorTile(new Protobuf(data)))\n\t\t\t\t.then((tile) => {\n\t\t\t\t\t// Skip process if pictures are not available\n\t\t\t\t\tif(!tile.layers.pictures || tile.layers.pictures.length >= CROWDED_TILE_SIZE) { return tile; }\n\t\t\t\t\t\n\t\t\t\t\tObject.values(tile.layers).forEach(layer => {\n\t\t\t\t\t\tconst oldFeat = layer.feature.bind(layer);\n\t\t\t\t\t\tlayer.feature = (index) => {\n\t\t\t\t\t\t\tconst feature = oldFeat(index);\n\t\t\t\t\t\t\t// Mark tile as \"uncrowded\"\n\t\t\t\t\t\t\tfeature.properties.uncrowded = true;\n\t\t\t\t\t\t\treturn feature;\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\treturn tile;\n\t\t\t\t})\n\t\t\t\t.then((tile) => fromVectorTileJs(tile).buffer)\n\t\t\t\t.then((data) => ({ data }));\n\t\t};\n\t}\n}","import { EquirectangularTilesAdapter } from \"@photo-sphere-viewer/equirectangular-tiles-adapter\";\n\n/**\n * Override of PSV EquirectangularTilesAdapter for fine-tweaking.\n * @class Panoramax.utils.PhotoAdapter\n * @private\n */\nexport default class PhotoAdapter extends EquirectangularTilesAdapter {\n\tconstructor(viewer, config) {\n\t\tsuper(viewer, config);\n\t\tthis._shouldGoFast = config.shouldGoFast || (() => true);\n\t}\n\n\t/**\n\t * Override to skip loading SD images according to shouldGoFast option.\n\t */\n\tloadTexture(panorama, loader) {\n\t\tif(!panorama.origBaseUrl) { panorama.origBaseUrl = panorama.baseUrl; }\n\t\telse { panorama.baseUrl = panorama.origBaseUrl; }\n\t\t\n\t\t// Fast mode + thumbnail available + no HD image loaded yet + flat picture\n\t\tif(\n\t\t\tthis._shouldGoFast()\n\t\t\t&& panorama.thumbUrl\n\t\t\t&& !panorama.hdLoaded\n\t\t\t&& panorama.rows == 1\n\t\t) {\n\t\t\tpanorama.baseUrl = panorama.thumbUrl;\n\t\t}\n\n\t\treturn super.loadTexture(panorama, loader).then(data => {\n\t\t\tif(panorama.baseUrl === panorama.origBaseUrl) {\n\t\t\t\tpanorama.hdLoaded = true;\n\t\t\t}\n\t\t\treturn data;\n\t\t}).catch(e => {\n\t\t\tconsole.error(\"Can't load texture\", e);\n\t\t});\n\t}\n\n\t/**\n\t * Override to skip loading tiles according to shouldGoFast option.\n\t * @private\n\t */\n\t__loadTiles(tiles) {\n\t\tif(!this._shouldGoFast()) { super.__loadTiles(tiles); }\n\t}\n}\n","import { PanoramaxPresetsURL } from \"./services\";\n\n// Iconify aliases for whole collections\nconst ICON_COLLECTIONS_SUB = {\n\t\"fas\": \"fa7-solid\"\n};\n\n// Iconify aliases for specific icons\nconst ICON_SUBS = {\n\t// \"fa6-solid:directions\": \"fa6-solid:diamond-turn-right\"\n};\n\n/**\n * Presets Manager handle retrieval of presets against dedicated endpoint.\n * It allows an easily search between all presets, and handles translations.\n *\n * @class Panoramax.utils.PresetsManager\n * @typicalname presetsManager\n * @param {string} [lang] The user prefered language. Defaults to web browser preferences.\n * @param {boolean} [skipLoad=false] Set to true to disable automatic load of API data\n */\nexport default class PresetManager {\n\tconstructor(lang = null, skipLoad = false) {\n\t\tthis._ready = false;\n\t\tthis._presets = null;\n\t\tthis._translations = {};\n\t\tif(!skipLoad) { this._load(lang); }\n\t}\n\n\t/**\n\t * Downloads various JSON file against presets API.\n\t * @private\n\t */\n\tasync _load(lang) {\n\t\tlang = lang?.substring(0, 2) || window.navigator.languages[0]?.substring(0, 2);\n\t\t\n\t\ttry {\n\t\t\tconst [translationsENRes, translationsLangRes, presetsRes] = await Promise.all([\n\t\t\t\tfetch(`${PanoramaxPresetsURL()}/translations/en.min.json`),\n\t\t\t\tlang ? fetch(`${PanoramaxPresetsURL()}/translations/${lang}.min.json`) : Promise.resolve({ok: true}),\n\t\t\t\tfetch(`${PanoramaxPresetsURL()}/presets.min.json`),\n\t\t\t]);\n\n\t\t\tif (\n\t\t\t\t!translationsENRes || !translationsLangRes || !presetsRes\n\t\t\t\t|| !translationsENRes.ok || !translationsLangRes.ok || !presetsRes.ok\n\t\t\t) {\n\t\t\t\tthis._ready = -1;\n\t\t\t\tthrow new Error(\"Presets service is not available\");\n\t\t\t}\n\n\t\t\tthis._presets = await presetsRes.json();\n\t\t\tthis._translations.en = (await translationsENRes.json())?.en?.presets;\n\t\t\tif(lang) {\n\t\t\t\tthis._translations[lang] = (await translationsLangRes.json())?.[lang]?.presets;\n\t\t\t}\n\n\t\t\t// Post-process presets\n\t\t\tObject.entries(this._presets).forEach(([pid,p]) => {\n\t\t\t\t// Add labels\n\t\t\t\tif(this._translations[lang]?.presets?.[pid]?.name) {\n\t\t\t\t\tp.name = this._translations[lang].presets[pid].name;\n\t\t\t\t}\n\t\t\t\telse if(this._translations.en?.presets?.[pid]?.name) {\n\t\t\t\t\tp.name = this._translations.en.presets[pid].name;\n\t\t\t\t}\n\n\t\t\t\t// Create iconify-compatible icon\n\t\t\t\tif(p.icon) {\n\t\t\t\t\tconst iconColl = p.icon.split(\"-\")[0];\n\t\t\t\t\tconst iconCollSub = ICON_COLLECTIONS_SUB[iconColl];\n\t\t\t\t\tp.iconify = iconCollSub ? p.icon.replace(iconColl+\"-\", iconCollSub+\":\") : p.icon.split(\"-\")[0]+\":\"+p.icon.split(\"-\").slice(1).join(\"-\");\n\t\t\t\t\tif(ICON_SUBS[p.iconify]) { p.iconify = ICON_SUBS[p.iconify]; }\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tthis._ready = true;\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Presets service throws an error:\", error);\n\t\t\tthis._ready = -1;\n\t\t}\n\t}\n\n\t/**\n\t * Resolves when the all necessary data was downloaded.\n\t * @memberOf Panoramax.utils.PresetsManager#\n\t * @returns {Promise}\n\t */\n\tasync onceReady() {\n\t\tif(!this._ready) {\n\t\t\tawait new Promise(resolve => setTimeout(resolve, 250));\n\t\t\treturn this.onceReady();\n\t\t}\n\t\telse if(this._ready === -1) { return Promise.reject(); }\n\t\telse { return Promise.resolve(); }\n\t}\n\n\t/**\n\t * Find the best matching preset for a given STAC feature.\n\t * @memberOf Panoramax.utils.PresetsManager#\n\t * @returns {Promise}\n\t * @fulfil {object|null} The preset JSON that best matches, or null if no matches\n\t */\n\tasync getPreset(f) {\n\t\treturn this.getPresets(f).then(res => res.shift());\n\t}\n\n\t/**\n\t * Find all matching presets for a given STAC feature.\n\t * @memberOf Panoramax.utils.PresetsManager#\n\t * @returns {Promise}\n\t * @fulfil {object[]|null} The all JSON presets that best matches, or null if no matches\n\t */\n\tasync getPresets(f) {\n\t\treturn this.onceReady().then(() => {\n\t\t\tconst candidatePresets = Object.values(this._presets).filter(p => {\n\t\t\t\tif(Object.keys(p.tags).length === 0) { return false; }\n\n\t\t\t\t// Check if every tag on preset exists in feature\n\t\t\t\tfor(let pk in p.tags) {\n\t\t\t\t\tconst pv = p.tags[pk];\n\t\t\t\t\tif(!f.semantics.find(s => s.action !== \"delete\" && s.key === pk && (pv === \"*\" || pv === s.value))) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\n\t\t\t// Sort by best matching\n\t\t\tcandidatePresets.sort((a,b) => {\n\t\t\t\tconst nbTagsA = Object.keys(a.tags).length;\n\t\t\t\tconst nbTagsB = Object.keys(b.tags).length;\n\n\t\t\t\tif(nbTagsA > nbTagsB) { return -1; }\n\t\t\t\telse if(nbTagsA === nbTagsB) {\n\t\t\t\t\tconst nbTagsStarA = Object.values(a.tags).filter(v => v === \"*\").length;\n\t\t\t\t\tconst nbTagsStarB = Object.values(b.tags).filter(v => v === \"*\").length;\n\t\t\t\t\tif(nbTagsStarA < nbTagsStarB) { return -1; }\n\t\t\t\t\telse if(nbTagsStarA > nbTagsStarB) { return 1; }\n\t\t\t\t\telse { return 0; }\n\t\t\t\t}\n\t\t\t\telse { return 1; }\n\t\t\t});\n\n\t\t\treturn candidatePresets;\n\t\t});\n\t}\n}\n","import geojsonvt from \"geojson-vt\";\nimport { fromGeojsonVt } from \"@maplibre/vt-pbf\";\n\nexport const SEMANTICS_OVERLAY_MINZOOM = 15;\nexport const SEMANTICS_OVERLAY_MAXZOOM = 19;\nconst LIMIT_PER_ZOOM = { 15: 100, 16: 300, 17: 500, 18: 800, 19: 1000 };\n\n/**\n * Semantics Map Protocol adds a new URI scheme \"sem://\" to MapLibre.\n * It allows loading tile per tile metadata from semantics API, seamlessly.\n * You can use them with URI like:\n * - `sem://\"semantics.osm|traffic_sign\" IS NOT NULL/{z}/{x}/{y}`\n * - `sem://\"semantics.osm|traffic_sign\"='yes'/{z}/{x}/{y}`\n * @class Panoramax.utils.SemanticsMapProtocol\n * @typicalname semMapProtocol\n * @param {Panoramax.utils.API} api The API\n */\nexport default class SemanticsMapProtocol {\n\tconstructor(api) {\n\t\tthis.tiles = new Map();\n\t\tthis.api = api;\n\t}\n\n\t/**\n\t * Transforms a XYZ tile coordinates into GPS bounding box coordinates\n\t * @private \n\t */\n\t_tileToBbox(x, y, z) {\n\t\tconst n = Math.pow(2, z);\n\t\tconst lon1 = x / n * 360 - 180;\n\t\tconst lon2 = (x + 1) / n * 360 - 180;\n\t\tconst lat1 = Math.atan(Math.sinh(Math.PI * (1 - 2 * y / n))) * 180 / Math.PI;\n\t\tconst lat2 = Math.atan(Math.sinh(Math.PI * (1 - 2 * (y + 1) / n))) * 180 / Math.PI;\n\t\treturn [lon1, lat2, lon2, lat1];\n\t}\n\n\t/**\n\t * Merge and override semantics attribute to get a flat tags object.\n\t * @private\n\t */\n\t_semanticsToBasicProps(f) {\n\t\tconst tags = {};\n\n\t\t// Set or append function\n\t\tconst setOrAppend = kv => {\n\t\t\tif(tags[kv.key]) {\n\t\t\t\ttags[kv.key].add(kv.value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttags[kv.key] = new Set([kv.value]);\n\t\t\t}\n\t\t};\n\n\t\t// Read all level of semantics\n\t\t(f.properties?.collection?.semantics || []).forEach(setOrAppend);\n\t\t(f.properties?.semantics || []).forEach(setOrAppend);\n\t\t(f.properties?.annotations || []).forEach(a => a.semantics.forEach(setOrAppend));\n\n\t\tObject.keys(tags).forEach(k => tags[k] = [...tags[k]].join(\";\"));\n\n\t\t// Add Panoramax IDs as well\n\t\ttags.picid = f.id;\n\t\ttags.seqid = f.collection;\n\n\t\treturn tags;\n\t}\n\n\t/**\n\t * Get a single tile\n\t * @param {object} params MapLibre parameters \n\t * @param {AbortController} abort The abort signal handler\n\t * @returns {object} The tile, as expected by MapLibre\n\t * @memberof Panoramax.utils.SemanticsMapProtocol#\n\t */\n\ttile() {\n\t\treturn async (params, abort) => {\n\t\t\tabort = abort || new AbortController();\n\t\t\tconst match = params.url.match(/^sem:\\/\\/\\/(.+)\\/(\\d+)\\/(\\d+)\\/(\\d+)/);\n\t\t\tif (!match) throw new Error(\"Invalid URL\");\n\n\t\t\t// Look for cache\n\t\t\tif(this.tiles.has(params.url)) {\n\t\t\t\treturn { data: this.tiles.get(params.url).buffer.slice(0) };\n\t\t\t}\n\t\t\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\tconst [_, f, z, x, y] = match;\n\t\t\n\t\t\t// Download from API\n\t\t\tconst bbox = this._tileToBbox(parseInt(x), parseInt(y), parseInt(z));\n\t\t\tconst url = `${this.api._endpoint}/search?bbox=${bbox.join(\",\")}&limit=${LIMIT_PER_ZOOM[parseInt(z)]}&sortby=id&filter=${encodeURIComponent(f)}`;\n\t\t\treturn fetch(url, { signal: abort.signal })\n\t\t\t\t.then(res => res.json())\n\t\t\t\t.then(geojson => {\n\t\t\t\t\tif(geojson.features) {\n\t\t\t\t\t\tgeojson.type = \"FeatureCollection\";\n\n\t\t\t\t\t\t// Handle empty results\n\t\t\t\t\t\tif(geojson.features.length === 0) {\n\t\t\t\t\t\t\tconst mvt = new Uint8Array();\n\t\t\t\t\t\t\tthis.tiles.set(params.url, mvt);\n\t\t\t\t\t\t\treturn { data: mvt.buffer.slice(0) };\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Remove useless stuff\n\t\t\t\t\t\tgeojson.features = geojson.features.map(f => ({\n\t\t\t\t\t\t\ttype: f.type,\n\t\t\t\t\t\t\tgeometry: f.geometry,\n\t\t\t\t\t\t\tid: f.id,\n\t\t\t\t\t\t\tproperties: this._semanticsToBasicProps(f)\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Transform GeoJSON into MVT\n\t\t\t\t\tconst tileIndex = geojsonvt(geojson, {minZoom: SEMANTICS_OVERLAY_MINZOOM, maxZoom: SEMANTICS_OVERLAY_MAXZOOM});\n\t\t\t\t\tconst tile = tileIndex.getTile(z, x, y);\n\t\t\t\t\tif(!tile) { throw new Error(\"Can't create tile\"); }\n\t\t\t\t\tconst mvt = fromGeojsonVt({ layer: tile }, { version: 2 });\n\t\t\t\t\tthis.tiles.set(params.url, mvt);\n\t\t\t\t\treturn { data: mvt.buffer.slice(0) };\n\t\t\t\t});\n\t\t};\n\t}\n}","import {\n\talterPSVState, MAP_FILTERS_JS2URL, alterMapState, alterViewerState, alterPhotoViewerState\n} from \"./InitParameters\";\n\n// List of supported parameters\nconst MANAGED_PARAMETERS = [\n\t\"speed\", \"nav\", \"focus\", \"pic\", \"xyz\", \"map\",\n\t\"background\", \"users\", \"s\", \"xywh\",\n\t\"annot\", \"seq\", \"overlay\", \"level\",\n].concat(Object.values(MAP_FILTERS_JS2URL));\n\n// Events to listen on parent and PSV\nconst UPDATE_PARENT_EVENTS = [\"focus-changed\", \"pictures-navigation-changed\"];\nconst UPDATE_PSV_EVENTS = [\"position-updated\", \"zoom-updated\", \"view-rotated\", \"picture-loaded\", \"transition-duration-changed\", \"annotation-focused\", \"annotations-unfocused\"];\nconst UPDATE_MAP_EVENTS = [\"moveend\", \"zoomend\", \"boxzoomend\", \"background-changed\", \"users-changed\", \"filters-changed\", \"styledata\"];\n\n\n/**\n * Updates the URL query part with various parent component information.\n * \n * Note that you may call `listenToChanges()` for this class to be effective once parent is ready-enough.\n *\n * @class Panoramax.utils.URLHandler\n * @typicalname urlHandler\n * @param {Panoramax.components.core.Basic} parent The parent component\n * @fires Panoramax.utils.URLHandler#url-changed\n */\nexport default class URLHandler extends EventTarget {\n\tconstructor(parent) {\n\t\tsuper();\n\t\tthis._parent = parent;\n\t\tthis._delay = null;\n\t}\n\n\t/**\n\t * Start listening to URL & parent changes through events.\n\t * This leads to parent & URL updates.\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tlistenToChanges() {\n\t\twindow.addEventListener(\"popstate\", this._onURLChange.bind(this), false);\n\t\tUPDATE_PARENT_EVENTS.forEach(e => this._parent.addEventListener(e, this._onParentChange.bind(this)));\n\t\tUPDATE_PSV_EVENTS.forEach(e => this._parent.psv.addEventListener(e, this._onParentChange.bind(this)));\n\t\tif(this._parent.map) {\n\t\t\tUPDATE_MAP_EVENTS.forEach(e => this._parent.map.on(e, this._onParentChange.bind(this)));\n\t\t\tthis._parent.map.indoorEqual?.on(\"levelchange\", this._onParentChange.bind(this));\n\t\t}\n\t}\n\n\t/**\n\t * Call this function to stop listening to global events.\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tdestroy() {\n\t\twindow.removeEventListener(\"popstate\", this._onURLChange);\n\t}\n\n\t/**\n\t * Compute next values to insert in URL\n\t * @returns {object} Query parameters\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tnextURLParams() {\n\t\tlet hashParts = {};\n\n\t\tif(typeof this._parent.psv.getTransitionDuration() == \"number\") {\n\t\t\thashParts.speed = this._parent.psv.getTransitionDuration();\n\t\t}\n\n\t\tif(![null, \"any\"].includes(this._parent.psv.getPicturesNavigation())) {\n\t\t\thashParts.nav = this._parent.psv.getPicturesNavigation();\n\t\t}\n\n\t\tif(this._parent.psv.getPictureId()) {\n\t\t\thashParts.pic = this._parent.psv.getPictureId();\n\t\t}\n\t\tconst picMeta = this._parent.psv.getPictureMetadata();\n\t\tif (picMeta) {\n\t\t\thashParts.xyz = this.currentPSVString();\n\t\t\tif(picMeta.sequence?.id) { hashParts.seq = picMeta.sequence.id; }\n\t\t}\n\n\t\tconst annots = this._parent.psv.getSelectedAnnotations();\n\t\tif(annots?.length > 0) {\n\t\t\thashParts.annot = annots[0];\n\t\t}\n\n\t\tif(this._parent.map?.loaded) { // Use this test to avoid empty object checking in\n\t\t\thashParts.map = this.currentMapString();\n\t\t\thashParts.focus = \"pic\";\n\t\t\tif(this._parent.isMapWide()) { hashParts.focus = \"map\"; }\n\t\t\tif(this._parent.map?.hasTwoBackgrounds?.() && this._parent.map?.getBackground?.()) {\n\t\t\t\thashParts.background = this._parent.map.getBackground();\n\t\t\t}\n\n\t\t\tconst vu = this._parent.map.getVisibleUsers();\n\t\t\tif(vu.length > 1 || !vu.includes(\"geovisio\")) {\n\t\t\t\thashParts.users = vu.join(\",\");\n\t\t\t}\n\n\t\t\tif(this._parent.map._mapFilters) {\n\t\t\t\tfor(let k in MAP_FILTERS_JS2URL) {\n\t\t\t\t\tif(this._parent.map._mapFilters[k]) {\n\t\t\t\t\t\thashParts[MAP_FILTERS_JS2URL[k]] = this._parent.map._mapFilters[k];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Array.isArray(hashParts.pic_score)) {\n\t\t\t\t\tif(hashParts.pic_score.length === 5) {\n\t\t\t\t\t\tdelete hashParts.pic_score;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconst mapping = [null, \"E\", \"D\", \"C\", \"B\", \"A\"];\n\t\t\t\t\t\thashParts.pic_score = hashParts.pic_score.map(v => mapping[v]).join(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(Array.isArray(hashParts.gps) && hashParts.gps.length === 5) {\n\t\t\t\t\tdelete hashParts.gps;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._parent.map?.getSemanticOverlays) {\n\t\t\t\tconst visibleSem = this._parent.map.getSemanticOverlays()\n\t\t\t\t\t.filter(l => l.layout?.visibility !== \"none\")\n\t\t\t\t\t.map(l => l.id);\n\t\t\t\tif(visibleSem.length > 0) {\n\t\t\t\t\thashParts.overlay = visibleSem.join(\",\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this._parent.map?.indoorEqual) {\n\t\t\t\thashParts.level = this._parent.map.indoorEqual.level;\n\t\t\t}\n\t\t}\n\t\treturn hashParts;\n\t}\n\n\t/**\n\t * Compute next URL query string (based on `nextURLParams()`)\n\t * @memberof Panoramax.utils.URLHandler#\n\t * @return {string} The query string\n\t */\n\tnextURLString() {\n\t\tlet hash = \"\";\n\n\t\tObject.entries(this.nextURLParams())\n\t\t\t.sort((a,b) => a[0].localeCompare(b[0]))\n\t\t\t.forEach(entry => {\n\t\t\t\tlet [ hashName, value ] = entry;\n\t\t\t\tlet found = false;\n\t\t\t\tconst parts = hash.split(\"&\").map(part => {\n\t\t\t\t\tconst key = part.split(\"=\")[0];\n\t\t\t\t\tif (key === hashName) {\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\treturn `${key}=${value}`;\n\t\t\t\t\t}\n\t\t\t\t\treturn part;\n\t\t\t\t}).filter(a => a);\n\t\t\t\tif (!found) {\n\t\t\t\t\tparts.push(`${hashName}=${value}`);\n\t\t\t\t}\n\t\t\t\thash = `${parts.join(\"&\")}`;\n\t\t\t});\n\n\t\treturn `?${hash}`.replace(/^\\?+/, \"?\");\n\t}\n\n\t/**\n\t * Transforms current URL query string into key->value object\n\t * @param {boolean} [readFromHash=false] Switch to reading from hash URL part (for retro-compatibility)\n\t * @return {object} Key-value read from current URL query\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tcurrentURLParams(readFromHash = false) {\n\t\t// Get the current hash from location, stripped from its number sign\n\t\tconst hash = (readFromHash ? window.location.hash : window.location.search)\n\t\t\t.replace(/^[?#]/, \"\")\n\t\t\t.replace(/&amp;/g, \"&\");\n\n\t\t// Split the parameter-styled hash into parts and find the value we need\n\t\tlet keyvals = {};\n\t\thash.split(\"&\").map(\n\t\t\tpart => part.split(\"=\")\n\t\t)\n\t\t\t.filter(part => part[0] !== undefined && part[0].length > 0 && MANAGED_PARAMETERS.includes(part[0]))\n\t\t\t.forEach(part => {\n\t\t\t\tkeyvals[part[0]] = part[1];\n\t\t\t});\n\t\t\n\t\t// If hash is compressed\n\t\tif(keyvals.s) {\n\t\t\tconst shortVals = Object.fromEntries(\n\t\t\t\tdecodeURIComponent(keyvals.s)\n\t\t\t\t\t.split(\";\")\n\t\t\t\t\t.map(kv => [kv[0], kv.substring(1)])\n\t\t\t);\n\n\t\t\tkeyvals = {};\n\n\t\t\t// Used letters: a b c d e f g k m n o p q l s t u v\n\t\t\t// NOTE: seq=* isn't used in shortlinks\n\t\t\t// Focus\n\t\t\tif(shortVals.f === \"m\") { keyvals.focus = \"map\"; }\n\t\t\telse if(shortVals.f === \"p\") { keyvals.focus = \"pic\"; }\n\t\t\telse if(shortVals.f === \"t\") { keyvals.focus = \"meta\"; }\n\n\t\t\t// Speed\n\t\t\tif(shortVals.s !== \"\") { keyvals.speed = parseFloat(shortVals.s) * 100; }\n\n\t\t\t// Nav\n\t\t\tif(shortVals.n === \"a\") { keyvals.nav = \"any\"; }\n\t\t\telse if(shortVals.n === \"s\") { keyvals.nav = \"seq\"; }\n\t\t\tif([\"n\", \"p\"].includes(shortVals.n)) { keyvals.nav = \"pic\"; }\n\n\t\t\t// Pic\n\t\t\tif(shortVals.p !== \"\") { keyvals.pic = shortVals.p; }\n\n\t\t\t// Annotation\n\t\t\tif(shortVals.a !== \"\") { keyvals.annot = shortVals.a; }\n\n\t\t\t// XYZ\n\t\t\tif(shortVals.c !== \"\") { keyvals.xyz = shortVals.c; }\n\n\t\t\t// Map\n\t\t\tif(shortVals.m !== \"\") { keyvals.map = shortVals.m; }\n\n\t\t\t// Date\n\t\t\tif(shortVals.d !== \"\") { keyvals.date_from = shortVals.d; }\n\t\t\tif(shortVals.e !== \"\") { keyvals.date_to = shortVals.e; }\n\n\t\t\t// Pic type\n\t\t\tif(shortVals.t === \"f\") { keyvals.pic_type = \"flat\"; }\n\t\t\telse if(shortVals.t === \"e\") { keyvals.pic_type = \"equirectangular\"; }\n\n\t\t\t// Camera\n\t\t\tif(shortVals.k !== \"\") { keyvals.camera = shortVals.k; }\n\n\t\t\t// Theme\n\t\t\tif(shortVals.v === \"d\") { keyvals.theme = \"default\"; }\n\t\t\telse if(shortVals.v === \"a\") { keyvals.theme = \"age\"; }\n\t\t\telse if(shortVals.v === \"t\") { keyvals.theme = \"type\"; }\n\t\t\telse if(shortVals.v === \"s\") { keyvals.theme = \"score\"; }\n\t\t\telse if(shortVals.v === \"g\") { keyvals.theme = \"gps\"; }\n\n\t\t\t// Background\n\t\t\tif(shortVals.b === \"s\") { keyvals.background = \"streets\"; }\n\t\t\telse if(shortVals.b === \"a\") { keyvals.background = \"aerial\"; }\n\n\t\t\t// Users\n\t\t\tif(shortVals.u !== \"\") { keyvals.users = shortVals.u; }\n\n\t\t\t// Photoscore\n\t\t\tif(shortVals.q !== \"\") { keyvals.pic_score = shortVals.q; }\n\n\t\t\t// GPS precision\n\t\t\tif(shortVals.g !== \"\") { keyvals.gps = shortVals.g; }\n\n\t\t\t// Overlays\n\t\t\tif(shortVals.o !== \"\") { keyvals.overlay = shortVals.o; }\n\n\t\t\t// Level\n\t\t\tif(shortVals.l !== \"\") { keyvals.level = shortVals.l; }\n\t\t}\n\n\t\treturn keyvals;\n\t}\n\n\t/**\n\t * Get string representation of map position\n\t * @returns {string} zoom/lat/lon or zoom/lat/lon/bearing/pitch\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tcurrentMapString() {\n\t\tif(!this._parent.map?.loaded) { return \"\"; }\n\n\t\tconst center = this._parent.map.getCenter(),\n\t\t\tzoom = Math.round(this._parent.map.getZoom() * 100) / 100,\n\t\t\t// derived from equation: 512px * 2^z / 360 / 10^d < 0.5px\n\t\t\tprecision = Math.ceil((zoom * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10),\n\t\t\tm = Math.pow(10, precision),\n\t\t\tlng = Math.round(center.lng * m) / m,\n\t\t\tlat = Math.round(center.lat * m) / m,\n\t\t\tbearing = this._parent.map.getBearing(),\n\t\t\tpitch = this._parent.map.getPitch();\n\t\tlet hash = `${zoom}/${lat}/${lng}`;\n\n\t\tif (bearing || pitch) hash += (`/${Math.round(bearing * 10) / 10}`);\n\t\tif (pitch) hash += (`/${Math.round(pitch)}`);\n\n\t\treturn hash;\n\t}\n\n\t/**\n\t * Get PSV view position as string\n\t * @returns {string} x/y/z\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tcurrentPSVString() {\n\t\tconst xyz = this._parent.psv.getXYZ();\n\t\tconst x = xyz.x.toFixed(2),\n\t\t\ty = xyz.y.toFixed(2),\n\t\t\tz = Math.round(xyz.z || 0);\n\t\treturn `${x}/${y}/${z}`;\n\t}\n\n\t/**\n\t * Updates map and PSV according to current hash values\n\t * @private\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\t_onURLChange() {\n\t\tlet vals = this.currentURLParams();\n\n\t\tif(this._parent.getClassName() === \"Viewer\") { alterViewerState(this._parent, vals); }\n\t\telse { alterPhotoViewerState(this._parent, vals); }\n\t\t\n\t\talterPSVState(this._parent.psv, vals);\n\t\tif(this._parent.map) { alterMapState(this._parent.map, vals); }\n\t}\n\n\t/**\n\t * Get short link URL (query replaced by Base64)\n\t * @returns {str} The short link URL\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tnextShortLink(baseUrl) {\n\t\tconst url = new URL(baseUrl);\n\t\tconst hashParts = this.nextURLParams();\n\t\tconst shortVals = {\n\t\t\tf: (hashParts.focus || \"\").substring(0, 1),\n\t\t\ts: !isNaN(parseInt(hashParts.speed)) ? Math.floor(parseInt(hashParts.speed)/100) : undefined,\n\t\t\tn: (hashParts.nav || \"\").substring(0, 1),\n\t\t\tp: hashParts.pic,\n\t\t\tc: hashParts.xyz,\n\t\t\tm: hashParts.map,\n\t\t\td: hashParts.date_from,\n\t\t\te: hashParts.date_to,\n\t\t\tt: (hashParts.pic_type || \"\").substring(0, 1),\n\t\t\tk: hashParts.camera,\n\t\t\tv: (hashParts.theme || \"\").substring(0, 1),\n\t\t\tb: (hashParts.background || \"\").substring(0, 1),\n\t\t\tu: hashParts.users,\n\t\t\tq: hashParts.pic_score,\n\t\t\ta: hashParts.annot,\n\t\t\tg: hashParts.gps,\n\t\t\to: hashParts.overlay,\n\t\t\tl: hashParts.level,\n\t\t};\n\t\tconst short = Object.entries(shortVals)\n\t\t\t.filter(([,v]) => v != undefined && v != \"\")\n\t\t\t.map(([k,v]) => `${k}${v}`)\n\t\t\t.join(\";\");\n\t\turl.search = `s=${short}`;\n\t\treturn url;\n\t}\n\n\t/**\n\t * Returns a string containing only parameters out of URLHandler scope\n\t * @param {URL} prevUrl The previously set URL\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\tgetUnmanagedParameters(prevUrl) {\n\t\treturn new URLSearchParams(\n\t\t\tArray.from(prevUrl.searchParams)\n\t\t\t\t.filter(([k]) => !MANAGED_PARAMETERS.includes(k))\n\t\t).toString();\n\t}\n\n\t/**\n\t * Changes the URL hash using current viewer parameters\n\t * @private\n\t * @memberof Panoramax.utils.URLHandler#\n\t */\n\t_onParentChange() {\n\t\tif(this._delay) {\n\t\t\tclearTimeout(this._delay);\n\t\t\tthis._delay = null;\n\t\t}\n\n\t\tthis._delay = setTimeout(() => {\n\t\t\tconst prevUrl = new URL(window.location.href);\n\t\t\tconst nextUrl = new URL(window.location.href);\n\t\t\tconst unmanaged = this.getUnmanagedParameters(prevUrl);\n\t\t\tnextUrl.search = this._parent ? this.nextURLString() + (unmanaged.length > 0 ? \"&\"+unmanaged : \"\"): \"\";\n\n\t\t\t// Clear out hash if older parameters appear\n\t\t\tif(Object.keys(this.currentURLParams(true)).length > 0) { nextUrl.hash = \"\"; }\n\n\t\t\t// Skip hash update if no changes\n\t\t\tif(prevUrl.search == nextUrl.search) { return; }\n\n\t\t\tconst prevPic = this.currentURLParams().pic || \"\";\n\t\t\tconst nextPic = this._parent?.psv?.getPictureId?.() || \"\";\n\n\t\t\ttry {\n\t\t\t\t// If different pic, add entry in browser history\n\t\t\t\tif(prevPic != nextPic) {\n\t\t\t\t\twindow.history.pushState(window.history.state, null, nextUrl.href);\n\t\t\t\t}\n\t\t\t\t// If same pic, just update viewer params\n\t\t\t\telse {\n\t\t\t\t\twindow.history.replaceState(window.history.state, null, nextUrl.href);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this._parent) {\n\t\t\t\t\t/**\n\t\t\t\t\t * URL changed event\n\t\t\t\t\t * @event Panoramax.utils.URLHandler#url-changed\n\t\t\t\t\t * @type {CustomEvent}\n\t\t\t\t\t * @property {string} detail.url The new used URL\n\t\t\t\t\t */\n\t\t\t\t\tconst event = new CustomEvent(\"url-changed\", { detail: {url: nextUrl.href}});\n\t\t\t\t\tthis.dispatchEvent(event);\n\t\t\t\t}\n\t\t\t} catch (SecurityError) {\n\t\t\t\t// IE11 does not allow this if the page is within an iframe created\n\t\t\t\t// with iframe.contentWindow.document.write(...).\n\t\t\t\t// https://github.com/mapbox/mapbox-gl-js/issues/7410\n\t\t\t}\n\t\t}, 500);\n\t}\n}\n","import { NominatimBaseUrl, AdresseDataGouvBaseURL } from \"./services\";\n\nconst PLACETYPE_ZOOM =  {\n\t\"house\": 20,\n\t\"housenumber\": 20,\n\t\"street\": 18,\n\t\"locality\": 15,\n\t\"district\": 13,\n\t\"municipality\": 12,\n\t\"city\": 12,\n\t\"county\": 8,\n\t\"region\": 7,\n\t\"state\": 7,\n\t\"country\": 5\n};\n\n/**\n * Transforms a set of parameters into an URL-ready string\n * It also removes null/undefined values\n *\n * @param {object} params The parameters object\n * @return {string} The URL query part\n * @private\n */\nfunction geocoderParamsToURLString(params) {\n\tlet p = {};\n\tObject.entries(params)\n\t\t.filter(e => e[1] !== undefined && e[1] !== null)\n\t\t.forEach(e => p[e[0]] = e[1]);\n\n\treturn new URLSearchParams(p).toString();\n}\n\n/**\n * Nominatim (OSM) geocoder, ready to use for our Map\n * @private\n */\nexport function forwardGeocodingNominatim(config) {\n\t// Transform parameters into Nominatim format\n\tconst params = {\n\t\tq: config.query,\n\t\tcountrycodes: config.countries,\n\t\tlimit: config.limit,\n\t\tviewbox: config.bbox,\n\t};\n\n\treturn fetch(`${NominatimBaseUrl()}/search?${geocoderParamsToURLString(params)}&format=geocodejson&addressdetails=1`)\n\t\t.then(res => res.json())\n\t\t.then(res => {\n\t\t\tconst finalRes = { features: [] };\n\t\t\tconst listedNames = [];\n\t\t\t(res.features || []).forEach(f => {\n\t\t\t\tconst plname = geocodeJsonToPlaceName(f.properties?.geocoding) || f.properties?.geocoding?.label;\n\t\t\t\tif(!listedNames.includes(plname)) {\n\t\t\t\t\tfinalRes.features.push({\n\t\t\t\t\t\tplace_type: [\"place\"],\n\t\t\t\t\t\tplace_name: plname,\n\t\t\t\t\t\tcenter: f.geometry.coordinates,\n\t\t\t\t\t\tzoom: PLACETYPE_ZOOM[f.properties?.geocoding?.type],\n\t\t\t\t\t});\n\t\t\t\t\tlistedNames.push(plname);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn finalRes;\n\t\t});\n}\n\nexport function reverseGeocodingNominatim(lat, lon) {\n\treturn fetch(`${NominatimBaseUrl()}/reverse?lat=${lat}&lon=${lon}&zoom=18&format=geocodejson`)\n\t\t.then(res => res.json())\n\t\t.then(res => geocodeJsonToPlaceName(res?.features?.shift()?.properties?.geocoding));\n}\n\n/**\n * Base adresse nationale (FR) geocoder, ready to use for our Map\n * @param {object} config Configuration sent by MapLibre GL Geocoder, following the geocoderApi format ( https://maplibre.org/maplibre-gl-geocoder/types/MaplibreGeocoderApiConfig.html )\n * @returns {object} GeoJSON Feature collection in Carmen GeoJSON format ( https://maplibre.org/maplibre-gl-geocoder/types/CarmenGeojsonFeature.html )\n * @private\n */\nexport function forwardGeocodingBAN(config) {\n\treturn forwardGeocodingStandard(config, AdresseDataGouvBaseURL());\n}\n\n/**\n * Transforms GeocodeJSON search result into a nice-to-display address.\n * @param {object} props The GecodeJSON API feature properties\n * @returns {string} The clean-up string for display\n * @private\n */\nfunction geocodeJsonToPlaceName(props) {\n\t// API format @ https://github.com/geocoders/geocodejson-spec/blob/master/draft/README.md\n\tif(!props || typeof props != \"object\") { return \"\"; }\n\n\t// P1 = main name, P2=locality-like, P3=country+high-level admin\n\tlet p1 = props.name;\n\tlet p2 = [], p3 = [];\n\n\tswitch(props.type) {\n\tcase \"hamlet\":\n\tcase \"croft\":\n\tcase \"isolated_dwelling\":\n\tcase \"neighbourhood\":\n\tcase \"allotments\":\n\tcase \"quarter\":\n\tcase \"farm\":\n\tcase \"farmyard\":\n\tcase \"industrial\":\n\tcase \"commercial\":\n\tcase \"retail\":\n\tcase \"city_block\":\n\tcase \"residential\":\n\tcase \"locality\":\n\tcase \"district\":\n\t\tp3.push(props.city);\n\t\tp3.push(props.county);\n\t\tp3.push(props.state);\n\t\tp3.push(props.country);\n\t\tbreak;\n\tcase \"city\":\n\t\tp3.push(props.county);\n\t\tp3.push(props.state);\n\t\tp3.push(props.country);\n\t\tbreak;\n\tcase \"region\":\n\t\tp3.push(props.county);\n\t\tp3.push(props.state);\n\t\tp3.push(props.country);\n\t\tbreak;\n\tcase \"country\":\n\t\tbreak;\n\tcase \"house\":\n\tcase \"housenumber\":\n\t\tp2.push(props.housenumber);\n\t\tp2.push(props.street);\n\t\tp2.push(props.locality);\n\t\tp2.push(props.district);\n\t\tp3.push(props.city);\n\t\tp3.push(props.county);\n\t\tp3.push(props.state);\n\t\tp3.push(props.country);\n\t\tbreak;\n\tcase \"street\":\n\tcase \"road\":\n\tdefault:\n\t\tp2.push(props.street);\n\t\tp2.push(props.locality);\n\t\tp2.push(props.district);\n\t\tp3.push(props.city);\n\t\tp3.push(props.county);\n\t\tp3.push(props.state);\n\t\tp3.push(props.country);\n\t\tbreak;\n\t}\n\n\tp2 = p2.filter(v => v);\n\tp2 = p2.filter((v,i) => v != p1 && (i === 0 || p2[i-1] !== v));\n\tp2 = p2.length > 0 ? (props.housenumber ? p2.slice(0,2).join(\" \") : p2.shift()) : null;\n\tif(p2 === p1) { p2 = null; }\n\n\tp3 = p3.filter(v => v);\n\tp3 = p3.filter((v,i) => v != p1 && (!p2 || !p2.includes(v)) && (i === 0 || p3[i-1] !== v));\n\n\tlet res = [p1, p2, p3.shift()].filter(v => v);\n\n\treturn res.join(\", \");\n}\n\n/**\n * Standard forward geocoder\n * @param {object} config Configuration sent by MapLibre GL Geocoder, following the geocoderApi format ( https://maplibre.org/maplibre-gl-geocoder/types/MaplibreGeocoderApiConfig.html )\n * @param {string} endpoint The URL endpoint (everything before the /?q=...)\n * @returns {object} GeoJSON Feature collection in Carmen GeoJSON format ( https://maplibre.org/maplibre-gl-geocoder/types/CarmenGeojsonFeature.html )\n * @private\n */\nexport function forwardGeocodingStandard(config, endpoint) {\n\t// Transform parameters into BAN format\n\tconst params = { q: config.query, limit: config.limit };\n\tif(typeof config.proximity === \"string\") {\n\t\tconst [lat, lon] = config.proximity.split(\",\").map(v => parseFloat(v.trim()));\n\t\tparams.lat = lat;\n\t\tparams.lon = lon;\n\t}\n\n\treturn fetch(`${endpoint}/?${geocoderParamsToURLString(params)}`)\n\t\t.then(res => res.json())\n\t\t.then(res => {\n\t\t\tconst finalRes = { features: [] };\n\t\t\tconst listedNames = [];\n\t\t\t(res.features || []).forEach(f => {\n\t\t\t\tconst plname = geocodeJsonToPlaceName(f.properties);\n\t\t\t\tif(!listedNames.includes(plname) && f.properties.type != \"other\") {\n\t\t\t\t\tfinalRes.features.push({\n\t\t\t\t\t\tplace_type: [\"place\"],\n\t\t\t\t\t\tplace_name: plname,\n\t\t\t\t\t\tcenter: f.geometry.coordinates,\n\t\t\t\t\t\tzoom: PLACETYPE_ZOOM[f.properties.type],\n\t\t\t\t\t});\n\t\t\t\t\tlistedNames.push(plname);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn finalRes;\n\t\t});\n}\n","import T_be from \"../translations/be.json\";\nimport T_da from \"../translations/da.json\";\nimport T_de from \"../translations/de.json\";\nimport T_en from \"../translations/en.json\";\nimport T_eo from \"../translations/eo.json\";\nimport T_es from \"../translations/es.json\";\nimport T_fr from \"../translations/fr.json\";\nimport T_hu from \"../translations/hu.json\";\nimport T_it from \"../translations/it.json\";\nimport T_ja from \"../translations/ja.json\";\nimport T_nl from \"../translations/nl.json\";\nimport T_pl from \"../translations/pl.json\";\nimport T_pt from \"../translations/pt.json\";\nimport T_pt_BR from \"../translations/pt_BR.json\";\nimport T_sv from \"../translations/sv.json\";\nimport T_tr from \"../translations/tr.json\";\nimport T_uk from \"../translations/uk.json\";\nimport T_zh_Hant from \"../translations/zh_Hant.json\";\n\nconst FALLBACK_LOCALE = \"en\";\nconst TRANSLATIONS = {\n\t\"be\": T_be, \"da\": T_da, \"de\": T_de, \"eo\": T_eo, \"en\": T_en, \"es\": T_es, \"fr\": T_fr,\n\t\"hu\": T_hu, \"it\": T_it, \"ja\": T_ja, \"nl\": T_nl, \"pl\": T_pl, \"pt\": T_pt, \"pt-br\": T_pt_BR,\n\t\"sv\": T_sv, \"tr\": T_tr, \"uk\": T_uk, \"zh-hant\": T_zh_Hant, \"zh\": T_zh_Hant,\n};\n\n/**\n * Find best matching language regarding of list of supported languages and browser accepted languages\n * @param {str[]} supportedTranslations List of supported languages\n * @param {str} fallback The fallback language\n * @returns The best matching language (in lowercase)\n * @private\n */\nexport function autoDetectLocale(supportedTranslations, fallback) { // eslint-ignore import/no-unused-modules\n\tsupportedTranslations = supportedTranslations.map(k => k.toLowerCase());\n\n\tfor (const navigatorLang of window.navigator.languages) {\n\t\tlet language = navigatorLang.toLowerCase();\n\t\t// Convert browser code to weblate code\n\t\tswitch (language) {\n\t\tcase \"zh-tw\":\n\t\tcase \"zh-hk\":\n\t\tcase \"zh-mo\":\n\t\t\tlanguage = \"zh-hant\";\n\t\t\tbreak;\n\t\tcase \"zh-cn\":\n\t\tcase \"zh-sg\":\n\t\t\tlanguage = \"zh-hans\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (language.length > 2 && !supportedTranslations.includes(language)) {\n\t\t\t\tlanguage = navigatorLang.substring(0, 2);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tconst pair = supportedTranslations.find((pair) => pair === language);\n\t\tif (pair) {\n\t\t\treturn pair;\n\t\t}\n\t}\n\treturn fallback;\n}\n\n/**\n * Get text labels translations in given language\n *\n * @param {string} [lang] The language code (fr, en) (defaults to browser preferences)\n * @returns {object} Translations in given language, with fallback to english\n * @private\n */\nexport function getTranslations(lang = \"\") {\n\tconst myTr = JSON.parse(JSON.stringify(T_en));\n\tlet preferedTr;\n\t\n\t// No specific lang set -> use browser lang\n\tif(!lang) {\n\t\tlang = autoDetectLocale(Object.keys(TRANSLATIONS), FALLBACK_LOCALE);\n\t}\n\n\t// Lang exists -> send it\n\tif(TRANSLATIONS[lang] && lang !== \"en\") {\n\t\tpreferedTr = TRANSLATIONS[lang];\n\t}\n\n\t// Look for primary lang\n\tif(lang.length > 2) {\n\t\tconst primaryLang = lang.substring(0, 2);\n\t\tif(TRANSLATIONS[primaryLang]) { preferedTr = TRANSLATIONS[primaryLang]; }\n\t}\n\n\t// Merge labels to avoid missing ones\n\tif(preferedTr) {\n\t\tObject.entries(preferedTr).forEach(([k1, k2]) => {\n\t\t\tObject.entries(k2).forEach(([k2, k3]) => {\n\t\t\t\tif(Array.isArray(k3)) { k3 = k3.filter(v => v != null); }\n\t\t\t\tmyTr[k1][k2] = k3;\n\t\t\t});\n\t\t});\n\t}\n\n\tmyTr.PREF_LANG = lang;\n\n\treturn myTr;\n}\n\n\n/**\n * Get best matching label based on user language\n * @param {object} labels The key->value list of labels\n * @param {string} [lang] The language code (fr, en) (defaults to browser preferences)\n * @returns {string} The best matching label\n */\nexport function getBestLabel(labels, lang) {\n\t// All to lowercase to avoid matching issues\n\tlang = lang ? lang.toLowerCase() : null;\n\tlabels = Object.fromEntries(Object.entries(labels).map(([k,v]) => [k.toLowerCase(), v]));\n\n\t// No specific lang set -> use browser lang\n\tif(!lang) {\n\t\tlang = autoDetectLocale(Object.keys(labels), FALLBACK_LOCALE);\n\t}\n\n\tif(labels[lang]) { return labels[lang]; }\n\telse if(lang.length > 2 && labels[lang.substring(0,2)]) { return labels[lang.substring(0,2)]; }\n\telse { return labels[FALLBACK_LOCALE] || \"\"; }\n}\n","import { IndoorEqualSpritesURL } from \"./services\";\nimport { createWebComp } from \"./widgets\";\n\nexport const DISABLED_LEVEL = \"-1000\";\nconst LEVEL_SEM_LAYER = \"levels\";\n\n/**\n * Enables indoor= plugin on MapLibre\n * @param {Map} map The MapLibre map\n */\nexport function initIndoorEqualOnMap(map) {\n\tif(map._options.indoor) {\n\t\t/* eslint-disable no-undef */\n\n\t\t// Check if indoor= plugin is enabled\n\t\tlet enabled = false;\n\t\ttry {\n\t\t\tIndoorEqual;\n\t\t\tenabled = true;\n\t\t}\n\t\tcatch(e) {\n\t\t\tconsole.error(\"The indoor= plugin is not enabled. Please add the maplibre-gl-indoorequal before calling 'indoor' option of Panoramax Viewer.\");\n\t\t}\n\n\t\tif(enabled) {\n\t\t\tmap.indoorEqual = new IndoorEqual(map, map._options.indoor);\n\t\t\tmap.addControl(map.indoorEqual);\n\t\t\tmap.indoorEqual.loadSprite(IndoorEqualSpritesURL());\n\n\t\t\t// Override level refresh to keep \"disabled\" state after map move\n\t\t\tmap.indoorEqual._refreshAfterLevelsUpdate = function() {\n\t\t\t\tif (!this.levels.includes(this.level) && this.level != DISABLED_LEVEL) {\n\t\t\t\t\tthis.setLevel(\"0\");\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Override updateLevels to take into account pictures levels\n\t\t\tconst SEM_SRC_ID = \"sem-\"+LEVEL_SEM_LAYER;\n\t\t\tmap.indoorEqual._updateLevels = function() {\n\t\t\t\tif(\n\t\t\t\t\tthis.map.isSourceLoaded(this.source.sourceId)\n\t\t\t\t\t&& this.map.isSourceLoaded(SEM_SRC_ID)\n\t\t\t\t) {\n\t\t\t\t\tlet levels = new Set();\n\n\t\t\t\t\t// Read levels from indoor= tiles\n\t\t\t\t\tthis.map.querySourceFeatures(this.source.sourceId, { sourceLayer: \"area\" })\n\t\t\t\t\t\t.forEach(f => {\n\t\t\t\t\t\t\tif(f.properties.class === \"level\") { return; }\n\t\t\t\t\t\t\tif(f.properties.level !== undefined) {\n\t\t\t\t\t\t\t\tlevels.add(f.properties.level.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// Read levels from Panoramax tiles\n\t\t\t\t\tthis.map.querySourceFeatures(SEM_SRC_ID, { sourceLayer: \"layer\" })\n\t\t\t\t\t\t.forEach(f => {\n\t\t\t\t\t\t\tif(f.properties[\"osm|level\"] !== undefined) {\n\t\t\t\t\t\t\t\tlevels.add(f.properties[\"osm|level\"].toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// If at least one level exist, add floor just to be sure it's always present\n\t\t\t\t\tif(levels.size > 0) { levels.add(\"0\"); }\n\n\t\t\t\t\tif(levels.symmetricDifference(new Set(this.levels)).size !== 0) {\n\t\t\t\t\t\tthis.levels = [...levels].sort((a, b) => parseFloat(a) - parseFloat(b)).reverse();\n\t\t\t\t\t\tthis._emitLevelsChange();\n\t\t\t\t\t\tthis._refreshAfterLevelsUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Store features IDs by level\n\t\t\tmap._indoorFeaturesIDs = { pictures: {}, sequences: {} };\n\t\t\tmap.on(\"sourcedata\", LEVEL_SEM_LAYER, e => {\n\t\t\t\tif(e.sourceId === SEM_SRC_ID) {\n\t\t\t\t\te.features.forEach(f => {\n\t\t\t\t\t\tif(!map._indoorFeaturesIDs.pictures[f.properties[\"osm|level\"]]) {\n\t\t\t\t\t\t\tmap._indoorFeaturesIDs.pictures[f.properties[\"osm|level\"]] = new Set();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!map._indoorFeaturesIDs.sequences[f.properties[\"osm|level\"]]) {\n\t\t\t\t\t\t\tmap._indoorFeaturesIDs.sequences[f.properties[\"osm|level\"]] = new Set();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap._indoorFeaturesIDs.pictures[f.properties[\"osm|level\"]].add(f.properties.picid);\n\t\t\t\t\t\tmap._indoorFeaturesIDs.sequences[f.properties[\"osm|level\"]].add(f.properties.seqid);\n\t\t\t\t\t});\n\t\t\t\t\tupdateIndoorLevelFilteringThrottled();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Create semantic overlay layer for loading with-level pictures\n\t\t\tmap.once(\"load\", () => {\n\t\t\t\tmap.addSemanticOverlay?.(\n\t\t\t\t\tLEVEL_SEM_LAYER,\n\t\t\t\t\t\"\\\"semantics.osm|level\\\" IS NOT NULL\",\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"circle\",\n\t\t\t\t\t\tlayout: { visibility: \"visible\" },\n\t\t\t\t\t\tpaint: { \"circle-opacity\": 0 }\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t// Load level from component/URL if any\n\t\t\t\tif(![null, undefined, \"\"].includes(map._parent._initParams?.getMapPostInit()?.level)) {\n\t\t\t\t\tmap.indoorEqual.setLevel(map._parent._initParams?.getMapPostInit()?.level);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Add map widget for level select\n\t\t\tmap._parent.grid.appendChild(createWebComp(\"pnx-level-select\", {\n\t\t\t\tslot: \"bottom-right\",\n\t\t\t\t_parent: map._parent,\n\t\t\t\tclass: \"pnx-only-map pnx-print-hidden\",\n\t\t\t}));\n\n\t\t\t// Filter indoor pictures based on selected level\n\t\t\tlet updateIndoorLevelFilteringThrottler;\n\t\t\tconst updateIndoorLevelFiltering = () => {\n\t\t\t\t// Disabled = show everything\n\t\t\t\tif(map.indoorEqual.level === DISABLED_LEVEL) {\n\t\t\t\t\tmap.restrictVisibleFeatures(\"hide\", \"pictures\", []);\n\t\t\t\t\tmap.restrictVisibleFeatures(\"hide\", \"sequences\", []);\n\t\t\t\t}\n\t\t\t\t// Ground level = hide all other levels features\n\t\t\t\telse if(map.indoorEqual.level === \"0\") {\n\t\t\t\t\t// Pictures\n\t\t\t\t\tconst nonGroundPics = new Set();\n\t\t\t\t\tObject.entries(map._indoorFeaturesIDs.pictures).forEach(([lvl, features]) => {\n\t\t\t\t\t\tif(lvl != \"0\") { features.forEach(f => nonGroundPics.add(f)); }\n\t\t\t\t\t});\n\t\t\t\t\tmap.restrictVisibleFeatures(\"hide\", \"pictures\", [...nonGroundPics]);\n\n\t\t\t\t\t// Sequences\n\t\t\t\t\tlet nonGroundSeqs = new Set();\n\t\t\t\t\tObject.entries(map._indoorFeaturesIDs.sequences).forEach(([lvl, features]) => {\n\t\t\t\t\t\tif(lvl != \"0\") {\n\t\t\t\t\t\t\tnonGroundSeqs = nonGroundSeqs.union(features);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(map._indoorFeaturesIDs.sequences[\"0\"]) { nonGroundSeqs = nonGroundSeqs.difference(map._indoorFeaturesIDs.sequences[\"0\"]); } // To skip multi-level sequences\n\t\t\t\t\tmap.restrictVisibleFeatures(\"hide\", \"sequences\", [...nonGroundSeqs]);\n\t\t\t\t}\n\t\t\t\t// Other level = show only appropriate level features\n\t\t\t\telse {\n\t\t\t\t\tmap.restrictVisibleFeatures(\n\t\t\t\t\t\t\"keep\",\n\t\t\t\t\t\t\"pictures\",\n\t\t\t\t\t\tmap._indoorFeaturesIDs.pictures[map.indoorEqual.level]\n\t\t\t\t\t\t\t? [...map._indoorFeaturesIDs.pictures[map.indoorEqual.level]]\n\t\t\t\t\t\t\t: []\n\t\t\t\t\t);\n\t\t\t\t\tmap.restrictVisibleFeatures(\n\t\t\t\t\t\t\"keep\",\n\t\t\t\t\t\t\"sequences\",\n\t\t\t\t\t\tmap._indoorFeaturesIDs.sequences[map.indoorEqual.level]\n\t\t\t\t\t\t\t? [...map._indoorFeaturesIDs.sequences[map.indoorEqual.level]]\n\t\t\t\t\t\t\t: []\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t\tconst updateIndoorLevelFilteringThrottled = () => {\n\t\t\t\tif(updateIndoorLevelFilteringThrottler) {\n\t\t\t\t\tclearTimeout(updateIndoorLevelFilteringThrottler);\n\t\t\t\t\tupdateIndoorLevelFilteringThrottler = undefined;\n\t\t\t\t}\n\t\t\t\tupdateIndoorLevelFilteringThrottler = setTimeout(updateIndoorLevelFiltering, 250);\n\t\t\t};\n\n\t\t\tmap.indoorEqual.on(\"levelchange\", updateIndoorLevelFilteringThrottled);\n\t\t}\n\t}\n}\n","import LoaderImg from \"../img/marker.svg\";\nimport { COLORS, QUALITYSCORE_RES_FLAT_VALUES, QUALITYSCORE_RES_360_VALUES, QUALITYSCORE_GPS_VALUES, QUALITYSCORE_POND_RES, QUALITYSCORE_POND_GPS } from \"./utils\";\nimport { autoDetectLocale } from \"./i18n\";\nimport { isNullId } from \"./utils\";\n\nexport const RASTER_LAYER_ID = \"pnx-aerial\";\n\nexport const TILES_PICTURES_ZOOM = 15;\nexport const TILES_PICTURES_SYMBOL_ZOOM = 19;\n\nconst CROWDED_TILE_COND = [\"!\", [\"has\", \"uncrowded\"]];\nconst EQUIRECT_COND = [\"==\", [\"get\", \"type\"], \"equirectangular\"];\n\nfunction getVectorStyles(noCrowded) {\n\treturn {\n\t\tPICTURES: {\n\t\t\t\"paint\": {\n\t\t\t\t\"circle-radius\": [\"interpolate\", [\"linear\"], [\"zoom\"],\n\t\t\t\t\tTILES_PICTURES_ZOOM,     0,\n\t\t\t\t\tTILES_PICTURES_ZOOM+0.5, noCrowded ? 1 : [\"case\", CROWDED_TILE_COND, 0, 1],\n\t\t\t\t\tTILES_PICTURES_ZOOM+1.5, noCrowded ? 2 : [\"case\", CROWDED_TILE_COND, 0, 2],\n\t\t\t\t\tTILES_PICTURES_ZOOM+2,   noCrowded ? 4 : [\"case\", CROWDED_TILE_COND, 1, 4],\n\t\t\t\t\tTILES_PICTURES_ZOOM+3,   noCrowded ? 5 : [\"case\", CROWDED_TILE_COND, 3, 5],\n\t\t\t\t\tTILES_PICTURES_ZOOM+5,   noCrowded ? 7 : [\"case\", CROWDED_TILE_COND, 5, 7],\n\t\t\t\t\tTILES_PICTURES_ZOOM+7,   noCrowded ? 7 : [\"case\", CROWDED_TILE_COND, 7, 7],\n\t\t\t\t],\n\t\t\t\t\"circle-opacity\": [\"interpolate\", [\"linear\"], [\"zoom\"],\n\t\t\t\t\tTILES_PICTURES_ZOOM,     0,\n\t\t\t\t\tTILES_PICTURES_ZOOM+0.5, noCrowded ? 1 : [\"case\", CROWDED_TILE_COND, 0, 1],\n\t\t\t\t\tTILES_PICTURES_ZOOM+1.5, noCrowded ? 1 : [\"case\", CROWDED_TILE_COND, 0, 1],\n\t\t\t\t\tTILES_PICTURES_ZOOM+2,   1\n\t\t\t\t],\n\t\t\t\t\"circle-stroke-opacity\": [\"case\",\n\t\t\t\t\t[\"all\", CROWDED_TILE_COND, EQUIRECT_COND], 0.2,\n\t\t\t\t\tEQUIRECT_COND, 0.4,\n\t\t\t\t\t0\n\t\t\t\t],\n\t\t\t\t\"circle-stroke-width\": [\"interpolate\", [\"linear\"], [\"zoom\"],\n\t\t\t\t\tTILES_PICTURES_ZOOM+2.5, 0,\n\t\t\t\t\tTILES_PICTURES_ZOOM+3.5, noCrowded ? [\"case\",\n\t\t\t\t\t\tEQUIRECT_COND, 10,\n\t\t\t\t\t\t2\n\t\t\t\t\t] : [\"case\",\n\t\t\t\t\t\t[\"all\", CROWDED_TILE_COND, EQUIRECT_COND], 0,\n\t\t\t\t\t\tEQUIRECT_COND, 10,\n\t\t\t\t\t\tCROWDED_TILE_COND, 0,\n\t\t\t\t\t\t2\n\t\t\t\t\t],\n\t\t\t\t\tTILES_PICTURES_ZOOM+4.5, noCrowded ? [\"case\",\n\t\t\t\t\t\tEQUIRECT_COND, 10,\n\t\t\t\t\t\t2\n\t\t\t\t\t]: [\"case\",\n\t\t\t\t\t\t[\"all\", CROWDED_TILE_COND, EQUIRECT_COND], 10,\n\t\t\t\t\t\tEQUIRECT_COND, 10,\n\t\t\t\t\t\tCROWDED_TILE_COND, 0,\n\t\t\t\t\t\t2\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t},\n\t\t\t\"layout\": {}\n\t\t},\n\t\tSEQUENCES: {\n\t\t\t\"paint\": {\n\t\t\t\t\"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"],\n\t\t\t\t\t0,                       0.5,\n\t\t\t\t\t10,                      1.5,\n\t\t\t\t\tTILES_PICTURES_ZOOM-0.5, 1.5,\n\t\t\t\t\tTILES_PICTURES_ZOOM+0.5, noCrowded ? 2 : [\"case\", CROWDED_TILE_COND, 0.5, 2],\n\t\t\t\t\t22,                      noCrowded ? 4 : [\"case\", CROWDED_TILE_COND, 1, 4],\n\t\t\t\t],\n\t\t\t},\n\t\t\t\"layout\": {\n\t\t\t\t\"line-cap\": \"square\",\n\t\t\t}\n\t\t},\n\t\tSEQUENCES_PLUS: {\n\t\t\t\"paint\": {\n\t\t\t\t\"line-width\": [\"interpolate\", [\"linear\"], [\"zoom\"], 0, 15, TILES_PICTURES_ZOOM+1, 30],\n\t\t\t\t\"line-opacity\": 0,\n\t\t\t\t\"line-color\": \"#ff0000\",\n\t\t\t},\n\t\t\t\"layout\": {\n\t\t\t\t\"line-cap\": \"square\",\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport const VECTOR_STYLES = getVectorStyles(false);\nexport const VECTOR_STYLES_NOCROWD = getVectorStyles(true);\n\nexport const MAP_THEMES = {\n\tDEFAULT: \"default\",\n\tAGE: \"age\",\n\tTYPE: \"type\",\n\tSCORE: \"score\",\n\tGPS: \"gps\",\n};\n\n\n// See MapLibre docs for explanation of expressions magic: https://maplibre.org/maplibre-style-spec/expressions/\nconst MAP_EXPR_QUALITYSCORE_RES_360  = [\"case\", [\"has\", \"h_pixel_density\"], [\"step\", [\"get\", \"h_pixel_density\"], ...QUALITYSCORE_RES_360_VALUES], 1];\nconst MAP_EXPR_QUALITYSCORE_RES_FLAT = [\"case\", [\"has\", \"h_pixel_density\"], [\"step\", [\"get\", \"h_pixel_density\"], ...QUALITYSCORE_RES_FLAT_VALUES], 1];\nconst MAP_EXPR_QUALITYSCORE_RES = [\n\t\"case\", [\"==\", [\"get\", \"type\"], \"equirectangular\"],\n\tMAP_EXPR_QUALITYSCORE_RES_360, MAP_EXPR_QUALITYSCORE_RES_FLAT\n];\nexport const MAP_EXPR_QUALITYSCORE_GPS = [\"case\", [\"has\", \"gps_accuracy\"], [\"step\", [\"get\", \"gps_accuracy\"], ...QUALITYSCORE_GPS_VALUES], 1];\n// Note: score is also calculated in widgets/popup code\nexport const MAP_EXPR_QUALITYSCORE = [\n\t\"round\",\n\t[\"+\",\n\t\t[\"*\", MAP_EXPR_QUALITYSCORE_RES, QUALITYSCORE_POND_RES],\n\t\t[\"*\", MAP_EXPR_QUALITYSCORE_GPS, QUALITYSCORE_POND_GPS]]\n];\n\n\n/**\n * Get the GIF shown while thumbnail loads\n * @param {object} lang Translations\n * @returns The DOM element for this GIF\n * @private\n */\nexport function getThumbGif(lang) {\n\tconst thumbGif = document.createElement(\"img\");\n\tthumbGif.src = LoaderImg;\n\tthumbGif.alt = lang.loading;\n\tthumbGif.title = lang.loading;\n\tthumbGif.classList.add(\"pnx-map-thumb\", \"pnx-map-thumb-loader\");\n\treturn thumbGif;\n}\n\nexport function isNullCoordinates(c) {\n\treturn (\n\t\tc === null\n\t\t|| c === undefined\n\t\t|| (Array.isArray(c) && (\n\t\t\t(c.length === 2 && c[0] === 0 && c[1] === 0)\n\t\t\t|| c.length < 2\n\t\t))\n\t);\n}\n\n/**\n * Is given layer a label layer.\n * \n * This is useful for inserting new vector layer before labels in MapLibre.\n * @param {object} l The layer to check\n * @returns {boolean} True if it's a label layer\n * @private\n */\nexport function isLabelLayer(l) {\n\treturn l.type === \"symbol\"\n\t\t&& l?.layout?.[\"text-field\"] !== undefined\n\t\t&& (l.minzoom === undefined || l.minzoom < 15);\n}\n\n/**\n * Create all-in-one map style for MapLibre GL JS\n * \n * @param {CoreView} parent The parent view\n * @param {object} options Options from Map component\n * @param {object} [options.raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).\n * @param {string} [options.background] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to street.\n * @param {object} [options.supplementaryStyle] Additional style properties (completing CoreView style and STAC API style)\n * @returns {object} The full MapLibre style\n * @private\n */\nexport function combineStyles(parent, options) {\n\t// Get basic vector styles\n\tconst style = parent.api.getMapStyle();\n\t\n\t// Complete styles\n\tstyle.layers = style.layers || [];\n\tstyle.layers = style.layers.concat(getMissingLayerStyles(style.sources, style.layers));\n\tif(!style.metadata) { style.metadata = {}; }\n\n\t// Complementary style\n\tif(options.supplementaryStyle) {\n\t\tObject.assign(style.sources, options.supplementaryStyle.sources || {});\n\t\tObject.assign(style.metadata, options.supplementaryStyle.metadata || {});\n\t\tstyle.layers = style.layers.concat(options.supplementaryStyle.layers || []);\n\t}\n\n\t// Fix for empty layers causing sorting issues\n\tstyle.layers = style.layers.filter(l => l.id);\n\n\t// Aerial imagery background\n\tif(options.raster) {\n\t\tstyle.sources[\"pnx-aerial\"] = options.raster;\n\t\tstyle.layers.push({\n\t\t\t\"id\": RASTER_LAYER_ID,\n\t\t\t\"type\": \"raster\",\n\t\t\t\"source\": \"pnx-aerial\",\n\t\t\t\"layout\": {\n\t\t\t\t\"visibility\": options.background === \"aerial\" ? \"visible\" : \"none\",\n\t\t\t}\n\t\t});\n\t}\n\n\t// Filter out general tiles if necessary\n\tif(!parent?.users?.includes(\"geovisio\")) {\n\t\tstyle.layers.forEach(l => {\n\t\t\tif(l.source === \"geovisio\") {\n\t\t\t\tif(!l.layout) { l.layout = {}; }\n\t\t\t\tl.layout.visibility = \"none\";\n\t\t\t}\n\t\t});\n\t}\n\n\t// Order layers (base, geovisio, labels)\n\tstyle.layers.sort((a,b) => {\n\t\tif(isLabelLayer(a) && !isLabelLayer(b)) { return 1; }\n\t\telse if(!isLabelLayer(a) && isLabelLayer(b)) { return -1; }\n\t\telse {\n\t\t\tif(a.id.startsWith(\"geovisio\") && !b.id.startsWith(\"geovisio\")) { return 1; }\n\t\t\telse if(!a.id.startsWith(\"geovisio\") && b.id.startsWith(\"geovisio\")) { return -1; }\n\t\t\telse {\n\t\t\t\tif(a.id.endsWith(\"_pictures\") && !b.id.endsWith(\"_pictures\")) { return 1; }\n\t\t\t\tif(!a.id.endsWith(\"_pictures\") && b.id.endsWith(\"_pictures\")) { return -1; }\n\t\t\t\telse { return 0; }\n\t\t\t}\n\t\t}\n\t});\n\n\t// TODO : remove override once available in default Panoramax style\n\tif(!style.metadata?.[\"panoramax:locales\"]) {\n\t\tstyle.metadata[\"panoramax:locales\"] = [\"fr\", \"en\", \"de\", \"es\", \"ru\", \"pt\", \"zh\", \"hi\", \"latin\"];\n\t}\n\n\t// Override labels to use appropriate language\n\tif(style.metadata[\"panoramax:locales\"]) {\n\t\tlet prefLang = parent.lang || autoDetectLocale(style.metadata[\"panoramax:locales\"], \"latin\");\n\t\tif(prefLang.includes(\"-\")) { prefLang = prefLang.split(\"-\")[0]; }\n\t\tif(prefLang.includes(\"_\")) { prefLang = prefLang.split(\"_\")[0]; }\n\t\tstyle.layers.forEach(l => {\n\t\t\tif(isLabelLayer(l) && l.layout[\"text-field\"].includes(\"name:latin\")) {\n\t\t\t\tl.layout[\"text-field\"] = [\n\t\t\t\t\t\"coalesce\",\n\t\t\t\t\t[\"get\", `name:${prefLang}`],\n\t\t\t\t\t[\"get\", \"name:latin\"],\n\t\t\t\t\t[\"get\", \"name\"]\n\t\t\t\t];\n\t\t\t}\n\t\t});\n\t}\n\n\t// Fix for capital cities\n\tconst citiesLayer = style.layers.find(l => l.id == \"place_label_city\");\n\tlet capitalLayer = style.layers.find(l => l.id == \"place_label_capital\");\n\tif(citiesLayer && !capitalLayer) {\n\t\t// Create capital layer from original city style\n\t\tcitiesLayer.paint = {\n\t\t\t\"text-color\": \"hsl(0, 0%, 0%)\",\n\t\t\t\"text-halo-blur\": 0,\n\t\t\t\"text-halo-color\": \"hsla(0, 0%, 100%, 1)\",\n\t\t\t\"text-halo-width\": 3,\n\t\t};\n\t\tcitiesLayer.layout[\"text-letter-spacing\"] = 0.1;\n\t\tcapitalLayer = JSON.parse(JSON.stringify(citiesLayer));\n\t\tcapitalLayer.id = \"place_label_capital\";\n\t\tcapitalLayer.filter.push([\"<=\", \"capital\", 2]);\n\n\t\t// Edit original city to make it less import\n\t\tcitiesLayer.filter.push([\">\", \"capital\", 2]);\n\t\tstyle.layers.push(capitalLayer);\n\t}\n\n\t// Fix for maxzoom on IGN tiles\n\tif(style?.sources?.plan_ign) {\n\t\tstyle.sources.plan_ign.maxzoom = 18;\n\t}\n\n\treturn style;\n}\n\n/**\n * Identifies missing layers for a complete rendering of GeoVisio vector tiles.\n * This allows retro-compatibility with GeoVisio instances <= 2.5.0\n *   which didn't offer a MapLibre JSON style directly.\n * \n * @param {object} sources Pre-existing MapLibre style sources\n * @param {object[]} layers Pre-existing MapLibre style layers\n * @returns List of layers to add\n * @private\n */\nexport function getMissingLayerStyles(sources = {}, layers = []) {\n\tconst newLayers = [];\n\n\t// GeoVisio API <= 2.5.0 : add sequences + pictures\n\tObject.keys(sources).filter(s => (\n\t\tlayers.find(l => l?.source === s) === undefined\n\t)).forEach(s => {\n\t\tif(s.startsWith(\"geovisio\")) {\n\t\t\t// Basic sequences\n\t\t\tnewLayers.push({\n\t\t\t\t\"id\": `${s}_sequences`,\n\t\t\t\t\"type\": \"line\",\n\t\t\t\t\"source\": s,\n\t\t\t\t\"source-layer\": \"sequences\",\n\t\t\t\t\"layout\": {\n\t\t\t\t\t...VECTOR_STYLES.SEQUENCES.layout\n\t\t\t\t},\n\t\t\t\t\"paint\": {\n\t\t\t\t\t...VECTOR_STYLES.SEQUENCES.paint,\n\t\t\t\t\t\"line-color\": COLORS.BASE,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// Padded sequence (for easier click)\n\t\t\tnewLayers.push({\n\t\t\t\t\"id\": `${s}_sequences_plus`,\n\t\t\t\t\"type\": \"line\",\n\t\t\t\t\"source\": s,\n\t\t\t\t\"source-layer\": \"sequences\",\n\t\t\t\t\"layout\": {\n\t\t\t\t\t...VECTOR_STYLES.SEQUENCES_PLUS.layout\n\t\t\t\t},\n\t\t\t\t\"paint\": {\n\t\t\t\t\t...VECTOR_STYLES.SEQUENCES_PLUS.paint\n\t\t\t\t},\n\t\t\t});\n\n\t\t\t// Pictures\n\t\t\tnewLayers.push({\n\t\t\t\t\"id\": `${s}_pictures`,\n\t\t\t\t\"type\": \"circle\",\n\t\t\t\t\"source\": s,\n\t\t\t\t\"source-layer\": \"pictures\",\n\t\t\t\t\"layout\": {\n\t\t\t\t\t...VECTOR_STYLES.PICTURES.layout\n\t\t\t\t},\n\t\t\t\t\"paint\": {\n\t\t\t\t\t...VECTOR_STYLES.PICTURES.paint,\n\t\t\t\t\t\"circle-color\": COLORS.BASE,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t});\n\n\t// Add sequences_plus for easier click on map\n\tlayers.filter(l => (\n\t\tl?.id?.endsWith(\"_sequences\")\n\t\t&& layers.find(sl => sl?.id === l.id+\"_plus\") === undefined\n\t)).forEach(l => {\n\t\tnewLayers.push({\n\t\t\t\"id\": `${l.id}_plus`,\n\t\t\t\"type\": \"line\",\n\t\t\t\"source\": l.source,\n\t\t\t\"source-layer\": l[\"source-layer\"],\n\t\t\t\"layout\": {\n\t\t\t\t...VECTOR_STYLES.SEQUENCES_PLUS.layout\n\t\t\t},\n\t\t\t\"paint\": {\n\t\t\t\t...VECTOR_STYLES.SEQUENCES_PLUS.paint\n\t\t\t},\n\t\t});\n\t});\n\n\t// Add pictures symbol for high-level zooms\n\tlayers.filter(l => (\n\t\tl?.id?.endsWith(\"_pictures\")\n\t\t&& layers.find(sl => sl?.id === l.id+\"_symbols\") === undefined\n\t)).forEach(l => {\n\t\t// Patch style of pictures layer\n\t\tl.paint = Object.assign(l.paint || {}, VECTOR_STYLES.PICTURES.paint);\n\t\tl.layout = Object.assign(l.layout || {}, VECTOR_STYLES.PICTURES.layout);\n\t});\n\n\treturn newLayers;\n}\n\n/**\n * Get comprehensive values from map filters form\n * @param {Element} mapFiltersMenu The MapFilters DOM Element\n * @param {Element} mapThemeSelect The Map Theme select DOM Element\n * @param {boolean} hasQualityScore Set to true if vector tiles embed quality score data\n * @return {object} The map filters as JSON\n */\nexport function mapFiltersFormValues(mapFiltersMenu, mapThemeSelect, hasQualityScore) {\n\tconst fMinDate = mapFiltersMenu?.shadowRoot.getElementById(\"pnx-filter-date-from\");\n\tconst fMaxDate = mapFiltersMenu?.shadowRoot.getElementById(\"pnx-filter-date-end\");\n\tconst fTypes = mapFiltersMenu?.shadowRoot.querySelectorAll(\"input[name='pnx-filter-type']\");\n\n\tlet type = \"\";\n\tfor(let fTypeId = 0 ; fTypeId < fTypes.length; fTypeId++) {\n\t\tconst fType = fTypes[fTypeId];\n\t\tif(fType.checked) {\n\t\t\ttype = fType.value;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tlet qualityscore = [];\n\tlet gps = [];\n\tif(hasQualityScore) {\n\t\t// Quality score itself\n\t\tconst fScore = mapFiltersMenu?.shadowRoot.getElementById(\"pnx-filter-qualityscore\");\n\t\tqualityscore = (fScore?.grade || \"\").split(\",\").map(v => parseInt(v)).filter(v => !isNaN(v));\n\n\t\t// GPS precision\n\t\tconst fGPS = mapFiltersMenu?.shadowRoot.getElementById(\"pnx-filter-gps\");\n\t\tgps = (fGPS?.grade || \"\").split(\",\").map(v => parseInt(v)).filter(v => !isNaN(v));\n\t}\n\n\treturn {\n\t\tminDate: fMinDate?.value,\n\t\tmaxDate: fMaxDate?.value,\n\t\tpic_type: type,\n\t\ttheme: mapThemeSelect?.value,\n\t\tqualityscore,\n\t\tgps,\n\t};\n}\n\n/**\n * Transforms map filters into MapLibre-like JSON filters\n * @param {object} filters Filters returned by MapFilters widgets\n * @param {boolean} [hasGridStats=false] Set to true if vector tiles offer grid statistics\n * @param {object} [featuresRestrictions] Rules to restrict display of pictures & sequences\n * @returns {object} Set of variables { mapFilters, mapSeqFilters, mapPicFilters, reloadMapStyle }\n */\nexport function mapFiltersToLayersFilters(filters, hasGridStats = false, featuresRestrictions = null) {\n\tlet mapFilters = {};\n\tlet mapSeqFilters = [];\n\tlet mapPicFilters = [];\n\tlet reloadMapStyle = false;\n\n\tif(filters.minDate && filters.minDate !== \"\") {\n\t\tmapFilters.minDate = filters.minDate;\n\t\tmapSeqFilters.push([\">=\", [\"get\", \"date\"], filters.minDate]);\n\t\tmapPicFilters.push([\">=\", [\"get\", \"ts\"], filters.minDate]);\n\t}\n\n\tif(filters.maxDate && filters.maxDate !== \"\") {\n\t\tmapFilters.maxDate = filters.maxDate;\n\t\tmapSeqFilters.push([\"<=\", [\"get\", \"date\"], filters.maxDate]);\n\n\t\t// Get tomorrow date for pictures filtering\n\t\t// (because ts is date+time, so comparing date only string would fail otherwise)\n\t\tlet d = new Date(filters.maxDate);\n\t\td.setDate(d.getDate() + 1);\n\t\td = d.toISOString().split(\"T\")[0];\n\t\tmapPicFilters.push([\"<=\", [\"get\", \"ts\"], d]);\n\t}\n\n\tif(filters.pic_type && filters.pic_type !== \"\") {\n\t\tmapFilters.pic_type = filters.pic_type === \"flat\" ? \"flat\" : \"equirectangular\";\n\t\tmapSeqFilters.push([\"==\", [\"get\", \"type\"], mapFilters.pic_type]);\n\t\tmapPicFilters.push([\"==\", [\"get\", \"type\"], mapFilters.pic_type]);\n\t}\n\n\tif(hasGridStats) {\n\t\treloadMapStyle = true;\n\t}\n\n\tif(filters.camera && filters.camera !== \"\") {\n\t\tmapFilters.camera = filters.camera;\n\t\t// low/high model hack : to enable fuzzy filtering of camera make and model\n\t\tconst lowModel = filters.camera.toLowerCase().trim() + \"                    \";\n\t\tconst highModel = filters.camera.toLowerCase().trim() + \"zzzzzzzzzzzzzzzzzzzz\";\n\t\tconst collator = [\"collator\", { \"case-sensitive\": false, \"diacritic-sensitive\": false } ];\n\t\tmapSeqFilters.push([\">=\", [\"get\", \"model\"], lowModel, collator]);\n\t\tmapSeqFilters.push([\"<=\", [\"get\", \"model\"], highModel, collator]);\n\t\tmapPicFilters.push([\">=\", [\"get\", \"model\"], lowModel, collator]);\n\t\tmapPicFilters.push([\"<=\", [\"get\", \"model\"], highModel, collator]);\n\t}\n\n\tif(filters.qualityscore && filters.qualityscore.length > 0) {\n\t\tmapFilters.qualityscore = filters.qualityscore;\n\t\tmapSeqFilters.push([\"in\", MAP_EXPR_QUALITYSCORE, [\"literal\", mapFilters.qualityscore]]);\n\t\tmapPicFilters.push([\"in\", MAP_EXPR_QUALITYSCORE, [\"literal\", mapFilters.qualityscore]]);\n\t}\n\n\tif(filters.gps && filters.gps.length > 0) {\n\t\tmapFilters.gps = filters.gps;\n\t\tmapSeqFilters.push([\"in\", MAP_EXPR_QUALITYSCORE_GPS, [\"literal\", mapFilters.gps]]);\n\t\tmapPicFilters.push([\"in\", MAP_EXPR_QUALITYSCORE_GPS, [\"literal\", mapFilters.gps]]);\n\t}\n\n\tif(filters.theme && Object.values(MAP_THEMES).includes(filters.theme)) {\n\t\tmapFilters.theme = filters.theme;\n\t\treloadMapStyle = true;\n\t}\n\n\tif(featuresRestrictions?.pictures && featuresRestrictions.pictures.features?.length >= 0) {\n\t\tif(featuresRestrictions.pictures.rule === \"keep\") {\n\t\t\tmapPicFilters.push([\"in\", [\"get\", \"id\"], [\"literal\", featuresRestrictions.pictures.features]]);\n\t\t}\n\t\telse if(featuresRestrictions.pictures.features.length > 0) {\n\t\t\tmapPicFilters.push([\"!\", [\"in\", [\"get\", \"id\"], [\"literal\", featuresRestrictions.pictures.features]]]);\n\t\t}\n\t}\n\n\tif(featuresRestrictions?.sequences && featuresRestrictions.sequences.features?.length >= 0) {\n\t\tif(featuresRestrictions.sequences.rule === \"keep\") {\n\t\t\tmapSeqFilters.push([\"in\", [\"get\", \"id\"], [\"literal\", featuresRestrictions.sequences.features]]);\n\t\t}\n\t\telse if(featuresRestrictions.sequences.features.length > 0) {\n\t\t\tmapSeqFilters.push([\"!\", [\"in\", [\"get\", \"id\"], [\"literal\", featuresRestrictions.sequences.features]]]);\n\t\t}\n\t}\n\n\n\tif(mapSeqFilters.length == 0) { mapSeqFilters = null; }\n\telse {\n\t\tmapSeqFilters.unshift(\"all\");\n\t}\n\n\tif(mapPicFilters.length == 0) { mapPicFilters = null; }\n\telse {\n\t\tmapPicFilters.unshift(\"all\");\n\t\tmapPicFilters = [\"step\", [\"zoom\"],\n\t\t\ttrue,\n\t\t\tTILES_PICTURES_ZOOM, mapPicFilters\n\t\t];\n\t}\n\n\treturn { mapFilters, mapSeqFilters, mapPicFilters, reloadMapStyle };\n}\n\n/**\n * Get cleaned-up layer ID for a specific user.\n * @param {string} userId The user UUID (or \"geovisio\" for general layer)\n * @param {string} layerType The kind of layer (pictures, sequences...)\n * @returns {string} The cleaned-up layer ID for MapLibre\n * @private\n */\nexport function getUserLayerId(userId, layerType) {\n\treturn `${getUserSourceId(userId)}_${layerType}`;\n}\n\n/**\n * Get cleaned-up source ID for a specific user.\n * @param {string} userId The user UUID (or \"geovisio\" for general layer)\n * @returns {string} The cleaned-up source ID for MapLibre\n * @private\n */\nexport function getUserSourceId(userId) {\n\treturn userId === \"geovisio\" ? \"geovisio\" : \"geovisio_\"+userId;\n}\n\n/**\n * Switches used coef value in MapLibre style JSON expression\n * @param {*} expr The MapLibre style expression\n * @param {string} newCoefVal The new coef value to use\n * @returns {*} The switched expression\n * @private\n */\nexport function switchCoefValue(expr, newCoefVal) {\n\tif(Array.isArray(expr)) {\n\t\treturn expr.map(v => switchCoefValue(v, newCoefVal));\n\t}\n\telse if(typeof expr === \"object\" && expr !== null) {\n\t\tconst newExpr = {};\n\t\tfor (const key in expr) {\n\t\t\tnewExpr[key] = switchCoefValue(expr[key], newCoefVal);\n\t\t}\n\t\treturn newExpr;\n\t}\n\telse if(typeof expr === \"string\" && (expr.startsWith(\"coef\") || expr.startsWith(\"logged_coef\"))) {\n\t\treturn newCoefVal;\n\t}\n\treturn expr;\n}\n\n/**\n * Creates links between map and photo elements.\n * This enable interactions like click on map showing picture.\n * \n * @param {CoreView} parent The view containing both Photo and Map elements\n * @private\n */\nexport function linkMapAndPhoto(parent) {\n\t// Switched picture\n\tconst onPicLoad = e => {\n\t\tif(isNullId(e.detail.picId)) {\n\t\t\tparent.map.displayPictureMarker();\n\t\t\tif(parent?.isMapWide?.()) {\n\t\t\t\tparent?.mini?.setAttribute(\"collapsed\", \"\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tparent.map.displayPictureMarker(\n\t\t\t\te.detail.lon,\n\t\t\t\te.detail.lat,\n\t\t\t\tparent.psv.getXY().x,\n\t\t\t\te.detail.first && !isNullCoordinates(parent._initParams?.getMapPostInit()?.center), // Skip centering if precise coordinates are set from URL\n\t\t\t\te.detail.picId\n\t\t\t);\n\n\t\t\tif(parent?.isMapWide?.()) {\n\t\t\t\tparent?.mini?.removeAttribute(\"collapsed\");\n\t\t\t}\n\t\t}\n\t};\n\tparent.psv.addEventListener(\"picture-loading\", onPicLoad);\n\tparent.psv.addEventListener(\"picture-loaded\", onPicLoad);\n\n\t// Picture view rotated\n\tparent.psv.addEventListener(\"view-rotated\", () => {\n\t\tlet x = parent.psv.getPosition().yaw * (180 / Math.PI);\n\t\tx += parent.psv.getPictureOriginalHeading();\n\t\tparent.map._picMarker.setRotation(x);\n\t});\n\n\t// Picture preview\n\tparent.psv.addEventListener(\"picture-preview-started\", e => {\n\t\t// Show marker corresponding to selection\n\t\tparent.map._picMarkerPreview\n\t\t\t.setLngLat(e.detail.coordinates)\n\t\t\t.setRotation(e.detail.direction || 0)\n\t\t\t.addTo(parent.map);\n\t});\n\n\tparent.psv.addEventListener(\"picture-preview-stopped\", () => {\n\t\tparent.map._picMarkerPreview.remove();\n\t});\n\n\tparent.psv.addEventListener(\"picture-loaded\", e => {\n\t\tif (parent.isWidthSmall() && parent._picPopup && e.detail.picId == parent._picPopup._picId) {\n\t\t\tparent._picPopup.remove();\n\t\t}\n\t});\n\n\t// Picture click\n\tparent.map.on(\"picture-click\", e => {\n\t\tparent.select(e.seqId, e.picId);\n\t\tif(!parent.psv._myVTour.state.currentNode && parent?._setFocus) { parent._setFocus(\"pic\"); }\n\t});\n\n\t// Sequence click\n\tparent.map.on(\"sequence-click\", e => {\n\t\tparent.api.getPicturesAroundCoordinates(\n\t\t\te.coordinates.lat,\n\t\t\te.coordinates.lng,\n\t\t\t0.01,\n\t\t\t1,\n\t\t\te.seqId\n\t\t).then(results => {\n\t\t\tif(results?.features?.length > 0) {\n\t\t\t\tparent.select(results.features[0]?.collection, results.features[0].id);\n\t\t\t\tif(!parent.psv.getPictureMetadata() && parent?._setFocus) { parent._setFocus(\"pic\"); }\n\t\t\t}\n\t\t});\n\t});\n\n\t// Focus changes\n\tif(parent._setFocus) {\n\t\t// PSV double click\n\t\tparent.psv.addEventListener(\"dblclick\", () => { if(parent.isMapWide()) { parent._setFocus(\"pic\"); } });\n\n\t\t// Map double-click: unselect if focused, toggle focus if unfocused\n\t\tparent.map.on(\"dblclick\", () => {\n\t\t\tif(!parent.isMapWide()) { parent._setFocus(\"map\"); }\n\t\t\telse if(parent.psv.getPicturesNavigation() === \"any\") { parent.select(); }\n\t\t});\n\t}\n}\n\n/**\n * Adds events related to keyboard\n * @private\n */\nexport function initMapKeyboardHandler(parent) {\n\tparent.map.keyboard.keydown = function(e) {\n\t\tif (e.altKey || e.ctrlKey || e.metaKey) return;\n\n\t\t// Custom keys\n\t\tswitch(e.key) {\n\t\tcase \"*\":\n\t\tcase \"5\":\n\t\t\tparent.moveCenter();\n\t\t\treturn;\n\n\t\tcase \"PageUp\":\n\t\tcase \"9\":\n\t\t\tparent.psv.goToNextPicture();\n\t\t\treturn;\n\t\t\n\t\tcase \"PageDown\":\n\t\tcase \"3\":\n\t\t\tparent.psv.goToPrevPicture();\n\t\t\treturn;\n\t\t\n\t\tcase \"Home\":\n\t\tcase \"7\":\n\t\t\te.stopPropagation();\n\t\t\tparent._toggleFocus();\n\t\t\treturn;\n\t\t\n\t\tcase \"End\":\n\t\tcase \"1\":\n\t\t\tparent.mini.toggleAttribute(\"collapsed\");\n\t\t\treturn;\n\t\t\n\t\tcase \" \":\n\t\tcase \"0\":\n\t\t\tparent.psv.toggleSequencePlaying();\n\t\t\treturn;\n\t\t}\n\n\t\tlet zoomDir = 0;\n\t\tlet bearingDir = 0;\n\t\tlet pitchDir = 0;\n\t\tlet xDir = 0;\n\t\tlet yDir = 0;\n\n\t\tswitch (e.keyCode) {\n\t\tcase 61:\n\t\tcase 107:\n\t\tcase 171:\n\t\tcase 187:\n\t\t\tzoomDir = 1;\n\t\t\tbreak;\n\n\t\tcase 189:\n\t\tcase 109:\n\t\tcase 173:\n\t\t\tzoomDir = -1;\n\t\t\tbreak;\n\n\t\tcase 37:\n\t\tcase 100:\n\t\t\tif (e.shiftKey) {\n\t\t\t\tbearingDir = -1;\n\t\t\t} else {\n\t\t\t\te.preventDefault();\n\t\t\t\txDir = -1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 39:\n\t\tcase 102:\n\t\t\tif (e.shiftKey) {\n\t\t\t\tbearingDir = 1;\n\t\t\t} else {\n\t\t\t\te.preventDefault();\n\t\t\t\txDir = 1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 38:\n\t\tcase 104:\n\t\t\tif (e.shiftKey) {\n\t\t\t\tpitchDir = 1;\n\t\t\t} else {\n\t\t\t\te.preventDefault();\n\t\t\t\tyDir = -1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 40:\n\t\tcase 98:\n\t\t\tif (e.shiftKey) {\n\t\t\t\tpitchDir = -1;\n\t\t\t} else {\n\t\t\t\te.preventDefault();\n\t\t\t\tyDir = 1;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._rotationDisabled) {\n\t\t\tbearingDir = 0;\n\t\t\tpitchDir = 0;\n\t\t}\n\n\t\treturn {\n\t\t\tcameraAnimation: (map) => {\n\t\t\t\tconst tr = this._tr;\n\t\t\t\tmap.easeTo({\n\t\t\t\t\tduration: 300,\n\t\t\t\t\teaseId: \"keyboardHandler\",\n\t\t\t\t\teasing: t => t * (2-t),\n\t\t\t\t\tzoom: zoomDir ? Math.round(tr.zoom) + zoomDir * (e.shiftKey ? 2 : 1) : tr.zoom,\n\t\t\t\t\tbearing: tr.bearing + bearingDir * this._bearingStep,\n\t\t\t\t\tpitch: tr.pitch + pitchDir * this._pitchStep,\n\t\t\t\t\toffset: [-xDir * this._panStep, -yDir * this._panStep],\n\t\t\t\t\tcenter: tr.center\n\t\t\t\t}, {originalEvent: e});\n\t\t\t}\n\t\t};\n\t}.bind(parent.map.keyboard);\n}\n\nconst MAP_PARAMS_STORAGE = \"pnx-map-parameters\";\n\n/**\n * Reads map parameters from localStorage\n * @private\n */\nexport function getMapParamsFromLocalStorage() {\n\tconst params = localStorage.getItem(MAP_PARAMS_STORAGE);\n\tif(!params) { return {}; }\n\ttry {\n\t\treturn JSON.parse(params);\n\t}\n\tcatch(e) {\n\t\tconsole.warn(\"Can't read map parameters stored in localStorage\", e);\n\t\treturn {};\n\t}\n}\n\n/**\n * Save map parameters into localStorage.\n * @private\n */\nexport function saveMapParamsToLocalStorage(map) {\n\t// Save map state in localStorage\n\tconst save = () => localStorage.setItem(MAP_PARAMS_STORAGE, JSON.stringify({\n\t\tcenter: Object.fromEntries(Object.entries(map.getCenter()).map(([k,v]) => ([k,v.toFixed(7)]))),\n\t\tzoom: map.getZoom().toFixed(1),\n\t\tbackground: map.getBackground(),\n\t\ttheme: map._mapFilters.theme\n\t}));\n\n\t// Add events to know when to rewrite info\n\tmap.on(\"background-changed\", save);\n\tmap.on(\"filters-changed\", save);\n\tmap.on(\"moveend\", save);\n\tmap.on(\"zoomend\", save);\n\tmap.on(\"dragend\", save);\n\tmap.on(\"boxzoomend\", save);\n}\n","import ArrowTriangleSVG from \"../img/arrow_triangle.svg\";\nimport ArrowTurnSVG from \"../img/arrow_turn.svg\";\nimport { svgToPSVLink, COLORS, getDistance, getSimplifiedAngle, getArrow } from \"./utils\";\n\nconst ArrowTriangle = svgToPSVLink(ArrowTriangleSVG, \"white\");\nconst ArrowTurn = svgToPSVLink(ArrowTurnSVG, COLORS.NEXT);\n\n/**\n * Read float value from EXIF tags (to handle fractions & all)\n * @param {*} val The input EXIF tag value\n * @returns {number|undefined} The parsed value, or undefined if value is not readable\n * @private\n */\nexport function getExifFloat(val) {\n\t// Null-like values\n\tif(\n\t\t[null, undefined, \"\"].includes(val)\n\t\t|| typeof val === \"string\" && val.trim() === \"\"\n\t) {\n\t\treturn undefined;\n\t}\n\t// Already valid number\n\telse if(typeof val === \"number\") {\n\t\treturn val;\n\t}\n\t// String\n\telse if(typeof val === \"string\") {\n\t\t// Check if looks like a fraction\n\t\tif(/^-?\\d+(\\.\\d+)?\\/-?\\d+(\\.\\d+)?$/.test(val)) {\n\t\t\tconst parts = val.split(\"/\").map(p => parseFloat(p));\n\t\t\treturn parts[0] / parts[1];\n\t\t}\n\n\t\t// Try a direct cast to float\n\t\ttry { return parseFloat(val); }\n\t\tcatch(e) {} // eslint-disable-line no-empty\n\n\t\t// Unrecognized\n\t\treturn undefined;\n\t}\n\telse { return undefined; }\n}\n\n/**\n * Find in picture metadata the GPS precision.\n * @param {object} picture The GeoJSON picture feature\n * @returns {string} The precision value (poor, fair, moderate, good, excellent, ideal, unknown)\n * @private\n */\nexport function getGPSPrecision(picture) {\n\tlet quality = null;\n\tconst gpsHPosError = picture?.properties?.[\"quality:horizontal_accuracy\"] || getExifFloat(picture?.properties?.exif?.[\"Exif.GPSInfo.GPSHPositioningError\"]);\n\tconst gpsDop = getExifFloat(picture?.properties?.exif?.[\"Exif.GPSInfo.GPSDOP\"]);\n\t\n\tif(gpsHPosError !== undefined) {\n\t\tquality = `${gpsHPosError} m`;\n\t}\n\telse if(gpsDop !== undefined) {\n\t\tif(gpsDop < 1) { quality = \"ideal\"; }\n\t\telse if(gpsDop < 2) { quality = \"excellent\"; }\n\t\telse if(gpsDop < 5) { quality = \"good\"; }\n\t\telse if(gpsDop < 10) { quality = \"moderate\"; }\n\t\telse if(gpsDop < 20) { quality = \"fair\"; }\n\t\telse { quality = \"poor\"; }\n\t}\n\n\treturn quality;\n}\n\n/**\n * Compute PSV sphere correction based on picture metadata & EXIF tags.\n * @param {object} picture The GeoJSON picture feature\n * @returns {object} The PSV sphereCorrection value\n * @private\n */\nexport function getSphereCorrection(picture) {\n\t// Photo direction\n\tlet dir = picture.properties?.[\"view:azimuth\"];\n\tif(dir === undefined) {\n\t\tconst v = getExifFloat(picture.properties?.exif?.[\"Exif.GPSInfo.GPSImgDirection\"]);\n\t\tif(v !== undefined) {\n\t\t\tdir = v;\n\t\t}\n\t}\n\tdir = dir || 0;\n\n\t// Yaw\n\tlet yaw = picture.properties?.[\"pers:yaw\"];\n\tlet exifFallbacks = [\"Xmp.GPano.PoseHeadingDegrees\", \"Xmp.Camera.Yaw\", \"Exif.MpfInfo.MPFYawAngle\"];\n\tif(yaw === undefined) {\n\t\tfor(let exif of exifFallbacks) {\n\t\t\tconst v = getExifFloat(picture.properties?.exif?.[exif]);\n\t\t\tif(v !== undefined) {\n\t\t\t\tyaw = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tyaw = yaw || 0;\n\n\t// Check if yaw is applicable: different from photo direction\n\tif(Math.round(dir) === Math.round(yaw) && yaw > 0) {\n\t\tconsole.warn(\"Picture with UUID\", picture.id, \"has same GPS Image direction and Yaw, could cause rendering issues\");\n\t\t// yaw = 0;\n\t}\n\n\t// Pitch\n\tlet pitch = picture.properties?.[\"pers:pitch\"];\n\texifFallbacks = [\"Xmp.GPano.PosePitchDegrees\", \"Xmp.Camera.Pitch\", \"Exif.MpfInfo.MPFPitchAngle\"];\n\tif(pitch === undefined) {\n\t\tfor(let exif of exifFallbacks) {\n\t\t\tconst v = getExifFloat(picture.properties?.exif?.[exif]);\n\t\t\tif(v !== undefined) {\n\t\t\t\tpitch = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpitch = pitch || 0;\n\n\t// Roll\n\tlet roll = picture.properties?.[\"pers:roll\"];\n\texifFallbacks = [\"Xmp.GPano.PoseRollDegrees\", \"Xmp.Camera.Roll\", \"Exif.MpfInfo.MPFRollAngle\"];\n\tif(roll === undefined) {\n\t\tfor(let exif of exifFallbacks) {\n\t\t\tconst v = getExifFloat(picture.properties?.exif?.[exif]);\n\t\t\tif(v !== undefined) {\n\t\t\t\troll = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\troll = roll || 0;\n\n\t// Send result\n\treturn pitch !== 0 && roll !== 0 ? {\n\t\tpan:  yaw * Math.PI / 180,\n\t\ttilt: -pitch * Math.PI / 180,\n\t\troll: roll * Math.PI / 180,\n\t} : {};\n}\n\n/**\n * Compute PSV panoData for cropped panorama based on picture metadata & EXIF tags.\n * @param {object} picture The GeoJSON picture feature\n * @param {object} [img] The loaded image file, with width, height properties for possible resizing\n * @returns {object} The PSV panoData values\n * @private\n */\nexport function getCroppedPanoData(picture, img) {\n\tlet res;\n\n\tif(picture.properties?.[\"pers:interior_orientation\"]) {\n\t\tif(\n\t\t\tpicture.properties[\"pers:interior_orientation\"]?.[\"visible_area\"]\n\t\t\t&& picture.properties[\"pers:interior_orientation\"]?.[\"sensor_array_dimensions\"]\n\t\t) {\n\t\t\tconst va = picture.properties[\"pers:interior_orientation\"][\"visible_area\"];\n\t\t\tconst sad = picture.properties[\"pers:interior_orientation\"][\"sensor_array_dimensions\"];\n\t\t\ttry {\n\t\t\t\tres = {\n\t\t\t\t\tfullWidth: parseInt(sad[0]),\n\t\t\t\t\tfullHeight: parseInt(sad[1]),\n\t\t\t\t\tcroppedX: parseInt(va[0]),\n\t\t\t\t\tcroppedY: parseInt(va[1]),\n\t\t\t\t\tcroppedWidth: parseInt(sad[0]) - parseInt(va[2]) - parseInt(va[0]),\n\t\t\t\t\tcroppedHeight: parseInt(sad[1]) - parseInt(va[3]) - parseInt(va[1]),\n\t\t\t\t};\n\t\t\t}\n\t\t\tcatch(e) {\n\t\t\t\tconsole.warn(\"Invalid pers:interior_orientation values for cropped panorama \"+picture.id);\n\t\t\t}\n\t\t}\n\t}\n\n\tif(!res && picture.properties?.exif) {\n\t\ttry {\n\t\t\tres = {\n\t\t\t\tfullWidth: parseInt(picture.properties.exif?.[\"Xmp.GPano.FullPanoWidthPixels\"]),\n\t\t\t\tfullHeight: parseInt(picture.properties.exif?.[\"Xmp.GPano.FullPanoHeightPixels\"]),\n\t\t\t\tcroppedX: parseInt(picture.properties.exif?.[\"Xmp.GPano.CroppedAreaLeftPixels\"]),\n\t\t\t\tcroppedY: parseInt(picture.properties.exif?.[\"Xmp.GPano.CroppedAreaTopPixels\"]),\n\t\t\t\tcroppedWidth: parseInt(picture.properties.exif?.[\"Xmp.GPano.CroppedAreaImageWidthPixels\"]),\n\t\t\t\tcroppedHeight: parseInt(picture.properties.exif?.[\"Xmp.GPano.CroppedAreaImageHeightPixels\"]),\n\t\t\t};\n\n\t\t\t// Fix images with cropped size higher than full size\n\t\t\tif(res.croppedWidth > res.fullWidth) { res.fullWidth = res.croppedWidth; }\n\t\t\tif(res.croppedHeight > res.fullHeight) { res.fullHeight = res.croppedHeight; }\n\t\t}\n\t\tcatch(e) {\n\t\t\tconsole.warn(\"Invalid XMP.GPano values for cropped panorama \"+picture.id);\n\t\t}\n\t}\n\n\t// Check if crop is really necessary\n\tif(res) {\n\t\tres = Object.fromEntries(Object.entries(res || {}).filter(e => !isNaN(e[1])));\n\t\tif(\n\t\t\t(!res.fullWidth && !res.croppedWidth && res.fullHeight && !res.croppedHeight)\n\t\t\t|| (res.fullWidth && !res.croppedWidth && !res.fullHeight && !res.croppedHeight)\n\t\t\t|| (res.fullWidth && !res.croppedWidth && res.fullHeight && !res.croppedHeight)\n\t\t\t|| (res.fullWidth == res.croppedWidth && res.fullHeight == res.croppedHeight)\n\t\t) {\n\t\t\tres = {};\n\t\t}\n\t}\n\n\t// Resize if image given\n\tif(res?.fullWidth && img?.width) {\n\t\tlet ratio = img.width / (res?.croppedWidth || res.fullWidth);\n\t\tres = {\n\t\t\tfullWidth: res.fullWidth !== undefined ? Math.floor(res.fullWidth * ratio) : undefined,\n\t\t\tfullHeight: res.fullHeight !== undefined ? Math.floor(res.fullHeight * ratio) : undefined,\n\t\t\tcroppedWidth: res.croppedWidth !== undefined ? Math.floor(res.croppedWidth * ratio) : undefined,\n\t\t\tcroppedHeight: res.croppedHeight !== undefined ? Math.floor(res.croppedHeight * ratio) : undefined,\n\t\t\tcroppedX: res.croppedX !== undefined ? Math.floor(res.croppedX * ratio) : undefined,\n\t\t\tcroppedY: res.croppedY !== undefined ? Math.floor(res.croppedY * ratio) : undefined,\n\t\t};\n\t}\n\n\treturn res || {};\n}\n\n/**\n * Compare function to retrieve most appropriate picture in a single direction.\n * \n * @param {number[]} picPos The picture [x,y] position\n * @returns {function} A compare function for sorting\n * @private\n */\nexport function sortPicturesInDirection(picPos) {\n\treturn (a,b) => {\n\t\t// Two prev/next links = no sort\n\t\tif(a.rel != \"related\" && b.rel != \"related\") { return 0; }\n\t\t// First is prev/next link = goes first\n\t\telse if(a.rel != \"related\") { return -1; }\n\t\t// Second is prev/next link = goes first\n\t\telse if(b.rel != \"related\") { return 1; }\n\t\t// Two related links same day = nearest goes first\n\t\telse if(a.date == b.date) { return getDistance(picPos, a.geometry.coordinates) - getDistance(picPos, b.geometry.coordinates); }\n\t\t// Two related links at different day = recent goes first\n\t\telse { return b.date.localeCompare(a.date); }\n\t};\n}\n\n/**\n * Generates the navbar caption based on a single picture metadata\n *\n * @param {object} metadata The picture metadata\n * @param {object} t The labels translations container\n * @returns {object} Normalized object with user name, licence and date\n * @private\n */\nexport function getNodeCaption(metadata, t) {\n\tconst caption = {};\n\n\t// Timestamp\n\tif(metadata?.properties?.datetimetz) {\n\t\tcaption.date = new Date(metadata.properties.datetimetz);\n\t\tconst timeZoneMatch = metadata.properties.datetimetz.match(/([+-]\\d{2}):(\\d{2})$|Z$/);\n\t\tif (timeZoneMatch) {\n\t\t\tif (timeZoneMatch[0] === \"Z\") {\n\t\t\t\tcaption.tz = \"UTC\";\n\t\t\t} else {\n\t\t\t\tcaption.tz = timeZoneMatch[0];\n\t\t\t}\n\t\t}\n\t}\n\telse if(metadata?.properties?.datetime) {\n\t\tcaption.date = new Date(metadata.properties.datetime);\n\t}\n\n\t// Producer\n\tif(metadata?.providers) {\n\t\tconst producerRoles = metadata?.providers?.filter(el => el?.roles?.includes(\"producer\"));\n\t\tif(producerRoles?.length >= 0) {\n\t\t\t// Avoid duplicates between account name and picture author\n\t\t\tconst producersDeduped = {};\n\t\t\tproducerRoles.map(p => p.name).forEach(p => {\n\t\t\t\tconst pmin = p.toLowerCase().replace(/\\s/g, \"\");\n\t\t\t\tif(producersDeduped[pmin]) { producersDeduped[pmin].push(p); }\n\t\t\t\telse { producersDeduped[pmin] = [p];}\n\t\t\t});\n\n\t\t\t// Keep best looking name for each\n\t\t\tcaption.producer = [];\n\t\t\tObject.values(producersDeduped).forEach(pv => {\n\t\t\t\tconst deflt = pv[0];\n\t\t\t\tconst better = pv.find(v => v.toLowerCase() != v);\n\t\t\t\tcaption.producer.push(better || deflt);\n\t\t\t});\n\t\t}\n\t}\n\n\t// License\n\tif(metadata?.properties?.license) {\n\t\tcaption.license = metadata.properties.license;\n\t\t// Look for URL to license\n\t\tif(metadata?.links) {\n\t\t\tconst licenseLink = metadata.links.find(l => l?.rel === \"license\");\n\t\t\tif(licenseLink) {\n\t\t\t\tcaption.license = `<a href=\"${licenseLink.href}\" title=\"${t.pnx.metadata_general_license_link}\" target=\"_blank\">${caption.license}</a>`;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn caption;\n}\n\n/**\n * Transforms a GeoJSON feature from the STAC API into a PSV node.\n * \n * @param {object} f The API GeoJSON feature\n * @param {object} t The labels translations container\n * @param {boolean} [fastInternet] True if Internet speed is high enough for loading HD flat pictures\n * @param {function} [customLinkFilter] A function checking if a STAC link is acceptable to use for picture navigation\n * @param {function} [urlCleaner] A function that each URL goes through for cleaning (allows use of relative URLs)\n * @return {object} A PSV node\n * @private\n */\nexport function apiFeatureToPSVNode(f, t, fastInternet=false, customLinkFilter=null, urlCleaner=(u => u)) {\n\tconst isHorizontalFovDefined = f.properties?.[\"pers:interior_orientation\"]?.[\"field_of_view\"] != null;\n\tlet horizontalFov = isHorizontalFovDefined ? parseInt(f.properties[\"pers:interior_orientation\"][\"field_of_view\"]) : 70;\n\tconst is360 = horizontalFov === 360;\n\n\tconst hdUrl = urlCleaner((Object.values(f.assets).find(a => a?.roles?.includes(\"data\")) || {}).href);\n\tconst matrix = f?.properties?.[\"tiles:tile_matrix_sets\"]?.geovisio;\n\tconst prev = f.links?.find?.(l => l?.rel === \"prev\" && l?.type === \"application/geo+json\");\n\tconst next = f.links?.find?.(l => l?.rel === \"next\" && l?.type === \"application/geo+json\");\n\tconst baseUrlWebp = Object.values(f.assets).find(a => a.roles?.includes(\"visual\") && a.type === \"image/webp\");\n\tconst baseUrlJpeg = Object.values(f.assets).find(a => a.roles?.includes(\"visual\") && a.type === \"image/jpeg\");\n\tconst baseUrl = urlCleaner((baseUrlWebp || baseUrlJpeg).href);\n\tconst thumbUrl = urlCleaner((Object.values(f.assets).find(a => a.roles?.includes(\"thumbnail\") && a.type === \"image/jpeg\"))?.href);\n\tconst tileUrl = f?.asset_templates?.tiles_webp || f?.asset_templates?.tiles;\n\tconst croppedPanoData = getCroppedPanoData(f);\n\tconst origInstance = f.links?.find?.(l => l?.rel === \"via\" && l?.type === \"application/json\");\n\tconst size = f.properties?.[\"pers:interior_orientation\"]?.[\"sensor_array_dimensions\"];\n\n\tlet panorama;\n\n\t// Cropped panorama\n\tif(Object.keys(croppedPanoData).length > 0) {\n\t\tpanorama = {\n\t\t\tbaseUrl: fastInternet ? hdUrl : baseUrl,\n\t\t\torigBaseUrl: fastInternet ? hdUrl : baseUrl,\n\t\t\thdUrl,\n\t\t\tthumbUrl,\n\t\t\tbasePanoData: fastInternet ? croppedPanoData : (img) => getCroppedPanoData(f, img),\n\t\t\tcropData: croppedPanoData,\n\t\t\twidth: croppedPanoData.fullWidth,\n\t\t\t// This is only to mock loading of tiles (which are not available for flat pictures)\n\t\t\tcols: 2, rows: 1, tileUrl: () => null\n\t\t};\n\t}\n\t// 360°\n\telse if(is360 && matrix) {\n\t\tpanorama = {\n\t\t\tbaseUrl,\n\t\t\torigBaseUrl: baseUrl,\n\t\t\tbasePanoData: (img) => ({\n\t\t\t\tfullWidth: img.width,\n\t\t\t\tfullHeight: img.height,\n\t\t\t}),\n\t\t\thdUrl,\n\t\t\tthumbUrl,\n\t\t\tcols: matrix && matrix.tileMatrix[0].matrixWidth,\n\t\t\trows: matrix && matrix.tileMatrix[0].matrixHeight,\n\t\t\twidth: matrix && (matrix.tileMatrix[0].matrixWidth * matrix.tileMatrix[0].tileWidth),\n\t\t\ttileUrl: matrix && ((col, row) => urlCleaner(tileUrl.href.replace(/\\{TileCol\\}/g, col).replace(/\\{TileRow\\}/g, row)))\n\t\t};\n\t}\n\t// Flat pictures: shown only using a cropped base panorama\n\telse {\n\t\tconst getFlatCrop = (img) => {\n\t\t\tif (img.width < img.height && !isHorizontalFovDefined) {\n\t\t\t\thorizontalFov = 35;\n\t\t\t}\n\t\t\tconst verticalFov = horizontalFov * img.height / img.width;\n\t\t\tconst panoWidth = img.width * 360 / horizontalFov;\n\t\t\tconst panoHeight = img.height * 180 / verticalFov;\n\n\t\t\treturn {\n\t\t\t\tfullWidth: Math.floor(panoWidth),\n\t\t\t\tfullHeight: Math.floor(panoHeight),\n\t\t\t\tcroppedWidth: img.width,\n\t\t\t\tcroppedHeight: img.height,\n\t\t\t\tcroppedX: Math.floor((panoWidth - img.width) / 2),\n\t\t\t\tcroppedY: Math.floor((panoHeight - img.height) / 2),\n\t\t\t};\n\t\t};\n\n\t\tlet cropData = size ? getFlatCrop({width: size[0], height: size[1]}) : null;\n\n\t\tpanorama = {\n\t\t\tbaseUrl: fastInternet ? hdUrl : baseUrl,\n\t\t\torigBaseUrl: fastInternet ? hdUrl : baseUrl,\n\t\t\thdUrl,\n\t\t\tthumbUrl,\n\t\t\tbasePanoData: getFlatCrop,\n\t\t\tcropData,\n\t\t\twidth: cropData?.fullWidth || 2,\n\t\t\t// This is only to mock loading of tiles (which are not available for flat pictures)\n\t\t\tcols: 2, rows: 1, tileUrl: () => null\n\t\t};\n\t}\n\n\t// Cleanup empty semantics feature (metacatalog bug)\n\tif(f.properties?.semantics) {\n\t\tf.properties.semantics = f.properties.semantics.filter(o => Object.keys(o).length > 0);\n\t}\n\n\tconst node = {\n\t\tid: f.id,\n\t\tcaption: getNodeCaption(f, t),\n\t\tpanorama,\n\t\tlinks: filterRelatedPicsLinks(f, customLinkFilter),\n\t\tgps: f.geometry.coordinates,\n\t\tsequence: {\n\t\t\tid: f.collection,\n\t\t\tnextPic: next ? next.id : undefined,\n\t\t\tprevPic: prev ? prev.id : undefined\n\t\t},\n\t\tsphereCorrection: getSphereCorrection(f),\n\t\thorizontalFov,\n\t\torigInstance,\n\t\tproperties: f.properties,\n\t};\n\t\n\treturn node;\n}\n\n/**\n * Filter surrounding pictures links to avoid too much arrows on viewer.\n * @private\n */\nexport function filterRelatedPicsLinks(metadata, customFilter = null) {\n\tconst picLinks = metadata.links\n\t\t.filter(l => [\"next\", \"prev\", \"related\"].includes(l?.rel) && l?.type === \"application/geo+json\")\n\t\t.filter(l => customFilter ? customFilter(l) : true)\n\t\t.map(l => {\n\t\t\tif(l.datetime) {\n\t\t\t\tl.date = l.datetime.split(\"T\")[0];\n\t\t\t}\n\t\t\treturn l;\n\t\t});\n\tconst picPos = metadata.geometry.coordinates;\n\n\t// Filter to keep a single link per direction, in same sequence or most recent one\n\tconst filteredLinks = [];\n\tconst picSurroundings = { \"N\": [], \"ENE\": [], \"ESE\": [], \"S\": [], \"WSW\": [], \"WNW\": [] };\n\n\tfor(let picLink of picLinks) {\n\t\tconst a = getSimplifiedAngle(picPos, picLink.geometry.coordinates);\n\t\tpicSurroundings[a].push(picLink);\n\t}\n\n\tfor(let direction in picSurroundings) {\n\t\tconst picsInDirection = picSurroundings[direction];\n\t\tif(picsInDirection.length == 0) { continue; }\n\t\tpicsInDirection.sort(sortPicturesInDirection(picPos));\n\t\tfilteredLinks.push(picsInDirection.shift());\n\t}\n\n\tlet arrowStyle = l => l.rel === \"related\" ? {\n\t\telement: getArrow(ArrowTurn),\n\t\tsize: { width: 64*2/3, height: 192*2/3 }\n\t} : {\n\t\telement: getArrow(ArrowTriangle),\n\t\tsize: { width: 75, height: 75 }\n\t};\n\n\tconst rectifiedYaw = - (metadata.properties?.[\"view:azimuth\"] || 0) * (Math.PI / 180);\n\treturn filteredLinks.map(l => ({\n\t\tnodeId: l.id,\n\t\tgps: l.geometry.coordinates,\n\t\tarrowStyle: arrowStyle(l),\n\t\tlinkOffset: { yaw: rectifiedYaw }\n\t}));\n}\n\n/**\n * Read structured hashtags from picture metadata\n * @private\n */\nexport function getHashTags(metadata) {\n\tif(!metadata?.properties?.semantics) { return []; }\n\t\n\t// Find hashtag entry in semantics\n\tconst hashtagsTags = metadata.properties.semantics.filter(kv => kv.key === \"hashtags\");\n\tconst readHashTags = [];\n\thashtagsTags.forEach(htt => htt.value.split(\";\").forEach(v => readHashTags.push(v.trim())));\n\n\treturn readHashTags;\n}\n\n/**\n * Check if a given picture has associated annotations.\n * @private\n */\nexport function hasAnnotations(metadata) {\n\treturn metadata?.properties?.annotations?.length > 0;\n}","import { html } from \"lit\";\nimport logoOsm from \"../img/osm.svg\";\nimport logoWd from \"../img/wd.svg\";\nimport { OSMWikiURL, WikidataURL, PanoramaxPresetsURL, OSMURL, WikidataAPIURL } from \"./services\";\nimport { getBestLabel } from \"./i18n\";\n\n\n// List of [ Overlay ID, API filter, Maplibre Style, Sprites ]\nexport const SEMANTICS_OVERLAYS = [\n\t[\n\t\t\"features\",\n\t\t\"\\\"semantics\\\" IS NOT NULL\",\n\t\t{\n\t\t\tmetadata: { \"name\": \"All features\" },\n\t\t\ttype: \"circle\",\n\t\t\tlayout: {\n\t\t\t\tvisibility: \"none\",\n\t\t\t},\n\t\t\tpaint: {\n\t\t\t\t\"circle-radius\": 4,\n\t\t\t\t\"circle-color\": \"#00897B\"\n\t\t\t}\n\t\t}\n\t],\n\t[\n\t\t\"tfsigns\",\n\t\t\"\\\"semantics.osm|traffic_sign\\\" IS NOT NULL\",\n\t\t{\n\t\t\tmetadata: { \"name\": \"Traffic signs\" },\n\t\t\ttype: \"symbol\",\n\t\t\tlayout: {\n\t\t\t\tvisibility: \"none\",\n\t\t\t\t\"icon-overlap\": \"never\",\n\t\t\t\t\"icon-image\": [\"case\",\n\t\t\t\t\t// Many signs\n\t\t\t\t\t[\"in\", \";\", [\"get\", \"osm|traffic_sign\"]],\n\t\t\t\t\t\"pnx-tfsigns-fr:0_many\",\n\t\t\t\t\t// Single FR sign\n\t\t\t\t\t[\"==\", [\"slice\", [\"get\", \"osm|traffic_sign\"], 0, 2], \"FR\"],\n\t\t\t\t\t[\"concat\", \"pnx-tfsigns-fr:\", [\"slice\", [\"get\", \"osm|traffic_sign\"], 3]],\n\t\t\t\t\t// Generic value\n\t\t\t\t\t[\"==\", [\"get\", \"osm|traffic_sign\"], \"yes\"],\n\t\t\t\t\t\"pnx-tfsigns-fr:0_unknown\",\n\t\t\t\t\t// Fallbacks\n\t\t\t\t\t[\"has\", \"osm|traffic_sign\"],\n\t\t\t\t\t\"pnx-tfsigns-fr:0_unknown\",\n\t\t\t\t\t\"\"\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t{ \"pnx-tfsigns-fr\": `${PanoramaxPresetsURL()}/sprites/trafficsigns_fr` }\n\t]\n];\n\n// General helpers\nfunction valToValLink(val, url, title) {\n\treturn html`<a href=${url} target=\"_blank\" title=${title}>${val}</a>`;\n}\n\n// OSM helpers\nconst OSM_MAIN_KEYS = [\n\t\"highway\", \"building\", \"amenity\", \"landuse\", \"natural\", \"waterway\", \"leisure\",\n\t\"shop\", \"railway\", \"tourism\", \"barrier\", \"boundary\", \"place\", \"power\"\n];\n\n// Wikidata helpers\nconst WD_LABELS_CACHE = {};\nfunction getWDLabel(entity, _t) {\n\tif(WD_LABELS_CACHE[entity]) {\n\t\treturn Promise.resolve(WD_LABELS_CACHE[entity]);\n\t}\n\telse {\n\t\tconst url = entity.startsWith(\"P\") ? `properties/${entity}` : `items/${entity}/labels`;\n\t\treturn fetch(`${WikidataAPIURL()}/entities/${url}`)\n\t\t\t.then(res => res.json())\n\t\t\t.then(res => {\n\t\t\t\tWD_LABELS_CACHE[entity] = getBestLabel(res.labels || res, _t.PREF_LANG);\n\t\t\t\treturn WD_LABELS_CACHE[entity];\n\t\t\t});\n\t}\n}\n\n// Supported prefixes for nice semantic display\nconst KNOWN_PREFIXES = {\n\t\"\": {\n\t\ttitle: \"Panoramax\",\n\t\tvalue_transform: (tag, _t) => {\n\t\t\tif(tag.key === \"osm\") {\n\t\t\t\treturn valToValLink(\n\t\t\t\t\ttag.value,\n\t\t\t\t\t`${OSMURL()}/${tag.value}`,\n\t\t\t\t\t_t.pnx.semantics_value_show_osm\n\t\t\t\t);\n\t\t\t}\n\t\t\telse { return tag.value; }\n\t\t}\n\t},\n\n\tosm: {\n\t\ttitle: \"OpenStreetMap\",\n\t\tlogo: logoOsm,\n\t\tkey_transform: (tag, _t) => valToValLink(\n\t\t\ttag.key,\n\t\t\t`${OSMWikiURL()}/Key:${tag.key}`,\n\t\t\t_t.pnx.semantics_key_doc\n\t\t),\n\t\tvalue_transform: (tag, _t) => {\n\t\t\tif(OSM_MAIN_KEYS.includes(tag.key)) {\n\t\t\t\treturn valToValLink(\n\t\t\t\t\ttag.value,\n\t\t\t\t\t`${OSMWikiURL()}/Tag:${tag.key}=${tag.value}`,\n\t\t\t\t\t_t.pnx.semantics_value_doc\n\t\t\t\t);\n\t\t\t}\n\t\t\telse { return tag.value; }\n\t\t}\n\t},\n\n\twd: {\n\t\ttitle: \"Wikidata\",\n\t\tlogo: logoWd,\n\t\tkey_transform: (tag, _t) => {\n\t\t\tconst url = `${WikidataURL()}/Property:${tag.key}`;\n\t\t\tconst keylabel = _t.pnx.semantics_wikidata_properties[tag.key];\n\n\t\t\tif(keylabel) {\n\t\t\t\treturn valToValLink(\n\t\t\t\t\thtml`${_t.pnx.semantics_wikidata_properties[tag.key]} <small>(${tag.key})</small>`,\n\t\t\t\t\turl,\n\t\t\t\t\t_t.pnx.semantics_key_doc\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst label = document.createElement(\"span\");\n\t\t\t\tlabel.innerText = tag.key;\n\n\t\t\t\t// Try to fetch label from API\n\t\t\t\tgetWDLabel(tag.key, _t).then(wdl => {\n\t\t\t\t\tlabel.innerHTML = `${wdl} <small>(${tag.key})</small>`;\n\t\t\t\t});\n\n\t\t\t\treturn valToValLink(label, url, _t.pnx.semantics_key_doc);\n\t\t\t}\n\t\t},\n\t\tvalue_transform: (tag, _t) => {\n\t\t\tconst label = document.createElement(\"span\");\n\t\t\tlabel.innerText = tag.value;\n\n\t\t\t// Try to fetch label from API\n\t\t\tgetWDLabel(tag.value, _t).then(wdl => {\n\t\t\t\tlabel.innerHTML = `${wdl} <small>(${tag.value})</small>`;\n\t\t\t});\n\n\t\t\treturn valToValLink(\n\t\t\t\tlabel,\n\t\t\t\t`${WikidataURL()}/${tag.value}`,\n\t\t\t\t_t.pnx.semantics_value_doc\n\t\t\t);\n\t\t}\n\t},\n\n\texif: { title: \"EXIF\" },\n};\n\n\n/**\n * Transform a prefix|key=value into parsed object.\n * Does not handle qualifiers tags.\n * @private\n */\nexport function decodeBasicTag(tag) {\n\tconst firstEqual = (tag || \"\").lastIndexOf(\"=\");\n\tif(firstEqual < 0) { return null; }\n\n\tconst key = decodeKey(tag.substring(0, firstEqual));\n\tif(key.subkey.indexOf(\"=\") >= 0) { return null; }\n\n\treturn { key, value: tag.substring(firstEqual+1) };\n}\n\n\n/** @private */\nexport function decodeKey(key = \"\") {\n\tconst regex = /^(?:([a-z_]+)\\|)?([^[]+)(?:\\[(.*)\\])?$/;\n\tconst match = key.match(regex);\n\n\tif (!match) {\n\t\treturn { prefix: \"\", subkey: key, qualifies: null };\n\t}\n\n\tconst [, prefix, subkey, qualifies ] = match;\n\treturn {\n\t\tkey: key,\n\t\tprefix: prefix || \"\",\n\t\tsubkey,\n\t\tqualifies: decodeBasicTag(qualifies),\n\t};\n}\n\n\n/**\n * Transforms a string containing a list of tags in a ready-to-use parsed object list.\n * @param {string} str The string to read (each tag separated by newline `\\n`)\n * @returns {object[]} List of API-formatted tags\n */\nexport function parseSemanticsString(str) {\n\tconst parsedTags = str.split(\"\\n\").map(t => {\n\t\tconst parts = decodeBasicTag(t);\n\t\tif(\n\t\t\tparts\n\t\t\t&& parts.key.key.length <= 256\n\t\t\t&& parts.value.length <= 2048\n\t\t) {\n\t\t\treturn { key: parts.key.key, value: parts.value };\n\t\t} else { return null; }\n\t});\n\n\tif(parsedTags.findIndex(v => !v) >= 0) {\n\t\tif(str.trim().length === 0 && parsedTags.length === 1) { return []; }\n\t\tthrow new Error(\"Invalid tags\");\n\t}\n\n\treturn parsedTags;\n}\n\n\n/**\n * Transforms a semantics array into a key=value string.\n * @param {object[]} semantics List of API-formatted tags\n * @returns {string} The readable string (each tag separated by newline `\\n`)\n */\nexport function semanticsToString(semantics) {\n\treturn (semantics || []).map(s => `${s.key}=${s.value}`).join(\"\\n\");\n}\n\n\n/**\n * Computes the difference between two set of API tags.\n * API expects a delta between old & new, so result contains only\n * added and deleted tags.\n * @param {object[]} prev The previous set of tags\n * @param {object[]} next The new set of tags\n * @returns {object[]} The new set of tags, with only added/deleted tags\n */\nexport function computeDiffTags(prev = [], next = []) {\n\tconst res = [];\n\n\t// Look for new values\n\t(next || [])\n\t\t.filter(nt => prev.find(pt => pt.key == nt.key && pt.value == nt.value) === undefined)\n\t\t.forEach(t => res.push({key: t.key, value: t.value, action: \"add\"}));\n\n\t// Look for prev values missing in next\n\t(prev || [])\n\t\t.filter(pt => next.find(nt => pt.key == nt.key && pt.value == nt.value) === undefined)\n\t\t.forEach(t => res.push({key: t.key, value: t.value, action: \"delete\"}));\n\n\treturn res;\n}\n\n\n/**\n * Transforms raw API semantics properties into ready-to-display container.\n * @param {object[]} tags The API semantics tags\n * @returns {object[]} A list of groups (by prefix), with {title, tags} information.\n */\nexport function groupByPrefix(tags) {\n\t// Create raw groups by prefix\n\tconst byPrefix = {};\n\tconst qualifiers = [];\n\n\t// First pass: analyze tags, separate by prefix\n\ttags.forEach(tag => {\n\t\tif(tag.action === \"delete\") { return; }\n\t\t\n\t\tconst decodedKey = decodeKey(tag.key);\n\n\t\t// Put apart qualifiers, to later insert on tags themselves\n\t\tif(decodedKey.qualifies) {\n\t\t\tqualifiers.push(Object.assign({}, tag, decodedKey));\n\t\t}\n\t\t// Process classic tag\n\t\telse {\n\t\t\tif (!byPrefix[decodedKey.prefix]) { byPrefix[decodedKey.prefix] = []; }\n\n\t\t\tbyPrefix[decodedKey.prefix].push(decodedKey.prefix.length > 0 ? {\n\t\t\t\tkey: decodedKey.subkey,\n\t\t\t\tvalue: tag.value\n\t\t\t} : tag);\n\t\t}\n\t});\n\n\t// Second pass: add qualifiers on concerned tags\n\tqualifiers.forEach(({key, prefix, subkey, qualifies, value}) => {\n\t\tconst concernedTag = byPrefix[qualifies.key.prefix]?.find(t => (\n\t\t\tt.key === qualifies.key.subkey\n\t\t\t&& (!qualifies.value || qualifies.value === t.value)\n\t\t));\n\n\t\tif(concernedTag) {\n\t\t\tif(!concernedTag.qualifiers) { concernedTag.qualifiers = []; }\n\t\t\tconcernedTag.qualifiers.push({key, prefix, subkey, value});\n\t\t}\n\t});\n\n\t// Append known prefixes information\n\tlet groups = Object.entries(byPrefix).map(([prefix, prefixTags]) => {\n\t\tif(KNOWN_PREFIXES[prefix]) {\n\t\t\treturn Object.assign({ prefix, tags: prefixTags }, KNOWN_PREFIXES[prefix]);\n\t\t}\n\t\telse {\n\t\t\treturn { prefix, title: prefix, tags: prefixTags };\n\t\t}\n\t});\n\n\treturn groups;\n}\n","/*\n * Settings that may be useful to change for special cases (e.g. offline implementation).\n * Most users will be fine with the defaults.\n */\n\n\n/**\n * Default map background tiles\n * @returns {string} The website URL\n */\nexport function MapTiles() {\n\treturn \"https://panoramax.openstreetmap.fr/pmtiles/basic.json\";\n}\n\n/**\n * Panoramax website URL\n * @returns {string} The website URL\n */\nexport function PanoramaxWebsiteURL() {\n\treturn \"https://panoramax.fr\";\n}\n\n/**\n * Panoramax Presets URL\n * @returns {string} The presets URL\n */\nexport function PanoramaxPresetsURL() {\n\treturn \"https://presets.panoramax.fr\";\n}\n\n/**\n * Panoramax meta-catalog URL\n * @returns {string} The metacatalog URL\n */\nexport function PanoramaxMetaCatalogURL() {\n\treturn \"https://explore.panoramax.fr\";\n}\n\n/**\n * Temaki icons URL\n * @param {string} [iconName] The icon name to insert in URL\n * @returns {string} The SVG icon URL\n */\nexport function TemakiIconURL(iconName) {\n\treturn `https://raw.githubusercontent.com/rapideditor/temaki/refs/heads/main/icons/${iconName}.svg`;\n}\n\n\n/* -----------------------------------------------------\n * Wikidata docs & tools\n */\n\n/**\n * Wikidata URL\n * @returns {string} The Wikidata URL\n */\nexport function WikidataURL() {\n\treturn \"https://www.wikidata.org/wiki\";\n}\n\n/**\n * Wikidata API URL\n * @returns {string} The Wikidata URL\n */\nexport function WikidataAPIURL() {\n\treturn \"https://www.wikidata.org/w/rest.php/wikibase/v1\";\n}\n\n\n/* -----------------------------------------------------\n * OpenStreetMap docs & tools\n */\n\n/**\n * OpenStreetMap iD editor URL\n * @returns {string} The editor URL\n */\nexport function IdEditorURL() {\n\treturn \"https://www.openstreetmap.org/edit?editor=id\";\n}\n\n/**\n * OpenStreetMap wiki URL\n * @returns {string} The wiki URL\n */\nexport function OSMWikiURL() {\n\treturn \"https://wiki.openstreetmap.org/wiki\";\n}\n\n/**\n * OpenStreetMap website URL\n * @returns {string} The OSM website URL\n */\nexport function OSMURL() {\n\treturn \"https://openstreetmap.org\";\n}\n\n/**\n * Indoor= sprites URL\n * @returns {string} The indoor= sprites URL\n */\nexport function IndoorEqualSpritesURL() {\n\treturn \"https://files.pavie.info/depot/remote/indoorequal/indoorequal\";\n}\n\n\n/* -----------------------------------------------------\n * Internet speed tests\n */\n\n/**\n * Get the threshold fast internet speed value.\n *\n * @returns {number} the minimum speed in MBps for internet to be considered \"fast\"\n */\nexport function InternetFastThreshold() {\n\treturn 10;\n}\n\n/**\n * Get the fast internet speed test file.\n *\n * @returns {string} URL for the file to use for internet speed testing.\n */\nexport function InternetFastTestFile() {\n\treturn \"https://panoramax.openstreetmap.fr/images/05/ca/2c/98/0111-4baf-b6f3-587bb8847d2e.jpg\";\n}\n\n\n/* -----------------------------------------------------\n * Geocoding-related settings\n */\n\n/**\n * Get the Base Adresse Nationale URL for geocoding API.\n * @returns {string} The Base Adresse Nationale URL (must support /search calls).\n */\nexport function AdresseDataGouvBaseURL() {\n\treturn \"https://data.geopf.fr/geocodage/search\";\n}\n\n/**\n * Get the Nominatim base URL for geocoding API.\n * @returns {string} The Nominatim URL (must support /search & /reverse calls).\n */\nexport function NominatimBaseUrl() {\n\treturn \"https://nominatim.openstreetmap.org\";\n}\n","import { InternetFastTestFile, InternetFastThreshold } from \"./services\";\n\nexport const DISABLE_ANNOTATIONS_PARAM = \"pnx-disable-annotations\";\nexport const BASE_PANORAMA_ID = \"geovisio-fake-id-0\";\n\nexport const COLORS = {\n\tBASE: \"#FF6F00\",\n\tSELECTED: \"#1E88E5\",\n\tHIDDEN: \"#34495E\",\n\tNEXT: \"#ffab40\",\n\n\tQUALI_1: \"#00695C\", // 360\n\tQUALI_2: \"#fd8d3c\", // flat\n\n\tPALETTE_1: \"#fecc5c\", // Oldest\n\tPALETTE_2: \"#fd8d3c\",\n\tPALETTE_3: \"#f03b20\",\n\tPALETTE_4: \"#bd0026\" // Newest\n};\n\nexport const COLORS_HEX = Object.fromEntries(Object.entries(COLORS).map(e => {\n\te[1] = parseInt(e[1].slice(1), 16);\n\treturn e;\n}));\n\nexport const QUALITYSCORE_VALUES = [\n\t{ color: \"#007f4e\", label: \"A\" },\n\t{ color: \"#72b043\", label: \"B\" },\n\t{ color: \"#b5be2f\", label: \"C\" },\n\t{ color: \"#f8cc1b\", label: \"D\" },\n\t{ color: \"#f6a020\", label: \"E\" },\n];\n\nexport const QUALITYSCORE_RES_FLAT_VALUES = [1, 10, 2, 15, 3, 30, 4];\t\t\t\t// Grade, < Px/FOV value\nexport const QUALITYSCORE_RES_360_VALUES = [3, 15, 4, 30, 5];\t\t\t\t\t\t// Grade, < Px/FOV value\nexport const QUALITYSCORE_GPS_VALUES = [5, 0.5, 4, 2.01, 3, 5.01, 2, 10.01, 1];\t// Grade, < Meters value\nexport const QUALITYSCORE_POND_RES = 4/5;\nexport const QUALITYSCORE_POND_GPS = 1/5;\n\nexport const GPS_VALUES = [\n\t{ color: \"#4A148C\", label: `<= ${QUALITYSCORE_GPS_VALUES[1]} m` },\n\t{ color: \"#7B1FA2\", label: `${Math.round(QUALITYSCORE_GPS_VALUES[1])} - ${Math.round(QUALITYSCORE_GPS_VALUES[3])} m` },\n\t{ color: \"#9C27B0\", label: `${Math.round(QUALITYSCORE_GPS_VALUES[3])} - ${Math.round(QUALITYSCORE_GPS_VALUES[5])} m` },\n\t{ color: \"#BA68C8\", label: `${Math.round(QUALITYSCORE_GPS_VALUES[5])} - ${Math.round(QUALITYSCORE_GPS_VALUES[7])} m` },\n\t{ color: \"#EA80FC\", label: `> ${Math.round(QUALITYSCORE_GPS_VALUES[7])} m` },\n];\n\n\n/**\n * Checks if a picture or sequence ID is kinda-null.\n * @param {string|null|undefined} id The ID to check\n * @returns True if null-like\n */\nexport function isNullId(id) {\n\treturn [null, undefined, \"\", BASE_PANORAMA_ID].includes(id);\n}\n\n/**\n * Find the grade associated to an input Quality Score definition.\n * @param {number[]} ranges The QUALITYSCORE_*_VALUES definition\n * @param {number} value The picture value\n * @return {number} The corresponding grade (1 to 5, or null if missing)\n * @private\n */\nexport function getGrade(ranges, value) {\n\tif(value === null || value === undefined || value === \"\") { return null; }\n\n\t// Read each pair from table (grade, reference value)\n\tfor(let i = 0; i < ranges.length; i += 2) {\n\t\tconst grade = ranges[i];\n\t\tconst limit = ranges[i+1];\n\n\t\t// Send grade if value is under limit\n\t\tif (value < limit) {\n\t\t\treturn grade;\n\t\t}\n\t}\n\t// Otherwise, send last grade\n\treturn ranges[ranges.length - 1];\n}\n\n/**\n * Get cartesian distance between two points\n * @param {number[]} from Start [x,y] coordinates\n * @param {number[]} to End [x,y] coordinates\n * @returns {number} The distance\n * @private\n */\nexport function getDistance(from, to) {\n\tconst dx = from[0] - to[0];\n\tconst dy = from[1] - to[1];\n\treturn Math.sqrt(dx*dx + dy*dy);\n}\n\n/**\n * Transforms a Base64 SVG string into a DOM img element.\n * @param {string} svg The SVG as Base64 string\n * @returns {Element} The DOM image element\n * @private\n */\nexport function svgToPSVLink(svg, fillColor) {\n\ttry {\n\t\tconst svgStr = atob(svg.replace(/^data:image\\/svg\\+xml;base64,/, \"\"));\n\t\tconst svgXml = (new DOMParser()).parseFromString(svgStr, \"image/svg+xml\").childNodes[0];\n\t\tconst btn = document.createElement(\"button\");\n\t\tbtn.appendChild(svgXml);\n\t\tbtn.classList.add(\"pnx-psv-tour-arrows\", \"pnx-print-hidden\");\n\t\tbtn.style.color = fillColor;\n\t\treturn btn;\n\t}\n\tcatch(e) {\n\t\tconst img = document.createElement(\"img\");\n\t\timg.src = svg;\n\t\timg.alt = \"\";\n\t\treturn img;\n\t}\n}\n\n/**\n * Clones a model PSV link\n * @private\n */\nexport function getArrow(a) {\n\tconst d = a.cloneNode(true);\n\td.addEventListener(\"pointerup\", () => d.classList.add(\"pnx-clicked\"));\n\treturn d;\n}\n\n/**\n * Get direction based on angle\n * @param {number[]} from Start [x,y] coordinates\n * @param {number[]} to End [x,y] coordinates\n * @returns {number} The azimuth, from 0 to 360°\n * @private\n */\nexport function getAzimuth(from, to) {\n\treturn (Math.atan2(to[0] - from[0], to[1] - from[1]) * (180 / Math.PI) + 360) % 360;\n}\n\n/**\n * Computes relative heading for a single picture, based on its metadata\n * @param {*} m The picture metadata\n * @returns {number} The relative heading\n * @private\n */\nexport function getRelativeHeading(m) {\n\tif(!m) { throw new Error(\"No picture selected\"); }\n\n\tlet prevSegDir, nextSegDir;\n\tconst currHeading = m.properties[\"view:azimuth\"];\n\n\t// Previous picture GPS coordinates\n\tif(m?.sequence?.prevPic) {\n\t\tconst prevLink = m?.links?.find(l => l.nodeId === m.sequence.prevPic);\n\t\tif(prevLink) {\n\t\t\tprevSegDir = (((currHeading - getAzimuth(prevLink.gps, m.gps)) + 180) % 360) - 180;\n\t\t}\n\t}\n\n\t// Next picture GPS coordinates\n\tif(m?.sequence?.nextPic) {\n\t\tconst nextLink = m?.links?.find(l => l.nodeId === m.sequence.nextPic);\n\t\tif(nextLink) {\n\t\t\tnextSegDir = (((currHeading - getAzimuth(m.gps, nextLink.gps)) + 180) % 360) - 180;\n\t\t}\n\t}\n\n\treturn prevSegDir !== undefined ? prevSegDir : (nextSegDir !== undefined ? nextSegDir : 0);\n}\n\n/**\n * Get direction based on angle\n * @param {number[]} from Start [x,y] coordinates\n * @param {number[]} to End [x,y] coordinates\n * @returns {string} Direction (N/ENE/ESE/S/WSW/WNW)\n * @private\n */\nexport function getSimplifiedAngle(from, to) {\n\tconst angle = Math.atan2(to[0] - from[0], to[1] - from[1]) * (180 / Math.PI); // -180 to 180°\n\n\t// 6 directions version\n\tif (Math.abs(angle) < 30) { return \"N\"; }\n\telse if (angle >= 30 && angle < 90) { return \"ENE\"; }\n\telse if (angle >= 90 && angle < 150) { return \"ESE\"; }\n\telse if (Math.abs(angle) >= 150) { return \"S\"; }\n\telse if (angle <= -30 && angle > -90) { return \"WNW\"; }\n\telse if (angle <= -90 && angle > -150) { return \"WSW\"; }\n}\n\n/**\n * Converts result from getPosition or position-updated event into x/y/z coordinates\n *\n * @param {object} pos pitch/yaw as given by PSV\n * @param {number} zoom zoom as given by PSV\n * @returns {object} Coordinates as x/y in degrees and zoom as given by PSV\n * @private\n */\nexport function positionToXYZ(pos, zoom = undefined) {\n\tconst res = {\n\t\tx: pos.yaw * (180/Math.PI),\n\t\ty: pos.pitch * (180/Math.PI)\n\t};\n\n\tif(zoom !== undefined) { res.z = zoom; }\n\treturn res;\n}\n\n/**\n * Converts x/y/z coordinates into PSV position (lat/lon/zoom)\n *\n * @param {number} x The X coordinate (in degrees)\n * @param {number} y The Y coordinate (in degrees)\n * @param {number} z The zoom level (0-100)\n * @returns {object} Position coordinates as yaw/pitch/zoom\n * @private\n */\nexport function xyzToPosition(x, y, z) {\n\treturn {\n\t\tyaw: x / (180/Math.PI),\n\t\tpitch: y / (180/Math.PI),\n\t\tzoom: z\n\t};\n}\n\n/**\n * Transforms decimal degrees into degrees/minutes/seconds format.\n * @param {number} degrees The decimal degrees value\n * @returns {object} Coordinate as {d,m,s} object\n */\nexport function degToDms(degrees) {\n\tconst d = degrees < 0 ? Math.ceil(degrees) : Math.floor(degrees);\n\tconst rm = Math.abs(degrees - d) * 60;\n\tconst m = Math.floor(rm);\n\tconst s = parseFloat(((rm - m) * 60).toFixed(3));\n\treturn { d, m, s };\n}\n\n/**\n * Get the query string for JOSM to load current picture area\n * @returns {string} The query string, or null if not available\n * @private\n */\nexport function josmBboxParameters(meta) {\n\tif(meta) {\n\t\tconst coords = meta.gps;\n\t\tconst heading = meta?.properties?.[\"view:azimuth\"];\n\t\tconst delta = 0.0002;\n\t\tconst values = {\n\t\t\tleft: coords[0] - (heading === null || heading >= 180 ? delta : 0),\n\t\t\tright: coords[0] + (heading === null || heading <= 180 ? delta : 0),\n\t\t\ttop: coords[1] + (heading === null || heading <= 90 || heading >= 270 ? delta : 0),\n\t\t\tbottom: coords[1] - (heading === null || (heading >= 90 && heading <= 270) ? delta : 0),\n\t\t\tchangeset_source: \"Panoramax\"\n\t\t};\n\t\treturn Object.entries(values).map(e => e.join(\"=\")).join(\"&\");\n\t}\n\telse { return null; }\n}\n\n/**\n * Check if code runs in an iframe or in a classic page.\n * @returns {boolean} True if running in iframe\n * @private\n */\nexport function isInIframe() {\n\ttry {\n\t\treturn window.self !== window.top;\n\t} catch(e) {\n\t\treturn true;\n\t}\n}\n\n\nconst INTERNET_FAST_STORAGE = \"pnx-internet-fast\";\n\n/**\n * Check if Internet connection is high-speed or not.\n * @returns {Promise} Resolves on true if high-speed.\n * @private\n */\nexport function isInternetFast() {\n\t// Check if downlink property is available\n\ttry {\n\t\tconst speed = navigator.connection.downlink; // MBit/s\n\t\treturn Promise.resolve(speed >= InternetFastThreshold());\n\t}\n\t// Fallback for other browsers\n\tcatch(e) {\n\t\ttry {\n\t\t\t// Check if test has been done before and stored\n\t\t\tconst isFast = sessionStorage.getItem(INTERNET_FAST_STORAGE);\n\t\t\tif([\"true\", \"false\"].includes(isFast)) {\n\t\t\t\treturn Promise.resolve(isFast === \"true\");\n\t\t\t}\n\n\t\t\t// Run download testing\n\t\t\tconst startTime = (new Date()).getTime();\n\t\t\treturn fetch(`${InternetFastTestFile()}?nocache=${startTime}`)\n\t\t\t\t.then(async res => [res, await res.blob()])\n\t\t\t\t.then(([res, blob]) => {\n\t\t\t\t\tconst size = parseInt(res.headers.get(\"Content-Length\") || blob.size); // Bytes\n\t\t\t\t\tconst endTime = (new Date()).getTime();\n\t\t\t\t\tconst duration = (endTime - startTime) / 1000; // Transfer time in seconds\n\t\t\t\t\tconst speed = (size * 8 / 1024 / 1024) / duration; // MBits/s\n\t\t\t\t\tconst isFast = speed >= InternetFastThreshold();\n\t\t\t\t\tsessionStorage.setItem(INTERNET_FAST_STORAGE, isFast ? \"true\" : \"false\");\n\t\t\t\t\treturn isFast;\n\t\t\t\t})\n\t\t\t\t.catch(e => {\n\t\t\t\t\tconsole.warn(\"Failed to run speedtest\", e);\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t}\n\t\t// Fallback for browser blocking third-party downloads or sessionStorage\n\t\tcatch(e) {\n\t\t\treturn Promise.resolve(false);\n\t\t}\n\t}\n}\n\n/**\n * Get a cookie value\n * @param {str} name The cookie name\n * @returns {str} The cookie value, or null if not found\n * @private\n */\nexport function getCookie(name) {\n\tconst parts = document.cookie\n\t\t?.split(\";\")\n\t\t?.find((row) => row.trimStart().startsWith(`${name}=`))\n\t\t?.split(\"=\");\n\tif(!parts) { return undefined; }\n\tparts.shift();\n\treturn parts.join(\"=\");\n}\n\n/**\n * Checks if an user account exists\n * @returns {object} Object like {\"id\", \"name\"} or null if no authenticated account\n * @private\n */\nexport function getUserAccount() {\n\tconst session = getCookie(\"session\");\n\tconst user_id = getCookie(\"user_id\");\n\tconst user_name = getCookie(\"user_name\");\n\n\treturn (session && user_id && user_name) ? { id: user_id, name: user_name } : null;\n}\n\n/**\n * Sends a random value between min and max (inclusive)\n * @param {number} min Minimal value\n * @param {number} max Maximal value\n * @returns {number} Random value\n */\nexport function inRangeRandom(min, max) {\n\tconst randomBuffer = new Uint32Array(1);\n\tcrypto.getRandomValues(randomBuffer);\n\tlet randomNumber = randomBuffer[0] / (0xffffffff + 1);\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(randomNumber * (max - min + 1)) + min;\n}\n","import { icon } from \"@fortawesome/fontawesome-svg-core\";\nimport { setCustomIconLoader } from \"iconify-icon\";\nimport { TemakiIconURL } from \"./services\";\n\n\n/**\n * Transform Font Awesome icon definition into HTML element\n * @param {IconDefinition} i The icon to use\n * @param {object} [o] [FontAwesome icon parameters](https://origin.fontawesome.com/docs/apis/javascript/methods#icon-icondefinition-params)\n * @returns {Element} HTML element\n * @private\n */\nexport function fa(i, o) {\n\treturn icon(i, o).node[0];\n}\n\n/**\n * Register more icons providers for Iconify\n * @private\n */\nexport function moreIcons() {\n\tsetCustomIconLoader(async (name) => {\n\t\tconst response = await fetch(TemakiIconURL(name));\n\t\tif (!response.ok) {\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\tbody: await response.text()\n\t\t};\n\t}, \"temaki\");\n}\n\n/**\n * Create a web component with its initial properties\n * @private\n */\nexport function createWebComp(tag, props = {}) {\n\tconst wc = document.createElement(tag);\n\tObject.entries(props).forEach(([k,v]) => {\n\t\tif(k.startsWith(\"_\")) { wc[k] = v; }\n\t\telse if(k.startsWith(\"fn\")) { wc[k.substring(2)] = v; }\n\t\telse if(k.startsWith(\"on\")) { wc.addEventListener(k.substring(2), v); }\n\t\telse if(v) { wc.setAttribute(k, v); }\n\t});\n\treturn wc;\n}\n\n/**\n * Listen to parent events that may lead to a menu closure\n * @private\n */\nexport function listenForMenuClosure(me, callback) {\n\t// Other menu opened\n\tme._parent?.addEventListener(\"menu-opened\", e => {\n\t\tif(e.detail.menu != me) { callback(); }\n\t});\n\n\t// Map click\n\tme._parent?.onceMapReady?.().then(() => {\n\t\tme._parent.map?.on?.(\"click\", () => callback());\n\t});\n\n\t// Photo click\n\tme._parent?.oncePSVReady?.().then(() => {\n\t\tme._parent.psv.addEventListener(\"click\", () => callback());\n\t});\n\n\t// Legend click\n\tme._parent?.onceReady?.().then(() => {\n\t\tme._parent.legend?.addEventListener(\"click\", () => callback());\n\t});\n}\n\n/** @private */\nfunction lookForParent(comp) {\n\tif(comp._parent) {\n\t\treturn comp._parent;\n\t}\n\telse if(comp === document.body) {\n\t\treturn null;\n\t}\n\telse if(comp.parentNode) {\n\t\treturn lookForParent(comp.parentNode);\n\t}\n\telse if(comp.host) {\n\t\treturn lookForParent(comp.host);\n\t}\n}\n\n/**\n * Wait for parent availability\n * @private\n */\nexport function onceParentAvailable(comp) {\n\tif(comp._parent) {\n\t\treturn Promise.resolve(comp._parent);\n\t}\n\telse {\n\t\treturn new Promise(resolve => {\n\t\t\tconst itv = setInterval(() => {\n\t\t\t\tconst p = lookForParent(comp);\n\t\t\t\tif(p) {\n\t\t\t\t\tcomp._parent = p;\n\t\t\t\t\tclearInterval(itv);\n\t\t\t\t\tresolve(comp._parent);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t});\n\t}\n}\n","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'far';\nvar iconName = 'star';\nvar width = 576;\nvar height = 512;\nvar aliases = [11088,61446];\nvar unicode = 'f005';\nvar svgPathData = 'M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faStar = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'arrow-left';\nvar width = 448;\nvar height = 512;\nvar aliases = [8592];\nvar unicode = 'f060';\nvar svgPathData = 'M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faArrowLeft = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'arrow-right';\nvar width = 448;\nvar height = 512;\nvar aliases = [8594];\nvar unicode = 'f061';\nvar svgPathData = 'M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faArrowRight = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'at';\nvar width = 512;\nvar height = 512;\nvar aliases = [61946];\nvar unicode = '40';\nvar svgPathData = 'M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256l0 32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32l0 80 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faAt = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'backward';\nvar width = 512;\nvar height = 512;\nvar aliases = [9194];\nvar unicode = 'f04a';\nvar svgPathData = 'M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3l0 41.7 0 41.7L459.5 440.6zM256 352l0-96 0-128 0-32c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-64z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faBackward = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'calendar';\nvar width = 448;\nvar height = 512;\nvar aliases = [128197,128198];\nvar unicode = 'f133';\nvar svgPathData = 'M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCalendar = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faCalendarDays');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faCalendarAlt = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'calendar-days';\nvar width = 448;\nvar height = 512;\nvar aliases = [\"calendar-alt\"];\nvar unicode = 'f073';\nvar svgPathData = 'M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zm64 80l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 400l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCalendarDays = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'camera';\nvar width = 512;\nvar height = 512;\nvar aliases = [62258,\"camera-alt\"];\nvar unicode = 'f030';\nvar svgPathData = 'M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCamera = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'caret-down';\nvar width = 320;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f0d7';\nvar svgPathData = 'M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCaretDown = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'caret-up';\nvar width = 320;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f0d8';\nvar svgPathData = 'M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCaretUp = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'check';\nvar width = 448;\nvar height = 512;\nvar aliases = [10003,10004];\nvar unicode = 'f00c';\nvar svgPathData = 'M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCheck = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'chevron-down';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f078';\nvar svgPathData = 'M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faChevronDown = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'chevron-right';\nvar width = 320;\nvar height = 512;\nvar aliases = [9002];\nvar unicode = 'f054';\nvar svgPathData = 'M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faChevronRight = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'chevron-up';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f077';\nvar svgPathData = 'M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faChevronUp = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'circle-exclamation';\nvar width = 512;\nvar height = 512;\nvar aliases = [\"exclamation-circle\"];\nvar unicode = 'f06a';\nvar svgPathData = 'M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCircleExclamation = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'circle-info';\nvar width = 512;\nvar height = 512;\nvar aliases = [\"info-circle\"];\nvar unicode = 'f05a';\nvar svgPathData = 'M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCircleInfo = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'circle-notch';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f1ce';\nvar svgPathData = 'M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCircleNotch = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'comment-dots';\nvar width = 512;\nvar height = 512;\nvar aliases = [128172,62075,\"commenting\"];\nvar unicode = 'f4ad';\nvar svgPathData = 'M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCommentDots = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'copy';\nvar width = 448;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f0c5';\nvar svgPathData = 'M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faCopy = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'download';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f019';\nvar svgPathData = 'M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faDownload = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'earth-europe';\nvar width = 512;\nvar height = 512;\nvar aliases = [\"globe-europe\"];\nvar unicode = 'f7a2';\nvar svgPathData = 'M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faEarthEurope = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faEllipsisVertical');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faEllipsisV = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'ellipsis-vertical';\nvar width = 128;\nvar height = 512;\nvar aliases = [\"ellipsis-v\"];\nvar unicode = 'f142';\nvar svgPathData = 'M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faEllipsisVertical = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'eraser';\nvar width = 576;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f12d';\nvar svgPathData = 'M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faEraser = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faUpRightFromSquare');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faExternalLinkAlt = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'floppy-disk';\nvar width = 448;\nvar height = 512;\nvar aliases = [128190,128426,\"save\"];\nvar unicode = 'f0c7';\nvar svgPathData = 'M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-242.7c0-17-6.7-33.3-18.7-45.3L352 50.7C340 38.7 323.7 32 306.7 32L64 32zm0 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32L96 224c-17.7 0-32-14.3-32-32l0-64zM224 288a64 64 0 1 1 0 128 64 64 0 1 1 0-128z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faFloppyDisk = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'forward';\nvar width = 512;\nvar height = 512;\nvar aliases = [9193];\nvar unicode = 'f04e';\nvar svgPathData = 'M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3l0 41.7 0 41.7L52.5 440.6zM256 352l0-96 0-128 0-32c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29l0-64z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faForward = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'image';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f03e';\nvar svgPathData = 'M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faImage = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'images';\nvar width = 576;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f302';\nvar svgPathData = 'M160 32c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64l352 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L160 32zM396 138.7l96 144c4.9 7.4 5.4 16.8 1.2 24.6S480.9 320 472 320l-144 0-48 0-80 0c-9.2 0-17.6-5.3-21.6-13.6s-2.9-18.2 2.9-25.4l64-80c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l17.3 21.6 56-84C360.5 132 368 128 376 128s15.5 4 20 10.7zM192 128a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM48 120c0-13.3-10.7-24-24-24S0 106.7 0 120L0 344c0 75.1 60.9 136 136 136l320 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-320 0c-48.6 0-88-39.4-88-88l0-224z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faImages = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faCircleInfo');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faInfoCircle = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'layer-group';\nvar width = 576;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f5fd';\nvar svgPathData = 'M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faLayerGroup = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'lightbulb';\nvar width = 384;\nvar height = 512;\nvar aliases = [128161];\nvar unicode = 'f0eb';\nvar svgPathData = 'M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faLightbulb = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'link';\nvar width = 640;\nvar height = 512;\nvar aliases = [128279,\"chain\"];\nvar unicode = 'f0c1';\nvar svgPathData = 'M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faLink = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'location-dot';\nvar width = 384;\nvar height = 512;\nvar aliases = [\"map-marker-alt\"];\nvar unicode = 'f3c5';\nvar svgPathData = 'M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faLocationDot = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'magnifying-glass';\nvar width = 512;\nvar height = 512;\nvar aliases = [128269,\"search\"];\nvar unicode = 'f002';\nvar svgPathData = 'M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faMagnifyingGlass = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'map';\nvar width = 576;\nvar height = 512;\nvar aliases = [128506,62072];\nvar unicode = 'f279';\nvar svgPathData = 'M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faMap = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faLocationDot');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faMapMarkerAlt = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'medal';\nvar width = 512;\nvar height = 512;\nvar aliases = [127941];\nvar unicode = 'f5a2';\nvar svgPathData = 'M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0L133.9 0c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0L487.4 0C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faMedal = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'minus';\nvar width = 448;\nvar height = 512;\nvar aliases = [8211,8722,10134,\"subtract\"];\nvar unicode = 'f068';\nvar svgPathData = 'M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faMinus = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'palette';\nvar width = 512;\nvar height = 512;\nvar aliases = [127912];\nvar unicode = 'f53f';\nvar svgPathData = 'M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPalette = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'panorama';\nvar width = 640;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'e209';\nvar svgPathData = 'M45.6 32C20.4 32 0 52.4 0 77.6L0 434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6l0-356.7C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPanorama = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'paper-plane';\nvar width = 512;\nvar height = 512;\nvar aliases = [61913];\nvar unicode = 'f1d8';\nvar svgPathData = 'M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPaperPlane = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'pause';\nvar width = 320;\nvar height = 512;\nvar aliases = [9208];\nvar unicode = 'f04c';\nvar svgPathData = 'M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPause = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'pen';\nvar width = 512;\nvar height = 512;\nvar aliases = [128394];\nvar unicode = 'f304';\nvar svgPathData = 'M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPen = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'person-biking';\nvar width = 640;\nvar height = 512;\nvar aliases = [128692,\"biking\"];\nvar unicode = 'f84a';\nvar svgPathData = 'M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1 288 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPersonBiking = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'play';\nvar width = 384;\nvar height = 512;\nvar aliases = [9654];\nvar unicode = 'f04b';\nvar svgPathData = 'M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPlay = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'plus';\nvar width = 448;\nvar height = 512;\nvar aliases = [10133,61543,\"add\"];\nvar unicode = '2b';\nvar svgPathData = 'M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faPlus = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faSquarePlus');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faPlusSquare = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'question';\nvar width = 320;\nvar height = 512;\nvar aliases = [10067,10068,61736];\nvar unicode = '3f';\nvar svgPathData = 'M80 160c0-35.3 28.7-64 64-64l32 0c35.3 0 64 28.7 64 64l0 3.6c0 21.8-11.1 42.1-29.4 53.8l-42.2 27.1c-25.2 16.2-40.4 44.1-40.4 74l0 1.4c0 17.7 14.3 32 32 32s32-14.3 32-32l0-1.4c0-8.2 4.2-15.8 11-20.2l42.2-27.1c36.6-23.6 58.8-64.1 58.8-107.7l0-3.6c0-70.7-57.3-128-128-128l-32 0C73.3 32 16 89.3 16 160c0 17.7 14.3 32 32 32s32-14.3 32-32zm80 320a40 40 0 1 0 0-80 40 40 0 1 0 0 80z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faQuestion = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'rocket';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f135';\nvar svgPathData = 'M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faRocket = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'satellite-dish';\nvar width = 512;\nvar height = 512;\nvar aliases = [128225];\nvar unicode = 'f7c0';\nvar svgPathData = 'M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faSatelliteDish = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'scroll';\nvar width = 576;\nvar height = 512;\nvar aliases = [128220];\nvar unicode = 'f70e';\nvar svgPathData = 'M0 80l0 48c0 17.7 14.3 32 32 32l16 0 48 0 0-80c0-26.5-21.5-48-48-48S0 53.5 0 80zM112 32c10 13.4 16 30 16 48l0 304c0 35.3 28.7 64 64 64s64-28.7 64-64l0-5.3c0-32.4 26.3-58.7 58.7-58.7L480 320l0-192c0-53-43-96-96-96L112 32zM464 480c61.9 0 112-50.1 112-112c0-8.8-7.2-16-16-16l-245.3 0c-14.7 0-26.7 11.9-26.7 26.7l0 5.3c0 53-43 96-96 96l176 0 96 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faScroll = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faShareNodes');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faShareAlt = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'share-nodes';\nvar width = 448;\nvar height = 512;\nvar aliases = [\"share-alt\"];\nvar unicode = 'f1e0';\nvar svgPathData = 'M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faShareNodes = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'sliders';\nvar width = 512;\nvar height = 512;\nvar aliases = [\"sliders-h\"];\nvar unicode = 'f1de';\nvar svgPathData = 'M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faSliders = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'square-plus';\nvar width = 448;\nvar height = 512;\nvar aliases = [61846,\"plus-square\"];\nvar unicode = 'f0fe';\nvar svgPathData = 'M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM200 344l0-64-64 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l64 0 0-64c0-13.3 10.7-24 24-24s24 10.7 24 24l0 64 64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0 0 64c0 13.3-10.7 24-24 24s-24-10.7-24-24z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faSquarePlus = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'star';\nvar width = 576;\nvar height = 512;\nvar aliases = [11088,61446];\nvar unicode = 'f005';\nvar svgPathData = 'M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faStar = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'tags';\nvar width = 512;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f02c';\nvar svgPathData = 'M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5L0 80C0 53.5 21.5 32 48 32l149.5 0c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faTags = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar source = require('./faXmark');\nexports.definition = {\n  prefix: source.prefix,\n  iconName: source.iconName,\n  icon: [\n    source.width,\n    source.height,\n    source.aliases,\n    source.unicode,\n    source.svgPathData\n  ]};\n\nexports.faTimes = exports.definition;\nexports.prefix = source.prefix;\nexports.iconName = source.iconName;\nexports.width = source.width;\nexports.height = source.height;\nexports.ligatures = source.aliases;\nexports.unicode = source.unicode;\nexports.svgPathData = source.svgPathData;\nexports.aliases = source.aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'trash';\nvar width = 448;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f1f8';\nvar svgPathData = 'M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faTrash = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'triangle-exclamation';\nvar width = 512;\nvar height = 512;\nvar aliases = [9888,\"exclamation-triangle\",\"warning\"];\nvar unicode = 'f071';\nvar svgPathData = 'M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faTriangleExclamation = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'up-right-from-square';\nvar width = 512;\nvar height = 512;\nvar aliases = [\"external-link-alt\"];\nvar unicode = 'f35d';\nvar svgPathData = 'M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faUpRightFromSquare = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'user';\nvar width = 448;\nvar height = 512;\nvar aliases = [128100,62144];\nvar unicode = 'f007';\nvar svgPathData = 'M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faUser = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'user-lock';\nvar width = 640;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f502';\nvar svgPathData = 'M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l362.8 0c-5.4-9.4-8.6-20.3-8.6-32l0-128c0-2.1 .1-4.2 .3-6.3c-31-26-71-41.7-114.6-41.7l-91.4 0zM528 240c17.7 0 32 14.3 32 32l0 48-64 0 0-48c0-17.7 14.3-32 32-32zm-80 32l0 48c-17.7 0-32 14.3-32 32l0 128c0 17.7 14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faUserLock = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'vector-square';\nvar width = 448;\nvar height = 512;\nvar aliases = [];\nvar unicode = 'f5cb';\nvar svgPathData = 'M368 80l32 0 0 32-32 0 0-32zM352 32c-17.7 0-32 14.3-32 32L128 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64l0 64c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l64 0c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l0-192c17.7 0 32-14.3 32-32l0-64c0-17.7-14.3-32-32-32l-64 0zM96 160c17.7 0 32-14.3 32-32l192 0c0 17.7 14.3 32 32 32l0 192c-17.7 0-32 14.3-32 32l-192 0c0-17.7-14.3-32-32-32l0-192zM48 400l32 0 0 32-32 0 0-32zm320 32l0-32 32 0 0 32-32 0zM48 112l0-32 32 0 0 32-32 0z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faVectorSquare = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","'use strict';\nObject.defineProperty(exports, '__esModule', { value: true });\nvar prefix = 'fas';\nvar iconName = 'xmark';\nvar width = 384;\nvar height = 512;\nvar aliases = [128473,10005,10006,10060,215,\"close\",\"multiply\",\"remove\",\"times\"];\nvar unicode = 'f00d';\nvar svgPathData = 'M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z';\n\nexports.definition = {\n  prefix: prefix,\n  iconName: iconName,\n  icon: [\n    width,\n    height,\n    aliases,\n    unicode,\n    svgPathData\n  ]};\n\nexports.faXmark = exports.definition;\nexports.prefix = prefix;\nexports.iconName = iconName;\nexports.width = width;\nexports.height = height;\nexports.ligatures = aliases;\nexports.unicode = unicode;\nexports.svgPathData = svgPathData;\nexports.aliases = aliases;","import arrow from '../icons/arrow.svg';\nimport close from '../icons/close.svg';\nimport download from '../icons/download.svg';\nimport fullscreenIn from '../icons/fullscreen-in.svg';\nimport fullscreenOut from '../icons/fullscreen-out.svg';\nimport info from '../icons/info.svg';\nimport menu from '../icons/menu.svg';\nimport zoomIn from '../icons/zoom-in.svg';\nimport zoomOut from '../icons/zoom-out.svg';\n\n/**\n *  Minimum duration of the animations created with {@link Viewer#animate}\n */\nexport const ANIMATION_MIN_DURATION = 500;\n\n/**\n * Number of pixels below which a mouse move will be considered as a click\n */\nexport const MOVE_THRESHOLD = 4;\n\n/**\n * Delay in milliseconds between two clicks to consider a double click\n */\nexport const DBLCLICK_DELAY = 300;\n\n/**\n * Delay in milliseconds to emulate a long touch\n */\nexport const LONGTOUCH_DELAY = 500;\n\n/**\n * Delay in milliseconds to for the two fingers overlay to appear\n */\nexport const TWOFINGERSOVERLAY_DELAY = 100;\n\n/**\n * Duration in milliseconds of the \"ctrl zoom\" overlay\n */\nexport const CTRLZOOM_TIMEOUT = 2000;\n\n/**\n * Radius of the SphereGeometry, Half-length of the BoxGeometry\n */\nexport const SPHERE_RADIUS = 10;\n\n/**\n * Property name added to viewer element\n */\nexport const VIEWER_DATA = 'photoSphereViewer';\n\n/**\n * CSS class that must be applied on elements whose mouse events must not bubble to the viewer itself\n */\nexport const CAPTURE_EVENTS_CLASS = 'psv--capture-event';\n\n/**\n * Actions available for {@link ViewerConfig['keyboardActions']} configuration\n */\nexport enum ACTIONS {\n    ROTATE_UP = 'ROTATE_UP',\n    ROTATE_DOWN = 'ROTATE_DOWN',\n    ROTATE_RIGHT = 'ROTATE_RIGHT',\n    ROTATE_LEFT = 'ROTATE_LEFT',\n    ZOOM_IN = 'ZOOM_IN',\n    ZOOM_OUT = 'ZOOM_OUT',\n}\n\n/**\n * Internal identifiers for various stuff\n * @internal\n */\nexport const IDS = {\n    MENU: 'menu',\n    TWO_FINGERS: 'twoFingers',\n    CTRL_ZOOM: 'ctrlZoom',\n    ERROR: 'error',\n    DESCRIPTION: 'description',\n};\n\n/**\n * Subset of keyboard codes\n */\nexport const KEY_CODES = {\n    Enter: 'Enter',\n    Control: 'Control',\n    Escape: 'Escape',\n    Space: ' ',\n    PageUp: 'PageUp',\n    PageDown: 'PageDown',\n    ArrowLeft: 'ArrowLeft',\n    ArrowUp: 'ArrowUp',\n    ArrowRight: 'ArrowRight',\n    ArrowDown: 'ArrowDown',\n    Delete: 'Delete',\n    Plus: '+',\n    Minus: '-',\n};\n\n/**\n * Collection of SVG icons\n */\nexport const ICONS = {\n    arrow,\n    close,\n    download,\n    fullscreenIn,\n    fullscreenOut,\n    info,\n    menu,\n    zoomIn,\n    zoomOut,\n};\n\n/**\n * String identifiers for easing functions\n */\nexport type EASING =\n    | 'linear'\n    | 'inQuad'\n    | 'outQuad'\n    | 'inOutQuad'\n    | 'inCubic'\n    | 'outCubic'\n    | 'inOutCubic'\n    | 'inQuart'\n    | 'outQuart'\n    | 'inOutQuart'\n    | 'inQuint'\n    | 'outQuint'\n    | 'inOutQuint'\n    | 'inSine'\n    | 'outSine'\n    | 'inOutSine'\n    | 'inExpo'\n    | 'outExpo'\n    | 'inOutExpo'\n    | 'inCirc'\n    | 'outCirc'\n    | 'inOutCirc';\n\n/**\n * Collection of easing functions\n * @see https://gist.github.com/frederickk/6165768\n */\nexport const EASINGS: Record<EASING, (t: number) => number> = {\n    linear: (t: number) => t,\n\n    inQuad: (t: number) => t * t,\n    outQuad: (t: number) => t * (2 - t),\n    inOutQuad: (t: number) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t),\n\n    inCubic: (t: number) => t * t * t,\n    outCubic: (t: number) => --t * t * t + 1,\n    inOutCubic: (t: number) => (t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),\n\n    inQuart: (t: number) => t * t * t * t,\n    outQuart: (t: number) => 1 - --t * t * t * t,\n    inOutQuart: (t: number) => (t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t),\n\n    inQuint: (t: number) => t * t * t * t * t,\n    outQuint: (t: number) => 1 + --t * t * t * t * t,\n    inOutQuint: (t: number) => (t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t),\n\n    inSine: (t: number) => 1 - Math.cos(t * (Math.PI / 2)),\n    outSine: (t: number) => Math.sin(t * (Math.PI / 2)),\n    inOutSine: (t: number) => 0.5 - 0.5 * Math.cos(Math.PI * t),\n\n    inExpo: (t: number) => Math.pow(2, 10 * (t - 1)),\n    outExpo: (t: number) => 1 - Math.pow(2, -10 * t),\n    inOutExpo: (t: number) => ((t = t * 2 - 1) < 0 ? 0.5 * Math.pow(2, 10 * t) : 1 - 0.5 * Math.pow(2, -10 * t)),\n\n    inCirc: (t: number) => 1 - Math.sqrt(1 - t * t),\n    outCirc: (t: number) => Math.sqrt(1 - (t - 1) * (t - 1)),\n    inOutCirc: (t: number) => (t *= 2) < 1 ? 0.5 - 0.5 * Math.sqrt(1 - t * t) : 0.5 + 0.5 * Math.sqrt(1 - (t -= 2) * t),\n};\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"40 40 432 432\"><g transform=\"rotate(0, 256, 256)\"><path fill=\"currentColor\" d=\"M425.23 210.55H227.39a5 5 0 01-3.53-8.53l56.56-56.57a45.5 45.5 0 000-64.28 45.15 45.15 0 00-32.13-13.3 45.15 45.15 0 00-32.14 13.3L41.32 256l174.83 174.83a45.15 45.15 0 0032.14 13.3 45.15 45.15 0 0032.13-13.3 45.5 45.5 0 000-64.28l-56.57-56.57a5 5 0 013.54-8.53h197.84c25.06 0 45.45-20.39 45.45-45.45s-20.4-45.45-45.45-45.45z\"/></g><!-- Created by Flatart from the Noun Project --></svg>\n","import { Point } from '../model';\nimport { angle, distance } from './math';\n\n/**\n * Get an element in the page by an unknown selector\n */\nexport function getElement(selector: string | HTMLElement): HTMLElement {\n    if (typeof selector === 'string') {\n        return selector.match(/^[a-z]/i) ? document.getElementById(selector) : document.querySelector(selector);\n    } else {\n        return selector;\n    }\n}\n\n/**\n * Toggles a CSS class\n */\nexport function toggleClass(element: Element, className: string, active?: boolean) {\n    if (active === undefined) {\n        element.classList.toggle(className);\n    } else if (active) {\n        element.classList.add(className);\n    } else if (!active) {\n        element.classList.remove(className);\n    }\n}\n\n/**\n * Adds one or several CSS classes to an element\n */\nexport function addClasses(element: Element, className: string) {\n    element.classList.add(...className.split(' ').filter(c => !!c));\n}\n\n/**\n * Removes one or several CSS classes to an element\n */\nexport function removeClasses(element: Element, className: string) {\n    element.classList.remove(...className.split(' ').filter(c => !!c));\n}\n\n/**\n * Searches if an element has a particular parent at any level including itself\n */\nexport function hasParent(el: HTMLElement, parent: Element): boolean {\n    let test: HTMLElement | null = el;\n\n    do {\n        if (test === parent) {\n            return true;\n        }\n        test = test.parentElement;\n    } while (test);\n\n    return false;\n}\n\n/**\n * Gets the closest parent matching the selector (can by itself)\n */\nexport function getClosest(el: HTMLElement, selector: string): HTMLElement | null {\n    // When el is document or window, the matches does not exist\n    if (!el?.matches) {\n        return null;\n    }\n\n    let test: HTMLElement | null = el;\n\n    do {\n        if (test.matches(selector)) {\n            return test;\n        }\n        test = test.parentElement;\n    } while (test);\n\n    return null;\n}\n\n/**\n * Returns the first element of the event' composedPath\n */\nexport function getEventTarget(e: Event): HTMLElement | null {\n    return e?.composedPath()[0] as HTMLElement || null;\n}\n\n/**\n * Returns the first element of the event's composedPath matching the selector\n */\nexport function getMatchingTarget(e: Event, selector: string): HTMLElement | null {\n    if (!e) {\n        return null;\n    }\n    return e.composedPath().find((el) => {\n        if (!(el instanceof HTMLElement) && !(el instanceof SVGElement)) {\n            return false;\n        }\n\n        return el.matches(selector);\n    }) as HTMLElement;\n}\n\n/**\n * Gets the position of an element in the viewport without reflow\n * Will gives the same result as getBoundingClientRect() as soon as there are no CSS transforms\n */\nexport function getPosition(el: HTMLElement): Point {\n    let x = 0;\n    let y = 0;\n    let test: HTMLElement | null = el;\n\n    while (test) {\n        x += test.offsetLeft - test.scrollLeft + test.clientLeft;\n        y += test.offsetTop - test.scrollTop + test.clientTop;\n        test = test.offsetParent as HTMLElement;\n    }\n\n    x -= window.scrollX;\n    y -= window.scrollY;\n\n    return { x, y };\n}\n\n/**\n * Gets an element style value\n */\nexport function getStyleProperty(elt: Element, varname: string): string {\n    return window.getComputedStyle(elt).getPropertyValue(varname);\n}\n\nexport type TouchData = {\n    distance: number;\n    angle: number;\n    center: Point;\n};\n\n/**\n * Returns data about a touch event (first 2 fingers) : distance, angle, center\n */\nexport function getTouchData(e: TouchEvent): TouchData {\n    if (e.touches.length < 2) {\n        return null;\n    }\n\n    const p1 = { x: e.touches[0].clientX, y: e.touches[0].clientY };\n    const p2 = { x: e.touches[1].clientX, y: e.touches[1].clientY };\n\n    return {\n        distance: distance(p1, p2),\n        angle: angle(p1, p2),\n        center: { x: (p1.x + p2.x) / 2, y: (p1.y + p2.y) / 2 },\n    };\n}\n\nlet fullscreenElement: HTMLElement;\n\n/**\n * Detects if fullscreen is enabled\n */\nexport function isFullscreenEnabled(elt: HTMLElement, isIphone = false): boolean {\n    if (isIphone) {\n        return elt === fullscreenElement;\n    } else {\n        return document.fullscreenElement === elt;\n    }\n}\n\n/**\n * Enters fullscreen mode\n */\nexport function requestFullscreen(elt: HTMLElement, isIphone = false) {\n    if (isIphone) {\n        fullscreenElement = elt;\n        elt.classList.add('psv-fullscreen-emulation');\n        document.dispatchEvent(new Event('fullscreenchange'));\n    } else {\n        elt.requestFullscreen();\n    }\n}\n\n/**\n * Exits fullscreen mode\n */\nexport function exitFullscreen(isIphone = false) {\n    if (isIphone) {\n        fullscreenElement.classList.remove('psv-fullscreen-emulation');\n        fullscreenElement = null;\n        document.dispatchEvent(new Event('fullscreenchange'));\n    } else {\n        document.exitFullscreen();\n    }\n}\n\n/**\n * Simple keystroke matcher with modifiers support\n */\nexport function keyPressMatch(e: KeyboardEvent, pattern: string) {\n    let key: string;\n    let shift = false;\n    let ctrl = false;\n    let alt = false;\n    let meta = false;\n\n    if (pattern === '+') {\n        key = pattern;\n    } else {\n        pattern.split('+').forEach((p) => {\n            switch (p) {\n                case 'Shift':\n                    shift = true;\n                    break;\n                case 'Ctrl':\n                    ctrl = true;\n                    break;\n                case 'Alt':\n                    alt = true;\n                    break;\n                case 'Meta':\n                    meta = true;\n                    break;\n                case 'Space':\n                    key = ' ';\n                    break;\n                case 'Plus':\n                    key = '+';\n                    break;\n                case 'Minus':\n                    key = '-';\n                    break;\n                default:\n                    key = p;\n                    break;\n            }\n        });\n    }\n\n    return shift === e.shiftKey\n        && ctrl === e.ctrlKey\n        && alt === e.altKey\n        && meta === e.metaKey\n        && key === e.key;\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><g fill=\"currentColor\" transform=\" translate(50, 50) rotate(45)\"><rect x=\"-5\" y=\"-65\" width=\"10\" height=\"130\"/><rect x=\"-65\" y=\"-5\" width=\"130\" height=\"10\"/></g></svg>","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z\"/><path fill=\"currentColor\" d=\"M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z\"/><!--Created by Michael Zenaty from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z\"/><!--Created by Garrett Knoll from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z\"/><!--Created by Garrett Knoll from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"><path fill=\"currentColor\" d=\"M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z\"/><circle fill=\"currentColor\" cx=\"39.3\" cy=\"9.2\" r=\"8.2\"/><!--Created by Arafat Uddin from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"10 10 80 80\"><g fill=\"currentColor\"><circle r=\"10\" cx=\"20\" cy=\"20\"/><circle r=\"10\" cx=\"50\" cy=\"20\"/><circle r=\"10\" cx=\"80\" cy=\"20\"/><circle r=\"10\" cx=\"20\" cy=\"50\"/><circle r=\"10\" cx=\"50\" cy=\"50\"/><circle r=\"10\" cx=\"80\" cy=\"50\"/><circle r=\"10\" cx=\"20\" cy=\"80\"/><circle r=\"10\" cx=\"50\" cy=\"80\"/><circle r=\"10\" cx=\"80\" cy=\"80\"/></g><!-- Created by Richard Kunák from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z\"/><path fill=\"currentColor\" d=\"M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z\"/><!--Created by Ryan Canning from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path fill=\"currentColor\" d=\"M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z\"/><path fill=\"currentColor\" d=\"M4.006 6.746h7.459V8.73H4.006z\"/><!--Created by Ryan Canning from the Noun Project--></svg>\n","export * from './browser';\nexport * from './math';\nexport * from './misc';\nexport * from './psv';\n\nexport * from './Animation';\nexport * from './Dynamic';\nexport * from './MultiDynamic';\nexport * from './PressHandler';\nexport * from './Slider';\n","import { Point, Position } from '../model';\n\n/**\n * Ensures a value is within 0 and `max` by wrapping max to 0\n */\nexport function wrap(value: number, max: number): number {\n    let result = value % max;\n\n    if (result < 0) {\n        result += max;\n    }\n\n    return result;\n}\n\n/**\n * Computes the sum of an array\n */\nexport function sum(array: number[]): number {\n    return array.reduce((a, b) => a + b, 0);\n}\n\n/**\n * Computes the distance between two points\n */\nexport function distance(p1: Point, p2: Point): number {\n    return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n}\n\n/**\n * Computes the angle between two points\n */\nexport function angle(p1: Point, p2: Point): number {\n    return Math.atan2(p2.y - p1.y, p2.x - p1.x);\n}\n\n/**\n * Compute the shortest offset between two angles on a sphere\n */\nexport function getShortestArc(from: number, to: number): number {\n    const candidates = [\n        0, // direct\n        Math.PI * 2, // clock-wise cross zero\n        -Math.PI * 2, // counter-clock-wise cross zero\n    ];\n\n    return candidates.reduce((value, candidate) => {\n        const newCandidate = to - from + candidate;\n        return Math.abs(newCandidate) < Math.abs(value) ? newCandidate : value;\n    }, Infinity);\n}\n\n/**\n * Computes the angle between the current position and a target position\n */\nexport function getAngle(position1: Position, position2: Position): number {\n    return Math.acos(\n        Math.cos(position1.pitch)\n        * Math.cos(position2.pitch)\n        * Math.cos(position1.yaw - position2.yaw)\n        + Math.sin(position1.pitch)\n        * Math.sin(position2.pitch),\n    );\n}\n\n/**\n * Returns the distance between two points on a sphere of radius one\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n */\nexport function greatArcDistance([yaw1, pitch1]: [number, number], [yaw2, pitch2]: [number, number]): number {\n    // if yaw delta is > PI, apply an offset to only consider the shortest arc\n    if (yaw1 - yaw2 > Math.PI) {\n        yaw1 -= 2 * Math.PI;\n    } else if (yaw1 - yaw2 < -Math.PI) {\n        yaw1 += 2 * Math.PI;\n    }\n    const x = (yaw2 - yaw1) * Math.cos((pitch1 + pitch2) / 2);\n    const y = pitch2 - pitch1;\n    return Math.sqrt(x * x + y * y);\n}\n","/**\n * Transforms a string to dash-case\n * @see https://github.com/shahata/dasherize\n */\nexport function dasherize(str: string): string {\n    return str.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (s, i) => {\n        return (i > 0 ? '-' : '') + s.toLowerCase();\n    });\n}\n\n/**\n * Returns a function, that, when invoked, will only be triggered at most once during a given window of time.\n */\nexport function throttle<T extends (...args: any) => any>(callback: T, wait: number): (...args: Parameters<T>) => void {\n    let paused = false;\n    return function (this: any, ...args: Parameters<T>) {\n        if (!paused) {\n            paused = true;\n            setTimeout(() => {\n                callback.apply(this, args);\n                paused = false;\n            }, wait);\n        }\n    };\n}\n\n/**\n * Test if an object is a plain object\n * Test if an object is a plain object, i.e. is constructed by the built-in\n * Object constructor and inherits directly from Object.prototype or null.\n * @see https://github.com/lodash/lodash/blob/master/isPlainObject.js\n */\nexport function isPlainObject<T extends Record<string, any>>(value: any): value is T {\n    if (typeof value !== 'object' || value === null || Object.prototype.toString.call(value) !== '[object Object]') {\n        return false;\n    }\n    if (Object.getPrototypeOf(value) === null) {\n        return true;\n    }\n    let proto = value;\n    while (Object.getPrototypeOf(proto) !== null) {\n        proto = Object.getPrototypeOf(proto);\n    }\n    return Object.getPrototypeOf(value) === proto;\n}\n\n/**\n * Merges the enumerable attributes of two objects\n * Replaces arrays and alters the target object.\n * @copyright Nicholas Fisher <nfisher110@gmail.com>\n */\nexport function deepmerge<T>(target: T, src: T): T {\n    const first = src;\n\n    return (function merge(target: any, src: any) {\n        if (Array.isArray(src)) {\n            if (!target || !Array.isArray(target)) {\n                target = [];\n            } else {\n                target.length = 0;\n            }\n            src.forEach((e, i) => {\n                target[i] = merge(null, e);\n            });\n        } else if (typeof src === 'object') {\n            if (!target || Array.isArray(target)) {\n                target = {};\n            }\n            Object.keys(src).forEach((key) => {\n                if (key === '__proto__') {\n                    return;\n                }\n                if (typeof src[key] !== 'object' || !src[key] || !isPlainObject(src[key])) {\n                    target[key] = src[key];\n                } else if (src[key] !== first) {\n                    if (!target[key]) {\n                        target[key] = merge(null, src[key]);\n                    } else {\n                        merge(target[key], src[key]);\n                    }\n                }\n            });\n        } else {\n            target = src;\n        }\n\n        return target;\n    })(target, src);\n}\n\n/**\n * Deeply clones an object\n */\nexport function clone<T>(src: T): T {\n    return deepmerge(null as T, src);\n}\n\n/**\n * Tests of an object is empty\n */\nexport function isEmpty(obj: any): boolean {\n    return !obj || (Object.keys(obj).length === 0 && obj.constructor === Object);\n}\n\n/**\n * Returns if a valu is null or undefined\n */\nexport function isNil(val: any): val is null | undefined {\n    return val === null || val === undefined;\n}\n\n/**\n * Returns the first non null non undefined parameter\n */\nexport function firstNonNull<T>(...values: T[]): T | null {\n    for (const val of values) {\n        if (!isNil(val)) {\n            return val;\n        }\n    }\n\n    return null;\n}\n\n/**\n * Returns deep equality between objects\n * @see https://gist.github.com/egardner/efd34f270cc33db67c0246e837689cb9\n */\nexport function deepEqual(obj1: any, obj2: any): boolean {\n    if (obj1 === obj2) {\n        return true;\n    } else if (isObject(obj1) && isObject(obj2)) {\n        if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n            return false;\n        }\n        for (const prop of Object.keys(obj1)) {\n            if (!deepEqual(obj1[prop], obj2[prop])) {\n                return false;\n            }\n        }\n        return true;\n    } else {\n        return false;\n    }\n}\n\nfunction isObject(obj: any): boolean {\n    return typeof obj === 'object' && obj !== null;\n}\n","export class PSVError extends Error {\n    constructor(message: string, reason?: any) {\n        super(reason && reason instanceof Error ? `${message}: ${reason.message}` : message);\n        this.name = 'PSVError';\n        (Error as any).captureStackTrace?.(this, PSVError);\n    }\n}\n","import { Euler, LinearFilter, LinearMipmapLinearFilter, MathUtils, Quaternion, Texture, Vector3 } from 'three';\nimport { PSVError } from '../PSVError';\nimport { ExtendedPosition, PanoData, Point, ResolvableBoolean } from '../model';\nimport { getStyleProperty } from './browser';\nimport { wrap } from './math';\nimport { clone, firstNonNull, isPlainObject } from './misc';\n\n/**\n * Executes a callback with the value of a ResolvableBoolean\n */\nexport function resolveBoolean(value: boolean | ResolvableBoolean, cb: (val: boolean, init: boolean) => void) {\n    if (isPlainObject(value)) {\n        cb((value as ResolvableBoolean).initial, true);\n        (value as ResolvableBoolean).promise.then(res => cb(res, false));\n    } else {\n        cb(value as boolean, true);\n    }\n}\n\n/**\n * Inverts the result of a ResolvableBoolean\n */\nexport function invertResolvableBoolean(value: ResolvableBoolean): ResolvableBoolean {\n    return {\n        initial: !value.initial,\n        promise: value.promise.then(res => !res),\n    };\n}\n\n/**\n * Builds an Error with name 'AbortError'\n */\nexport function getAbortError(): Error {\n    const error = new Error('Loading was aborted.');\n    error.name = 'AbortError';\n    return error;\n}\n\n/**\n * Tests if an Error has name 'AbortError'\n */\nexport function isAbortError(err: Error): boolean {\n    return err?.name === 'AbortError';\n}\n\n/**\n * Displays a warning in the console with \"PhotoSphereViewer\" prefix\n */\nexport function logWarn(message: string) {\n    console.warn(`PhotoSphereViewer: ${message}`);\n}\n\n/**\n * Checks if an object is a ExtendedPosition, ie has textureX/textureY or yaw/pitch\n */\nexport function isExtendedPosition(object: any): object is ExtendedPosition {\n    if (!object || Array.isArray(object)) {\n        return false;\n    }\n    return [\n        ['textureX', 'textureY'],\n        ['yaw', 'pitch'],\n    ].some(([key1, key2]) => {\n        return object[key1] !== undefined && object[key2] !== undefined;\n    });\n}\n\n/**\n * Returns the value of a given attribute in the panorama metadata\n */\nexport function getXMPValue(data: string, attr: string, intVal = true): number | null {\n    // XMP data are stored in children\n    let result = data.match('<GPano:' + attr + '>(.*)</GPano:' + attr + '>');\n    if (result !== null) {\n        const val = intVal ? parseInt(result[1], 10) : parseFloat(result[1]);\n        return isNaN(val) ? null : val;\n    }\n\n    // XMP data are stored in attributes\n    result = data.match('GPano:' + attr + '=\"(.*?)\"');\n    if (result !== null) {\n        const val = intVal ? parseInt(result[1], 10) : parseFloat(result[1]);\n        return isNaN(val) ? null : val;\n    }\n\n    return null;\n}\n\nconst CSS_POSITIONS: Record<string, string> = {\n    top: '0%',\n    bottom: '100%',\n    left: '0%',\n    right: '100%',\n    center: '50%',\n};\nconst X_VALUES = ['left', 'center', 'right'];\nconst Y_VALUES = ['top', 'center', 'bottom'];\nconst POS_VALUES = [...X_VALUES, ...Y_VALUES];\nconst CENTER = 'center';\n\n/**\n * Translate CSS values like \"top center\" or \"10% 50%\" as top and left positions (0-1 range)\n * The implementation is as close as possible to the \"background-position\" specification\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}\n */\nexport function parsePoint(value: string | Point): Point {\n    if (!value) {\n        return { x: 0.5, y: 0.5 };\n    }\n\n    if (typeof value === 'object') {\n        return value;\n    }\n\n    let tokens = value.toLocaleLowerCase().split(' ').slice(0, 2);\n\n    if (tokens.length === 1) {\n        if (CSS_POSITIONS[tokens[0]]) {\n            tokens = [tokens[0], CENTER];\n        } else {\n            tokens = [tokens[0], tokens[0]];\n        }\n    }\n\n    const xFirst = tokens[1] !== 'left' && tokens[1] !== 'right' && tokens[0] !== 'top' && tokens[0] !== 'bottom';\n\n    tokens = tokens.map(token => CSS_POSITIONS[token] || token);\n\n    if (!xFirst) {\n        tokens.reverse();\n    }\n\n    const parsed = tokens.join(' ').match(/^([0-9.]+)% ([0-9.]+)%$/);\n\n    if (parsed) {\n        return {\n            x: parseFloat(parsed[1]) / 100,\n            y: parseFloat(parsed[2]) / 100,\n        };\n    } else {\n        return { x: 0.5, y: 0.5 };\n    }\n}\n\n/**\n * Parse a CSS-like position into an array of position keywords among top, bottom, left, right and center\n * @param value\n * @param [options]\n * @param [options.allowCenter=true] allow \"center center\"\n * @param [options.cssOrder=true] force CSS order (y axis then x axis)\n */\nexport function cleanCssPosition(\n    value: string | string[],\n    { allowCenter, cssOrder } = {\n        allowCenter: true,\n        cssOrder: true,\n    },\n): [string, string] | null {\n    if (!value) {\n        return null;\n    }\n\n    if (typeof value === 'string') {\n        value = value.split(' ');\n    }\n\n    if (value.length === 1) {\n        if (value[0] === CENTER) {\n            value = [CENTER, CENTER];\n        } else if (X_VALUES.indexOf(value[0]) !== -1) {\n            value = [CENTER, value[0]];\n        } else if (Y_VALUES.indexOf(value[0]) !== -1) {\n            value = [value[0], CENTER];\n        }\n    }\n\n    if (value.length !== 2 || POS_VALUES.indexOf(value[0]) === -1 || POS_VALUES.indexOf(value[1]) === -1) {\n        logWarn(`Unparsable position ${value}`);\n        return null;\n    }\n\n    if (!allowCenter && value[0] === CENTER && value[1] === CENTER) {\n        logWarn(`Invalid position center center`);\n        return null;\n    }\n\n    if (cssOrder && !cssPositionIsOrdered(value)) {\n        value = [value[1], value[0]];\n    }\n    if (value[1] === CENTER && X_VALUES.indexOf(value[0]) !== -1) {\n        value = [CENTER, value[0]];\n    }\n    if (value[0] === CENTER && Y_VALUES.indexOf(value[1]) !== -1) {\n        value = [value[1], CENTER];\n    }\n\n    return value as [string, string];\n}\n\n/**\n * Checks if an array of two positions is ordered (y axis then x axis)\n */\nexport function cssPositionIsOrdered(value: string[]): boolean {\n    return Y_VALUES.indexOf(value[0]) !== -1 && X_VALUES.indexOf(value[1]) !== -1;\n}\n\n/**\n * Parses an speed\n * @param speed in radians/degrees/revolutions per second/minute\n * @throws {@link PSVError} when the speed cannot be parsed\n */\nexport function parseSpeed(speed: string | number): number {\n    let parsed;\n\n    if (typeof speed === 'string') {\n        const speedStr = speed.toString().trim();\n\n        // Speed extraction\n        let speedValue = parseFloat(speedStr.replace(/^(-?[0-9]+(?:\\.[0-9]*)?).*$/, '$1'));\n        const speedUnit = speedStr.replace(/^-?[0-9]+(?:\\.[0-9]*)?(.*)$/, '$1').trim();\n\n        // \"per minute\" -> \"per second\"\n        if (speedUnit.match(/(pm|per minute)$/)) {\n            speedValue /= 60;\n        }\n\n        // Which unit?\n        switch (speedUnit) {\n            // Degrees per minute / second\n            case 'dpm':\n            case 'degrees per minute':\n            case 'dps':\n            case 'degrees per second':\n                parsed = MathUtils.degToRad(speedValue);\n                break;\n\n            // Radians per minute / second\n            case 'rdpm':\n            case 'radians per minute':\n            case 'rdps':\n            case 'radians per second':\n                parsed = speedValue;\n                break;\n\n            // Revolutions per minute / second\n            case 'rpm':\n            case 'revolutions per minute':\n            case 'rps':\n            case 'revolutions per second':\n                parsed = speedValue * Math.PI * 2;\n                break;\n\n            // Unknown unit\n            default:\n                throw new PSVError(`Unknown speed unit \"${speedUnit}\"`);\n        }\n    } else {\n        parsed = speed;\n    }\n\n    return parsed;\n}\n\n/**\n * Converts a speed into a duration for a specific angle to travel\n */\nexport function speedToDuration(value: string | number, angle: number): number {\n    if (typeof value !== 'number') {\n        // desired radial speed\n        const speed = parseSpeed(value);\n        // compute duration\n        return (angle / Math.abs(speed)) * 1000;\n    } else {\n        return Math.abs(value);\n    }\n}\n\n/**\n * Parses an angle value in radians or degrees and returns a normalized value in radians\n * @param angle - eg: 3.14, 3.14rad, 180deg\n * @param [zeroCenter=false] - normalize between -Pi - Pi instead of 0 - 2*Pi\n * @param [halfCircle=zeroCenter] - normalize between -Pi/2 - Pi/2 instead of -Pi - Pi\n * @throws {@link PSVError} when the angle cannot be parsed\n */\nexport function parseAngle(angle: string | number, zeroCenter = false, halfCircle = zeroCenter): number {\n    let parsed;\n\n    if (typeof angle === 'string') {\n        const match = angle\n            .toLowerCase()\n            .trim()\n            .match(/^(-?[0-9]+(?:\\.[0-9]*)?)(.*)$/);\n\n        if (!match) {\n            throw new PSVError(`Unknown angle \"${angle}\"`);\n        }\n\n        const value = parseFloat(match[1]);\n        const unit = match[2];\n\n        if (unit) {\n            switch (unit) {\n                case 'deg':\n                case 'degs':\n                    parsed = MathUtils.degToRad(value);\n                    break;\n                case 'rad':\n                case 'rads':\n                    parsed = value;\n                    break;\n                default:\n                    throw new PSVError(`Unknown angle unit \"${unit}\"`);\n            }\n        } else {\n            parsed = value;\n        }\n    } else if (typeof angle === 'number' && !isNaN(angle)) {\n        parsed = angle;\n    } else {\n        throw new PSVError(`Unknown angle \"${angle}\"`);\n    }\n\n    parsed = wrap(zeroCenter ? parsed + Math.PI : parsed, Math.PI * 2);\n\n    return zeroCenter\n        ? MathUtils.clamp(parsed - Math.PI, -Math.PI / (halfCircle ? 2 : 1), Math.PI / (halfCircle ? 2 : 1))\n        : parsed;\n}\n\n/**\n * Creates a THREE texture from an image\n */\nexport function createTexture(img: TexImageSource, mimaps = false): Texture {\n    const texture = new Texture(img);\n    texture.needsUpdate = true;\n    texture.minFilter = mimaps ? LinearMipmapLinearFilter : LinearFilter;\n    texture.generateMipmaps = mimaps;\n    texture.anisotropy = mimaps ? 2 : 1;\n    return texture;\n}\n\nconst quaternion = new Quaternion();\n\n/**\n * Applies the inverse of Euler angles to a vector\n */\nexport function applyEulerInverse(vector: Vector3, euler: Euler) {\n    quaternion.setFromEuler(euler).invert();\n    vector.applyQuaternion(quaternion);\n}\n\n/**\n * Declaration of configuration parsers, used by {@link getConfigParser}\n */\nexport type ConfigParsers<T, U extends T = T> = {\n    [key in keyof T]: (val: T[key], opts: { defValue: U[key]; rawConfig: T }) => U[key];\n};\n\n/**\n * Result of {@link getConfigParser}\n */\nexport type ConfigParser<T, U extends T> = {\n    (config: T): U;\n    defaults: Required<U>;\n    parsers: ConfigParsers<T, U>;\n};\n\n/**\n * Creates a function to validate an user configuration object\n *\n * @template T type of input config\n * @template U type of config after parsing\n *\n * @param defaults the default configuration\n * @param parsers function used to parse/validate the configuration\n *\n * @example\n * ```ts\n * type MyConfig = {\n *      value: number;\n *      label?: string;\n * };\n *\n * const getConfig<MyConfig>({\n *      value: 1,\n *      label: 'Title',\n * }, {\n *      value(value, { defValue }) {\n *          return value < 10 ? value : defValue;\n *      }\n * });\n *\n * const config = getConfig({ value: 3 });\n * ```\n */\nexport function getConfigParser<T extends Record<string, any>, U extends T = T>(\n    defaults: Required<U>,\n    parsers?: ConfigParsers<T, U>,\n): ConfigParser<T, U> {\n    const parser = function (userConfig: T): U {\n        const rawConfig: U = clone({\n            ...defaults,\n            ...userConfig,\n        });\n\n        const config: U = {} as U;\n\n        for (let [key, value] of Object.entries(rawConfig) as Array<[keyof T, any]>) {\n            if (parsers && key in parsers) {\n                value = parsers[key](value, {\n                    rawConfig: rawConfig,\n                    defValue: defaults[key],\n                });\n            } else if (!(key in defaults)) {\n                logWarn(`Unknown option ${key as string}`);\n                continue;\n            }\n\n            // @ts-ignore\n            config[key] = value;\n        }\n\n        return config;\n    } as ConfigParser<T, U>;\n\n    parser.defaults = defaults;\n    parser.parsers = parsers || ({} as any);\n\n    return parser;\n}\n\n/**\n * Checks if a stylesheet is loaded by the presence of a CSS variable\n */\nexport function checkStylesheet(element: HTMLElement, name: string) {\n    if (getStyleProperty(element, `--psv-${name}-loaded`) !== 'true') {\n        console.error(`PhotoSphereViewer: stylesheet \"@photo-sphere-viewer/${name}/index.css\" is not loaded`);\n    }\n}\n\n/**\n * Checks that a dependency version is the same as the core\n */\nexport function checkVersion(name: string, version: string, coreVersion: string) {\n    if (version && version !== coreVersion) {\n        console.error(`PhotoSphereViewer: @photo-sphere-viewer/${name} is in version ${version} but @photo-sphere-viewer/core is in version ${coreVersion}`);\n    }\n}\n\n/**\n * Checks if the viewer is not used insude a closed shadow DOM\n */\nexport function checkClosedShadowDom(el: Node) {\n    do {\n        if (el instanceof ShadowRoot && el.mode === 'closed') {\n            console.error(`PhotoSphereViewer: closed shadow DOM detected, the viewer might not work as expected`);\n            return;\n        }\n        el = el.parentNode;\n    } while (el);\n}\n\n/**\n * Merge XMP data with custom panoData, also apply default behaviour when data is missing\n */\nexport function mergePanoData(width: number, height: number, newPanoData?: PanoData, xmpPanoData?: PanoData): PanoData {\n    const panoData: PanoData = {\n        isEquirectangular: true,\n        fullWidth: firstNonNull(newPanoData?.fullWidth, xmpPanoData?.fullWidth),\n        fullHeight: firstNonNull(newPanoData?.fullHeight, xmpPanoData?.fullHeight),\n        croppedWidth: firstNonNull(newPanoData?.croppedWidth, xmpPanoData?.croppedWidth, width),\n        croppedHeight: firstNonNull(newPanoData?.croppedHeight, xmpPanoData?.croppedHeight, height),\n        croppedX: firstNonNull(newPanoData?.croppedX, xmpPanoData?.croppedX),\n        croppedY: firstNonNull(newPanoData?.croppedY, xmpPanoData?.croppedY),\n        poseHeading: firstNonNull(newPanoData?.poseHeading, xmpPanoData?.poseHeading, 0),\n        posePitch: firstNonNull(newPanoData?.posePitch, xmpPanoData?.posePitch, 0),\n        poseRoll: firstNonNull(newPanoData?.poseRoll, xmpPanoData?.poseRoll, 0),\n        initialHeading: xmpPanoData?.initialHeading,\n        initialPitch: xmpPanoData?.initialPitch,\n        initialFov: xmpPanoData?.initialFov,\n    };\n\n    // resize data if necessary\n    if (panoData.croppedWidth !== width) {\n        const ratio = width / panoData.croppedWidth;\n        ([\n            'fullWidth',\n            'fullHeight',\n            'croppedWidth',\n            'croppedHeight',\n            'croppedX',\n            'croppedY',\n        ] satisfies Array<keyof PanoData>).forEach((key) => {\n            if (panoData[key]) {\n                panoData[key] = Math.round(panoData[key] * ratio);\n            }\n        });\n    }\n\n    // construct missing data\n    if (!panoData.fullWidth && !panoData.fullHeight) {\n        panoData.fullWidth = Math.max(panoData.croppedWidth, panoData.croppedHeight * 2);\n        panoData.fullHeight = Math.round(panoData.fullWidth / 2);\n    }\n    if (!panoData.fullWidth) {\n        panoData.fullWidth = panoData.fullHeight * 2;\n    }\n    if (!panoData.fullHeight) {\n        panoData.fullHeight = Math.round(panoData.fullWidth / 2);\n    }\n    if (panoData.croppedX === null) {\n        panoData.croppedX = Math.round((panoData.fullWidth - width) / 2);\n    }\n    if (panoData.croppedY === null) {\n        panoData.croppedY = Math.round((panoData.fullHeight - height) / 2);\n    }\n\n    // sanity checks\n    if (Math.abs(panoData.fullWidth - panoData.fullHeight * 2) > 1) {\n        logWarn('Invalid panoData, fullWidth should be twice fullHeight');\n        panoData.fullHeight = Math.round(panoData.fullWidth / 2);\n    }\n    if (panoData.croppedX + panoData.croppedWidth > panoData.fullWidth) {\n        logWarn('Invalid panoData, croppedX + croppedWidth > fullWidth');\n        panoData.croppedX = panoData.fullWidth - panoData.croppedWidth;\n    }\n    if (panoData.croppedY + panoData.croppedHeight > panoData.fullHeight) {\n        logWarn('Invalid panoData, croppedY + croppedHeight > fullHeight');\n        panoData.croppedY = panoData.fullHeight - panoData.croppedHeight;\n    }\n    if (panoData.croppedX < 0) {\n        logWarn('Invalid panoData, croppedX < 0');\n        panoData.croppedX = 0;\n    }\n    if (panoData.croppedY < 0) {\n        logWarn('Invalid panoData, croppedY < 0');\n        panoData.croppedY = 0;\n    }\n\n    return panoData;\n}\n","import { type EASING, EASINGS } from '../data/constants';\n\n/**\n * Options for {@link Animation}\n */\nexport type AnimationOptions<T> = {\n    /**\n     * interpolated properties\n     */\n    properties: Partial<Record<keyof T, { start: number; end: number }>>;\n    /**\n     * duration of the animation\n     */\n    duration: number;\n    /**\n     * delay before start\n     * @default 0\n     */\n    delay?: number;\n    /**\n     * interpolation function, see {@link EASINGS}\n     * @default 'linear'\n     */\n    easing?: EASING | ((t: number) => number);\n    /**\n     * function called for each frame\n     */\n    onTick: (properties: Record<keyof T, number>, progress: number) => void;\n};\n\ntype PropertyValues = AnimationOptions<any>['properties']['k'];\n\n/**\n * Interpolation helper for animations\n *\n * Implements the Promise API with an additional \"cancel\" method.\n * The promise is resolved with `true` when the animation is completed and `false` if the animation is cancelled.\n * @template T the type of interpolated properties\n *\n * @example\n * ```ts\n * const anim = new Animation({\n *     properties: {\n *         width: {start: 100, end: 200}\n *     },\n *     duration: 5000,\n *     onTick: (properties) => element.style.width = `${properties.width}px`;\n * });\n *\n * anim.then((completed) => ...);\n *\n * anim.cancel();\n * ```\n */\nexport class Animation<T = any> implements PromiseLike<boolean> {\n    private options: AnimationOptions<T>;\n    private easing: (t: number) => number = EASINGS['linear'];\n    private callbacks: Array<(complete: boolean) => void> = [];\n    private start?: number;\n    private delayTimeout: ReturnType<typeof setTimeout>;\n    private animationFrame: ReturnType<typeof requestAnimationFrame>;\n\n    resolved = false;\n    cancelled = false;\n\n    constructor(options: AnimationOptions<T>) {\n        this.options = options;\n\n        if (options) {\n            if (options.easing) {\n                this.easing = typeof options.easing === 'function'\n                    ? options.easing\n                    : EASINGS[options.easing] || EASINGS['linear'];\n            }\n\n            this.delayTimeout = setTimeout(() => {\n                this.delayTimeout = undefined;\n                this.animationFrame = window.requestAnimationFrame(t => this.__run(t));\n            }, options.delay || 0);\n        } else {\n            this.resolved = true;\n        }\n    }\n\n    private __run(timestamp: number) {\n        if (this.cancelled) {\n            return;\n        }\n\n        // first iteration\n        if (!this.start) {\n            this.start = timestamp;\n        }\n\n        // compute progress\n        const progress = (timestamp - this.start) / this.options.duration;\n        const current = {} as Record<keyof T, number>;\n\n        if (progress < 1.0) {\n            // interpolate properties\n            for (const [name, prop] of Object.entries(this.options.properties) as Array<[string, PropertyValues]>) {\n                if (prop) {\n                    const value = prop.start + (prop.end - prop.start) * this.easing(progress);\n                    // @ts-ignore\n                    current[name] = value;\n                }\n            }\n            this.options.onTick(current, progress);\n\n            this.animationFrame = window.requestAnimationFrame(t => this.__run(t));\n        } else {\n            // call onTick one last time with final values\n            for (const [name, prop] of Object.entries(this.options.properties) as Array<[string, PropertyValues]>) {\n                if (prop) {\n                    // @ts-ignore\n                    current[name] = prop.end;\n                }\n            }\n            this.options.onTick(current, 1.0);\n\n            this.__resolve(true);\n            this.animationFrame = undefined;\n        }\n    }\n\n    private __resolve(value: boolean) {\n        if (value) {\n            this.resolved = true;\n        } else {\n            this.cancelled = true;\n        }\n        this.callbacks.forEach(cb => cb(value));\n        this.callbacks.length = 0;\n    }\n\n    /**\n     * Promise chaining\n     * @param [onFulfilled] - Called when the animation is complete (true) or cancelled (false)\n     */\n    then<U>(onFulfilled: (complete: boolean) => PromiseLike<U> | U): Promise<U> {\n        if (this.resolved || this.cancelled) {\n            return Promise.resolve(this.resolved).then(onFulfilled);\n        }\n\n        return new Promise((resolve: (complete: boolean) => void) => {\n            this.callbacks.push(resolve);\n        }).then(onFulfilled);\n    }\n\n    /**\n     * Cancels the animation\n     */\n    cancel() {\n        if (!this.cancelled && !this.resolved) {\n            this.__resolve(false);\n\n            if (this.delayTimeout) {\n                window.clearTimeout(this.delayTimeout);\n                this.delayTimeout = undefined;\n            }\n            if (this.animationFrame) {\n                window.cancelAnimationFrame(this.animationFrame);\n                this.animationFrame = undefined;\n            }\n        }\n    }\n}\n","import { MathUtils } from 'three';\nimport { PSVError } from '../PSVError';\nimport { wrap } from './math';\n\nconst enum DynamicMode {\n    STOP,\n    INFINITE,\n    POSITION,\n}\n\n/**\n * Represents a variable that can dynamically change with time (using requestAnimationFrame)\n */\nexport class Dynamic {\n    private readonly min: number;\n    private readonly max: number;\n    private readonly wrap: boolean;\n\n    private mode = DynamicMode.STOP;\n    private speed = 0;\n    private speedMult = 0;\n    private currentSpeed = 0;\n    private target = 0;\n    private __current = 0;\n\n    get current(): number {\n        return this.__current;\n    }\n\n    private set current(current: number) {\n        this.__current = current;\n    }\n\n    constructor(\n        private readonly fn: (val: number) => void,\n        config: {\n            min: number;\n            max: number;\n            defaultValue: number;\n            wrap: boolean;\n        },\n    ) {\n        this.min = config.min;\n        this.max = config.max;\n        this.wrap = config.wrap;\n        this.current = config.defaultValue;\n\n        if (this.wrap && this.min !== 0) {\n            throw new PSVError('invalid config');\n        }\n\n        if (this.fn) {\n            this.fn(this.current);\n        }\n    }\n\n    /**\n     * Changes base speed\n     */\n    setSpeed(speed: number) {\n        this.speed = speed;\n    }\n\n    /**\n     * Defines the target position\n     */\n    goto(position: number, speedMult = 1) {\n        this.mode = DynamicMode.POSITION;\n        this.target = this.wrap ? wrap(position, this.max) : MathUtils.clamp(position, this.min, this.max);\n        this.speedMult = speedMult;\n    }\n\n    /**\n     * Increases/decreases the target position\n     */\n    step(step: number, speedMult = 1) {\n        if (speedMult === 0) {\n            this.setValue(this.current + step);\n        } else {\n            if (this.mode !== DynamicMode.POSITION) {\n                this.target = this.current;\n            }\n            this.goto(this.target + step, speedMult);\n        }\n    }\n\n    /**\n     * Starts infinite movement\n     */\n    roll(invert = false, speedMult = 1) {\n        this.mode = DynamicMode.INFINITE;\n        this.target = invert ? -Infinity : Infinity;\n        this.speedMult = speedMult;\n    }\n\n    /**\n     * Stops movement\n     */\n    stop() {\n        this.mode = DynamicMode.STOP;\n    }\n\n    /**\n     * Defines the current position and immediately stops movement\n     * @param {number} value\n     */\n    setValue(value: number): boolean {\n        this.target = this.wrap ? wrap(value, this.max) : MathUtils.clamp(value, this.min, this.max);\n        this.mode = DynamicMode.STOP;\n        this.currentSpeed = 0;\n        if (this.target !== this.current) {\n            this.current = this.target;\n            if (this.fn) {\n                this.fn(this.current);\n            }\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * @internal\n     */\n    update(elapsed: number): boolean {\n        // in position mode switch to stop mode when in the decceleration window\n        if (this.mode === DynamicMode.POSITION) {\n            // in loop mode, alter \"current\" to avoid crossing the origin\n            if (this.wrap && Math.abs(this.target - this.current) > this.max / 2) {\n                this.current = this.current < this.target ? this.current + this.max : this.current - this.max;\n            }\n\n            const dstStop = (this.currentSpeed * this.currentSpeed) / (this.speed * this.speedMult * 4);\n            if (Math.abs(this.target - this.current) <= dstStop) {\n                this.mode = DynamicMode.STOP;\n            }\n        }\n\n        // compute speed\n        let targetSpeed = this.mode === DynamicMode.STOP ? 0 : this.speed * this.speedMult;\n        if (this.target < this.current) {\n            targetSpeed = -targetSpeed;\n        }\n        if (this.currentSpeed < targetSpeed) {\n            this.currentSpeed = Math.min(\n                targetSpeed,\n                this.currentSpeed + (elapsed / 1000) * this.speed * this.speedMult * 2,\n            );\n        } else if (this.currentSpeed > targetSpeed) {\n            this.currentSpeed = Math.max(\n                targetSpeed,\n                this.currentSpeed - (elapsed / 1000) * this.speed * this.speedMult * 2,\n            );\n        }\n\n        // compute new position\n        let next = null;\n        if (this.current > this.target && this.currentSpeed) {\n            next = Math.max(this.target, this.current + (this.currentSpeed * elapsed) / 1000);\n        } else if (this.current < this.target && this.currentSpeed) {\n            next = Math.min(this.target, this.current + (this.currentSpeed * elapsed) / 1000);\n        }\n\n        // apply value\n        if (next !== null) {\n            next = this.wrap ? wrap(next, this.max) : MathUtils.clamp(next, this.min, this.max);\n            if (next !== this.current) {\n                this.current = next;\n                if (this.fn) {\n                    this.fn(this.current);\n                }\n                return true;\n            }\n        }\n\n        return false;\n    }\n}\n","import { Dynamic } from './Dynamic';\n\n/**\n * Wrapper for multiple {@link Dynamic} evolving together\n */\nexport class MultiDynamic<T extends Record<string, Dynamic>> {\n    get current(): Record<keyof T, number> {\n        return Object.entries(this.dynamics).reduce(\n            (values, [name, dynamic]) => {\n                // @ts-ignore\n                values[name] = dynamic.current;\n                return values;\n            },\n            {} as Record<keyof T, number>,\n        );\n    }\n\n    constructor(\n        private readonly fn: (val: Record<keyof T, number>) => void,\n        private readonly dynamics: T,\n    ) {\n        if (this.fn) {\n            this.fn(this.current);\n        }\n    }\n\n    /**\n     * Changes base speed\n     */\n    setSpeed(speed: number) {\n        for (const d of Object.values(this.dynamics)) {\n            d.setSpeed(speed);\n        }\n    }\n\n    /**\n     * Defines the target positions\n     */\n    goto(positions: Partial<Record<keyof T, number>>, speedMult = 1) {\n        for (const [name, position] of Object.entries(positions)) {\n            this.dynamics[name].goto(position as number, speedMult);\n        }\n    }\n\n    /**\n     * Increase/decrease the target positions\n     */\n    step(steps: Partial<Record<keyof T, number>>, speedMult = 1) {\n        if (speedMult === 0) {\n            this.setValue(\n                Object.keys(steps).reduce(\n                    (values, name: keyof T) => {\n                        values[name] = steps[name] + this.dynamics[name].current;\n                        return values;\n                    },\n                    {} as typeof steps,\n                ),\n            );\n        } else {\n            for (const [name, step] of Object.entries(steps)) {\n                this.dynamics[name].step(step as number, speedMult);\n            }\n        }\n    }\n\n    /**\n     * Starts infinite movements\n     */\n    roll(rolls: Partial<Record<keyof T, boolean>>, speedMult = 1) {\n        for (const [name, roll] of Object.entries(rolls)) {\n            this.dynamics[name].roll(roll, speedMult);\n        }\n    }\n\n    /**\n     * Stops movements\n     */\n    stop() {\n        for (const d of Object.values(this.dynamics)) {\n            d.stop();\n        }\n    }\n\n    /**\n     * Defines the current positions and immediately stops movements\n     */\n    setValue(values: Partial<Record<keyof T, number>>): boolean {\n        let hasUpdates = false;\n\n        for (const [name, value] of Object.entries(values)) {\n            hasUpdates = this.dynamics[name].setValue(value as number) || hasUpdates;\n        }\n\n        if (hasUpdates && this.fn) {\n            this.fn(this.current);\n        }\n\n        return hasUpdates;\n    }\n\n    /**\n     * @internal\n     */\n    update(elapsed: number): boolean {\n        let hasUpdates = false;\n\n        for (const d of Object.values(this.dynamics)) {\n            hasUpdates = d.update(elapsed) || hasUpdates;\n        }\n\n        if (hasUpdates && this.fn) {\n            this.fn(this.current);\n        }\n\n        return hasUpdates;\n    }\n}\n","/**\n * Helper for pressable things (buttons, keyboard)\n * When the pressed thing goes up and was not pressed long enough, wait a bit more before execution\n * @internal\n */\nexport class PressHandler<TData = never> {\n    private time = 0;\n    private timeout: ReturnType<typeof setTimeout>;\n    private data: TData;\n\n    get pending() {\n        return this.time !== 0;\n    }\n\n    constructor(private readonly delay = 200) {\n        this.delay = delay;\n    }\n\n    down(data?: TData) {\n        if (this.timeout) {\n            clearTimeout(this.timeout);\n            this.timeout = undefined;\n        }\n\n        this.time = new Date().getTime();\n        this.data = data;\n    }\n\n    up(cb: (data: TData) => void) {\n        if (!this.time) {\n            return;\n        }\n\n        const elapsed = Date.now() - this.time;\n        if (elapsed < this.delay) {\n            this.timeout = setTimeout(() => {\n                cb(this.data);\n                this.timeout = undefined;\n                this.time = 0;\n                this.data = undefined;\n            }, this.delay);\n        } else {\n            cb(this.data);\n            this.time = 0;\n            this.data = undefined;\n        }\n    }\n}\n","import { MathUtils } from 'three';\n\n/**\n * Direction of a {@link Slider}\n */\nexport enum SliderDirection {\n    VERTICAL = 'VERTICAL',\n    HORIZONTAL = 'HORIZONTAL',\n}\n\n/**\n * Data transmitted to the {@link Slider} listener\n */\nexport type SliderUpdateData = {\n    /**\n     * slider progression for 0-1\n     */\n    readonly value: number;\n\n    /**\n     * the user clicked on the slider\n     */\n    readonly click: boolean;\n\n    /**\n     * the user moves the cursor above the slider, without click\n     */\n    readonly mouseover: boolean;\n\n    /**\n     * the user moves the cursor above the slider while maintaining click\n     */\n    readonly mousedown: boolean;\n\n    /**\n     * the cursor position on the page\n     */\n    readonly cursor: { clientX: number; clientY: number };\n};\n\n/**\n * Helper to make sliders elements\n */\nexport class Slider {\n    private mousedown = false;\n    private mouseover = false;\n\n    get isVertical() {\n        return this.direction === SliderDirection.VERTICAL;\n    }\n\n    get isHorizontal() {\n        return this.direction === SliderDirection.HORIZONTAL;\n    }\n\n    constructor(\n        /** main container of the sliding element */\n        private readonly container: HTMLElement,\n        /** direction of the slider */\n        private readonly direction: SliderDirection,\n        /** callback when the user interacts with the slider */\n        private readonly listener: (data: SliderUpdateData) => void,\n    ) {\n        this.container.addEventListener('click', this);\n        this.container.addEventListener('mousedown', this);\n        this.container.addEventListener('mouseenter', this);\n        this.container.addEventListener('mouseleave', this);\n        this.container.addEventListener('touchstart', this);\n        this.container.addEventListener('mousemove', this, true);\n        this.container.addEventListener('touchmove', this, true);\n        window.addEventListener('mouseup', this);\n        window.addEventListener('touchend', this);\n    }\n\n    destroy() {\n        window.removeEventListener('mouseup', this);\n        window.removeEventListener('touchend', this);\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case 'click': e.stopPropagation(); break;\n            case 'mousedown': this.__onMouseDown(e as MouseEvent); break;\n            case 'mouseenter': this.__onMouseEnter(e as MouseEvent); break;\n            case 'mouseleave': this.__onMouseLeave(e as MouseEvent); break;\n            case 'touchstart': this.__onTouchStart(e as TouchEvent); break;\n            case 'mousemove': this.__onMouseMove(e as MouseEvent); break;\n            case 'touchmove': this.__onTouchMove(e as TouchEvent); break;\n            case 'mouseup': this.__onMouseUp(e as MouseEvent); break;\n            case 'touchend': this.__onTouchEnd(e as TouchEvent); break;\n        }\n    }\n\n    private __onMouseDown(evt: MouseEvent) {\n        this.mousedown = true;\n        this.__update(evt.clientX, evt.clientY, true);\n    }\n\n    private __onMouseEnter(evt: MouseEvent) {\n        this.mouseover = true;\n        this.__update(evt.clientX, evt.clientY, true);\n    }\n\n    private __onTouchStart(evt: TouchEvent) {\n        this.mouseover = true;\n        this.mousedown = true;\n        const touch = evt.changedTouches[0];\n        this.__update(touch.clientX, touch.clientY, true);\n    }\n\n    private __onMouseMove(evt: MouseEvent) {\n        if (this.mousedown || this.mouseover) {\n            evt.stopPropagation();\n            this.__update(evt.clientX, evt.clientY, true);\n        }\n    }\n\n    private __onTouchMove(evt: TouchEvent) {\n        if (this.mousedown || this.mouseover) {\n            evt.stopPropagation();\n            const touch = evt.changedTouches[0];\n            this.__update(touch.clientX, touch.clientY, true);\n        }\n    }\n\n    private __onMouseUp(evt: MouseEvent) {\n        if (this.mousedown) {\n            this.mousedown = false;\n            this.__update(evt.clientX, evt.clientY, false);\n        }\n    }\n\n    private __onMouseLeave(evt: MouseEvent) {\n        if (this.mouseover) {\n            this.mouseover = false;\n            this.__update(evt.clientX, evt.clientY, true);\n        }\n    }\n\n    private __onTouchEnd(evt: TouchEvent) {\n        if (this.mousedown) {\n            this.mouseover = false;\n            this.mousedown = false;\n            const touch = evt.changedTouches[0];\n            this.__update(touch.clientX, touch.clientY, false);\n        }\n    }\n\n    private __update(clientX: number, clientY: number, moving: boolean) {\n        const boundingClientRect = this.container.getBoundingClientRect();\n\n        let val: number;\n        if (this.isVertical) {\n            val = MathUtils.clamp((boundingClientRect.bottom - clientY) / boundingClientRect.height, 0, 1);\n        } else {\n            val = MathUtils.clamp((clientX - boundingClientRect.left) / boundingClientRect.width, 0, 1);\n        }\n\n        this.listener({\n            value: val,\n            click: !moving,\n            mousedown: this.mousedown,\n            mouseover: this.mouseover,\n            cursor: { clientX, clientY },\n        });\n    }\n}\n","import { Mesh } from 'three';\nimport { Tooltip, TooltipConfig } from './components/Tooltip';\nimport { TypedEvent } from './lib/TypedEventTarget';\nimport { ClickData, Point, Position, Size, TextureData, ViewerConfig } from './model';\nimport type { Viewer } from './Viewer';\nimport { keyPressMatch } from './utils';\n\n/**\n * Base class for all events dispatched by {@link Viewer}\n */\nexport abstract class ViewerEvent extends TypedEvent<Viewer> {}\n\n/**\n * @event Triggered before an animation, can be cancelled\n */\nexport class BeforeAnimateEvent extends ViewerEvent {\n    static override readonly type = 'before-animate';\n    override type: 'before-animate';\n\n    /** @internal */\n    constructor(\n        /** target position, can be modified */\n        public position: Position | undefined,\n        /** target zoom level, can be modified */\n        public zoomLevel: number | undefined,\n    ) {\n        super(BeforeAnimateEvent.type, true);\n    }\n}\n\n/**\n * @event Triggered before a render\n */\nexport class BeforeRenderEvent extends ViewerEvent {\n    static override readonly type = 'before-render';\n    override type: 'before-render';\n\n    /** @internal */\n    constructor(\n        /** time provided by requestAnimationFrame */\n        public readonly timestamp: number,\n        /**  time elapsed since the previous frame */\n        public readonly elapsed: number,\n    ) {\n        super(BeforeRenderEvent.type);\n    }\n}\n\n/**\n * @event Triggered before a rotate operation, can be cancelled\n */\nexport class BeforeRotateEvent extends ViewerEvent {\n    static override readonly type = 'before-rotate';\n    override type: 'before-rotate';\n\n    /** @internal */\n    constructor(\n        /** target position, can be modified */\n        public position: Position,\n    ) {\n        super(BeforeRotateEvent.type, true);\n    }\n}\n\n/**\n * @event Triggered when the user clicks on the viewer (everywhere excluding the navbar and the side panel)\n */\nexport class ClickEvent extends ViewerEvent {\n    static override readonly type = 'click';\n    override type: 'click';\n\n    /** @internal */\n    constructor(public readonly data: ClickData) {\n        super(ClickEvent.type);\n    }\n}\n\n/**\n * @event Triggered when some options are changed\n */\nexport class ConfigChangedEvent extends ViewerEvent {\n    static override readonly type = 'config-changed';\n    override type: 'config-changed';\n\n    /** @internal */\n    constructor(public readonly options: Array<keyof ViewerConfig>) {\n        super(ConfigChangedEvent.type);\n    }\n\n    /**\n     * Checks if at least one of the `options` has been modified\n     */\n    containsOptions(...options: Array<keyof ViewerConfig>): boolean {\n        return options.some(option => this.options.includes(option));\n    }\n}\n\n/**\n * @event Triggered when the user double clicks on the viewer. The simple `click` event is always fired before `dblclick`.\n */\nexport class DoubleClickEvent extends ViewerEvent {\n    static override readonly type = 'dblclick';\n    override type: 'dblclick';\n\n    /** @internal */\n    constructor(public readonly data: ClickData) {\n        super(DoubleClickEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the fullscreen is enabled/disabled\n */\nexport class FullscreenEvent extends ViewerEvent {\n    static override readonly type = 'fullscreen';\n    override type: 'fullscreen';\n\n    /** @internal */\n    constructor(public readonly fullscreenEnabled: boolean) {\n        super(FullscreenEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the notification is hidden\n */\nexport class HideNotificationEvent extends ViewerEvent {\n    static override readonly type = 'hide-notification';\n    override type: 'hide-notification';\n\n    /** @internal */\n    constructor(public readonly notificationId?: string) {\n        super(HideNotificationEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the overlay is hidden\n */\nexport class HideOverlayEvent extends ViewerEvent {\n    static override readonly type = 'hide-overlay';\n    override type: 'hide-overlay';\n\n    /** @internal */\n    constructor(public readonly overlayId?: string) {\n        super(HideOverlayEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the panel is hidden\n */\nexport class HidePanelEvent extends ViewerEvent {\n    static override readonly type = 'hide-panel';\n    override type: 'hide-panel';\n\n    /** @internal */\n    constructor(public readonly panelId?: string) {\n        super(HidePanelEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a tooltip is hidden\n */\nexport class HideTooltipEvent extends ViewerEvent {\n    static override readonly type = 'hide-tooltip';\n    override type: 'hide-tooltip';\n\n    /** @internal */\n    constructor(\n        /** Userdata associated to the tooltip */\n        public readonly tooltipData: TooltipConfig['data'],\n    ) {\n        super(HideTooltipEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a key is pressed, can be cancelled\n */\nexport class KeypressEvent extends ViewerEvent {\n    static override readonly type = 'key-press';\n    override type: 'key-press';\n\n    /** @internal */\n    constructor(public readonly key: string, public readonly originalEvent: KeyboardEvent) {\n        super(KeypressEvent.type, true);\n    }\n\n    /**\n     * Checks if the key events matches the given pattern\n     */\n    matches(pattern: string): boolean {\n        return keyPressMatch(this.originalEvent, pattern);\n    }\n}\n\n/**\n * @event Triggered when the loader value changes\n */\nexport class LoadProgressEvent extends ViewerEvent {\n    static override readonly type = 'load-progress';\n    override type: 'load-progress';\n\n    /** @internal */\n    constructor(public readonly progress: number) {\n        super(LoadProgressEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a panorama image starts loading\n */\nexport class PanoramaLoadEvent extends ViewerEvent {\n    static override readonly type = 'panorama-load';\n    override type: 'panorama-load';\n\n    /** @internal */\n    constructor(public readonly panorama: any) {\n        super(PanoramaLoadEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a panorama image has been loaded\n */\nexport class PanoramaLoadedEvent extends ViewerEvent {\n    static override readonly type = 'panorama-loaded';\n    override type: 'panorama-loaded';\n\n    /** @internal */\n    constructor(public readonly data: TextureData) {\n        super(PanoramaLoadedEvent.type);\n    }\n}\n\n/**\n * @event Triggered when an error occured when loading the panorama\n */\nexport class PanoramaErrorEvent extends ViewerEvent {\n    static override readonly type = 'panorama-error';\n    override type: 'panorama-error';\n\n    /** @internal */\n    constructor(\n        public readonly panorama: any,\n        public readonly error: Error,\n    ) {\n        super(PanoramaErrorEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the transition to a new panorama is done (complete or not)\n */\nexport class TransitionDoneEvent extends ViewerEvent {\n    static override readonly type = 'transition-done';\n    override type: 'transition-done';\n\n    /** @internal */\n    constructor(public readonly completed: boolean) {\n        super(TransitionDoneEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the view angles change\n */\nexport class PositionUpdatedEvent extends ViewerEvent {\n    static override readonly type = 'position-updated';\n    override type: 'position-updated';\n\n    /** @internal */\n    constructor(public readonly position: Position) {\n        super(PositionUpdatedEvent.type);\n    }\n}\n\n/**\n * @event Triggered when camera roll change\n */\nexport class RollUpdatedEvent extends ViewerEvent {\n    static override readonly type = 'roll-updated';\n    override type: 'roll-updated';\n\n    /** @internal */\n    constructor(public readonly roll: number) {\n        super(RollUpdatedEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the panorama image has been loaded and the viewer is ready to perform the first render\n */\nexport class ReadyEvent extends ViewerEvent {\n    static override readonly type = 'ready';\n    override type: 'ready';\n\n    /** @internal */\n    constructor() {\n        super(ReadyEvent.type);\n    }\n}\n\n/**\n * @event Triggered on each viewer render\n */\nexport class RenderEvent extends ViewerEvent {\n    static override readonly type = 'render';\n    override type: 'render';\n\n    /** @internal */\n    constructor() {\n        super(RenderEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the notification is shown\n */\nexport class ShowNotificationEvent extends ViewerEvent {\n    static override readonly type = 'show-notification';\n    override type: 'show-notification';\n\n    /** @internal */\n    constructor(public readonly notificationId?: string) {\n        super(ShowNotificationEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the overlay is shown\n */\nexport class ShowOverlayEvent extends ViewerEvent {\n    static override readonly type = 'show-overlay';\n    override type: 'show-overlay';\n\n    /** @internal */\n    constructor(public readonly overlayId?: string) {\n        super(ShowOverlayEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the panel is shown\n */\nexport class ShowPanelEvent extends ViewerEvent {\n    static override readonly type = 'show-panel';\n    override type: 'show-panel';\n\n    /** @internal */\n    constructor(public readonly panelId?: string) {\n        super(ShowPanelEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a tooltip is shown\n */\nexport class ShowTooltipEvent extends ViewerEvent {\n    static override readonly type = 'show-tooltip';\n    override type: 'show-tooltip';\n\n    /** @internal */\n    constructor(\n        /** Instance of the tooltip */\n        public readonly tooltip: Tooltip,\n        /** Userdata associated to the tooltip */\n        public readonly tooltipData?: TooltipConfig['data'],\n    ) {\n        super(ShowTooltipEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the viewer size changes\n */\nexport class SizeUpdatedEvent extends ViewerEvent {\n    static override readonly type = 'size-updated';\n    override type: 'size-updated';\n\n    /** @internal */\n    constructor(public readonly size: Size) {\n        super(SizeUpdatedEvent.type);\n    }\n}\n\n/**\n * @event Triggered when all current animations are stopped\n */\nexport class StopAllEvent extends ViewerEvent {\n    static override readonly type = 'stop-all';\n    override type: 'stop-all';\n\n    /** @internal */\n    constructor() {\n        super(StopAllEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the viewer zoom changes\n */\nexport class ZoomUpdatedEvent extends ViewerEvent {\n    static override readonly type = 'zoom-updated';\n    override type: 'zoom-updated';\n\n    /** @internal */\n    constructor(public readonly zoomLevel: number) {\n        super(ZoomUpdatedEvent.type);\n    }\n}\n\n/**\n * Base class for events on three.js objects\n *\n * Note: {@link Viewer#observeObjects} must be called for these events to be dispatched\n */\nexport abstract class ObjectEvent extends ViewerEvent {\n    /** @internal */\n    constructor(\n        type: string,\n        public readonly originalEvent: MouseEvent,\n        public readonly object: Mesh<any, any>,\n        public readonly viewerPoint: Point,\n        public readonly userDataKey: string,\n    ) {\n        super(type);\n    }\n}\n\n/**\n * @event Triggered when the cursor enters an object in the scene\n *\n * Note: {@link Viewer#observeObjects} must be called for this event to be dispatched\n */\nexport class ObjectEnterEvent extends ObjectEvent {\n    static override readonly type = 'enter-object';\n    override type: 'enter-object';\n\n    /** @internal */\n    constructor(originalEvent: MouseEvent, object: Mesh, viewerPoint: Point, userDataKey: string) {\n        super(ObjectEnterEvent.type, originalEvent, object, viewerPoint, userDataKey);\n    }\n}\n\n/**\n * @event Triggered when the cursor leaves an object in the scene\n *\n * Note: {@link Viewer#observeObjects} must be called for this event to be dispatched\n */\nexport class ObjectLeaveEvent extends ObjectEvent {\n    static override readonly type = 'leave-object';\n    override type: 'leave-object';\n\n    /** @internal */\n    constructor(originalEvent: MouseEvent, object: Mesh, viewerPoint: Point, userDataKey: string) {\n        super(ObjectLeaveEvent.type, originalEvent, object, viewerPoint, userDataKey);\n    }\n}\n\n/**\n * @event Triggered when the cursor moves over an object in the scene\n *\n * Note: {@link Viewer#observeObjects} must be called for this event to be dispatched\n */\nexport class ObjectHoverEvent extends ObjectEvent {\n    static override readonly type = 'hover-object';\n    override type: 'hover-object';\n\n    /** @internal */\n    constructor(originalEvent: MouseEvent, object: Mesh, viewerPoint: Point, userDataKey: string) {\n        super(ObjectHoverEvent.type, originalEvent, object, viewerPoint, userDataKey);\n    }\n}\n\nexport type ViewerEvents =\n    | BeforeAnimateEvent\n    | BeforeRenderEvent\n    | BeforeRotateEvent\n    | ClickEvent\n    | ConfigChangedEvent\n    | DoubleClickEvent\n    | FullscreenEvent\n    | HideNotificationEvent\n    | HideOverlayEvent\n    | HidePanelEvent\n    | HideTooltipEvent\n    | KeypressEvent\n    | LoadProgressEvent\n    | PanoramaLoadEvent\n    | PanoramaLoadedEvent\n    | PanoramaErrorEvent\n    | TransitionDoneEvent\n    | PositionUpdatedEvent\n    | RollUpdatedEvent\n    | ReadyEvent\n    | RenderEvent\n    | ShowNotificationEvent\n    | ShowOverlayEvent\n    | ShowPanelEvent\n    | ShowTooltipEvent\n    | SizeUpdatedEvent\n    | StopAllEvent\n    | ZoomUpdatedEvent\n    | ObjectEnterEvent\n    | ObjectLeaveEvent\n    | ObjectHoverEvent;\n","/**\n * Base class for events dispatched by {@link TypedEventTarget}\n * @template TTarget type of the event target\n */\nexport abstract class TypedEvent<TTarget extends TypedEventTarget<any>> extends Event {\n    static readonly type: string;\n\n    override target: TTarget;\n\n    constructor(type: string, cancelable = false) {\n        super(type, { cancelable });\n    }\n}\n\n/**\n * Decorator for EventTarget allowing to strongly type events and listeners\n * @see https://rjzaworski.com/2021/06/event-target-with-typescript\n * @template TEvents union of dispatched events\n */\nexport class TypedEventTarget<TEvents extends TypedEvent<any>> extends EventTarget {\n    override dispatchEvent(e: TEvents): boolean {\n        return super.dispatchEvent(e);\n    }\n\n    /**\n     * @template T the name of event\n     * @template E the class of the event\n     */\n    override addEventListener<T extends TEvents['type'], E extends TEvents & { type: T }>(\n        type: T,\n        callback: ((e: E) => void) | EventListenerObject | null,\n        options?: AddEventListenerOptions | boolean,\n    ) {\n        super.addEventListener(type, callback as any, options);\n    }\n\n    /**\n     * @template T the name of event\n     * @template E the class of the event\n     */\n    override removeEventListener<T extends TEvents['type'], E extends TEvents & { type: T }>(\n        type: TEvents['type'],\n        callback: ((e: E) => void) | EventListenerObject | null,\n        options?: EventListenerOptions | boolean,\n    ) {\n        super.removeEventListener(type, callback as any, options);\n    }\n}\n","import { Object3D } from 'three';\nimport { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { PanoData, PanoDataProvider, PanoramaPosition, Position, TextureData } from '../model';\nimport { checkVersion } from '../utils';\n\n/**\n * Base class for adapters\n * @template TPanorama type of the panorama object\n * @template TData type of the panorama metadata\n * @template TTexture type of the loaded texture\n * @template TMesh type of the mesh\n */\nexport abstract class AbstractAdapter<TPanorama, TData, TTexture, TMesh extends Object3D> {\n    /**\n     * Unique identifier of the adapter\n     */\n    static readonly id: string;\n    /**\n     * Expected version of the core\n     * DO NOT USE on custom adapters\n     */\n    static readonly VERSION: string;\n\n    /**\n     * Indicates if the adapter supports panorama download natively\n     */\n    static readonly supportsDownload: boolean = false;\n\n    constructor(protected readonly viewer: Viewer) {}\n\n    /**\n     * Initializes the adapter\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    init(): void {}\n\n    /**\n     * Destroys the adapter\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    destroy(): void {}\n\n    /**\n     * Indicates if the adapter supports transitions between panoramas\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    supportsTransition(panorama: TPanorama): boolean {\n        return false;\n    }\n\n    /**\n     * Indicates if the adapter supports preload of a panorama\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    supportsPreload(panorama: TPanorama): boolean {\n        return false;\n    }\n\n    /**\n     * Converts pixel texture coordinates to spherical radians coordinates\n     * @throws {@link PSVError} when the current adapter does not support texture coordinates\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    textureCoordsToSphericalCoords(point: PanoramaPosition, data: TData): Position {\n        throw new PSVError('Current adapter does not support texture coordinates.');\n    }\n\n    /**\n     * Converts spherical radians coordinates to pixel texture coordinates\n     * @throws {@link PSVError} when the current adapter does not support texture coordinates\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    sphericalCoordsToTextureCoords(position: Position, data: TData): PanoramaPosition {\n        throw new PSVError('Current adapter does not support texture coordinates.');\n    }\n\n    /**\n     * Loads the panorama texture\n     */\n    abstract loadTexture(\n        panorama: TPanorama,\n        loader?: boolean,\n        newPanoData?: PanoData | PanoDataProvider,\n        useXmpPanoData?: boolean\n    ): Promise<TextureData<TTexture, TPanorama, TData>>;\n\n    /**\n     * Creates the mesh\n     */\n    abstract createMesh(panoData: TData): TMesh;\n\n    /**\n     * Applies the texture to the mesh\n     */\n    abstract setTexture(mesh: TMesh, textureData: TextureData<TTexture, TPanorama, TData>, transition: boolean): void;\n\n    /**\n     * Changes the opacity of the mesh\n     */\n    abstract setTextureOpacity(mesh: TMesh, opacity: number): void;\n\n    /**\n     * Clear a loaded texture from memory\n     */\n    abstract disposeTexture(textureData: TextureData<TTexture, TPanorama, TData>): void;\n\n    /**\n     * Cleanup a mesh from memory\n     */\n    abstract disposeMesh(mesh: TMesh): void;\n}\n\nexport type AdapterConstructor = (new (viewer: Viewer, config?: any) => AbstractAdapter<any, any, any, any>);\n\n/**\n * Returns the adapter constructor from the imported object\n * @internal\n */\nexport function adapterInterop(adapter: any): AdapterConstructor & typeof AbstractAdapter {\n    if (adapter) {\n        for (const [, p] of [['_', adapter], ...Object.entries(adapter)]) {\n            if (p.prototype instanceof AbstractAdapter) {\n                checkVersion(p.id, p.VERSION, PKG_VERSION);\n                return p;\n            }\n        }\n    }\n    return null;\n}\n","import { ResolvableBoolean } from '../model';\nimport { PSVError } from '../PSVError';\nimport { VIEWER_DATA } from './constants';\n\nconst LOCALSTORAGE_TOUCH_SUPPORT = `${VIEWER_DATA}_touchSupport`;\n\n/**\n * General information about the system\n */\nexport const SYSTEM = {\n    /**\n     * Indicates if the system data has been loaded\n     */\n    loaded: false,\n\n    /**\n     * Device screen pixel ratio\n     */\n    pixelRatio: 1,\n\n    /**\n     * Device supports WebGL\n     */\n    isWebGLSupported: false,\n\n    /**\n     * Maximum WebGL texture width\n     */\n    maxTextureWidth: 0,\n\n    /**\n     * Device supports touch events\n     */\n    isTouchEnabled: null as ResolvableBoolean,\n\n    /**\n     * @internal\n     */\n    __maxCanvasWidth: null as number | null,\n\n    /**\n     * If the current device is an iPhone\n     */\n    isIphone: false,\n\n    /**\n     * Maximum canvas width\n     */\n    get maxCanvasWidth(): number {\n        if (this.__maxCanvasWidth === null) {\n            this.__maxCanvasWidth = getMaxCanvasWidth(this.maxTextureWidth);\n        }\n        return this.__maxCanvasWidth;\n    },\n\n    /**\n     * Loads the system if not already loaded\n     * @internal\n     */\n    load() {\n        if (!this.loaded) {\n            const ctx = getWebGLCtx();\n\n            this.pixelRatio = window.devicePixelRatio || 1;\n            this.isWebGLSupported = !!ctx;\n            this.maxTextureWidth = ctx ? ctx.getParameter(ctx.MAX_TEXTURE_SIZE) : 0;\n            this.isTouchEnabled = isTouchEnabled();\n            this.isIphone = /iPhone/i.test(navigator.userAgent);\n            this.loaded = true;\n        }\n\n        if (!SYSTEM.isWebGLSupported) {\n            throw new PSVError('WebGL 2 is not supported.');\n        }\n        if (SYSTEM.maxTextureWidth === 0) {\n            throw new PSVError('Unable to detect system capabilities');\n        }\n    },\n};\n\n/**\n * Tries to return a canvas webgl context\n */\nfunction getWebGLCtx(): WebGLRenderingContext | null {\n    try {\n        const canvas = document.createElement('canvas');\n        return canvas.getContext('webgl2');\n    } catch {\n        return null;\n    }\n}\n\n/**\n * Detects if the user is using a touch screen\n */\nfunction isTouchEnabled(): ResolvableBoolean {\n    let initial = 'ontouchstart' in window || navigator.maxTouchPoints > 0;\n    if (LOCALSTORAGE_TOUCH_SUPPORT in localStorage) {\n        initial = localStorage[LOCALSTORAGE_TOUCH_SUPPORT] === 'true';\n    }\n\n    const promise = new Promise<boolean>((resolve) => {\n        const clear = () => {\n            window.removeEventListener('mousedown', listenerMouse);\n            window.removeEventListener('touchstart', listenerTouch);\n            clearTimeout(listenerTimeoutId);\n        };\n\n        const listenerMouse = () => {\n            clear();\n            localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = false;\n            resolve(false);\n        };\n\n        const listenerTouch = () => {\n            clear();\n            localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = true;\n            resolve(true);\n        };\n\n        const listenerTimeout = () => {\n            clear();\n            localStorage[LOCALSTORAGE_TOUCH_SUPPORT] = initial;\n            resolve(initial);\n        };\n\n        window.addEventListener('mousedown', listenerMouse, false);\n        window.addEventListener('touchstart', listenerTouch, false);\n        const listenerTimeoutId = setTimeout(listenerTimeout, 10000);\n    });\n\n    return { initial, promise };\n}\n\n/**\n * Gets max canvas width supported by the browser.\n * We only test powers of 2 and height = width / 2 because that's what we need to generate WebGL textures\n * Adapted from https://github.com/jhildenbiddle/canvas-size\n */\nfunction getMaxCanvasWidth(maxWidth: number): number {\n    let width = maxWidth;\n    let pass = false;\n\n    // use 1x1 canvas to reduce the time for getImageData to complete\n    const cropCanvas = document.createElement('canvas');\n    const cropCtx = cropCanvas.getContext('2d');\n    cropCanvas.width = 1;\n    cropCanvas.height = 1;\n\n    while (width > 1024 && !pass) {\n        const testCanvas = document.createElement('canvas');\n        const testCtx = testCanvas.getContext('2d');\n        testCanvas.width = width;\n        testCanvas.height = width / 2;\n\n        try {\n            testCtx.fillStyle = 'white';\n            testCtx.fillRect(width - 1, width / 2 - 1, 1, 1);\n\n            cropCtx.drawImage(testCanvas, width - 1, width / 2 - 1, 1, 1, 0, 0, 1, 1);\n\n            if (cropCtx.getImageData(0, 0, 1, 1).data[0] > 0) {\n                pass = true;\n            }\n        } catch {\n            // continue\n        }\n\n        // Release canvas elements (Safari memory usage fix)\n        // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n        testCanvas.width = 0;\n        testCanvas.height = 0;\n\n        if (!pass) {\n            width /= 2;\n        }\n    }\n\n    if (pass) {\n        return width;\n    } else {\n        throw new PSVError('Unable to detect system capabilities');\n    }\n}\n","import { MathUtils, Mesh, MeshBasicMaterial, SphereGeometry, Texture } from 'three';\nimport { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { SPHERE_RADIUS } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { EquirectangularPanorama, PanoData, PanoDataProvider, PanoramaPosition, Position, TextureData } from '../model';\nimport { createTexture, getConfigParser, getXMPValue, isNil, mergePanoData } from '../utils';\nimport { AbstractAdapter, AdapterConstructor } from './AbstractAdapter';\n\n/**\n * Configuration for {@link EquirectangularAdapter}\n */\nexport type EquirectangularAdapterConfig = {\n    /**\n     * number of faces of the sphere geometry, higher values may decrease performances\n     * @default 64\n     */\n    resolution?: number;\n    /**\n     * read real image size from XMP data\n     * @default true\n     */\n    useXmpData?: boolean;\n    /**\n     * used for equirectangular tiles adapter\n     * @internal\n     */\n    blur?: boolean;\n};\n\nexport type EquirectangularMesh = Mesh<SphereGeometry, MeshBasicMaterial>;\nexport type EquirectangularTextureData = TextureData<Texture, string | EquirectangularPanorama, PanoData>;\n\nconst getConfig = getConfigParser<EquirectangularAdapterConfig>(\n    {\n        resolution: 64,\n        useXmpData: true,\n        blur: false,\n    },\n    {\n        resolution: (resolution) => {\n            if (!resolution || !MathUtils.isPowerOfTwo(resolution)) {\n                throw new PSVError('EquirectangularAdapter resolution must be power of two.');\n            }\n            return resolution;\n        },\n    },\n);\n\n/**\n * Adapter for equirectangular panoramas\n */\nexport class EquirectangularAdapter extends AbstractAdapter<string | EquirectangularPanorama, PanoData, Texture, EquirectangularMesh> {\n    static override readonly id: string = 'equirectangular';\n    static override readonly VERSION = PKG_VERSION;\n    static override readonly supportsDownload: boolean = true;\n\n    private readonly config: EquirectangularAdapterConfig;\n\n    // @internal\n    public readonly SPHERE_SEGMENTS: number;\n    // @internal\n    public readonly SPHERE_HORIZONTAL_SEGMENTS: number;\n\n    static withConfig(config: EquirectangularAdapterConfig): [AdapterConstructor, any] {\n        return [EquirectangularAdapter, config];\n    }\n\n    constructor(viewer: Viewer, config?: EquirectangularAdapterConfig) {\n        super(viewer);\n\n        this.config = getConfig(config);\n\n        this.SPHERE_SEGMENTS = this.config.resolution;\n        this.SPHERE_HORIZONTAL_SEGMENTS = this.SPHERE_SEGMENTS / 2;\n    }\n\n    override supportsTransition() {\n        return true;\n    }\n\n    override supportsPreload() {\n        return true;\n    }\n\n    override textureCoordsToSphericalCoords(point: PanoramaPosition, data: PanoData): Position {\n        if (isNil(point.textureX) || isNil(point.textureY)) {\n            throw new PSVError(`Texture position is missing 'textureX' or 'textureY'`);\n        }\n\n        const relativeX = ((point.textureX + data.croppedX) / data.fullWidth) * Math.PI * 2;\n        const relativeY = ((point.textureY + data.croppedY) / data.fullHeight) * Math.PI;\n\n        return {\n            yaw: relativeX >= Math.PI ? relativeX - Math.PI : relativeX + Math.PI,\n            pitch: Math.PI / 2 - relativeY,\n        };\n    }\n\n    override sphericalCoordsToTextureCoords(position: Position, data: PanoData): PanoramaPosition {\n        const relativeLong = (position.yaw / Math.PI / 2) * data.fullWidth;\n        const relativeLat = (position.pitch / Math.PI) * data.fullHeight;\n\n        let textureX = Math.round(position.yaw < Math.PI ? relativeLong + data.fullWidth / 2 : relativeLong - data.fullWidth / 2) - data.croppedX;\n        let textureY = Math.round(data.fullHeight / 2 - relativeLat) - data.croppedY;\n\n        if (textureX < 0 || textureX > data.croppedWidth || textureY < 0 || textureY > data.croppedHeight) {\n            textureX = textureY = undefined;\n        }\n\n        return { textureX, textureY };\n    }\n\n    async loadTexture(\n        panorama: string | EquirectangularPanorama,\n        loader = true,\n        newPanoData?: PanoData | PanoDataProvider,\n        useXmpPanoData = this.config.useXmpData,\n    ): Promise<EquirectangularTextureData> {\n        if (typeof panorama !== 'string' && (typeof panorama !== 'object' || !panorama.path)) {\n            return Promise.reject(new PSVError('Invalid panorama url, are you using the right adapter?'));\n        }\n\n        let cleanPanorama: EquirectangularPanorama;\n        if (typeof panorama === 'string') {\n            cleanPanorama = {\n                path: panorama,\n                data: newPanoData,\n            };\n        } else {\n            cleanPanorama = {\n                data: newPanoData,\n                ...panorama,\n            };\n        }\n\n        const blob = await this.viewer.textureLoader.loadFile(\n            cleanPanorama.path,\n            loader ? p => this.viewer.textureLoader.dispatchProgress(p) : null,\n            cleanPanorama.path,\n        );\n        const xmpPanoData = useXmpPanoData ? await this.loadXMP(blob) : null;\n        const img = await this.viewer.textureLoader.blobToImage(blob);\n\n        if (typeof cleanPanorama.data === 'function') {\n            cleanPanorama.data = cleanPanorama.data(img, xmpPanoData);\n        }\n\n        const panoData = mergePanoData(img.width, img.height, cleanPanorama.data, xmpPanoData);\n\n        const texture = this.createEquirectangularTexture(img);\n\n        return {\n            panorama,\n            texture,\n            panoData,\n            cacheKey: cleanPanorama.path,\n        };\n    }\n\n    /**\n     * Loads the XMP data of an image\n     */\n    private async loadXMP(blob: Blob): Promise<PanoData> {\n        const binary = await this.loadBlobAsString(blob);\n\n        const a = binary.indexOf('<x:xmpmeta');\n        if (a === -1) {\n            return null;\n        }\n\n        const b = binary.indexOf('</x:xmpmeta>', a);\n        if (b === -1) {\n            return null;\n        }\n\n        const data = binary.substring(a, b);\n        if (!data.includes('GPano:')) {\n            return null;\n        }\n\n        return {\n            fullWidth: getXMPValue(data, 'FullPanoWidthPixels'),\n            fullHeight: getXMPValue(data, 'FullPanoHeightPixels'),\n            croppedWidth: getXMPValue(data, 'CroppedAreaImageWidthPixels'),\n            croppedHeight: getXMPValue(data, 'CroppedAreaImageHeightPixels'),\n            croppedX: getXMPValue(data, 'CroppedAreaLeftPixels'),\n            croppedY: getXMPValue(data, 'CroppedAreaTopPixels'),\n            poseHeading: getXMPValue(data, 'PoseHeadingDegrees', false),\n            posePitch: getXMPValue(data, 'PosePitchDegrees', false),\n            poseRoll: getXMPValue(data, 'PoseRollDegrees', false),\n            initialHeading: getXMPValue(data, 'InitialViewHeadingDegrees', false),\n            initialPitch: getXMPValue(data, 'InitialViewPitchDegrees', false),\n            initialFov: getXMPValue(data, 'InitialHorizontalFOVDegrees', false),\n        };\n    }\n\n    /**\n     * Reads a Blob as a string\n     */\n    private loadBlobAsString(blob: Blob): Promise<string> {\n        return new Promise((resolve, reject) => {\n            const reader = new FileReader();\n            reader.onload = () => resolve(reader.result as string);\n            reader.onerror = reject;\n            reader.readAsText(blob);\n        });\n    }\n\n    /**\n     * Creates the final texture from image and panorama data\n     */\n    private createEquirectangularTexture(img: HTMLImageElement): Texture {\n        if (this.config.blur || img.width > SYSTEM.maxTextureWidth) {\n            const ratio = Math.min(1, SYSTEM.maxCanvasWidth / img.width);\n\n            const buffer = new OffscreenCanvas(Math.floor(img.width * ratio), Math.floor(img.height * ratio));\n\n            const ctx = buffer.getContext('2d');\n\n            if (this.config.blur) {\n                ctx.filter = `blur(${buffer.width / 2048}px)`;\n            }\n\n            ctx.drawImage(img, 0, 0, buffer.width, buffer.height);\n\n            return createTexture(buffer);\n        }\n\n        return createTexture(img);\n    }\n\n    createMesh(panoData: PanoData): EquirectangularMesh {\n        const hStart = (panoData.croppedX / panoData.fullWidth) * 2 * Math.PI;\n        const hLength = (panoData.croppedWidth / panoData.fullWidth) * 2 * Math.PI;\n        const vStart = (panoData.croppedY / panoData.fullHeight) * Math.PI;\n        const vLength = (panoData.croppedHeight / panoData.fullHeight) * Math.PI;\n\n        // The middle of the panorama is placed at yaw=0\n        const geometry = new SphereGeometry(\n            SPHERE_RADIUS,\n            Math.round((this.SPHERE_SEGMENTS / (2 * Math.PI)) * hLength),\n            Math.round((this.SPHERE_HORIZONTAL_SEGMENTS / Math.PI) * vLength),\n            -Math.PI / 2 + hStart,\n            hLength,\n            vStart,\n            vLength,\n        ).scale(-1, 1, 1);\n\n        const material = new MeshBasicMaterial({ depthTest: false, depthWrite: false });\n\n        return new Mesh(geometry, material);\n    }\n\n    setTexture(mesh: EquirectangularMesh, textureData: EquirectangularTextureData) {\n        mesh.material.map = textureData.texture;\n    }\n\n    setTextureOpacity(mesh: EquirectangularMesh, opacity: number) {\n        mesh.material.opacity = opacity;\n        mesh.material.transparent = opacity < 1;\n    }\n\n    disposeTexture({ texture }: EquirectangularTextureData) {\n        texture.dispose();\n    }\n\n    disposeMesh(mesh: EquirectangularMesh) {\n        mesh.geometry.dispose();\n        mesh.material.dispose();\n    }\n}\n","import { BufferAttribute, Mesh, MeshBasicMaterial, SphereGeometry } from 'three';\nimport { type Viewer } from '../Viewer';\nimport { SPHERE_RADIUS } from '../data/constants';\nimport { EquirectangularAdapter, EquirectangularMesh, EquirectangularTextureData } from './EquirectangularAdapter';\nimport { AdapterConstructor } from './AbstractAdapter';\n\nexport type DualFisheyeAdapterConfig = {\n    /**\n     * number of faces of the sphere geometry, higher values may decrease performances\n     * @default 64\n     */\n    resolution?: number;\n};\n\n/**\n * @see https://github.com/acalcutt/Gear360_html5_viewer\n */\nexport class DualFisheyeAdapter extends EquirectangularAdapter {\n    static override readonly id: string = 'dual-fisheye';\n    static override readonly VERSION = PKG_VERSION;\n\n    static override withConfig(config: DualFisheyeAdapterConfig): [AdapterConstructor, any] {\n        return [DualFisheyeAdapter, config];\n    }\n\n    constructor(viewer: Viewer, config?: DualFisheyeAdapterConfig) {\n        super(viewer, {\n            resolution: config?.resolution ?? 64,\n            useXmpData: false,\n        });\n    }\n\n    override async loadTexture(panorama: string, loader?: boolean): Promise<EquirectangularTextureData> {\n        const result = await super.loadTexture(panorama, loader, null, false);\n        result.panoData = null;\n        return result;\n    }\n\n    override createMesh(): EquirectangularMesh {\n        const geometry = new SphereGeometry(\n            SPHERE_RADIUS,\n            this.SPHERE_SEGMENTS,\n            this.SPHERE_HORIZONTAL_SEGMENTS,\n        )\n            .scale(-1, 1, 1)\n            .toNonIndexed() as SphereGeometry;\n\n        const uvs = geometry.getAttribute('uv') as BufferAttribute;\n        const normals = geometry.getAttribute('normal') as BufferAttribute;\n\n        for (let i = 0; i < uvs.count; i++) {\n            for (let j = 0; j < 3; j++) {\n                const index = i * 3 + j;\n\n                const x = normals.getX(index);\n                const y = normals.getY(index);\n                const z = normals.getZ(index);\n\n                const c = 0.947;\n                if (i < uvs.count / 6) {\n                    const correction = (x === 0 && z === 0) ? 1 : (Math.acos(y) / Math.sqrt(x * x + z * z)) * (2 / Math.PI);\n                    uvs.setXY(index,\n                        x * (c / 4) * correction + (1 / 4),\n                        z * (c / 2) * correction + (1 / 2),\n                    );\n                } else {\n                    const correction = (x === 0 && z === 0) ? 1 : (Math.acos(-y) / Math.sqrt(x * x + z * z)) * (2 / Math.PI);\n                    uvs.setXY(index,\n                        -x * (c / 4) * correction + (3 / 4),\n                        z * (c / 2) * correction + (1 / 2),\n                    );\n                }\n            }\n        }\n\n        geometry.rotateX(-Math.PI / 2);\n        geometry.rotateY(Math.PI);\n\n        const material = new MeshBasicMaterial({ depthTest: false, depthWrite: false });\n\n        return new Mesh(geometry, material);\n    }\n}\n","import type { Viewer } from '../Viewer';\n\n/**\n * Base class for UI components\n */\nexport abstract class AbstractComponent {\n    /**\n     * Reference to main controller\n     */\n    protected readonly viewer: Viewer;\n\n    /**\n     * All child components\n     * @internal\n     */\n    readonly children: AbstractComponent[] = [];\n\n    /**\n     * Container element\n     */\n    readonly container: HTMLElement;\n\n    /**\n     * Internal properties\n     * @internal\n     */\n    protected readonly state = {\n        visible: true,\n    };\n\n    constructor(\n        protected readonly parent: Viewer | AbstractComponent,\n        config: { className?: string; tagName?: string },\n    ) {\n        this.viewer = parent instanceof AbstractComponent ? parent.viewer : parent;\n\n        this.container = document.createElement(config.tagName ?? 'div');\n        this.container.className = config.className || '';\n\n        this.parent.children.push(this);\n        this.parent.container.appendChild(this.container);\n    }\n\n    /**\n     * Destroys the component\n     */\n    destroy() {\n        this.parent.container.removeChild(this.container);\n\n        const childIdx = this.parent.children.indexOf(this);\n        if (childIdx !== -1) {\n            this.parent.children.splice(childIdx, 1);\n        }\n\n        this.children.slice().forEach(child => child.destroy());\n        this.children.length = 0;\n    }\n\n    /**\n     * Displays or hides the component\n     */\n    toggle(visible = !this.isVisible()) {\n        if (!visible) {\n            this.hide();\n        } else {\n            this.show();\n        }\n    }\n\n    /**\n     * Hides the component\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    hide(options?: any) {\n        this.container.style.display = 'none';\n        this.state.visible = false;\n    }\n\n    /**\n     * Displays the component\n     */\n    // @ts-ignore unused parameter\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    show(options?: any) {\n        this.container.style.display = '';\n        this.state.visible = true;\n    }\n\n    /**\n     * Checks if the component is visible\n     */\n    isVisible(): boolean {\n        return this.state.visible;\n    }\n}\n","import { AbstractComponent } from '../components/AbstractComponent';\nimport type { Navbar } from '../components/Navbar';\nimport { KEY_CODES } from '../data/constants';\nimport { ResolvableBoolean } from '../model';\nimport { addClasses, getConfigParser, resolveBoolean, toggleClass } from '../utils';\n\n/**\n * Configuration for {@link AbstractButton}\n */\nexport type ButtonConfig = {\n    id?: string;\n    tagName?: string;\n    className?: string;\n    title?: string;\n    /**\n     * if the button has an mouse hover effect\n     * @default false\n     */\n    hoverScale?: boolean;\n    /**\n     * if the button can be moved to menu when the navbar is too small\n     * @default false\n     */\n    collapsable?: boolean;\n    /**\n     * if the button is accessible with the keyboard\n     * @default true\n     */\n    tabbable?: boolean;\n    /**\n     * icon of the button\n     */\n    icon?: string;\n    /**\n     * override icon when the button is active\n     */\n    iconActive?: string;\n};\n\nconst getConfig = getConfigParser<ButtonConfig>({\n    id: null,\n    tagName: null,\n    className: null,\n    title: null,\n    hoverScale: false,\n    collapsable: false,\n    tabbable: true,\n    icon: null,\n    iconActive: null,\n});\n\n/**\n * Base class for navbar buttons\n */\nexport abstract class AbstractButton extends AbstractComponent {\n    /**\n     * Unique identifier of the button\n     */\n    static readonly id: string;\n\n    /**\n     * Identifier to declare a group of buttons\n     */\n    static readonly groupId?: string;\n\n    /**\n     * Internal properties\n     */\n    protected override readonly state = {\n        visible: true,\n        enabled: true,\n        supported: true,\n        collapsed: false,\n        active: false,\n        width: 0,\n    };\n\n    protected readonly config: ButtonConfig;\n\n    get id(): string {\n        return this.config.id;\n    }\n\n    get title(): string {\n        return this.container.title;\n    }\n\n    get content(): string {\n        return this.container.innerHTML;\n    }\n\n    get width(): number {\n        return this.state.width;\n    }\n\n    get collapsable(): boolean {\n        return this.config.collapsable;\n    }\n\n    constructor(navbar: Navbar, config: ButtonConfig) {\n        super(navbar, {\n            tagName: config.tagName,\n            className: `psv-button ${config.hoverScale ? 'psv-button--hover-scale' : ''} ${config.className || ''}`,\n        });\n\n        this.config = getConfig(config);\n        if (!config.id) {\n            this.config.id = (this.constructor as typeof AbstractButton).id;\n        }\n\n        if (config.icon) {\n            this.__setIcon(config.icon);\n        }\n\n        this.state.width = this.container.offsetWidth;\n\n        if (this.config.title) {\n            this.container.title = this.viewer.config.lang[this.config.title] ?? this.config.title;\n        } else if (this.id && this.id in this.viewer.config.lang) {\n            this.container.title = (this.viewer.config.lang as any)[this.id];\n        }\n\n        if (config.tabbable) {\n            this.container.tabIndex = 0;\n        }\n\n        this.container.addEventListener('click', (e) => {\n            if (this.state.enabled) {\n                this.onClick();\n            }\n            e.stopPropagation();\n        });\n\n        this.container.addEventListener('keydown', (e) => {\n            if (e.key === KEY_CODES.Enter && this.state.enabled) {\n                this.onClick();\n                e.stopPropagation();\n            }\n        });\n    }\n\n    /**\n     * Action when the button is clicked\n     */\n    abstract onClick(): void;\n\n    override show(refresh = true) {\n        if (!this.isVisible()) {\n            this.state.visible = true;\n            if (!this.state.collapsed) {\n                this.container.style.display = '';\n            }\n            if (refresh) {\n                this.viewer.navbar.autoSize();\n            }\n        }\n    }\n\n    override hide(refresh = true) {\n        if (this.isVisible()) {\n            this.state.visible = false;\n            this.container.style.display = 'none';\n            if (refresh) {\n                this.viewer.navbar.autoSize();\n            }\n        }\n    }\n\n    /**\n     * Hides/shows the button depending of the result of {@link isSupported}\n     * @internal\n     */\n    checkSupported() {\n        resolveBoolean(this.isSupported(), (supported, init) => {\n            if (!this.state) {\n                return; // the component has been destroyed\n            }\n            this.state.supported = supported;\n            if (!init) {\n                this.toggle(supported);\n            } else if (!supported) {\n                this.hide();\n            }\n        });\n    }\n\n    /**\n     * Perform action when the navbar size/content changes\n     * @internal\n     */\n    autoSize() {\n        // nothing\n    }\n\n    /**\n     * Checks if the button can be displayed\n     */\n    isSupported(): boolean | ResolvableBoolean {\n        return true;\n    }\n\n    /**\n     * Changes the active state of the button\n     */\n    toggleActive(active = !this.state.active) {\n        if (active !== this.state.active) {\n            this.state.active = active;\n            toggleClass(this.container, 'psv-button--active', this.state.active);\n\n            if (this.config.iconActive) {\n                this.__setIcon(this.state.active ? this.config.iconActive : this.config.icon);\n            }\n        }\n    }\n\n    /**\n     * Disables the button\n     */\n    disable() {\n        this.container.classList.add('psv-button--disabled');\n        this.state.enabled = false;\n    }\n\n    /**\n     * Enables the button\n     */\n    enable() {\n        this.container.classList.remove('psv-button--disabled');\n        this.state.enabled = true;\n    }\n\n    /**\n     * Collapses the button in the navbar menu\n     */\n    collapse() {\n        this.state.collapsed = true;\n        this.container.style.display = 'none';\n    }\n\n    /**\n     * Uncollapses the button from the navbar menu\n     */\n    uncollapse() {\n        this.state.collapsed = false;\n        if (this.state.visible) {\n            this.container.style.display = '';\n        }\n    }\n\n    private __setIcon(icon: string) {\n        this.container.innerHTML = icon;\n        addClasses(this.container.querySelector('svg'), 'psv-button-svg');\n    }\n}\n\nexport type ButtonConstructor = (new (navbar: Navbar) => AbstractButton) & typeof AbstractButton;\n","import type { Navbar } from '../components/Navbar';\nimport { NavbarCustomButton } from '../model';\nimport { AbstractButton } from './AbstractButton';\n\nexport class CustomButton extends AbstractButton {\n    private readonly customOnClick: NavbarCustomButton['onClick'];\n\n    constructor(navbar: Navbar, config: NavbarCustomButton) {\n        super(navbar, {\n            id: config.id ?? `psvButton-${Math.random().toString(36).substring(2)}`,\n            className: `psv-custom-button ${config.className || ''}`,\n            hoverScale: false,\n            collapsable: config.collapsable !== false,\n            tabbable: config.tabbable !== false,\n            title: config.title,\n        });\n\n        this.customOnClick = config.onClick;\n\n        if (config.content) {\n            if (typeof config.content === 'string') {\n                this.container.innerHTML = config.content;\n            } else {\n                this.container.classList.add('psv-custom-button--no-padding');\n                config.content.style.height = '100%';\n                config.content.attachViewer?.(this.viewer);\n                this.container.appendChild(config.content);\n            }\n        }\n\n        this.state.width = this.container.offsetWidth;\n\n        if (config.disabled) {\n            this.disable();\n        }\n\n        if (config.visible === false) {\n            this.hide();\n        }\n    }\n\n    onClick() {\n        this.customOnClick?.(this.viewer);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { ICONS, IDS } from '../data/constants';\nimport {\n    ConfigChangedEvent,\n    HideNotificationEvent,\n    HidePanelEvent,\n    ShowNotificationEvent,\n    ShowPanelEvent,\n} from '../events';\nimport { AbstractButton } from './AbstractButton';\n\nconst enum DescriptionButtonMode {\n    NONE,\n    NOTIF,\n    PANEL,\n}\n\nexport class DescriptionButton extends AbstractButton {\n    static override readonly id = 'description';\n\n    private mode = DescriptionButtonMode.NONE;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-description-button',\n            hoverScale: true,\n            collapsable: false,\n            tabbable: true,\n            icon: ICONS.info,\n        });\n\n        this.viewer.addEventListener(HideNotificationEvent.type, this);\n        this.viewer.addEventListener(ShowNotificationEvent.type, this);\n        this.viewer.addEventListener(HidePanelEvent.type, this);\n        this.viewer.addEventListener(ShowPanelEvent.type, this);\n        this.viewer.addEventListener(ConfigChangedEvent.type, this);\n    }\n\n    override destroy() {\n        this.viewer.removeEventListener(HideNotificationEvent.type, this);\n        this.viewer.removeEventListener(ShowNotificationEvent.type, this);\n        this.viewer.removeEventListener(HidePanelEvent.type, this);\n        this.viewer.removeEventListener(ShowPanelEvent.type, this);\n        this.viewer.removeEventListener(ConfigChangedEvent.type, this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof ConfigChangedEvent) {\n            e.containsOptions('description') && this.autoSize(true);\n            return;\n        }\n\n        if (!this.mode) {\n            return;\n        }\n\n        let closed = false;\n        if (e instanceof HideNotificationEvent) {\n            closed = this.mode === DescriptionButtonMode.NOTIF;\n        } else if (e instanceof ShowNotificationEvent) {\n            closed = this.mode === DescriptionButtonMode.NOTIF && e.notificationId !== IDS.DESCRIPTION;\n        } else if (e instanceof HidePanelEvent) {\n            closed = this.mode === DescriptionButtonMode.PANEL;\n        } else if (e instanceof ShowPanelEvent) {\n            closed = this.mode === DescriptionButtonMode.PANEL && e.panelId !== IDS.DESCRIPTION;\n        }\n\n        if (closed) {\n            this.toggleActive(false);\n            this.mode = DescriptionButtonMode.NONE;\n        }\n    }\n\n    onClick() {\n        if (this.mode) {\n            this.__close();\n        } else {\n            this.__open();\n        }\n    }\n\n    override hide(refresh?: boolean) {\n        super.hide(refresh);\n\n        if (this.mode) {\n            this.__close();\n        }\n    }\n\n    /**\n     * This button can only be refreshed from NavbarCaption\n     * @internal\n     */\n    override autoSize(refresh = false) {\n        if (refresh) {\n            const caption = this.viewer.navbar.getButton('caption', false);\n            const captionHidden = caption && !caption.isVisible();\n            const hasDescription = !!this.viewer.config.description;\n\n            if (captionHidden || hasDescription) {\n                this.show(false);\n            } else {\n                this.hide(false);\n            }\n        }\n    }\n\n    private __close() {\n        switch (this.mode) {\n            case DescriptionButtonMode.NOTIF:\n                this.viewer.notification.hide(IDS.DESCRIPTION);\n                break;\n            case DescriptionButtonMode.PANEL:\n                this.viewer.panel.hide(IDS.DESCRIPTION);\n                break;\n            default:\n        }\n    }\n\n    private __open() {\n        this.toggleActive(true);\n\n        if (this.viewer.config.description) {\n            this.mode = DescriptionButtonMode.PANEL;\n            this.viewer.panel.show({\n                id: IDS.DESCRIPTION,\n                content: `${this.viewer.config.caption ? `<p>${this.viewer.config.caption}</p>` : ''}${this.viewer.config.description}`,\n            });\n        } else {\n            this.mode = DescriptionButtonMode.NOTIF;\n            this.viewer.notification.show({\n                id: IDS.DESCRIPTION,\n                content: this.viewer.config.caption,\n            });\n        }\n    }\n}\n","import { AbstractAdapter } from '../adapters/AbstractAdapter';\nimport type { Navbar } from '../components/Navbar';\nimport { ICONS } from '../data/constants';\nimport { ConfigChangedEvent, PanoramaLoadedEvent } from '../events';\nimport { AbstractButton } from './AbstractButton';\n\nexport class DownloadButton extends AbstractButton {\n    static override readonly id = 'download';\n\n    readonly link: HTMLAnchorElement;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            tagName: 'a',\n            className: 'psv-download-button',\n            hoverScale: true,\n            collapsable: true,\n            tabbable: true,\n            icon: ICONS.download,\n        });\n\n        this.viewer.addEventListener(ConfigChangedEvent.type, this);\n        this.viewer.addEventListener(PanoramaLoadedEvent.type, this);\n    }\n\n    override destroy(): void {\n        this.viewer.removeEventListener(ConfigChangedEvent.type, this);\n        this.viewer.removeEventListener(PanoramaLoadedEvent.type, this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof ConfigChangedEvent) {\n            e.containsOptions('downloadUrl') && this.checkSupported();\n            e.containsOptions('downloadUrl', 'downloadName') && this.__update();\n        } else if (e instanceof PanoramaLoadedEvent) {\n            this.__update();\n        }\n    }\n\n    onClick() {\n        // nothing\n    }\n\n    override checkSupported() {\n        const adapter = this.viewer.adapter.constructor as typeof AbstractAdapter;\n        const supported = adapter.supportsDownload || this.viewer.config.downloadUrl;\n        if (supported) {\n            this.show();\n        } else {\n            this.hide();\n        }\n    }\n\n    private __update() {\n        const link = this.container as HTMLAnchorElement;\n        link.href = this.viewer.config.downloadUrl || this.viewer.config.panorama;\n        link.target = '_blank';\n        if (link.href.startsWith('data:') && !this.viewer.config.downloadName) {\n            link.download = 'panorama.' + link.href.substring(0, link.href.indexOf(';')).split('/').pop();\n        } else {\n            link.download = this.viewer.config.downloadName || link.href.split('/').pop();\n        }\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { FullscreenEvent } from '../events';\nimport { AbstractButton } from './AbstractButton';\nimport { ICONS } from '../data/constants';\n\nexport class FullscreenButton extends AbstractButton {\n    static override readonly id = 'fullscreen';\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-fullscreen-button',\n            hoverScale: true,\n            collapsable: false,\n            tabbable: true,\n            icon: ICONS.fullscreenIn,\n            iconActive: ICONS.fullscreenOut,\n        });\n\n        this.viewer.addEventListener(FullscreenEvent.type, this);\n    }\n\n    override destroy() {\n        this.viewer.removeEventListener(FullscreenEvent.type, this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof FullscreenEvent) {\n            this.toggleActive(e.fullscreenEnabled);\n        }\n    }\n\n    onClick() {\n        this.viewer.toggleFullscreen();\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { ICONS, IDS } from '../data/constants';\nimport { HidePanelEvent, ShowPanelEvent } from '../events';\nimport { getClosest } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\nconst BUTTON_DATA = 'psvButton';\n\nconst MENU_TEMPLATE = (buttons: AbstractButton[], title: string) => `\n<div class=\"psv-panel-menu psv-panel-menu--stripped\">\n  <h1 class=\"psv-panel-menu-title\">${ICONS.menu} ${title}</h1>\n  <ul class=\"psv-panel-menu-list\">\n    ${buttons\n        .map(\n            button => `\n    <li data-psv-button=\"${button.id}\" class=\"psv-panel-menu-item\" tabindex=\"0\">\n      <span class=\"psv-panel-menu-item-icon\">${button.content}</span>\n      <span class=\"psv-panel-menu-item-label\">${button.title}</span>\n    </li>\n    `,\n        )\n        .join('')}\n  </ul>\n</div>\n`;\n\nexport class MenuButton extends AbstractButton {\n    static override readonly id = 'menu';\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-menu-button',\n            hoverScale: true,\n            collapsable: false,\n            tabbable: true,\n            icon: ICONS.menu,\n        });\n\n        this.viewer.addEventListener(ShowPanelEvent.type, this);\n        this.viewer.addEventListener(HidePanelEvent.type, this);\n\n        super.hide();\n    }\n\n    override destroy() {\n        this.viewer.removeEventListener(ShowPanelEvent.type, this);\n        this.viewer.removeEventListener(HidePanelEvent.type, this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof ShowPanelEvent) {\n            this.toggleActive(e.panelId === IDS.MENU);\n        } else if (e instanceof HidePanelEvent) {\n            this.toggleActive(false);\n        }\n    }\n\n    onClick() {\n        if (this.state.active) {\n            this.__hideMenu();\n        } else {\n            this.__showMenu();\n        }\n    }\n\n    override hide(refresh?: boolean) {\n        super.hide(refresh);\n        this.__hideMenu();\n    }\n\n    override show(refresh?: boolean) {\n        super.show(refresh);\n\n        if (this.state.active) {\n            this.__showMenu();\n        }\n    }\n\n    private __showMenu() {\n        this.viewer.panel.show({\n            id: IDS.MENU,\n            content: MENU_TEMPLATE(this.viewer.navbar.collapsed, this.viewer.config.lang.menu),\n            noMargin: true,\n            clickHandler: (target) => {\n                const li = target ? getClosest(target as HTMLElement, '.psv-panel-menu-item') : undefined;\n                const buttonId = li ? li.dataset[BUTTON_DATA] : undefined;\n\n                if (buttonId) {\n                    this.viewer.navbar.getButton(buttonId).onClick();\n                    this.__hideMenu();\n                }\n            },\n        });\n    }\n\n    private __hideMenu() {\n        this.viewer.panel.hide(IDS.MENU);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { ICONS, KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { invertResolvableBoolean } from '../utils';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\nexport const enum MoveButtonDirection {\n    UP,\n    DOWN,\n    LEFT,\n    RIGHT,\n}\n\nfunction getIcon(value: MoveButtonDirection): string {\n    let angle = 0;\n    switch (value) {\n        case MoveButtonDirection.UP: angle = 90; break;\n        case MoveButtonDirection.DOWN: angle = -90; break;\n        case MoveButtonDirection.RIGHT: angle = 180; break;\n        default: angle = 0; break;\n    }\n\n    return ICONS.arrow.replace('rotate(0', `rotate(${angle}`);\n}\n\nexport abstract class AbstractMoveButton extends AbstractButton {\n    static override readonly groupId = 'move';\n\n    private readonly handler = new PressHandler();\n\n    constructor(\n        navbar: Navbar,\n        private direction: MoveButtonDirection,\n    ) {\n        super(navbar, {\n            className: 'psv-move-button',\n            hoverScale: true,\n            collapsable: false,\n            tabbable: true,\n            icon: getIcon(direction),\n        });\n\n        this.container.addEventListener('mousedown', this);\n        this.container.addEventListener('keydown', this);\n        this.container.addEventListener('keyup', this);\n        this.viewer.container.addEventListener('mouseup', this);\n        this.viewer.container.addEventListener('touchend', this);\n    }\n\n    override destroy() {\n        this.__onMouseUp();\n\n        this.viewer.container.removeEventListener('mouseup', this);\n        this.viewer.container.removeEventListener('touchend', this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case 'mousedown': this.__onMouseDown(); break;\n            case 'mouseup': this.__onMouseUp(); break;\n            case 'touchend': this.__onMouseUp(); break;\n            case 'keydown': (e as KeyboardEvent).key === KEY_CODES.Enter && this.__onMouseDown(); break;\n            case 'keyup': (e as KeyboardEvent).key === KEY_CODES.Enter && this.__onMouseUp(); break;\n        }\n    }\n\n    onClick() {\n        // nothing\n    }\n\n    override isSupported() {\n        return invertResolvableBoolean(SYSTEM.isTouchEnabled);\n    }\n\n    private __onMouseDown() {\n        if (!this.state.enabled) {\n            return;\n        }\n\n        const dynamicRoll: {\n            yaw?: boolean;\n            pitch?: boolean;\n        } = {};\n        switch (this.direction) {\n            case MoveButtonDirection.UP: dynamicRoll.pitch = false; break;\n            case MoveButtonDirection.DOWN: dynamicRoll.pitch = true; break;\n            case MoveButtonDirection.RIGHT: dynamicRoll.yaw = false; break;\n            default: dynamicRoll.yaw = true; break;\n        }\n\n        this.viewer.stopAll();\n        this.viewer.dynamics.position.roll(dynamicRoll);\n        this.handler.down();\n    }\n\n    private __onMouseUp() {\n        if (!this.state.enabled) {\n            return;\n        }\n\n        this.handler.up(() => {\n            this.viewer.dynamics.position.stop();\n            this.viewer.resetIdleTimer();\n        });\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { AbstractMoveButton, MoveButtonDirection } from './AbstractMoveButton';\n\nexport class MoveDownButton extends AbstractMoveButton {\n    static override readonly id = 'moveDown';\n\n    constructor(navbar: Navbar) {\n        super(navbar, MoveButtonDirection.DOWN);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { AbstractMoveButton, MoveButtonDirection } from './AbstractMoveButton';\n\nexport class MoveLeftButton extends AbstractMoveButton {\n    static override readonly id = 'moveLeft';\n\n    constructor(navbar: Navbar) {\n        super(navbar, MoveButtonDirection.LEFT);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { AbstractMoveButton, MoveButtonDirection } from './AbstractMoveButton';\n\nexport class MoveRightButton extends AbstractMoveButton {\n    static override readonly id = 'moveRight';\n\n    constructor(navbar: Navbar) {\n        super(navbar, MoveButtonDirection.RIGHT);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { AbstractMoveButton, MoveButtonDirection } from './AbstractMoveButton';\n\nexport class MoveUpButton extends AbstractMoveButton {\n    static override readonly id = 'moveUp';\n\n    constructor(navbar: Navbar) {\n        super(navbar, MoveButtonDirection.UP);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { KEY_CODES } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport { invertResolvableBoolean } from '../utils';\nimport { PressHandler } from '../utils/PressHandler';\nimport { AbstractButton } from './AbstractButton';\n\nexport const enum ZoomButtonDirection {\n    IN,\n    OUT,\n}\n\nexport class AbstractZoomButton extends AbstractButton {\n    static override readonly groupId = 'zoom';\n\n    private readonly handler = new PressHandler();\n\n    constructor(\n        navbar: Navbar,\n        icon: string,\n        private direction: ZoomButtonDirection,\n    ) {\n        super(navbar, {\n            className: 'psv-zoom-button',\n            hoverScale: true,\n            collapsable: false,\n            tabbable: true,\n            icon: icon,\n        });\n\n        this.container.addEventListener('mousedown', this);\n        this.container.addEventListener('keydown', this);\n        this.container.addEventListener('keyup', this);\n        this.viewer.container.addEventListener('mouseup', this);\n        this.viewer.container.addEventListener('touchend', this);\n    }\n\n    override destroy() {\n        this.__onMouseUp();\n\n        this.viewer.container.removeEventListener('mouseup', this);\n        this.viewer.container.removeEventListener('touchend', this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case 'mousedown': this.__onMouseDown(); break;\n            case 'mouseup': this.__onMouseUp(); break;\n            case 'touchend': this.__onMouseUp(); break;\n            case 'keydown': (e as KeyboardEvent).key === KEY_CODES.Enter && this.__onMouseDown(); break;\n            case 'keyup': (e as KeyboardEvent).key === KEY_CODES.Enter && this.__onMouseUp(); break;\n        }\n    }\n\n    onClick() {\n        // nothing\n    }\n\n    override isSupported() {\n        return invertResolvableBoolean(SYSTEM.isTouchEnabled);\n    }\n\n    private __onMouseDown() {\n        if (!this.state.enabled) {\n            return;\n        }\n\n        this.viewer.dynamics.zoom.roll(this.direction === ZoomButtonDirection.OUT);\n        this.handler.down();\n    }\n\n    private __onMouseUp() {\n        if (!this.state.enabled) {\n            return;\n        }\n\n        this.handler.up(() => this.viewer.dynamics.zoom.stop());\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { ICONS } from '../data/constants';\nimport { AbstractZoomButton, ZoomButtonDirection } from './AbstractZoomButton';\n\nexport class ZoomInButton extends AbstractZoomButton {\n    static override readonly id = 'zoomIn';\n\n    constructor(navbar: Navbar) {\n        super(navbar, ICONS.zoomIn, ZoomButtonDirection.IN);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { ICONS } from '../data/constants';\nimport { AbstractZoomButton, ZoomButtonDirection } from './AbstractZoomButton';\n\nexport class ZoomOutButton extends AbstractZoomButton {\n    static override readonly id = 'zoomOut';\n\n    constructor(navbar: Navbar) {\n        super(navbar, ICONS.zoomOut, ZoomButtonDirection.OUT);\n    }\n}\n","import type { Navbar } from '../components/Navbar';\nimport { SYSTEM } from '../data/system';\nimport { ReadyEvent, ZoomUpdatedEvent } from '../events';\nimport { Slider, SliderDirection, SliderUpdateData, getStyleProperty, invertResolvableBoolean } from '../utils';\nimport { AbstractButton } from './AbstractButton';\n\nexport class ZoomRangeButton extends AbstractButton {\n    static override readonly id = 'zoomRange';\n    static override readonly groupId = 'zoom';\n\n    private readonly slider: Slider;\n    private readonly zoomRange: HTMLElement;\n    private readonly zoomValue: HTMLElement;\n    private readonly mediaMinWidth: number;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-zoom-range',\n            hoverScale: false,\n            collapsable: false,\n            tabbable: false,\n        });\n\n        this.zoomRange = document.createElement('div');\n        this.zoomRange.className = 'psv-zoom-range-line';\n        this.container.appendChild(this.zoomRange);\n\n        this.zoomValue = document.createElement('div');\n        this.zoomValue.className = 'psv-zoom-range-handle';\n        this.zoomRange.appendChild(this.zoomValue);\n\n        this.slider = new Slider(this.container, SliderDirection.HORIZONTAL, data => this.__onSliderUpdate(data));\n\n        this.mediaMinWidth = parseInt(getStyleProperty(this.container, 'max-width'), 10);\n\n        this.viewer.addEventListener(ZoomUpdatedEvent.type, this);\n        if (this.viewer.state.ready) {\n            this.__moveZoomValue(this.viewer.getZoomLevel());\n        } else {\n            this.viewer.addEventListener(ReadyEvent.type, this);\n        }\n    }\n\n    override destroy() {\n        this.slider.destroy();\n\n        this.viewer.removeEventListener(ZoomUpdatedEvent.type, this);\n        this.viewer.removeEventListener(ReadyEvent.type, this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof ZoomUpdatedEvent) {\n            this.__moveZoomValue(e.zoomLevel);\n        } else if (e instanceof ReadyEvent) {\n            this.__moveZoomValue(this.viewer.getZoomLevel());\n        }\n    }\n\n    onClick() {\n        // nothing\n    }\n\n    override isSupported() {\n        return invertResolvableBoolean(SYSTEM.isTouchEnabled);\n    }\n\n    override autoSize() {\n        if (this.state.supported) {\n            if (this.viewer.state.size.width <= this.mediaMinWidth && this.state.visible) {\n                this.hide(false);\n            } else if (this.viewer.state.size.width > this.mediaMinWidth && !this.state.visible) {\n                this.show(false);\n            }\n        }\n    }\n\n    private __moveZoomValue(level: number) {\n        this.zoomValue.style.left = (level / 100) * this.zoomRange.offsetWidth - this.zoomValue.offsetWidth / 2 + 'px';\n    }\n\n    private __onSliderUpdate(data: SliderUpdateData) {\n        if (data.mousedown) {\n            this.viewer.zoom(data.value * 100);\n        }\n    }\n}\n","import { TypedEvent, TypedEventTarget } from '../lib/TypedEventTarget';\nimport { checkVersion, ConfigParser, logWarn } from '../utils';\nimport type { Viewer } from '../Viewer';\n\n/**\n * Base class for plugins\n * @template TEvents union of dispatched events\n */\nexport abstract class AbstractPlugin<\n    TEvents extends TypedEvent<AbstractPlugin> = never,\n> extends TypedEventTarget<TEvents> {\n    /**\n     * Unique identifier of the plugin\n     */\n    static readonly id: string;\n    /**\n     * Expected version of the core\n     * DO NOT USE on custom plugins\n     */\n    static readonly VERSION: string;\n\n    constructor(protected viewer: Viewer) {\n        super();\n    }\n\n    /**\n     * Initializes the plugin\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    init(): void {}\n\n    /**\n     * Destroys the plugin\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    destroy(): void {}\n}\n\n/**\n * Base class for plugins with updatable configuration\n * The implementation must have a static `configParser` property which is the result of {@link utils.getConfigParser}\n *\n * @template TConfig type of input config\n * @template TParsedConfig type of config after parsing\n * @template TUpdatableConfig type of config that can be updated\n * @template TEvents union of dispatched events\n */\nexport abstract class AbstractConfigurablePlugin<\n    TConfig extends Record<string, any>,\n    TParsedConfig extends TConfig = TConfig,\n    TUpdatableConfig extends TConfig = TConfig,\n    TEvents extends TypedEvent<AbstractPlugin> = never,\n> extends AbstractPlugin<TEvents> {\n    static configParser: ConfigParser<any, any>;\n    static readonlyOptions: string[] = [];\n\n    readonly config: TParsedConfig;\n\n    constructor(viewer: Viewer, config: TConfig) {\n        super(viewer);\n\n        this.config = (this.constructor as typeof AbstractConfigurablePlugin).configParser(config) as TParsedConfig;\n    }\n\n    /**\n     * Update options\n     */\n    setOption<T extends keyof TUpdatableConfig>(option: T, value: TUpdatableConfig[T]) {\n        // @ts-ignore\n        this.setOptions({ [option]: value });\n    }\n\n    /**\n     * Update options\n     */\n    setOptions(options: Partial<TUpdatableConfig>) {\n        const rawConfig: TConfig = {\n            ...this.config,\n            ...options,\n        };\n\n        const ctor = this.constructor as typeof AbstractConfigurablePlugin;\n        const parser: ConfigParser<TConfig, TParsedConfig> = ctor.configParser as any;\n        const readonly = ctor.readonlyOptions;\n        const id = ctor.id;\n\n        for (let [key, value] of Object.entries(options) as Array<[keyof TConfig, any]>) {\n            if (!(key in parser.defaults)) {\n                logWarn(`${id}: Unknown option \"${key as string}\"`);\n                continue;\n            }\n\n            if (readonly.includes(key as string)) {\n                logWarn(`${id}: Option \"${key as string}\" cannot be updated`);\n                continue;\n            }\n\n            if (key in parser.parsers) {\n                value = parser.parsers[key](value, {\n                    rawConfig: rawConfig,\n                    defValue: parser.defaults[key],\n                });\n            }\n\n            this.config[key] = value;\n        }\n    }\n}\n\nexport type PluginConstructor = new (viewer: Viewer, config?: any) => AbstractPlugin<any>;\n\n/**\n * Returns the plugin constructor from the imported object\n * @internal\n */\nexport function pluginInterop(plugin: any): PluginConstructor & typeof AbstractPlugin {\n    if (plugin) {\n        for (const [, p] of [['_', plugin], ...Object.entries(plugin)]) {\n            if (p.prototype instanceof AbstractPlugin) {\n                checkVersion(p.id, p.VERSION, PKG_VERSION);\n                return p;\n            }\n        }\n    }\n    return null;\n}\n","import { MathUtils } from 'three';\nimport { PSVError } from '../PSVError';\nimport { adapterInterop } from '../adapters/AbstractAdapter';\nimport { EquirectangularAdapter } from '../adapters/EquirectangularAdapter';\nimport { ParsedViewerConfig, ReadonlyViewerConfig, ViewerConfig } from '../model';\nimport { pluginInterop } from '../plugins/AbstractPlugin';\nimport { ConfigParsers, clone, getConfigParser, logWarn, parseAngle } from '../utils';\nimport { ACTIONS, KEY_CODES } from './constants';\n\n/**\n * Default options\n */\nexport const DEFAULTS: Required<ParsedViewerConfig> = {\n    panorama: null,\n    container: null,\n    adapter: [EquirectangularAdapter as any, null],\n    plugins: [],\n    caption: null,\n    description: null,\n    downloadUrl: null,\n    downloadName: null,\n    loadingImg: null,\n    loadingTxt: '', // empty string => `lang.loading`\n    size: null,\n    fisheye: 0,\n    minFov: 30,\n    maxFov: 90,\n    defaultZoomLvl: 50,\n    defaultYaw: 0,\n    defaultPitch: 0,\n    sphereCorrection: null,\n    moveSpeed: 1,\n    zoomSpeed: 1,\n    moveInertia: 0.8,\n    mousewheel: true,\n    mousemove: true,\n    mousewheelCtrlKey: false,\n    touchmoveTwoFingers: false,\n    panoData: null,\n    requestHeaders: null,\n    canvasBackground: '#000',\n    defaultTransition: {\n        speed: 1500,\n        rotation: true,\n        effect: 'fade',\n    },\n    rendererParameters: { alpha: true, antialias: true },\n    withCredentials: () => false,\n    navbar: [\n        'zoom',\n        'move',\n        'download',\n        'description',\n        'caption',\n        'fullscreen',\n    ],\n    lang: {\n        zoom: 'Zoom',\n        zoomOut: 'Zoom out',\n        zoomIn: 'Zoom in',\n        moveUp: 'Move up',\n        moveDown: 'Move down',\n        moveLeft: 'Move left',\n        moveRight: 'Move right',\n        description: 'Description',\n        download: 'Download',\n        fullscreen: 'Fullscreen',\n        loading: 'Loading...',\n        menu: 'Menu',\n        close: 'Close',\n        twoFingers: 'Use two fingers to navigate',\n        ctrlZoom: 'Use ctrl + scroll to zoom the image',\n        loadError: 'The panorama cannot be loaded',\n        webglError: 'Your browser does not seem to support WebGL',\n    },\n    keyboard: 'fullscreen',\n    keyboardActions: {\n        [KEY_CODES.ArrowUp]: ACTIONS.ROTATE_UP,\n        [KEY_CODES.ArrowDown]: ACTIONS.ROTATE_DOWN,\n        [KEY_CODES.ArrowRight]: ACTIONS.ROTATE_RIGHT,\n        [KEY_CODES.ArrowLeft]: ACTIONS.ROTATE_LEFT,\n        [KEY_CODES.PageUp]: ACTIONS.ZOOM_IN,\n        [KEY_CODES.PageDown]: ACTIONS.ZOOM_OUT,\n        [KEY_CODES.Plus]: ACTIONS.ZOOM_IN,\n        [KEY_CODES.Minus]: ACTIONS.ZOOM_OUT,\n    },\n};\n\n/**\n * List of unmodifiable options and their error messages\n * @internal\n */\nexport const READONLY_OPTIONS: Record<ReadonlyViewerConfig, string> = {\n    panorama: 'Use setPanorama method to change the panorama',\n    panoData: 'Use setPanorama method to change the panorama',\n    container: 'Cannot change viewer container',\n    adapter: 'Cannot change adapter',\n    plugins: 'Cannot change plugins',\n};\n\n/**\n * Parsers/validators for each option\n * @internal\n */\nexport const CONFIG_PARSERS: ConfigParsers<ViewerConfig, ParsedViewerConfig> = {\n    container: (container) => {\n        if (!container) {\n            throw new PSVError('No value given for container.');\n        }\n        return container;\n    },\n    adapter: (adapter, { defValue }) => {\n        if (!adapter) {\n            adapter = defValue;\n        } else if (Array.isArray(adapter)) {\n            adapter = [adapterInterop(adapter[0]), adapter[1]];\n        } else {\n            adapter = [adapterInterop(adapter), null];\n        }\n        if (!adapter[0]) {\n            throw new PSVError('An undefined value was given for adapter.');\n        }\n        if (!(adapter[0] as any).id) {\n            throw new PSVError(`Adapter has no id.`);\n        }\n        return adapter;\n    },\n    defaultYaw: (defaultYaw) => {\n        // defaultYaw is between 0 and PI\n        return parseAngle(defaultYaw);\n    },\n    defaultPitch: (defaultPitch) => {\n        // defaultPitch is between -PI/2 and PI/2\n        return parseAngle(defaultPitch, true);\n    },\n    defaultZoomLvl: (defaultZoomLvl) => {\n        return MathUtils.clamp(defaultZoomLvl, 0, 100);\n    },\n    minFov: (minFov, { rawConfig }) => {\n        // minFov and maxFov must be ordered\n        if (rawConfig.maxFov < minFov) {\n            logWarn('maxFov cannot be lower than minFov');\n            minFov = rawConfig.maxFov;\n        }\n        // minFov between 1 and 179\n        return MathUtils.clamp(minFov, 1, 179);\n    },\n    maxFov: (maxFov, { rawConfig }) => {\n        // minFov and maxFov must be ordered\n        if (maxFov < rawConfig.minFov) {\n            maxFov = rawConfig.minFov;\n        }\n        // maxFov between 1 and 179\n        return MathUtils.clamp(maxFov, 1, 179);\n    },\n    moveInertia: (moveInertia, { defValue }) => {\n        if (moveInertia === true) {\n            return defValue;\n        }\n        if (moveInertia === false) {\n            return 0;\n        }\n        return moveInertia;\n    },\n    lang: (lang) => {\n        return {\n            ...DEFAULTS.lang,\n            ...lang,\n        };\n    },\n    fisheye: (fisheye) => {\n        // translate boolean fisheye to amount\n        if (fisheye === true) {\n            return 1;\n        } else if (fisheye === false) {\n            return 0;\n        }\n        return fisheye;\n    },\n    requestHeaders: (requestHeaders) => {\n        if (requestHeaders && typeof requestHeaders === 'object') {\n            return () => requestHeaders;\n        }\n        if (typeof requestHeaders === 'function') {\n            return requestHeaders;\n        }\n        return null;\n    },\n    withCredentials: (withCredentials) => {\n        if (typeof withCredentials === 'boolean') {\n            return () => withCredentials;\n        }\n        if (typeof withCredentials === 'function') {\n            return withCredentials;\n        }\n        return () => false;\n    },\n    defaultTransition: (defaultTransition, { defValue }) => {\n        if (defaultTransition === null || defaultTransition.speed === 0) {\n            return null;\n        } else {\n            return { ...defValue, ...defaultTransition };\n        }\n    },\n    rendererParameters: (rendererParameters, { defValue }) => ({\n        ...rendererParameters,\n        ...defValue,\n    }),\n    plugins: (plugins) => {\n        return plugins.map((plugin, i) => {\n            if (Array.isArray(plugin)) {\n                plugin = [pluginInterop(plugin[0]), plugin[1]];\n            } else {\n                plugin = [pluginInterop(plugin), null];\n            }\n            if (!plugin[0]) {\n                throw new PSVError(`An undefined value was given for plugin ${i}.`);\n            }\n            if (!(plugin[0] as any).id) {\n                throw new PSVError(`Plugin ${i} has no id.`);\n            }\n            return plugin;\n        });\n    },\n    navbar: (navbar) => {\n        if (navbar === false) {\n            return null;\n        }\n        if (navbar === true) {\n            // true becomes the default array\n            return clone(DEFAULTS.navbar as string[]);\n        }\n        if (typeof navbar === 'string') {\n            // can be a space or coma separated list\n            return navbar.split(/[ ,]/);\n        }\n        return navbar;\n    },\n};\n\n/**\n * @internal\n */\nexport const getViewerConfig = getConfigParser<ViewerConfig, ParsedViewerConfig>(DEFAULTS, CONFIG_PARSERS);\n","import { AbstractButton } from '../buttons/AbstractButton';\nimport { DescriptionButton } from '../buttons/DescriptionButton';\nimport type { Navbar } from './Navbar';\n\nexport class NavbarCaption extends AbstractButton {\n    static override readonly id = 'caption';\n\n    private contentWidth = 0;\n\n    private readonly contentElt: HTMLElement;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-caption',\n            hoverScale: false,\n            collapsable: false,\n            tabbable: true,\n        });\n\n        this.state.width = 0;\n\n        this.contentElt = document.createElement('div');\n        this.contentElt.className = 'psv-caption-content';\n        this.container.appendChild(this.contentElt);\n\n        this.setCaption(this.viewer.config.caption);\n    }\n\n    override hide() {\n        this.contentElt.style.display = 'none';\n        this.state.visible = false;\n    }\n\n    override show() {\n        this.contentElt.style.display = '';\n        this.state.visible = true;\n    }\n\n    onClick(): void {\n        // nothing\n    }\n\n    /**\n     * Changes the caption\n     */\n    setCaption(html: string | null) {\n        this.show();\n        this.contentElt.innerHTML = html ?? '';\n\n        if (this.contentElt.innerHTML) {\n            this.contentWidth = this.contentElt.offsetWidth;\n        } else {\n            this.contentWidth = 0;\n        }\n\n        this.autoSize();\n    }\n\n    /**\n     * Toggles content and icon depending on available space\n     */\n    override autoSize() {\n        this.toggle(this.container.offsetWidth >= this.contentWidth);\n        this.__refreshButton();\n    }\n\n    private __refreshButton() {\n        (this.viewer.navbar.getButton(DescriptionButton.id, false) as DescriptionButton)?.autoSize(true);\n    }\n}\n","import { AbstractButton, ButtonConstructor } from '../buttons/AbstractButton';\nimport { CustomButton } from '../buttons/CustomButton';\nimport { DescriptionButton } from '../buttons/DescriptionButton';\nimport { DownloadButton } from '../buttons/DownloadButton';\nimport { FullscreenButton } from '../buttons/FullscreenButton';\nimport { MenuButton } from '../buttons/MenuButton';\nimport { MoveDownButton } from '../buttons/MoveDownButton';\nimport { MoveLeftButton } from '../buttons/MoveLeftButton';\nimport { MoveRightButton } from '../buttons/MoveRightButton';\nimport { MoveUpButton } from '../buttons/MoveUpButton';\nimport { ZoomInButton } from '../buttons/ZoomInButton';\nimport { ZoomOutButton } from '../buttons/ZoomOutButton';\nimport { ZoomRangeButton } from '../buttons/ZoomRangeButton';\nimport { DEFAULTS } from '../data/config';\nimport { CAPTURE_EVENTS_CLASS } from '../data/constants';\nimport { ParsedViewerConfig } from '../model';\nimport { PSVError } from '../PSVError';\nimport { logWarn } from '../utils';\nimport type { Viewer } from '../Viewer';\nimport { AbstractComponent } from './AbstractComponent';\nimport { NavbarCaption } from './NavbarCaption';\n\n/**\n * List of available buttons\n */\nconst AVAILABLE_BUTTONS: Record<string, ButtonConstructor> = {};\n\n/**\n * List of available buttons\n */\nconst AVAILABLE_GROUPS: Record<string, ButtonConstructor[]> = {};\n\n/**\n * Register a new button available for all viewers\n * @param button\n * @param [defaultPosition]  If provided the default configuration of the navbar will be modified.\n * Possible values are :\n *    - `start`\n *    - `end`\n *    - `[id]:left`\n *    - `[id]:right`\n * @throws {@link PSVError} if the button constructor has no \"id\"\n */\nexport function registerButton(button: ButtonConstructor, defaultPosition?: string) {\n    if (!button.id) {\n        throw new PSVError('Button id is required');\n    }\n\n    AVAILABLE_BUTTONS[button.id] = button;\n\n    if (button.groupId) {\n        (AVAILABLE_GROUPS[button.groupId] = AVAILABLE_GROUPS[button.groupId] || []).push(button);\n    }\n\n    if (defaultPosition) {\n        const navbar = DEFAULTS.navbar as string[];\n        switch (defaultPosition) {\n            case 'start':\n                navbar.unshift(button.id);\n                break;\n            case 'end':\n                navbar.push(button.id);\n                break;\n            default: {\n                const [id, pos] = defaultPosition.split(':');\n                const idx = navbar.indexOf(id);\n                if (!id || !pos || idx === -1) {\n                    throw new PSVError(`Invalid defaultPosition ${defaultPosition}`);\n                }\n                navbar.splice(idx + (pos === 'right' ? 1 : 0), 0, button.id);\n            }\n        }\n    }\n}\n\n[\n    ZoomOutButton,\n    ZoomRangeButton,\n    ZoomInButton,\n    DescriptionButton,\n    NavbarCaption,\n    DownloadButton,\n    FullscreenButton,\n    MoveLeftButton,\n    MoveRightButton,\n    MoveUpButton,\n    MoveDownButton,\n].forEach(btn => registerButton(btn));\n\n/**\n * Navigation bar component\n */\nexport class Navbar extends AbstractComponent {\n    /**\n     * @internal\n     */\n    collapsed: AbstractButton[] = [];\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer, {\n            className: `psv-navbar ${CAPTURE_EVENTS_CLASS}`,\n        });\n\n        this.state.visible = false;\n    }\n\n    /**\n     * Shows the navbar\n     */\n    override show() {\n        this.viewer.container.classList.add('psv--has-navbar');\n        this.container.classList.add('psv-navbar--open');\n        this.state.visible = true;\n    }\n\n    /**\n     * Hides the navbar\n     */\n    override hide() {\n        this.viewer.container.classList.remove('psv--has-navbar');\n        this.container.classList.remove('psv-navbar--open');\n        this.state.visible = false;\n    }\n\n    /**\n     * Change the buttons visible on the navbar\n     */\n    setButtons(buttons: ParsedViewerConfig['navbar']) {\n        this.children.slice().forEach(item => item.destroy());\n        this.children.length = 0;\n\n        // force description button if caption is present (used on narrow screens)\n        if (buttons.indexOf(NavbarCaption.id) !== -1 && buttons.indexOf(DescriptionButton.id) === -1) {\n            buttons.splice(buttons.indexOf(NavbarCaption.id), 0, DescriptionButton.id);\n        }\n\n        buttons.forEach((button) => {\n            if (typeof button === 'object') {\n                new CustomButton(this, button);\n            } else if (AVAILABLE_BUTTONS[button]) {\n                // @ts-ignore\n                new AVAILABLE_BUTTONS[button](this);\n            } else if (AVAILABLE_GROUPS[button]) {\n                AVAILABLE_GROUPS[button].forEach((buttonCtor) => {\n                    // @ts-ignore\n                    new buttonCtor(this);\n                });\n            } else {\n                logWarn(`Unknown button ${button}`);\n            }\n        });\n\n        new MenuButton(this);\n\n        this.children.forEach((item) => {\n            if (item instanceof AbstractButton) {\n                item.checkSupported();\n            }\n        });\n\n        this.autoSize();\n    }\n\n    /**\n     * Changes the navbar caption\n     */\n    setCaption(html: string | null) {\n        this.children.some((item) => {\n            if (item instanceof NavbarCaption) {\n                item.setCaption(html);\n                return true;\n            } else {\n                return false;\n            }\n        });\n    }\n\n    /**\n     * Returns a button by its identifier\n     */\n    getButton(id: string, warnNotFound = true): AbstractButton {\n        const button = this.children.find((item) => {\n            return item instanceof AbstractButton && item.id === id;\n        });\n\n        if (!button && warnNotFound) {\n            logWarn(`button \"${id}\" not found in the navbar`);\n        }\n\n        return button as AbstractButton;\n    }\n\n    /**\n     * Try to focus a button, will focus the first button if the requested button does not exist.\n     */\n    focusButton(id: string) {\n        if (this.isVisible()) {\n            (this.getButton(id, false)?.container || this.container.firstElementChild as HTMLElement)?.focus();\n        }\n    }\n\n    /**\n     * Automatically collapses buttons\n     * @internal\n     */\n    autoSize() {\n        this.children.forEach((child) => {\n            if (child instanceof AbstractButton) {\n                child.autoSize();\n            }\n        });\n\n        const availableWidth = this.container.offsetWidth;\n\n        let totalWidth = 0;\n        const collapsableButtons: AbstractButton[] = [];\n\n        this.children.forEach((item) => {\n            if (item.isVisible() && item instanceof AbstractButton) {\n                totalWidth += item.width;\n                if (item.collapsable) {\n                    collapsableButtons.push(item);\n                }\n            }\n        });\n\n        if (totalWidth === 0) {\n            return;\n        }\n\n        if (availableWidth < totalWidth && collapsableButtons.length > 0) {\n            collapsableButtons.forEach(item => item.collapse());\n            this.collapsed = collapsableButtons;\n\n            this.getButton(MenuButton.id).show(false);\n        } else if (availableWidth >= totalWidth && this.collapsed.length > 0) {\n            this.collapsed.forEach(item => item.uncollapse());\n            this.collapsed = [];\n\n            this.getButton(MenuButton.id).hide(false);\n        }\n\n        this.getButton(NavbarCaption.id, false)?.autoSize();\n    }\n}\n","import { Cache as ThreeCache } from 'three';\nimport { logWarn } from '../utils';\n\nThreeCache.enabled = false;\n\nexport const Cache = {\n    enabled: true,\n\n    maxItems: 10,\n\n    ttl: 10 * 60,\n\n    items: {} as Record<string, { files: Record<string, HTMLImageElement | Blob>; lastAccess: number }>,\n\n    purgeInterval: null as ReturnType<typeof setInterval>,\n\n    init() {\n        if (ThreeCache.enabled) {\n            logWarn('ThreeJS cache should be disabled');\n            ThreeCache.enabled = false;\n        }\n\n        if (!this.purgeInterval && this.enabled) {\n            this.purgeInterval = setInterval(() => this.purge(), 60 * 1000);\n        }\n    },\n\n    add(url: string, key: string, data: HTMLImageElement | Blob) {\n        if (this.enabled && key) {\n            this.items[key] = this.items[key] ?? { files: {}, lastAccess: null };\n            this.items[key].files[url] = data;\n            this.items[key].lastAccess = Date.now();\n        }\n    },\n\n    get(url: string, key: string): HTMLImageElement | Blob {\n        if (this.enabled && key && this.items[key]) {\n            this.items[key].lastAccess = Date.now();\n            return this.items[key].files[url];\n        }\n    },\n\n    remove(url: string, key: string) {\n        if (this.enabled && key && this.items[key]) {\n            delete this.items[key].files[url];\n            if (Object.keys(this.items[key].files).length === 0) {\n                delete this.items[key];\n            }\n        }\n    },\n\n    purge() {\n        Object.entries(this.items)\n            .sort(([, a], [, b]) => {\n                return b.lastAccess - a.lastAccess;\n            })\n            .forEach(([key, { lastAccess }], index) => {\n                // remove expired items and extra numerous items\n                // but always keep the most recent one\n                if (index > 0 && (Date.now() - lastAccess >= this.ttl * 1000 || index >= this.maxItems)) {\n                    delete this.items[key];\n                }\n            });\n    },\n};\n","import { MathUtils } from 'three';\nimport { ConfigChangedEvent } from '../events';\nimport { getStyleProperty } from '../utils';\nimport type { Viewer } from '../Viewer';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * Loader component\n */\nexport class Loader extends AbstractComponent {\n    private readonly loader: HTMLElement;\n    private readonly canvas: SVGElement;\n\n    private readonly size: number;\n    private readonly border: number;\n    private readonly thickness: number;\n    private readonly color: string;\n    private readonly textColor: string;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer, { className: 'psv-loader-container' });\n\n        this.loader = document.createElement('div');\n        this.loader.className = 'psv-loader';\n        this.container.appendChild(this.loader);\n\n        this.size = this.loader.offsetWidth;\n\n        this.canvas = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n        this.canvas.setAttribute('class', 'psv-loader-canvas');\n        this.canvas.setAttribute('viewBox', `0 0 ${this.size} ${this.size}`);\n        this.loader.appendChild(this.canvas);\n\n        this.textColor = getStyleProperty(this.loader, 'color');\n        this.color = getStyleProperty(this.canvas, 'color');\n        this.border = parseInt(getStyleProperty(this.loader, '--psv-loader-border'), 10);\n        this.thickness = parseInt(getStyleProperty(this.loader, '--psv-loader-tickness'), 10);\n\n        const halfSize = this.size / 2;\n        this.canvas.innerHTML = `\n            <circle cx=\"${halfSize}\" cy=\"${halfSize}\" r=\"${halfSize}\" fill=\"${this.color}\"/>\n            <path d=\"\" fill=\"none\" stroke=\"${this.textColor}\" stroke-width=\"${this.thickness}\" stroke-linecap=\"round\"/>\n        `;\n\n        this.viewer.addEventListener(ConfigChangedEvent.type, this);\n\n        this.__updateContent();\n        this.hide();\n    }\n\n    /**\n     * @internal\n     */\n    override destroy(): void {\n        this.viewer.removeEventListener(ConfigChangedEvent.type, this);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        if (e instanceof ConfigChangedEvent) {\n            e.containsOptions('loadingImg', 'loadingTxt', 'lang') && this.__updateContent();\n        }\n    }\n\n    /**\n     * Sets the loader progression\n     */\n    setProgress(value: number) {\n        this.container.classList.remove('psv-loader--undefined');\n\n        const angle = (MathUtils.clamp(value, 0, 99.999) / 100) * Math.PI * 2;\n        const halfSize = this.size / 2;\n        const startX = halfSize;\n        const startY = this.thickness / 2 + this.border;\n        const radius = (this.size - this.thickness) / 2 - this.border;\n        const endX = Math.sin(angle) * radius + halfSize;\n        const endY = -Math.cos(angle) * radius + halfSize;\n        const largeArc = value > 50 ? '1' : '0';\n\n        this.canvas.querySelector('path').setAttributeNS(null, 'd',\n            `M ${startX} ${startY} A ${radius} ${radius} 0 ${largeArc} 1 ${endX} ${endY}`,\n        );\n    }\n\n    /**\n     * Animates the loader with an unknown state\n     */\n    showUndefined() {\n        this.show();\n        this.setProgress(25);\n        this.container.classList.add('psv-loader--undefined');\n    }\n\n    private __updateContent() {\n        const current = this.loader.querySelector('.psv-loader-image, .psv-loader-text');\n        if (current) {\n            this.loader.removeChild(current);\n        }\n\n        let inner;\n        if (this.viewer.config.loadingImg) {\n            inner = document.createElement('img');\n            inner.className = 'psv-loader-image';\n            inner.src = this.viewer.config.loadingImg;\n        } else if (this.viewer.config.loadingTxt !== null) {\n            inner = document.createElement('div');\n            inner.className = 'psv-loader-text';\n            inner.innerHTML = this.viewer.config.loadingTxt || this.viewer.config.lang.loading;\n        }\n        if (inner) {\n            const size = Math.round(Math.sqrt(2 * Math.pow(this.size / 2 - this.thickness / 2 - this.border, 2)));\n            inner.style.maxWidth = size + 'px';\n            inner.style.maxHeight = size + 'px';\n            this.loader.appendChild(inner);\n        }\n    }\n}\n","import { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { HideNotificationEvent, ShowNotificationEvent } from '../events';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * Configuration for {@link Notification.show}\n */\nexport type NotificationConfig = {\n    /**\n     * unique identifier to use with {@link Notification.hide} and {@link Notification.isVisible}\n     */\n    id?: string;\n    /**\n     * notification content\n     */\n    content: string;\n    /**\n     * automatically hide the notification after X milliseconds\n     */\n    timeout?: number;\n};\n\n/**\n * Notification component\n */\nexport class Notification extends AbstractComponent {\n    /**\n     * @internal\n     */\n    protected override readonly state = {\n        visible: false,\n        contentId: null as string,\n        timeout: null as ReturnType<typeof setTimeout>,\n    };\n\n    private readonly content: HTMLElement;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer, {\n            className: 'psv-notification',\n        });\n\n        this.content = document.createElement('div');\n        this.content.className = 'psv-notification-content';\n        this.container.appendChild(this.content);\n\n        this.content.addEventListener('click', () => this.hide());\n    }\n\n    /**\n     * Checks if the notification is visible\n     */\n    override isVisible(id?: string) {\n        return this.state.visible && (!id || !this.state.contentId || this.state.contentId === id);\n    }\n\n    /**\n     * @throws {@link PSVError} always\n     * @internal\n     */\n    override toggle() {\n        throw new PSVError('Notification cannot be toggled');\n    }\n\n    /**\n     * Displays a notification on the viewer\n     *\n     * @example\n     * viewer.showNotification({ content: 'Hello world', timeout: 5000 })\n     * @example\n     * viewer.showNotification('Hello world')\n     */\n    override show(config: string | NotificationConfig) {\n        if (this.state.timeout) {\n            clearTimeout(this.state.timeout);\n            this.state.timeout = null;\n        }\n\n        if (typeof config === 'string') {\n            config = { content: config };\n        }\n\n        this.state.contentId = config.id || null;\n        this.content.innerHTML = config.content;\n\n        this.container.classList.add('psv-notification--visible');\n        this.state.visible = true;\n\n        this.viewer.dispatchEvent(new ShowNotificationEvent(this.state.contentId));\n\n        if (config.timeout) {\n            this.state.timeout = setTimeout(() => this.hide(this.state.contentId), config.timeout);\n        }\n    }\n\n    /**\n     * Hides the notification\n     */\n    override hide(id?: string) {\n        if (this.isVisible(id)) {\n            const contentId = this.state.contentId;\n\n            this.container.classList.remove('psv-notification--visible');\n            this.state.visible = false;\n\n            this.state.contentId = null;\n\n            this.viewer.dispatchEvent(new HideNotificationEvent(contentId));\n        }\n    }\n}\n","import { CAPTURE_EVENTS_CLASS, KEY_CODES } from '../data/constants';\nimport { HideOverlayEvent, KeypressEvent, ShowOverlayEvent } from '../events';\nimport { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * Configuration for {@link Overlay.show}\n */\nexport type OverlayConfig = {\n    /**\n     * unique identifier to use with {@link Overlay.hide} and {@link Overlay.isVisible}\n     */\n    id?: string;\n    /**\n     * SVG image/icon displayed above the text\n     */\n    image?: string;\n    /**\n     * main message\n     */\n    title: string;\n    /**\n     * secondary message\n     */\n    text?: string;\n    /**\n     * if the user can hide the overlay by clicking\n     * @default true\n     */\n    dismissible?: boolean;\n};\n\n/**\n * Overlay component\n */\nexport class Overlay extends AbstractComponent {\n    /**\n     * @internal\n     */\n    protected override readonly state = {\n        visible: false,\n        contentId: null as string,\n        dismissible: true,\n    };\n\n    private readonly image: HTMLElement;\n    private readonly title: HTMLElement;\n    private readonly text: HTMLElement;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer, {\n            className: `psv-overlay ${CAPTURE_EVENTS_CLASS}`,\n        });\n\n        this.image = document.createElement('div');\n        this.image.className = 'psv-overlay-image';\n        this.container.appendChild(this.image);\n\n        this.title = document.createElement('div');\n        this.title.className = 'psv-overlay-title';\n        this.container.appendChild(this.title);\n\n        this.text = document.createElement('div');\n        this.text.className = 'psv-overlay-text';\n        this.container.appendChild(this.text);\n\n        this.container.addEventListener('click', this);\n        this.viewer.addEventListener(KeypressEvent.type, this);\n\n        super.hide();\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        this.viewer.removeEventListener(KeypressEvent.type, this);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        if (e.type === 'click') {\n            if (this.isVisible() && this.state.dismissible) {\n                this.hide();\n                e.stopPropagation();\n            }\n        } else if (e instanceof KeypressEvent) {\n            if (this.isVisible() && this.state.dismissible && e.matches(KEY_CODES.Escape)) {\n                this.hide();\n                e.preventDefault();\n            }\n        }\n    }\n\n    /**\n     * Checks if the overlay is visible\n     */\n    override isVisible(id?: string) {\n        return this.state.visible && (!id || !this.state.contentId || this.state.contentId === id);\n    }\n\n    /**\n     * @throws {@link PSVError} always\n     * @internal\n     */\n    override toggle() {\n        throw new PSVError('Overlay cannot be toggled');\n    }\n\n    /**\n     * Displays an overlay on the viewer\n     */\n    override show(config: string | OverlayConfig) {\n        if (typeof config === 'string') {\n            config = { title: config };\n        }\n\n        this.state.contentId = config.id || null;\n        this.state.dismissible = config.dismissible !== false;\n        this.image.innerHTML = config.image || '';\n        this.title.innerHTML = config.title || '';\n        this.text.innerHTML = config.text || '';\n\n        super.show();\n\n        this.viewer.dispatchEvent(new ShowOverlayEvent(this.state.contentId));\n    }\n\n    /**\n     * Hides the overlay\n     */\n    override hide(id?: string) {\n        if (this.isVisible(id)) {\n            const contentId = this.state.contentId;\n\n            super.hide();\n\n            this.state.contentId = null;\n\n            this.viewer.dispatchEvent(new HideOverlayEvent(contentId));\n        }\n    }\n}\n","import { CAPTURE_EVENTS_CLASS, ICONS, KEY_CODES } from '../data/constants';\nimport { PSVError } from '../PSVError';\nimport { getEventTarget, toggleClass } from '../utils';\nimport type { Viewer } from '../Viewer';\nimport { HidePanelEvent, KeypressEvent, ShowPanelEvent } from '../events';\nimport { AbstractComponent } from './AbstractComponent';\n\nconst PANEL_MIN_WIDTH = 200;\n\nconst PANEL_CLASS_NO_INTERACTION = 'psv-panel-content--no-interaction';\n\n/**\n * Configuration for {@link Panel.show}\n */\nexport type PanelConfig = {\n    /**\n     * unique identifier to use with {@link Panel.hide} and {@link Panel.isVisible} and to store the width\n     */\n    id?: string;\n    /**\n     * HTML content of the panel\n     */\n    content: string;\n    /**\n     * remove the default margins\n     * @default false\n     */\n    noMargin?: boolean;\n    /**\n     * initial width\n     */\n    width?: string;\n    /**\n     * called when the user clicks inside the panel or presses the Enter key while an element focused\n     */\n    clickHandler?: (target: HTMLElement) => void;\n};\n\n/**\n * Panel component\n */\nexport class Panel extends AbstractComponent {\n    /**\n     * @internal\n     */\n    protected override readonly state = {\n        visible: false,\n        contentId: null as string,\n        mouseX: 0,\n        mouseY: 0,\n        mousedown: false,\n        clickHandler: null as (e: MouseEvent) => void,\n        keyHandler: null as (e: KeyboardEvent) => void,\n        width: {} as Record<string, string>,\n    };\n\n    private readonly content: HTMLElement;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer, {\n            className: `psv-panel ${CAPTURE_EVENTS_CLASS}`,\n        });\n\n        const resizer = document.createElement('div');\n        resizer.className = 'psv-panel-resizer';\n        this.container.appendChild(resizer);\n\n        const closeBtn = document.createElement('div');\n        closeBtn.className = 'psv-panel-close-button';\n        closeBtn.innerHTML = ICONS.close;\n        closeBtn.title = viewer.config.lang.close;\n        this.container.appendChild(closeBtn);\n\n        this.content = document.createElement('div');\n        this.content.className = 'psv-panel-content';\n        this.container.appendChild(this.content);\n\n        closeBtn.addEventListener('click', () => this.hide());\n\n        // Event for panel resizing\n        resizer.addEventListener('mousedown', this);\n        resizer.addEventListener('touchstart', this);\n        this.viewer.container.addEventListener('mouseup', this);\n        this.viewer.container.addEventListener('touchend', this);\n        this.viewer.container.addEventListener('mousemove', this);\n        this.viewer.container.addEventListener('touchmove', this);\n\n        this.viewer.addEventListener(KeypressEvent.type, this);\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        this.viewer.removeEventListener(KeypressEvent.type, this);\n\n        this.viewer.container.removeEventListener('mousemove', this);\n        this.viewer.container.removeEventListener('touchmove', this);\n        this.viewer.container.removeEventListener('mouseup', this);\n        this.viewer.container.removeEventListener('touchend', this);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case 'mousedown': this.__onMouseDown(e as MouseEvent); break;\n            case 'touchstart': this.__onTouchStart(e as TouchEvent); break;\n            case 'mousemove': this.__onMouseMove(e as MouseEvent); break;\n            case 'touchmove': this.__onTouchMove(e as TouchEvent); break;\n            case 'mouseup': this.__onMouseUp(e as MouseEvent); break;\n            case 'touchend': this.__onTouchEnd(e as TouchEvent); break;\n            case KeypressEvent.type: this.__onKeyPress(e as KeypressEvent); break;\n        }\n    }\n\n    /**\n     * Checks if the panel is visible\n     */\n    override isVisible(id?: string) {\n        return this.state.visible && (!id || !this.state.contentId || this.state.contentId === id);\n    }\n\n    /**\n     * @throws {@link PSVError} always\n     * @internal\n     */\n    override toggle() {\n        throw new PSVError('Panel cannot be toggled');\n    }\n\n    /**\n     * Shows the panel\n     */\n    override show(config: string | PanelConfig) {\n        if (typeof config === 'string') {\n            config = { content: config };\n        }\n        const wasVisible = this.isVisible(config.id);\n\n        this.state.contentId = config.id || null;\n        this.state.visible = true;\n\n        if (this.state.clickHandler) {\n            this.content.removeEventListener('click', this.state.clickHandler);\n            this.content.removeEventListener('keydown', this.state.keyHandler);\n            this.state.clickHandler = null;\n            this.state.keyHandler = null;\n        }\n\n        if (config.id && this.state.width[config.id]) {\n            this.container.style.width = this.state.width[config.id];\n        } else if (config.width) {\n            this.container.style.width = config.width;\n        } else {\n            this.container.style.width = null;\n        }\n\n        this.content.innerHTML = config.content;\n        this.content.scrollTop = 0;\n        this.container.classList.add('psv-panel--open');\n\n        toggleClass(this.content, 'psv-panel-content--no-margin', config.noMargin === true);\n\n        if (config.clickHandler) {\n            this.state.clickHandler = (e) => {\n                config.clickHandler(getEventTarget(e));\n            };\n            this.state.keyHandler = (e) => {\n                if (e.key === KEY_CODES.Enter) {\n                    config.clickHandler(getEventTarget(e));\n                }\n            };\n            this.content.addEventListener('click', this.state.clickHandler);\n            this.content.addEventListener('keydown', this.state.keyHandler);\n\n            // focus the first element if possible, after animation ends\n            if (!wasVisible) {\n                setTimeout(() => {\n                    (this.content.querySelector('a,button,[tabindex]') as HTMLElement)?.focus();\n                }, 300);\n            }\n        }\n\n        this.viewer.dispatchEvent(new ShowPanelEvent(this.state.contentId));\n    }\n\n    /**\n     * Hides the panel\n     */\n    override hide(id?: string) {\n        if (this.isVisible(id)) {\n            const contentId = this.state.contentId;\n\n            this.state.visible = false;\n            this.state.contentId = null;\n\n            this.content.innerHTML = null;\n            this.container.classList.remove('psv-panel--open');\n\n            if (this.state.clickHandler) {\n                this.content.removeEventListener('click', this.state.clickHandler);\n                this.content.removeEventListener('keydown', this.state.keyHandler);\n                this.state.clickHandler = null;\n                this.state.keyHandler = null;\n            }\n\n            this.viewer.dispatchEvent(new HidePanelEvent(contentId));\n        }\n    }\n\n    private __onMouseDown(evt: MouseEvent) {\n        evt.stopPropagation();\n        this.__startResize(evt.clientX, evt.clientY);\n    }\n\n    private __onTouchStart(evt: TouchEvent) {\n        evt.stopPropagation();\n        if (evt.touches.length === 1) {\n            const touch = evt.touches[0];\n            this.__startResize(touch.clientX, touch.clientY);\n        }\n    }\n\n    private __onMouseUp(evt: MouseEvent) {\n        if (this.state.mousedown) {\n            evt.stopPropagation();\n            this.state.mousedown = false;\n            this.content.classList.remove(PANEL_CLASS_NO_INTERACTION);\n        }\n    }\n\n    private __onTouchEnd(evt: TouchEvent) {\n        if (this.state.mousedown) {\n            evt.stopPropagation();\n            if (evt.touches.length === 0) {\n                this.state.mousedown = false;\n                this.content.classList.remove(PANEL_CLASS_NO_INTERACTION);\n            }\n        }\n    }\n\n    private __onMouseMove(evt: MouseEvent) {\n        if (this.state.mousedown) {\n            evt.stopPropagation();\n            this.__resize(evt.clientX, evt.clientY);\n        }\n    }\n\n    private __onTouchMove(evt: TouchEvent) {\n        if (this.state.mousedown) {\n            const touch = evt.touches[0];\n            this.__resize(touch.clientX, touch.clientY);\n        }\n    }\n\n    private __onKeyPress(evt: KeypressEvent) {\n        if (this.isVisible() && evt.matches(KEY_CODES.Escape)) {\n            this.hide();\n            evt.preventDefault();\n        }\n    }\n\n    private __startResize(clientX: number, clientY: number) {\n        this.state.mouseX = clientX;\n        this.state.mouseY = clientY;\n        this.state.mousedown = true;\n        this.content.classList.add(PANEL_CLASS_NO_INTERACTION);\n    }\n\n    private __resize(clientX: number, clientY: number) {\n        const x = clientX;\n        const y = clientY;\n        const width = Math.max(PANEL_MIN_WIDTH, this.container.offsetWidth - (x - this.state.mouseX)) + 'px';\n\n        if (this.state.contentId) {\n            this.state.width[this.state.contentId] = width;\n        }\n\n        this.container.style.width = width;\n\n        this.state.mouseX = x;\n        this.state.mouseY = y;\n    }\n}\n","import { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { HideTooltipEvent, ShowTooltipEvent } from '../events';\nimport { addClasses, cleanCssPosition, cssPositionIsOrdered, getStyleProperty } from '../utils';\nimport { AbstractComponent } from './AbstractComponent';\n\n/**\n * Object defining the tooltip position\n */\nexport type TooltipPosition = {\n    /**\n     * Position of the tip of the arrow of the tooltip, in pixels\n     */\n    top: number;\n    /**\n     * Position of the tip of the arrow of the tooltip, in pixels\n     */\n    left: number;\n    /**\n     * Tooltip position toward it's arrow tip.\n     * Accepted values are combinations of `top`, `center`, `bottom` and `left`, `center`, `right`.\n     */\n    position?: string | [string, string];\n    /**\n     * @internal\n     */\n    box?: { width: number; height: number };\n};\n\n/**\n * Configuration for {@link Viewer.createTooltip}\n */\nexport type TooltipConfig = TooltipPosition & {\n    /**\n     * HTML content of the tooltip\n     */\n    content: string;\n    /**\n     * Additional CSS class added to the tooltip\n     */\n    className?: string;\n    /**\n     * CSS properties added to the tooltip\n     */\n    style?: Record<string, string>;\n    /**\n     * Userdata associated to the tooltip\n     */\n    data?: any;\n};\n\ntype TooltipStyle = {\n    posClass: [string, string];\n    width: number;\n    height: number;\n    top: number;\n    left: number;\n    arrowTop: number;\n    arrowLeft: number;\n};\n\nconst enum TooltipState {\n    NONE,\n    SHOWING,\n    HIDING,\n    READY,\n}\n\n/**\n * Tooltip component\n * Never instanciate tooltips directly use {@link Viewer#createTooltip} instead\n */\nexport class Tooltip extends AbstractComponent {\n    /**\n     * @internal\n     */\n    protected override readonly state = {\n        visible: true,\n        arrow: 0,\n        border: 0,\n        state: TooltipState.NONE,\n        width: 0,\n        height: 0,\n        pos: '',\n        config: null as TooltipPosition,\n        data: null as any,\n        hideTimeout: null as ReturnType<typeof setTimeout>,\n    };\n\n    private readonly content: HTMLElement;\n    private readonly arrow: HTMLElement;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer, config: TooltipConfig) {\n        super(viewer, {\n            className: 'psv-tooltip',\n        });\n\n        this.content = document.createElement('div');\n        this.content.className = 'psv-tooltip-content';\n        this.container.appendChild(this.content);\n\n        this.arrow = document.createElement('div');\n        this.arrow.className = 'psv-tooltip-arrow';\n        this.container.appendChild(this.arrow);\n\n        this.container.addEventListener('transitionend', this);\n\n        // allows to interact with static tooltips\n        this.container.addEventListener('touchdown', e => e.stopPropagation());\n        this.container.addEventListener('mousedown', e => e.stopPropagation());\n\n        this.container.style.top = '-1000px';\n        this.container.style.left = '-1000px';\n\n        this.show(config);\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        if (e.type === 'transitionend') {\n            this.__onTransitionEnd(e as TransitionEvent);\n        }\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        clearTimeout(this.state.hideTimeout);\n        delete this.state.data;\n        super.destroy();\n    }\n\n    /**\n     * @throws {@link PSVError} always\n     * @internal\n     */\n    override toggle() {\n        throw new PSVError('Tooltip cannot be toggled');\n    }\n\n    /**\n     * Displays the tooltip on the viewer\n     * @internal\n     */\n    override show(config: TooltipConfig) {\n        if (this.state.state !== TooltipState.NONE) {\n            throw new PSVError('Initialized tooltip cannot be re-initialized');\n        }\n\n        if (config.className) {\n            addClasses(this.container, config.className);\n        }\n        if (config.style) {\n            Object.assign(this.container.style, config.style);\n        }\n\n        this.state.state = TooltipState.READY;\n\n        this.update(config.content, config);\n\n        this.state.data = config.data;\n        this.state.state = TooltipState.SHOWING;\n\n        this.viewer.dispatchEvent(new ShowTooltipEvent(this, this.state.data));\n\n        this.__waitImages();\n    }\n\n    /**\n     * Updates the content of the tooltip, optionally with a new position\n     * @throws {@link PSVError} if the configuration is invalid\n     */\n    update(content: string, config?: TooltipPosition) {\n        this.content.innerHTML = content;\n\n        const rect = this.container.getBoundingClientRect();\n        this.state.width = rect.right - rect.left;\n        this.state.height = rect.bottom - rect.top;\n        this.state.arrow = parseInt(getStyleProperty(this.arrow, 'border-top-width'), 10);\n        this.state.border = parseInt(getStyleProperty(this.container, 'border-top-left-radius'), 10);\n\n        this.move(config ?? this.state.config);\n        this.__waitImages();\n    }\n\n    /**\n     * Moves the tooltip to a new position\n     * @throws {@link PSVError} if the configuration is invalid\n     */\n    move(config: TooltipPosition) {\n        if (this.state.state !== TooltipState.SHOWING && this.state.state !== TooltipState.READY) {\n            throw new PSVError('Uninitialized tooltip cannot be moved');\n        }\n\n        config.box = config.box ?? this.state.config?.box ?? { width: 0, height: 0 };\n        this.state.config = config;\n\n        const t = this.container;\n        const a = this.arrow;\n\n        // compute size\n        const style: TooltipStyle = {\n            posClass: cleanCssPosition(config.position, { allowCenter: false, cssOrder: false }) || ['top', 'center'],\n            width: this.state.width,\n            height: this.state.height,\n            top: 0,\n            left: 0,\n            arrowTop: 0,\n            arrowLeft: 0,\n        };\n\n        // set initial position\n        this.__computeTooltipPosition(style, config);\n\n        // correct position if overflow\n        let swapY = null;\n        let swapX = null;\n        if (style.top < 0) {\n            swapY = 'bottom';\n        } else if (style.top + style.height > this.viewer.state.size.height) {\n            swapY = 'top';\n        }\n        if (style.left < 0) {\n            swapX = 'right';\n        } else if (style.left + style.width > this.viewer.state.size.width) {\n            swapX = 'left';\n        }\n        if (swapX || swapY) {\n            const ordered = cssPositionIsOrdered(style.posClass);\n            if (swapY) {\n                style.posClass[ordered ? 0 : 1] = swapY;\n            }\n            if (swapX) {\n                style.posClass[ordered ? 1 : 0] = swapX;\n            }\n            this.__computeTooltipPosition(style, config);\n        }\n\n        // apply position\n        t.style.top = style.top + 'px';\n        t.style.left = style.left + 'px';\n\n        a.style.top = style.arrowTop + 'px';\n        a.style.left = style.arrowLeft + 'px';\n\n        const newPos = style.posClass.join('-');\n        if (newPos !== this.state.pos) {\n            t.classList.remove(`psv-tooltip--${this.state.pos}`);\n\n            this.state.pos = newPos;\n            t.classList.add(`psv-tooltip--${this.state.pos}`);\n        }\n    }\n\n    /**\n     * Hides the tooltip\n     */\n    override hide() {\n        this.container.classList.remove('psv-tooltip--visible');\n        this.state.state = TooltipState.HIDING;\n\n        this.viewer.dispatchEvent(new HideTooltipEvent(this.state.data));\n\n        // watchdog in case the \"transitionend\" event is not received\n        const duration = parseFloat(getStyleProperty(this.container, 'transition-duration'));\n        this.state.hideTimeout = setTimeout(() => {\n            this.destroy();\n        }, duration * 2);\n    }\n\n    /**\n     * Finalize transition\n     */\n    private __onTransitionEnd(e: TransitionEvent) {\n        if (e.propertyName === 'transform') {\n            switch (this.state.state) {\n                case TooltipState.SHOWING:\n                    this.container.classList.add('psv-tooltip--visible');\n                    this.state.state = TooltipState.READY;\n                    break;\n\n                case TooltipState.HIDING:\n                    this.state.state = TooltipState.NONE;\n                    this.destroy();\n                    break;\n\n                default:\n                // nothing\n            }\n        }\n    }\n\n    /**\n     * Computes the position of the tooltip and its arrow\n     */\n    private __computeTooltipPosition(style: TooltipStyle, config: TooltipPosition) {\n        const arrow = this.state.arrow;\n        const top = config.top;\n        const height = style.height;\n        const left = config.left;\n        const width = style.width;\n        const offsetSide = arrow + this.state.border;\n        const offsetX = config.box.width / 2 + arrow * 2;\n        const offsetY = config.box.height / 2 + arrow * 2;\n\n        switch (style.posClass.join('-')) {\n            case 'top-left':\n                style.top = top - offsetY - height;\n                style.left = left + offsetSide - width;\n                style.arrowTop = height;\n                style.arrowLeft = width - offsetSide - arrow;\n                break;\n            case 'top-center':\n                style.top = top - offsetY - height;\n                style.left = left - width / 2;\n                style.arrowTop = height;\n                style.arrowLeft = width / 2 - arrow;\n                break;\n            case 'top-right':\n                style.top = top - offsetY - height;\n                style.left = left - offsetSide;\n                style.arrowTop = height;\n                style.arrowLeft = arrow;\n                break;\n            case 'bottom-left':\n                style.top = top + offsetY;\n                style.left = left + offsetSide - width;\n                style.arrowTop = -arrow * 2;\n                style.arrowLeft = width - offsetSide - arrow;\n                break;\n            case 'bottom-center':\n                style.top = top + offsetY;\n                style.left = left - width / 2;\n                style.arrowTop = -arrow * 2;\n                style.arrowLeft = width / 2 - arrow;\n                break;\n            case 'bottom-right':\n                style.top = top + offsetY;\n                style.left = left - offsetSide;\n                style.arrowTop = -arrow * 2;\n                style.arrowLeft = arrow;\n                break;\n            case 'left-top':\n                style.top = top + offsetSide - height;\n                style.left = left - offsetX - width;\n                style.arrowTop = height - offsetSide - arrow;\n                style.arrowLeft = width;\n                break;\n            case 'center-left':\n                style.top = top - height / 2;\n                style.left = left - offsetX - width;\n                style.arrowTop = height / 2 - arrow;\n                style.arrowLeft = width;\n                break;\n            case 'left-bottom':\n                style.top = top - offsetSide;\n                style.left = left - offsetX - width;\n                style.arrowTop = arrow;\n                style.arrowLeft = width;\n                break;\n            case 'right-top':\n                style.top = top + offsetSide - height;\n                style.left = left + offsetX;\n                style.arrowTop = height - offsetSide - arrow;\n                style.arrowLeft = -arrow * 2;\n                break;\n            case 'center-right':\n                style.top = top - height / 2;\n                style.left = left + offsetX;\n                style.arrowTop = height / 2 - arrow;\n                style.arrowLeft = -arrow * 2;\n                break;\n            case 'right-bottom':\n                style.top = top - offsetSide;\n                style.left = left + offsetX;\n                style.arrowTop = arrow;\n                style.arrowLeft = -arrow * 2;\n                break;\n\n            // no default\n        }\n    }\n\n    /**\n     * If the tooltip contains images, recompute its size once they are loaded\n     */\n    private __waitImages() {\n        const images = this.content.querySelectorAll('img') as NodeListOf<HTMLImageElement>;\n\n        if (images.length > 0) {\n            const promises: Array<Promise<any>> = [];\n\n            images.forEach((image) => {\n                if (!image.complete) {\n                    promises.push(\n                        new Promise((resolve) => {\n                            image.onload = resolve;\n                            image.onerror = resolve;\n                        }),\n                    );\n                }\n            });\n\n            if (promises.length) {\n                Promise.all(promises).then(() => {\n                    if (this.state.state === TooltipState.SHOWING || this.state.state === TooltipState.READY) {\n                        const rect = this.container.getBoundingClientRect();\n                        this.state.width = rect.right - rect.left;\n                        this.state.height = rect.bottom - rect.top;\n                        this.move(this.state.config);\n                    }\n                });\n            }\n        }\n    }\n}\n","import { ParsedViewerConfig } from '../model';\nimport type { Viewer } from '../Viewer';\nimport { ViewerState } from './ViewerState';\n\n/**\n * Base class for services\n */\nexport abstract class AbstractService {\n    protected readonly config: ParsedViewerConfig;\n    protected readonly state: ViewerState;\n\n    /**\n     * @internal\n     */\n    constructor(protected readonly viewer: Viewer) {\n        this.config = viewer.config;\n        this.state = viewer.state;\n    }\n\n    /**\n     * Destroys the service\n     * @internal\n     */\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    destroy() {}\n}\n","import { Euler, MathUtils, Vector3 } from 'three';\nimport { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { DEFAULTS } from '../data/config';\nimport { ANIMATION_MIN_DURATION, SPHERE_RADIUS, VIEWER_DATA } from '../data/constants';\nimport {\n    ExtendedPosition,\n    PanoData,\n    PanoramaOptions,\n    PanoramaPosition,\n    Point,\n    Position,\n    SphereCorrection,\n    TransitionOptions,\n} from '../model';\nimport {\n    AnimationOptions,\n    applyEulerInverse,\n    getAngle,\n    getShortestArc,\n    isExtendedPosition,\n    isNil,\n    parseAngle,\n    speedToDuration,\n} from '../utils';\nimport { AbstractService } from './AbstractService';\n\nconst vector3 = new Vector3();\nconst EULER_ZERO = new Euler(0, 0, 0, 'ZXY');\n\n/**\n * Collections of data converters for the viewer\n */\nexport class DataHelper extends AbstractService {\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer);\n    }\n\n    /**\n     * Converts vertical FOV to zoom level\n     */\n    fovToZoomLevel(fov: number): number {\n        const temp = Math.round(((fov - this.config.minFov) / (this.config.maxFov - this.config.minFov)) * 100);\n        return MathUtils.clamp(temp - 2 * (temp - 50), 0, 100);\n    }\n\n    /**\n     * Converts zoom level to vertical FOV\n     */\n    zoomLevelToFov(level: number): number {\n        return this.config.maxFov + (level / 100) * (this.config.minFov - this.config.maxFov);\n    }\n\n    /**\n     * Converts vertical FOV to horizontal FOV\n     */\n    vFovToHFov(vFov: number): number {\n        return MathUtils.radToDeg(2 * Math.atan(Math.tan(MathUtils.degToRad(vFov) / 2) * this.state.aspect));\n    }\n\n    /**\n     * Converts horizontal FOV to vertical FOV\n     */\n    hFovToVFov(hFov: number): number {\n        return MathUtils.radToDeg(2 * Math.atan(Math.tan(MathUtils.degToRad(hFov) / 2) / this.state.aspect));\n    }\n\n    /**\n     * @internal\n     */\n    getAnimationProperties(\n        speed: number | string,\n        targetPosition: Position,\n        targetZoom: number,\n    ): {\n        duration: number;\n        properties: AnimationOptions<{ yaw: any; pitch: any; zoom: any }>['properties'];\n    } {\n        const positionProvided = !isNil(targetPosition);\n        const zoomProvided = !isNil(targetZoom);\n\n        const properties: AnimationOptions<{ yaw: any; pitch: any; zoom: any }>['properties'] = {};\n        let duration = null;\n\n        // clean/filter position and compute duration\n        if (positionProvided) {\n            const currentPosition = this.viewer.getPosition();\n            const dYaw = getShortestArc(currentPosition.yaw, targetPosition.yaw);\n\n            properties.yaw = { start: currentPosition.yaw, end: currentPosition.yaw + dYaw };\n            properties.pitch = { start: currentPosition.pitch, end: targetPosition.pitch };\n\n            duration = speedToDuration(speed, getAngle(currentPosition, targetPosition));\n        }\n\n        // clean/filter zoom and compute duration\n        if (zoomProvided) {\n            const currentZoom = this.viewer.getZoomLevel();\n            const dZoom = Math.abs(targetZoom - currentZoom);\n\n            properties.zoom = { start: currentZoom, end: targetZoom };\n\n            if (duration === null) {\n                // if animating zoom only and a speed is given, use an arbitrary PI/4 to compute the duration\n                duration = speedToDuration(speed, ((Math.PI / 4) * dZoom) / 100);\n            }\n        }\n\n        // if nothing to animate\n        if (duration === null) {\n            if (typeof speed === 'number') {\n                duration = speed;\n            } else {\n                duration = ANIMATION_MIN_DURATION;\n            }\n        } else {\n            duration = Math.max(ANIMATION_MIN_DURATION, duration);\n        }\n\n        return { duration, properties };\n    }\n\n    /**\n     * @internal\n     */\n    getTransitionOptions(options: PanoramaOptions): TransitionOptions {\n        let transition: TransitionOptions;\n        const defaultTransition = this.config.defaultTransition ?? DEFAULTS.defaultTransition;\n\n        if (options.transition === false || options.transition === null) {\n            transition = null;\n        } else if (options.transition === true) {\n            transition = {\n                ...defaultTransition,\n            };\n        } else if (typeof options.transition === 'object') {\n            transition = {\n                ...defaultTransition,\n                ...options.transition,\n            };\n        } else {\n            transition = this.config.defaultTransition;\n        }\n\n        return transition;\n    }\n\n    /**\n     * Converts pixel texture coordinates to spherical radians coordinates\n     * @throws {@link PSVError} when the current adapter does not support texture coordinates\n     */\n    textureCoordsToSphericalCoords(point: PanoramaPosition): Position {\n        if (!this.state.textureData?.panoData) {\n            throw new PSVError('Current adapter does not support texture coordinates or no texture has been loaded');\n        }\n\n        const result = this.viewer.adapter.textureCoordsToSphericalCoords(point, this.state.textureData.panoData);\n\n        if (\n            !EULER_ZERO.equals(this.viewer.renderer.panoramaPose)\n            || !EULER_ZERO.equals(this.viewer.renderer.sphereCorrection)\n        ) {\n            this.sphericalCoordsToVector3(result, vector3);\n            vector3.applyEuler(this.viewer.renderer.panoramaPose);\n            vector3.applyEuler(this.viewer.renderer.sphereCorrection);\n            return this.vector3ToSphericalCoords(vector3);\n        } else {\n            return result;\n        }\n    }\n\n    /**\n     * Converts spherical radians coordinates to pixel texture coordinates\n     * @throws {@link PSVError} when the current adapter does not support texture coordinates\n     */\n    sphericalCoordsToTextureCoords(position: Position): PanoramaPosition {\n        if (!this.state.textureData?.panoData) {\n            throw new PSVError('Current adapter does not support texture coordinates or no texture has been loaded');\n        }\n\n        if (\n            !EULER_ZERO.equals(this.viewer.renderer.panoramaPose)\n            || !EULER_ZERO.equals(this.viewer.renderer.sphereCorrection)\n        ) {\n            this.sphericalCoordsToVector3(position, vector3);\n            applyEulerInverse(vector3, this.viewer.renderer.sphereCorrection);\n            applyEulerInverse(vector3, this.viewer.renderer.panoramaPose);\n            position = this.vector3ToSphericalCoords(vector3);\n        }\n\n        return this.viewer.adapter.sphericalCoordsToTextureCoords(position, this.state.textureData.panoData);\n    }\n\n    /**\n     * Converts spherical radians coordinates to a Vector3\n     */\n    sphericalCoordsToVector3(position: Position, vector?: Vector3, distance = SPHERE_RADIUS): Vector3 {\n        if (!vector) {\n            vector = new Vector3();\n        }\n        vector.x = distance * -Math.cos(position.pitch) * Math.sin(position.yaw);\n        vector.y = distance * Math.sin(position.pitch);\n        vector.z = distance * Math.cos(position.pitch) * Math.cos(position.yaw);\n        return vector;\n    }\n\n    /**\n     * Converts a Vector3 to spherical radians coordinates\n     */\n    vector3ToSphericalCoords(vector: Vector3): Position {\n        const phi = Math.acos(vector.y / Math.sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z));\n        const theta = Math.atan2(vector.x, vector.z);\n\n        return {\n            yaw: theta < 0 ? -theta : Math.PI * 2 - theta,\n            pitch: Math.PI / 2 - phi,\n        };\n    }\n\n    /**\n     * Converts position on the viewer to a THREE.Vector3\n     */\n    viewerCoordsToVector3(viewerPoint: Point): Vector3 {\n        const sphereIntersect = this.viewer.renderer\n            .getIntersections(viewerPoint)\n            .filter(i => i.object.userData[VIEWER_DATA]);\n\n        if (sphereIntersect.length) {\n            return sphereIntersect[0].point;\n        } else {\n            return null;\n        }\n    }\n\n    /**\n     * Converts position on the viewer to spherical radians coordinates\n     */\n    viewerCoordsToSphericalCoords(viewerPoint: Point): Position {\n        const vector = this.viewerCoordsToVector3(viewerPoint);\n        return vector ? this.vector3ToSphericalCoords(vector) : null;\n    }\n\n    /**\n     * Converts a Vector3 to position on the viewer\n     */\n    vector3ToViewerCoords(vector: Vector3): Point {\n        const vectorClone = vector.clone();\n        vectorClone.project(this.viewer.renderer.camera);\n\n        return {\n            x: Math.round(((vectorClone.x + 1) / 2) * this.state.size.width),\n            y: Math.round(((1 - vectorClone.y) / 2) * this.state.size.height),\n        };\n    }\n\n    /**\n     * Converts spherical radians coordinates to position on the viewer\n     */\n    sphericalCoordsToViewerCoords(position: Position): Point {\n        this.sphericalCoordsToVector3(position, vector3);\n        return this.vector3ToViewerCoords(vector3);\n    }\n\n    /**\n     * Checks if a point in the 3D scene is currently visible\n     */\n    isPointVisible(vector: Vector3): boolean;\n\n    /**\n     * Checks if a point on the sphere is currently visible\n     */\n    isPointVisible(position: Position): boolean;\n\n    /**\n     * @internal\n     */\n    isPointVisible(point: Vector3 | Position): boolean {\n        let vector: Vector3;\n        let viewerPoint: Point;\n\n        if (point instanceof Vector3) {\n            vector = point;\n            viewerPoint = this.vector3ToViewerCoords(point);\n        } else if (isExtendedPosition(point)) {\n            vector = this.sphericalCoordsToVector3(point, vector3);\n            viewerPoint = this.vector3ToViewerCoords(vector);\n        } else {\n            return false;\n        }\n\n        return (\n            vector.dot(this.viewer.state.direction) > 0\n            && viewerPoint.x >= 0\n            && viewerPoint.x <= this.viewer.state.size.width\n            && viewerPoint.y >= 0\n            && viewerPoint.y <= this.viewer.state.size.height\n        );\n    }\n\n    /**\n     * Converts pixel position to angles if present and ensure boundaries\n     */\n    cleanPosition(position: ExtendedPosition): Position {\n        if ('yaw' in position || 'pitch' in position) {\n            if (!('yaw' in position) || !('pitch' in position)) {\n                throw new PSVError(`Position is missing 'yaw' or 'pitch'`);\n            }\n            return {\n                yaw: parseAngle(position.yaw),\n                pitch: parseAngle(position.pitch, true),\n            };\n        } else {\n            return this.textureCoordsToSphericalCoords(position);\n        }\n    }\n\n    /**\n     * Ensure a SphereCorrection object is valid\n     */\n    cleanSphereCorrection(sphereCorrection: SphereCorrection): SphereCorrection<number> {\n        return {\n            pan: parseAngle(sphereCorrection?.pan || 0),\n            tilt: parseAngle(sphereCorrection?.tilt || 0, true),\n            roll: parseAngle(sphereCorrection?.roll || 0, true, false),\n        };\n    }\n\n    /**\n     * Parse the pose angles of the pano data\n     */\n    cleanPanoramaPose(panoData: PanoData): SphereCorrection<number> {\n        return {\n            pan: MathUtils.degToRad(panoData?.poseHeading || 0),\n            tilt: MathUtils.degToRad(panoData?.posePitch || 0),\n            roll: MathUtils.degToRad(panoData?.poseRoll || 0),\n        };\n    }\n\n    /**\n     * Update the panorama options if the panorama files contains \"InitialView\" metadata\n     */\n    cleanPanoramaOptions(options: PanoramaOptions, panoData: PanoData): PanoramaOptions {\n        if (!panoData?.isEquirectangular) {\n            return options;\n        }\n\n        if (isNil(options.zoom) && !isNil(panoData.initialFov)) {\n            options = {\n                ...options,\n                zoom: this.fovToZoomLevel(this.hFovToVFov(panoData.initialFov)),\n            };\n        }\n        if (isNil(options.position) && !isNil(panoData.initialHeading) && !isNil(panoData.initialPitch)) {\n            options = {\n                ...options,\n                position: {\n                    yaw: parseAngle(panoData.initialHeading),\n                    pitch: parseAngle(panoData.initialPitch, true),\n                },\n            };\n        }\n        return options;\n    }\n}\n","import { MathUtils, Mesh } from 'three';\nimport {\n    ACTIONS,\n    CAPTURE_EVENTS_CLASS,\n    CTRLZOOM_TIMEOUT,\n    DBLCLICK_DELAY,\n    IDS,\n    KEY_CODES,\n    LONGTOUCH_DELAY,\n    MOVE_THRESHOLD,\n    TWOFINGERSOVERLAY_DELAY,\n    VIEWER_DATA,\n} from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport {\n    BeforeRenderEvent,\n    ClickEvent,\n    DoubleClickEvent,\n    FullscreenEvent,\n    KeypressEvent,\n    ObjectEnterEvent,\n    ObjectHoverEvent,\n    ObjectLeaveEvent,\n    StopAllEvent,\n    ViewerEvents,\n} from '../events';\nimport gestureIcon from '../icons/gesture.svg';\nimport mousewheelIcon from '../icons/mousewheel.svg';\nimport { ClickData, Point, Position } from '../model';\nimport {\n    clone,\n    getEventTarget,\n    getMatchingTarget,\n    getPosition,\n    getTouchData,\n    isEmpty,\n    keyPressMatch,\n    throttle,\n} from '../utils';\nimport { PressHandler } from '../utils/PressHandler';\nimport type { Viewer } from '../Viewer';\nimport { AbstractService } from './AbstractService';\n\nclass Step {\n    static IDLE = 0;\n    static CLICK = 1;\n    static MOVING = 2;\n\n    private $: number = Step.IDLE;\n\n    is(...steps: number[]): boolean {\n        return steps.some(step => this.$ & step);\n    }\n\n    set(step: number) {\n        this.$ = step;\n    }\n\n    add(step: number) {\n        this.$ |= step;\n    }\n\n    remove(step: number) {\n        this.$ &= ~step;\n    }\n}\n\n/**\n * Events handler\n * @internal\n */\nexport class EventsHandler extends AbstractService {\n    private readonly data = {\n        /** start x position of the click/touch */\n        startMouseX: 0,\n        /** start y position of the click/touch */\n        startMouseY: 0,\n        /** current x position of the cursor */\n        mouseX: 0,\n        /** current y position of the cursor */\n        mouseY: 0,\n        /** current distance between fingers */\n        pinchDist: 0,\n        /** accumulator for smooth movement */\n        moveDelta: { yaw: 0, pitch: 0, zoom: 0 },\n        accumulatorFactor: 0,\n        /** when the Ctrl key is pressed */\n        ctrlKeyDown: false,\n        /** temporary storage of click data between two clicks */\n        dblclickData: null as ClickData,\n        dblclickTimeout: null as ReturnType<typeof setTimeout>,\n        longtouchTimeout: null as ReturnType<typeof setTimeout>,\n        twofingersTimeout: null as ReturnType<typeof setTimeout>,\n        ctrlZoomTimeout: null as ReturnType<typeof setTimeout>,\n    };\n\n    private readonly step = new Step();\n    private readonly keyHandler = new PressHandler<ACTIONS>();\n    private readonly resizeObserver = new ResizeObserver(throttle(() => this.viewer.autoSize(), 50));\n    private readonly moveThreshold = MOVE_THRESHOLD * SYSTEM.pixelRatio;\n\n    constructor(viewer: Viewer) {\n        super(viewer);\n    }\n\n    /**\n     * @internal\n     */\n    init() {\n        window.addEventListener('keydown', this, { passive: false });\n        window.addEventListener('keyup', this);\n        this.viewer.container.addEventListener('mousedown', this);\n        window.addEventListener('mousemove', this, { passive: false });\n        window.addEventListener('mouseup', this);\n        this.viewer.container.addEventListener('touchstart', this, { passive: false });\n        window.addEventListener('touchmove', this, { passive: false });\n        window.addEventListener('touchend', this, { passive: false });\n        this.viewer.container.addEventListener('wheel', this, { passive: false });\n        document.addEventListener('fullscreenchange', this);\n        this.resizeObserver.observe(this.viewer.container);\n\n        this.viewer.addEventListener(BeforeRenderEvent.type, this);\n        this.viewer.addEventListener(StopAllEvent.type, this);\n    }\n\n    override destroy() {\n        window.removeEventListener('keydown', this);\n        window.removeEventListener('keyup', this);\n        this.viewer.container.removeEventListener('mousedown', this);\n        window.removeEventListener('mousemove', this);\n        window.removeEventListener('mouseup', this);\n        this.viewer.container.removeEventListener('touchstart', this);\n        window.removeEventListener('touchmove', this);\n        window.removeEventListener('touchend', this);\n        this.viewer.container.removeEventListener('wheel', this);\n        document.removeEventListener('fullscreenchange', this);\n        this.resizeObserver.disconnect();\n\n        this.viewer.removeEventListener(BeforeRenderEvent.type, this);\n        this.viewer.removeEventListener(StopAllEvent.type, this);\n\n        clearTimeout(this.data.dblclickTimeout);\n        clearTimeout(this.data.longtouchTimeout);\n        clearTimeout(this.data.twofingersTimeout);\n        clearTimeout(this.data.ctrlZoomTimeout);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(evt: Event) {\n        switch (evt.type) {\n            case 'keydown': this.__onKeyDown(evt as KeyboardEvent); break;\n            case 'keyup': this.__onKeyUp(); break;\n            case 'mousemove': this.__onMouseMove(evt as MouseEvent); break;\n            case 'mouseup': this.__onMouseUp(evt as MouseEvent); break;\n            case 'touchmove': this.__onTouchMove(evt as TouchEvent); break;\n            case 'touchend': this.__onTouchEnd(evt as TouchEvent); break;\n            case 'fullscreenchange': this.__onFullscreenChange(); break;\n            case BeforeRenderEvent.type: this.__applyMoveDelta(); break;\n            case StopAllEvent.type: this.__clearMoveDelta(); break;\n        }\n\n        if (!getMatchingTarget(evt, '.' + CAPTURE_EVENTS_CLASS)) {\n            switch (evt.type) {\n                case 'mousedown': this.__onMouseDown(evt as MouseEvent); break;\n                case 'touchstart': this.__onTouchStart(evt as TouchEvent); break;\n                case 'wheel': this.__onMouseWheel(evt as WheelEvent); break;\n            }\n        }\n    }\n\n    /**\n     * Handles keyboard events\n     */\n    private __onKeyDown(e: KeyboardEvent) {\n        if (this.config.mousewheelCtrlKey) {\n            this.data.ctrlKeyDown = e.key === KEY_CODES.Control;\n\n            if (this.data.ctrlKeyDown) {\n                clearTimeout(this.data.ctrlZoomTimeout);\n                this.viewer.overlay.hide(IDS.CTRL_ZOOM);\n            }\n        }\n\n        if (!this.viewer.dispatchEvent(new KeypressEvent(e.key, e))) {\n            return;\n        }\n\n        if (!this.state.keyboardEnabled || !this.config.keyboardActions || this.keyHandler.pending) {\n            return;\n        }\n\n        for (const [pattern, action] of Object.entries(this.config.keyboardActions)) {\n            if (keyPressMatch(e, pattern)) {\n                if (typeof action === 'function') {\n                    action(this.viewer, e);\n                } else {\n                    if (action !== ACTIONS.ZOOM_IN && action !== ACTIONS.ZOOM_OUT) {\n                        this.viewer.stopAll();\n                    }\n\n                    switch (action) {\n                        case ACTIONS.ROTATE_UP: this.viewer.dynamics.position.roll({ pitch: false }); break;\n                        case ACTIONS.ROTATE_DOWN: this.viewer.dynamics.position.roll({ pitch: true }); break;\n                        case ACTIONS.ROTATE_RIGHT: this.viewer.dynamics.position.roll({ yaw: false }); break;\n                        case ACTIONS.ROTATE_LEFT: this.viewer.dynamics.position.roll({ yaw: true }); break;\n                        case ACTIONS.ZOOM_IN: this.viewer.dynamics.zoom.roll(false); break;\n                        case ACTIONS.ZOOM_OUT: this.viewer.dynamics.zoom.roll(true); break;\n                    }\n\n                    this.keyHandler.down(action);\n                }\n\n                e.preventDefault();\n                return;\n            }\n        }\n    }\n\n    /**\n     * Handles keyboard events\n     */\n    private __onKeyUp() {\n        this.data.ctrlKeyDown = false;\n\n        if (!this.state.keyboardEnabled) {\n            return;\n        }\n\n        this.keyHandler.up((action) => {\n            if (action === ACTIONS.ZOOM_IN || action === ACTIONS.ZOOM_OUT) {\n                this.viewer.dynamics.zoom.stop();\n            } else {\n                this.viewer.dynamics.position.stop();\n                this.viewer.resetIdleTimer();\n            }\n        });\n    }\n\n    /**\n     * Handles mouse down events\n     */\n    private __onMouseDown(evt: MouseEvent) {\n        this.step.add(Step.CLICK);\n        this.data.startMouseX = evt.clientX;\n        this.data.startMouseY = evt.clientY;\n\n        if (this.config.mousemove) {\n            evt.preventDefault();\n        }\n    }\n\n    /**\n     *Handles mouse up events\n     */\n    private __onMouseUp(evt: MouseEvent) {\n        if (this.step.is(Step.CLICK, Step.MOVING)) {\n            this.__stopMove(evt.clientX, evt.clientY, evt, evt.button === 2);\n        }\n    }\n\n    /**\n     * Handles mouse move events\n     */\n    private __onMouseMove(evt: MouseEvent) {\n        if (this.config.mousemove && this.step.is(Step.CLICK, Step.MOVING)) {\n            evt.preventDefault();\n            this.__doMove(evt.clientX, evt.clientY);\n        }\n\n        this.__handleObjectsEvents(evt);\n    }\n\n    /**\n     * Handles touch events\n     */\n    private __onTouchStart(evt: TouchEvent) {\n        if (evt.touches.length === 1) {\n            this.step.add(Step.CLICK);\n            this.data.startMouseX = evt.touches[0].clientX;\n            this.data.startMouseY = evt.touches[0].clientY;\n\n            if (!this.data.longtouchTimeout) {\n                this.data.longtouchTimeout = setTimeout(() => {\n                    const touch = evt.touches[0];\n                    this.__stopMove(touch.clientX, touch.clientY, evt, true);\n                    this.data.longtouchTimeout = null;\n                }, LONGTOUCH_DELAY);\n            }\n        } else if (evt.touches.length === 2) {\n            this.step.set(Step.IDLE);\n            this.__cancelLongTouch();\n\n            if (this.config.mousemove) {\n                this.__cancelTwoFingersOverlay();\n                this.__startMoveZoom(evt);\n                evt.preventDefault();\n            }\n        }\n    }\n\n    /**\n     * Handles touch events\n     */\n    private __onTouchEnd(evt: TouchEvent) {\n        this.__cancelLongTouch();\n\n        if (this.step.is(Step.CLICK, Step.MOVING)) {\n            evt.preventDefault();\n            this.__cancelTwoFingersOverlay();\n\n            if (evt.touches.length === 1) {\n                this.__stopMove(this.data.mouseX, this.data.mouseY);\n            } else if (evt.touches.length === 0) {\n                const touch = evt.changedTouches[0];\n                this.__stopMove(touch.clientX, touch.clientY, evt);\n            }\n        }\n    }\n\n    /**\n     * Handles touch move events\n     */\n    private __onTouchMove(evt: TouchEvent) {\n        this.__cancelLongTouch();\n\n        if (!this.config.mousemove) {\n            return;\n        }\n\n        if (evt.touches.length === 1) {\n            if (this.config.touchmoveTwoFingers) {\n                if (this.step.is(Step.CLICK) && !this.data.twofingersTimeout) {\n                    this.data.twofingersTimeout = setTimeout(() => {\n                        this.viewer.overlay.show({\n                            id: IDS.TWO_FINGERS,\n                            image: gestureIcon,\n                            title: this.config.lang.twoFingers,\n                        });\n                    }, TWOFINGERSOVERLAY_DELAY);\n                }\n            } else if (this.step.is(Step.CLICK, Step.MOVING)) {\n                evt.preventDefault();\n                const touch = evt.touches[0];\n                this.__doMove(touch.clientX, touch.clientY);\n            }\n        } else {\n            this.__doMoveZoom(evt);\n            this.__cancelTwoFingersOverlay();\n        }\n    }\n\n    /**\n     * Cancel the long touch timer if any\n     */\n    private __cancelLongTouch() {\n        if (this.data.longtouchTimeout) {\n            clearTimeout(this.data.longtouchTimeout);\n            this.data.longtouchTimeout = null;\n        }\n    }\n\n    /**\n     * Cancel the two fingers overlay timer if any\n     */\n    private __cancelTwoFingersOverlay() {\n        if (this.config.touchmoveTwoFingers) {\n            if (this.data.twofingersTimeout) {\n                clearTimeout(this.data.twofingersTimeout);\n                this.data.twofingersTimeout = null;\n            }\n            this.viewer.overlay.hide(IDS.TWO_FINGERS);\n        }\n    }\n\n    /**\n     * Handles mouse wheel events\n     */\n    private __onMouseWheel(evt: WheelEvent) {\n        if (!this.config.mousewheel || !evt.deltaY) {\n            return;\n        }\n\n        if (this.config.mousewheelCtrlKey && !this.data.ctrlKeyDown) {\n            this.viewer.overlay.show({\n                id: IDS.CTRL_ZOOM,\n                image: mousewheelIcon,\n                title: this.config.lang.ctrlZoom,\n            });\n\n            clearTimeout(this.data.ctrlZoomTimeout);\n            this.data.ctrlZoomTimeout = setTimeout(() => this.viewer.overlay.hide(IDS.CTRL_ZOOM), CTRLZOOM_TIMEOUT);\n\n            return;\n        }\n\n        evt.preventDefault();\n        evt.stopPropagation();\n\n        const delta = (evt.deltaY / Math.abs(evt.deltaY)) * 5 * this.config.zoomSpeed;\n        if (delta !== 0) {\n            this.viewer.dynamics.zoom.step(-delta, 5);\n        }\n    }\n\n    /**\n     * Handles fullscreen events\n     */\n    private __onFullscreenChange() {\n        const fullscreen = this.viewer.isFullscreenEnabled();\n\n        if (this.config.keyboard === 'fullscreen') {\n            if (fullscreen) {\n                this.viewer.startKeyboardControl();\n            } else {\n                this.viewer.stopKeyboardControl();\n            }\n        }\n\n        this.viewer.dispatchEvent(new FullscreenEvent(fullscreen));\n    }\n\n    /**\n     * Resets all state variables\n     */\n    private __resetMove() {\n        this.step.set(Step.IDLE);\n        this.data.mouseX = 0;\n        this.data.mouseY = 0;\n        this.data.startMouseX = 0;\n        this.data.startMouseY = 0;\n    }\n\n    /**\n     * Initializes the combines move and zoom\n     */\n    private __startMoveZoom(evt: TouchEvent) {\n        this.viewer.stopAll();\n        this.__resetMove();\n\n        const touchData = getTouchData(evt);\n\n        this.step.set(Step.MOVING);\n        this.data.accumulatorFactor = this.config.moveInertia;\n        ({\n            distance: this.data.pinchDist,\n            center: { x: this.data.mouseX, y: this.data.mouseY },\n        } = touchData);\n    }\n\n    /**\n     * Stops the movement\n     * @description If the move threshold was not reached a click event is triggered\n     */\n    private __stopMove(clientX: number, clientY: number, event?: Event, rightclick = false) {\n        if (this.step.is(Step.CLICK) && !this.__moveThresholdReached(clientX, clientY)) {\n            this.__doClick(clientX, clientY, event, rightclick);\n        }\n\n        if (this.config.moveInertia) {\n            this.data.accumulatorFactor = Math.pow(this.config.moveInertia, 0.5);\n        }\n\n        this.__resetMove();\n        this.viewer.resetIdleTimer();\n    }\n\n    /**\n     * Triggers an event with all coordinates when a simple click is performed\n     */\n    private __doClick(clientX: number, clientY: number, event?: Event, rightclick = false) {\n        const boundingRect = this.viewer.container.getBoundingClientRect();\n\n        const viewerX = clientX - boundingRect.left;\n        const viewerY = clientY - boundingRect.top;\n\n        const intersections = this.viewer.renderer.getIntersections({ x: viewerX, y: viewerY });\n        const sphereIntersection = intersections.find(i => i.object.userData[VIEWER_DATA]);\n\n        if (sphereIntersection) {\n            const sphericalCoords = this.viewer.dataHelper.vector3ToSphericalCoords(sphereIntersection.point);\n\n            const data: ClickData = {\n                rightclick: rightclick,\n                originalEvent: event,\n                target: getEventTarget(event),\n                clientX,\n                clientY,\n                viewerX,\n                viewerY,\n                yaw: sphericalCoords.yaw,\n                pitch: sphericalCoords.pitch,\n                objects: intersections.map(i => i.object).filter(o => !o.userData[VIEWER_DATA]),\n            };\n\n            try {\n                const textureCoords = this.viewer.dataHelper.sphericalCoordsToTextureCoords(data);\n                Object.assign(data, textureCoords);\n            } catch {\n                // nothing\n            }\n\n            if (!this.data.dblclickTimeout) {\n                this.viewer.dispatchEvent(new ClickEvent(data));\n\n                this.data.dblclickData = clone(data);\n                this.data.dblclickTimeout = setTimeout(() => {\n                    this.data.dblclickTimeout = null;\n                    this.data.dblclickData = null;\n                }, DBLCLICK_DELAY);\n            } else {\n                if (\n                    Math.abs(this.data.dblclickData.clientX - data.clientX) < this.moveThreshold\n                    && Math.abs(this.data.dblclickData.clientY - data.clientY) < this.moveThreshold\n                ) {\n                    this.viewer.dispatchEvent(new DoubleClickEvent(this.data.dblclickData));\n                }\n\n                clearTimeout(this.data.dblclickTimeout);\n                this.data.dblclickTimeout = null;\n                this.data.dblclickData = null;\n            }\n        }\n    }\n\n    /**\n     * Trigger events for observed THREE objects\n     */\n    private __handleObjectsEvents(evt: MouseEvent) {\n        if (!isEmpty(this.state.objectsObservers) && evt.composedPath().includes(this.viewer.container)) {\n            const viewerPos = getPosition(this.viewer.container);\n\n            const viewerPoint: Point = {\n                x: evt.clientX - viewerPos.x,\n                y: evt.clientY - viewerPos.y,\n            };\n\n            const intersections = this.viewer.renderer.getIntersections(viewerPoint);\n\n            const emit = (\n                object: Mesh,\n                key: string,\n                evtCtor: new (e: MouseEvent, o: Mesh, pt: Point, data: any) => ViewerEvents,\n            ) => {\n                this.viewer.dispatchEvent(new evtCtor(evt, object, viewerPoint, key));\n            };\n\n            for (const [key, object] of Object.entries(this.state.objectsObservers) as Array<[string, Mesh | null]>) {\n                const intersection = intersections.find(i => i.object.userData[key]);\n\n                if (intersection) {\n                    if (object && intersection.object !== object) {\n                        emit(object, key, ObjectLeaveEvent);\n                        this.state.objectsObservers[key] = null;\n                    }\n\n                    if (!object) {\n                        this.state.objectsObservers[key] = intersection.object;\n                        emit(intersection.object, key, ObjectEnterEvent);\n                    } else {\n                        emit(intersection.object, key, ObjectHoverEvent);\n                    }\n                } else if (object) {\n                    emit(object, key, ObjectLeaveEvent);\n                    this.state.objectsObservers[key] = null;\n                }\n            }\n        }\n    }\n\n    /**\n     * Starts moving when crossing moveThreshold and performs movement\n     */\n    private __doMove(clientX: number, clientY: number) {\n        if (this.step.is(Step.CLICK) && this.__moveThresholdReached(clientX, clientY)) {\n            this.viewer.stopAll();\n            this.__resetMove();\n            this.step.set(Step.MOVING);\n            this.data.mouseX = clientX;\n            this.data.mouseY = clientY;\n            this.data.accumulatorFactor = this.config.moveInertia;\n        } else if (this.step.is(Step.MOVING)) {\n            const x = (clientX - this.data.mouseX) * Math.cos(this.state.roll) - (clientY - this.data.mouseY) * Math.sin(this.state.roll);\n            const y = (clientY - this.data.mouseY) * Math.cos(this.state.roll) + (clientX - this.data.mouseX) * Math.sin(this.state.roll);\n\n            const rotation: Position = {\n                yaw: this.config.moveSpeed * (x / this.state.size.width) * MathUtils.degToRad(this.state.hFov),\n                pitch: this.config.moveSpeed * (y / this.state.size.height) * MathUtils.degToRad(this.state.vFov),\n            };\n\n            this.data.moveDelta.yaw += rotation.yaw;\n            this.data.moveDelta.pitch += rotation.pitch;\n\n            this.data.mouseX = clientX;\n            this.data.mouseY = clientY;\n        }\n    }\n\n    /**\n     * Checks if the cursor was move beyond the move threshold\n     */\n    private __moveThresholdReached(clientX: number, clientY: number) {\n        return (\n            Math.abs(clientX - this.data.startMouseX) >= this.moveThreshold\n            || Math.abs(clientY - this.data.startMouseY) >= this.moveThreshold\n        );\n    }\n\n    /**\n     * Perfoms combined move and zoom\n     */\n    private __doMoveZoom(evt: TouchEvent) {\n        if (this.step.is(Step.MOVING)) {\n            evt.preventDefault();\n\n            const touchData = getTouchData(evt);\n\n            this.__doMove(touchData.center.x, touchData.center.y);\n\n            this.data.moveDelta.zoom += this.config.zoomSpeed * ((touchData.distance - this.data.pinchDist) / SYSTEM.pixelRatio);\n\n            this.data.pinchDist = touchData.distance;\n        }\n    }\n\n    private __applyMoveDelta() {\n        const EPS = 0.001;\n\n        if (Math.abs(this.data.moveDelta.yaw) > 0 || Math.abs(this.data.moveDelta.pitch) > 0) {\n            const currentPosition = this.viewer.getPosition();\n            this.viewer.rotate({\n                yaw: currentPosition.yaw - this.data.moveDelta.yaw * (1 - this.config.moveInertia),\n                pitch: currentPosition.pitch + this.data.moveDelta.pitch * (1 - this.config.moveInertia),\n            });\n\n            this.data.moveDelta.yaw *= this.data.accumulatorFactor;\n            this.data.moveDelta.pitch *= this.data.accumulatorFactor;\n\n            if (Math.abs(this.data.moveDelta.yaw) <= EPS) {\n                this.data.moveDelta.yaw = 0;\n            }\n            if (Math.abs(this.data.moveDelta.pitch) <= EPS) {\n                this.data.moveDelta.pitch = 0;\n            }\n        }\n\n        if (Math.abs(this.data.moveDelta.zoom) > 0) {\n            const currentZoom = this.viewer.getZoomLevel();\n            this.viewer.zoom(currentZoom + this.data.moveDelta.zoom * (1 - this.config.moveInertia));\n\n            this.data.moveDelta.zoom *= this.config.moveInertia;\n\n            if (Math.abs(this.data.moveDelta.zoom) <= EPS) {\n                this.data.moveDelta.zoom = 0;\n            }\n        }\n    }\n\n    private __clearMoveDelta() {\n        this.data.moveDelta.yaw = 0;\n        this.data.moveDelta.pitch = 0;\n        this.data.moveDelta.zoom = 0;\n    }\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><path fill=\"currentColor\" d=\"M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z\"/><!--Created by AomAm from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"10 17 79 79\"><path fill=\"currentColor\" d=\"M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z\"/><!-- Created by Icon Island from the Noun Project --></svg>\n","import {\n    Box3,\n    ColorManagement,\n    Euler,\n    Frustum,\n    Group,\n    Intersection,\n    LinearSRGBColorSpace,\n    LinearToneMapping,\n    MathUtils,\n    Matrix4,\n    Mesh,\n    MeshBasicMaterial,\n    Object3D,\n    PerspectiveCamera,\n    Raycaster,\n    Scene,\n    SphereGeometry,\n    Vector2,\n    Vector3,\n    WebGLRenderTarget,\n    WebGLRenderer,\n} from 'three';\nimport { SPHERE_RADIUS, VIEWER_DATA } from '../data/constants';\nimport { SYSTEM } from '../data/system';\nimport {\n    BeforeAnimateEvent,\n    BeforeRenderEvent,\n    ConfigChangedEvent,\n    PositionUpdatedEvent,\n    RenderEvent,\n    RollUpdatedEvent,\n    SizeUpdatedEvent,\n    ZoomUpdatedEvent,\n} from '../events';\nimport {\n    PanoData,\n    PanoramaOptions,\n    Point,\n    SphereCorrection,\n    TextureData,\n    TransitionOptions,\n} from '../model';\nimport { Animation, isNil } from '../utils';\nimport { Viewer } from '../Viewer';\nimport { AbstractService } from './AbstractService';\n\n// https://discourse.threejs.org/t/updates-to-color-management-in-three-js-r152/50791\nColorManagement.enabled = false;\n\nconst vector2 = new Vector2();\nconst matrix4 = new Matrix4();\nconst box3 = new Box3();\n\nexport type CustomRenderer = Pick<WebGLRenderer, 'render'> & {\n    getIntersections?(raycaster: Raycaster, vector: Vector2): Array<Intersection<Mesh>>;\n};\n\n/**\n * Controller for the three.js scene\n */\nexport class Renderer extends AbstractService {\n    private readonly renderer: WebGLRenderer;\n    private readonly scene: Scene;\n    /** @internal */\n    public readonly camera: PerspectiveCamera;\n    /** @internal */\n    public mesh: Object3D;\n    private meshContainer: Group;\n    private readonly raycaster: Raycaster;\n    private readonly frustum: Frustum;\n    private readonly container: HTMLElement;\n\n    private timestamp?: number;\n    private frustumNeedsUpdate = true;\n    private customRenderer?: CustomRenderer;\n\n    get panoramaPose(): Euler {\n        return this.mesh.rotation;\n    }\n\n    get sphereCorrection(): Euler {\n        return this.meshContainer.rotation;\n    }\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer);\n\n        this.renderer = new WebGLRenderer(this.config.rendererParameters);\n        this.renderer.setPixelRatio(SYSTEM.pixelRatio);\n        // https://discourse.threejs.org/t/updates-to-color-management-in-three-js-r152/50791\n        this.renderer.outputColorSpace = LinearSRGBColorSpace;\n        this.renderer.toneMapping = LinearToneMapping;\n        this.renderer.domElement.className = 'psv-canvas';\n        this.renderer.domElement.style.background = this.config.canvasBackground;\n\n        this.scene = new Scene();\n\n        this.camera = new PerspectiveCamera(50, 16 / 9, 0.1, 2 * SPHERE_RADIUS);\n        this.camera.matrixAutoUpdate = false;\n\n        // mesh used to detect clicks on the viewer\n        const raycasterMesh = new Mesh(\n            new SphereGeometry(SPHERE_RADIUS).scale(-1, 1, 1),\n            new MeshBasicMaterial({ opacity: 0, transparent: true, depthTest: false, depthWrite: false }),\n        );\n        raycasterMesh.userData = { [VIEWER_DATA]: true };\n        this.scene.add(raycasterMesh);\n\n        this.raycaster = new Raycaster();\n        this.frustum = new Frustum();\n\n        this.container = document.createElement('div');\n        this.container.className = 'psv-canvas-container';\n        this.container.appendChild(this.renderer.domElement);\n        this.viewer.container.appendChild(this.container);\n\n        this.container.addEventListener('contextmenu', e => e.preventDefault());\n\n        this.viewer.addEventListener(SizeUpdatedEvent.type, this);\n        this.viewer.addEventListener(ZoomUpdatedEvent.type, this);\n        this.viewer.addEventListener(PositionUpdatedEvent.type, this);\n        this.viewer.addEventListener(RollUpdatedEvent.type, this);\n        this.viewer.addEventListener(ConfigChangedEvent.type, this);\n\n        this.hide();\n    }\n\n    /**\n     * @internal\n     */\n    init() {\n        this.show();\n        this.renderer.setAnimationLoop(t => this.__renderLoop(t));\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        // destroy ThreeJS\n        this.renderer.setAnimationLoop(null);\n        this.cleanScene(this.scene);\n        this.renderer.dispose();\n\n        // remove container\n        this.viewer.container.removeChild(this.container);\n\n        this.viewer.removeEventListener(SizeUpdatedEvent.type, this);\n        this.viewer.removeEventListener(ZoomUpdatedEvent.type, this);\n        this.viewer.removeEventListener(PositionUpdatedEvent.type, this);\n        this.viewer.removeEventListener(RollUpdatedEvent.type, this);\n        this.viewer.removeEventListener(ConfigChangedEvent.type, this);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case SizeUpdatedEvent.type: this.__onSizeUpdated(); break;\n            case ZoomUpdatedEvent.type: this.__onZoomUpdated(); break;\n            case PositionUpdatedEvent.type: this.__onPositionUpdated(); break;\n            case RollUpdatedEvent.type: this.__onPositionUpdated(); break;\n            case ConfigChangedEvent.type:\n                if ((e as ConfigChangedEvent).containsOptions('fisheye')) {\n                    this.__onPositionUpdated();\n                }\n                if ((e as ConfigChangedEvent).containsOptions('canvasBackground')) {\n                    this.renderer.domElement.style.background = this.config.canvasBackground;\n                }\n                break;\n        }\n    }\n\n    /**\n     * Hides the viewer\n     */\n    hide() {\n        this.container.style.opacity = '0';\n    }\n\n    /**\n     * Shows the viewer\n     */\n    show() {\n        this.container.style.opacity = '1';\n    }\n\n    /**\n     * Resets or replaces the THREE renderer by a custom one\n     */\n    setCustomRenderer(factory: ((renderer: WebGLRenderer) => CustomRenderer) | null) {\n        if (factory) {\n            this.customRenderer = factory(this.renderer);\n        } else {\n            this.customRenderer = null;\n        }\n        this.viewer.needsUpdate();\n    }\n\n    /**\n     * Updates the size of the renderer and the aspect of the camera\n     */\n    private __onSizeUpdated() {\n        this.renderer.setSize(this.state.size.width, this.state.size.height);\n        this.camera.aspect = this.state.aspect;\n        this.camera.updateProjectionMatrix();\n        this.viewer.needsUpdate();\n        this.frustumNeedsUpdate = true;\n    }\n\n    /**\n     * Updates the fov of the camera\n     */\n    private __onZoomUpdated() {\n        this.camera.fov = this.state.vFov;\n        this.camera.updateProjectionMatrix();\n        this.viewer.needsUpdate();\n        this.frustumNeedsUpdate = true;\n    }\n\n    /**\n     * Updates the position of the camera\n     */\n    private __onPositionUpdated() {\n        this.camera.position.set(0, 0, 0);\n        this.camera.lookAt(this.state.direction);\n        if (this.config.fisheye) {\n            this.camera.position\n                .copy(this.state.direction)\n                .multiplyScalar(this.config.fisheye / 2)\n                .negate();\n        }\n        this.camera.rotateZ(-this.state.roll);\n\n        this.camera.updateMatrix();\n        this.camera.updateMatrixWorld();\n\n        this.viewer.needsUpdate();\n        this.frustumNeedsUpdate = true;\n    }\n\n    /**\n     * Main event loop, performs a render if `state.needsUpdate` is true\n     */\n    private __renderLoop(timestamp: number) {\n        const elapsed = !this.timestamp ? 0 : timestamp - this.timestamp;\n        this.timestamp = timestamp;\n\n        this.viewer.dispatchEvent(new BeforeRenderEvent(timestamp, elapsed));\n        this.viewer.dynamics.update(elapsed);\n\n        if (this.state.needsUpdate || this.state.continuousUpdateCount > 0) {\n            this.state.needsUpdate = false;\n            (this.customRenderer || this.renderer).render(this.scene, this.camera);\n            this.viewer.dispatchEvent(new RenderEvent());\n        }\n    }\n\n    /**\n     * Applies the texture to the scene, creates the scene if needed\n     * @internal\n     */\n    setTexture(textureData: TextureData) {\n        if (!this.meshContainer) {\n            this.meshContainer = new Group();\n            this.scene.add(this.meshContainer);\n        }\n\n        if (this.state.textureData) {\n            this.viewer.adapter.disposeTexture(this.state.textureData);\n        }\n\n        if (this.mesh) {\n            this.meshContainer.remove(this.mesh);\n            this.viewer.adapter.disposeMesh(this.mesh);\n        }\n\n        this.mesh = this.viewer.adapter.createMesh(textureData.panoData);\n        this.viewer.adapter.setTexture(this.mesh, textureData, false);\n        this.meshContainer.add(this.mesh);\n\n        this.state.textureData = textureData;\n\n        this.viewer.needsUpdate();\n    }\n\n    /**\n     * Applies a panorama data pose to a Mesh\n     * @internal\n     */\n    setPanoramaPose(panoData: PanoData, mesh: Object3D = this.mesh) {\n        const cleanCorrection = this.viewer.dataHelper.cleanPanoramaPose(panoData);\n        mesh.rotation.set(-cleanCorrection.tilt, cleanCorrection.pan, cleanCorrection.roll, 'YXZ');\n    }\n\n    /**\n     * Applies a SphereCorrection to a Group\n     * @internal\n     */\n    setSphereCorrection(sphereCorrection: SphereCorrection, group: Object3D = this.meshContainer) {\n        const cleanCorrection = this.viewer.dataHelper.cleanSphereCorrection(sphereCorrection);\n        group.rotation.set(cleanCorrection.tilt, cleanCorrection.pan, cleanCorrection.roll, 'YXZ');\n    }\n\n    /**\n     * Performs transition between the current and a new texture\n     * @internal\n     */\n    transition(textureData: TextureData, options: PanoramaOptions, transition: TransitionOptions): Animation<any> {\n        // do not animate zoom in black/white transition without rotation\n        const zoomTransition = transition.effect === 'fade' || transition.rotation;\n\n        const positionProvided = !isNil(options.position);\n        const zoomProvided = !isNil(options.zoom);\n\n        const e = new BeforeAnimateEvent(\n            positionProvided ? this.viewer.dataHelper.cleanPosition(options.position) : undefined,\n            options.zoom,\n        );\n        this.viewer.dispatchEvent(e);\n\n        const tempContainer = new Group();\n        const newMesh = this.viewer.adapter.createMesh(textureData.panoData);\n        this.viewer.adapter.setTexture(newMesh, textureData, true);\n        this.viewer.adapter.setTextureOpacity(newMesh, 0);\n        this.setPanoramaPose(textureData.panoData, newMesh);\n        this.setSphereCorrection(options.sphereCorrection, tempContainer);\n\n        // rotate the new sphere to make the target position face the camera\n        if (positionProvided && !transition.rotation) {\n            const currentPosition = this.viewer.getPosition();\n\n            // rotation along the vertical axis\n            const verticalAxis = new Vector3(0, 1, 0);\n            tempContainer.rotateOnWorldAxis(verticalAxis, e.position.yaw - currentPosition.yaw);\n\n            // rotation along the camera horizontal axis\n            const horizontalAxis = new Vector3(0, 1, 0).cross(this.camera.getWorldDirection(new Vector3())).normalize();\n            tempContainer.rotateOnWorldAxis(horizontalAxis, e.position.pitch - currentPosition.pitch);\n        }\n\n        tempContainer.add(newMesh);\n        this.scene.add(tempContainer);\n\n        // make sure the new texture is transfered to the GPU before starting the animation\n        this.renderer.setRenderTarget(new WebGLRenderTarget<any>());\n        this.renderer.render(this.scene, this.camera);\n        this.renderer.setRenderTarget(null);\n\n        const { duration, properties } = this.viewer.dataHelper.getAnimationProperties(\n            transition.speed,\n            transition.rotation ? e.position : null,\n            zoomTransition ? e.zoomLevel : null,\n        );\n\n        const animation = new Animation({\n            properties: {\n                ...properties,\n                opacity: { start: 0.0, end: 1.0 },\n            },\n            duration: duration,\n            easing: 'inOutCubic',\n            onTick: (props) => {\n                switch (transition.effect) {\n                    case 'fade':\n                        this.viewer.adapter.setTextureOpacity(newMesh, props.opacity);\n                        break;\n                    case 'black':\n                    case 'white':\n                        if (props.opacity < 0.5) {\n                            this.renderer.toneMappingExposure = transition.effect === 'black'\n                                ? MathUtils.mapLinear(props.opacity, 0, 0.5, 1, 0)\n                                : MathUtils.mapLinear(props.opacity, 0, 0.5, 1, 5);\n                        } else {\n                            this.renderer.toneMappingExposure = transition.effect === 'black'\n                                ? MathUtils.mapLinear(props.opacity, 0.5, 1, 0, 1)\n                                : MathUtils.mapLinear(props.opacity, 0.5, 1, 5, 1);\n\n                            this.mesh.visible = false;\n                            this.viewer.adapter.setTextureOpacity(newMesh, 1);\n\n                            if (zoomProvided && !zoomTransition) {\n                                this.viewer.dynamics.zoom.setValue(e.zoomLevel);\n                            }\n                        }\n                        break;\n                }\n\n                if (positionProvided && transition.rotation) {\n                    this.viewer.dynamics.position.setValue({\n                        yaw: props.yaw,\n                        pitch: props.pitch,\n                    });\n                }\n                if (zoomProvided && zoomTransition) {\n                    this.viewer.dynamics.zoom.setValue(props.zoom);\n                }\n\n                this.viewer.needsUpdate();\n            },\n        });\n\n        animation.then((completed) => {\n            tempContainer.remove(newMesh);\n            this.scene.remove(tempContainer);\n\n            if (completed) {\n                // remove old texture and mesh\n                this.viewer.adapter.disposeTexture(this.state.textureData);\n                this.meshContainer.remove(this.mesh);\n                this.viewer.adapter.disposeMesh(this.mesh);\n\n                // promote new texture and mesh\n                this.mesh = newMesh;\n                this.meshContainer.add(newMesh);\n                this.state.textureData = textureData;\n\n                // apply rotations\n                this.setPanoramaPose(textureData.panoData);\n                this.setSphereCorrection(options.sphereCorrection);\n\n                if (positionProvided && !transition.rotation) {\n                    this.viewer.rotate(options.position);\n                }\n            } else {\n                this.viewer.adapter.disposeTexture(textureData);\n                this.viewer.adapter.disposeMesh(newMesh);\n            }\n        });\n\n        return animation;\n    }\n\n    /**\n     * Returns intersections with objects in the scene\n     */\n    getIntersections(viewerPoint: Point): Array<Intersection<Mesh>> {\n        vector2.x = (2 * viewerPoint.x) / this.state.size.width - 1;\n        vector2.y = (-2 * viewerPoint.y) / this.state.size.height + 1;\n\n        this.raycaster.setFromCamera(vector2, this.camera);\n\n        const intersections = this.raycaster\n            .intersectObjects(this.scene.children, true)\n            .filter(i => i.object.visible)\n            .filter(i => (i.object as Mesh).isMesh && !!i.object.userData) as Array<Intersection<Mesh>>;\n\n        if (this.customRenderer?.getIntersections) {\n            intersections.push(...this.customRenderer.getIntersections(this.raycaster, vector2));\n        }\n\n        return intersections;\n    }\n\n    /**\n     * Checks if an object/point is currently visible\n     */\n    isObjectVisible(value: Object3D | Vector3): boolean {\n        if (!value) {\n            return false;\n        }\n\n        if (this.frustumNeedsUpdate) {\n            matrix4.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse);\n            this.frustum.setFromProjectionMatrix(matrix4);\n            this.frustumNeedsUpdate = false;\n        }\n\n        if ((value as Vector3).isVector3) {\n            return this.frustum.containsPoint(value as Vector3);\n        } else if ((value as Mesh).isMesh && (value as Mesh).geometry) {\n            // Frustum.intersectsObject uses the boundingSphere by default\n            // for better precision we prefer the boundingBox\n            const mesh = value as Mesh;\n            if (!mesh.geometry.boundingBox) {\n                mesh.geometry.computeBoundingBox();\n            }\n            box3.copy(mesh.geometry.boundingBox).applyMatrix4(mesh.matrixWorld);\n            return this.frustum.intersectsBox(box3);\n        } else if ((value as Object3D).isObject3D) {\n            return this.frustum.intersectsObject(value as Object3D);\n        } else {\n            return false;\n        }\n    }\n\n    /**\n     * Adds an object to the THREE scene\n     */\n    addObject(object: Object3D) {\n        this.scene.add(object);\n    }\n\n    /**\n     * Removes an object from the THREE scene\n     */\n    removeObject(object: Object3D) {\n        this.scene.remove(object);\n    }\n\n    /**\n     * Calls `dispose` on all objects and textures\n     * @internal\n     */\n    cleanScene(object: any) {\n        const disposeMaterial = (material: any) => {\n            material.map?.dispose();\n\n            if (material.uniforms) {\n                Object.values(material.uniforms).forEach((uniform: any) => {\n                    uniform.value?.dispose?.();\n                });\n            }\n\n            material.dispose();\n        };\n\n        object.traverse((item: any) => {\n            item.geometry?.dispose();\n\n            if (item.material) {\n                if (Array.isArray(item.material)) {\n                    item.material.forEach((material: any) => {\n                        disposeMaterial(material);\n                    });\n                } else {\n                    disposeMaterial(item.material);\n                }\n            }\n\n            if (!(item instanceof Scene)) {\n                item.dispose?.();\n            }\n\n            if (item !== object) {\n                this.cleanScene(item);\n            }\n        });\n    }\n}\n","import { ImageLoader } from 'three';\n\n/**\n * ThreeJS ImageLoader that can be aborted\n */\nexport class AbortableImageLoader extends ImageLoader {\n    private _abortController = new AbortController();\n\n    override abort() {\n        this._abortController.abort();\n        this._abortController = new AbortController();\n        return this;\n    }\n\n    override load(\n        url: string,\n        onLoad: (data: HTMLImageElement) => void,\n        onProgress: (event: ProgressEvent) => void,\n        onError: (err: unknown) => void,\n    ) {\n        const abortSignal = this._abortController.signal;\n\n        const image = super.load(\n            url,\n            (data) => {\n                removeEventListeners();\n                onLoad(data);\n            },\n            onProgress,\n            (error) => {\n                removeEventListeners();\n\n                if (abortSignal.aborted) {\n                    // Simulate an error similar to the DOMException thrown by the Fetch API\n                    // (DOMException is not instanciable)\n                    const e = new Error();\n                    e.name = 'AbortError';\n                    e.message = 'The operation was aborted.';\n                    onError(e);\n                } else {\n                    onError(error);\n                }\n            },\n        );\n\n        function onAbortSignal() {\n            image.src = '';\n        }\n\n        function removeEventListeners() {\n            abortSignal.removeEventListener('abort', onAbortSignal, false);\n        }\n\n        abortSignal.addEventListener('abort', onAbortSignal, false);\n\n        return image;\n    }\n}\n","import { FileLoader } from 'three';\nimport { PSVError } from '../PSVError';\nimport type { Viewer } from '../Viewer';\nimport { Cache } from '../data/cache';\nimport { LoadProgressEvent } from '../events';\nimport { AbortableImageLoader } from '../lib/ImageLoader';\nimport { AbstractService } from './AbstractService';\n\n/**\n * Image and texture loading system\n */\nexport class TextureLoader extends AbstractService {\n    private readonly fileLoader: FileLoader;\n    private readonly imageLoader: AbortableImageLoader;\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer);\n\n        this.fileLoader = new FileLoader();\n        this.fileLoader.setResponseType('blob');\n        this.imageLoader = new AbortableImageLoader();\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        this.abortLoading();\n        super.destroy();\n    }\n\n    /**\n     * Cancels current HTTP requests\n     * @internal\n     */\n    abortLoading() {\n        this.fileLoader.abort?.();\n        this.imageLoader.abort();\n    }\n\n    /**\n     * Loads a Blob with FileLoader\n     */\n    loadFile(url: string, onProgress?: (p: number) => void, cacheKey?: string): Promise<Blob> {\n        const cached = Cache.get(url, cacheKey);\n\n        if (cached) {\n            if (cached instanceof Blob) {\n                onProgress?.(100);\n                return Promise.resolve(cached);\n            } else {\n                // unlikely case when the image has already been loaded with the ImageLoader\n                Cache.remove(url, cacheKey);\n            }\n        }\n\n        if (this.config.requestHeaders) {\n            this.fileLoader.setRequestHeader(this.config.requestHeaders(url));\n        }\n\n        this.fileLoader.setWithCredentials(this.config.withCredentials(url));\n\n        let progress = 0;\n        onProgress?.(progress);\n\n        return this.fileLoader.loadAsync(\n            url,\n            (e) => {\n                if (e.lengthComputable) {\n                    const newProgress = (e.loaded / e.total) * 100;\n                    if (newProgress > progress) {\n                        progress = newProgress;\n                        onProgress?.(progress);\n                    }\n                }\n            },\n        )\n            .then((result) => {\n                progress = 100;\n                onProgress?.(progress);\n                Cache.add(url, cacheKey, result as any as Blob);\n                return result as any as Blob;\n            });\n    }\n\n    /**\n     * Loads an image with ImageLoader or with FileLoader if progress is tracked or if request headers are configured\n     */\n    loadImage(url: string, onProgress?: (p: number) => void, cacheKey?: string): Promise<HTMLImageElement> {\n        const cached = Cache.get(url, cacheKey);\n\n        if (cached) {\n            onProgress?.(100);\n            if (cached instanceof Blob) {\n                // unlikely case when the image has already been loaded with the FileLoader\n                return this.blobToImage(cached);\n            } else {\n                return Promise.resolve(cached);\n            }\n        }\n\n        if (!onProgress && !this.config.requestHeaders) {\n            this.imageLoader.setWithCredentials(this.config.withCredentials(url));\n\n            return this.imageLoader.loadAsync(url)\n                .then((result) => {\n                    Cache.add(url, cacheKey, result);\n                    return result;\n                });\n        } else {\n            return this.loadFile(url, onProgress, cacheKey).then(blob => this.blobToImage(blob));\n        }\n    }\n\n    /**\n     * Converts a file loaded with {@link loadFile} into an image\n     */\n    blobToImage(blob: Blob): Promise<HTMLImageElement> {\n        return new Promise((resolve, reject) => {\n            const img = document.createElement('img');\n            img.onload = () => {\n                URL.revokeObjectURL(img.src);\n                resolve(img);\n            };\n            img.onerror = reject;\n            img.src = URL.createObjectURL(blob);\n        });\n    }\n\n    /**\n     * Preload a panorama file without displaying it\n     */\n    preloadPanorama(panorama: any): Promise<unknown> {\n        if (this.viewer.adapter.supportsPreload(panorama)) {\n            return this.viewer.adapter.loadTexture(panorama, false);\n        } else {\n            return Promise.reject(new PSVError('Current adapter does not support preload'));\n        }\n    }\n\n    /**\n     * @internal\n     */\n    dispatchProgress(progress: number) {\n        this.viewer.loader.setProgress(progress);\n        this.viewer.dispatchEvent(new LoadProgressEvent(Math.round(progress)));\n    }\n}\n","import { MathUtils } from 'three';\nimport { Dynamic, MultiDynamic } from '../utils';\nimport type { Viewer } from '../Viewer';\nimport { PositionUpdatedEvent, RollUpdatedEvent, ZoomUpdatedEvent } from '../events';\nimport { AbstractService } from './AbstractService';\n\nexport class ViewerDynamics extends AbstractService {\n    readonly zoom = new Dynamic(\n        (zoomLevel) => {\n            this.viewer.state.vFov = this.viewer.dataHelper.zoomLevelToFov(zoomLevel);\n            this.viewer.state.hFov = this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov);\n            this.viewer.dispatchEvent(new ZoomUpdatedEvent(zoomLevel));\n        },\n        {\n            defaultValue: this.viewer.config.defaultZoomLvl,\n            min: 0,\n            max: 100,\n            wrap: false,\n        },\n    );\n\n    readonly position = new MultiDynamic(\n        (position) => {\n            this.viewer.dataHelper.sphericalCoordsToVector3(position, this.viewer.state.direction);\n            this.viewer.dispatchEvent(new PositionUpdatedEvent(position));\n        },\n        {\n            yaw: new Dynamic(null, {\n                defaultValue: this.config.defaultYaw,\n                min: 0,\n                max: 2 * Math.PI,\n                wrap: true,\n            }),\n            pitch: new Dynamic(null, {\n                defaultValue: this.config.defaultPitch,\n                min: -Math.PI / 2,\n                max: Math.PI / 2,\n                wrap: false,\n            }),\n        },\n    );\n\n    readonly roll = new Dynamic(\n        (roll) => {\n            this.viewer.state.roll = roll;\n            this.viewer.dispatchEvent(new RollUpdatedEvent(roll));\n        },\n        {\n            defaultValue: 0,\n            min: -Math.PI,\n            max: Math.PI,\n            wrap: false,\n        },\n    );\n\n    /**\n     * @internal\n     */\n    constructor(viewer: Viewer) {\n        super(viewer);\n        this.updateSpeeds();\n    }\n\n    /**\n     * @internal\n     */\n    updateSpeeds() {\n        this.zoom.setSpeed(this.config.zoomSpeed * 50);\n        this.position.setSpeed(MathUtils.degToRad(this.config.moveSpeed * 50));\n        this.roll.setSpeed(MathUtils.degToRad(this.config.moveSpeed * 50));\n    }\n\n    /**\n     * @internal\n     */\n    update(elapsed: number) {\n        this.zoom.update(elapsed);\n        this.position.update(elapsed);\n        this.roll.update(elapsed);\n    }\n}\n","import { Mesh, Vector3 } from 'three';\nimport { SPHERE_RADIUS } from '../data/constants';\nimport { Size, TextureData } from '../model';\nimport type { Animation } from '../utils';\n\n/**\n * Internal properties of the viewer\n */\nexport class ViewerState {\n    /**\n     * when all components are loaded\n     */\n    ready = false;\n\n    /**\n     * if the view needs to be renderer\n     */\n    needsUpdate = false;\n\n    /**\n     * number of plugins requesting to continuously render the scene\n     */\n    continuousUpdateCount = 0;\n\n    /**\n     * if the keyboard events are currently listened to\n     */\n    keyboardEnabled = false;\n\n    /**\n     * direction of the camera\n     */\n    direction = new Vector3(0, 0, SPHERE_RADIUS);\n\n    /**\n     * current camera roll\n     */\n    roll = 0;\n\n    /**\n     * vertical FOV\n     */\n    vFov = 60;\n\n    /**\n     * horizontal FOV\n     */\n    hFov = 60;\n\n    /**\n     * renderer aspect ratio\n     */\n    aspect = 1;\n\n    /**\n     * currently running animation\n     */\n    animation: Animation = null;\n\n    /**\n     * currently running transition\n     */\n    transitionAnimation: Animation = null;\n\n    /**\n     * promise of the last \"setPanorama()\" call\n     */\n    loadingPromise: Promise<any> = null;\n\n    /**\n     * time of the last user action\n     */\n    idleTime = -1;\n\n    /**\n     * registered THREE objects observer\n     */\n    objectsObservers: Record<string, Mesh | null> = {};\n\n    /**\n     * size of the container\n     */\n    size: Size = {\n        width: 0,\n        height: 0,\n    };\n\n    /**\n     * Current panorama texture displayed\n     */\n    textureData: TextureData;\n\n    /**\n     * Current override of the global cursor\n     */\n    cursorOverride: string;\n\n    /**\n     * @internal\n     */\n    // eslint-disable-next-line  @typescript-eslint/no-empty-function\n    constructor() {}\n}\n","import { Object3D } from 'three';\nimport { PSVError } from './PSVError';\nimport type { AbstractAdapter } from './adapters/AbstractAdapter';\nimport type { AbstractComponent } from './components/AbstractComponent';\nimport { Loader } from './components/Loader';\nimport { Navbar } from './components/Navbar';\nimport { Notification } from './components/Notification';\nimport { Overlay } from './components/Overlay';\nimport { Panel } from './components/Panel';\nimport { Tooltip, TooltipConfig } from './components/Tooltip';\nimport { Cache } from './data/cache';\nimport { CONFIG_PARSERS, DEFAULTS, getViewerConfig, READONLY_OPTIONS } from './data/config';\nimport { IDS, VIEWER_DATA } from './data/constants';\nimport { SYSTEM } from './data/system';\nimport {\n    BeforeAnimateEvent,\n    BeforeRotateEvent,\n    ConfigChangedEvent,\n    PanoramaErrorEvent,\n    PanoramaLoadedEvent,\n    PanoramaLoadEvent,\n    ReadyEvent,\n    SizeUpdatedEvent,\n    StopAllEvent,\n    TransitionDoneEvent,\n    ViewerEvents,\n    ZoomUpdatedEvent,\n} from './events';\nimport errorIcon from './icons/error.svg';\nimport { TypedEventTarget } from './lib/TypedEventTarget';\nimport {\n    AnimateOptions,\n    CssSize,\n    ExtendedPosition,\n    PanoramaOptions,\n    ParsedViewerConfig,\n    Position,\n    Size,\n    UpdatableViewerConfig,\n    ViewerConfig,\n} from './model';\nimport type { AbstractPlugin, PluginConstructor } from './plugins/AbstractPlugin';\nimport { pluginInterop } from './plugins/AbstractPlugin';\nimport { DataHelper } from './services/DataHelper';\nimport { EventsHandler } from './services/EventsHandler';\nimport { Renderer } from './services/Renderer';\nimport { TextureLoader } from './services/TextureLoader';\nimport { ViewerDynamics } from './services/ViewerDynamics';\nimport { ViewerState } from './services/ViewerState';\nimport {\n    Animation,\n    checkClosedShadowDom,\n    checkStylesheet,\n    exitFullscreen,\n    getAbortError,\n    getElement,\n    isAbortError,\n    isExtendedPosition,\n    isFullscreenEnabled,\n    isNil,\n    logWarn,\n    requestFullscreen,\n    resolveBoolean,\n    toggleClass,\n} from './utils';\n\n/**\n * Photo Sphere Viewer controller\n */\nexport class Viewer extends TypedEventTarget<ViewerEvents> {\n    readonly state: ViewerState;\n    readonly config: ParsedViewerConfig;\n\n    readonly parent: HTMLElement;\n    readonly container: HTMLElement;\n\n    /** @internal */\n    readonly adapter: AbstractAdapter<any, any, any, Object3D>;\n    /** @internal */\n    readonly plugins: Record<string, AbstractPlugin<any>> = {};\n    /** @internal */\n    readonly dynamics: ViewerDynamics;\n\n    readonly renderer: Renderer;\n    readonly textureLoader: TextureLoader;\n    /** @internal */\n    readonly eventsHandler: EventsHandler;\n    readonly dataHelper: DataHelper;\n\n    readonly loader: Loader;\n    readonly navbar: Navbar;\n    readonly notification: Notification;\n    readonly overlay: Overlay;\n    readonly panel: Panel;\n\n    /** @internal */\n    readonly children: AbstractComponent[] = [];\n\n    constructor(config: ViewerConfig) {\n        super();\n\n        // init\n        this.parent = getElement(config.container);\n        if (!this.parent) {\n            throw new PSVError(`\"container\" element not found.`);\n        }\n\n        // @ts-ignore\n        this.parent[VIEWER_DATA] = this;\n\n        this.container = document.createElement('div');\n        this.container.classList.add('psv-container');\n        this.parent.appendChild(this.container);\n\n        checkClosedShadowDom(this.parent);\n        checkStylesheet(this.container, 'core');\n\n        this.state = new ViewerState();\n        this.config = getViewerConfig(config);\n\n        this.__setSize(this.config.size);\n\n        this.overlay = new Overlay(this);\n\n        try {\n            SYSTEM.load();\n        } catch (err) {\n            console.error(err);\n            this.showError(this.config.lang.webglError);\n            return;\n        }\n\n        Cache.init();\n\n        this.adapter = new this.config.adapter[0](this, this.config.adapter[1]);\n\n        this.renderer = new Renderer(this);\n        this.textureLoader = new TextureLoader(this);\n        this.eventsHandler = new EventsHandler(this);\n        this.dataHelper = new DataHelper(this);\n        this.dynamics = new ViewerDynamics(this);\n\n        this.adapter.init?.();\n\n        this.loader = new Loader(this);\n        this.navbar = new Navbar(this);\n        this.panel = new Panel(this);\n        this.notification = new Notification(this);\n\n        this.autoSize();\n        this.setCursor(null);\n\n        resolveBoolean(SYSTEM.isTouchEnabled, (enabled) => {\n            toggleClass(this.container, 'psv--is-touch', enabled);\n        });\n\n        // init plugins\n        this.config.plugins.forEach(([plugin, opts]) => {\n            // @ts-ignore\n            this.plugins[plugin.id] = new plugin(this, opts);\n        });\n        for (const plugin of Object.values(this.plugins)) {\n            plugin.init?.();\n        }\n\n        // init buttons\n        if (this.config.navbar) {\n            this.navbar.setButtons(this.config.navbar);\n        }\n\n        // load panorama\n        if (!this.state.loadingPromise) {\n            if (this.config.panorama) {\n                this.setPanorama(this.config.panorama, {\n                    sphereCorrection: this.config.sphereCorrection,\n                    panoData: this.config.panoData,\n                });\n            } else {\n                this.loader.show();\n            }\n        }\n    }\n\n    /**\n     * Destroys the viewer\n     */\n    destroy() {\n        this.stopAll();\n        this.stopKeyboardControl();\n        this.exitFullscreen();\n\n        for (const [id, plugin] of Object.entries(this.plugins)) {\n            plugin.destroy();\n            delete this.plugins[id];\n        }\n\n        this.children.slice().forEach(child => child.destroy());\n        this.children.length = 0;\n\n        this.eventsHandler?.destroy();\n        this.renderer?.destroy();\n        this.textureLoader?.destroy();\n        this.dataHelper?.destroy();\n        this.adapter?.destroy();\n        this.dynamics?.destroy();\n\n        this.parent.removeChild(this.container);\n        // @ts-ignore\n        delete this.parent[VIEWER_DATA];\n    }\n\n    private init() {\n        this.eventsHandler.init();\n        this.renderer.init();\n\n        if (this.config.navbar) {\n            this.navbar.show();\n        }\n\n        if (this.config.keyboard === 'always') {\n            this.startKeyboardControl();\n        }\n\n        this.resetIdleTimer();\n\n        this.state.ready = true;\n\n        this.dispatchEvent(new ReadyEvent());\n    }\n\n    /**\n     * Restarts the idle timer\n     * @internal\n     */\n    resetIdleTimer() {\n        this.state.idleTime = performance.now();\n    }\n\n    /**\n     * Stops the idle timer\n     * @internal\n     */\n    disableIdleTimer() {\n        this.state.idleTime = -1;\n    }\n\n    /**\n     * Returns the instance of a plugin if it exists\n     * @example By plugin identifier\n     * ```js\n     * viewer.getPlugin('markers')\n     * ```\n     * @example By plugin class with TypeScript support\n     * ```ts\n     * viewer.getPlugin<MarkersPlugin>(MarkersPlugin)\n     * ```\n     */\n    getPlugin<T extends AbstractPlugin<any>>(pluginId: string | PluginConstructor): T {\n        if (typeof pluginId === 'string') {\n            return this.plugins[pluginId] as T;\n        } else {\n            const pluginCtor = pluginInterop(pluginId);\n            return pluginCtor ? (this.plugins[pluginCtor.id] as T) : null;\n        }\n    }\n\n    /**\n     * Returns the current position of the camera\n     */\n    getPosition(): Position {\n        return this.dataHelper.cleanPosition(this.dynamics.position.current);\n    }\n\n    /**\n     * Returns the current zoom level\n     */\n    getZoomLevel(): number {\n        return this.dynamics.zoom.current;\n    }\n\n    /**\n     * Returns the current viewer size\n     */\n    getSize(): Size {\n        return { ...this.state.size };\n    }\n\n    /**\n     * Checks if the viewer is in fullscreen\n     */\n    isFullscreenEnabled(): boolean {\n        return isFullscreenEnabled(this.parent, SYSTEM.isIphone);\n    }\n\n    /**\n     * Request a new render of the scene\n     */\n    needsUpdate() {\n        this.state.needsUpdate = true;\n    }\n\n    /**\n     * Request the scene to be continuously renderer (when using videos)\n     */\n    needsContinuousUpdate(enabled: boolean) {\n        if (enabled) {\n            this.state.continuousUpdateCount++;\n        } else if (this.state.continuousUpdateCount > 0) {\n            this.state.continuousUpdateCount--;\n        }\n    }\n\n    /**\n     * Resizes the scene if the viewer is resized\n     */\n    autoSize() {\n        if (\n            this.container.clientWidth !== this.state.size.width\n            || this.container.clientHeight !== this.state.size.height\n        ) {\n            this.state.size.width = Math.round(this.container.clientWidth);\n            this.state.size.height = Math.round(this.container.clientHeight);\n            this.state.aspect = this.state.size.width / this.state.size.height;\n            this.state.hFov = this.dataHelper.vFovToHFov(this.state.vFov);\n\n            this.dispatchEvent(new SizeUpdatedEvent(this.getSize()));\n            this.navbar.autoSize();\n        }\n    }\n\n    /**\n     * Loads a new panorama file\n     * Loads a new panorama file, optionally changing the camera position/zoom and activating the transition animation.<br>\n     * If the \"options\" parameter is not defined, the camera will not move and the ongoing animation will continue.<br>\n     * If another loading is already in progress it will be aborted.\n     * @returns promise resolved with false if the loading was aborted by another call\n     */\n    setPanorama(path: any, options: PanoramaOptions = {}): Promise<boolean> {\n        this.textureLoader.abortLoading();\n        this.state.transitionAnimation?.cancel();\n\n        const transition = this.dataHelper.getTransitionOptions(options);\n\n        if (options.showLoader === undefined) {\n            options.showLoader = true;\n        }\n        if (options.caption === undefined) {\n            options.caption = this.config.caption;\n        }\n        if (options.description === undefined) {\n            options.description = this.config.description;\n        }\n        if (!options.panoData && typeof this.config.panoData === 'function') {\n            options.panoData = this.config.panoData;\n        }\n\n        this.hideError();\n        this.resetIdleTimer();\n\n        this.config.panorama = path;\n        this.config.caption = options.caption;\n        this.config.description = options.description;\n        this.config.sphereCorrection = options.sphereCorrection;\n        if (typeof this.config.panoData !== 'function' || typeof options.panoData === 'function') {\n            this.config.panoData = options.panoData; // keep the default panoData if defined as a function\n        }\n\n        const done = (err?: Error) => {\n            if (isAbortError(err)) {\n                return false;\n            }\n\n            this.loader.hide();\n            this.state.loadingPromise = null;\n\n            if (err) {\n                this.navbar.setCaption(null);\n                this.showError(this.config.lang.loadError);\n                console.error(err);\n                this.dispatchEvent(new PanoramaErrorEvent(path, err));\n                throw err;\n            } else {\n                this.navbar.setCaption(this.config.caption);\n                return true;\n            }\n        };\n\n        this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`);\n        if (options.showLoader || !this.state.ready) {\n            this.loader.show();\n        }\n\n        this.dispatchEvent(new PanoramaLoadEvent(path));\n\n        const loadingPromise = this.adapter.loadTexture(this.config.panorama, true, options.panoData).then((textureData) => {\n            // check if another panorama was requested\n            if (textureData.panorama !== this.config.panorama) {\n                this.adapter.disposeTexture(textureData);\n                throw getAbortError();\n            }\n\n            const cleanOptions = this.dataHelper.cleanPanoramaOptions(options, textureData.panoData);\n\n            if (!isNil(cleanOptions.zoom) || !isNil(cleanOptions.position)) {\n                this.stopAll();\n            }\n\n            return {\n                textureData,\n                cleanOptions,\n            };\n        });\n\n        if (!transition || !this.state.ready || !this.adapter.supportsTransition(this.config.panorama)) {\n            this.state.loadingPromise = loadingPromise\n                .then(({ textureData, cleanOptions }) => {\n                    this.renderer.show();\n                    this.renderer.setTexture(textureData);\n                    this.renderer.setPanoramaPose(textureData.panoData);\n                    this.renderer.setSphereCorrection(options.sphereCorrection);\n\n                    if (!this.state.ready) {\n                        this.init();\n                    }\n\n                    this.dispatchEvent(new PanoramaLoadedEvent(textureData));\n\n                    if (!isNil(cleanOptions.zoom)) {\n                        this.zoom(cleanOptions.zoom);\n                    }\n                    if (!isNil(cleanOptions.position)) {\n                        this.rotate(cleanOptions.position);\n                    }\n                })\n                .then(\n                    () => done(),\n                    err => done(err),\n                );\n        } else {\n            this.state.loadingPromise = loadingPromise\n                .then(({ textureData, cleanOptions }) => {\n                    this.loader.hide();\n\n                    this.dispatchEvent(new PanoramaLoadedEvent(textureData));\n\n                    this.state.transitionAnimation = this.renderer.transition(textureData, cleanOptions, transition);\n                    return this.state.transitionAnimation;\n                })\n                .then((completed) => {\n                    this.state.transitionAnimation = null;\n\n                    this.dispatchEvent(new TransitionDoneEvent(completed));\n\n                    if (!completed) {\n                        throw getAbortError();\n                    }\n                })\n                .then(\n                    () => done(),\n                    err => done(err),\n                );\n        }\n\n        return this.state.loadingPromise;\n    }\n\n    /**\n     * Update options\n     * @throws {@link PSVError} if the configuration is invalid\n     */\n    setOptions(options: Partial<UpdatableViewerConfig>) {\n        const rawConfig: ViewerConfig = {\n            ...this.config,\n            ...options,\n        };\n\n        for (let [key, value] of Object.entries(options) as Array<[keyof typeof rawConfig, any]>) {\n            if (!(key in DEFAULTS)) {\n                logWarn(`Unknown option ${key}`);\n                continue;\n            }\n\n            if (key in READONLY_OPTIONS) {\n                logWarn((READONLY_OPTIONS as any)[key]);\n                continue;\n            }\n\n            if (key in CONFIG_PARSERS) {\n                // @ts-ignore\n                value = CONFIG_PARSERS[key](value, {\n                    rawConfig: rawConfig,\n                    defValue: DEFAULTS[key],\n                } as any);\n            }\n\n            // @ts-ignore\n            this.config[key] = value;\n\n            switch (key) {\n                case 'mousemove':\n                    if (!this.state.cursorOverride) {\n                        this.setCursor(null);\n                    }\n                    break;\n\n                case 'caption':\n                    this.navbar.setCaption(this.config.caption);\n                    break;\n\n                case 'size':\n                    this.resize(this.config.size);\n                    break;\n\n                case 'sphereCorrection':\n                    this.renderer.setSphereCorrection(this.config.sphereCorrection);\n                    break;\n\n                case 'navbar':\n                case 'lang':\n                    this.navbar.setButtons(this.config.navbar);\n                    break;\n\n                case 'moveSpeed':\n                case 'zoomSpeed':\n                    this.dynamics.updateSpeeds();\n                    break;\n\n                case 'minFov':\n                case 'maxFov':\n                    this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov));\n                    this.dispatchEvent(new ZoomUpdatedEvent(this.getZoomLevel()));\n                    break;\n\n                case 'keyboard':\n                    if (this.config.keyboard === 'always') {\n                        this.startKeyboardControl();\n                    } else {\n                        this.stopKeyboardControl();\n                    }\n                    break;\n\n                default:\n                    break;\n            }\n        }\n\n        this.needsUpdate();\n\n        this.dispatchEvent(new ConfigChangedEvent(Object.keys(options) as any));\n    }\n\n    /**\n     * Update options\n     * @throws {@link PSVError} if the configuration is invalid\n     */\n    setOption<T extends keyof UpdatableViewerConfig>(option: T, value: UpdatableViewerConfig[T]) {\n        this.setOptions({ [option]: value });\n    }\n\n    /**\n     * Displays an error message over the viewer\n     */\n    showError(message: string) {\n        this.overlay.show({\n            id: IDS.ERROR,\n            image: errorIcon,\n            title: message,\n            dismissible: false,\n        });\n    }\n\n    /**\n     *  Hides the error message\n     */\n    hideError() {\n        this.overlay.hide(IDS.ERROR);\n    }\n\n    /**\n     * Rotates the view to specific position\n     */\n    rotate(position: ExtendedPosition) {\n        const e = new BeforeRotateEvent(this.dataHelper.cleanPosition(position));\n        this.dispatchEvent(e);\n\n        if (e.defaultPrevented) {\n            return;\n        }\n\n        this.dynamics.position.setValue(e.position);\n    }\n\n    /**\n     * Zooms to a specific level between `maxFov` and `minFov`\n     */\n    zoom(level: number) {\n        this.dynamics.zoom.setValue(level);\n    }\n\n    /**\n     * Increases the zoom level\n     */\n    zoomIn(step = 1) {\n        this.dynamics.zoom.step(step);\n    }\n\n    /**\n     * Decreases the zoom level\n     */\n    zoomOut(step = 1) {\n        this.dynamics.zoom.step(-step);\n    }\n\n    /**\n     * Rotates and zooms the view with a smooth animation\n     */\n    animate(options: AnimateOptions): Animation {\n        const positionProvided = isExtendedPosition(options);\n        const zoomProvided = !isNil(options.zoom);\n\n        const e = new BeforeAnimateEvent(\n            positionProvided ? this.dataHelper.cleanPosition(options) : undefined,\n            options.zoom,\n        );\n        this.dispatchEvent(e);\n\n        if (e.defaultPrevented) {\n            return;\n        }\n\n        this.stopAll();\n\n        const { duration, properties } = this.dataHelper.getAnimationProperties(options.speed, e.position, e.zoomLevel);\n\n        // if no animation needed\n        if (!duration) {\n            if (positionProvided) {\n                this.rotate(e.position);\n            }\n            if (zoomProvided) {\n                this.zoom(e.zoomLevel);\n            }\n\n            return new Animation(null);\n        }\n\n        this.state.animation = new Animation({\n            properties: properties,\n            duration: duration,\n            easing: options.easing || 'inOutSine',\n            onTick: (props) => {\n                if (positionProvided) {\n                    this.dynamics.position.setValue({\n                        yaw: props.yaw,\n                        pitch: props.pitch,\n                    });\n                }\n                if (zoomProvided) {\n                    this.dynamics.zoom.setValue(props.zoom);\n                }\n            },\n        });\n\n        this.state.animation.then(() => {\n            this.state.animation = null;\n            this.resetIdleTimer();\n        });\n\n        return this.state.animation;\n    }\n\n    /**\n     * Stops the ongoing animation\n     * The return value is a Promise because the is no guaranty the animation can be stopped synchronously.\n     */\n    stopAnimation(): PromiseLike<any> {\n        if (this.state.animation) {\n            this.state.animation.cancel();\n            return this.state.animation;\n        } else {\n            return Promise.resolve();\n        }\n    }\n\n    /**\n     * Resizes the viewer\n     */\n    resize(size: CssSize) {\n        this.__setSize(size);\n        this.autoSize();\n    }\n\n    private __setSize(size?: CssSize) {\n        (['width', 'height'] as Array<'width' | 'height'>).forEach((dim) => {\n            if (size?.[dim]) {\n                if (/^[0-9.]+$/.test(size[dim])) {\n                    size[dim] += 'px';\n                }\n                this.parent.style[dim] = size[dim];\n            }\n        });\n    }\n\n    /**\n     * Enters the fullscreen mode\n     */\n    enterFullscreen() {\n        if (!this.isFullscreenEnabled()) {\n            requestFullscreen(this.parent, SYSTEM.isIphone);\n        }\n    }\n\n    /**\n     * Exits the fullscreen mode\n     */\n    exitFullscreen() {\n        if (this.isFullscreenEnabled()) {\n            exitFullscreen(SYSTEM.isIphone);\n        }\n    }\n\n    /**\n     * Enters or exits the fullscreen mode\n     */\n    toggleFullscreen() {\n        if (!this.isFullscreenEnabled()) {\n            this.enterFullscreen();\n        } else {\n            this.exitFullscreen();\n        }\n    }\n\n    /**\n     * Enables the keyboard controls\n     */\n    startKeyboardControl() {\n        this.state.keyboardEnabled = true;\n    }\n\n    /**\n     * Disables the keyboard controls\n     */\n    stopKeyboardControl() {\n        this.state.keyboardEnabled = false;\n    }\n\n    /**\n     * Creates a new tooltip\n     * Use {@link Tooltip.move} to update the tooltip without re-create\n     * @throws {@link PSVError} if the configuration is invalid\n     */\n    createTooltip(config: TooltipConfig): Tooltip {\n        return new Tooltip(this, config);\n    }\n\n    /**\n     * Changes the global mouse cursor\n     */\n    setCursor(cursor: string | null) {\n        this.state.cursorOverride = cursor;\n        if (!cursor) {\n            this.container.style.cursor = this.config.mousemove ? 'move' : 'default';\n        } else {\n            this.container.style.cursor = cursor;\n        }\n    }\n\n    /**\n     * Subscribes to events on objects in the three.js scene\n     * @param userDataKey - only objects with the following `userData` will be observed\n     */\n    observeObjects(userDataKey: string): void {\n        if (!this.state.objectsObservers[userDataKey]) {\n            this.state.objectsObservers[userDataKey] = null;\n        }\n    }\n\n    /**\n     * Unsubscribes to events on objects\n     */\n    unobserveObjects(userDataKey: string): void {\n        delete this.state.objectsObservers[userDataKey];\n    }\n\n    /**\n     * Stops all current animations\n     * @internal\n     */\n    stopAll(): PromiseLike<void> {\n        this.dispatchEvent(new StopAllEvent());\n\n        this.disableIdleTimer();\n\n        return this.stopAnimation();\n    }\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"15 15 70 70\"><path fill=\"currentColor\" d=\"M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z\"/><rect fill=\"currentColor\" x=\"48\" y=\"31.7\" width=\"4\" height=\"28\"/><rect fill=\"currentColor\" x=\"48\" y=\"63.2\" width=\"4\" height=\"5\"/><!--Created by Shastry from the Noun Project--></svg>\n","/**\n * @internal\n */\nconst enum Status {\n    DISABLED,\n    PENDING,\n    RUNNING,\n    CANCELLED,\n    DONE,\n    ERROR,\n}\n\n/**\n * @internal\n */\nexport class Task {\n    status: Status = Status.PENDING;\n\n    constructor(\n        public readonly id: string,\n        public priority: number,\n        private readonly fn: (task: Task) => Promise<any>,\n    ) {}\n\n    start() {\n        this.status = Status.RUNNING;\n        return this.fn(this).then(\n            () => {\n                this.status = Status.DONE;\n            },\n            () => {\n                this.status = Status.ERROR;\n            },\n        );\n    }\n\n    cancel() {\n        this.status = Status.CANCELLED;\n    }\n\n    isCancelled() {\n        return this.status === Status.CANCELLED;\n    }\n}\n\n/**\n * @internal\n */\nexport class Queue {\n    private runningTasks: Record<string, boolean> = {};\n    private tasks: Record<string, Task> = {};\n\n    constructor(private readonly concurency = 8) {}\n\n    enqueue(task: Task) {\n        this.tasks[task.id] = task;\n    }\n\n    clear() {\n        Object.values(this.tasks).forEach(task => task.cancel());\n        this.tasks = {};\n        this.runningTasks = {};\n    }\n\n    setPriority(taskId: string, priority: number) {\n        const task = this.tasks[taskId];\n        if (task) {\n            task.priority = priority;\n            if (task.status === Status.DISABLED) {\n                task.status = Status.PENDING;\n            }\n        }\n    }\n\n    disableAllTasks() {\n        Object.values(this.tasks).forEach((task) => {\n            task.status = Status.DISABLED;\n        });\n    }\n\n    start() {\n        if (Object.keys(this.runningTasks).length >= this.concurency) {\n            return;\n        }\n\n        const nextTask = Object.values(this.tasks)\n            .filter(task => task.status === Status.PENDING)\n            .sort((a, b) => b.priority - a.priority)\n            .pop();\n\n        if (nextTask) {\n            this.runningTasks[nextTask.id] = true;\n\n            nextTask.start().then(() => {\n                if (!nextTask.isCancelled()) {\n                    delete this.tasks[nextTask.id];\n                    delete this.runningTasks[nextTask.id];\n                    this.start();\n                }\n            });\n\n            this.start(); // start tasks until max concurrency is reached\n        }\n    }\n}\n","import { utils } from '@photo-sphere-viewer/core';\nimport { BufferGeometry, LineSegments, Material, MeshBasicMaterial, Object3D, WireframeGeometry } from 'three';\n\n/**\n * Generates an material for errored tiles\n * @internal\n */\nexport function buildErrorMaterial(): MeshBasicMaterial {\n    const canvas = new OffscreenCanvas(512, 512);\n\n    const ctx = canvas.getContext('2d');\n\n    ctx.fillStyle = '#333';\n    ctx.fillRect(0, 0, canvas.width, canvas.height);\n    ctx.font = `${canvas.width / 5}px serif`;\n    ctx.fillStyle = '#a22';\n    ctx.textAlign = 'center';\n    ctx.textBaseline = 'middle';\n    ctx.fillText('⚠', canvas.width / 2, canvas.height / 2);\n\n    return new MeshBasicMaterial({ map: utils.createTexture(canvas) });\n}\n\n/**\n * Creates a wireframe geometry, for debug\n * @internal\n */\nexport function createWireFrame(geometry: BufferGeometry): Object3D {\n    const wireframe = new WireframeGeometry(geometry);\n    const line = new LineSegments<WireframeGeometry, Material>(wireframe);\n    line.material.depthTest = false;\n    line.material.depthWrite = false;\n    line.material.opacity = 0.25;\n    line.material.transparent = true;\n    return line;\n}\n\nconst DEBUG_COLORS = ['dodgerblue', 'limegreen', 'indianred'];\n\n/**\n * Applies a color filter to an tile image and shows the id of the tile\n * @internal\n */\nexport function buildDebugTexture(image: HTMLImageElement, level: number, id: string): HTMLCanvasElement {\n    const canvas = document.createElement('canvas');\n    canvas.width = image.width;\n    canvas.height = image.height;\n    const ctx = canvas.getContext('2d');\n\n    ctx.fillStyle = DEBUG_COLORS[level % DEBUG_COLORS.length];\n    ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n    ctx.globalCompositeOperation = 'multiply';\n    ctx.drawImage(image, 0, 0);\n\n    const fontSize = image.width / 7;\n    ctx.globalCompositeOperation = 'source-over';\n    ctx.fillStyle = 'white';\n    ctx.font = `${fontSize}px monospace`;\n    ctx.textAlign = 'center';\n    id.split('\\n').forEach((id2, i) => {\n        ctx.fillText(id2, image.width / 2, image.height / 2 + fontSize * (0.3 + i));\n    });\n\n    return canvas;\n}\n","import { PSVError, Size, utils } from '@photo-sphere-viewer/core';\nimport { MathUtils } from 'three';\nimport { EquirectangularMultiTilesPanorama, EquirectangularTileLevel, EquirectangularTilesPanorama } from './model';\n\nexport type EquirectangularTileConfig = EquirectangularTileLevel & {\n    level: number;\n    colSize: number;\n    rowSize: number;\n    facesByCol: number;\n    facesByRow: number;\n};\n\nfunction isMultiTiles(\n    panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n): panorama is EquirectangularMultiTilesPanorama {\n    return !!(panorama as EquirectangularMultiTilesPanorama).levels;\n}\n\nfunction computeTileConfig(\n    tile: EquirectangularTileLevel,\n    level: number,\n    data: { SPHERE_SEGMENTS: number; SPHERE_HORIZONTAL_SEGMENTS: number },\n): EquirectangularTileConfig {\n    return {\n        ...tile,\n        level,\n        colSize: tile.width / tile.cols,\n        rowSize: tile.width / 2 / tile.rows,\n        facesByCol: data.SPHERE_SEGMENTS / tile.cols,\n        facesByRow: data.SPHERE_HORIZONTAL_SEGMENTS / tile.rows,\n    };\n}\n\nexport function getTileConfig(\n    panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    hFov: number, vFov: number,\n    viewerSize: Size,\n    data: { SPHERE_SEGMENTS: number; SPHERE_HORIZONTAL_SEGMENTS: number },\n): EquirectangularTileConfig {\n    let tile: EquirectangularTileLevel;\n    let level: number;\n    if (!isMultiTiles(panorama)) {\n        level = 0;\n        tile = { ...panorama };\n    } else {\n        if (viewerSize) {\n            level = panorama.levels.findIndex((pLevel) => {\n                const hResolution = pLevel.width / 360 * hFov;\n                const vResolution = pLevel.width / 2 / 180 * vFov;\n                return hResolution >= viewerSize.width && vResolution >= viewerSize.height;\n            });\n            if (level === -1) {\n                level = panorama.levels.length - 1;\n            }\n        } else {\n            level = 0;\n        }\n        tile = panorama.levels[level];\n    }\n    return computeTileConfig(tile, level, data);\n}\n\nexport function getTileConfigByIndex(\n    panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    level: number,\n    data: { SPHERE_SEGMENTS: number; SPHERE_HORIZONTAL_SEGMENTS: number },\n): EquirectangularTileConfig {\n    if (!isMultiTiles(panorama) || !panorama.levels[level]) {\n        return null;\n    } else {\n        return computeTileConfig(panorama.levels[level], level, data);\n    }\n}\n\nexport function checkPanoramaConfig(\n    panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    data: { SPHERE_SEGMENTS: number; SPHERE_HORIZONTAL_SEGMENTS: number },\n) {\n    if (typeof panorama !== 'object' || !panorama.tileUrl) {\n        throw new PSVError('Invalid panorama configuration, are you using the right adapter?');\n    }\n    if (isMultiTiles(panorama)) {\n        panorama.levels.forEach((level) => {\n            checkTile(level, data);\n            if ('zoomRange' in level) {\n                utils.logWarn('EquirectangularTilesAdapter: \"zoomRange\" property is deprecated and must be removed');\n            }\n        });\n        panorama.levels.sort((a, b) => a.width - b.width);\n    } else {\n        checkTile(panorama, data);\n    }\n}\n\nfunction checkTile(\n    tile: EquirectangularTilesPanorama | EquirectangularTileLevel,\n    data: { SPHERE_SEGMENTS: number; SPHERE_HORIZONTAL_SEGMENTS: number },\n) {\n    if (!tile.width || !tile.cols || !tile.rows) {\n        throw new PSVError('Invalid panorama configuration, are you using the right adapter?');\n    }\n    if (tile.cols > data.SPHERE_SEGMENTS) {\n        throw new PSVError(`Panorama cols must not be greater than ${data.SPHERE_SEGMENTS}.`);\n    }\n    if (tile.rows > data.SPHERE_HORIZONTAL_SEGMENTS) {\n        throw new PSVError(`Panorama rows must not be greater than ${data.SPHERE_HORIZONTAL_SEGMENTS}.`);\n    }\n    if (!MathUtils.isPowerOfTwo(tile.cols) || !MathUtils.isPowerOfTwo(tile.rows)) {\n        throw new PSVError('Panorama cols and rows must be powers of 2.');\n    }\n}\n\n/**\n * Returns a path used for cache key\n */\nexport function getCacheKey(\n    panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    firstTile: EquirectangularTileConfig,\n): string {\n    // some tiles might be \"null\"\n    for (let i = 0; i < firstTile.cols; i++) {\n        const url = panorama.tileUrl(i, firstTile.rows / 2, firstTile.level);\n        if (url) {\n            return url;\n        }\n    }\n\n    return panorama.tileUrl.toString();\n}\n","import type { AdapterConstructor, PanoData, PanoramaPosition, Position, TextureData, Viewer } from '@photo-sphere-viewer/core';\nimport { AbstractAdapter, CONSTANTS, EquirectangularAdapter, events, utils } from '@photo-sphere-viewer/core';\nimport { BufferAttribute, Group, Mesh, MeshBasicMaterial, SphereGeometry, Texture, Vector3 } from 'three';\nimport { Queue, Task } from '../../shared/Queue';\nimport { buildDebugTexture, buildErrorMaterial, createWireFrame } from '../../shared/tiles-utils';\nimport {\n    EquirectangularMultiTilesPanorama,\n    EquirectangularTilesAdapterConfig,\n    EquirectangularTilesPanoData,\n    EquirectangularTilesPanorama,\n} from './model';\nimport { EquirectangularTileConfig, checkPanoramaConfig, getCacheKey, getTileConfig, getTileConfigByIndex } from './utils';\n\n/* the faces of the top and bottom rows are made of a single triangle (3 vertices)\n * all other faces are made of two triangles (6 vertices)\n * below is the indexing of each face vertices\n *\n * first row faces:\n *     ⋀\n *    /0\\\n *   /   \\\n *  /     \\\n * /1     2\\\n * ¯¯¯¯¯¯¯¯¯\n *\n * other rows faces:\n * _________\n * |\\1    0|\n * |3\\     |\n * |  \\    |\n * |   \\   |\n * |    \\  |\n * |     \\2|\n * |4    5\\|\n * ¯¯¯¯¯¯¯¯¯\n *\n * last row faces:\n * _________\n * \\1     0/\n *  \\     /\n *   \\   /\n *    \\2/\n *     ⋁\n */\n\ntype EquirectangularMesh = Mesh<SphereGeometry, MeshBasicMaterial>;\ntype EquirectangularTilesMesh = Mesh<SphereGeometry, MeshBasicMaterial[]>;\ntype EquirectangularTilesTextureData = TextureData<\n    Texture,\n    EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    EquirectangularTilesPanoData\n>;\ntype EquirectangularTile = {\n    row: number;\n    col: number;\n    angle: number;\n    config: EquirectangularTileConfig;\n    url: string;\n};\n\nconst NB_VERTICES_BY_FACE = 6;\nconst NB_VERTICES_BY_SMALL_FACE = 3;\n\nconst ATTR_UV = 'uv';\nconst ATTR_POSITION = 'position';\n\nconst ERROR_LEVEL = -1;\n\nfunction tileId(tile: EquirectangularTile): string {\n    return `${tile.col}x${tile.row}/${tile.config.level}`;\n}\n\nfunction meshes(group: Group) {\n    return group.children as [EquirectangularMesh, EquirectangularTilesMesh];\n}\n\nconst getConfig = utils.getConfigParser<EquirectangularTilesAdapterConfig>({\n    resolution: 64,\n    showErrorTile: true,\n    baseBlur: true,\n    antialias: true,\n    debug: false,\n    useXmpData: false,\n});\n\nconst vertexPosition = new Vector3();\n\n/**\n * Adapter for tiled panoramas\n */\nexport class EquirectangularTilesAdapter extends AbstractAdapter<\n    EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n    EquirectangularTilesPanoData,\n    Texture,\n    Group\n> {\n    static override readonly id = 'equirectangular-tiles';\n    static override readonly VERSION = PKG_VERSION;\n    static override readonly supportsDownload = false;\n\n    // @internal\n    public readonly SPHERE_SEGMENTS: number;\n    // @internal\n    public readonly SPHERE_HORIZONTAL_SEGMENTS: number;\n    private readonly NB_VERTICES: number;\n    private readonly NB_GROUPS: number;\n\n    private readonly config: EquirectangularTilesAdapterConfig;\n\n    private readonly state = {\n        tileConfig: null as EquirectangularTileConfig,\n        tiles: {} as Record<string, boolean>,\n        faces: {} as Record<number, number>,\n        geom: null as SphereGeometry,\n        materials: [] as MeshBasicMaterial[],\n        errorMaterial: null as MeshBasicMaterial,\n        inTransition: false,\n    };\n\n    // @internal\n    public adapter: EquirectangularAdapter;\n    private readonly queue = new Queue();\n\n    static withConfig(config: EquirectangularTilesAdapterConfig): [AdapterConstructor, any] {\n        return [EquirectangularTilesAdapter, config];\n    }\n\n    constructor(viewer: Viewer, config: EquirectangularTilesAdapterConfig) {\n        super(viewer);\n\n        this.config = getConfig(config);\n\n        this.adapter = new EquirectangularAdapter(this.viewer, {\n            resolution: this.config.resolution,\n            blur: this.config.baseBlur,\n        });\n\n        this.SPHERE_SEGMENTS = this.config.resolution;\n        this.SPHERE_HORIZONTAL_SEGMENTS = this.SPHERE_SEGMENTS / 2;\n        this.NB_VERTICES\n            = 2 * this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE\n                + (this.SPHERE_HORIZONTAL_SEGMENTS - 2) * this.SPHERE_SEGMENTS * NB_VERTICES_BY_FACE;\n        this.NB_GROUPS = this.SPHERE_SEGMENTS * this.SPHERE_HORIZONTAL_SEGMENTS;\n\n        if (this.viewer.config.requestHeaders) {\n            utils.logWarn(\n                'EquirectangularTilesAdapter fallbacks to file loader because \"requestHeaders\" where provided. '\n                + 'Consider removing \"requestHeaders\" if you experience performances issues.',\n            );\n        }\n    }\n\n    override init() {\n        super.init();\n\n        this.viewer.addEventListener(events.TransitionDoneEvent.type, this);\n        this.viewer.addEventListener(events.PositionUpdatedEvent.type, this);\n        this.viewer.addEventListener(events.ZoomUpdatedEvent.type, this);\n    }\n\n    override destroy() {\n        this.viewer.removeEventListener(events.TransitionDoneEvent.type, this);\n        this.viewer.removeEventListener(events.PositionUpdatedEvent.type, this);\n        this.viewer.removeEventListener(events.ZoomUpdatedEvent.type, this);\n\n        this.__cleanup();\n\n        this.state.errorMaterial?.map?.dispose();\n        this.state.errorMaterial?.dispose();\n        this.adapter.destroy();\n\n        delete this.adapter;\n        delete this.state.geom;\n        delete this.state.errorMaterial;\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case events.PositionUpdatedEvent.type:\n            case events.ZoomUpdatedEvent.type:\n                this.__refresh();\n                break;\n\n            case events.TransitionDoneEvent.type:\n                this.state.inTransition = false;\n                if ((e as events.TransitionDoneEvent).completed) {\n                    this.__switchMesh(this.viewer.renderer.mesh as Group);\n                }\n                break;\n        }\n    }\n\n    override supportsTransition(panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama) {\n        return !!panorama.baseUrl;\n    }\n\n    override supportsPreload(panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama) {\n        return !!panorama.baseUrl;\n    }\n\n    override textureCoordsToSphericalCoords(point: PanoramaPosition, data: EquirectangularTilesPanoData): Position {\n        return this.adapter.textureCoordsToSphericalCoords(point, data);\n    }\n\n    override sphericalCoordsToTextureCoords(position: Position, data: EquirectangularTilesPanoData): PanoramaPosition {\n        return this.adapter.sphericalCoordsToTextureCoords(position, data);\n    }\n\n    override async loadTexture(\n        panorama: EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama,\n        loader = true,\n    ): Promise<EquirectangularTilesTextureData> {\n        checkPanoramaConfig(panorama, this);\n\n        const firstTile = getTileConfig(panorama, 0, 0, null, this);\n        const panoData: PanoData = {\n            isEquirectangular: true,\n            fullWidth: firstTile.width,\n            fullHeight: firstTile.width / 2,\n            croppedWidth: firstTile.width,\n            croppedHeight: firstTile.width / 2,\n            croppedX: 0,\n            croppedY: 0,\n            poseHeading: 0,\n            posePitch: 0,\n            poseRoll: 0,\n        };\n\n        if (panorama.baseUrl) {\n            const textureData = await this.adapter.loadTexture(panorama.baseUrl, loader, panorama.basePanoData, true);\n\n            return {\n                panorama,\n                panoData: {\n                    ...panoData,\n                    baseData: textureData.panoData,\n                },\n                cacheKey: textureData.cacheKey,\n                texture: textureData.texture,\n            };\n        } else {\n            return {\n                panorama,\n                panoData: {\n                    ...panoData,\n                    baseData: null,\n                },\n                cacheKey: getCacheKey(panorama, firstTile),\n                texture: null,\n            };\n        }\n    }\n\n    createMesh(panoData: EquirectangularTilesPanoData): Group {\n        // mesh for the base panorama\n        const baseMesh = this.adapter.createMesh(panoData.baseData ?? panoData);\n\n        // mesh for the tiles\n        const geometry = new SphereGeometry(\n            CONSTANTS.SPHERE_RADIUS,\n            this.SPHERE_SEGMENTS,\n            this.SPHERE_HORIZONTAL_SEGMENTS,\n            -Math.PI / 2,\n        )\n            .scale(-1, 1, 1)\n            .toNonIndexed() as SphereGeometry;\n\n        geometry.clearGroups();\n        let i = 0;\n        let k = 0;\n        // first row\n        for (; i < this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE; i += NB_VERTICES_BY_SMALL_FACE) {\n            geometry.addGroup(i, NB_VERTICES_BY_SMALL_FACE, k++);\n        }\n        // second to before last rows\n        for (; i < this.NB_VERTICES - this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE; i += NB_VERTICES_BY_FACE) {\n            geometry.addGroup(i, NB_VERTICES_BY_FACE, k++);\n        }\n        // last row\n        for (; i < this.NB_VERTICES; i += NB_VERTICES_BY_SMALL_FACE) {\n            geometry.addGroup(i, NB_VERTICES_BY_SMALL_FACE, k++);\n        }\n\n        const materials: MeshBasicMaterial[] = [];\n        const material = new MeshBasicMaterial({\n            opacity: 0,\n            transparent: true,\n            depthTest: false,\n            depthWrite: false,\n        });\n        for (let g = 0; g < this.NB_GROUPS; g++) {\n            materials.push(material);\n        }\n\n        const tilesMesh = new Mesh(geometry, materials);\n        tilesMesh.renderOrder = 1;\n\n        const group = new Group();\n        group.add(baseMesh);\n        group.add(tilesMesh);\n        return group;\n    }\n\n    /**\n     * Applies the base texture and starts the loading of tiles\n     */\n    setTexture(group: Group, textureData: EquirectangularTilesTextureData, transition: boolean) {\n        const [baseMesh] = meshes(group);\n\n        if (textureData.texture) {\n            this.adapter.setTexture(baseMesh, {\n                panorama: textureData.panorama.baseUrl,\n                texture: textureData.texture,\n                panoData: textureData.panoData.baseData,\n            });\n        } else {\n            baseMesh.visible = false;\n        }\n\n        if (transition) {\n            this.state.inTransition = true;\n        } else {\n            this.__switchMesh(group);\n        }\n    }\n\n    setTextureOpacity(group: Group, opacity: number) {\n        const [baseMesh] = meshes(group);\n        this.adapter.setTextureOpacity(baseMesh, opacity);\n    }\n\n    disposeTexture({ texture }: EquirectangularTilesTextureData) {\n        texture?.dispose();\n    }\n\n    disposeMesh(group: Group) {\n        const [baseMesh, tilesMesh] = meshes(group);\n\n        baseMesh.geometry.dispose();\n        baseMesh.material.dispose();\n\n        tilesMesh.geometry.dispose();\n        tilesMesh.material.forEach((m) => {\n            m.map?.dispose();\n            m.dispose();\n        });\n    }\n\n    /**\n     * Compute visible tiles and load them\n     */\n    private __refresh() {\n        if (!this.state.geom || this.state.inTransition) {\n            return;\n        }\n\n        const panorama = this.viewer.config.panorama as EquirectangularTilesPanorama | EquirectangularMultiTilesPanorama;\n        const tileConfig = getTileConfig(panorama, this.viewer.state.hFov, this.viewer.state.vFov, this.viewer.state.size, this);\n\n        const verticesPosition = this.state.geom.getAttribute(ATTR_POSITION) as BufferAttribute;\n        const tilesToLoad: Record<string, EquirectangularTile> = {};\n\n        for (let i = 0; i < this.NB_VERTICES; i += 1) {\n            vertexPosition.fromBufferAttribute(verticesPosition, i);\n            vertexPosition.applyEuler(this.viewer.renderer.sphereCorrection);\n\n            if (this.viewer.renderer.isObjectVisible(vertexPosition)) {\n                // compute position of the segment (3 or 6 vertices)\n                let segmentIndex;\n                if (i < this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE) {\n                    // first row\n                    segmentIndex = Math.floor(i / 3);\n                } else if (i < this.NB_VERTICES - this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE) {\n                    // second to before last rows\n                    segmentIndex = Math.floor((i / 3 - this.SPHERE_SEGMENTS) / 2) + this.SPHERE_SEGMENTS;\n                } else {\n                    // last row\n                    segmentIndex\n                        = Math.floor((i - this.NB_VERTICES - this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE) / 3)\n                            + this.SPHERE_HORIZONTAL_SEGMENTS * (this.SPHERE_SEGMENTS - 1);\n                }\n                const segmentRow = Math.floor(segmentIndex / this.SPHERE_SEGMENTS);\n                const segmentCol = segmentIndex - segmentRow * this.SPHERE_SEGMENTS;\n\n                let config = tileConfig;\n                while (config) {\n                    // compute the position of the tile\n                    const row = Math.floor(segmentRow / config.facesByRow);\n                    const col = Math.floor(segmentCol / config.facesByCol);\n                    let angle = vertexPosition.angleTo(this.viewer.state.direction);\n                    if (row === 0 || row === config.rows - 1) {\n                        angle *= 2; // lower priority to top and bottom tiles\n                    }\n\n                    const tile: EquirectangularTile = {\n                        row,\n                        col,\n                        angle,\n                        config,\n                        url: null,\n                    };\n                    const id = tileId(tile);\n\n                    if (tilesToLoad[id]) {\n                        tilesToLoad[id].angle = Math.min(tilesToLoad[id].angle, angle);\n                        break;\n                    } else {\n                        tile.url = panorama.tileUrl(col, row, config.level);\n\n                        if (tile.url) {\n                            tilesToLoad[id] = tile;\n                            break;\n                        } else {\n                            // if no url is returned, try a lower tile level\n                            config = getTileConfigByIndex(panorama, config.level - 1, this);\n                        }\n                    }\n                }\n            }\n        }\n\n        this.state.tileConfig = tileConfig;\n        this.__loadTiles(Object.values(tilesToLoad));\n    }\n\n    /**\n     * Loads tiles and change existing tiles priority\n     */\n    private __loadTiles(tiles: EquirectangularTile[]) {\n        this.queue.disableAllTasks();\n\n        tiles.forEach((tile) => {\n            const id = tileId(tile);\n\n            if (this.state.tiles[id]) {\n                this.queue.setPriority(id, tile.angle);\n            } else {\n                this.state.tiles[id] = true;\n                this.queue.enqueue(new Task(id, tile.angle, task => this.__loadTile(tile, task)));\n            }\n        });\n\n        this.queue.start();\n    }\n\n    /**\n     * Loads and draw a tile\n     */\n    private __loadTile(tile: EquirectangularTile, task: Task): Promise<any> {\n        return this.viewer.textureLoader\n            .loadImage(tile.url, null, this.viewer.state.textureData.cacheKey)\n            .then((image: HTMLImageElement) => {\n                if (!task.isCancelled()) {\n                    if (this.config.debug) {\n                        image = buildDebugTexture(image, tile.config.level, tileId(tile)) as any;\n                    }\n\n                    const mipmaps = this.config.antialias && tile.config.level > 0;\n                    const material = new MeshBasicMaterial({ map: utils.createTexture(image, mipmaps) });\n                    this.__swapMaterial(tile, material, false);\n                    this.viewer.needsUpdate();\n                }\n            })\n            .catch((err) => {\n                if (!utils.isAbortError(err) && !task.isCancelled() && this.config.showErrorTile) {\n                    if (!this.state.errorMaterial) {\n                        this.state.errorMaterial = buildErrorMaterial();\n                    }\n                    this.__swapMaterial(tile, this.state.errorMaterial, true);\n                    this.viewer.needsUpdate();\n                }\n            });\n    }\n\n    /**\n     * Applies a new texture to the faces\n     */\n    private __swapMaterial(tile: EquirectangularTile, material: MeshBasicMaterial, isError: boolean) {\n        const uvs = this.state.geom.getAttribute(ATTR_UV) as BufferAttribute;\n\n        for (let c = 0; c < tile.config.facesByCol; c++) {\n            for (let r = 0; r < tile.config.facesByRow; r++) {\n                // position of the face\n                const faceCol = tile.col * tile.config.facesByCol + c;\n                const faceRow = tile.row * tile.config.facesByRow + r;\n                const isFirstRow = faceRow === 0;\n                const isLastRow = faceRow === (this.SPHERE_HORIZONTAL_SEGMENTS - 1);\n\n                // first vertex for this face (3 or 6 vertices in total)\n                let firstVertex: number;\n                if (isFirstRow) {\n                    firstVertex = faceCol * NB_VERTICES_BY_SMALL_FACE;\n                } else if (isLastRow) {\n                    firstVertex\n                        = this.NB_VERTICES\n                            - this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE\n                            + faceCol * NB_VERTICES_BY_SMALL_FACE;\n                } else {\n                    firstVertex\n                        = this.SPHERE_SEGMENTS * NB_VERTICES_BY_SMALL_FACE\n                            + (faceRow - 1) * this.SPHERE_SEGMENTS * NB_VERTICES_BY_FACE\n                            + faceCol * NB_VERTICES_BY_FACE;\n                }\n\n                // in case of error, skip the face if already showing valid data\n                if (isError && this.state.faces[firstVertex] > ERROR_LEVEL) {\n                    continue;\n                }\n                // skip this face if its already showing an higher resolution\n                if (this.state.faces[firstVertex] > tile.config.level) {\n                    continue;\n                }\n                this.state.faces[firstVertex] = isError ? ERROR_LEVEL : tile.config.level;\n\n                // swap material\n                const matIndex = this.state.geom.groups.find(g => g.start === firstVertex).materialIndex;\n                this.state.materials[matIndex] = material;\n\n                // define new uvs\n                const top = 1 - r / tile.config.facesByRow;\n                const bottom = 1 - (r + 1) / tile.config.facesByRow;\n                const left = c / tile.config.facesByCol;\n                const right = (c + 1) / tile.config.facesByCol;\n\n                if (isFirstRow) {\n                    uvs.setXY(firstVertex, (left + right) / 2, top);\n                    uvs.setXY(firstVertex + 1, left, bottom);\n                    uvs.setXY(firstVertex + 2, right, bottom);\n                } else if (isLastRow) {\n                    uvs.setXY(firstVertex, right, top);\n                    uvs.setXY(firstVertex + 1, left, top);\n                    uvs.setXY(firstVertex + 2, (left + right) / 2, bottom);\n                } else {\n                    uvs.setXY(firstVertex, right, top);\n                    uvs.setXY(firstVertex + 1, left, top);\n                    uvs.setXY(firstVertex + 2, right, bottom);\n                    uvs.setXY(firstVertex + 3, left, top);\n                    uvs.setXY(firstVertex + 4, left, bottom);\n                    uvs.setXY(firstVertex + 5, right, bottom);\n                }\n            }\n        }\n\n        uvs.needsUpdate = true;\n    }\n\n    private __switchMesh(group: Group) {\n        const [, tilesMesh] = meshes(group);\n\n        this.__cleanup();\n\n        this.state.materials = tilesMesh.material;\n        this.state.geom = tilesMesh.geometry;\n\n        if (this.config.debug) {\n            const wireframe = createWireFrame(this.state.geom);\n            this.viewer.renderer.addObject(wireframe);\n            this.viewer.renderer.setSphereCorrection(this.viewer.config.sphereCorrection, wireframe);\n        }\n\n        setTimeout(() => this.__refresh());\n    }\n\n    /**\n     * Clears loading queue, dispose all materials\n     */\n    private __cleanup() {\n        this.queue.clear();\n        this.state.tiles = {};\n        this.state.faces = {};\n        this.state.materials = [];\n        this.state.inTransition = false;\n    }\n}\n","import { TypedEvent } from '@photo-sphere-viewer/core';\nimport type { Marker } from './markers/Marker';\nimport type { MarkersPlugin } from './MarkersPlugin';\n\n/**\n * Base class for events dispatched by {@link MarkersPlugin}\n */\nexport abstract class MarkersPluginEvent extends TypedEvent<MarkersPlugin> {}\n\n/**\n * @event Triggered when the visibility of a marker changes\n */\nexport class MarkerVisibilityEvent extends MarkersPluginEvent {\n    static override readonly type = 'marker-visibility';\n    override type: 'marker-visibility';\n\n    /** @internal */\n    constructor(\n        public readonly marker: Marker,\n        public readonly visible: boolean,\n    ) {\n        super(MarkerVisibilityEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the animation to a marker is done\n */\nexport class GotoMarkerDoneEvent extends MarkersPluginEvent {\n    static override readonly type = 'goto-marker-done';\n    override type: 'goto-marker-done';\n\n    /** @internal */\n    constructor(public readonly marker: Marker) {\n        super(GotoMarkerDoneEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the user puts the cursor away from a marker\n */\nexport class LeaveMarkerEvent extends MarkersPluginEvent {\n    static override readonly type = 'leave-marker';\n    override type: 'leave-marker';\n\n    /** @internal */\n    constructor(public readonly marker: Marker) {\n        super(LeaveMarkerEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the user puts the cursor hover a marker\n */\nexport class EnterMarkerEvent extends MarkersPluginEvent {\n    static override readonly type = 'enter-marker';\n    override type: 'enter-marker';\n\n    /** @internal */\n    constructor(public readonly marker: Marker) {\n        super(EnterMarkerEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the user clicks on a marker\n */\nexport class SelectMarkerEvent extends MarkersPluginEvent {\n    static override readonly type = 'select-marker';\n    override type: 'select-marker';\n\n    /** @internal */\n    constructor(\n        public readonly marker: Marker,\n        public readonly doubleClick: boolean,\n        public readonly rightClick: boolean,\n    ) {\n        super(SelectMarkerEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a marker is selected from the side panel\n */\nexport class SelectMarkerListEvent extends MarkersPluginEvent {\n    static override readonly type = 'select-marker-list';\n    override type: 'select-marker-list';\n\n    /** @internal */\n    constructor(public readonly marker: Marker) {\n        super(SelectMarkerListEvent.type);\n    }\n}\n\n/**\n * @event Triggered when a marker was selected and the user clicks elsewhere\n */\nexport class UnselectMarkerEvent extends MarkersPluginEvent {\n    static override readonly type = 'unselect-marker';\n    override type: 'unselect-marker';\n\n    /** @internal */\n    constructor(public readonly marker: Marker) {\n        super(UnselectMarkerEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the markers are hidden\n */\nexport class HideMarkersEvent extends MarkersPluginEvent {\n    static override readonly type = 'hide-markers';\n    override type: 'hide-markers';\n\n    /** @internal */\n    constructor() {\n        super(HideMarkersEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the markers change\n */\nexport class SetMarkersEvent extends MarkersPluginEvent {\n    static override readonly type = 'set-markers';\n    override type: 'set-markers';\n\n    /** @internal */\n    constructor(public readonly markers: Marker[]) {\n        super(SetMarkersEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the markers are shown\n */\nexport class ShowMarkersEvent extends MarkersPluginEvent {\n    static override readonly type = 'show-markers';\n    override type: 'show-markers';\n\n    /** @internal */\n    constructor() {\n        super(ShowMarkersEvent.type);\n    }\n}\n\n/**\n * @event Used to alter the list of markers displayed in the side-panel\n */\nexport class RenderMarkersListEvent extends MarkersPluginEvent {\n    static override readonly type = 'render-markers-list';\n    override type: 'render-markers-list';\n\n    /** @internal */\n    constructor(\n        /** the list of markers to display, can be modified */\n        public markers: Marker[],\n    ) {\n        super(RenderMarkersListEvent.type);\n    }\n}\n\nexport type MarkersPluginEvents =\n    | MarkerVisibilityEvent\n    | GotoMarkerDoneEvent\n    | LeaveMarkerEvent\n    | EnterMarkerEvent\n    | SelectMarkerEvent\n    | SelectMarkerListEvent\n    | UnselectMarkerEvent\n    | HideMarkersEvent\n    | SetMarkersEvent\n    | ShowMarkersEvent\n    | RenderMarkersListEvent;\n","import type { Navbar } from '@photo-sphere-viewer/core';\nimport { AbstractButton } from '@photo-sphere-viewer/core';\nimport { HideMarkersEvent, ShowMarkersEvent } from './events';\nimport type { MarkersPlugin } from './MarkersPlugin';\nimport pin from './icons/pin.svg';\n\nexport class MarkersButton extends AbstractButton {\n    static override readonly id = 'markers';\n\n    private readonly plugin: MarkersPlugin;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: 'psv-markers-button',\n            icon: pin,\n            hoverScale: true,\n            collapsable: true,\n            tabbable: true,\n        });\n\n        this.plugin = this.viewer.getPlugin('markers');\n\n        if (this.plugin) {\n            this.plugin.addEventListener(ShowMarkersEvent.type, this);\n            this.plugin.addEventListener(HideMarkersEvent.type, this);\n\n            this.toggleActive(true);\n        }\n    }\n\n    override destroy() {\n        if (this.plugin) {\n            this.plugin.removeEventListener(ShowMarkersEvent.type, this);\n            this.plugin.removeEventListener(HideMarkersEvent.type, this);\n        }\n\n        super.destroy();\n    }\n\n    override isSupported() {\n        return !!this.plugin;\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof ShowMarkersEvent) {\n            this.toggleActive(true);\n        } else if (e instanceof HideMarkersEvent) {\n            this.toggleActive(false);\n        }\n    }\n\n    onClick() {\n        this.plugin.toggleAllMarkers();\n    }\n}\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"10 9 81 81\"><path fill=\"currentColor\" d=\"M50.5 90S22.9 51.9 22.9 36.6 35.2 9 50.5 9s27.6 12.4 27.6 27.6S50.5 90 50.5 90zm0-66.3c-6.1 0-11 4.9-11 11s4.9 11 11 11 11-4.9 11-11-4.9-11-11-11z\"/><!--Created by Rohith M S from the Noun Project--></svg>\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"9 9 81 81\"><path fill=\"currentColor\" d=\"M37.5 90S9.9 51.9 9.9 36.6 22.2 9 37.5 9s27.6 12.4 27.6 27.6S37.5 90 37.5 90zm0-66.3c-6.1 0-11 4.9-11 11s4.9 11 11 11 11-4.9 11-11-4.9-11-11-11zM86.7 55H70c-1.8 0-3.3-1.5-3.3-3.3s1.5-3.3 3.3-3.3h16.7c1.8 0 3.3 1.5 3.3 3.3S88.5 55 86.7 55zm0-25h-15a3.3 3.3 0 0 1-3.3-3.3c0-1.8 1.5-3.3 3.3-3.3h15c1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3zM56.5 73h30c1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3h-30a3.3 3.3 0 0 1-3.3-3.3 3.2 3.2 0 0 1 3.3-3.3z\"/><!--Created by Rohith M S from the Noun Project--></svg>\n","import { utils } from '@photo-sphere-viewer/core';\nimport type { Marker } from './markers/Marker';\nimport icon from './icons/pin-list.svg';\n\n/**\n * Namespace for SVG creation\n * @internal\n */\nexport const SVG_NS = 'http://www.w3.org/2000/svg';\n\n/**\n * Property name added to marker elements\n * @internal\n */\nexport const MARKER_DATA = 'psvMarker';\n\n/**\n * Property name added to marker elements (dash-case)\n * @internal\n */\nexport const MARKER_DATA_KEY = utils.dasherize(MARKER_DATA);\n\n/**\n * Panel identifier for marker content\n * @internal\n */\nexport const ID_PANEL_MARKER = 'marker';\n\n/**\n * Panel identifier for markers list\n * @internal\n */\nexport const ID_PANEL_MARKERS_LIST = 'markersList';\n\n/**\n * Default configuration for the \"hoverScale\" parameters\n * @internal\n */\nexport const DEFAULT_HOVER_SCALE = {\n    amount: 2,\n    duration: 100,\n    easing: 'linear',\n};\n\n/**\n * Markers list template\n * @internal\n */\nexport const MARKERS_LIST_TEMPLATE = (markers: Marker[], title: string) => `\n<div class=\"psv-panel-menu psv-panel-menu--stripped\">\n    <h1 class=\"psv-panel-menu-title\">${icon} ${title}</h1>\n    <ul class=\"psv-panel-menu-list\">\n    ${markers.map(marker => `\n        <li data-${MARKER_DATA_KEY}=\"${marker.id}\" class=\"psv-panel-menu-item\" tabindex=\"0\">\n          ${marker.type === 'image' ? `<span class=\"psv-panel-menu-item-icon\"><img src=\"${marker.definition}\"/></span>` : ''}\n          <span class=\"psv-panel-menu-item-label\">${marker.getListContent()}</span>\n        </li>\n    `).join('')}\n    </ul>\n</div>\n`;\n","import type { Navbar } from '@photo-sphere-viewer/core';\nimport { AbstractButton, events } from '@photo-sphere-viewer/core';\nimport { ID_PANEL_MARKERS_LIST } from './constants';\nimport type { MarkersPlugin } from './MarkersPlugin';\nimport pinList from './icons/pin-list.svg';\n\nexport class MarkersListButton extends AbstractButton {\n    static override readonly id = 'markersList';\n\n    private readonly plugin: MarkersPlugin;\n\n    constructor(navbar: Navbar) {\n        super(navbar, {\n            className: ' psv-markers-list-button',\n            icon: pinList,\n            hoverScale: true,\n            collapsable: true,\n            tabbable: true,\n        });\n\n        this.plugin = this.viewer.getPlugin('markers');\n\n        if (this.plugin) {\n            this.viewer.addEventListener(events.ShowPanelEvent.type, this);\n            this.viewer.addEventListener(events.HidePanelEvent.type, this);\n        }\n    }\n\n    override destroy() {\n        this.viewer.removeEventListener(events.ShowPanelEvent.type, this);\n        this.viewer.removeEventListener(events.HidePanelEvent.type, this);\n\n        super.destroy();\n    }\n\n    override isSupported() {\n        return !!this.plugin;\n    }\n\n    handleEvent(e: Event) {\n        if (e instanceof events.ShowPanelEvent) {\n            this.toggleActive(e.panelId === ID_PANEL_MARKERS_LIST);\n        } else if (e instanceof events.HidePanelEvent) {\n            this.toggleActive(false);\n        }\n    }\n\n    onClick() {\n        this.plugin.toggleMarkersList();\n    }\n}\n","import {\n\tMatrix4,\n\tObject3D,\n\tQuaternion,\n\tVector3\n} from 'three';\n\n// Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs\n\nconst _position = new Vector3();\nconst _quaternion = new Quaternion();\nconst _scale = new Vector3();\n\n/**\n * The base 3D object that is supported by {@link CSS3DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS3DObject } from 'three/addons/renderers/CSS3DRenderer.js';\n */\nclass CSS3DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS3D object.\n\t *\n\t * @param {DOMElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS3DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {DOMElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.pointerEvents = 'auto';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A specialized version of {@link CSS3DObject} that represents\n * DOM elements as sprites.\n *\n * @augments CSS3DObject\n * @three_import import { CSS3DSprite } from 'three/addons/renderers/CSS3DRenderer.js';\n */\nclass CSS3DSprite extends CSS3DObject {\n\n\t/**\n\t * Constructs a new CSS3D sprite object.\n\t *\n\t * @param {DOMElement} [element] - The DOM element.\n\t */\n\tconstructor( element ) {\n\n\t\tsuper( element );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS3DSprite = true;\n\n\t\t/**\n\t\t * The sprite's rotation in radians.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.rotation2D = 0;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.rotation2D = source.rotation2D;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _matrix = new Matrix4();\nconst _matrix2 = new Matrix4();\n\n/**\n * This renderer can be used to apply hierarchical 3D transformations to DOM elements\n * via the CSS3 [transform]{@link https://www.w3schools.com/cssref/css3_pr_transform.asp} property.\n * `CSS3DRenderer` is particularly interesting if you want to apply 3D effects to a website without\n * canvas based rendering. It can also be used in order to combine DOM elements with WebGLcontent.\n *\n * There are, however, some important limitations:\n *\n * - It's not possible to use the material system of *three.js*.\n * - It's also not possible to use geometries.\n * - The renderer only supports 100% browser and display zoom.\n *\n * So `CSS3DRenderer` is just focused on ordinary DOM elements. These elements are wrapped into special\n * 3D objects ({@link CSS3DObject} or {@link CSS3DSprite}) and then added to the scene graph.\n *\n * @three_import import { CSS3DRenderer } from 'three/addons/renderers/CSS3DRenderer.js';\n */\nclass CSS3DRenderer {\n\n\t/**\n\t * Constructs a new CSS3D renderer.\n\t *\n\t * @param {CSS3DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tcamera: { style: '' },\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {DOMElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\tconst viewElement = document.createElement( 'div' );\n\t\tviewElement.style.transformOrigin = '0 0';\n\t\tviewElement.style.pointerEvents = 'none';\n\t\tdomElement.appendChild( viewElement );\n\n\t\tconst cameraElement = document.createElement( 'div' );\n\n\t\tcameraElement.style.transformStyle = 'preserve-3d';\n\n\t\tviewElement.appendChild( cameraElement );\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tconst fov = camera.projectionMatrix.elements[ 5 ] * _heightHalf;\n\n\t\t\tif ( camera.view && camera.view.enabled ) {\n\n\t\t\t\t// view offset\n\t\t\t\tviewElement.style.transform = `translate( ${ - camera.view.offsetX * ( _width / camera.view.width ) }px, ${ - camera.view.offsetY * ( _height / camera.view.height ) }px )`;\n\n\t\t\t\t// view fullWidth and fullHeight, view width and height\n\t\t\t\tviewElement.style.transform += `scale( ${ camera.view.fullWidth / camera.view.width }, ${ camera.view.fullHeight / camera.view.height } )`;\n\n\t\t\t} else {\n\n\t\t\t\tviewElement.style.transform = '';\n\n\t\t\t}\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\tlet tx, ty;\n\n\t\t\tif ( camera.isOrthographicCamera ) {\n\n\t\t\t\ttx = - ( camera.right + camera.left ) / 2;\n\t\t\t\tty = ( camera.top + camera.bottom ) / 2;\n\n\t\t\t}\n\n\t\t\tconst scaleByViewOffset = camera.view && camera.view.enabled ? camera.view.height / camera.view.fullHeight : 1;\n\t\t\tconst cameraCSSMatrix = camera.isOrthographicCamera ?\n\t\t\t\t`scale( ${ scaleByViewOffset } )` + 'scale(' + fov + ')' + 'translate(' + epsilon( tx ) + 'px,' + epsilon( ty ) + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse ) :\n\t\t\t\t`scale( ${ scaleByViewOffset } )` + 'translateZ(' + fov + 'px)' + getCameraCSSMatrix( camera.matrixWorldInverse );\n\t\t\tconst perspective = camera.isPerspectiveCamera ? 'perspective(' + fov + 'px) ' : '';\n\n\t\t\tconst style = perspective + cameraCSSMatrix +\n\t\t\t\t'translate(' + _widthHalf + 'px,' + _heightHalf + 'px)';\n\n\t\t\tif ( cache.camera.style !== style ) {\n\n\t\t\t\tcameraElement.style.transform = style;\n\n\t\t\t\tcache.camera.style = style;\n\n\t\t\t}\n\n\t\t\trenderObject( scene, scene, camera, cameraCSSMatrix );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t\tviewElement.style.width = width + 'px';\n\t\t\tviewElement.style.height = height + 'px';\n\n\t\t\tcameraElement.style.width = width + 'px';\n\t\t\tcameraElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction epsilon( value ) {\n\n\t\t\treturn Math.abs( value ) < 1e-10 ? 0 : value;\n\n\t\t}\n\n\t\tfunction getCameraCSSMatrix( matrix ) {\n\n\t\t\tconst elements = matrix.elements;\n\n\t\t\treturn 'matrix3d(' +\n\t\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 1 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 4 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 6 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 7 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 9 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 13 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 15 ] ) +\n\t\t\t')';\n\n\t\t}\n\n\t\tfunction getObjectCSSMatrix( matrix ) {\n\n\t\t\tconst elements = matrix.elements;\n\t\t\tconst matrix3d = 'matrix3d(' +\n\t\t\t\tepsilon( elements[ 0 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 1 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 2 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 3 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 4 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 5 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 6 ] ) + ',' +\n\t\t\t\tepsilon( - elements[ 7 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 8 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 9 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 10 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 11 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 12 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 13 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 14 ] ) + ',' +\n\t\t\t\tepsilon( elements[ 15 ] ) +\n\t\t\t')';\n\n\t\t\treturn 'translate(-50%,-50%)' + matrix3d;\n\n\t\t}\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS3DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera, cameraCSSMatrix ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS3DObject ) {\n\n\t\t\t\tconst visible = ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\tlet style;\n\n\t\t\t\t\tif ( object.isCSS3DSprite ) {\n\n\t\t\t\t\t\t// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/\n\n\t\t\t\t\t\t_matrix.copy( camera.matrixWorldInverse );\n\t\t\t\t\t\t_matrix.transpose();\n\n\t\t\t\t\t\tif ( object.rotation2D !== 0 ) _matrix.multiply( _matrix2.makeRotationZ( object.rotation2D ) );\n\n\t\t\t\t\t\tobject.matrixWorld.decompose( _position, _quaternion, _scale );\n\t\t\t\t\t\t_matrix.setPosition( _position );\n\t\t\t\t\t\t_matrix.scale( _scale );\n\n\t\t\t\t\t\t_matrix.elements[ 3 ] = 0;\n\t\t\t\t\t\t_matrix.elements[ 7 ] = 0;\n\t\t\t\t\t\t_matrix.elements[ 11 ] = 0;\n\t\t\t\t\t\t_matrix.elements[ 15 ] = 1;\n\n\t\t\t\t\t\tstyle = getObjectCSSMatrix( _matrix );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstyle = getObjectCSSMatrix( object.matrixWorld );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cachedObject = cache.objects.get( object );\n\n\t\t\t\t\tif ( cachedObject === undefined || cachedObject.style !== style ) {\n\n\t\t\t\t\t\telement.style.transform = style;\n\n\t\t\t\t\t\tconst objectData = { style: style };\n\t\t\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( element.parentNode !== cameraElement ) {\n\n\t\t\t\t\t\tcameraElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera, cameraCSSMatrix );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS3DRenderer`.\n *\n * @typedef {Object} CSS3DRenderer~Parameters\n * @property {DOMElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS3DObject, CSS3DSprite, CSS3DRenderer };\n","import { events, type Viewer } from '@photo-sphere-viewer/core';\nimport { Scene } from 'three';\nimport { CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer.js';\nimport { MARKER_DATA } from './constants';\nimport { MarkerCSS3D } from './markers/MarkerCSS3D';\n\n/**\n * @internal\n */\nexport class CSS3DContainer {\n    element: HTMLElement;\n\n    private readonly renderer: CSS3DRenderer;\n    private readonly scene: Scene;\n    private readonly intersectionObserver: IntersectionObserver;\n\n    constructor(\n        private viewer: Viewer,\n    ) {\n        this.element = document.createElement('div');\n        this.element.className = 'psv-markers-css3d-container';\n\n        this.renderer = new CSS3DRenderer({ element: this.element });\n        this.scene = new Scene();\n\n        this.intersectionObserver = new IntersectionObserver((entries) => {\n            entries.forEach((entry) => {\n                const marker = (entry.target as any)[MARKER_DATA] as MarkerCSS3D;\n                if (marker.config.visible) {\n                    marker.viewportIntersection = entry.isIntersecting;\n                }\n            });\n        }, {\n            root: this.element,\n        });\n\n        viewer.addEventListener(events.ReadyEvent.type, this, { once: true });\n        viewer.addEventListener(events.SizeUpdatedEvent.type, this);\n        viewer.addEventListener(events.RenderEvent.type, this);\n    }\n\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case events.ReadyEvent.type:\n            case events.SizeUpdatedEvent.type:\n                this.updateSize();\n                break;\n            case events.RenderEvent.type:\n                this.render();\n                break;\n        }\n    }\n\n    destroy(): void {\n        this.viewer.removeEventListener(events.ReadyEvent.type, this);\n        this.viewer.removeEventListener(events.SizeUpdatedEvent.type, this);\n        this.viewer.removeEventListener(events.RenderEvent.type, this);\n\n        this.intersectionObserver.disconnect();\n    }\n\n    private updateSize() {\n        const size = this.viewer.getSize();\n        this.renderer.setSize(size.width, size.height);\n    }\n\n    private render() {\n        this.renderer.render(this.scene, this.viewer.renderer.camera);\n    }\n\n    addObject(marker: MarkerCSS3D) {\n        this.scene.add(marker.threeElement);\n        this.intersectionObserver.observe(marker.domElement);\n    }\n\n    removeObject(marker: MarkerCSS3D) {\n        this.scene.remove(marker.threeElement);\n        this.intersectionObserver.unobserve(marker.domElement);\n    }\n}\n","import { PSVError } from '@photo-sphere-viewer/core';\nimport { MarkerConfig } from './model';\n\nexport enum MarkerType {\n    image = 'image',\n    html = 'html',\n    element = 'element',\n    imageLayer = 'imageLayer',\n    videoLayer = 'videoLayer',\n    elementLayer = 'elementLayer',\n    polygon = 'polygon',\n    polygonPixels = 'polygonPixels',\n    polyline = 'polyline',\n    polylinePixels = 'polylinePixels',\n    square = 'square',\n    rect = 'rect',\n    circle = 'circle',\n    ellipse = 'ellipse',\n    path = 'path',\n}\n\n/**\n * Determines the type of a marker by the available properties\n * @throws {@link PSVError} when the marker's type cannot be found\n */\nexport function getMarkerType(config: MarkerConfig, allowNone = false): MarkerType {\n    const found: MarkerType[] = [];\n\n    Object.keys(MarkerType).forEach((type) => {\n        if ((config as any)[type]) {\n            found.push(type as MarkerType);\n        }\n    });\n\n    if (found.length === 0 && !allowNone) {\n        throw new PSVError(`missing marker content, either ${Object.keys(MarkerType).join(', ')}`);\n    } else if (found.length > 1) {\n        throw new PSVError(`multiple marker content, either ${Object.keys(MarkerType).join(', ')}`);\n    }\n\n    return found[0];\n}\n","import { PSVError, Point, Position, Size, Tooltip, TooltipConfig, utils, type Viewer } from '@photo-sphere-viewer/core';\nimport { Object3D, Vector3 } from 'three';\nimport { MarkerType, getMarkerType } from '../MarkerType';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MarkerConfig, ParsedMarkerConfig } from '../model';\n\n/**\n * Base class for all markers\n */\nexport abstract class Marker {\n    readonly type: MarkerType;\n\n    protected element: any;\n\n    /**\n     * The final description of the marker. Either text content, image, url, SVG attributes, etc.\n     */\n    definition: any;\n\n    /** @internal */\n    tooltip?: Tooltip;\n\n    config: ParsedMarkerConfig;\n\n    get id(): string {\n        return this.config.id;\n    }\n\n    get data(): any {\n        return this.config.data;\n    }\n\n    get domElement(): HTMLElement | SVGElement {\n        return null;\n    }\n\n    get threeElement(): Object3D {\n        return null;\n    }\n\n    get video(): HTMLVideoElement {\n        return null;\n    }\n\n    /** @internal */\n    readonly state = {\n        anchor: null as Point,\n        visible: false,\n        staticTooltip: false,\n        position: null as Position,\n        position2D: null as Point,\n        positions3D: null as Vector3[],\n        size: null as Size,\n    };\n\n    constructor(\n        protected viewer: Viewer,\n        protected plugin: MarkersPlugin,\n        config: MarkerConfig,\n    ) {\n        if (!config.id) {\n            throw new PSVError('missing marker id');\n        }\n\n        this.type = getMarkerType(config);\n        this.createElement();\n        this.update(config);\n    }\n\n    /**\n     * @internal\n     */\n    abstract createElement(): void;\n\n    /**\n     * @internal\n     * Returns the 2D position if the marker is visible\n     */\n    abstract render(params: {\n        viewerPosition: Position;\n        zoomLevel: number;\n        hoveringMarker: Marker;\n    }): Point;\n\n    /**\n     * @internal\n     */\n    destroy() {\n        delete this.viewer;\n        delete this.plugin;\n        delete this.element;\n\n        this.hideTooltip();\n    }\n\n    /**\n     * Checks if it is a 3D marker (imageLayer, videoLayer)\n     */\n    is3d(): boolean {\n        return false;\n    }\n\n    /**\n     * Checks if it is a normal marker (image, html, element)\n     */\n    isNormal(): boolean {\n        return false;\n    }\n\n    /**\n     * Checks if it is a polygon/polyline marker\n     */\n    isPoly(): boolean {\n        return false;\n    }\n\n    /**\n     * Checks if it is an SVG marker\n     */\n    isSvg(): boolean {\n        return false;\n    }\n\n    /**\n     * Checks if it is an CSS3D marker\n     */\n    isCss3d(): boolean {\n        return false;\n    }\n\n    /**\n     * Updates the marker with new properties\n     * @throws {@link PSVError} if the configuration is invalid\n     * @internal\n     */\n    update(config: MarkerConfig) {\n        const newType = getMarkerType(config, true);\n\n        if (newType !== undefined && newType !== this.type) {\n            throw new PSVError(`cannot change marker ${config.id} type`);\n        }\n\n        this.config = utils.deepmerge(this.config, config as any);\n        if (typeof this.config.tooltip === 'string') {\n            this.config.tooltip = { content: this.config.tooltip };\n        }\n        if (this.config.tooltip && !this.config.tooltip.trigger) {\n            this.config.tooltip.trigger = 'hover';\n        }\n        if (utils.isNil(this.config.visible)) {\n            this.config.visible = true;\n        }\n        if (utils.isNil(this.config.zIndex)) {\n            this.config.zIndex = 1;\n        }\n        if (utils.isNil(this.config.opacity)) {\n            this.config.opacity = 1;\n        }\n\n        if (this.config.rotation) {\n            const rot = this.config.rotation;\n            if (typeof rot === 'object') {\n                this.config.rotation = {\n                    yaw: rot.yaw ? utils.parseAngle(rot.yaw, true, false) : 0,\n                    pitch: rot.pitch ? utils.parseAngle(rot.pitch, true, false) : 0,\n                    roll: rot.roll ? utils.parseAngle(rot.roll, true, false) : 0,\n                };\n            } else {\n                this.config.rotation = {\n                    yaw: 0,\n                    pitch: 0,\n                    roll: utils.parseAngle(rot, true, false),\n                };\n            }\n        } else {\n            this.config.rotation = { yaw: 0, pitch: 0, roll: 0 };\n        }\n\n        this.state.anchor = utils.parsePoint(this.config.anchor);\n    }\n\n    /**\n     * Returns the markers list content for the marker, it can be either :\n     * - the `listContent`\n     * - the `tooltip`\n     * - the `html`\n     * - the `id`\n     * @internal\n     */\n    getListContent(): string {\n        if (this.config.listContent) {\n            return this.config.listContent;\n        } else if (this.config.tooltip?.content) {\n            return this.config.tooltip.content;\n        } else if (this.config.html) {\n            return this.config.html;\n        } else {\n            return this.id;\n        }\n    }\n\n    /**\n     * Display the tooltip of this marker\n     * @internal\n     */\n    showTooltip(clientX?: number, clientY?: number, forceUpdate = false) {\n        if (this.state.visible && this.config.tooltip?.content && this.state.position2D) {\n            const config: TooltipConfig = {\n                ...this.config.tooltip,\n                style: {\n                    // prevents conflicts with tooltip tracking\n                    pointerEvents: this.state.staticTooltip ? 'auto' : 'none',\n                },\n                data: this,\n                top: 0,\n                left: 0,\n            };\n\n            if (this.isPoly() || this.is3d() || this.isCss3d()) {\n                if (clientX || clientY) {\n                    const viewerPos = utils.getPosition(this.viewer.container);\n                    config.top = clientY - viewerPos.y + 10;\n                    config.left = clientX - viewerPos.x;\n                    config.box = {\n                        // separate the tooltip from the cursor\n                        width: 20,\n                        height: 20,\n                    };\n                } else {\n                    config.top = this.state.position2D.y;\n                    config.left = this.state.position2D.x;\n                }\n            } else {\n                // note: state.position2D already has the anchor applied with the default size\n                const position = this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);\n                let width = this.state.size.width;\n                let height = this.state.size.height;\n\n                // only apply scaling for \"temporary\" tooltips\n                if (this.config.hoverScale && !this.state.staticTooltip) {\n                    width *= this.config.hoverScale.amount;\n                    height *= this.config.hoverScale.amount;\n                }\n\n                config.top = position.y - height * this.state.anchor.y + height / 2;\n                config.left = position.x - width * this.state.anchor.x + width / 2;\n                config.box = { width, height };\n            }\n\n            if (this.tooltip) {\n                if (forceUpdate) {\n                    this.tooltip.update(this.config.tooltip.content, config);\n                } else {\n                    this.tooltip.move(config);\n                }\n            } else {\n                this.tooltip = this.viewer.createTooltip(config);\n            }\n        }\n    }\n\n    /**\n     * Hides the tooltip of this marker\n     * @internal\n     */\n    hideTooltip() {\n        if (this.tooltip) {\n            this.tooltip.hide();\n            this.tooltip = null;\n        }\n    }\n}\n","import { utils, type Viewer } from '@photo-sphere-viewer/core';\nimport { MARKER_DATA } from '../constants';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MarkerConfig } from '../model';\nimport { Marker } from './Marker';\n\n/**\n * Base class for markers added in the DOM\n * @internal\n */\nexport abstract class AbstractDomMarker extends Marker {\n    override get domElement(): HTMLElement | SVGElement {\n        return this.element;\n    }\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    protected afterCreateElement(): void {\n        this.element[MARKER_DATA] = this;\n    }\n\n    override destroy(): void {\n        delete this.element[MARKER_DATA];\n\n        super.destroy();\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        const element = this.domElement;\n\n        element.id = `psv-marker-${this.config.id}`;\n\n        // reset CSS class\n        element.setAttribute('class', 'psv-marker');\n        if (this.state.visible) {\n            element.classList.add('psv-marker--visible');\n        }\n        if (this.config.tooltip) {\n            element.classList.add('psv-marker--has-tooltip');\n        }\n        if (this.config.content) {\n            element.classList.add('psv-marker--has-content');\n        }\n        if (this.config.className) {\n            utils.addClasses(element, this.config.className);\n        }\n\n        // apply style\n        element.style.opacity = `${this.config.opacity}`;\n        element.style.zIndex = `${30 + this.config.zIndex}`; // 30 is the base z-index in the stylesheet\n        if (this.config.style) {\n            Object.assign(element.style, this.config.style);\n        }\n    }\n}\n","import { CONSTANTS, Point, Position, PSVError, utils, type Viewer } from '@photo-sphere-viewer/core';\nimport { MathUtils } from 'three';\nimport { DEFAULT_HOVER_SCALE } from '../constants';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MarkerType } from '../MarkerType';\nimport { MarkerConfig } from '../model';\nimport { AbstractDomMarker } from './AbstractDomMarker';\nimport { Marker } from './Marker';\n\n/**\n * Base class for standard markers\n * @internal\n */\nexport abstract class AbstractStandardMarker extends AbstractDomMarker {\n    protected needsUpdateSize: boolean;\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    protected override afterCreateElement(): void {\n        super.afterCreateElement();\n\n        this.domElement.addEventListener('transitionend', () => {\n            // the transition \"scale\" is only applied manually on mouseover\n            // because it must not be present when the scale changes on zoom/move\n            this.domElement.style.transition = '';\n        });\n    }\n\n    override render({\n        viewerPosition,\n        zoomLevel,\n        hoveringMarker,\n    }: {\n        viewerPosition: Position;\n        zoomLevel: number;\n        hoveringMarker: Marker;\n    }): Point {\n        this.__updateSize();\n\n        const position = this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);\n        position.x -= this.state.size.width * this.state.anchor.x;\n        position.y -= this.state.size.height * this.state.anchor.y;\n\n        // It tests if the point is in the general direction of the camera, then check if it's in the viewport\n        const isVisible = (\n            this.state.positions3D[0].dot(this.viewer.state.direction) > 0\n            && position.x + this.state.size.width >= 0\n            && position.x - this.state.size.width <= this.viewer.state.size.width\n            && position.y + this.state.size.height >= 0\n            && position.y - this.state.size.height <= this.viewer.state.size.height\n        );\n\n        if (isVisible) {\n            this.domElement.style.translate = `${position.x}px ${position.y}px 0px`;\n\n            this.applyScale({\n                zoomLevel,\n                viewerPosition,\n                mouseover: this === hoveringMarker,\n            });\n\n            return position;\n        } else {\n            return null;\n        }\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        if (!utils.isExtendedPosition(this.config.position)) {\n            throw new PSVError(`missing marker ${this.id} position`);\n        }\n\n        // convert texture coordinates to spherical coordinates\n        try {\n            this.state.position = this.viewer.dataHelper.cleanPosition(this.config.position);\n        } catch (e) {\n            throw new PSVError(`invalid marker ${this.id} position`, e);\n        }\n\n        // compute x/y/z position\n        this.state.positions3D = [this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];\n\n        const element = this.domElement;\n\n        element.classList.add('psv-marker--normal');\n\n        if (this.config.scale && Array.isArray(this.config.scale)) {\n            this.config.scale = { zoom: this.config.scale as any };\n        }\n        if (typeof this.config.hoverScale === 'boolean') {\n            this.config.hoverScale = this.config.hoverScale\n                ? this.plugin.config.defaultHoverScale || DEFAULT_HOVER_SCALE\n                : null;\n        } else if (typeof this.config.hoverScale === 'number') {\n            this.config.hoverScale = { amount: this.config.hoverScale } as any;\n        } else if (!this.config.hoverScale) {\n            this.config.hoverScale = this.plugin.config.defaultHoverScale;\n        }\n        if (this.config.hoverScale) {\n            this.config.hoverScale = {\n                ...this.plugin.config.defaultHoverScale,\n                ...this.config.hoverScale,\n            };\n        }\n\n        // set rotation\n        element.style.rotate = this.config.rotation.roll !== 0 ? MathUtils.radToDeg(this.config.rotation.roll) + 'deg' : null;\n\n        // set anchor\n        element.style.transformOrigin = `${this.state.anchor.x * 100}% ${this.state.anchor.y * 100}%`;\n    }\n\n    /**\n     * Computes the real size of a marker\n     * @description This is done by removing all it's transformations (if any) and making it visible\n     * before querying its bounding rect\n     */\n    private __updateSize() {\n        if (!this.needsUpdateSize) {\n            return;\n        }\n\n        const element = this.domElement;\n        const makeTransparent = !this.state.visible || !this.state.size;\n\n        if (makeTransparent) {\n            element.classList.add('psv-marker--transparent');\n        }\n\n        if (this.isSvg()) {\n            const rect = (element.firstElementChild as SVGElement).getBoundingClientRect();\n            this.state.size = {\n                width: rect.width,\n                height: rect.height,\n            };\n        } else {\n            this.state.size = {\n                width: (element as HTMLElement).offsetWidth,\n                height: (element as HTMLElement).offsetHeight,\n            };\n        }\n\n        if (makeTransparent) {\n            element.classList.remove('psv-marker--transparent');\n        }\n\n        if (this.isSvg()) {\n            // the real size must be declared on the SVG root\n            element.style.width = this.state.size.width + 'px';\n            element.style.height = this.state.size.height + 'px';\n        }\n\n        // custom element HTML marker remain dynamic\n        if (this.type !== MarkerType.element) {\n            this.needsUpdateSize = false;\n        }\n    }\n\n    /**\n     * Computes and applies the scale to the marker\n     */\n    applyScale({\n        zoomLevel,\n        viewerPosition,\n        mouseover,\n    }: {\n        zoomLevel: number;\n        viewerPosition: Position;\n        mouseover: boolean;\n    }) {\n        if (mouseover !== null && this.config.hoverScale) {\n            this.domElement.style.transition = `scale ${this.config.hoverScale.duration}ms ${this.config.hoverScale.easing}`;\n        }\n\n        let scale = 1;\n        if (typeof this.config.scale === 'function') {\n            scale = this.config.scale(zoomLevel, viewerPosition);\n        } else if (this.config.scale) {\n            if (Array.isArray(this.config.scale.zoom)) {\n                const [min, max] = this.config.scale.zoom;\n                scale *= min + (max - min) * CONSTANTS.EASINGS.inQuad(zoomLevel / 100);\n            }\n            if (Array.isArray(this.config.scale.yaw)) {\n                const [min, max] = this.config.scale.yaw;\n                const halfFov = MathUtils.degToRad(this.viewer.state.hFov) / 2;\n                const arc = Math.abs(utils.getShortestArc(this.state.position.yaw, viewerPosition.yaw));\n                scale *= max + (min - max) * CONSTANTS.EASINGS.outQuad(Math.max(0, (halfFov - arc) / halfFov));\n            }\n        }\n        if (mouseover && this.config.hoverScale) {\n            scale *= this.config.hoverScale.amount;\n        }\n\n        this.domElement.style.scale = `${scale}`;\n    }\n}\n","import { Color, ColorRepresentation, ShaderMaterial, Texture, Vector2 } from 'three';\nimport chromaKeyFragment from './shaders/chromaKey.fragment.glsl';\nimport chromaKeyVertex from './shaders/chromaKey.vertex.glsl';\n\ntype ShaderUniforms = {\n    map: { value: Texture };\n    repeat: { value: Vector2 };\n    offset: { value: Vector2 };\n    alpha: { value: number };\n    keying: { value: boolean };\n    color: { value: Color };\n    similarity: { value: number };\n    smoothness: { value: number };\n    spill: { value: number };\n};\n\ntype ChromaKey = {\n    /** @default false */\n    enabled: boolean;\n    /** @default 0x00ff00 */\n    color?: ColorRepresentation | { r: number; g: number; b: number };\n    /** @default 0.2 */\n    similarity?: number;\n    /** @default 0.2 */\n    smoothness?: number;\n};\n\nexport class ChromaKeyMaterial extends ShaderMaterial {\n    override uniforms: ShaderUniforms;\n\n    get map(): Texture {\n        return this.uniforms.map.value;\n    }\n\n    set map(map: Texture) {\n        this.uniforms.map.value = map;\n    }\n\n    set alpha(alpha: number) {\n        this.uniforms.alpha.value = alpha;\n    }\n\n    get offset(): Vector2 {\n        return this.uniforms.offset.value;\n    }\n\n    get repeat(): Vector2 {\n        return this.uniforms.repeat.value;\n    }\n\n    set chromaKey(chromaKey: ChromaKey) {\n        this.uniforms.keying.value = chromaKey?.enabled === true;\n        if (chromaKey?.enabled) {\n            if (typeof chromaKey.color === 'object' && 'r' in chromaKey.color) {\n                this.uniforms.color.value.set(\n                    chromaKey.color.r / 255,\n                    chromaKey.color.g / 255,\n                    chromaKey.color.b / 255,\n                );\n            } else {\n                this.uniforms.color.value.set(chromaKey.color ?? 0x00ff00);\n            }\n            this.uniforms.similarity.value = chromaKey.similarity ?? 0.2;\n            this.uniforms.smoothness.value = chromaKey.smoothness ?? 0.2;\n        }\n    }\n\n    constructor(params?: {\n        map?: Texture;\n        alpha?: number;\n        chromaKey?: ChromaKey;\n    }) {\n        super({\n            transparent: true,\n            depthTest: false,\n            depthWrite: false,\n            uniforms: {\n                map: { value: params?.map },\n                repeat: { value: new Vector2(1, 1) },\n                offset: { value: new Vector2(0, 0) },\n                alpha: { value: params?.alpha ?? 1 },\n                keying: { value: false },\n                color: { value: new Color(0x00ff00) },\n                similarity: { value: 0.2 },\n                smoothness: { value: 0.2 },\n                spill: { value: 0.1 },\n            } satisfies ShaderUniforms,\n            vertexShader: chromaKeyVertex,\n            fragmentShader: chromaKeyFragment,\n        });\n\n        this.chromaKey = params?.chromaKey;\n    }\n}\n","varying vec2 vUv;\nuniform vec2 repeat;\nuniform vec2 offset;\n\nvoid main() {\n    vUv = uv * repeat + offset;\n    gl_Position = projectionMatrix *  modelViewMatrix * vec4( position, 1.0 );\n}\n","// https://www.8thwall.com/playground/chromakey-threejs\n\nuniform sampler2D map;\nuniform float alpha;\nuniform bool keying;\nuniform vec3 color;\nuniform float similarity;\nuniform float smoothness;\nuniform float spill;\n\nvarying vec2 vUv;\n\nvec2 RGBtoUV(vec3 rgb) {\n    return vec2(\n        rgb.r * -0.169 + rgb.g * -0.331 + rgb.b *  0.5    + 0.5,\n        rgb.r *  0.5   + rgb.g * -0.419 + rgb.b * -0.081  + 0.5\n    );\n}\n\nvoid main(void) {\n    gl_FragColor = texture2D(map, vUv);\n\n    if (keying) {\n        float chromaDist = distance(RGBtoUV(gl_FragColor.rgb), RGBtoUV(color));\n\n        float baseMask = chromaDist - similarity;\n        float fullMask = pow(clamp(baseMask / smoothness, 0., 1.), 1.5);\n        gl_FragColor.a *= fullMask * alpha;\n\n        float spillVal = pow(clamp(baseMask / spill, 0., 1.), 1.5);\n        float desat = clamp(gl_FragColor.r * 0.2126 + gl_FragColor.g * 0.7152 + gl_FragColor.b * 0.0722, 0., 1.);\n        gl_FragColor.rgb = mix(vec3(desat, desat, desat), gl_FragColor.rgb, spillVal);\n    } else {\n        gl_FragColor.a *= alpha;\n    }\n}\n","import { CONSTANTS, utils } from '@photo-sphere-viewer/core';\nimport { Vector3 } from 'three';\n\n/**\n * Returns intermediary point between two points on the sphere\n * {@link http://www.movable-type.co.uk/scripts/latlong.html}\n */\nfunction greatArcIntermediaryPoint(p1: [number, number], p2: [number, number], f: number): [number, number] {\n    const [λ1, φ1] = p1;\n    const [λ2, φ2] = p2;\n\n    // note: \"r\" should be the angular distance, see \"intermediatePointTo\" in the above article\n    // but \"greatArcDistance\" gives identiqual results up to 0.00001 radians and is faster\n    const r = utils.greatArcDistance(p1, p2);\n    const a = Math.sin((1 - f) * r) / Math.sin(r);\n    const b = Math.sin(f * r) / Math.sin(r);\n    const x = a * Math.cos(φ1) * Math.cos(λ1) + b * Math.cos(φ2) * Math.cos(λ2);\n    const y = a * Math.cos(φ1) * Math.sin(λ1) + b * Math.cos(φ2) * Math.sin(λ2);\n    const z = a * Math.sin(φ1) + b * Math.sin(φ2);\n\n    return [Math.atan2(y, x), Math.atan2(z, Math.sqrt(x * x + y * y))];\n}\n\n/**\n * Given a list of spherical points, offsets yaws in order to have only coutinuous values\n * eg: [0.2, 6.08] is transformed to [0.2, -0.2]\n */\nfunction getPolygonCoherentPoints(points: Array<[number, number]>) {\n    const workPoints = [points[0]];\n\n    let k = 0;\n    for (let i = 1; i < points.length; i++) {\n        const d = points[i - 1][0] - points[i][0];\n        if (d > Math.PI) {\n            // crossed the origin left to right\n            k += 1;\n        } else if (d < -Math.PI) {\n            // crossed the origin right to left\n            k -= 1;\n        }\n        workPoints.push([points[i][0] + k * 2 * Math.PI, points[i][1]]);\n    }\n\n    return workPoints;\n}\n\n/**\n * Computes the center point of a polygon\n * @todo Get \"visual center\" (https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual-center-of-a-polygon-7c77e6492fbc)\n * @internal\n */\nexport function getPolygonCenter(polygon: Vector3[]): Vector3 {\n    return polygon\n        .reduce((sum, point) => sum.add(point), new Vector3())\n        .normalize();\n}\n\n/**\n * Computes the middle point of a polyline\n * @internal\n */\nexport function getPolylineCenter(polyline: Array<[number, number]>): [number, number] {\n    const points = getPolygonCoherentPoints(polyline);\n\n    // compute each segment length + total length\n    let length = 0;\n    const lengths = [];\n\n    for (let i = 0; i < points.length - 1; i++) {\n        const l = utils.greatArcDistance(points[i], points[i + 1]) * CONSTANTS.SPHERE_RADIUS;\n\n        lengths.push(l);\n        length += l;\n    }\n\n    // iterate until length / 2\n    let consumed = 0;\n\n    for (let j = 0; j < points.length - 1; j++) {\n        // once the segment containing the middle point is found, computes the intermediary point\n        if (consumed + lengths[j] > length / 2) {\n            const r = (length / 2 - consumed) / lengths[j];\n            return greatArcIntermediaryPoint(points[j], points[j + 1], r);\n        }\n\n        consumed += lengths[j];\n    }\n\n    // this never happens\n    return points[Math.round(points.length / 2)];\n}\n\nconst C = new Vector3();\nconst N = new Vector3();\nconst V = new Vector3();\nconst X = new Vector3();\nconst Y = new Vector3();\nconst A = new Vector3();\n\n/**\n * Given one point in the same direction of the camera and one point behind the camera,\n * computes an intermediary point on the great circle delimiting the half sphere visible by the camera.\n * The point is shifted by .01 rad because the projector cannot handle points exactly on this circle.\n * @todo : does not work with fisheye view (must not use the great circle)\n * @link http://math.stackexchange.com/a/1730410/327208\n */\nexport function getGreatCircleIntersection(P1: Vector3, P2: Vector3, direction: Vector3): Vector3 {\n    C.copy(direction).normalize();\n    N.crossVectors(P1, P2).normalize();\n    V.crossVectors(N, P1).normalize();\n    X.copy(P1).multiplyScalar(-C.dot(V));\n    Y.copy(V).multiplyScalar(C.dot(P1));\n    const H = new Vector3().addVectors(X, Y).normalize();\n    A.crossVectors(H, C);\n    return H.applyAxisAngle(A, 0.01).multiplyScalar(CONSTANTS.SPHERE_RADIUS);\n}\n","import { ExtendedPosition, PSVError, Point, Position, Size, utils, type Viewer } from '@photo-sphere-viewer/core';\nimport {\n    Group,\n    Mesh,\n    Object3D,\n    PlaneGeometry,\n    Texture,\n    Vector3,\n    VideoTexture,\n} from 'three';\nimport { ChromaKeyMaterial } from '../../../shared/ChromaKeyMaterial';\nimport { createVideo } from '../../../shared/video-utils';\nimport { MarkerType } from '../MarkerType';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MARKER_DATA } from '../constants';\nimport { MarkerConfig } from '../model';\nimport { getPolygonCenter } from '../utils';\nimport { Marker } from './Marker';\n\n/**\n * @internal\n */\nexport class Marker3D extends Marker {\n    override get threeElement(): Group {\n        return this.element;\n    }\n\n    get threeMesh(): Mesh<PlaneGeometry, ChromaKeyMaterial> {\n        return this.threeElement.children[0] as any;\n    }\n\n    override get video(): HTMLVideoElement {\n        if (this.type === MarkerType.videoLayer) {\n            return this.threeMesh.material.map.image;\n        } else {\n            return null;\n        }\n    }\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    override is3d(): boolean {\n        return true;\n    }\n\n    override createElement(): void {\n        const material = new ChromaKeyMaterial({ alpha: 0 });\n        const geometry = new PlaneGeometry(1, 1);\n        const mesh = new Mesh(geometry, material);\n        mesh.userData = { [MARKER_DATA]: this };\n\n        // overwrite the visible property to be tied to the Marker instance\n        // and do it without context bleed\n        Object.defineProperty(mesh, 'visible', {\n            enumerable: true,\n            get: function (this: Object3D) {\n                return (this.userData[MARKER_DATA] as Marker).config.visible;\n            },\n            set: function (this: Object3D, visible: boolean) {\n                (this.userData[MARKER_DATA] as Marker).config.visible = visible;\n            },\n        });\n\n        this.element = new Group().add(mesh);\n\n        if (this.type === MarkerType.videoLayer) {\n            this.viewer.needsContinuousUpdate(true);\n        }\n    }\n\n    override destroy(): void {\n        delete this.threeMesh.userData[MARKER_DATA];\n\n        if (this.type === MarkerType.videoLayer) {\n            this.video.pause();\n            this.viewer.needsContinuousUpdate(false);\n        }\n\n        super.destroy();\n    }\n\n    override render(): Point {\n        if (this.viewer.renderer.isObjectVisible(this.threeMesh)) {\n            return this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position);\n        } else {\n            return null;\n        }\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        const mesh = this.threeMesh;\n        const group = mesh.parent;\n        const material = mesh.material;\n\n        if (utils.isExtendedPosition(this.config.position)) {\n            try {\n                this.state.position = this.viewer.dataHelper.cleanPosition(this.config.position);\n            } catch (e) {\n                throw new PSVError(`invalid marker ${this.id} position`, e);\n            }\n\n            if (!this.config.size) {\n                throw new PSVError(`missing marker ${this.id} size`);\n            }\n\n            this.state.size = this.config.size;\n\n            // 100 is magic number that gives a coherent size at default zoom level\n            mesh.scale.set(this.config.size.width / 100, this.config.size.height / 100, 1);\n            mesh.position.set(mesh.scale.x * (0.5 - this.state.anchor.x), mesh.scale.y * (this.state.anchor.y - 0.5), 0);\n            mesh.rotation.set(0, 0, 0);\n            this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position, group.position);\n\n            group.lookAt(0, group.position.y, 0);\n            mesh.rotateY(-this.config.rotation.yaw);\n            mesh.rotateX(-this.config.rotation.pitch);\n            mesh.rotateZ(-this.config.rotation.roll);\n\n            const p = mesh.geometry.getAttribute('position');\n            this.state.positions3D = [0, 1, 3, 2].map((i) => {\n                const v3 = new Vector3();\n                v3.fromBufferAttribute(p, i);\n                return mesh.localToWorld(v3);\n            });\n        } else {\n            if (this.config.position?.length !== 4) {\n                throw new PSVError(`missing marker ${this.id} position`);\n            }\n\n            let positions: Position[];\n            try {\n                positions = this.config.position.map(p => this.viewer.dataHelper.cleanPosition(p));\n            } catch (e) {\n                throw new PSVError(`invalid marker ${this.id} position`, e);\n            }\n\n            const positions3D = positions.map(p => this.viewer.dataHelper.sphericalCoordsToVector3(p));\n\n            const centroid = getPolygonCenter(positions3D);\n            this.state.position = this.viewer.dataHelper.vector3ToSphericalCoords(centroid);\n\n            this.state.positions3D = positions3D;\n\n            const p = mesh.geometry.getAttribute('position');\n            [\n                positions3D[0],\n                positions3D[1],\n                positions3D[3], // not a mistake!\n                positions3D[2],\n            ].forEach((v, i) => {\n                p.setX(i, v.x);\n                p.setY(i, v.y);\n                p.setZ(i, v.z);\n            });\n            p.needsUpdate = true;\n\n            this.__setTextureWrap(material);\n        }\n\n        switch (this.type) {\n            case MarkerType.videoLayer:\n                if (this.definition !== this.config.videoLayer) {\n                    material.map?.dispose();\n\n                    const video = createVideo({\n                        src: this.config.videoLayer,\n                        withCredentials: this.viewer.config.withCredentials(this.config.videoLayer),\n                        muted: true,\n                        autoplay: this.config.autoplay ?? true,\n                    });\n\n                    const texture = new VideoTexture(video);\n                    material.map = texture;\n                    material.alpha = 0;\n\n                    video.addEventListener('loadedmetadata', () => {\n                        if (!this.viewer) {\n                            return; // the marker has been removed\n                        }\n\n                        material.alpha = this.config.opacity;\n\n                        if (!utils.isExtendedPosition(this.config.position)) {\n                            mesh.material.userData[MARKER_DATA] = { width: video.videoWidth, height: video.videoHeight };\n                            this.__setTextureWrap(material);\n                        }\n                    }, { once: true });\n\n                    if (video.autoplay) {\n                        video.play();\n                    }\n\n                    this.definition = this.config.videoLayer;\n                } else {\n                    material.alpha = this.config.opacity;\n                }\n                break;\n\n            case MarkerType.imageLayer:\n                if (this.definition !== this.config.imageLayer) {\n                    material.map?.dispose();\n\n                    const texture = new Texture();\n                    material.map = texture;\n                    material.alpha = 0;\n\n                    this.viewer.textureLoader.loadImage(this.config.imageLayer).then((image) => {\n                        if (!this.viewer) {\n                            return; // the marker has been removed\n                        }\n\n                        if (!utils.isExtendedPosition(this.config.position)) {\n                            mesh.material.userData[MARKER_DATA] = { width: image.width, height: image.height };\n                            this.__setTextureWrap(material);\n                        }\n\n                        texture.image = image;\n                        texture.anisotropy = 4;\n                        texture.needsUpdate = true;\n                        material.alpha = this.config.opacity;\n\n                        this.viewer.needsUpdate();\n                    });\n\n                    this.definition = this.config.imageLayer;\n                } else {\n                    material.alpha = this.config.opacity;\n                }\n                break;\n\n            // no default\n        }\n\n        material.chromaKey = this.config.chromaKey;\n        mesh.renderOrder = 1000 + this.config.zIndex;\n        mesh.geometry.boundingBox = null; // reset box for Renderer.isObjectVisible\n    }\n\n    /**\n     * For layers positionned by corners, applies offset to the texture in order to keep its proportions\n     */\n    private __setTextureWrap(material: ChromaKeyMaterial) {\n        const imageSize: Size = material.userData[MARKER_DATA];\n\n        if (!imageSize || !imageSize.height || !imageSize.width) {\n            material.repeat.set(1, 1);\n            material.offset.set(0, 0);\n            return;\n        }\n\n        const positions = (this.config.position as ExtendedPosition[]).map((p) => {\n            return this.viewer.dataHelper.cleanPosition(p);\n        });\n\n        const w1 = utils.greatArcDistance(\n            [positions[0].yaw, positions[0].pitch],\n            [positions[1].yaw, positions[1].pitch],\n        );\n        const w2 = utils.greatArcDistance(\n            [positions[3].yaw, positions[3].pitch],\n            [positions[2].yaw, positions[2].pitch],\n        );\n        const h1 = utils.greatArcDistance(\n            [positions[1].yaw, positions[1].pitch],\n            [positions[2].yaw, positions[2].pitch],\n        );\n        const h2 = utils.greatArcDistance(\n            [positions[0].yaw, positions[0].pitch],\n            [positions[3].yaw, positions[3].pitch],\n        );\n\n        const layerRatio = (w1 + w2) / (h1 + h2);\n        const imageRatio = imageSize.width / imageSize.height;\n\n        let hMargin = 0;\n        let vMargin = 0;\n        if (layerRatio < imageRatio) {\n            hMargin = imageRatio - layerRatio;\n        } else {\n            vMargin = 1 / imageRatio - 1 / layerRatio;\n        }\n\n        material.repeat.set(1 - hMargin, 1 - vMargin);\n        material.offset.set(hMargin / 2, vMargin / 2);\n    }\n}\n","/**\n * Create a standard video element\n */\nexport function createVideo({\n    src,\n    withCredentials,\n    muted,\n    autoplay,\n}: {\n    src: string | MediaStream;\n    withCredentials: boolean;\n    muted: boolean;\n    autoplay: boolean;\n}): HTMLVideoElement {\n    const video = document.createElement('video');\n    video.crossOrigin = withCredentials ? 'use-credentials' : 'anonymous';\n    video.loop = true;\n    video.playsInline = true;\n    video.autoplay = autoplay;\n    video.muted = muted;\n    video.preload = 'metadata';\n    if (src instanceof MediaStream) {\n        video.srcObject = src;\n    } else {\n        video.src = src;\n    }\n    return video;\n}\n","import { PSVError, Point, Position, utils, type Viewer } from '@photo-sphere-viewer/core';\nimport { Object3D } from 'three';\nimport { CSS3DObject } from 'three/examples/jsm/renderers/CSS3DRenderer.js';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MARKER_DATA } from '../constants';\nimport { MarkerConfig } from '../model';\nimport { AbstractDomMarker } from './AbstractDomMarker';\nimport { Marker } from './Marker';\n\n/**\n * @internal\n */\nexport class MarkerCSS3D extends AbstractDomMarker {\n    private object: CSS3DObject;\n\n    /**\n     * @internal\n     */\n    viewportIntersection = false;\n\n    override get threeElement() {\n        return this.object;\n    }\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    override isCss3d(): boolean {\n        return true;\n    }\n\n    override createElement(): void {\n        this.element = document.createElement('div');\n\n        this.object = new CSS3DObject(this.element);\n        this.object.userData = { [MARKER_DATA]: this };\n\n        // overwrite the visible property to be tied to the Marker instance\n        // and do it without context bleed\n        Object.defineProperty(this.object, 'visible', {\n            enumerable: true,\n            get: function (this: Object3D) {\n                return (this.userData[MARKER_DATA] as Marker).config.visible;\n            },\n            set: function (this: Object3D, visible: boolean) {\n                (this.userData[MARKER_DATA] as Marker).config.visible = visible;\n            },\n        });\n\n        this.afterCreateElement();\n    }\n\n    override destroy(): void {\n        delete this.object.userData[MARKER_DATA];\n        delete this.object;\n\n        super.destroy();\n    }\n\n    override render({\n        viewerPosition,\n        zoomLevel,\n    }: {\n        viewerPosition: Position;\n        zoomLevel: number;\n    }): Point {\n        const element = this.domElement;\n\n        this.state.size = {\n            width: (element as HTMLElement).offsetWidth,\n            height: (element as HTMLElement).offsetHeight,\n        };\n\n        const isVisible = this.state.positions3D[0].dot(this.viewer.state.direction) > 0 && this.viewportIntersection;\n\n        if (isVisible) {\n            const position = this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position);\n\n            this.config.elementLayer.updateMarker?.({\n                marker: this,\n                position,\n                viewerPosition,\n                zoomLevel,\n                viewerSize: this.viewer.state.size,\n            });\n\n            return position;\n        } else {\n            return null;\n        }\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        if (!utils.isExtendedPosition(this.config.position)) {\n            throw new PSVError(`missing marker ${this.id} position`);\n        }\n\n        // convert texture coordinates to spherical coordinates\n        try {\n            this.state.position = this.viewer.dataHelper.cleanPosition(this.config.position);\n        } catch (e) {\n            throw new PSVError(`invalid marker ${this.id} position`, e);\n        }\n\n        // compute x/y/z position\n        this.state.positions3D = [this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];\n\n        const object = this.threeElement;\n        const element = this.domElement;\n\n        element.classList.add('psv-marker--css3d');\n\n        element.childNodes.forEach(n => n.remove());\n        element.appendChild(this.config.elementLayer);\n        this.config.elementLayer.style.display = 'block';\n\n        object.position.copy(this.state.positions3D[0]).multiplyScalar(100);\n        object.lookAt(0, this.state.positions3D[0].y * 100, 0);\n        object.rotateY(-this.config.rotation.yaw);\n        object.rotateX(-this.config.rotation.pitch);\n        object.rotateZ(-this.config.rotation.roll);\n    }\n}\n","import { PSVError, Point, Position, type Viewer } from '@photo-sphere-viewer/core';\nimport { MarkerType } from '../MarkerType';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MarkerConfig } from '../model';\nimport { AbstractStandardMarker } from './AbstractStandardMarker';\nimport { Marker } from './Marker';\n\n/**\n * @internal\n */\nexport class MarkerNormal extends AbstractStandardMarker {\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    override isNormal(): boolean {\n        return true;\n    }\n\n    override createElement(): void {\n        this.element = document.createElement('div');\n        this.afterCreateElement();\n    }\n\n    override render(params: {\n        viewerPosition: Position;\n        zoomLevel: number;\n        hoveringMarker: Marker;\n    }): Point {\n        const position = super.render(params);\n\n        if (position && this.type === MarkerType.element) {\n            this.config.element.updateMarker?.({\n                marker: this,\n                position,\n                viewerPosition: params.viewerPosition,\n                zoomLevel: params.zoomLevel,\n                viewerSize: this.viewer.state.size,\n            });\n        }\n\n        return position;\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        const element = this.domElement;\n\n        if (this.config.image && !this.config.size) {\n            throw new PSVError(`missing marker ${this.id} size`);\n        }\n\n        if (this.config.size) {\n            this.needsUpdateSize = false;\n            this.state.size = this.config.size;\n            element.style.width = this.config.size.width + 'px';\n            element.style.height = this.config.size.height + 'px';\n        } else {\n            this.needsUpdateSize = true;\n        }\n\n        switch (this.type) {\n            case MarkerType.image:\n                this.definition = this.config.image;\n                element.style.backgroundImage = `url(\"${this.config.image}\")`;\n                break;\n            case MarkerType.html:\n                this.definition = this.config.html;\n                element.innerHTML = this.config.html;\n                break;\n            case MarkerType.element:\n                if (this.definition !== this.config.element) {\n                    this.definition = this.config.element;\n                    element.childNodes.forEach(n => n.remove());\n                    element.appendChild(this.config.element);\n                    this.config.element.style.display = 'block';\n                }\n                break;\n        }\n    }\n}\n","import {\n    PSVError,\n    PanoramaPosition,\n    Point,\n    Position,\n    SphericalPosition,\n    Viewer,\n    utils,\n} from '@photo-sphere-viewer/core';\nimport { Vector3 } from 'three';\nimport { MarkerType } from '../MarkerType';\nimport { MarkersPlugin } from '../MarkersPlugin';\nimport { MARKER_DATA, SVG_NS } from '../constants';\nimport { MarkerConfig } from '../model';\nimport { getGreatCircleIntersection, getPolygonCenter, getPolylineCenter } from '../utils';\nimport { AbstractDomMarker } from './AbstractDomMarker';\n\n/**\n * @internal\n */\nexport class MarkerPolygon extends AbstractDomMarker {\n    private positions3D: Vector3[][];\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    override createElement(): void {\n        this.element = document.createElementNS(SVG_NS, 'path');\n        this.element[MARKER_DATA] = this;\n    }\n\n    override isPoly(): boolean {\n        return true;\n    }\n\n    /**\n     * Checks if it is a polygon/polyline using pixel coordinates\n     */\n    private get isPixels(): boolean {\n        return this.type === MarkerType.polygonPixels || this.type === MarkerType.polylinePixels;\n    }\n\n    /**\n     * Checks if it is a polygon marker\n     */\n    private get isPolygon(): boolean {\n        return this.type === MarkerType.polygon || this.type === MarkerType.polygonPixels;\n    }\n\n    /**\n     * Checks if it is a polyline marker\n     */\n    private get isPolyline(): boolean {\n        return this.type === MarkerType.polyline || this.type === MarkerType.polylinePixels;\n    }\n\n    private get coords(): Array<Array<[number, number]>> {\n        return this.definition;\n    }\n\n    override render(): Point {\n        const positions = this.__getAllPolyPositions();\n        const isVisible = positions[0].length > (this.isPolygon ? 2 : 1);\n\n        if (isVisible) {\n            const position = this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position);\n\n            const points = positions\n                .filter(innerPos => innerPos.length > 0)\n                .map((innerPos) => {\n                    let innerPoints = 'M';\n                    innerPoints += innerPos\n                        .map(pos => `${pos.x - position.x},${pos.y - position.y}`)\n                        .join('L');\n                    if (this.isPolygon) {\n                        innerPoints += 'Z';\n                    }\n                    return innerPoints;\n                })\n                .join(' ');\n\n            this.domElement.setAttributeNS(null, 'd', points);\n            this.domElement.setAttributeNS(null, 'transform', `translate(${position.x} ${position.y})`);\n\n            return position;\n        } else {\n            return null;\n        }\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        const element = this.domElement;\n\n        element.classList.add('psv-marker--poly');\n\n        // set style\n        if (this.config.svgStyle) {\n            Object.entries(this.config.svgStyle).forEach(([prop, value]) => {\n                element.setAttributeNS(null, utils.dasherize(prop), value);\n            });\n\n            if (this.isPolyline && !this.config.svgStyle.fill) {\n                element.setAttributeNS(null, 'fill', 'none');\n            }\n        } else if (this.isPolygon) {\n            element.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n        } else if (this.isPolyline) {\n            element.setAttributeNS(null, 'fill', 'none');\n            element.setAttributeNS(null, 'stroke', 'rgb(0,0,0)');\n        }\n\n        try {\n            // (retrocompat) fold arrays: [1,2,3,4] => [[1,2],[3,4]]\n            let actualPoly: any = this.config[this.type];\n            if (!Array.isArray(actualPoly[0]) && typeof actualPoly[0] !== 'object') {\n                for (let i = 0; i < actualPoly.length; i++) {\n                    // @ts-ignore\n                    actualPoly.splice(i, 2, [actualPoly[i], actualPoly[i + 1]]);\n                }\n            }\n\n            // make nested array for holes\n            if (!Array.isArray(actualPoly[0][0]) && typeof actualPoly[0][0] !== 'object') {\n                actualPoly = [actualPoly];\n            }\n\n            if (this.isPolyline && actualPoly.length > 1) {\n                throw new PSVError(`polylines cannot have holes`);\n            }\n\n            if (this.isPixels) {\n                // convert texture coordinates to spherical coordinates\n                this.definition = (actualPoly as Array<Array<[number, number] | PanoramaPosition>>).map((coords) => {\n                    return coords.map((coord) => {\n                        let sphericalCoord: Position;\n                        if (utils.isExtendedPosition(coord)) {\n                            sphericalCoord = this.viewer.dataHelper.cleanPosition(coord);\n                        } else {\n                            sphericalCoord = this.viewer.dataHelper.textureCoordsToSphericalCoords({\n                                textureX: coord[0],\n                                textureY: coord[1],\n                            });\n                        }\n                        return [sphericalCoord.yaw, sphericalCoord.pitch];\n                    });\n                });\n            } else {\n                // clean angles\n                this.definition = (actualPoly as Array<Array<[number, number] | [string, string] | SphericalPosition>>).map((coords) => {\n                    return coords.map((coord) => {\n                        let sphericalCoord: Position;\n                        if (utils.isExtendedPosition(coord)) {\n                            sphericalCoord = this.viewer.dataHelper.cleanPosition(coord);\n                        } else {\n                            sphericalCoord = this.viewer.dataHelper.cleanPosition({\n                                yaw: coord[0],\n                                pitch: coord[1],\n                            });\n                        }\n                        return [sphericalCoord.yaw, sphericalCoord.pitch];\n                    });\n                });\n            }\n        } catch (e) {\n            throw new PSVError(`invalid marker ${this.id} position`, e);\n        }\n\n        // compute x/y/z positions\n        this.positions3D = this.coords.map((coords) => {\n            return coords.map((coord) => {\n                return this.viewer.dataHelper.sphericalCoordsToVector3({ yaw: coord[0], pitch: coord[1] });\n            });\n        });\n\n        if (this.isPolygon) {\n            const centroid = getPolygonCenter(this.positions3D[0]);\n            this.state.position = this.viewer.dataHelper.vector3ToSphericalCoords(centroid);\n        } else {\n            const centroid = getPolylineCenter(this.coords[0]);\n            this.state.position = { yaw: centroid[0], pitch: centroid[1] };\n        }\n\n        this.state.positions3D = this.positions3D[0];\n    }\n\n    private __getAllPolyPositions(): Point[][] {\n        return this.positions3D.map((positions) => {\n            return this.__getPolyPositions(positions);\n        });\n    }\n\n    /**\n     * Computes viewer coordinates of each point of a polygon/polyline<br>\n     * It handles points behind the camera by creating intermediary points suitable for the projector\n     */\n    private __getPolyPositions(positions: Vector3[]): Point[] {\n        const nbVectors = positions.length;\n\n        // compute if each vector is visible\n        const positions3D = positions.map((vector) => {\n            return {\n                vector: vector,\n                visible: vector.dot(this.viewer.state.direction) > 0,\n            };\n        });\n\n        // get pairs of visible/invisible vectors for each invisible vector connected to a visible vector\n        const toBeComputed: Array<{ visible: Vector3; invisible: Vector3; index: number }> = [];\n        positions3D.forEach((pos, i) => {\n            if (!pos.visible) {\n                const neighbours = [\n                    i === 0 ? positions3D[nbVectors - 1] : positions3D[i - 1],\n                    i === nbVectors - 1 ? positions3D[0] : positions3D[i + 1],\n                ];\n\n                neighbours.forEach((neighbour) => {\n                    if (neighbour.visible) {\n                        toBeComputed.push({\n                            visible: neighbour.vector,\n                            invisible: pos.vector,\n                            index: i,\n                        });\n                    }\n                });\n            }\n        });\n\n        // compute intermediary vector for each pair (the loop is reversed for splice to insert at the right place)\n        toBeComputed.reverse().forEach((pair) => {\n            positions3D.splice(pair.index, 0, {\n                vector: getGreatCircleIntersection(pair.visible, pair.invisible, this.viewer.state.direction),\n                visible: true,\n            });\n        });\n\n        // translate vectors to screen pos\n        return positions3D\n            .filter(pos => pos.visible)\n            .map(pos => this.viewer.dataHelper.vector3ToViewerCoords(pos.vector));\n    }\n}\n","import { utils, type Viewer } from '@photo-sphere-viewer/core';\nimport { SVG_NS } from '../constants';\nimport { type MarkersPlugin } from '../MarkersPlugin';\nimport { MarkerType } from '../MarkerType';\nimport { MarkerConfig } from '../model';\nimport { AbstractStandardMarker } from './AbstractStandardMarker';\n\n/**\n * @internal\n */\nexport class MarkerSvg extends AbstractStandardMarker {\n    get svgElement(): SVGElement {\n        return this.domElement.firstElementChild as any;\n    }\n\n    constructor(viewer: Viewer, plugin: MarkersPlugin, config: MarkerConfig) {\n        super(viewer, plugin, config);\n    }\n\n    override isSvg(): boolean {\n        return true;\n    }\n\n    override createElement(): void {\n        const svgType = this.type === MarkerType.square ? 'rect' : this.type;\n        const elt = document.createElementNS(SVG_NS, svgType);\n        this.element = document.createElementNS(SVG_NS, 'svg');\n        this.element.appendChild(elt);\n        this.afterCreateElement();\n    }\n\n    override update(config: MarkerConfig): void {\n        super.update(config);\n\n        const svgElement = this.svgElement;\n\n        this.needsUpdateSize = true;\n\n        // set content\n        switch (this.type) {\n            case MarkerType.square:\n                this.definition = {\n                    x: 0,\n                    y: 0,\n                    width: this.config.square,\n                    height: this.config.square,\n                };\n                break;\n\n            case MarkerType.rect:\n                if (Array.isArray(this.config.rect)) {\n                    this.definition = {\n                        x: 0,\n                        y: 0,\n                        width: this.config.rect[0],\n                        height: this.config.rect[1],\n                    };\n                } else {\n                    this.definition = {\n                        x: 0,\n                        y: 0,\n                        width: this.config.rect.width,\n                        height: this.config.rect.height,\n                    };\n                }\n                break;\n\n            case MarkerType.circle:\n                this.definition = {\n                    cx: this.config.circle,\n                    cy: this.config.circle,\n                    r: this.config.circle,\n                };\n                break;\n\n            case MarkerType.ellipse:\n                if (Array.isArray(this.config.ellipse)) {\n                    this.definition = {\n                        cx: this.config.ellipse[0],\n                        cy: this.config.ellipse[1],\n                        rx: this.config.ellipse[0],\n                        ry: this.config.ellipse[1],\n                    };\n                } else {\n                    this.definition = {\n                        cx: this.config.ellipse.rx,\n                        cy: this.config.ellipse.ry,\n                        rx: this.config.ellipse.rx,\n                        ry: this.config.ellipse.ry,\n                    };\n                }\n                break;\n\n            case MarkerType.path:\n                this.definition = {\n                    d: this.config.path,\n                };\n                break;\n\n            // no default\n        }\n\n        Object.entries(this.definition).forEach(([prop, value]) => {\n            svgElement.setAttributeNS(null, prop, value as string);\n        });\n\n        // set style\n        if (this.config.svgStyle) {\n            Object.entries(this.config.svgStyle).forEach(([prop, value]) => {\n                svgElement.setAttributeNS(null, utils.dasherize(prop), value);\n            });\n        } else {\n            svgElement.setAttributeNS(null, 'fill', 'rgba(0,0,0,0.5)');\n        }\n    }\n}\n","import type { PluginConstructor, Point, Viewer } from '@photo-sphere-viewer/core';\nimport { AbstractConfigurablePlugin, PSVError, events, utils } from '@photo-sphere-viewer/core';\nimport { Object3D } from 'three';\nimport { CSS3DContainer } from './CSS3DContainer';\nimport { getMarkerType } from './MarkerType';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\nimport {\n    DEFAULT_HOVER_SCALE,\n    ID_PANEL_MARKER,\n    ID_PANEL_MARKERS_LIST,\n    MARKERS_LIST_TEMPLATE,\n    MARKER_DATA,\n    SVG_NS,\n} from './constants';\nimport {\n    EnterMarkerEvent,\n    GotoMarkerDoneEvent,\n    HideMarkersEvent,\n    LeaveMarkerEvent,\n    MarkerVisibilityEvent,\n    MarkersPluginEvents,\n    RenderMarkersListEvent,\n    SelectMarkerEvent,\n    SelectMarkerListEvent,\n    SetMarkersEvent,\n    ShowMarkersEvent,\n    UnselectMarkerEvent,\n} from './events';\nimport { AbstractStandardMarker } from './markers/AbstractStandardMarker';\nimport { Marker } from './markers/Marker';\nimport { Marker3D } from './markers/Marker3D';\nimport { MarkerCSS3D } from './markers/MarkerCSS3D';\nimport { MarkerNormal } from './markers/MarkerNormal';\nimport { MarkerPolygon } from './markers/MarkerPolygon';\nimport { MarkerSvg } from './markers/MarkerSvg';\nimport { MarkerConfig, MarkersPluginConfig, ParsedMarkersPluginConfig, UpdatableMarkersPluginConfig } from './model';\n\nconst getConfig = utils.getConfigParser<MarkersPluginConfig, ParsedMarkersPluginConfig>(\n    {\n        clickEventOnMarker: false,\n        gotoMarkerSpeed: '8rpm',\n        markers: null,\n        defaultHoverScale: null,\n    },\n    {\n        defaultHoverScale(defaultHoverScale) {\n            if (!defaultHoverScale) {\n                return null;\n            }\n            if (defaultHoverScale === true) {\n                defaultHoverScale = DEFAULT_HOVER_SCALE;\n            }\n            if (typeof defaultHoverScale === 'number') {\n                defaultHoverScale = { amount: defaultHoverScale };\n            }\n            return {\n                ...DEFAULT_HOVER_SCALE,\n                ...defaultHoverScale,\n            };\n        },\n    },\n);\n\nfunction getMarkerCtor(config: MarkerConfig): typeof Marker {\n    const type = getMarkerType(config, false);\n\n    switch (type) {\n        case 'image':\n        case 'html':\n        case 'element':\n            return MarkerNormal;\n        case 'imageLayer':\n        case 'videoLayer':\n            return Marker3D;\n        case 'elementLayer':\n            return MarkerCSS3D;\n        case 'polygon':\n        case 'polyline':\n        case 'polygonPixels':\n        case 'polylinePixels':\n            return MarkerPolygon;\n        case 'square':\n        case 'rect':\n        case 'circle':\n        case 'ellipse':\n        case 'path':\n            return MarkerSvg;\n        default:\n            throw new PSVError('invalid marker type');\n    }\n}\n\n/**\n * Displays various markers on the viewer\n */\nexport class MarkersPlugin extends AbstractConfigurablePlugin<\n    MarkersPluginConfig,\n    ParsedMarkersPluginConfig,\n    UpdatableMarkersPluginConfig,\n    MarkersPluginEvents\n> {\n    static override readonly id = 'markers';\n    static override readonly VERSION = PKG_VERSION;\n    static override readonly configParser = getConfig;\n    static override readonly readonlyOptions: Array<keyof MarkersPluginConfig> = ['markers'];\n\n    private readonly markers: Record<string, Marker> = {};\n\n    private readonly state = {\n        allVisible: true,\n        showAllTooltips: false,\n        currentMarker: null as Marker,\n        hoveringMarker: null as Marker,\n        // require a 2nd render (only the scene) when 3d markers visibility changes\n        needsReRender: false,\n        // use when updating a polygon marker in order to keep the current position\n        lastClientX: null as number,\n        lastClientY: null as number,\n    };\n\n    private readonly container: HTMLElement;\n    private readonly svgContainer: SVGElement;\n    private readonly css3DContainer: CSS3DContainer;\n\n    static withConfig(config: MarkersPluginConfig): [PluginConstructor, any] {\n        return [MarkersPlugin, config];\n    }\n\n    constructor(viewer: Viewer, config: MarkersPluginConfig) {\n        super(viewer, config);\n\n        this.container = document.createElement('div');\n        this.container.className = 'psv-markers';\n        this.viewer.container.appendChild(this.container);\n\n        this.container.addEventListener('contextmenu', e => e.preventDefault());\n\n        this.svgContainer = document.createElementNS(SVG_NS, 'svg');\n        this.svgContainer.setAttribute('class', 'psv-markers-svg-container');\n        this.container.appendChild(this.svgContainer);\n\n        this.css3DContainer = new CSS3DContainer(viewer);\n        this.container.appendChild(this.css3DContainer.element);\n\n        // Markers events via delegation\n        this.container.addEventListener('mouseenter', this, true);\n        this.container.addEventListener('mouseleave', this, true);\n        this.container.addEventListener('mousemove', this, true);\n    }\n\n    /**\n     * @internal\n     */\n    override init() {\n        super.init();\n\n        utils.checkStylesheet(this.viewer.container, 'markers-plugin');\n\n        // Viewer events\n        this.viewer.addEventListener(events.ClickEvent.type, this);\n        this.viewer.addEventListener(events.DoubleClickEvent.type, this);\n        this.viewer.addEventListener(events.RenderEvent.type, this);\n        this.viewer.addEventListener(events.ConfigChangedEvent.type, this);\n        this.viewer.addEventListener(events.ObjectEnterEvent.type, this);\n        this.viewer.addEventListener(events.ObjectHoverEvent.type, this);\n        this.viewer.addEventListener(events.ObjectLeaveEvent.type, this);\n        this.viewer.addEventListener(events.ReadyEvent.type, this, { once: true });\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        this.clearMarkers(false);\n\n        this.viewer.unobserveObjects(MARKER_DATA);\n\n        this.viewer.removeEventListener(events.ClickEvent.type, this);\n        this.viewer.removeEventListener(events.DoubleClickEvent.type, this);\n        this.viewer.removeEventListener(events.RenderEvent.type, this);\n        this.viewer.removeEventListener(events.ObjectEnterEvent.type, this);\n        this.viewer.removeEventListener(events.ObjectHoverEvent.type, this);\n        this.viewer.removeEventListener(events.ObjectLeaveEvent.type, this);\n        this.viewer.removeEventListener(events.ReadyEvent.type, this);\n\n        this.css3DContainer.destroy();\n        this.viewer.container.removeChild(this.container);\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case events.ReadyEvent.type:\n                if (this.config.markers) {\n                    this.setMarkers(this.config.markers);\n                    delete this.config.markers;\n                }\n                break;\n\n            case events.RenderEvent.type:\n                this.renderMarkers();\n                break;\n\n            case events.ClickEvent.type:\n                this.__onClick(e as events.ClickEvent, false);\n                break;\n\n            case events.DoubleClickEvent.type:\n                this.__onClick(e as events.DoubleClickEvent, true);\n                break;\n\n            case events.ObjectEnterEvent.type:\n            case events.ObjectLeaveEvent.type:\n            case events.ObjectHoverEvent.type:\n                if ((e as events.ObjectEvent).userDataKey === MARKER_DATA) {\n                    const event = (e as events.ObjectEvent).originalEvent;\n                    const marker: Marker = (e as events.ObjectEvent).object.userData[MARKER_DATA];\n                    switch (e.type) {\n                        case events.ObjectEnterEvent.type:\n                            if (marker.config.style?.cursor) {\n                                this.viewer.setCursor(marker.config.style.cursor);\n                            } else if (marker.config.tooltip || marker.config.content) {\n                                this.viewer.setCursor('pointer');\n                            }\n                            this.__onEnterMarker(event, marker);\n                            break;\n                        case events.ObjectLeaveEvent.type:\n                            this.viewer.setCursor(null);\n                            this.__onLeaveMarker(marker);\n                            break;\n                        case events.ObjectHoverEvent.type:\n                            this.__onHoverMarker(event, marker);\n                            break;\n                    }\n                }\n                break;\n\n            case 'mouseenter': {\n                const marker = this.__getTargetMarker(utils.getEventTarget(e));\n                this.__onEnterMarker(e as MouseEvent, marker);\n                break;\n            }\n\n            case 'mouseleave': {\n                const marker = this.__getTargetMarker(utils.getEventTarget(e));\n                this.__onLeaveMarker(marker);\n                break;\n            }\n\n            case 'mousemove': {\n                const marker = this.__getTargetMarker(utils.getEventTarget(e), true);\n                this.__onHoverMarker(e as MouseEvent, marker);\n                break;\n            }\n        }\n    }\n\n    /**\n     * Toggles all markers\n     */\n    toggleAllMarkers() {\n        if (this.state.allVisible) {\n            this.hideAllMarkers();\n        } else {\n            this.showAllMarkers();\n        }\n    }\n\n    /**\n     * Shows all markers\n     */\n    showAllMarkers() {\n        this.state.allVisible = true;\n        Object.values(this.markers).forEach((marker) => {\n            marker.config.visible = true;\n        });\n        this.renderMarkers();\n        this.dispatchEvent(new ShowMarkersEvent());\n    }\n\n    /**\n     * Hides all markers\n     */\n    hideAllMarkers() {\n        this.state.allVisible = false;\n        Object.values(this.markers).forEach((marker) => {\n            marker.config.visible = false;\n        });\n        this.renderMarkers();\n        this.dispatchEvent(new HideMarkersEvent());\n    }\n\n    /**\n     * Toggles the visibility of all tooltips\n     */\n    toggleAllTooltips() {\n        if (this.state.showAllTooltips) {\n            this.hideAllTooltips();\n        } else {\n            this.showAllTooltips();\n        }\n    }\n\n    /**\n     *  Displays all tooltips\n     */\n    showAllTooltips() {\n        this.state.showAllTooltips = true;\n        Object.values(this.markers).forEach((marker) => {\n            marker.state.staticTooltip = true;\n            marker.showTooltip();\n        });\n    }\n\n    /**\n     * Hides all tooltips\n     */\n    hideAllTooltips() {\n        this.state.showAllTooltips = false;\n        Object.values(this.markers).forEach((marker) => {\n            marker.state.staticTooltip = false;\n            marker.hideTooltip();\n        });\n    }\n\n    /**\n     * Returns the total number of markers\n     */\n    getNbMarkers(): number {\n        return Object.keys(this.markers).length;\n    }\n\n    /**\n     * Returns all the markers\n     */\n    getMarkers(): Marker[] {\n        return Object.values(this.markers);\n    }\n\n    /**\n     * Adds a new marker to viewer\n     * @throws {@link PSVError} when the marker's id is missing or already exists\n     */\n    addMarker(config: MarkerConfig, render = true) {\n        if (this.markers[config.id]) {\n            throw new PSVError(`marker \"${config.id}\" already exists`);\n        }\n\n        // @ts-ignore\n        const marker: Marker = new (getMarkerCtor(config))(this.viewer, this, config);\n\n        if (marker.isPoly()) {\n            this.svgContainer.appendChild(marker.domElement);\n        } else if (marker.isCss3d()) {\n            this.css3DContainer.addObject(marker as MarkerCSS3D);\n        } else if (marker.is3d()) {\n            this.viewer.renderer.addObject(marker.threeElement);\n        } else {\n            this.container.appendChild(marker.domElement);\n        }\n\n        this.markers[marker.id] = marker;\n\n        if (this.state.showAllTooltips) {\n            marker.state.staticTooltip = true;\n        }\n\n        if (render) {\n            this.__afterChangeMarkers();\n        }\n    }\n\n    /**\n     * Returns the internal marker object for a marker id\n     * @throws {@link PSVError} when the marker cannot be found\n     */\n    getMarker(markerId: string | MarkerConfig): Marker {\n        const id = typeof markerId === 'object' ? markerId.id : markerId;\n\n        if (!this.markers[id]) {\n            throw new PSVError(`cannot find marker \"${id}\"`);\n        }\n\n        return this.markers[id];\n    }\n\n    /**\n     * Returns the last marker selected by the user\n     */\n    getCurrentMarker(): Marker {\n        return this.state.currentMarker;\n    }\n\n    /**\n     * Updates the existing marker with the same id\n     * Every property can be changed but you can't change its type (Eg: `image` to `html`)\n     */\n    updateMarker(config: MarkerConfig, render = true) {\n        const marker = this.getMarker(config.id);\n\n        marker.update(config);\n\n        if (render) {\n            this.__afterChangeMarkers();\n\n            if (\n                (marker === this.state.hoveringMarker && marker.config.tooltip?.trigger === 'hover')\n                || marker.state.staticTooltip\n            ) {\n                marker.showTooltip(this.state.lastClientX, this.state.lastClientY, true);\n            }\n        }\n    }\n\n    /**\n     * Removes a marker from the viewer\n     */\n    removeMarker(markerId: string | MarkerConfig, render = true) {\n        const marker = this.getMarker(markerId);\n\n        if (marker.isPoly()) {\n            this.svgContainer.removeChild(marker.domElement);\n        } else if (marker.isCss3d()) {\n            this.css3DContainer.removeObject(marker as MarkerCSS3D);\n        } else if (marker.is3d()) {\n            this.viewer.renderer.removeObject(marker.threeElement);\n        } else {\n            this.container.removeChild(marker.domElement);\n        }\n\n        if (this.state.hoveringMarker === marker) {\n            this.state.hoveringMarker = null;\n        }\n\n        if (this.state.currentMarker === marker) {\n            this.state.currentMarker = null;\n        }\n\n        marker.destroy();\n        delete this.markers[marker.id];\n\n        if (render) {\n            this.__afterChangeMarkers();\n        }\n    }\n\n    /**\n     * Removes multiple markers\n     */\n    removeMarkers(markerIds: string[], render = true) {\n        markerIds.forEach(markerId => this.removeMarker(markerId, false));\n\n        if (render) {\n            this.__afterChangeMarkers();\n        }\n    }\n\n    /**\n     * Replaces all markers\n     */\n    setMarkers(markers: MarkerConfig[] | null, render = true) {\n        this.clearMarkers(false);\n\n        markers?.forEach((marker) => {\n            this.addMarker(marker, false);\n        });\n\n        if (render) {\n            this.__afterChangeMarkers();\n        }\n    }\n\n    /**\n     * Removes all markers\n     */\n    clearMarkers(render = true) {\n        Object.keys(this.markers).forEach((markerId) => {\n            this.removeMarker(markerId, false);\n        });\n\n        if (render) {\n            this.__afterChangeMarkers();\n        }\n    }\n\n    /**\n     * Rotate the view to face the marker\n     */\n    gotoMarker(markerId: string | MarkerConfig, speed: string | number = this.config.gotoMarkerSpeed): Promise<void> {\n        const marker = this.getMarker(markerId);\n\n        if (!speed) {\n            this.viewer.rotate(marker.state.position);\n            if (!utils.isNil(marker.config.zoomLvl)) {\n                this.viewer.zoom(marker.config.zoomLvl);\n            }\n            this.dispatchEvent(new GotoMarkerDoneEvent(marker));\n            return Promise.resolve();\n        } else {\n            return this.viewer\n                .animate({\n                    ...marker.state.position,\n                    zoom: marker.config.zoomLvl,\n                    speed: speed,\n                })\n                .then(() => {\n                    this.dispatchEvent(new GotoMarkerDoneEvent(marker));\n                });\n        }\n    }\n\n    /**\n     * Hides a marker\n     */\n    hideMarker(markerId: string | MarkerConfig) {\n        this.toggleMarker(markerId, false);\n    }\n\n    /**\n     * Shows a marker\n     */\n    showMarker(markerId: string | MarkerConfig) {\n        this.toggleMarker(markerId, true);\n    }\n\n    /**\n     * Forces the display of the tooltip of a marker\n     */\n    showMarkerTooltip(markerId: string | MarkerConfig) {\n        const marker = this.getMarker(markerId);\n        marker.state.staticTooltip = true;\n        marker.showTooltip();\n    }\n\n    /**\n     * Hides the tooltip of a marker\n     */\n    hideMarkerTooltip(markerId: string | MarkerConfig) {\n        const marker = this.getMarker(markerId);\n        marker.state.staticTooltip = false;\n        marker.hideTooltip();\n    }\n\n    /**\n     * Toggles a marker visibility\n     */\n    toggleMarker(markerId: string | MarkerConfig, visible?: boolean) {\n        const marker = this.getMarker(markerId);\n        marker.config.visible = utils.isNil(visible) ? !marker.config.visible : visible;\n        this.renderMarkers();\n    }\n\n    /**\n     * Opens the panel with the content of the marker\n     */\n    showMarkerPanel(markerId: string | MarkerConfig) {\n        const marker = this.getMarker(markerId);\n\n        if (marker.config.content) {\n            this.viewer.panel.show({\n                id: ID_PANEL_MARKER,\n                content: marker.config.content,\n            });\n        } else {\n            this.hideMarkerPanel();\n        }\n    }\n\n    /**\n     * Closes the panel if currently showing the content of a marker\n     */\n    hideMarkerPanel() {\n        this.viewer.panel.hide(ID_PANEL_MARKER);\n    }\n\n    /**\n     * Toggles the visibility of the list of markers\n     */\n    toggleMarkersList() {\n        if (this.viewer.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n            this.hideMarkersList();\n        } else {\n            this.showMarkersList();\n        }\n    }\n\n    /**\n     * Opens side panel with the list of markers\n     */\n    showMarkersList() {\n        let markers: Marker[] = [];\n        Object.values(this.markers).forEach((marker) => {\n            if (marker.config.visible && !marker.config.hideList) {\n                markers.push(marker);\n            }\n        });\n\n        const e = new RenderMarkersListEvent(markers);\n        this.dispatchEvent(e);\n        markers = e.markers;\n\n        this.viewer.panel.show({\n            id: ID_PANEL_MARKERS_LIST,\n            content: MARKERS_LIST_TEMPLATE(markers, this.viewer.config.lang[MarkersButton.id]),\n            noMargin: true,\n            clickHandler: (target) => {\n                const li = utils.getClosest(target, '.psv-panel-menu-item');\n                const markerId = li ? li.dataset[MARKER_DATA] : undefined;\n\n                if (markerId) {\n                    const marker = this.getMarker(markerId);\n\n                    this.dispatchEvent(new SelectMarkerListEvent(marker));\n\n                    this.gotoMarker(marker.id);\n                    this.hideMarkersList();\n                }\n            },\n        });\n    }\n\n    /**\n     * Closes side panel if it contains the list of markers\n     */\n    hideMarkersList() {\n        this.viewer.panel.hide(ID_PANEL_MARKERS_LIST);\n    }\n\n    /**\n     * Updates the visibility and the position of all markers\n     */\n    renderMarkers() {\n        if (this.state.needsReRender) {\n            this.state.needsReRender = false;\n            return;\n        }\n\n        const zoomLevel = this.viewer.getZoomLevel();\n        const viewerPosition = this.viewer.getPosition();\n        const hoveringMarker = this.state.hoveringMarker;\n\n        Object.values(this.markers).forEach((marker) => {\n            let isVisible = marker.config.visible;\n            let visibilityChanged = false;\n            let position: Point = null;\n\n            if (isVisible) {\n                position = marker.render({ viewerPosition, zoomLevel, hoveringMarker });\n                isVisible = !!position;\n            }\n\n            visibilityChanged = marker.state.visible !== isVisible;\n            marker.state.visible = isVisible;\n            marker.state.position2D = position;\n\n            if (marker.domElement) {\n                utils.toggleClass(marker.domElement, 'psv-marker--visible', isVisible);\n            }\n\n            if (!isVisible) {\n                marker.hideTooltip();\n            } else if (marker.state.staticTooltip) {\n                marker.showTooltip();\n            } else if (marker !== this.state.hoveringMarker) {\n                marker.hideTooltip();\n            }\n\n            if (visibilityChanged) {\n                this.dispatchEvent(new MarkerVisibilityEvent(marker, isVisible));\n\n                if (marker.is3d() || marker.isCss3d()) {\n                    this.state.needsReRender = true;\n                }\n            }\n        });\n\n        if (this.state.needsReRender) {\n            this.viewer.needsUpdate();\n        }\n    }\n\n    /**\n     * Returns the marker associated to an event target\n     */\n    private __getTargetMarker(target: HTMLElement, closest?: boolean): Marker;\n    private __getTargetMarker(target: Object3D[]): Marker;\n    private __getTargetMarker(target: HTMLElement | Object3D[], closest = false): Marker {\n        if (target instanceof Node) {\n            const target2 = closest ? utils.getClosest(target, '.psv-marker') : target;\n            return target2 ? (target2 as any)[MARKER_DATA] : undefined;\n        } else if (Array.isArray(target)) {\n            return target\n                .map(o => o.userData[MARKER_DATA] as Marker)\n                .filter(m => !!m)\n                .sort((a, b) => b.config.zIndex - a.config.zIndex)[0];\n        } else {\n            return null;\n        }\n    }\n\n    /**\n     * Handles mouse enter events, show the tooltip for non polygon markers\n     */\n    private __onEnterMarker(e: MouseEvent, marker?: Marker) {\n        if (marker) {\n            this.state.hoveringMarker = marker;\n            this.state.lastClientX = e.clientX;\n            this.state.lastClientY = e.clientY;\n\n            this.dispatchEvent(new EnterMarkerEvent(marker));\n\n            if (marker instanceof AbstractStandardMarker) {\n                marker.applyScale({\n                    zoomLevel: this.viewer.getZoomLevel(),\n                    viewerPosition: this.viewer.getPosition(),\n                    mouseover: true,\n                });\n            }\n\n            if (!marker.state.staticTooltip && marker.config.tooltip?.trigger === 'hover') {\n                marker.showTooltip(e.clientX, e.clientY);\n            }\n        }\n    }\n\n    /**\n     * Handles mouse leave events, hide the tooltip\n     */\n    private __onLeaveMarker(marker?: Marker) {\n        if (marker) {\n            this.dispatchEvent(new LeaveMarkerEvent(marker));\n\n            if (marker instanceof AbstractStandardMarker) {\n                marker.applyScale({\n                    zoomLevel: this.viewer.getZoomLevel(),\n                    viewerPosition: this.viewer.getPosition(),\n                    mouseover: false,\n                });\n            }\n\n            this.state.hoveringMarker = null;\n\n            if (!marker.state.staticTooltip && marker.config.tooltip?.trigger === 'hover') {\n                marker.hideTooltip();\n            } else if (marker.state.staticTooltip) {\n                marker.showTooltip();\n            }\n        }\n    }\n\n    /**\n     * Handles mouse move events, refresh the tooltip for polygon markers\n     */\n    private __onHoverMarker(e: MouseEvent, marker?: Marker) {\n        if (marker) {\n            this.state.lastClientX = e.clientX;\n            this.state.lastClientY = e.clientY;\n\n            if (marker.isPoly() || marker.is3d() || marker.isCss3d()) {\n                if (marker.config.tooltip?.trigger === 'hover') {\n                    marker.showTooltip(e.clientX, e.clientY);\n                }\n            }\n        }\n    }\n\n    /**\n     * Handles mouse click events, select the marker and open the panel if necessary\n     */\n    private __onClick(e: events.ClickEvent | events.DoubleClickEvent, dblclick: boolean) {\n        const threeMarker = this.__getTargetMarker(e.data.objects);\n        const stdMarker = this.__getTargetMarker(e.data.target, true);\n\n        // give priority to standard markers which are always on top of Three markers\n        const marker = stdMarker || threeMarker;\n\n        if (this.state.currentMarker && this.state.currentMarker !== marker) {\n            this.dispatchEvent(new UnselectMarkerEvent(this.state.currentMarker));\n\n            this.viewer.panel.hide(ID_PANEL_MARKER);\n\n            if (!this.state.showAllTooltips && this.state.currentMarker.config.tooltip?.trigger === 'click') {\n                this.hideMarkerTooltip(this.state.currentMarker.id);\n            }\n\n            this.state.currentMarker = null;\n        }\n\n        if (marker) {\n            this.state.currentMarker = marker;\n\n            this.dispatchEvent(new SelectMarkerEvent(marker, dblclick, e.data.rightclick));\n\n            if (this.config.clickEventOnMarker) {\n                // add the marker to event data\n                e.data.marker = marker;\n            } else {\n                e.stopImmediatePropagation();\n            }\n\n            // the marker could have been deleted in an event handler\n            if (this.markers[marker.id] && !e.data.rightclick) {\n                if (marker.config.tooltip?.trigger === 'click') {\n                    if (marker.tooltip) {\n                        this.hideMarkerTooltip(marker.id);\n                    } else {\n                        this.showMarkerTooltip(marker.id);\n                    }\n                } else {\n                    this.showMarkerPanel(marker.id);\n                }\n            }\n        }\n    }\n\n    private __afterChangeMarkers() {\n        this.__refreshUi();\n        this.__checkObjectsObserver();\n        this.viewer.needsUpdate();\n        this.dispatchEvent(new SetMarkersEvent(this.getMarkers()));\n    }\n\n    /**\n     * Updates the visiblity of the panel and the buttons\n     */\n    private __refreshUi() {\n        const nbMarkers = Object.values(this.markers).filter(m => !m.config.hideList).length;\n\n        if (nbMarkers === 0) {\n            this.viewer.panel.hide(ID_PANEL_MARKER);\n            this.viewer.panel.hide(ID_PANEL_MARKERS_LIST);\n        } else {\n            if (this.viewer.panel.isVisible(ID_PANEL_MARKERS_LIST)) {\n                this.showMarkersList();\n            } else if (this.viewer.panel.isVisible(ID_PANEL_MARKER)) {\n                this.state.currentMarker ? this.showMarkerPanel(this.state.currentMarker.id) : this.viewer.panel.hide();\n            }\n        }\n\n        this.viewer.navbar.getButton(MarkersButton.id, false)?.toggle(nbMarkers > 0);\n        this.viewer.navbar.getButton(MarkersListButton.id, false)?.toggle(nbMarkers > 0);\n    }\n\n    /**\n     * Adds or remove the objects observer if there are 3D markers\n     */\n    private __checkObjectsObserver() {\n        const has3d = Object.values(this.markers).some(marker => marker.is3d());\n\n        if (has3d) {\n            this.viewer.observeObjects(MARKER_DATA);\n        } else {\n            this.viewer.unobserveObjects(MARKER_DATA);\n        }\n    }\n}\n","import { DEFAULTS, registerButton } from '@photo-sphere-viewer/core';\nimport * as events from './events';\nimport { MarkersButton } from './MarkersButton';\nimport { MarkersListButton } from './MarkersListButton';\n\nDEFAULTS.lang[MarkersButton.id] = 'Markers';\nDEFAULTS.lang[MarkersListButton.id] = 'Markers list';\nregisterButton(MarkersButton, 'caption:left');\nregisterButton(MarkersListButton, 'caption:left');\n\nexport type { Marker } from './markers/Marker';\nexport type { MarkerType } from './MarkerType';\nexport { MarkersPlugin } from './MarkersPlugin';\nexport * from './model';\nexport { events };\n\n/** @internal  */\nimport './styles/index.scss';\n","import { Position, TypedEvent } from '@photo-sphere-viewer/core';\nimport { VirtualTourLink, VirtualTourNode } from './model';\nimport type { VirtualTourPlugin } from './VirtualTourPlugin';\n\n/**\n * @event Triggered when the current node changes\n */\nexport class NodeChangedEvent extends TypedEvent<VirtualTourPlugin> {\n    static override readonly type = 'node-changed';\n    override type: 'node-changed';\n\n    /** @internal */\n    constructor(\n        public readonly node: VirtualTourNode,\n        public readonly data: {\n            fromNode: VirtualTourNode;\n            fromLink: VirtualTourLink;\n            fromLinkPosition: Position;\n        },\n    ) {\n        super(NodeChangedEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the user puts the cursor hover a marker\n */\nexport class EnterArrowEvent extends TypedEvent<VirtualTourPlugin> {\n    static override readonly type = 'enter-arrow';\n    override type: 'enter-arrow';\n\n    /** @internal */\n    constructor(\n        public readonly link: VirtualTourLink,\n        public readonly node: VirtualTourNode,\n    ) {\n        super(EnterArrowEvent.type);\n    }\n}\n\n/**\n * @event Triggered when the user puts the cursor away from an arrow\n */\nexport class LeaveArrowEvent extends TypedEvent<VirtualTourPlugin> {\n    static override readonly type = 'leave-arrow';\n    override type: 'leave-arrow';\n\n    /** @internal */\n    constructor(\n        public readonly link: VirtualTourLink,\n        public readonly node: VirtualTourNode,\n    ) {\n        super(LeaveArrowEvent.type);\n    }\n}\n\nexport type VirtualTourEvents =\n    | NodeChangedEvent\n    | EnterArrowEvent\n    | LeaveArrowEvent;\n","import {\n\tMatrix4,\n\tObject3D,\n\tVector2,\n\tVector3\n} from 'three';\n\n/**\n * The only type of 3D object that is supported by {@link CSS2DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS2D object.\n\t *\n\t * @param {DOMElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS2DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {DOMElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\t/**\n\t\t * The 3D objects center point.\n\t\t * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\tthis.center = source.center;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _vector = new Vector3();\nconst _viewMatrix = new Matrix4();\nconst _viewProjectionMatrix = new Matrix4();\nconst _a = new Vector3();\nconst _b = new Vector3();\n\n/**\n * This renderer is a simplified version of {@link CSS3DRenderer}. The only transformation that is\n * supported is translation.\n *\n * The renderer is very useful if you want to combine HTML based labels with 3D objects. Here too,\n * the respective DOM elements are wrapped into an instance of {@link CSS2DObject} and added to the\n * scene graph. All other types of renderable 3D objects (like meshes or point clouds) are ignored.\n *\n * `CSS2DRenderer` only supports 100% browser and display zoom.\n *\n * @three_import import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DRenderer {\n\n\t/**\n\t * Constructs a new CSS2D renderer.\n\t *\n\t * @param {CSS2DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {DOMElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\t_viewMatrix.copy( camera.matrixWorldInverse );\n\t\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t\trenderObject( scene, scene, camera );\n\t\t\tzOrder( scene );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS2DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS2DObject ) {\n\n\t\t\t\t_vector.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t_vector.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tconst visible = ( _vector.z >= - 1 && _vector.z <= 1 ) && ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\telement.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t\tconst objectData = {\n\t\t\t\t\tdistanceToCameraSquared: getDistanceToSquared( camera, object )\n\t\t\t\t};\n\n\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getDistanceToSquared( object1, object2 ) {\n\n\t\t\t_a.setFromMatrixPosition( object1.matrixWorld );\n\t\t\t_b.setFromMatrixPosition( object2.matrixWorld );\n\n\t\t\treturn _a.distanceToSquared( _b );\n\n\t\t}\n\n\t\tfunction filterAndFlatten( scene ) {\n\n\t\t\tconst result = [];\n\n\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isCSS2DObject ) result.push( object );\n\n\t\t\t} );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction zOrder( scene ) {\n\n\t\t\tconst sorted = filterAndFlatten( scene ).sort( function ( a, b ) {\n\n\t\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\t\treturn b.renderOrder - a.renderOrder;\n\n\t\t\t\t}\n\n\t\t\t\tconst distanceA = cache.objects.get( a ).distanceToCameraSquared;\n\t\t\t\tconst distanceB = cache.objects.get( b ).distanceToCameraSquared;\n\n\t\t\t\treturn distanceA - distanceB;\n\n\t\t\t} );\n\n\t\t\tconst zMax = sorted.length;\n\n\t\t\tfor ( let i = 0, l = sorted.length; i < l; i ++ ) {\n\n\t\t\t\tsorted[ i ].element.style.zIndex = zMax - i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS2DRenderer`.\n *\n * @typedef {Object} CSS2DRenderer~Parameters\n * @property {DOMElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS2DObject, CSS2DRenderer };\n","import arrowIconSvg from './arrow.svg';\nimport { VirtualTourArrowStyle } from './model';\n\nexport const LINK_DATA = 'tourLink';\nexport const LINK_ID = '__tour-link__';\n\nexport const LOADING_TOOLTIP = {\n    className: 'psv-virtual-tour-tooltip',\n    content: `<div class=\"psv-virtual-tour-loader\"><div></div><div></div><div></div></div>`,\n};\n\n/**\n * Default style of the link arrow\n */\nexport const DEFAULT_ARROW: VirtualTourArrowStyle = {\n    element: () => {\n        const button = document.createElement('button');\n        button.className = 'psv-virtual-tour-arrow';\n        button.innerHTML = arrowIconSvg;\n        return button;\n    },\n    size: { width: 80, height: 80 },\n};\n","<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n    <path fill-rule=\"even-odd\" fill=\"currentColor\" d=\"\n        M50,50 m45,0\n        a45,45 0 1,0 -90,0\n        a45,45 0 1,0  90,0\n\n        M50,50 m38,0\n        a38,38 0 0,1 -76,0\n        a38,38 0 0,1  76,0\n\n        M50,50 m30,0\n        a30,30 0 1,0 -60,0\n        a30,30 0 1,0  60,0\n        \n        M50,40 m2.5,-2.5\n        l17.5,17.5\n        a 2.5,2.5 0 0 1 -5,5\n        l-15,-15\n        l-15,15\n        a 2.5,2.5 0 0 1 -5,-5\n        l17.5,-17.5\n        a 3.5,3.5 0 0 1 5,0\n    \"/>\n</svg>","import { AbstractComponent, events, Position, utils, type Viewer } from '@photo-sphere-viewer/core';\nimport type { GalleryPlugin, events as GalleryEvents } from '@photo-sphere-viewer/gallery-plugin';\nimport { MathUtils, PerspectiveCamera, Scene } from 'three';\nimport { CSS2DObject, CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { CSS3DObject, CSS3DRenderer } from 'three/examples/jsm/renderers/CSS3DRenderer.js';\nimport { LINK_DATA } from './constants';\nimport { VirtualTourArrowStyle, VirtualTourLink } from './model';\nimport { type VirtualTourPlugin } from './VirtualTourPlugin';\n\nconst ARROW_DATA = 'arrow';\n\ntype ArrowData = {\n    yaw: number;\n    conflict: boolean;\n};\n\n/**\n * @internal\n */\nexport class ArrowsRenderer extends AbstractComponent {\n    private renderer: CSS3DRenderer | CSS2DRenderer;\n    private scene: Scene;\n    private camera: PerspectiveCamera;\n\n    private gallery?: GalleryPlugin;\n\n    get is3D() {\n        return this.plugin.is3D;\n    }\n\n    get arrowsPosition() {\n        return this.plugin.config.arrowsPosition;\n    }\n\n    get arrowStyle() {\n        return this.plugin.config.arrowStyle;\n    }\n\n    constructor(parent: Viewer, private plugin: VirtualTourPlugin) {\n        super(parent, {\n            className: 'psv-virtual-tour-arrows',\n        });\n\n        this.renderer = this.is3D\n            ? new CSS3DRenderer({\n                element: this.container,\n            })\n            : new CSS2DRenderer({\n                element: this.container,\n            });\n\n        this.camera = this.is3D ? new PerspectiveCamera(30, 1) : null;\n        this.scene = new Scene();\n\n        this.viewer.addEventListener(events.ReadyEvent.type, this, { once: true });\n        this.viewer.addEventListener(events.PositionUpdatedEvent.type, this);\n        this.viewer.addEventListener(events.SizeUpdatedEvent.type, this);\n        this.viewer.addEventListener(events.RenderEvent.type, this);\n        this.viewer.addEventListener(events.ClickEvent.type, this);\n\n        this.container.addEventListener('mouseenter', this, true);\n        this.container.addEventListener('mouseleave', this, true);\n        this.container.addEventListener('mousemove', this, true);\n\n        this.container.addEventListener('contextmenu', e => e.preventDefault());\n    }\n\n    init() {\n        if (this.is3D) {\n            this.gallery = this.viewer.getPlugin('gallery');\n\n            this.gallery?.addEventListener('show-gallery', this);\n            this.gallery?.addEventListener('hide-gallery', this);\n        }\n    }\n\n    override destroy(): void {\n        this.viewer.removeEventListener(events.ReadyEvent.type, this);\n        this.viewer.removeEventListener(events.PositionUpdatedEvent.type, this);\n        this.viewer.removeEventListener(events.SizeUpdatedEvent.type, this);\n        this.viewer.removeEventListener(events.RenderEvent.type, this);\n        this.viewer.removeEventListener(events.ClickEvent.type, this);\n\n        this.gallery?.removeEventListener('show-gallery', this);\n        this.gallery?.removeEventListener('hide-gallery', this);\n\n        super.destroy();\n    }\n\n    handleEvent(e: Event) {\n        switch (e.type) {\n            case events.ReadyEvent.type:\n            case events.SizeUpdatedEvent.type:\n            case events.PositionUpdatedEvent.type:\n                this.__updateCamera();\n                break;\n            case events.RenderEvent.type:\n                this.render();\n                break;\n            case events.ClickEvent.type: {\n                if ((e as events.ClickEvent).data.rightclick) {\n                    break;\n                }\n                const link = this.__getTargetLink((e as events.ClickEvent).data.target, true);\n                if (link) {\n                    this.plugin.setCurrentNode(link.nodeId, null, link);\n                }\n                break;\n            }\n            case 'mouseenter': {\n                const link = this.__getTargetLink(utils.getEventTarget(e));\n                if (link) {\n                    this.plugin.__onEnterArrow(link, e as MouseEvent);\n                }\n                break;\n            }\n            case 'mouseleave': {\n                const link = this.__getTargetLink(utils.getEventTarget(e));\n                if (link) {\n                    this.plugin.__onLeaveArrow(link);\n                }\n                break;\n            }\n            case 'mousemove': {\n                const link = this.__getTargetLink(utils.getEventTarget(e), true);\n                if (link) {\n                    this.plugin.__onHoverArrow(e as MouseEvent);\n                }\n                break;\n            }\n            case 'hide-gallery':\n                this.__onToggleGallery(false);\n                break;\n            case 'show-gallery':\n                if (!(e as GalleryEvents.ShowGalleryEvent).fullscreen) {\n                    this.__onToggleGallery(true);\n                }\n                break;\n        }\n    }\n\n    private __updateCamera() {\n        const size = this.viewer.getSize();\n        this.renderer.setSize(size.width, size.height);\n\n        if (this.is3D) {\n            const position = this.viewer.getPosition();\n            position.pitch = MathUtils.clamp(position.pitch, -this.arrowsPosition.maxPitch, -this.arrowsPosition.minPitch);\n\n            this.viewer.dataHelper.sphericalCoordsToVector3(\n                position,\n                this.camera.position,\n                size.height * 2,\n            ).negate();\n\n            this.camera.lookAt(0, 0, 0);\n            this.camera.translateY(size.height / 3);\n            this.camera.updateProjectionMatrix();\n        }\n    }\n\n    render() {\n        if (this.is3D) {\n            const position = this.viewer.getPosition();\n\n            const objectsAndDist: Array<[CSS3DObject, number]> = [];\n            let minDist = Number.MAX_SAFE_INTEGER;\n            this.scene.children\n                .forEach((object) => {\n                    const data = object.userData[ARROW_DATA] as ArrowData;\n                    if (data.conflict) {\n                        const distance = Math.abs(utils.getShortestArc(position.yaw, data.yaw));\n                        minDist = Math.min(minDist, distance);\n                        objectsAndDist.push([object as CSS3DObject, distance]);\n                    }\n                });\n\n            objectsAndDist.forEach(([object, distance]) => {\n                const fade = distance !== minDist;\n                object.element.style.opacity = fade ? '0.5' : null;\n                object.element.style.zIndex = fade ? '-1' : null;\n            });\n\n            this.renderer.render(this.scene, this.camera);\n        } else {\n            this.renderer.render(this.scene, this.viewer.renderer.camera);\n        }\n    }\n\n    clear() {\n        this.scene.clear();\n    }\n\n    private __buildArrowElement(link: VirtualTourLink, style?: VirtualTourArrowStyle): HTMLElement {\n        if (style?.image) {\n            const image = document.createElement('img');\n            image.src = style.image;\n            return image;\n        } else if (style?.element) {\n            if (typeof style.element === 'function') {\n                return style.element(link);\n            } else {\n                return style.element;\n            }\n        }\n    }\n\n    addLinkArrow(link: VirtualTourLink, position: Position, depth = 1) {\n        let element = this.__buildArrowElement(link, link.arrowStyle);\n        if (!element) {\n            element = this.__buildArrowElement(link, this.arrowStyle);\n        }\n        (element as any)[LINK_DATA] = link;\n\n        const conf = {\n            ...this.arrowStyle,\n            ...link.arrowStyle,\n        };\n\n        element.classList.add('psv-virtual-tour-link');\n        if (conf.className) {\n            utils.addClasses(element, conf.className);\n        }\n        if (conf.style) {\n            Object.assign(element.style, conf.style);\n        }\n\n        if (this.is3D) {\n            // 1.5 ratio is arbitrary\n            element.style.width = conf.size.width * 1.5 + 'px';\n            element.style.height = conf.size.height * 1.5 + 'px';\n\n            let conflict = false;\n            this.scene.children.forEach((object) => {\n                const data = object.userData[ARROW_DATA] as ArrowData;\n                if (Math.abs(utils.getShortestArc(data.yaw, position.yaw)) < this.arrowsPosition.linkOverlapAngle) {\n                    data.conflict = true;\n                    conflict = true;\n                }\n            });\n\n            const object = new CSS3DObject(element);\n            object.userData[ARROW_DATA] = { yaw: position.yaw, conflict } as ArrowData;\n\n            object.rotation.set(-Math.PI / 2, 0, Math.PI - position.yaw);\n\n            this.viewer.dataHelper.sphericalCoordsToVector3(\n                { yaw: position.yaw, pitch: 0 },\n                object.position,\n                depth * 100,\n            );\n\n            this.scene.add(object);\n        } else {\n            element.style.width = conf.size.width + 'px';\n            element.style.height = conf.size.height + 'px';\n            element.style.pointerEvents = 'auto'; // CSS2DObject does not do it...\n\n            const object = new CSS2DObject(element);\n\n            this.viewer.dataHelper.sphericalCoordsToVector3(\n                position,\n                object.position,\n            );\n\n            this.scene.add(object);\n        }\n    }\n\n    private __getTargetLink(target: HTMLElement, closest = false): VirtualTourLink {\n        const target2 = closest ? utils.getClosest(target, '.psv-virtual-tour-link') : target;\n        return target2 ? (target2 as any)[LINK_DATA] : undefined;\n    }\n\n    private __onToggleGallery(visible: boolean) {\n        if (!visible) {\n            this.container.style.marginBottom = '';\n        } else {\n            this.container.style.marginBottom = (this.viewer.container.querySelector<HTMLElement>('.psv-gallery').offsetHeight) + 'px';\n        }\n    }\n}\n","import type { Viewer } from '@photo-sphere-viewer/core';\nimport { PSVError, utils } from '@photo-sphere-viewer/core';\nimport { VirtualTourLink, VirtualTourNode } from '../model';\nimport type { VirtualTourPlugin } from '../VirtualTourPlugin';\n\nexport abstract class AbstractDatasource {\n    nodes: Record<string, VirtualTourNode> = {};\n\n    constructor(\n        protected readonly plugin: VirtualTourPlugin,\n        protected readonly viewer: Viewer,\n    ) {}\n\n    // eslint-disable-next-line @typescript-eslint/no-empty-function\n    destroy() {}\n\n    /**\n     * Loads a node\n     */\n    abstract loadNode(nodeId: string): Promise<VirtualTourNode>;\n\n    /**\n     * Checks the configuration of a node\n     */\n    protected checkNode(node: VirtualTourNode) {\n        if (!node.id) {\n            throw new PSVError('No id given for node');\n        }\n        if (!node.panorama) {\n            throw new PSVError(`No panorama provided for node ${node.id}`);\n        }\n        if (this.plugin.isGps && !(node.gps?.length >= 2)) {\n            throw new PSVError(`No GPS position provided for node ${node.id}`);\n        }\n        if (!this.plugin.isGps && node.markers?.some(marker => marker.gps && !marker.position)) {\n            throw new PSVError(`Cannot use GPS positioning for markers in manual mode`);\n        }\n        if (!node.links) {\n            utils.logWarn(`Node ${node.id} has no links`);\n            node.links = [];\n        }\n    }\n\n    /**\n     * Checks the configuration of a link\n     */\n    protected checkLink(node: VirtualTourNode, link: VirtualTourLink) {\n        if (!link.nodeId) {\n            throw new PSVError(`Link of node ${node.id} has no target id`);\n        }\n        if (link.nodeId === node.id) {\n            throw new PSVError(`Node ${node.id} links to itself`);\n        }\n        if (!this.plugin.isGps && !utils.isExtendedPosition(link.position)) {\n            throw new PSVError(`No position provided for link ${link.nodeId} of node ${node.id}`);\n        }\n        if (this.plugin.isGps && !link.gps) {\n            throw new PSVError(`No GPS position provided for link ${link.nodeId} of node ${node.id}`);\n        }\n    }\n}\n","import { PSVError, utils } from '@photo-sphere-viewer/core';\nimport { VirtualTourNode } from '../model';\nimport { AbstractDatasource } from './AbstractDataSource';\n\nexport class ClientSideDatasource extends AbstractDatasource {\n    async loadNode(nodeId: string) {\n        if (this.nodes[nodeId]) {\n            return this.nodes[nodeId];\n        } else {\n            throw new PSVError(`Node ${nodeId} not found`);\n        }\n    }\n\n    setNodes(rawNodes: VirtualTourNode[]) {\n        if (!rawNodes?.length) {\n            throw new PSVError('No nodes provided');\n        }\n\n        const nodes: Record<string, VirtualTourNode> = {};\n        const linkedNodes: Record<string, boolean> = {};\n\n        rawNodes.forEach((node) => {\n            this.checkNode(node);\n\n            if (nodes[node.id]) {\n                throw new PSVError(`Duplicate node ${node.id}`);\n            }\n\n            nodes[node.id] = node;\n        });\n\n        rawNodes.forEach((node) => {\n            this.__checkLinks(node, nodes);\n\n            node.links.forEach((link) => {\n                linkedNodes[link.nodeId] = true;\n            });\n        });\n\n        rawNodes.forEach((node) => {\n            if (!linkedNodes[node.id]) {\n                utils.logWarn(`Node ${node.id} is never linked to`);\n            }\n        });\n\n        this.nodes = nodes;\n    }\n\n    updateNode(rawNode: Partial<VirtualTourNode> & { id: VirtualTourNode['id'] }) {\n        if (!rawNode.id) {\n            throw new PSVError('No id given for node');\n        }\n\n        const node = this.nodes[rawNode.id];\n        if (!node) {\n            throw new PSVError(`Node ${rawNode.id} does not exist`);\n        }\n\n        Object.assign(node, rawNode);\n\n        this.checkNode(node);\n\n        this.__checkLinks(node, this.nodes);\n\n        return node;\n    }\n\n    private __checkLinks(node: VirtualTourNode, nodes: Record<string, VirtualTourNode>) {\n        node.links.forEach((link) => {\n            if (!nodes[link.nodeId]) {\n                throw new PSVError(`Target node ${link.nodeId} of node ${node.id} does not exists`);\n            }\n\n            link.gps = link.gps || nodes[link.nodeId].gps;\n\n            this.checkLink(node, link);\n        });\n    }\n}\n","import type { Viewer } from '@photo-sphere-viewer/core';\nimport { PSVError } from '@photo-sphere-viewer/core';\nimport { VirtualTourPluginConfig } from '../model';\nimport type { VirtualTourPlugin } from '../VirtualTourPlugin';\nimport { AbstractDatasource } from './AbstractDataSource';\n\nexport class ServerSideDatasource extends AbstractDatasource {\n    private readonly nodeResolver: VirtualTourPluginConfig['getNode'];\n\n    constructor(plugin: VirtualTourPlugin, viewer: Viewer) {\n        super(plugin, viewer);\n\n        if (!plugin.config.getNode) {\n            throw new PSVError('Missing getNode() option.');\n        }\n\n        this.nodeResolver = plugin.config.getNode;\n    }\n\n    async loadNode(nodeId: string) {\n        if (this.nodes[nodeId]) {\n            return this.nodes[nodeId];\n        } else {\n            const node = await this.nodeResolver(nodeId);\n\n            this.checkNode(node);\n\n            node.links.forEach((link) => {\n                this.checkLink(node, link);\n            });\n\n            this.nodes[nodeId] = node;\n\n            return node;\n        }\n    }\n\n    clearCache(): void {\n        this.nodes = {};\n    }\n}\n","import { Position, utils } from '@photo-sphere-viewer/core';\nimport { MathUtils } from 'three';\nimport { GpsPosition } from './model';\n\n/**\n * Returns the difference between two WS84 GPS points as yaw+pitch on the viewer\n */\nexport function gpsToSpherical(gps1: GpsPosition, gps2: GpsPosition): Position {\n    const p1 = gpsDegToRad(gps1);\n    const p2 = gpsDegToRad(gps2);\n    const h1 = gps1[2] ?? 0;\n    const h2 = gps2[2] ?? 0;\n\n    let pitch = 0;\n    if (h1 !== h2) {\n        pitch = Math.atan((h2 - h1) / distance(p1, p2));\n    }\n\n    const yaw = bearing(p1, p2);\n\n    return { yaw, pitch };\n}\n\nfunction gpsDegToRad(gps: GpsPosition): [number, number] {\n    return [MathUtils.degToRad(gps[0]), MathUtils.degToRad(gps[1])];\n}\n\n/**\n * Returns the distance between two GPS points\n */\nfunction distance(p1: [number, number], p2: [number, number]): number {\n    return utils.greatArcDistance(p1, p2) * 6371e3;\n}\n\n/**\n * Returns the bearing between two GPS points\n * @link http://www.movable-type.co.uk/scripts/latlong.html\n */\nfunction bearing(p1: [number, number], p2: [number, number]): number {\n    const [long1, lat1] = p1;\n    const [long2, lat2] = p2;\n\n    const y = Math.sin(long2 - long1) * Math.cos(lat2);\n    const x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(long2 - long1);\n    return Math.atan2(y, x);\n}\n","import type { CompassPlugin } from '@photo-sphere-viewer/compass-plugin';\nimport type { PluginConstructor, Point, Position, Tooltip, Viewer } from '@photo-sphere-viewer/core';\nimport { AbstractConfigurablePlugin, PSVError, events, utils } from '@photo-sphere-viewer/core';\nimport type { GalleryPlugin } from '@photo-sphere-viewer/gallery-plugin';\nimport type { MapPlugin, events as mapEvents } from '@photo-sphere-viewer/map-plugin';\nimport type { MarkersPlugin } from '@photo-sphere-viewer/markers-plugin';\nimport type { PlanPlugin, events as planEvents } from '@photo-sphere-viewer/plan-plugin';\nimport { MathUtils } from 'three';\nimport { ArrowsRenderer } from './ArrowsRenderer';\nimport { DEFAULT_ARROW, LINK_DATA, LINK_ID, LOADING_TOOLTIP } from './constants';\nimport { AbstractDatasource } from './datasources/AbstractDataSource';\nimport { ClientSideDatasource } from './datasources/ClientSideDatasource';\nimport { ServerSideDatasource } from './datasources/ServerSideDatasource';\nimport { EnterArrowEvent, LeaveArrowEvent, NodeChangedEvent, VirtualTourEvents } from './events';\nimport {\n    GpsPosition,\n    VirtualTourLink,\n    VirtualTourNode,\n    VirtualTourPluginConfig,\n    VirtualTourTransitionOptions,\n} from './model';\nimport { gpsToSpherical } from './utils';\n\nconst getConfig = utils.getConfigParser<VirtualTourPluginConfig>(\n    {\n        dataMode: 'client',\n        positionMode: 'manual',\n        renderMode: '3d',\n        nodes: null,\n        getNode: null,\n        startNodeId: null,\n        preload: false,\n        transitionOptions: {\n            showLoader: true,\n            speed: '20rpm',\n            effect: 'fade',\n            rotation: true,\n        },\n        linksOnCompass: true,\n        showLinkTooltip: true,\n        getLinkTooltip: null,\n        arrowStyle: DEFAULT_ARROW,\n        arrowsPosition: {\n            minPitch: 0.3,\n            maxPitch: Math.PI / 2,\n            linkOverlapAngle: Math.PI / 4,\n            linkPitchOffset: -0.1,\n        },\n        map: null,\n    },\n    {\n        dataMode(dataMode) {\n            if (dataMode !== 'client' && dataMode !== 'server') {\n                throw new PSVError('VirtualTourPlugin: invalid dataMode');\n            }\n            return dataMode;\n        },\n        positionMode(positionMode) {\n            if (positionMode !== 'gps' && positionMode !== 'manual') {\n                throw new PSVError('VirtualTourPlugin: invalid positionMode');\n            }\n            return positionMode;\n        },\n        renderMode(renderMode) {\n            if (renderMode !== '3d' && renderMode !== '2d') {\n                throw new PSVError('VirtualTourPlugin: invalid renderMode');\n            }\n            return renderMode;\n        },\n        arrowsPosition(arrowsPosition, { defValue }) {\n            return { ...defValue, ...arrowsPosition };\n        },\n        arrowStyle(arrowStyle, { defValue }) {\n            return { ...defValue, ...arrowStyle };\n        },\n        map(map, { rawConfig }) {\n            if (map) {\n                if (rawConfig.dataMode === 'server') {\n                    utils.logWarn('VirtualTourPlugin: The map cannot be used in server side mode');\n                    return null;\n                }\n                if (!map.imageUrl) {\n                    utils.logWarn('VirtualTourPlugin: configuring the map requires at least \"imageUrl\"');\n                    return null;\n                }\n                if (!('recenter' in map)) {\n                    map.recenter = true;\n                }\n            }\n            return map;\n        },\n    },\n);\n\n/**\n * Creates virtual tours by linking multiple panoramas\n */\nexport class VirtualTourPlugin extends AbstractConfigurablePlugin<\n    VirtualTourPluginConfig,\n    VirtualTourPluginConfig,\n    never,\n    VirtualTourEvents\n> {\n    static override readonly id = 'virtual-tour';\n    static override readonly VERSION = PKG_VERSION;\n    static override readonly configParser = getConfig;\n    static override readonly readonlyOptions = Object.keys(getConfig.defaults);\n\n    private readonly state = {\n        currentNode: null as VirtualTourNode,\n        currentTooltip: null as Tooltip,\n        loadingNode: null as string,\n        preload: {} as Record<string, boolean | Promise<any>>,\n    };\n\n    private datasource: AbstractDatasource;\n    private arrowsRenderer: ArrowsRenderer;\n\n    private map?: MapPlugin;\n    private plan?: PlanPlugin;\n    private markers?: MarkersPlugin;\n    private compass?: CompassPlugin;\n    private gallery?: GalleryPlugin;\n\n    get is3D(): boolean {\n        return this.config.renderMode === '3d';\n    }\n\n    get isServerSide(): boolean {\n        return this.config.dataMode === 'server';\n    }\n\n    get isGps(): boolean {\n        return this.config.positionMode === 'gps';\n    }\n\n    static withConfig(config: VirtualTourPluginConfig): [PluginConstructor, any] {\n        return [VirtualTourPlugin, config];\n    }\n\n    constructor(viewer: Viewer, config: VirtualTourPluginConfig) {\n        super(viewer, config);\n\n        this.arrowsRenderer = new ArrowsRenderer(this.viewer, this);\n    }\n\n    /**\n     * @internal\n     */\n    override init() {\n        super.init();\n\n        this.arrowsRenderer.init();\n\n        utils.checkStylesheet(this.viewer.container, 'virtual-tour-plugin');\n\n        this.markers = this.viewer.getPlugin('markers');\n        this.compass = this.viewer.getPlugin('compass');\n\n        if (this.markers?.config.markers) {\n            utils.logWarn(\n                'No default markers can be configured on the MarkersPlugin when using the VirtualTourPlugin. '\n                + 'Consider defining `markers` on each tour node.',\n            );\n            delete this.markers.config.markers;\n        }\n\n        if (this.isGps) {\n            this.plan = this.viewer.getPlugin('plan');\n        }\n\n        if (!this.isServerSide) {\n            this.gallery = this.viewer.getPlugin('gallery');\n            this.map = this.viewer.getPlugin('map');\n\n            if (this.config.map && !this.map) {\n                utils.logWarn('The map is configured on the VirtualTourPlugin but the MapPlugin is not loaded.');\n            }\n        }\n\n        this.datasource = this.isServerSide\n            ? new ServerSideDatasource(this, this.viewer)\n            : new ClientSideDatasource(this, this.viewer);\n\n        if (this.map) {\n            this.map.addEventListener('select-hotspot', this);\n            this.map.setImage(this.config.map.imageUrl);\n        }\n\n        this.plan?.addEventListener('select-hotspot', this);\n\n        if (this.isServerSide) {\n            if (this.config.startNodeId) {\n                this.setCurrentNode(this.config.startNodeId);\n            }\n        } else if (this.config.nodes) {\n            this.setNodes(this.config.nodes, this.config.startNodeId);\n            delete this.config.nodes;\n        }\n    }\n\n    /**\n     * @internal\n     */\n    override destroy() {\n        this.map?.removeEventListener('select-hotspot', this);\n        this.plan?.removeEventListener('select-hotspot', this);\n\n        this.datasource.destroy();\n        this.arrowsRenderer.destroy();\n\n        delete this.datasource;\n        delete this.markers;\n        delete this.compass;\n        delete this.gallery;\n        delete this.arrowsRenderer;\n\n        super.destroy();\n    }\n\n    /**\n     * @internal\n     */\n    handleEvent(e: Event) {\n        if (e instanceof events.ClickEvent) {\n            const link = e.data.objects.find(o => o.userData[LINK_DATA])?.userData[LINK_DATA];\n            if (link) {\n                this.setCurrentNode(link.nodeId, null, link);\n            }\n        } else if (e.type === 'select-hotspot') {\n            const id = (e as mapEvents.SelectHotspot | planEvents.SelectHotspot).hotspotId;\n            if (id.startsWith(LINK_ID)) {\n                this.setCurrentNode(id.substring(LINK_ID.length));\n            }\n        }\n    }\n\n    /**\n     * Returns the current node\n     */\n    getCurrentNode(): VirtualTourNode {\n        return this.state.currentNode;\n    }\n\n    /**\n     * Sets the nodes (client mode only)\n     * @throws {@link PSVError} if not in client mode\n     */\n    setNodes(nodes: VirtualTourNode[], startNodeId?: string) {\n        if (this.isServerSide) {\n            throw new PSVError('Cannot set nodes in server side mode');\n        }\n\n        this.__hideTooltip();\n        this.state.currentNode = null;\n\n        (this.datasource as ClientSideDatasource).setNodes(nodes);\n\n        if (!startNodeId) {\n            startNodeId = nodes[0].id;\n        } else if (!this.datasource.nodes[startNodeId]) {\n            startNodeId = nodes[0].id;\n            utils.logWarn(`startNodeId not found is provided nodes, resetted to ${startNodeId}`);\n        }\n        this.setCurrentNode(startNodeId);\n\n        this.__setGalleryItems();\n        this.__setMapHotspots();\n        this.__setPlanHotspots();\n    }\n\n    /**\n     * Changes the current node\n     * @returns {Promise<boolean>} resolves false if the loading was aborted by another call\n     */\n    setCurrentNode(\n        nodeId: string,\n        options?: VirtualTourTransitionOptions & {\n            /**\n             * reload the node even if already loaded\n             */\n            forceUpdate?: boolean;\n        },\n        fromLink?: VirtualTourLink,\n    ): Promise<boolean> {\n        if (nodeId === this.state.currentNode?.id && !options?.forceUpdate) {\n            return Promise.resolve(true);\n        }\n\n        if (options?.forceUpdate && this.isServerSide) {\n            (this.datasource as ServerSideDatasource).clearCache();\n        }\n\n        this.viewer.hideError();\n\n        this.state.loadingNode = nodeId;\n\n        const fromNode = this.state.currentNode;\n        const fromLinkPosition = fromNode && fromLink ? this.__getLinkPosition(fromNode, fromLink) : null;\n\n        // if this node is already preloading, wait for it\n        return Promise.resolve(this.state.preload[nodeId])\n            .then(() => {\n                if (this.state.loadingNode !== nodeId) {\n                    throw utils.getAbortError();\n                }\n\n                return this.datasource.loadNode(nodeId);\n            })\n            .then((node) => {\n                if (this.state.loadingNode !== nodeId) {\n                    throw utils.getAbortError();\n                }\n\n                const transitionOptions: VirtualTourTransitionOptions = {\n                    ...getConfig.defaults.transitionOptions,\n                    rotateTo: fromLinkPosition,\n                    zoomTo: fromLinkPosition ? this.viewer.getZoomLevel() : null, // prevents the adapter to apply InitialHorizontalFOVDegrees\n                    ...(typeof this.config.transitionOptions === 'function'\n                        ? this.config.transitionOptions(node, fromNode, fromLink)\n                        : this.config.transitionOptions),\n                    ...options,\n                };\n\n                if (!transitionOptions.effect) {\n                    transitionOptions.effect = 'none';\n                }\n\n                this.viewer.panel.hide('description');\n\n                this.__hideTooltip();\n\n                this.arrowsRenderer.clear();\n\n                if (this.gallery?.config.hideOnClick) {\n                    this.gallery.hide();\n                }\n                if (this.map?.config.minimizeOnHotspotClick) {\n                    this.map.minimize();\n                }\n                if (this.plan?.config.minimizeOnHotspotClick) {\n                    this.plan.minimize();\n                }\n\n                if (transitionOptions.rotation && transitionOptions.effect === 'none') {\n                    return this.viewer\n                        .animate({\n                            ...transitionOptions.rotateTo,\n                            zoom: transitionOptions.zoomTo,\n                            speed: transitionOptions.speed,\n                        })\n                        .then(() => [node, transitionOptions] as [VirtualTourNode, VirtualTourTransitionOptions]);\n                } else {\n                    return Promise.resolve([node, transitionOptions] as [VirtualTourNode, VirtualTourTransitionOptions]);\n                }\n            })\n            .then(([node, transitionOptions]) => {\n                if (this.state.loadingNode !== nodeId) {\n                    throw utils.getAbortError();\n                }\n\n                this.markers?.clearMarkers();\n\n                if (this.config.linksOnCompass) {\n                    this.compass?.clearHotspots();\n                }\n\n                return this.viewer\n                    .setPanorama(node.panorama, {\n                        caption: node.caption,\n                        description: node.description,\n                        panoData: node.panoData,\n                        sphereCorrection: node.sphereCorrection,\n                        showLoader: transitionOptions.showLoader,\n                        position: transitionOptions.rotateTo,\n                        zoom: transitionOptions.zoomTo,\n                        transition: transitionOptions.effect === 'none'\n                            ? false\n                            : {\n                                    effect: transitionOptions.effect,\n                                    rotation: transitionOptions.rotation,\n                                    speed: transitionOptions.speed,\n                                },\n                    })\n                    .then((completed) => {\n                        if (!completed) {\n                            throw utils.getAbortError();\n                        }\n\n                        return node;\n                    });\n            })\n            .then((node) => {\n                if (this.state.loadingNode !== nodeId) {\n                    throw utils.getAbortError();\n                }\n\n                this.state.currentNode = node;\n\n                if (this.map) {\n                    // if the node is not visible in the map, we don't know where to center the map\n                    // so we keep the current center\n                    this.map.setCenter(this.__getNodeMapPosition(node) ?? this.map.config.center, this.config.map.recenter);\n                }\n                this.plan?.setCoordinates(node.gps);\n\n                this.__addNodeMarkers(node);\n                this.__renderLinks(node);\n                this.__preload(node);\n\n                this.state.loadingNode = null;\n\n                this.dispatchEvent(\n                    new NodeChangedEvent(node, {\n                        fromNode,\n                        fromLink,\n                        fromLinkPosition,\n                    }),\n                );\n\n                this.viewer.resetIdleTimer();\n\n                return true;\n            })\n            .catch((err) => {\n                if (utils.isAbortError(err)) {\n                    return false;\n                }\n\n                this.viewer.showError(this.viewer.config.lang.loadError);\n\n                this.viewer.loader.hide();\n                this.viewer.navbar.setCaption('');\n\n                this.state.loadingNode = null;\n\n                throw err;\n            });\n    }\n\n    /**\n     * Rotate the view to face the link\n     */\n    async gotoLink(nodeId: string, speed: string | number = '8rpm'): Promise<void> {\n        const position = this.getLinkPosition(nodeId);\n\n        if (!speed) {\n            this.viewer.rotate(position);\n        } else {\n            await this.viewer.animate({\n                ...position,\n                speed,\n            });\n        }\n    }\n\n    /**\n     * Returns the position of a link in the viewer\n     */\n    getLinkPosition(nodeId: string): Position {\n        const link = this.state.currentNode?.links.find(link => link.nodeId === nodeId);\n\n        if (!link) {\n            throw new PSVError(`Cannot find link \"${nodeId}\"`);\n        }\n\n        return this.__getLinkPosition(this.state.currentNode, link);\n    }\n\n    /**\n     * Updates a node (client mode only)\n     * All properties but \"id\" are optional, the new config will be merged with the previous\n     * @throws {@link PSVError} if not in client mode\n     */\n    updateNode(newNode: Partial<VirtualTourNode> & { id: VirtualTourNode['id'] }) {\n        if (this.isServerSide) {\n            throw new PSVError('Cannot update node in server side mode');\n        }\n\n        const node = (this.datasource as ClientSideDatasource).updateNode(newNode);\n\n        if (newNode.name || newNode.thumbnail || newNode.panorama) {\n            this.__setGalleryItems();\n        }\n        if (newNode.name || newNode.gps || newNode.map) {\n            this.__setMapHotspots();\n        }\n        if (newNode.name || newNode.gps || newNode.plan) {\n            this.__setPlanHotspots();\n        }\n\n        if (this.state.currentNode?.id === node.id) {\n            this.__hideTooltip();\n\n            if (newNode.panorama || newNode.panoData || newNode.sphereCorrection) {\n                this.setCurrentNode(node.id, { forceUpdate: true });\n                return;\n            }\n\n            if (newNode.caption) {\n                this.viewer.setOption('caption', node.caption);\n            }\n            if (newNode.description) {\n                this.viewer.setOption('description', node.description);\n            }\n\n            if (newNode.links || newNode.gps) {\n                this.__renderLinks(node);\n            }\n\n            if (newNode.gps) {\n                this.plan?.setCoordinates(node.gps);\n            }\n\n            if (newNode.map || newNode.gps) {\n                this.map?.setCenter(this.__getNodeMapPosition(node));\n            }\n\n            if (newNode.markers || newNode.gps) {\n                this.__addNodeMarkers(node);\n            }\n        }\n    }\n\n    /**\n     * Updates the gallery plugin\n     */\n    private __setGalleryItems() {\n        if (this.gallery) {\n            this.gallery.setItems(\n                Object.values(this.datasource.nodes)\n                    .filter(node => node.showInGallery !== false)\n                    .map(node => ({\n                        id: node.id,\n                        panorama: node.panorama,\n                        name: node.name,\n                        thumbnail: node.thumbnail,\n                    })),\n                (id) => {\n                    this.setCurrentNode(id as string);\n                },\n            );\n        }\n    }\n\n    /**\n     * Update the map plugin\n     */\n    private __setMapHotspots() {\n        if (this.map) {\n            this.map.setHotspots(\n                Object.values(this.datasource.nodes)\n                    .filter(node => node.map !== false)\n                    .map(node => ({\n                        tooltip: node.name,\n                        ...(node.map || {}),\n                        ...this.__getNodeMapPosition(node),\n                        id: LINK_ID + node.id,\n                    })),\n            );\n        }\n    }\n\n    /**\n     * Updates the plan plugin\n     */\n    private __setPlanHotspots() {\n        if (this.plan) {\n            this.plan.setHotspots(\n                Object.values(this.datasource.nodes)\n                    .filter(node => node.plan !== false)\n                    .map(node => ({\n                        tooltip: node.name,\n                        ...(node.plan || {}),\n                        coordinates: node.gps,\n                        id: LINK_ID + node.id,\n                    })),\n            );\n        }\n    }\n\n    /**\n     * Adds the links for the node\n     */\n    private __renderLinks(node: VirtualTourNode) {\n        this.arrowsRenderer.clear();\n\n        const positions: Position[] = [];\n\n        node.links.forEach((link) => {\n            const position = this.__getLinkPosition(node, link);\n            position.yaw += link.linkOffset?.yaw ?? 0;\n            position.pitch += link.linkOffset?.pitch ?? 0;\n\n            if (this.isGps && !this.is3D) {\n                position.pitch += this.config.arrowsPosition.linkPitchOffset;\n            }\n\n            positions.push(position);\n\n            this.arrowsRenderer.addLinkArrow(link, position, link.linkOffset?.depth);\n        });\n\n        this.arrowsRenderer.render();\n\n        if (this.config.linksOnCompass) {\n            this.compass?.setHotspots(positions);\n        }\n    }\n\n    /**\n     * Computes the marker position for a link\n     */\n    private __getLinkPosition(node: VirtualTourNode, link: VirtualTourLink): Position {\n        if (this.isGps) {\n            return gpsToSpherical(node.gps, link.gps);\n        } else {\n            return this.viewer.dataHelper.cleanPosition(link.position);\n        }\n    }\n\n    /**\n     * Returns the complete tootlip content for a node\n     */\n    private async __getTooltipContent(link: VirtualTourLink): Promise<string> {\n        const node = await this.datasource.loadNode(link.nodeId);\n        const elements: string[] = [];\n\n        if (node.name || node.thumbnail || node.caption) {\n            if (node.name) {\n                elements.push(`<h3>${node.name}</h3>`);\n            }\n            if (node.thumbnail) {\n                elements.push(`<img src=\"${node.thumbnail}\">`);\n            }\n            if (node.caption) {\n                elements.push(`<p>${node.caption}</p>`);\n            }\n        }\n\n        let content = elements.join('');\n        if (this.config.getLinkTooltip) {\n            content = this.config.getLinkTooltip(content, link, node);\n        }\n        return content;\n    }\n\n    /** @internal */\n    __onEnterArrow(link: VirtualTourLink, evt: MouseEvent) {\n        const viewerPos = utils.getPosition(this.viewer.container);\n\n        const viewerPoint: Point = {\n            x: evt.clientX - viewerPos.x,\n            y: evt.clientY - viewerPos.y,\n        };\n\n        if (this.config.showLinkTooltip) {\n            this.state.currentTooltip = this.viewer.createTooltip({\n                ...LOADING_TOOLTIP,\n                left: viewerPoint.x,\n                top: viewerPoint.y,\n                box: {\n                    // separate the tooltip from the cursor\n                    width: 20,\n                    height: 20,\n                },\n            });\n\n            this.__getTooltipContent(link).then((content) => {\n                if (content) {\n                    this.state.currentTooltip.update(content);\n                } else {\n                    this.__hideTooltip();\n                }\n            });\n        }\n\n        this.map?.setActiveHotspot(LINK_ID + link.nodeId);\n        this.plan?.setActiveHotspot(LINK_ID + link.nodeId);\n\n        this.dispatchEvent(new EnterArrowEvent(link, this.state.currentNode));\n    }\n\n    /** @internal */\n    __onHoverArrow(evt: MouseEvent) {\n        const viewerPos = utils.getPosition(this.viewer.container);\n\n        const viewerPoint: Point = {\n            x: evt.clientX - viewerPos.x,\n            y: evt.clientY - viewerPos.y,\n        };\n\n        this.state.currentTooltip?.move({\n            left: viewerPoint.x,\n            top: viewerPoint.y,\n        });\n    }\n\n    /** @internal */\n    __onLeaveArrow(link: VirtualTourLink) {\n        this.__hideTooltip();\n\n        this.map?.setActiveHotspot(null);\n        this.plan?.setActiveHotspot(null);\n\n        this.dispatchEvent(new LeaveArrowEvent(link, this.state.currentNode));\n    }\n\n    /**\n     * Hides the tooltip\n     */\n    private __hideTooltip() {\n        this.state.currentTooltip?.hide();\n        this.state.currentTooltip = null;\n    }\n\n    /**\n     * Manage the preload of the linked panoramas\n     */\n    private __preload(node: VirtualTourNode) {\n        if (!this.config.preload) {\n            return;\n        }\n\n        this.state.preload[node.id] = true;\n\n        this.state.currentNode.links\n            .filter(link => !this.state.preload[link.nodeId])\n            .filter((link) => {\n                if (typeof this.config.preload === 'function') {\n                    return this.config.preload(this.state.currentNode, link);\n                } else {\n                    return true;\n                }\n            })\n            .forEach((link) => {\n                this.state.preload[link.nodeId] = this.datasource\n                    .loadNode(link.nodeId)\n                    .then((linkNode) => {\n                        return this.viewer.textureLoader.preloadPanorama(linkNode.panorama);\n                    })\n                    .then(() => {\n                        this.state.preload[link.nodeId] = true;\n                    })\n                    .catch(() => {\n                        delete this.state.preload[link.nodeId];\n                    });\n            });\n    }\n\n    /**\n     * Changes the markers to the ones defined on the node\n     */\n    private __addNodeMarkers(node: VirtualTourNode) {\n        if (node.markers) {\n            if (this.markers) {\n                this.markers.setMarkers(\n                    node.markers.map((marker) => {\n                        if (marker.gps && this.isGps) {\n                            marker.position = gpsToSpherical(node.gps, marker.gps);\n                            if (marker.data?.['map']) {\n                                Object.assign(marker.data['map'], this.__getGpsMapPosition(marker.gps));\n                            }\n                            if (marker.data?.['plan']) {\n                                marker.data['plan'].coordinates = marker.gps;\n                            }\n                        }\n                        return marker;\n                    }),\n                );\n            } else {\n                utils.logWarn(`Node ${node.id} markers ignored because the plugin is not loaded.`);\n            }\n        }\n    }\n\n    /**\n     * Gets the position of a node on the map, if applicable\n     */\n    private __getNodeMapPosition(node: VirtualTourNode): Point {\n        const fromGps = this.__getGpsMapPosition(node.gps);\n        if (fromGps) {\n            return fromGps;\n        } else if (node.map) {\n            return { x: node.map.x, y: node.map.y };\n        } else {\n            return null;\n        }\n    }\n\n    /**\n     * Gets a gps position on the map\n     */\n    private __getGpsMapPosition(gps: GpsPosition): Point {\n        const map = this.config.map;\n        if (this.isGps && map && map.extent && map.size) {\n            return {\n                x: MathUtils.mapLinear(gps[0], map.extent[0], map.extent[2], 0, map.size.width),\n                y: MathUtils.mapLinear(gps[1], map.extent[1], map.extent[3], 0, map.size.height),\n            };\n        } else {\n            return null;\n        }\n    }\n}\n","// DEFLATE is a complex format; to read this code, you should probably check the RFC first:\n// https://tools.ietf.org/html/rfc1951\n// You may also wish to take a look at the guide I made about this program:\n// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad\n// Some of the following code is similar to that of UZIP.js:\n// https://github.com/photopea/UZIP.js\n// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.\n// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint\n// is better for memory in most engines (I *think*).\nvar ch2 = {};\nvar wk = (function (c, id, msg, transfer, cb) {\n    var w = new Worker(ch2[id] || (ch2[id] = URL.createObjectURL(new Blob([\n        c + ';addEventListener(\"error\",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'\n    ], { type: 'text/javascript' }))));\n    w.onmessage = function (e) {\n        var d = e.data, ed = d.$e$;\n        if (ed) {\n            var err = new Error(ed[0]);\n            err['code'] = ed[1];\n            err.stack = ed[2];\n            cb(err, null);\n        }\n        else\n            cb(null, d);\n    };\n    w.postMessage(msg, transfer);\n    return w;\n});\n\n// aliases for shorter compressed code (most minifers don't do this)\nvar u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;\n// fixed length extra bits\nvar fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);\n// fixed distance extra bits\nvar fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);\n// code length index map\nvar clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n// get base, reverse index map from extra bits\nvar freb = function (eb, start) {\n    var b = new u16(31);\n    for (var i = 0; i < 31; ++i) {\n        b[i] = start += 1 << eb[i - 1];\n    }\n    // numbers here are at max 18 bits\n    var r = new i32(b[30]);\n    for (var i = 1; i < 30; ++i) {\n        for (var j = b[i]; j < b[i + 1]; ++j) {\n            r[j] = ((j - b[i]) << 5) | i;\n        }\n    }\n    return { b: b, r: r };\n};\nvar _a = freb(fleb, 2), fl = _a.b, revfl = _a.r;\n// we can ignore the fact that the other numbers are wrong; they never happen anyway\nfl[28] = 258, revfl[258] = 28;\nvar _b = freb(fdeb, 0), fd = _b.b, revfd = _b.r;\n// map of value to reverse (assuming 16 bits)\nvar rev = new u16(32768);\nfor (var i = 0; i < 32768; ++i) {\n    // reverse table algorithm from SO\n    var x = ((i & 0xAAAA) >> 1) | ((i & 0x5555) << 1);\n    x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2);\n    x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4);\n    rev[i] = (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8)) >> 1;\n}\n// create huffman tree from u8 \"map\": index -> code length for code index\n// mb (max bits) must be at most 15\n// TODO: optimize/split up?\nvar hMap = (function (cd, mb, r) {\n    var s = cd.length;\n    // index\n    var i = 0;\n    // u16 \"map\": index -> # of codes with bit length = index\n    var l = new u16(mb);\n    // length of cd must be 288 (total # of codes)\n    for (; i < s; ++i) {\n        if (cd[i])\n            ++l[cd[i] - 1];\n    }\n    // u16 \"map\": index -> minimum code for bit length = index\n    var le = new u16(mb);\n    for (i = 1; i < mb; ++i) {\n        le[i] = (le[i - 1] + l[i - 1]) << 1;\n    }\n    var co;\n    if (r) {\n        // u16 \"map\": index -> number of actual bits, symbol for code\n        co = new u16(1 << mb);\n        // bits to remove for reverser\n        var rvb = 15 - mb;\n        for (i = 0; i < s; ++i) {\n            // ignore 0 lengths\n            if (cd[i]) {\n                // num encoding both symbol and bits read\n                var sv = (i << 4) | cd[i];\n                // free bits\n                var r_1 = mb - cd[i];\n                // start value\n                var v = le[cd[i] - 1]++ << r_1;\n                // m is end value\n                for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {\n                    // every 16 bit value starting with the code yields the same result\n                    co[rev[v] >> rvb] = sv;\n                }\n            }\n        }\n    }\n    else {\n        co = new u16(s);\n        for (i = 0; i < s; ++i) {\n            if (cd[i]) {\n                co[i] = rev[le[cd[i] - 1]++] >> (15 - cd[i]);\n            }\n        }\n    }\n    return co;\n});\n// fixed length tree\nvar flt = new u8(288);\nfor (var i = 0; i < 144; ++i)\n    flt[i] = 8;\nfor (var i = 144; i < 256; ++i)\n    flt[i] = 9;\nfor (var i = 256; i < 280; ++i)\n    flt[i] = 7;\nfor (var i = 280; i < 288; ++i)\n    flt[i] = 8;\n// fixed distance tree\nvar fdt = new u8(32);\nfor (var i = 0; i < 32; ++i)\n    fdt[i] = 5;\n// fixed length map\nvar flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);\n// fixed distance map\nvar fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);\n// find max of array\nvar max = function (a) {\n    var m = a[0];\n    for (var i = 1; i < a.length; ++i) {\n        if (a[i] > m)\n            m = a[i];\n    }\n    return m;\n};\n// read d, starting at bit p and mask with m\nvar bits = function (d, p, m) {\n    var o = (p / 8) | 0;\n    return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;\n};\n// read d, starting at bit p continuing for at least 16 bits\nvar bits16 = function (d, p) {\n    var o = (p / 8) | 0;\n    return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));\n};\n// get end of byte\nvar shft = function (p) { return ((p + 7) / 8) | 0; };\n// typed array slice - allows garbage collector to free original reference,\n// while being more compatible than .slice\nvar slc = function (v, s, e) {\n    if (s == null || s < 0)\n        s = 0;\n    if (e == null || e > v.length)\n        e = v.length;\n    // can't use .constructor in case user-supplied\n    return new u8(v.subarray(s, e));\n};\n/**\n * Codes for errors generated within this library\n */\nexport var FlateErrorCode = {\n    UnexpectedEOF: 0,\n    InvalidBlockType: 1,\n    InvalidLengthLiteral: 2,\n    InvalidDistance: 3,\n    StreamFinished: 4,\n    NoStreamHandler: 5,\n    InvalidHeader: 6,\n    NoCallback: 7,\n    InvalidUTF8: 8,\n    ExtraFieldTooLong: 9,\n    InvalidDate: 10,\n    FilenameTooLong: 11,\n    StreamFinishing: 12,\n    InvalidZipData: 13,\n    UnknownCompressionMethod: 14\n};\n// error codes\nvar ec = [\n    'unexpected EOF',\n    'invalid block type',\n    'invalid length/literal',\n    'invalid distance',\n    'stream finished',\n    'no stream handler',\n    ,\n    'no callback',\n    'invalid UTF-8 data',\n    'extra field too long',\n    'date not in range 1980-2099',\n    'filename too long',\n    'stream finishing',\n    'invalid zip data'\n    // determined by unknown compression method\n];\n;\nvar err = function (ind, msg, nt) {\n    var e = new Error(msg || ec[ind]);\n    e.code = ind;\n    if (Error.captureStackTrace)\n        Error.captureStackTrace(e, err);\n    if (!nt)\n        throw e;\n    return e;\n};\n// expands raw DEFLATE data\nvar inflt = function (dat, st, buf, dict) {\n    // source length       dict length\n    var sl = dat.length, dl = dict ? dict.length : 0;\n    if (!sl || st.f && !st.l)\n        return buf || new u8(0);\n    var noBuf = !buf;\n    // have to estimate size\n    var resize = noBuf || st.i != 2;\n    // no state\n    var noSt = st.i;\n    // Assumes roughly 33% compression ratio average\n    if (noBuf)\n        buf = new u8(sl * 3);\n    // ensure buffer can fit at least l elements\n    var cbuf = function (l) {\n        var bl = buf.length;\n        // need to increase size to fit\n        if (l > bl) {\n            // Double or set to necessary, whichever is greater\n            var nbuf = new u8(Math.max(bl * 2, l));\n            nbuf.set(buf);\n            buf = nbuf;\n        }\n    };\n    //  last chunk         bitpos           bytes\n    var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;\n    // total bits\n    var tbts = sl * 8;\n    do {\n        if (!lm) {\n            // BFINAL - this is only 1 when last chunk is next\n            final = bits(dat, pos, 1);\n            // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman\n            var type = bits(dat, pos + 1, 3);\n            pos += 3;\n            if (!type) {\n                // go to end of byte boundary\n                var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;\n                if (t > sl) {\n                    if (noSt)\n                        err(0);\n                    break;\n                }\n                // ensure size\n                if (resize)\n                    cbuf(bt + l);\n                // Copy over uncompressed data\n                buf.set(dat.subarray(s, t), bt);\n                // Get new bitpos, update byte count\n                st.b = bt += l, st.p = pos = t * 8, st.f = final;\n                continue;\n            }\n            else if (type == 1)\n                lm = flrm, dm = fdrm, lbt = 9, dbt = 5;\n            else if (type == 2) {\n                //  literal                            lengths\n                var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;\n                var tl = hLit + bits(dat, pos + 5, 31) + 1;\n                pos += 14;\n                // length+distance tree\n                var ldt = new u8(tl);\n                // code length tree\n                var clt = new u8(19);\n                for (var i = 0; i < hcLen; ++i) {\n                    // use index map to get real code\n                    clt[clim[i]] = bits(dat, pos + i * 3, 7);\n                }\n                pos += hcLen * 3;\n                // code lengths bits\n                var clb = max(clt), clbmsk = (1 << clb) - 1;\n                // code lengths map\n                var clm = hMap(clt, clb, 1);\n                for (var i = 0; i < tl;) {\n                    var r = clm[bits(dat, pos, clbmsk)];\n                    // bits read\n                    pos += r & 15;\n                    // symbol\n                    var s = r >> 4;\n                    // code length to copy\n                    if (s < 16) {\n                        ldt[i++] = s;\n                    }\n                    else {\n                        //  copy   count\n                        var c = 0, n = 0;\n                        if (s == 16)\n                            n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];\n                        else if (s == 17)\n                            n = 3 + bits(dat, pos, 7), pos += 3;\n                        else if (s == 18)\n                            n = 11 + bits(dat, pos, 127), pos += 7;\n                        while (n--)\n                            ldt[i++] = c;\n                    }\n                }\n                //    length tree                 distance tree\n                var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);\n                // max length bits\n                lbt = max(lt);\n                // max dist bits\n                dbt = max(dt);\n                lm = hMap(lt, lbt, 1);\n                dm = hMap(dt, dbt, 1);\n            }\n            else\n                err(1);\n            if (pos > tbts) {\n                if (noSt)\n                    err(0);\n                break;\n            }\n        }\n        // Make sure the buffer can hold this + the largest possible addition\n        // Maximum chunk size (practically, theoretically infinite) is 2^17\n        if (resize)\n            cbuf(bt + 131072);\n        var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;\n        var lpos = pos;\n        for (;; lpos = pos) {\n            // bits read, code\n            var c = lm[bits16(dat, pos) & lms], sym = c >> 4;\n            pos += c & 15;\n            if (pos > tbts) {\n                if (noSt)\n                    err(0);\n                break;\n            }\n            if (!c)\n                err(2);\n            if (sym < 256)\n                buf[bt++] = sym;\n            else if (sym == 256) {\n                lpos = pos, lm = null;\n                break;\n            }\n            else {\n                var add = sym - 254;\n                // no extra bits needed if less\n                if (sym > 264) {\n                    // index\n                    var i = sym - 257, b = fleb[i];\n                    add = bits(dat, pos, (1 << b) - 1) + fl[i];\n                    pos += b;\n                }\n                // dist\n                var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;\n                if (!d)\n                    err(3);\n                pos += d & 15;\n                var dt = fd[dsym];\n                if (dsym > 3) {\n                    var b = fdeb[dsym];\n                    dt += bits16(dat, pos) & (1 << b) - 1, pos += b;\n                }\n                if (pos > tbts) {\n                    if (noSt)\n                        err(0);\n                    break;\n                }\n                if (resize)\n                    cbuf(bt + 131072);\n                var end = bt + add;\n                if (bt < dt) {\n                    var shift = dl - dt, dend = Math.min(dt, end);\n                    if (shift + bt < 0)\n                        err(3);\n                    for (; bt < dend; ++bt)\n                        buf[bt] = dict[shift + bt];\n                }\n                for (; bt < end; ++bt)\n                    buf[bt] = buf[bt - dt];\n            }\n        }\n        st.l = lm, st.p = lpos, st.b = bt, st.f = final;\n        if (lm)\n            final = 1, st.m = lbt, st.d = dm, st.n = dbt;\n    } while (!final);\n    // don't reallocate for streams or user buffers\n    return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);\n};\n// starting at p, write the minimum number of bits that can hold v to d\nvar wbits = function (d, p, v) {\n    v <<= p & 7;\n    var o = (p / 8) | 0;\n    d[o] |= v;\n    d[o + 1] |= v >> 8;\n};\n// starting at p, write the minimum number of bits (>8) that can hold v to d\nvar wbits16 = function (d, p, v) {\n    v <<= p & 7;\n    var o = (p / 8) | 0;\n    d[o] |= v;\n    d[o + 1] |= v >> 8;\n    d[o + 2] |= v >> 16;\n};\n// creates code lengths from a frequency table\nvar hTree = function (d, mb) {\n    // Need extra info to make a tree\n    var t = [];\n    for (var i = 0; i < d.length; ++i) {\n        if (d[i])\n            t.push({ s: i, f: d[i] });\n    }\n    var s = t.length;\n    var t2 = t.slice();\n    if (!s)\n        return { t: et, l: 0 };\n    if (s == 1) {\n        var v = new u8(t[0].s + 1);\n        v[t[0].s] = 1;\n        return { t: v, l: 1 };\n    }\n    t.sort(function (a, b) { return a.f - b.f; });\n    // after i2 reaches last ind, will be stopped\n    // freq must be greater than largest possible number of symbols\n    t.push({ s: -1, f: 25001 });\n    var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;\n    t[0] = { s: -1, f: l.f + r.f, l: l, r: r };\n    // efficient algorithm from UZIP.js\n    // i0 is lookbehind, i2 is lookahead - after processing two low-freq\n    // symbols that combined have high freq, will start processing i2 (high-freq,\n    // non-composite) symbols instead\n    // see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/\n    while (i1 != s - 1) {\n        l = t[t[i0].f < t[i2].f ? i0++ : i2++];\n        r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];\n        t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };\n    }\n    var maxSym = t2[0].s;\n    for (var i = 1; i < s; ++i) {\n        if (t2[i].s > maxSym)\n            maxSym = t2[i].s;\n    }\n    // code lengths\n    var tr = new u16(maxSym + 1);\n    // max bits in tree\n    var mbt = ln(t[i1 - 1], tr, 0);\n    if (mbt > mb) {\n        // more algorithms from UZIP.js\n        // TODO: find out how this code works (debt)\n        //  ind    debt\n        var i = 0, dt = 0;\n        //    left            cost\n        var lft = mbt - mb, cst = 1 << lft;\n        t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });\n        for (; i < s; ++i) {\n            var i2_1 = t2[i].s;\n            if (tr[i2_1] > mb) {\n                dt += cst - (1 << (mbt - tr[i2_1]));\n                tr[i2_1] = mb;\n            }\n            else\n                break;\n        }\n        dt >>= lft;\n        while (dt > 0) {\n            var i2_2 = t2[i].s;\n            if (tr[i2_2] < mb)\n                dt -= 1 << (mb - tr[i2_2]++ - 1);\n            else\n                ++i;\n        }\n        for (; i >= 0 && dt; --i) {\n            var i2_3 = t2[i].s;\n            if (tr[i2_3] == mb) {\n                --tr[i2_3];\n                ++dt;\n            }\n        }\n        mbt = mb;\n    }\n    return { t: new u8(tr), l: mbt };\n};\n// get the max length and assign length codes\nvar ln = function (n, l, d) {\n    return n.s == -1\n        ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))\n        : (l[n.s] = d);\n};\n// length codes generation\nvar lc = function (c) {\n    var s = c.length;\n    // Note that the semicolon was intentional\n    while (s && !c[--s])\n        ;\n    var cl = new u16(++s);\n    //  ind      num         streak\n    var cli = 0, cln = c[0], cls = 1;\n    var w = function (v) { cl[cli++] = v; };\n    for (var i = 1; i <= s; ++i) {\n        if (c[i] == cln && i != s)\n            ++cls;\n        else {\n            if (!cln && cls > 2) {\n                for (; cls > 138; cls -= 138)\n                    w(32754);\n                if (cls > 2) {\n                    w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);\n                    cls = 0;\n                }\n            }\n            else if (cls > 3) {\n                w(cln), --cls;\n                for (; cls > 6; cls -= 6)\n                    w(8304);\n                if (cls > 2)\n                    w(((cls - 3) << 5) | 8208), cls = 0;\n            }\n            while (cls--)\n                w(cln);\n            cls = 1;\n            cln = c[i];\n        }\n    }\n    return { c: cl.subarray(0, cli), n: s };\n};\n// calculate the length of output from tree, code lengths\nvar clen = function (cf, cl) {\n    var l = 0;\n    for (var i = 0; i < cl.length; ++i)\n        l += cf[i] * cl[i];\n    return l;\n};\n// writes a fixed block\n// returns the new bit pos\nvar wfblk = function (out, pos, dat) {\n    // no need to write 00 as type: TypedArray defaults to 0\n    var s = dat.length;\n    var o = shft(pos + 2);\n    out[o] = s & 255;\n    out[o + 1] = s >> 8;\n    out[o + 2] = out[o] ^ 255;\n    out[o + 3] = out[o + 1] ^ 255;\n    for (var i = 0; i < s; ++i)\n        out[o + i + 4] = dat[i];\n    return (o + 4 + s) * 8;\n};\n// writes a block\nvar wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {\n    wbits(out, p++, final);\n    ++lf[256];\n    var _a = hTree(lf, 15), dlt = _a.t, mlb = _a.l;\n    var _b = hTree(df, 15), ddt = _b.t, mdb = _b.l;\n    var _c = lc(dlt), lclt = _c.c, nlc = _c.n;\n    var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;\n    var lcfreq = new u16(19);\n    for (var i = 0; i < lclt.length; ++i)\n        ++lcfreq[lclt[i] & 31];\n    for (var i = 0; i < lcdt.length; ++i)\n        ++lcfreq[lcdt[i] & 31];\n    var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;\n    var nlcc = 19;\n    for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)\n        ;\n    var flen = (bl + 5) << 3;\n    var ftlen = clen(lf, flt) + clen(df, fdt) + eb;\n    var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];\n    if (bs >= 0 && flen <= ftlen && flen <= dtlen)\n        return wfblk(out, p, dat.subarray(bs, bs + bl));\n    var lm, ll, dm, dl;\n    wbits(out, p, 1 + (dtlen < ftlen)), p += 2;\n    if (dtlen < ftlen) {\n        lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;\n        var llm = hMap(lct, mlcb, 0);\n        wbits(out, p, nlc - 257);\n        wbits(out, p + 5, ndc - 1);\n        wbits(out, p + 10, nlcc - 4);\n        p += 14;\n        for (var i = 0; i < nlcc; ++i)\n            wbits(out, p + 3 * i, lct[clim[i]]);\n        p += 3 * nlcc;\n        var lcts = [lclt, lcdt];\n        for (var it = 0; it < 2; ++it) {\n            var clct = lcts[it];\n            for (var i = 0; i < clct.length; ++i) {\n                var len = clct[i] & 31;\n                wbits(out, p, llm[len]), p += lct[len];\n                if (len > 15)\n                    wbits(out, p, (clct[i] >> 5) & 127), p += clct[i] >> 12;\n            }\n        }\n    }\n    else {\n        lm = flm, ll = flt, dm = fdm, dl = fdt;\n    }\n    for (var i = 0; i < li; ++i) {\n        var sym = syms[i];\n        if (sym > 255) {\n            var len = (sym >> 18) & 31;\n            wbits16(out, p, lm[len + 257]), p += ll[len + 257];\n            if (len > 7)\n                wbits(out, p, (sym >> 23) & 31), p += fleb[len];\n            var dst = sym & 31;\n            wbits16(out, p, dm[dst]), p += dl[dst];\n            if (dst > 3)\n                wbits16(out, p, (sym >> 5) & 8191), p += fdeb[dst];\n        }\n        else {\n            wbits16(out, p, lm[sym]), p += ll[sym];\n        }\n    }\n    wbits16(out, p, lm[256]);\n    return p + ll[256];\n};\n// deflate options (nice << 13) | chain\nvar deo = /*#__PURE__*/ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);\n// empty\nvar et = /*#__PURE__*/ new u8(0);\n// compresses data into a raw DEFLATE buffer\nvar dflt = function (dat, lvl, plvl, pre, post, st) {\n    var s = st.z || dat.length;\n    var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);\n    // writing to this writes to the output buffer\n    var w = o.subarray(pre, o.length - post);\n    var lst = st.l;\n    var pos = (st.r || 0) & 7;\n    if (lvl) {\n        if (pos)\n            w[0] = st.r >> 3;\n        var opt = deo[lvl - 1];\n        var n = opt >> 13, c = opt & 8191;\n        var msk_1 = (1 << plvl) - 1;\n        //    prev 2-byte val map    curr 2-byte val map\n        var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);\n        var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;\n        var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };\n        // 24576 is an arbitrary number of maximum symbols per block\n        // 424 buffer for last block\n        var syms = new i32(25000);\n        // length/literal freq   distance freq\n        var lf = new u16(288), df = new u16(32);\n        //  l/lcnt  exbits  index          l/lind  waitdx          blkpos\n        var lc_1 = 0, eb = 0, i = st.i || 0, li = 0, wi = st.w || 0, bs = 0;\n        for (; i + 2 < s; ++i) {\n            // hash value\n            var hv = hsh(i);\n            // index mod 32768    previous index mod\n            var imod = i & 32767, pimod = head[hv];\n            prev[imod] = pimod;\n            head[hv] = imod;\n            // We always should modify head and prev, but only add symbols if\n            // this data is not yet processed (\"wait\" for wait index)\n            if (wi <= i) {\n                // bytes remaining\n                var rem = s - i;\n                if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {\n                    pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);\n                    li = lc_1 = eb = 0, bs = i;\n                    for (var j = 0; j < 286; ++j)\n                        lf[j] = 0;\n                    for (var j = 0; j < 30; ++j)\n                        df[j] = 0;\n                }\n                //  len    dist   chain\n                var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;\n                if (rem > 2 && hv == hsh(i - dif)) {\n                    var maxn = Math.min(n, rem) - 1;\n                    var maxd = Math.min(32767, i);\n                    // max possible length\n                    // not capped at dif because decompressors implement \"rolling\" index population\n                    var ml = Math.min(258, rem);\n                    while (dif <= maxd && --ch_1 && imod != pimod) {\n                        if (dat[i + l] == dat[i + l - dif]) {\n                            var nl = 0;\n                            for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)\n                                ;\n                            if (nl > l) {\n                                l = nl, d = dif;\n                                // break out early when we reach \"nice\" (we are satisfied enough)\n                                if (nl > maxn)\n                                    break;\n                                // now, find the rarest 2-byte sequence within this\n                                // length of literals and search for that instead.\n                                // Much faster than just using the start\n                                var mmd = Math.min(dif, nl - 2);\n                                var md = 0;\n                                for (var j = 0; j < mmd; ++j) {\n                                    var ti = i - dif + j & 32767;\n                                    var pti = prev[ti];\n                                    var cd = ti - pti & 32767;\n                                    if (cd > md)\n                                        md = cd, pimod = ti;\n                                }\n                            }\n                        }\n                        // check the previous match\n                        imod = pimod, pimod = prev[imod];\n                        dif += imod - pimod & 32767;\n                    }\n                }\n                // d will be nonzero only when a match was found\n                if (d) {\n                    // store both dist and len data in one int32\n                    // Make sure this is recognized as a len/dist with 28th bit (2^28)\n                    syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];\n                    var lin = revfl[l] & 31, din = revfd[d] & 31;\n                    eb += fleb[lin] + fdeb[din];\n                    ++lf[257 + lin];\n                    ++df[din];\n                    wi = i + l;\n                    ++lc_1;\n                }\n                else {\n                    syms[li++] = dat[i];\n                    ++lf[dat[i]];\n                }\n            }\n        }\n        for (i = Math.max(i, wi); i < s; ++i) {\n            syms[li++] = dat[i];\n            ++lf[dat[i]];\n        }\n        pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);\n        if (!lst) {\n            st.r = (pos & 7) | w[(pos / 8) | 0] << 3;\n            // shft(pos) now 1 less if pos & 7 != 0\n            pos -= 7;\n            st.h = head, st.p = prev, st.i = i, st.w = wi;\n        }\n    }\n    else {\n        for (var i = st.w || 0; i < s + lst; i += 65535) {\n            // end\n            var e = i + 65535;\n            if (e >= s) {\n                // write final block\n                w[(pos / 8) | 0] = lst;\n                e = s;\n            }\n            pos = wfblk(w, pos + 1, dat.subarray(i, e));\n        }\n        st.i = s;\n    }\n    return slc(o, 0, pre + shft(pos) + post);\n};\n// CRC32 table\nvar crct = /*#__PURE__*/ (function () {\n    var t = new Int32Array(256);\n    for (var i = 0; i < 256; ++i) {\n        var c = i, k = 9;\n        while (--k)\n            c = ((c & 1) && -306674912) ^ (c >>> 1);\n        t[i] = c;\n    }\n    return t;\n})();\n// CRC32\nvar crc = function () {\n    var c = -1;\n    return {\n        p: function (d) {\n            // closures have awful performance\n            var cr = c;\n            for (var i = 0; i < d.length; ++i)\n                cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);\n            c = cr;\n        },\n        d: function () { return ~c; }\n    };\n};\n// Adler32\nvar adler = function () {\n    var a = 1, b = 0;\n    return {\n        p: function (d) {\n            // closures have awful performance\n            var n = a, m = b;\n            var l = d.length | 0;\n            for (var i = 0; i != l;) {\n                var e = Math.min(i + 2655, l);\n                for (; i < e; ++i)\n                    m += n += d[i];\n                n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);\n            }\n            a = n, b = m;\n        },\n        d: function () {\n            a %= 65521, b %= 65521;\n            return (a & 255) << 24 | (a & 0xFF00) << 8 | (b & 255) << 8 | (b >> 8);\n        }\n    };\n};\n;\n// deflate with opts\nvar dopt = function (dat, opt, pre, post, st) {\n    if (!st) {\n        st = { l: 1 };\n        if (opt.dictionary) {\n            var dict = opt.dictionary.subarray(-32768);\n            var newDat = new u8(dict.length + dat.length);\n            newDat.set(dict);\n            newDat.set(dat, dict.length);\n            dat = newDat;\n            st.w = dict.length;\n        }\n    }\n    return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? (st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20) : (12 + opt.mem), pre, post, st);\n};\n// Walmart object spread\nvar mrg = function (a, b) {\n    var o = {};\n    for (var k in a)\n        o[k] = a[k];\n    for (var k in b)\n        o[k] = b[k];\n    return o;\n};\n// worker clone\n// This is possibly the craziest part of the entire codebase, despite how simple it may seem.\n// The only parameter to this function is a closure that returns an array of variables outside of the function scope.\n// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.\n// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).\n// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.\n// This took me three weeks to figure out how to do.\nvar wcln = function (fn, fnStr, td) {\n    var dt = fn();\n    var st = fn.toString();\n    var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/\\s+/g, '').split(',');\n    for (var i = 0; i < dt.length; ++i) {\n        var v = dt[i], k = ks[i];\n        if (typeof v == 'function') {\n            fnStr += ';' + k + '=';\n            var st_1 = v.toString();\n            if (v.prototype) {\n                // for global objects\n                if (st_1.indexOf('[native code]') != -1) {\n                    var spInd = st_1.indexOf(' ', 8) + 1;\n                    fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));\n                }\n                else {\n                    fnStr += st_1;\n                    for (var t in v.prototype)\n                        fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();\n                }\n            }\n            else\n                fnStr += st_1;\n        }\n        else\n            td[k] = v;\n    }\n    return fnStr;\n};\nvar ch = [];\n// clone bufs\nvar cbfs = function (v) {\n    var tl = [];\n    for (var k in v) {\n        if (v[k].buffer) {\n            tl.push((v[k] = new v[k].constructor(v[k])).buffer);\n        }\n    }\n    return tl;\n};\n// use a worker to execute code\nvar wrkr = function (fns, init, id, cb) {\n    if (!ch[id]) {\n        var fnStr = '', td_1 = {}, m = fns.length - 1;\n        for (var i = 0; i < m; ++i)\n            fnStr = wcln(fns[i], fnStr, td_1);\n        ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };\n    }\n    var td = mrg({}, ch[id].e);\n    return wk(ch[id].c + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);\n};\n// base async inflate fn\nvar bInflt = function () { return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt]; };\nvar bDflt = function () { return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };\n// gzip extra\nvar gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };\n// gunzip extra\nvar guze = function () { return [gzs, gzl]; };\n// zlib extra\nvar zle = function () { return [zlh, wbytes, adler]; };\n// unzlib extra\nvar zule = function () { return [zls]; };\n// post buf\nvar pbf = function (msg) { return postMessage(msg, [msg.buffer]); };\n// get opts\nvar gopt = function (o) { return o && {\n    out: o.size && new u8(o.size),\n    dictionary: o.dictionary\n}; };\n// async helper\nvar cbify = function (dat, opts, fns, init, id, cb) {\n    var w = wrkr(fns, init, id, function (err, dat) {\n        w.terminate();\n        cb(err, dat);\n    });\n    w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);\n    return function () { w.terminate(); };\n};\n// auto stream\nvar astrm = function (strm) {\n    strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };\n    return function (ev) {\n        if (ev.data.length) {\n            strm.push(ev.data[0], ev.data[1]);\n            postMessage([ev.data[0].length]);\n        }\n        else\n            strm.flush();\n    };\n};\n// async stream attach\nvar astrmify = function (fns, strm, opts, init, id, flush, ext) {\n    var t;\n    var w = wrkr(fns, init, id, function (err, dat) {\n        if (err)\n            w.terminate(), strm.ondata.call(strm, err);\n        else if (!Array.isArray(dat))\n            ext(dat);\n        else if (dat.length == 1) {\n            strm.queuedSize -= dat[0];\n            if (strm.ondrain)\n                strm.ondrain(dat[0]);\n        }\n        else {\n            if (dat[1])\n                w.terminate();\n            strm.ondata.call(strm, err, dat[0], dat[1]);\n        }\n    });\n    w.postMessage(opts);\n    strm.queuedSize = 0;\n    strm.push = function (d, f) {\n        if (!strm.ondata)\n            err(5);\n        if (t)\n            strm.ondata(err(4, 0, 1), null, !!f);\n        strm.queuedSize += d.length;\n        w.postMessage([d, t = f], [d.buffer]);\n    };\n    strm.terminate = function () { w.terminate(); };\n    if (flush) {\n        strm.flush = function () { w.postMessage([]); };\n    }\n};\n// read 2 bytes\nvar b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };\n// read 4 bytes\nvar b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };\nvar b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };\n// write bytes\nvar wbytes = function (d, b, v) {\n    for (; v; ++b)\n        d[b] = v, v >>>= 8;\n};\n// gzip header\nvar gzh = function (c, o) {\n    var fn = o.filename;\n    c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix\n    if (o.mtime != 0)\n        wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));\n    if (fn) {\n        c[3] = 8;\n        for (var i = 0; i <= fn.length; ++i)\n            c[i + 10] = fn.charCodeAt(i);\n    }\n};\n// gzip footer: -8 to -4 = CRC, -4 to -0 is length\n// gzip start\nvar gzs = function (d) {\n    if (d[0] != 31 || d[1] != 139 || d[2] != 8)\n        err(6, 'invalid gzip data');\n    var flg = d[3];\n    var st = 10;\n    if (flg & 4)\n        st += (d[10] | d[11] << 8) + 2;\n    for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])\n        ;\n    return st + (flg & 2);\n};\n// gzip length\nvar gzl = function (d) {\n    var l = d.length;\n    return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;\n};\n// gzip header length\nvar gzhl = function (o) { return 10 + (o.filename ? o.filename.length + 1 : 0); };\n// zlib header\nvar zlh = function (c, o) {\n    var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;\n    c[0] = 120, c[1] = (fl << 6) | (o.dictionary && 32);\n    c[1] |= 31 - ((c[0] << 8) | c[1]) % 31;\n    if (o.dictionary) {\n        var h = adler();\n        h.p(o.dictionary);\n        wbytes(c, 2, h.d());\n    }\n};\n// zlib start\nvar zls = function (d, dict) {\n    if ((d[0] & 15) != 8 || (d[0] >> 4) > 7 || ((d[0] << 8 | d[1]) % 31))\n        err(6, 'invalid zlib data');\n    if ((d[1] >> 5 & 1) == +!dict)\n        err(6, 'invalid zlib data: ' + (d[1] & 32 ? 'need' : 'unexpected') + ' dictionary');\n    return (d[1] >> 3 & 4) + 2;\n};\nfunction StrmOpt(opts, cb) {\n    if (typeof opts == 'function')\n        cb = opts, opts = {};\n    this.ondata = cb;\n    return opts;\n}\n/**\n * Streaming DEFLATE compression\n */\nvar Deflate = /*#__PURE__*/ (function () {\n    function Deflate(opts, cb) {\n        if (typeof opts == 'function')\n            cb = opts, opts = {};\n        this.ondata = cb;\n        this.o = opts || {};\n        this.s = { l: 0, i: 32768, w: 32768, z: 32768 };\n        // Buffer length must always be 0 mod 32768 for index calculations to be correct when modifying head and prev\n        // 98304 = 32768 (lookback) + 65536 (common chunk size)\n        this.b = new u8(98304);\n        if (this.o.dictionary) {\n            var dict = this.o.dictionary.subarray(-32768);\n            this.b.set(dict, 32768 - dict.length);\n            this.s.i = 32768 - dict.length;\n        }\n    }\n    Deflate.prototype.p = function (c, f) {\n        this.ondata(dopt(c, this.o, 0, 0, this.s), f);\n    };\n    /**\n     * Pushes a chunk to be deflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Deflate.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            err(5);\n        if (this.s.l)\n            err(4);\n        var endLen = chunk.length + this.s.z;\n        if (endLen > this.b.length) {\n            if (endLen > 2 * this.b.length - 32768) {\n                var newBuf = new u8(endLen & -32768);\n                newBuf.set(this.b.subarray(0, this.s.z));\n                this.b = newBuf;\n            }\n            var split = this.b.length - this.s.z;\n            this.b.set(chunk.subarray(0, split), this.s.z);\n            this.s.z = this.b.length;\n            this.p(this.b, false);\n            this.b.set(this.b.subarray(-32768));\n            this.b.set(chunk.subarray(split), 32768);\n            this.s.z = chunk.length - split + 32768;\n            this.s.i = 32766, this.s.w = 32768;\n        }\n        else {\n            this.b.set(chunk, this.s.z);\n            this.s.z += chunk.length;\n        }\n        this.s.l = final & 1;\n        if (this.s.z > this.s.w + 8191 || final) {\n            this.p(this.b, final || false);\n            this.s.w = this.s.i, this.s.i -= 2;\n        }\n    };\n    /**\n     * Flushes buffered uncompressed data. Useful to immediately retrieve the\n     * deflated output for small inputs.\n     */\n    Deflate.prototype.flush = function () {\n        if (!this.ondata)\n            err(5);\n        if (this.s.l)\n            err(4);\n        this.p(this.b, false);\n        this.s.w = this.s.i, this.s.i -= 2;\n    };\n    return Deflate;\n}());\nexport { Deflate };\n/**\n * Asynchronous streaming DEFLATE compression\n */\nvar AsyncDeflate = /*#__PURE__*/ (function () {\n    function AsyncDeflate(opts, cb) {\n        astrmify([\n            bDflt,\n            function () { return [astrm, Deflate]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Deflate(ev.data);\n            onmessage = astrm(strm);\n        }, 6, 1);\n    }\n    return AsyncDeflate;\n}());\nexport { AsyncDeflate };\nexport function deflate(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bDflt,\n    ], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);\n}\n/**\n * Compresses data with DEFLATE without any wrapper\n * @param data The data to compress\n * @param opts The compression options\n * @returns The deflated version of the data\n */\nexport function deflateSync(data, opts) {\n    return dopt(data, opts || {}, 0, 0);\n}\n/**\n * Streaming DEFLATE decompression\n */\nvar Inflate = /*#__PURE__*/ (function () {\n    function Inflate(opts, cb) {\n        // no StrmOpt here to avoid adding to workerizer\n        if (typeof opts == 'function')\n            cb = opts, opts = {};\n        this.ondata = cb;\n        var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);\n        this.s = { i: 0, b: dict ? dict.length : 0 };\n        this.o = new u8(32768);\n        this.p = new u8(0);\n        if (dict)\n            this.o.set(dict);\n    }\n    Inflate.prototype.e = function (c) {\n        if (!this.ondata)\n            err(5);\n        if (this.d)\n            err(4);\n        if (!this.p.length)\n            this.p = c;\n        else if (c.length) {\n            var n = new u8(this.p.length + c.length);\n            n.set(this.p), n.set(c, this.p.length), this.p = n;\n        }\n    };\n    Inflate.prototype.c = function (final) {\n        this.s.i = +(this.d = final || false);\n        var bts = this.s.b;\n        var dt = inflt(this.p, this.s, this.o);\n        this.ondata(slc(dt, bts, this.s.b), this.d);\n        this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;\n        this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;\n    };\n    /**\n     * Pushes a chunk to be inflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the final chunk\n     */\n    Inflate.prototype.push = function (chunk, final) {\n        this.e(chunk), this.c(final);\n    };\n    return Inflate;\n}());\nexport { Inflate };\n/**\n * Asynchronous streaming DEFLATE decompression\n */\nvar AsyncInflate = /*#__PURE__*/ (function () {\n    function AsyncInflate(opts, cb) {\n        astrmify([\n            bInflt,\n            function () { return [astrm, Inflate]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Inflate(ev.data);\n            onmessage = astrm(strm);\n        }, 7, 0);\n    }\n    return AsyncInflate;\n}());\nexport { AsyncInflate };\nexport function inflate(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bInflt\n    ], function (ev) { return pbf(inflateSync(ev.data[0], gopt(ev.data[1]))); }, 1, cb);\n}\n/**\n * Expands DEFLATE data with no wrapper\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function inflateSync(data, opts) {\n    return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.\n/**\n * Streaming GZIP compression\n */\nvar Gzip = /*#__PURE__*/ (function () {\n    function Gzip(opts, cb) {\n        this.c = crc();\n        this.l = 0;\n        this.v = 1;\n        Deflate.call(this, opts, cb);\n    }\n    /**\n     * Pushes a chunk to be GZIPped\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Gzip.prototype.push = function (chunk, final) {\n        this.c.p(chunk);\n        this.l += chunk.length;\n        Deflate.prototype.push.call(this, chunk, final);\n    };\n    Gzip.prototype.p = function (c, f) {\n        var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);\n        if (this.v)\n            gzh(raw, this.o), this.v = 0;\n        if (f)\n            wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);\n        this.ondata(raw, f);\n    };\n    /**\n     * Flushes buffered uncompressed data. Useful to immediately retrieve the\n     * GZIPped output for small inputs.\n     */\n    Gzip.prototype.flush = function () {\n        Deflate.prototype.flush.call(this);\n    };\n    return Gzip;\n}());\nexport { Gzip };\n/**\n * Asynchronous streaming GZIP compression\n */\nvar AsyncGzip = /*#__PURE__*/ (function () {\n    function AsyncGzip(opts, cb) {\n        astrmify([\n            bDflt,\n            gze,\n            function () { return [astrm, Deflate, Gzip]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Gzip(ev.data);\n            onmessage = astrm(strm);\n        }, 8, 1);\n    }\n    return AsyncGzip;\n}());\nexport { AsyncGzip };\nexport function gzip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bDflt,\n        gze,\n        function () { return [gzipSync]; }\n    ], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);\n}\n/**\n * Compresses data with GZIP\n * @param data The data to compress\n * @param opts The compression options\n * @returns The gzipped version of the data\n */\nexport function gzipSync(data, opts) {\n    if (!opts)\n        opts = {};\n    var c = crc(), l = data.length;\n    c.p(data);\n    var d = dopt(data, opts, gzhl(opts), 8), s = d.length;\n    return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;\n}\n/**\n * Streaming single or multi-member GZIP decompression\n */\nvar Gunzip = /*#__PURE__*/ (function () {\n    function Gunzip(opts, cb) {\n        this.v = 1;\n        this.r = 0;\n        Inflate.call(this, opts, cb);\n    }\n    /**\n     * Pushes a chunk to be GUNZIPped\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Gunzip.prototype.push = function (chunk, final) {\n        Inflate.prototype.e.call(this, chunk);\n        this.r += chunk.length;\n        if (this.v) {\n            var p = this.p.subarray(this.v - 1);\n            var s = p.length > 3 ? gzs(p) : 4;\n            if (s > p.length) {\n                if (!final)\n                    return;\n            }\n            else if (this.v > 1 && this.onmember) {\n                this.onmember(this.r - p.length);\n            }\n            this.p = p.subarray(s), this.v = 0;\n        }\n        // necessary to prevent TS from using the closure value\n        // This allows for workerization to function correctly\n        Inflate.prototype.c.call(this, final);\n        // process concatenated GZIP\n        if (this.s.f && !this.s.l && !final) {\n            this.v = shft(this.s.p) + 9;\n            this.s = { i: 0 };\n            this.o = new u8(0);\n            this.push(new u8(0), final);\n        }\n    };\n    return Gunzip;\n}());\nexport { Gunzip };\n/**\n * Asynchronous streaming single or multi-member GZIP decompression\n */\nvar AsyncGunzip = /*#__PURE__*/ (function () {\n    function AsyncGunzip(opts, cb) {\n        var _this = this;\n        astrmify([\n            bInflt,\n            guze,\n            function () { return [astrm, Inflate, Gunzip]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Gunzip(ev.data);\n            strm.onmember = function (offset) { return postMessage(offset); };\n            onmessage = astrm(strm);\n        }, 9, 0, function (offset) { return _this.onmember && _this.onmember(offset); });\n    }\n    return AsyncGunzip;\n}());\nexport { AsyncGunzip };\nexport function gunzip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bInflt,\n        guze,\n        function () { return [gunzipSync]; }\n    ], function (ev) { return pbf(gunzipSync(ev.data[0], ev.data[1])); }, 3, cb);\n}\n/**\n * Expands GZIP data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function gunzipSync(data, opts) {\n    var st = gzs(data);\n    if (st + 8 > data.length)\n        err(6, 'invalid gzip data');\n    return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);\n}\n/**\n * Streaming Zlib compression\n */\nvar Zlib = /*#__PURE__*/ (function () {\n    function Zlib(opts, cb) {\n        this.c = adler();\n        this.v = 1;\n        Deflate.call(this, opts, cb);\n    }\n    /**\n     * Pushes a chunk to be zlibbed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Zlib.prototype.push = function (chunk, final) {\n        this.c.p(chunk);\n        Deflate.prototype.push.call(this, chunk, final);\n    };\n    Zlib.prototype.p = function (c, f) {\n        var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);\n        if (this.v)\n            zlh(raw, this.o), this.v = 0;\n        if (f)\n            wbytes(raw, raw.length - 4, this.c.d());\n        this.ondata(raw, f);\n    };\n    /**\n     * Flushes buffered uncompressed data. Useful to immediately retrieve the\n     * zlibbed output for small inputs.\n     */\n    Zlib.prototype.flush = function () {\n        Deflate.prototype.flush.call(this);\n    };\n    return Zlib;\n}());\nexport { Zlib };\n/**\n * Asynchronous streaming Zlib compression\n */\nvar AsyncZlib = /*#__PURE__*/ (function () {\n    function AsyncZlib(opts, cb) {\n        astrmify([\n            bDflt,\n            zle,\n            function () { return [astrm, Deflate, Zlib]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Zlib(ev.data);\n            onmessage = astrm(strm);\n        }, 10, 1);\n    }\n    return AsyncZlib;\n}());\nexport { AsyncZlib };\nexport function zlib(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bDflt,\n        zle,\n        function () { return [zlibSync]; }\n    ], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);\n}\n/**\n * Compress data with Zlib\n * @param data The data to compress\n * @param opts The compression options\n * @returns The zlib-compressed version of the data\n */\nexport function zlibSync(data, opts) {\n    if (!opts)\n        opts = {};\n    var a = adler();\n    a.p(data);\n    var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);\n    return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;\n}\n/**\n * Streaming Zlib decompression\n */\nvar Unzlib = /*#__PURE__*/ (function () {\n    function Unzlib(opts, cb) {\n        Inflate.call(this, opts, cb);\n        this.v = opts && opts.dictionary ? 2 : 1;\n    }\n    /**\n     * Pushes a chunk to be unzlibbed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Unzlib.prototype.push = function (chunk, final) {\n        Inflate.prototype.e.call(this, chunk);\n        if (this.v) {\n            if (this.p.length < 6 && !final)\n                return;\n            this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;\n        }\n        if (final) {\n            if (this.p.length < 4)\n                err(6, 'invalid zlib data');\n            this.p = this.p.subarray(0, -4);\n        }\n        // necessary to prevent TS from using the closure value\n        // This allows for workerization to function correctly\n        Inflate.prototype.c.call(this, final);\n    };\n    return Unzlib;\n}());\nexport { Unzlib };\n/**\n * Asynchronous streaming Zlib decompression\n */\nvar AsyncUnzlib = /*#__PURE__*/ (function () {\n    function AsyncUnzlib(opts, cb) {\n        astrmify([\n            bInflt,\n            zule,\n            function () { return [astrm, Inflate, Unzlib]; }\n        ], this, StrmOpt.call(this, opts, cb), function (ev) {\n            var strm = new Unzlib(ev.data);\n            onmessage = astrm(strm);\n        }, 11, 0);\n    }\n    return AsyncUnzlib;\n}());\nexport { AsyncUnzlib };\nexport function unzlib(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return cbify(data, opts, [\n        bInflt,\n        zule,\n        function () { return [unzlibSync]; }\n    ], function (ev) { return pbf(unzlibSync(ev.data[0], gopt(ev.data[1]))); }, 5, cb);\n}\n/**\n * Expands Zlib data\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function unzlibSync(data, opts) {\n    return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);\n}\n// Default algorithm for compression (used because having a known output size allows faster decompression)\nexport { gzip as compress, AsyncGzip as AsyncCompress };\nexport { gzipSync as compressSync, Gzip as Compress };\n/**\n * Streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar Decompress = /*#__PURE__*/ (function () {\n    function Decompress(opts, cb) {\n        this.o = StrmOpt.call(this, opts, cb) || {};\n        this.G = Gunzip;\n        this.I = Inflate;\n        this.Z = Unzlib;\n    }\n    // init substream\n    // overriden by AsyncDecompress\n    Decompress.prototype.i = function () {\n        var _this = this;\n        this.s.ondata = function (dat, final) {\n            _this.ondata(dat, final);\n        };\n    };\n    /**\n     * Pushes a chunk to be decompressed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Decompress.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            err(5);\n        if (!this.s) {\n            if (this.p && this.p.length) {\n                var n = new u8(this.p.length + chunk.length);\n                n.set(this.p), n.set(chunk, this.p.length);\n            }\n            else\n                this.p = chunk;\n            if (this.p.length > 2) {\n                this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)\n                    ? new this.G(this.o)\n                    : ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))\n                        ? new this.I(this.o)\n                        : new this.Z(this.o);\n                this.i();\n                this.s.push(this.p, final);\n                this.p = null;\n            }\n        }\n        else\n            this.s.push(chunk, final);\n    };\n    return Decompress;\n}());\nexport { Decompress };\n/**\n * Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression\n */\nvar AsyncDecompress = /*#__PURE__*/ (function () {\n    function AsyncDecompress(opts, cb) {\n        Decompress.call(this, opts, cb);\n        this.queuedSize = 0;\n        this.G = AsyncGunzip;\n        this.I = AsyncInflate;\n        this.Z = AsyncUnzlib;\n    }\n    AsyncDecompress.prototype.i = function () {\n        var _this = this;\n        this.s.ondata = function (err, dat, final) {\n            _this.ondata(err, dat, final);\n        };\n        this.s.ondrain = function (size) {\n            _this.queuedSize -= size;\n            if (_this.ondrain)\n                _this.ondrain(size);\n        };\n    };\n    /**\n     * Pushes a chunk to be decompressed\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    AsyncDecompress.prototype.push = function (chunk, final) {\n        this.queuedSize += chunk.length;\n        Decompress.prototype.push.call(this, chunk, final);\n    };\n    return AsyncDecompress;\n}());\nexport { AsyncDecompress };\nexport function decompress(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n        ? gunzip(data, opts, cb)\n        : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n            ? inflate(data, opts, cb)\n            : unzlib(data, opts, cb);\n}\n/**\n * Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format\n * @param data The data to decompress\n * @param opts The decompression options\n * @returns The decompressed version of the data\n */\nexport function decompressSync(data, opts) {\n    return (data[0] == 31 && data[1] == 139 && data[2] == 8)\n        ? gunzipSync(data, opts)\n        : ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))\n            ? inflateSync(data, opts)\n            : unzlibSync(data, opts);\n}\n// flatten a directory structure\nvar fltn = function (d, p, t, o) {\n    for (var k in d) {\n        var val = d[k], n = p + k, op = o;\n        if (Array.isArray(val))\n            op = mrg(o, val[1]), val = val[0];\n        if (val instanceof u8)\n            t[n] = [val, op];\n        else {\n            t[n += '/'] = [new u8(0), op];\n            fltn(val, n, t, o);\n        }\n    }\n};\n// text encoder\nvar te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();\n// text decoder\nvar td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();\n// text decoder stream\nvar tds = 0;\ntry {\n    td.decode(et, { stream: true });\n    tds = 1;\n}\ncatch (e) { }\n// decode UTF8\nvar dutf8 = function (d) {\n    for (var r = '', i = 0;;) {\n        var c = d[i++];\n        var eb = (c > 127) + (c > 223) + (c > 239);\n        if (i + eb > d.length)\n            return { s: r, r: slc(d, i - 1) };\n        if (!eb)\n            r += String.fromCharCode(c);\n        else if (eb == 3) {\n            c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,\n                r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));\n        }\n        else if (eb & 1)\n            r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));\n        else\n            r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));\n    }\n};\n/**\n * Streaming UTF-8 decoding\n */\nvar DecodeUTF8 = /*#__PURE__*/ (function () {\n    /**\n     * Creates a UTF-8 decoding stream\n     * @param cb The callback to call whenever data is decoded\n     */\n    function DecodeUTF8(cb) {\n        this.ondata = cb;\n        if (tds)\n            this.t = new TextDecoder();\n        else\n            this.p = et;\n    }\n    /**\n     * Pushes a chunk to be decoded from UTF-8 binary\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    DecodeUTF8.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            err(5);\n        final = !!final;\n        if (this.t) {\n            this.ondata(this.t.decode(chunk, { stream: true }), final);\n            if (final) {\n                if (this.t.decode().length)\n                    err(8);\n                this.t = null;\n            }\n            return;\n        }\n        if (!this.p)\n            err(4);\n        var dat = new u8(this.p.length + chunk.length);\n        dat.set(this.p);\n        dat.set(chunk, this.p.length);\n        var _a = dutf8(dat), s = _a.s, r = _a.r;\n        if (final) {\n            if (r.length)\n                err(8);\n            this.p = null;\n        }\n        else\n            this.p = r;\n        this.ondata(s, final);\n    };\n    return DecodeUTF8;\n}());\nexport { DecodeUTF8 };\n/**\n * Streaming UTF-8 encoding\n */\nvar EncodeUTF8 = /*#__PURE__*/ (function () {\n    /**\n     * Creates a UTF-8 decoding stream\n     * @param cb The callback to call whenever data is encoded\n     */\n    function EncodeUTF8(cb) {\n        this.ondata = cb;\n    }\n    /**\n     * Pushes a chunk to be encoded to UTF-8\n     * @param chunk The string data to push\n     * @param final Whether this is the last chunk\n     */\n    EncodeUTF8.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            err(5);\n        if (this.d)\n            err(4);\n        this.ondata(strToU8(chunk), this.d = final || false);\n    };\n    return EncodeUTF8;\n}());\nexport { EncodeUTF8 };\n/**\n * Converts a string into a Uint8Array for use with compression/decompression methods\n * @param str The string to encode\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n *               not need to be true unless decoding a binary string.\n * @returns The string encoded in UTF-8/Latin-1 binary\n */\nexport function strToU8(str, latin1) {\n    if (latin1) {\n        var ar_1 = new u8(str.length);\n        for (var i = 0; i < str.length; ++i)\n            ar_1[i] = str.charCodeAt(i);\n        return ar_1;\n    }\n    if (te)\n        return te.encode(str);\n    var l = str.length;\n    var ar = new u8(str.length + (str.length >> 1));\n    var ai = 0;\n    var w = function (v) { ar[ai++] = v; };\n    for (var i = 0; i < l; ++i) {\n        if (ai + 5 > ar.length) {\n            var n = new u8(ai + 8 + ((l - i) << 1));\n            n.set(ar);\n            ar = n;\n        }\n        var c = str.charCodeAt(i);\n        if (c < 128 || latin1)\n            w(c);\n        else if (c < 2048)\n            w(192 | (c >> 6)), w(128 | (c & 63));\n        else if (c > 55295 && c < 57344)\n            c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),\n                w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n        else\n            w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));\n    }\n    return slc(ar, 0, ai);\n}\n/**\n * Converts a Uint8Array to a string\n * @param dat The data to decode to string\n * @param latin1 Whether or not to interpret the data as Latin-1. This should\n *               not need to be true unless encoding to binary string.\n * @returns The original UTF-8/Latin-1 string\n */\nexport function strFromU8(dat, latin1) {\n    if (latin1) {\n        var r = '';\n        for (var i = 0; i < dat.length; i += 16384)\n            r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));\n        return r;\n    }\n    else if (td) {\n        return td.decode(dat);\n    }\n    else {\n        var _a = dutf8(dat), s = _a.s, r = _a.r;\n        if (r.length)\n            err(8);\n        return s;\n    }\n}\n;\n// deflate bit flag\nvar dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };\n// skip local zip header\nvar slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };\n// read zip header\nvar zh = function (d, b, z) {\n    var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);\n    var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];\n    return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];\n};\n// read zip64 extra field\nvar z64e = function (d, b) {\n    for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))\n        ;\n    return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];\n};\n// extra field length\nvar exfl = function (ex) {\n    var le = 0;\n    if (ex) {\n        for (var k in ex) {\n            var l = ex[k].length;\n            if (l > 65535)\n                err(9);\n            le += l + 4;\n        }\n    }\n    return le;\n};\n// write zip header\nvar wzh = function (d, b, f, fn, u, c, ce, co) {\n    var fl = fn.length, ex = f.extra, col = co && co.length;\n    var exl = exfl(ex);\n    wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;\n    if (ce != null)\n        d[b++] = 20, d[b++] = f.os;\n    d[b] = 20, b += 2; // spec compliance? what's that?\n    d[b++] = (f.flag << 1) | (c < 0 && 8), d[b++] = u && 8;\n    d[b++] = f.compression & 255, d[b++] = f.compression >> 8;\n    var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;\n    if (y < 0 || y > 119)\n        err(10);\n    wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >> 1)), b += 4;\n    if (c != -1) {\n        wbytes(d, b, f.crc);\n        wbytes(d, b + 4, c < 0 ? -c - 2 : c);\n        wbytes(d, b + 8, f.size);\n    }\n    wbytes(d, b + 12, fl);\n    wbytes(d, b + 14, exl), b += 16;\n    if (ce != null) {\n        wbytes(d, b, col);\n        wbytes(d, b + 6, f.attrs);\n        wbytes(d, b + 10, ce), b += 14;\n    }\n    d.set(fn, b);\n    b += fl;\n    if (exl) {\n        for (var k in ex) {\n            var exf = ex[k], l = exf.length;\n            wbytes(d, b, +k);\n            wbytes(d, b + 2, l);\n            d.set(exf, b + 4), b += 4 + l;\n        }\n    }\n    if (col)\n        d.set(co, b), b += col;\n    return b;\n};\n// write zip footer (end of central directory)\nvar wzf = function (o, b, c, d, e) {\n    wbytes(o, b, 0x6054B50); // skip disk\n    wbytes(o, b + 8, c);\n    wbytes(o, b + 10, c);\n    wbytes(o, b + 12, d);\n    wbytes(o, b + 16, e);\n};\n/**\n * A pass-through stream to keep data uncompressed in a ZIP archive.\n */\nvar ZipPassThrough = /*#__PURE__*/ (function () {\n    /**\n     * Creates a pass-through stream that can be added to ZIP archives\n     * @param filename The filename to associate with this data stream\n     */\n    function ZipPassThrough(filename) {\n        this.filename = filename;\n        this.c = crc();\n        this.size = 0;\n        this.compression = 0;\n    }\n    /**\n     * Processes a chunk and pushes to the output stream. You can override this\n     * method in a subclass for custom behavior, but by default this passes\n     * the data through. You must call this.ondata(err, chunk, final) at some\n     * point in this method.\n     * @param chunk The chunk to process\n     * @param final Whether this is the last chunk\n     */\n    ZipPassThrough.prototype.process = function (chunk, final) {\n        this.ondata(null, chunk, final);\n    };\n    /**\n     * Pushes a chunk to be added. If you are subclassing this with a custom\n     * compression algorithm, note that you must push data from the source\n     * file only, pre-compression.\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    ZipPassThrough.prototype.push = function (chunk, final) {\n        if (!this.ondata)\n            err(5);\n        this.c.p(chunk);\n        this.size += chunk.length;\n        if (final)\n            this.crc = this.c.d();\n        this.process(chunk, final || false);\n    };\n    return ZipPassThrough;\n}());\nexport { ZipPassThrough };\n// I don't extend because TypeScript extension adds 1kB of runtime bloat\n/**\n * Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate\n * for better performance\n */\nvar ZipDeflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates a DEFLATE stream that can be added to ZIP archives\n     * @param filename The filename to associate with this data stream\n     * @param opts The compression options\n     */\n    function ZipDeflate(filename, opts) {\n        var _this = this;\n        if (!opts)\n            opts = {};\n        ZipPassThrough.call(this, filename);\n        this.d = new Deflate(opts, function (dat, final) {\n            _this.ondata(null, dat, final);\n        });\n        this.compression = 8;\n        this.flag = dbf(opts.level);\n    }\n    ZipDeflate.prototype.process = function (chunk, final) {\n        try {\n            this.d.push(chunk, final);\n        }\n        catch (e) {\n            this.ondata(e, null, final);\n        }\n    };\n    /**\n     * Pushes a chunk to be deflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    ZipDeflate.prototype.push = function (chunk, final) {\n        ZipPassThrough.prototype.push.call(this, chunk, final);\n    };\n    return ZipDeflate;\n}());\nexport { ZipDeflate };\n/**\n * Asynchronous streaming DEFLATE compression for ZIP archives\n */\nvar AsyncZipDeflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates an asynchronous DEFLATE stream that can be added to ZIP archives\n     * @param filename The filename to associate with this data stream\n     * @param opts The compression options\n     */\n    function AsyncZipDeflate(filename, opts) {\n        var _this = this;\n        if (!opts)\n            opts = {};\n        ZipPassThrough.call(this, filename);\n        this.d = new AsyncDeflate(opts, function (err, dat, final) {\n            _this.ondata(err, dat, final);\n        });\n        this.compression = 8;\n        this.flag = dbf(opts.level);\n        this.terminate = this.d.terminate;\n    }\n    AsyncZipDeflate.prototype.process = function (chunk, final) {\n        this.d.push(chunk, final);\n    };\n    /**\n     * Pushes a chunk to be deflated\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    AsyncZipDeflate.prototype.push = function (chunk, final) {\n        ZipPassThrough.prototype.push.call(this, chunk, final);\n    };\n    return AsyncZipDeflate;\n}());\nexport { AsyncZipDeflate };\n// TODO: Better tree shaking\n/**\n * A zippable archive to which files can incrementally be added\n */\nvar Zip = /*#__PURE__*/ (function () {\n    /**\n     * Creates an empty ZIP archive to which files can be added\n     * @param cb The callback to call whenever data for the generated ZIP archive\n     *           is available\n     */\n    function Zip(cb) {\n        this.ondata = cb;\n        this.u = [];\n        this.d = 1;\n    }\n    /**\n     * Adds a file to the ZIP archive\n     * @param file The file stream to add\n     */\n    Zip.prototype.add = function (file) {\n        var _this = this;\n        if (!this.ondata)\n            err(5);\n        // finishing or finished\n        if (this.d & 2)\n            this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);\n        else {\n            var f = strToU8(file.filename), fl_1 = f.length;\n            var com = file.comment, o = com && strToU8(com);\n            var u = fl_1 != file.filename.length || (o && (com.length != o.length));\n            var hl_1 = fl_1 + exfl(file.extra) + 30;\n            if (fl_1 > 65535)\n                this.ondata(err(11, 0, 1), null, false);\n            var header = new u8(hl_1);\n            wzh(header, 0, file, f, u, -1);\n            var chks_1 = [header];\n            var pAll_1 = function () {\n                for (var _i = 0, chks_2 = chks_1; _i < chks_2.length; _i++) {\n                    var chk = chks_2[_i];\n                    _this.ondata(null, chk, false);\n                }\n                chks_1 = [];\n            };\n            var tr_1 = this.d;\n            this.d = 0;\n            var ind_1 = this.u.length;\n            var uf_1 = mrg(file, {\n                f: f,\n                u: u,\n                o: o,\n                t: function () {\n                    if (file.terminate)\n                        file.terminate();\n                },\n                r: function () {\n                    pAll_1();\n                    if (tr_1) {\n                        var nxt = _this.u[ind_1 + 1];\n                        if (nxt)\n                            nxt.r();\n                        else\n                            _this.d = 1;\n                    }\n                    tr_1 = 1;\n                }\n            });\n            var cl_1 = 0;\n            file.ondata = function (err, dat, final) {\n                if (err) {\n                    _this.ondata(err, dat, final);\n                    _this.terminate();\n                }\n                else {\n                    cl_1 += dat.length;\n                    chks_1.push(dat);\n                    if (final) {\n                        var dd = new u8(16);\n                        wbytes(dd, 0, 0x8074B50);\n                        wbytes(dd, 4, file.crc);\n                        wbytes(dd, 8, cl_1);\n                        wbytes(dd, 12, file.size);\n                        chks_1.push(dd);\n                        uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;\n                        if (tr_1)\n                            uf_1.r();\n                        tr_1 = 1;\n                    }\n                    else if (tr_1)\n                        pAll_1();\n                }\n            };\n            this.u.push(uf_1);\n        }\n    };\n    /**\n     * Ends the process of adding files and prepares to emit the final chunks.\n     * This *must* be called after adding all desired files for the resulting\n     * ZIP file to work properly.\n     */\n    Zip.prototype.end = function () {\n        var _this = this;\n        if (this.d & 2) {\n            this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);\n            return;\n        }\n        if (this.d)\n            this.e();\n        else\n            this.u.push({\n                r: function () {\n                    if (!(_this.d & 1))\n                        return;\n                    _this.u.splice(-1, 1);\n                    _this.e();\n                },\n                t: function () { }\n            });\n        this.d = 3;\n    };\n    Zip.prototype.e = function () {\n        var bt = 0, l = 0, tl = 0;\n        for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n            var f = _a[_i];\n            tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);\n        }\n        var out = new u8(tl + 22);\n        for (var _b = 0, _c = this.u; _b < _c.length; _b++) {\n            var f = _c[_b];\n            wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);\n            bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;\n        }\n        wzf(out, bt, this.u.length, tl, l);\n        this.ondata(null, out, true);\n        this.d = 2;\n    };\n    /**\n     * A method to terminate any internal workers used by the stream. Subsequent\n     * calls to add() will fail.\n     */\n    Zip.prototype.terminate = function () {\n        for (var _i = 0, _a = this.u; _i < _a.length; _i++) {\n            var f = _a[_i];\n            f.t();\n        }\n        this.d = 2;\n    };\n    return Zip;\n}());\nexport { Zip };\nexport function zip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    var r = {};\n    fltn(data, '', r, opts);\n    var k = Object.keys(r);\n    var lft = k.length, o = 0, tot = 0;\n    var slft = lft, files = new Array(lft);\n    var term = [];\n    var tAll = function () {\n        for (var i = 0; i < term.length; ++i)\n            term[i]();\n    };\n    var cbd = function (a, b) {\n        mt(function () { cb(a, b); });\n    };\n    mt(function () { cbd = cb; });\n    var cbf = function () {\n        var out = new u8(tot + 22), oe = o, cdl = tot - o;\n        tot = 0;\n        for (var i = 0; i < slft; ++i) {\n            var f = files[i];\n            try {\n                var l = f.c.length;\n                wzh(out, tot, f, f.f, f.u, l);\n                var badd = 30 + f.f.length + exfl(f.extra);\n                var loc = tot + badd;\n                out.set(f.c, loc);\n                wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;\n            }\n            catch (e) {\n                return cbd(e, null);\n            }\n        }\n        wzf(out, o, files.length, cdl, oe);\n        cbd(null, out);\n    };\n    if (!lft)\n        cbf();\n    var _loop_1 = function (i) {\n        var fn = k[i];\n        var _a = r[fn], file = _a[0], p = _a[1];\n        var c = crc(), size = file.length;\n        c.p(file);\n        var f = strToU8(fn), s = f.length;\n        var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n        var exl = exfl(p.extra);\n        var compression = p.level == 0 ? 0 : 8;\n        var cbl = function (e, d) {\n            if (e) {\n                tAll();\n                cbd(e, null);\n            }\n            else {\n                var l = d.length;\n                files[i] = mrg(p, {\n                    size: size,\n                    crc: c.d(),\n                    c: d,\n                    f: f,\n                    m: m,\n                    u: s != fn.length || (m && (com.length != ms)),\n                    compression: compression\n                });\n                o += 30 + s + exl + l;\n                tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n                if (!--lft)\n                    cbf();\n            }\n        };\n        if (s > 65535)\n            cbl(err(11, 0, 1), null);\n        if (!compression)\n            cbl(null, file);\n        else if (size < 160000) {\n            try {\n                cbl(null, deflateSync(file, p));\n            }\n            catch (e) {\n                cbl(e, null);\n            }\n        }\n        else\n            term.push(deflate(file, p, cbl));\n    };\n    // Cannot use lft because it can decrease\n    for (var i = 0; i < slft; ++i) {\n        _loop_1(i);\n    }\n    return tAll;\n}\n/**\n * Synchronously creates a ZIP file. Prefer using `zip` for better performance\n * with more than one file.\n * @param data The directory structure for the ZIP archive\n * @param opts The main options, merged with per-file options\n * @returns The generated ZIP archive\n */\nexport function zipSync(data, opts) {\n    if (!opts)\n        opts = {};\n    var r = {};\n    var files = [];\n    fltn(data, '', r, opts);\n    var o = 0;\n    var tot = 0;\n    for (var fn in r) {\n        var _a = r[fn], file = _a[0], p = _a[1];\n        var compression = p.level == 0 ? 0 : 8;\n        var f = strToU8(fn), s = f.length;\n        var com = p.comment, m = com && strToU8(com), ms = m && m.length;\n        var exl = exfl(p.extra);\n        if (s > 65535)\n            err(11);\n        var d = compression ? deflateSync(file, p) : file, l = d.length;\n        var c = crc();\n        c.p(file);\n        files.push(mrg(p, {\n            size: file.length,\n            crc: c.d(),\n            c: d,\n            f: f,\n            m: m,\n            u: s != fn.length || (m && (com.length != ms)),\n            o: o,\n            compression: compression\n        }));\n        o += 30 + s + exl + l;\n        tot += 76 + 2 * (s + exl) + (ms || 0) + l;\n    }\n    var out = new u8(tot + 22), oe = o, cdl = tot - o;\n    for (var i = 0; i < files.length; ++i) {\n        var f = files[i];\n        wzh(out, f.o, f, f.f, f.u, f.c.length);\n        var badd = 30 + f.f.length + exfl(f.extra);\n        out.set(f.c, f.o + badd);\n        wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);\n    }\n    wzf(out, o, files.length, cdl, oe);\n    return out;\n}\n/**\n * Streaming pass-through decompression for ZIP archives\n */\nvar UnzipPassThrough = /*#__PURE__*/ (function () {\n    function UnzipPassThrough() {\n    }\n    UnzipPassThrough.prototype.push = function (data, final) {\n        this.ondata(null, data, final);\n    };\n    UnzipPassThrough.compression = 0;\n    return UnzipPassThrough;\n}());\nexport { UnzipPassThrough };\n/**\n * Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for\n * better performance.\n */\nvar UnzipInflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates a DEFLATE decompression that can be used in ZIP archives\n     */\n    function UnzipInflate() {\n        var _this = this;\n        this.i = new Inflate(function (dat, final) {\n            _this.ondata(null, dat, final);\n        });\n    }\n    UnzipInflate.prototype.push = function (data, final) {\n        try {\n            this.i.push(data, final);\n        }\n        catch (e) {\n            this.ondata(e, null, final);\n        }\n    };\n    UnzipInflate.compression = 8;\n    return UnzipInflate;\n}());\nexport { UnzipInflate };\n/**\n * Asynchronous streaming DEFLATE decompression for ZIP archives\n */\nvar AsyncUnzipInflate = /*#__PURE__*/ (function () {\n    /**\n     * Creates a DEFLATE decompression that can be used in ZIP archives\n     */\n    function AsyncUnzipInflate(_, sz) {\n        var _this = this;\n        if (sz < 320000) {\n            this.i = new Inflate(function (dat, final) {\n                _this.ondata(null, dat, final);\n            });\n        }\n        else {\n            this.i = new AsyncInflate(function (err, dat, final) {\n                _this.ondata(err, dat, final);\n            });\n            this.terminate = this.i.terminate;\n        }\n    }\n    AsyncUnzipInflate.prototype.push = function (data, final) {\n        if (this.i.terminate)\n            data = slc(data, 0);\n        this.i.push(data, final);\n    };\n    AsyncUnzipInflate.compression = 8;\n    return AsyncUnzipInflate;\n}());\nexport { AsyncUnzipInflate };\n/**\n * A ZIP archive decompression stream that emits files as they are discovered\n */\nvar Unzip = /*#__PURE__*/ (function () {\n    /**\n     * Creates a ZIP decompression stream\n     * @param cb The callback to call whenever a file in the ZIP archive is found\n     */\n    function Unzip(cb) {\n        this.onfile = cb;\n        this.k = [];\n        this.o = {\n            0: UnzipPassThrough\n        };\n        this.p = et;\n    }\n    /**\n     * Pushes a chunk to be unzipped\n     * @param chunk The chunk to push\n     * @param final Whether this is the last chunk\n     */\n    Unzip.prototype.push = function (chunk, final) {\n        var _this = this;\n        if (!this.onfile)\n            err(5);\n        if (!this.p)\n            err(4);\n        if (this.c > 0) {\n            var len = Math.min(this.c, chunk.length);\n            var toAdd = chunk.subarray(0, len);\n            this.c -= len;\n            if (this.d)\n                this.d.push(toAdd, !this.c);\n            else\n                this.k[0].push(toAdd);\n            chunk = chunk.subarray(len);\n            if (chunk.length)\n                return this.push(chunk, final);\n        }\n        else {\n            var f = 0, i = 0, is = void 0, buf = void 0;\n            if (!this.p.length)\n                buf = chunk;\n            else if (!chunk.length)\n                buf = this.p;\n            else {\n                buf = new u8(this.p.length + chunk.length);\n                buf.set(this.p), buf.set(chunk, this.p.length);\n            }\n            var l = buf.length, oc = this.c, add = oc && this.d;\n            var _loop_2 = function () {\n                var _a;\n                var sig = b4(buf, i);\n                if (sig == 0x4034B50) {\n                    f = 1, is = i;\n                    this_1.d = null;\n                    this_1.c = 0;\n                    var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);\n                    if (l > i + 30 + fnl + es) {\n                        var chks_3 = [];\n                        this_1.k.unshift(chks_3);\n                        f = 2;\n                        var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);\n                        var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);\n                        if (sc_1 == 4294967295) {\n                            _a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];\n                        }\n                        else if (dd)\n                            sc_1 = -1;\n                        i += es;\n                        this_1.c = sc_1;\n                        var d_1;\n                        var file_1 = {\n                            name: fn_1,\n                            compression: cmp_1,\n                            start: function () {\n                                if (!file_1.ondata)\n                                    err(5);\n                                if (!sc_1)\n                                    file_1.ondata(null, et, true);\n                                else {\n                                    var ctr = _this.o[cmp_1];\n                                    if (!ctr)\n                                        file_1.ondata(err(14, 'unknown compression type ' + cmp_1, 1), null, false);\n                                    d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);\n                                    d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };\n                                    for (var _i = 0, chks_4 = chks_3; _i < chks_4.length; _i++) {\n                                        var dat = chks_4[_i];\n                                        d_1.push(dat, false);\n                                    }\n                                    if (_this.k[0] == chks_3 && _this.c)\n                                        _this.d = d_1;\n                                    else\n                                        d_1.push(et, true);\n                                }\n                            },\n                            terminate: function () {\n                                if (d_1 && d_1.terminate)\n                                    d_1.terminate();\n                            }\n                        };\n                        if (sc_1 >= 0)\n                            file_1.size = sc_1, file_1.originalSize = su_1;\n                        this_1.onfile(file_1);\n                    }\n                    return \"break\";\n                }\n                else if (oc) {\n                    if (sig == 0x8074B50) {\n                        is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;\n                        return \"break\";\n                    }\n                    else if (sig == 0x2014B50) {\n                        is = i -= 4, f = 3, this_1.c = 0;\n                        return \"break\";\n                    }\n                }\n            };\n            var this_1 = this;\n            for (; i < l - 4; ++i) {\n                var state_1 = _loop_2();\n                if (state_1 === \"break\")\n                    break;\n            }\n            this.p = et;\n            if (oc < 0) {\n                var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);\n                if (add)\n                    add.push(dat, !!f);\n                else\n                    this.k[+(f == 2)].push(dat);\n            }\n            if (f & 2)\n                return this.push(buf.subarray(i), final);\n            this.p = buf.subarray(i);\n        }\n        if (final) {\n            if (this.c)\n                err(13);\n            this.p = null;\n        }\n    };\n    /**\n     * Registers a decoder with the stream, allowing for files compressed with\n     * the compression type provided to be expanded correctly\n     * @param decoder The decoder constructor\n     */\n    Unzip.prototype.register = function (decoder) {\n        this.o[decoder.compression] = decoder;\n    };\n    return Unzip;\n}());\nexport { Unzip };\nvar mt = typeof queueMicrotask == 'function' ? queueMicrotask : typeof setTimeout == 'function' ? setTimeout : function (fn) { fn(); };\nexport function unzip(data, opts, cb) {\n    if (!cb)\n        cb = opts, opts = {};\n    if (typeof cb != 'function')\n        err(7);\n    var term = [];\n    var tAll = function () {\n        for (var i = 0; i < term.length; ++i)\n            term[i]();\n    };\n    var files = {};\n    var cbd = function (a, b) {\n        mt(function () { cb(a, b); });\n    };\n    mt(function () { cbd = cb; });\n    var e = data.length - 22;\n    for (; b4(data, e) != 0x6054B50; --e) {\n        if (!e || data.length - e > 65558) {\n            cbd(err(13, 0, 1), null);\n            return tAll;\n        }\n    }\n    ;\n    var lft = b2(data, e + 8);\n    if (lft) {\n        var c = lft;\n        var o = b4(data, e + 16);\n        var z = o == 4294967295 || c == 65535;\n        if (z) {\n            var ze = b4(data, e - 12);\n            z = b4(data, ze) == 0x6064B50;\n            if (z) {\n                c = lft = b4(data, ze + 32);\n                o = b4(data, ze + 48);\n            }\n        }\n        var fltr = opts && opts.filter;\n        var _loop_3 = function (i) {\n            var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n            o = no;\n            var cbl = function (e, d) {\n                if (e) {\n                    tAll();\n                    cbd(e, null);\n                }\n                else {\n                    if (d)\n                        files[fn] = d;\n                    if (!--lft)\n                        cbd(null, files);\n                }\n            };\n            if (!fltr || fltr({\n                name: fn,\n                size: sc,\n                originalSize: su,\n                compression: c_1\n            })) {\n                if (!c_1)\n                    cbl(null, slc(data, b, b + sc));\n                else if (c_1 == 8) {\n                    var infl = data.subarray(b, b + sc);\n                    // Synchronously decompress under 512KB, or barely-compressed data\n                    if (su < 524288 || sc > 0.8 * su) {\n                        try {\n                            cbl(null, inflateSync(infl, { out: new u8(su) }));\n                        }\n                        catch (e) {\n                            cbl(e, null);\n                        }\n                    }\n                    else\n                        term.push(inflate(infl, { size: su }, cbl));\n                }\n                else\n                    cbl(err(14, 'unknown compression type ' + c_1, 1), null);\n            }\n            else\n                cbl(null, null);\n        };\n        for (var i = 0; i < c; ++i) {\n            _loop_3(i);\n        }\n    }\n    else\n        cbd(null, {});\n    return tAll;\n}\n/**\n * Synchronously decompresses a ZIP archive. Prefer using `unzip` for better\n * performance with more than one file.\n * @param data The raw compressed ZIP file\n * @param opts The ZIP extraction options\n * @returns The decompressed files\n */\nexport function unzipSync(data, opts) {\n    var files = {};\n    var e = data.length - 22;\n    for (; b4(data, e) != 0x6054B50; --e) {\n        if (!e || data.length - e > 65558)\n            err(13);\n    }\n    ;\n    var c = b2(data, e + 8);\n    if (!c)\n        return {};\n    var o = b4(data, e + 16);\n    var z = o == 4294967295 || c == 65535;\n    if (z) {\n        var ze = b4(data, e - 12);\n        z = b4(data, ze) == 0x6064B50;\n        if (z) {\n            c = b4(data, ze + 32);\n            o = b4(data, ze + 48);\n        }\n    }\n    var fltr = opts && opts.filter;\n    for (var i = 0; i < c; ++i) {\n        var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);\n        o = no;\n        if (!fltr || fltr({\n            name: fn,\n            size: sc,\n            originalSize: su,\n            compression: c_2\n        })) {\n            if (!c_2)\n                files[fn] = slc(data, b, b + sc);\n            else if (c_2 == 8)\n                files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });\n            else\n                err(14, 'unknown compression type ' + c_2);\n        }\n    }\n    return files;\n}\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.JSON5 = factory());\n}(this, (function () { 'use strict';\n\n\tfunction createCommonjsModule(fn, module) {\n\t\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n\t}\n\n\tvar _global = createCommonjsModule(function (module) {\n\t// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n\tvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n\t  ? window : typeof self != 'undefined' && self.Math == Math ? self\n\t  // eslint-disable-next-line no-new-func\n\t  : Function('return this')();\n\tif (typeof __g == 'number') { __g = global; } // eslint-disable-line no-undef\n\t});\n\n\tvar _core = createCommonjsModule(function (module) {\n\tvar core = module.exports = { version: '2.6.5' };\n\tif (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef\n\t});\n\tvar _core_1 = _core.version;\n\n\tvar _isObject = function (it) {\n\t  return typeof it === 'object' ? it !== null : typeof it === 'function';\n\t};\n\n\tvar _anObject = function (it) {\n\t  if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); }\n\t  return it;\n\t};\n\n\tvar _fails = function (exec) {\n\t  try {\n\t    return !!exec();\n\t  } catch (e) {\n\t    return true;\n\t  }\n\t};\n\n\t// Thank's IE8 for his funny defineProperty\n\tvar _descriptors = !_fails(function () {\n\t  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\tvar document = _global.document;\n\t// typeof document.createElement is 'object' in old IE\n\tvar is = _isObject(document) && _isObject(document.createElement);\n\tvar _domCreate = function (it) {\n\t  return is ? document.createElement(it) : {};\n\t};\n\n\tvar _ie8DomDefine = !_descriptors && !_fails(function () {\n\t  return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;\n\t});\n\n\t// 7.1.1 ToPrimitive(input [, PreferredType])\n\n\t// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n\t// and the second argument - flag - preferred type is a string\n\tvar _toPrimitive = function (it, S) {\n\t  if (!_isObject(it)) { return it; }\n\t  var fn, val;\n\t  if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) { return val; }\n\t  throw TypeError(\"Can't convert object to primitive value\");\n\t};\n\n\tvar dP = Object.defineProperty;\n\n\tvar f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n\t  _anObject(O);\n\t  P = _toPrimitive(P, true);\n\t  _anObject(Attributes);\n\t  if (_ie8DomDefine) { try {\n\t    return dP(O, P, Attributes);\n\t  } catch (e) { /* empty */ } }\n\t  if ('get' in Attributes || 'set' in Attributes) { throw TypeError('Accessors not supported!'); }\n\t  if ('value' in Attributes) { O[P] = Attributes.value; }\n\t  return O;\n\t};\n\n\tvar _objectDp = {\n\t\tf: f\n\t};\n\n\tvar _propertyDesc = function (bitmap, value) {\n\t  return {\n\t    enumerable: !(bitmap & 1),\n\t    configurable: !(bitmap & 2),\n\t    writable: !(bitmap & 4),\n\t    value: value\n\t  };\n\t};\n\n\tvar _hide = _descriptors ? function (object, key, value) {\n\t  return _objectDp.f(object, key, _propertyDesc(1, value));\n\t} : function (object, key, value) {\n\t  object[key] = value;\n\t  return object;\n\t};\n\n\tvar hasOwnProperty = {}.hasOwnProperty;\n\tvar _has = function (it, key) {\n\t  return hasOwnProperty.call(it, key);\n\t};\n\n\tvar id = 0;\n\tvar px = Math.random();\n\tvar _uid = function (key) {\n\t  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n\t};\n\n\tvar _library = false;\n\n\tvar _shared = createCommonjsModule(function (module) {\n\tvar SHARED = '__core-js_shared__';\n\tvar store = _global[SHARED] || (_global[SHARED] = {});\n\n\t(module.exports = function (key, value) {\n\t  return store[key] || (store[key] = value !== undefined ? value : {});\n\t})('versions', []).push({\n\t  version: _core.version,\n\t  mode: _library ? 'pure' : 'global',\n\t  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'\n\t});\n\t});\n\n\tvar _functionToString = _shared('native-function-to-string', Function.toString);\n\n\tvar _redefine = createCommonjsModule(function (module) {\n\tvar SRC = _uid('src');\n\n\tvar TO_STRING = 'toString';\n\tvar TPL = ('' + _functionToString).split(TO_STRING);\n\n\t_core.inspectSource = function (it) {\n\t  return _functionToString.call(it);\n\t};\n\n\t(module.exports = function (O, key, val, safe) {\n\t  var isFunction = typeof val == 'function';\n\t  if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); }\n\t  if (O[key] === val) { return; }\n\t  if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); }\n\t  if (O === _global) {\n\t    O[key] = val;\n\t  } else if (!safe) {\n\t    delete O[key];\n\t    _hide(O, key, val);\n\t  } else if (O[key]) {\n\t    O[key] = val;\n\t  } else {\n\t    _hide(O, key, val);\n\t  }\n\t// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n\t})(Function.prototype, TO_STRING, function toString() {\n\t  return typeof this == 'function' && this[SRC] || _functionToString.call(this);\n\t});\n\t});\n\n\tvar _aFunction = function (it) {\n\t  if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); }\n\t  return it;\n\t};\n\n\t// optional / simple context binding\n\n\tvar _ctx = function (fn, that, length) {\n\t  _aFunction(fn);\n\t  if (that === undefined) { return fn; }\n\t  switch (length) {\n\t    case 1: return function (a) {\n\t      return fn.call(that, a);\n\t    };\n\t    case 2: return function (a, b) {\n\t      return fn.call(that, a, b);\n\t    };\n\t    case 3: return function (a, b, c) {\n\t      return fn.call(that, a, b, c);\n\t    };\n\t  }\n\t  return function (/* ...args */) {\n\t    return fn.apply(that, arguments);\n\t  };\n\t};\n\n\tvar PROTOTYPE = 'prototype';\n\n\tvar $export = function (type, name, source) {\n\t  var IS_FORCED = type & $export.F;\n\t  var IS_GLOBAL = type & $export.G;\n\t  var IS_STATIC = type & $export.S;\n\t  var IS_PROTO = type & $export.P;\n\t  var IS_BIND = type & $export.B;\n\t  var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE];\n\t  var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});\n\t  var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n\t  var key, own, out, exp;\n\t  if (IS_GLOBAL) { source = name; }\n\t  for (key in source) {\n\t    // contains in native\n\t    own = !IS_FORCED && target && target[key] !== undefined;\n\t    // export native or passed\n\t    out = (own ? target : source)[key];\n\t    // bind timers to global for call from export context\n\t    exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;\n\t    // extend global\n\t    if (target) { _redefine(target, key, out, type & $export.U); }\n\t    // export\n\t    if (exports[key] != out) { _hide(exports, key, exp); }\n\t    if (IS_PROTO && expProto[key] != out) { expProto[key] = out; }\n\t  }\n\t};\n\t_global.core = _core;\n\t// type bitmap\n\t$export.F = 1;   // forced\n\t$export.G = 2;   // global\n\t$export.S = 4;   // static\n\t$export.P = 8;   // proto\n\t$export.B = 16;  // bind\n\t$export.W = 32;  // wrap\n\t$export.U = 64;  // safe\n\t$export.R = 128; // real proto method for `library`\n\tvar _export = $export;\n\n\t// 7.1.4 ToInteger\n\tvar ceil = Math.ceil;\n\tvar floor = Math.floor;\n\tvar _toInteger = function (it) {\n\t  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n\t};\n\n\t// 7.2.1 RequireObjectCoercible(argument)\n\tvar _defined = function (it) {\n\t  if (it == undefined) { throw TypeError(\"Can't call method on  \" + it); }\n\t  return it;\n\t};\n\n\t// true  -> String#at\n\t// false -> String#codePointAt\n\tvar _stringAt = function (TO_STRING) {\n\t  return function (that, pos) {\n\t    var s = String(_defined(that));\n\t    var i = _toInteger(pos);\n\t    var l = s.length;\n\t    var a, b;\n\t    if (i < 0 || i >= l) { return TO_STRING ? '' : undefined; }\n\t    a = s.charCodeAt(i);\n\t    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n\t      ? TO_STRING ? s.charAt(i) : a\n\t      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n\t  };\n\t};\n\n\tvar $at = _stringAt(false);\n\t_export(_export.P, 'String', {\n\t  // 21.1.3.3 String.prototype.codePointAt(pos)\n\t  codePointAt: function codePointAt(pos) {\n\t    return $at(this, pos);\n\t  }\n\t});\n\n\tvar codePointAt = _core.String.codePointAt;\n\n\tvar max = Math.max;\n\tvar min = Math.min;\n\tvar _toAbsoluteIndex = function (index, length) {\n\t  index = _toInteger(index);\n\t  return index < 0 ? max(index + length, 0) : min(index, length);\n\t};\n\n\tvar fromCharCode = String.fromCharCode;\n\tvar $fromCodePoint = String.fromCodePoint;\n\n\t// length should be 1, old FF problem\n\t_export(_export.S + _export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n\t  // 21.1.2.2 String.fromCodePoint(...codePoints)\n\t  fromCodePoint: function fromCodePoint(x) {\n\t    var arguments$1 = arguments;\n\t // eslint-disable-line no-unused-vars\n\t    var res = [];\n\t    var aLen = arguments.length;\n\t    var i = 0;\n\t    var code;\n\t    while (aLen > i) {\n\t      code = +arguments$1[i++];\n\t      if (_toAbsoluteIndex(code, 0x10ffff) !== code) { throw RangeError(code + ' is not a valid code point'); }\n\t      res.push(code < 0x10000\n\t        ? fromCharCode(code)\n\t        : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n\t      );\n\t    } return res.join('');\n\t  }\n\t});\n\n\tvar fromCodePoint = _core.String.fromCodePoint;\n\n\t// This is a generated file. Do not edit.\n\tvar Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\n\tvar ID_Start = /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\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DE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\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xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u09FC\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0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CF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF9\\u1D00-\\u1DF9\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312E\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\u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B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n\tvar unicode = {\n\t\tSpace_Separator: Space_Separator,\n\t\tID_Start: ID_Start,\n\t\tID_Continue: ID_Continue\n\t};\n\n\tvar util = {\n\t    isSpaceSeparator: function isSpaceSeparator (c) {\n\t        return typeof c === 'string' && unicode.Space_Separator.test(c)\n\t    },\n\n\t    isIdStartChar: function isIdStartChar (c) {\n\t        return typeof c === 'string' && (\n\t            (c >= 'a' && c <= 'z') ||\n\t        (c >= 'A' && c <= 'Z') ||\n\t        (c === '$') || (c === '_') ||\n\t        unicode.ID_Start.test(c)\n\t        )\n\t    },\n\n\t    isIdContinueChar: function isIdContinueChar (c) {\n\t        return typeof c === 'string' && (\n\t            (c >= 'a' && c <= 'z') ||\n\t        (c >= 'A' && c <= 'Z') ||\n\t        (c >= '0' && c <= '9') ||\n\t        (c === '$') || (c === '_') ||\n\t        (c === '\\u200C') || (c === '\\u200D') ||\n\t        unicode.ID_Continue.test(c)\n\t        )\n\t    },\n\n\t    isDigit: function isDigit (c) {\n\t        return typeof c === 'string' && /[0-9]/.test(c)\n\t    },\n\n\t    isHexDigit: function isHexDigit (c) {\n\t        return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)\n\t    },\n\t};\n\n\tvar source;\n\tvar parseState;\n\tvar stack;\n\tvar pos;\n\tvar line;\n\tvar column;\n\tvar token;\n\tvar key;\n\tvar root;\n\n\tvar parse = function parse (text, reviver) {\n\t    source = String(text);\n\t    parseState = 'start';\n\t    stack = [];\n\t    pos = 0;\n\t    line = 1;\n\t    column = 0;\n\t    token = undefined;\n\t    key = undefined;\n\t    root = undefined;\n\n\t    do {\n\t        token = lex();\n\n\t        // This code is unreachable.\n\t        // if (!parseStates[parseState]) {\n\t        //     throw invalidParseState()\n\t        // }\n\n\t        parseStates[parseState]();\n\t    } while (token.type !== 'eof')\n\n\t    if (typeof reviver === 'function') {\n\t        return internalize({'': root}, '', reviver)\n\t    }\n\n\t    return root\n\t};\n\n\tfunction internalize (holder, name, reviver) {\n\t    var value = holder[name];\n\t    if (value != null && typeof value === 'object') {\n\t        if (Array.isArray(value)) {\n\t            for (var i = 0; i < value.length; i++) {\n\t                var key = String(i);\n\t                var replacement = internalize(value, key, reviver);\n\t                if (replacement === undefined) {\n\t                    delete value[key];\n\t                } else {\n\t                    Object.defineProperty(value, key, {\n\t                        value: replacement,\n\t                        writable: true,\n\t                        enumerable: true,\n\t                        configurable: true,\n\t                    });\n\t                }\n\t            }\n\t        } else {\n\t            for (var key$1 in value) {\n\t                var replacement$1 = internalize(value, key$1, reviver);\n\t                if (replacement$1 === undefined) {\n\t                    delete value[key$1];\n\t                } else {\n\t                    Object.defineProperty(value, key$1, {\n\t                        value: replacement$1,\n\t                        writable: true,\n\t                        enumerable: true,\n\t                        configurable: true,\n\t                    });\n\t                }\n\t            }\n\t        }\n\t    }\n\n\t    return reviver.call(holder, name, value)\n\t}\n\n\tvar lexState;\n\tvar buffer;\n\tvar doubleQuote;\n\tvar sign;\n\tvar c;\n\n\tfunction lex () {\n\t    lexState = 'default';\n\t    buffer = '';\n\t    doubleQuote = false;\n\t    sign = 1;\n\n\t    for (;;) {\n\t        c = peek();\n\n\t        // This code is unreachable.\n\t        // if (!lexStates[lexState]) {\n\t        //     throw invalidLexState(lexState)\n\t        // }\n\n\t        var token = lexStates[lexState]();\n\t        if (token) {\n\t            return token\n\t        }\n\t    }\n\t}\n\n\tfunction peek () {\n\t    if (source[pos]) {\n\t        return String.fromCodePoint(source.codePointAt(pos))\n\t    }\n\t}\n\n\tfunction read () {\n\t    var c = peek();\n\n\t    if (c === '\\n') {\n\t        line++;\n\t        column = 0;\n\t    } else if (c) {\n\t        column += c.length;\n\t    } else {\n\t        column++;\n\t    }\n\n\t    if (c) {\n\t        pos += c.length;\n\t    }\n\n\t    return c\n\t}\n\n\tvar lexStates = {\n\t    default: function default$1 () {\n\t        switch (c) {\n\t        case '\\t':\n\t        case '\\v':\n\t        case '\\f':\n\t        case ' ':\n\t        case '\\u00A0':\n\t        case '\\uFEFF':\n\t        case '\\n':\n\t        case '\\r':\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            read();\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'comment';\n\t            return\n\n\t        case undefined:\n\t            read();\n\t            return newToken('eof')\n\t        }\n\n\t        if (util.isSpaceSeparator(c)) {\n\t            read();\n\t            return\n\t        }\n\n\t        // This code is unreachable.\n\t        // if (!lexStates[parseState]) {\n\t        //     throw invalidLexState(parseState)\n\t        // }\n\n\t        return lexStates[parseState]()\n\t    },\n\n\t    comment: function comment () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            lexState = 'multiLineComment';\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'singleLineComment';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    multiLineComment: function multiLineComment () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            lexState = 'multiLineCommentAsterisk';\n\t            return\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t    },\n\n\t    multiLineCommentAsterisk: function multiLineCommentAsterisk () {\n\t        switch (c) {\n\t        case '*':\n\t            read();\n\t            return\n\n\t        case '/':\n\t            read();\n\t            lexState = 'default';\n\t            return\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        lexState = 'multiLineComment';\n\t    },\n\n\t    singleLineComment: function singleLineComment () {\n\t        switch (c) {\n\t        case '\\n':\n\t        case '\\r':\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            read();\n\t            lexState = 'default';\n\t            return\n\n\t        case undefined:\n\t            read();\n\t            return newToken('eof')\n\t        }\n\n\t        read();\n\t    },\n\n\t    value: function value () {\n\t        switch (c) {\n\t        case '{':\n\t        case '[':\n\t            return newToken('punctuator', read())\n\n\t        case 'n':\n\t            read();\n\t            literal('ull');\n\t            return newToken('null', null)\n\n\t        case 't':\n\t            read();\n\t            literal('rue');\n\t            return newToken('boolean', true)\n\n\t        case 'f':\n\t            read();\n\t            literal('alse');\n\t            return newToken('boolean', false)\n\n\t        case '-':\n\t        case '+':\n\t            if (read() === '-') {\n\t                sign = -1;\n\t            }\n\n\t            lexState = 'sign';\n\t            return\n\n\t        case '.':\n\t            buffer = read();\n\t            lexState = 'decimalPointLeading';\n\t            return\n\n\t        case '0':\n\t            buffer = read();\n\t            lexState = 'zero';\n\t            return\n\n\t        case '1':\n\t        case '2':\n\t        case '3':\n\t        case '4':\n\t        case '5':\n\t        case '6':\n\t        case '7':\n\t        case '8':\n\t        case '9':\n\t            buffer = read();\n\t            lexState = 'decimalInteger';\n\t            return\n\n\t        case 'I':\n\t            read();\n\t            literal('nfinity');\n\t            return newToken('numeric', Infinity)\n\n\t        case 'N':\n\t            read();\n\t            literal('aN');\n\t            return newToken('numeric', NaN)\n\n\t        case '\"':\n\t        case \"'\":\n\t            doubleQuote = (read() === '\"');\n\t            buffer = '';\n\t            lexState = 'string';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    identifierNameStartEscape: function identifierNameStartEscape () {\n\t        if (c !== 'u') {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        var u = unicodeEscape();\n\t        switch (u) {\n\t        case '$':\n\t        case '_':\n\t            break\n\n\t        default:\n\t            if (!util.isIdStartChar(u)) {\n\t                throw invalidIdentifier()\n\t            }\n\n\t            break\n\t        }\n\n\t        buffer += u;\n\t        lexState = 'identifierName';\n\t    },\n\n\t    identifierName: function identifierName () {\n\t        switch (c) {\n\t        case '$':\n\t        case '_':\n\t        case '\\u200C':\n\t        case '\\u200D':\n\t            buffer += read();\n\t            return\n\n\t        case '\\\\':\n\t            read();\n\t            lexState = 'identifierNameEscape';\n\t            return\n\t        }\n\n\t        if (util.isIdContinueChar(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('identifier', buffer)\n\t    },\n\n\t    identifierNameEscape: function identifierNameEscape () {\n\t        if (c !== 'u') {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t        var u = unicodeEscape();\n\t        switch (u) {\n\t        case '$':\n\t        case '_':\n\t        case '\\u200C':\n\t        case '\\u200D':\n\t            break\n\n\t        default:\n\t            if (!util.isIdContinueChar(u)) {\n\t                throw invalidIdentifier()\n\t            }\n\n\t            break\n\t        }\n\n\t        buffer += u;\n\t        lexState = 'identifierName';\n\t    },\n\n\t    sign: function sign$1 () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer = read();\n\t            lexState = 'decimalPointLeading';\n\t            return\n\n\t        case '0':\n\t            buffer = read();\n\t            lexState = 'zero';\n\t            return\n\n\t        case '1':\n\t        case '2':\n\t        case '3':\n\t        case '4':\n\t        case '5':\n\t        case '6':\n\t        case '7':\n\t        case '8':\n\t        case '9':\n\t            buffer = read();\n\t            lexState = 'decimalInteger';\n\t            return\n\n\t        case 'I':\n\t            read();\n\t            literal('nfinity');\n\t            return newToken('numeric', sign * Infinity)\n\n\t        case 'N':\n\t            read();\n\t            literal('aN');\n\t            return newToken('numeric', NaN)\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    zero: function zero () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer += read();\n\t            lexState = 'decimalPoint';\n\t            return\n\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\n\t        case 'x':\n\t        case 'X':\n\t            buffer += read();\n\t            lexState = 'hexadecimal';\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * 0)\n\t    },\n\n\t    decimalInteger: function decimalInteger () {\n\t        switch (c) {\n\t        case '.':\n\t            buffer += read();\n\t            lexState = 'decimalPoint';\n\t            return\n\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalPointLeading: function decimalPointLeading () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalFraction';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalPoint: function decimalPoint () {\n\t        switch (c) {\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalFraction';\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalFraction: function decimalFraction () {\n\t        switch (c) {\n\t        case 'e':\n\t        case 'E':\n\t            buffer += read();\n\t            lexState = 'decimalExponent';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    decimalExponent: function decimalExponent () {\n\t        switch (c) {\n\t        case '+':\n\t        case '-':\n\t            buffer += read();\n\t            lexState = 'decimalExponentSign';\n\t            return\n\t        }\n\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalExponentInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalExponentSign: function decimalExponentSign () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'decimalExponentInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    decimalExponentInteger: function decimalExponentInteger () {\n\t        if (util.isDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    hexadecimal: function hexadecimal () {\n\t        if (util.isHexDigit(c)) {\n\t            buffer += read();\n\t            lexState = 'hexadecimalInteger';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    hexadecimalInteger: function hexadecimalInteger () {\n\t        if (util.isHexDigit(c)) {\n\t            buffer += read();\n\t            return\n\t        }\n\n\t        return newToken('numeric', sign * Number(buffer))\n\t    },\n\n\t    string: function string () {\n\t        switch (c) {\n\t        case '\\\\':\n\t            read();\n\t            buffer += escape();\n\t            return\n\n\t        case '\"':\n\t            if (doubleQuote) {\n\t                read();\n\t                return newToken('string', buffer)\n\t            }\n\n\t            buffer += read();\n\t            return\n\n\t        case \"'\":\n\t            if (!doubleQuote) {\n\t                read();\n\t                return newToken('string', buffer)\n\t            }\n\n\t            buffer += read();\n\t            return\n\n\t        case '\\n':\n\t        case '\\r':\n\t            throw invalidChar(read())\n\n\t        case '\\u2028':\n\t        case '\\u2029':\n\t            separatorChar(c);\n\t            break\n\n\t        case undefined:\n\t            throw invalidChar(read())\n\t        }\n\n\t        buffer += read();\n\t    },\n\n\t    start: function start () {\n\t        switch (c) {\n\t        case '{':\n\t        case '[':\n\t            return newToken('punctuator', read())\n\n\t        // This code is unreachable since the default lexState handles eof.\n\t        // case undefined:\n\t        //     return newToken('eof')\n\t        }\n\n\t        lexState = 'value';\n\t    },\n\n\t    beforePropertyName: function beforePropertyName () {\n\t        switch (c) {\n\t        case '$':\n\t        case '_':\n\t            buffer = read();\n\t            lexState = 'identifierName';\n\t            return\n\n\t        case '\\\\':\n\t            read();\n\t            lexState = 'identifierNameStartEscape';\n\t            return\n\n\t        case '}':\n\t            return newToken('punctuator', read())\n\n\t        case '\"':\n\t        case \"'\":\n\t            doubleQuote = (read() === '\"');\n\t            lexState = 'string';\n\t            return\n\t        }\n\n\t        if (util.isIdStartChar(c)) {\n\t            buffer += read();\n\t            lexState = 'identifierName';\n\t            return\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    afterPropertyName: function afterPropertyName () {\n\t        if (c === ':') {\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    beforePropertyValue: function beforePropertyValue () {\n\t        lexState = 'value';\n\t    },\n\n\t    afterPropertyValue: function afterPropertyValue () {\n\t        switch (c) {\n\t        case ',':\n\t        case '}':\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    beforeArrayValue: function beforeArrayValue () {\n\t        if (c === ']') {\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        lexState = 'value';\n\t    },\n\n\t    afterArrayValue: function afterArrayValue () {\n\t        switch (c) {\n\t        case ',':\n\t        case ']':\n\t            return newToken('punctuator', read())\n\t        }\n\n\t        throw invalidChar(read())\n\t    },\n\n\t    end: function end () {\n\t        // This code is unreachable since it's handled by the default lexState.\n\t        // if (c === undefined) {\n\t        //     read()\n\t        //     return newToken('eof')\n\t        // }\n\n\t        throw invalidChar(read())\n\t    },\n\t};\n\n\tfunction newToken (type, value) {\n\t    return {\n\t        type: type,\n\t        value: value,\n\t        line: line,\n\t        column: column,\n\t    }\n\t}\n\n\tfunction literal (s) {\n\t    for (var i = 0, list = s; i < list.length; i += 1) {\n\t        var c = list[i];\n\n\t        var p = peek();\n\n\t        if (p !== c) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        read();\n\t    }\n\t}\n\n\tfunction escape () {\n\t    var c = peek();\n\t    switch (c) {\n\t    case 'b':\n\t        read();\n\t        return '\\b'\n\n\t    case 'f':\n\t        read();\n\t        return '\\f'\n\n\t    case 'n':\n\t        read();\n\t        return '\\n'\n\n\t    case 'r':\n\t        read();\n\t        return '\\r'\n\n\t    case 't':\n\t        read();\n\t        return '\\t'\n\n\t    case 'v':\n\t        read();\n\t        return '\\v'\n\n\t    case '0':\n\t        read();\n\t        if (util.isDigit(peek())) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        return '\\0'\n\n\t    case 'x':\n\t        read();\n\t        return hexEscape()\n\n\t    case 'u':\n\t        read();\n\t        return unicodeEscape()\n\n\t    case '\\n':\n\t    case '\\u2028':\n\t    case '\\u2029':\n\t        read();\n\t        return ''\n\n\t    case '\\r':\n\t        read();\n\t        if (peek() === '\\n') {\n\t            read();\n\t        }\n\n\t        return ''\n\n\t    case '1':\n\t    case '2':\n\t    case '3':\n\t    case '4':\n\t    case '5':\n\t    case '6':\n\t    case '7':\n\t    case '8':\n\t    case '9':\n\t        throw invalidChar(read())\n\n\t    case undefined:\n\t        throw invalidChar(read())\n\t    }\n\n\t    return read()\n\t}\n\n\tfunction hexEscape () {\n\t    var buffer = '';\n\t    var c = peek();\n\n\t    if (!util.isHexDigit(c)) {\n\t        throw invalidChar(read())\n\t    }\n\n\t    buffer += read();\n\n\t    c = peek();\n\t    if (!util.isHexDigit(c)) {\n\t        throw invalidChar(read())\n\t    }\n\n\t    buffer += read();\n\n\t    return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tfunction unicodeEscape () {\n\t    var buffer = '';\n\t    var count = 4;\n\n\t    while (count-- > 0) {\n\t        var c = peek();\n\t        if (!util.isHexDigit(c)) {\n\t            throw invalidChar(read())\n\t        }\n\n\t        buffer += read();\n\t    }\n\n\t    return String.fromCodePoint(parseInt(buffer, 16))\n\t}\n\n\tvar parseStates = {\n\t    start: function start () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        push();\n\t    },\n\n\t    beforePropertyName: function beforePropertyName () {\n\t        switch (token.type) {\n\t        case 'identifier':\n\t        case 'string':\n\t            key = token.value;\n\t            parseState = 'afterPropertyName';\n\t            return\n\n\t        case 'punctuator':\n\t            // This code is unreachable since it's handled by the lexState.\n\t            // if (token.value !== '}') {\n\t            //     throw invalidToken()\n\t            // }\n\n\t            pop();\n\t            return\n\n\t        case 'eof':\n\t            throw invalidEOF()\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    afterPropertyName: function afterPropertyName () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator' || token.value !== ':') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        parseState = 'beforePropertyValue';\n\t    },\n\n\t    beforePropertyValue: function beforePropertyValue () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        push();\n\t    },\n\n\t    beforeArrayValue: function beforeArrayValue () {\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        if (token.type === 'punctuator' && token.value === ']') {\n\t            pop();\n\t            return\n\t        }\n\n\t        push();\n\t    },\n\n\t    afterPropertyValue: function afterPropertyValue () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        switch (token.value) {\n\t        case ',':\n\t            parseState = 'beforePropertyName';\n\t            return\n\n\t        case '}':\n\t            pop();\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    afterArrayValue: function afterArrayValue () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'punctuator') {\n\t        //     throw invalidToken()\n\t        // }\n\n\t        if (token.type === 'eof') {\n\t            throw invalidEOF()\n\t        }\n\n\t        switch (token.value) {\n\t        case ',':\n\t            parseState = 'beforeArrayValue';\n\t            return\n\n\t        case ']':\n\t            pop();\n\t        }\n\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // throw invalidToken()\n\t    },\n\n\t    end: function end () {\n\t        // This code is unreachable since it's handled by the lexState.\n\t        // if (token.type !== 'eof') {\n\t        //     throw invalidToken()\n\t        // }\n\t    },\n\t};\n\n\tfunction push () {\n\t    var value;\n\n\t    switch (token.type) {\n\t    case 'punctuator':\n\t        switch (token.value) {\n\t        case '{':\n\t            value = {};\n\t            break\n\n\t        case '[':\n\t            value = [];\n\t            break\n\t        }\n\n\t        break\n\n\t    case 'null':\n\t    case 'boolean':\n\t    case 'numeric':\n\t    case 'string':\n\t        value = token.value;\n\t        break\n\n\t    // This code is unreachable.\n\t    // default:\n\t    //     throw invalidToken()\n\t    }\n\n\t    if (root === undefined) {\n\t        root = value;\n\t    } else {\n\t        var parent = stack[stack.length - 1];\n\t        if (Array.isArray(parent)) {\n\t            parent.push(value);\n\t        } else {\n\t            Object.defineProperty(parent, key, {\n\t                value: value,\n\t                writable: true,\n\t                enumerable: true,\n\t                configurable: true,\n\t            });\n\t        }\n\t    }\n\n\t    if (value !== null && typeof value === 'object') {\n\t        stack.push(value);\n\n\t        if (Array.isArray(value)) {\n\t            parseState = 'beforeArrayValue';\n\t        } else {\n\t            parseState = 'beforePropertyName';\n\t        }\n\t    } else {\n\t        var current = stack[stack.length - 1];\n\t        if (current == null) {\n\t            parseState = 'end';\n\t        } else if (Array.isArray(current)) {\n\t            parseState = 'afterArrayValue';\n\t        } else {\n\t            parseState = 'afterPropertyValue';\n\t        }\n\t    }\n\t}\n\n\tfunction pop () {\n\t    stack.pop();\n\n\t    var current = stack[stack.length - 1];\n\t    if (current == null) {\n\t        parseState = 'end';\n\t    } else if (Array.isArray(current)) {\n\t        parseState = 'afterArrayValue';\n\t    } else {\n\t        parseState = 'afterPropertyValue';\n\t    }\n\t}\n\n\t// This code is unreachable.\n\t// function invalidParseState () {\n\t//     return new Error(`JSON5: invalid parse state '${parseState}'`)\n\t// }\n\n\t// This code is unreachable.\n\t// function invalidLexState (state) {\n\t//     return new Error(`JSON5: invalid lex state '${state}'`)\n\t// }\n\n\tfunction invalidChar (c) {\n\t    if (c === undefined) {\n\t        return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t    }\n\n\t    return syntaxError((\"JSON5: invalid character '\" + (formatChar(c)) + \"' at \" + line + \":\" + column))\n\t}\n\n\tfunction invalidEOF () {\n\t    return syntaxError((\"JSON5: invalid end of input at \" + line + \":\" + column))\n\t}\n\n\t// This code is unreachable.\n\t// function invalidToken () {\n\t//     if (token.type === 'eof') {\n\t//         return syntaxError(`JSON5: invalid end of input at ${line}:${column}`)\n\t//     }\n\n\t//     const c = String.fromCodePoint(token.value.codePointAt(0))\n\t//     return syntaxError(`JSON5: invalid character '${formatChar(c)}' at ${line}:${column}`)\n\t// }\n\n\tfunction invalidIdentifier () {\n\t    column -= 5;\n\t    return syntaxError((\"JSON5: invalid identifier character at \" + line + \":\" + column))\n\t}\n\n\tfunction separatorChar (c) {\n\t    console.warn((\"JSON5: '\" + (formatChar(c)) + \"' in strings is not valid ECMAScript; consider escaping\"));\n\t}\n\n\tfunction formatChar (c) {\n\t    var replacements = {\n\t        \"'\": \"\\\\'\",\n\t        '\"': '\\\\\"',\n\t        '\\\\': '\\\\\\\\',\n\t        '\\b': '\\\\b',\n\t        '\\f': '\\\\f',\n\t        '\\n': '\\\\n',\n\t        '\\r': '\\\\r',\n\t        '\\t': '\\\\t',\n\t        '\\v': '\\\\v',\n\t        '\\0': '\\\\0',\n\t        '\\u2028': '\\\\u2028',\n\t        '\\u2029': '\\\\u2029',\n\t    };\n\n\t    if (replacements[c]) {\n\t        return replacements[c]\n\t    }\n\n\t    if (c < ' ') {\n\t        var hexString = c.charCodeAt(0).toString(16);\n\t        return '\\\\x' + ('00' + hexString).substring(hexString.length)\n\t    }\n\n\t    return c\n\t}\n\n\tfunction syntaxError (message) {\n\t    var err = new SyntaxError(message);\n\t    err.lineNumber = line;\n\t    err.columnNumber = column;\n\t    return err\n\t}\n\n\tvar stringify = function stringify (value, replacer, space) {\n\t    var stack = [];\n\t    var indent = '';\n\t    var propertyList;\n\t    var replacerFunc;\n\t    var gap = '';\n\t    var quote;\n\n\t    if (\n\t        replacer != null &&\n\t        typeof replacer === 'object' &&\n\t        !Array.isArray(replacer)\n\t    ) {\n\t        space = replacer.space;\n\t        quote = replacer.quote;\n\t        replacer = replacer.replacer;\n\t    }\n\n\t    if (typeof replacer === 'function') {\n\t        replacerFunc = replacer;\n\t    } else if (Array.isArray(replacer)) {\n\t        propertyList = [];\n\t        for (var i = 0, list = replacer; i < list.length; i += 1) {\n\t            var v = list[i];\n\n\t            var item = (void 0);\n\n\t            if (typeof v === 'string') {\n\t                item = v;\n\t            } else if (\n\t                typeof v === 'number' ||\n\t                v instanceof String ||\n\t                v instanceof Number\n\t            ) {\n\t                item = String(v);\n\t            }\n\n\t            if (item !== undefined && propertyList.indexOf(item) < 0) {\n\t                propertyList.push(item);\n\t            }\n\t        }\n\t    }\n\n\t    if (space instanceof Number) {\n\t        space = Number(space);\n\t    } else if (space instanceof String) {\n\t        space = String(space);\n\t    }\n\n\t    if (typeof space === 'number') {\n\t        if (space > 0) {\n\t            space = Math.min(10, Math.floor(space));\n\t            gap = '          '.substr(0, space);\n\t        }\n\t    } else if (typeof space === 'string') {\n\t        gap = space.substr(0, 10);\n\t    }\n\n\t    return serializeProperty('', {'': value})\n\n\t    function serializeProperty (key, holder) {\n\t        var value = holder[key];\n\t        if (value != null) {\n\t            if (typeof value.toJSON5 === 'function') {\n\t                value = value.toJSON5(key);\n\t            } else if (typeof value.toJSON === 'function') {\n\t                value = value.toJSON(key);\n\t            }\n\t        }\n\n\t        if (replacerFunc) {\n\t            value = replacerFunc.call(holder, key, value);\n\t        }\n\n\t        if (value instanceof Number) {\n\t            value = Number(value);\n\t        } else if (value instanceof String) {\n\t            value = String(value);\n\t        } else if (value instanceof Boolean) {\n\t            value = value.valueOf();\n\t        }\n\n\t        switch (value) {\n\t        case null: return 'null'\n\t        case true: return 'true'\n\t        case false: return 'false'\n\t        }\n\n\t        if (typeof value === 'string') {\n\t            return quoteString(value, false)\n\t        }\n\n\t        if (typeof value === 'number') {\n\t            return String(value)\n\t        }\n\n\t        if (typeof value === 'object') {\n\t            return Array.isArray(value) ? serializeArray(value) : serializeObject(value)\n\t        }\n\n\t        return undefined\n\t    }\n\n\t    function quoteString (value) {\n\t        var quotes = {\n\t            \"'\": 0.1,\n\t            '\"': 0.2,\n\t        };\n\n\t        var replacements = {\n\t            \"'\": \"\\\\'\",\n\t            '\"': '\\\\\"',\n\t            '\\\\': '\\\\\\\\',\n\t            '\\b': '\\\\b',\n\t            '\\f': '\\\\f',\n\t            '\\n': '\\\\n',\n\t            '\\r': '\\\\r',\n\t            '\\t': '\\\\t',\n\t            '\\v': '\\\\v',\n\t            '\\0': '\\\\0',\n\t            '\\u2028': '\\\\u2028',\n\t            '\\u2029': '\\\\u2029',\n\t        };\n\n\t        var product = '';\n\n\t        for (var i = 0; i < value.length; i++) {\n\t            var c = value[i];\n\t            switch (c) {\n\t            case \"'\":\n\t            case '\"':\n\t                quotes[c]++;\n\t                product += c;\n\t                continue\n\n\t            case '\\0':\n\t                if (util.isDigit(value[i + 1])) {\n\t                    product += '\\\\x00';\n\t                    continue\n\t                }\n\t            }\n\n\t            if (replacements[c]) {\n\t                product += replacements[c];\n\t                continue\n\t            }\n\n\t            if (c < ' ') {\n\t                var hexString = c.charCodeAt(0).toString(16);\n\t                product += '\\\\x' + ('00' + hexString).substring(hexString.length);\n\t                continue\n\t            }\n\n\t            product += c;\n\t        }\n\n\t        var quoteChar = quote || Object.keys(quotes).reduce(function (a, b) { return (quotes[a] < quotes[b]) ? a : b; });\n\n\t        product = product.replace(new RegExp(quoteChar, 'g'), replacements[quoteChar]);\n\n\t        return quoteChar + product + quoteChar\n\t    }\n\n\t    function serializeObject (value) {\n\t        if (stack.indexOf(value) >= 0) {\n\t            throw TypeError('Converting circular structure to JSON5')\n\t        }\n\n\t        stack.push(value);\n\n\t        var stepback = indent;\n\t        indent = indent + gap;\n\n\t        var keys = propertyList || Object.keys(value);\n\t        var partial = [];\n\t        for (var i = 0, list = keys; i < list.length; i += 1) {\n\t            var key = list[i];\n\n\t            var propertyString = serializeProperty(key, value);\n\t            if (propertyString !== undefined) {\n\t                var member = serializeKey(key) + ':';\n\t                if (gap !== '') {\n\t                    member += ' ';\n\t                }\n\t                member += propertyString;\n\t                partial.push(member);\n\t            }\n\t        }\n\n\t        var final;\n\t        if (partial.length === 0) {\n\t            final = '{}';\n\t        } else {\n\t            var properties;\n\t            if (gap === '') {\n\t                properties = partial.join(',');\n\t                final = '{' + properties + '}';\n\t            } else {\n\t                var separator = ',\\n' + indent;\n\t                properties = partial.join(separator);\n\t                final = '{\\n' + indent + properties + ',\\n' + stepback + '}';\n\t            }\n\t        }\n\n\t        stack.pop();\n\t        indent = stepback;\n\t        return final\n\t    }\n\n\t    function serializeKey (key) {\n\t        if (key.length === 0) {\n\t            return quoteString(key, true)\n\t        }\n\n\t        var firstChar = String.fromCodePoint(key.codePointAt(0));\n\t        if (!util.isIdStartChar(firstChar)) {\n\t            return quoteString(key, true)\n\t        }\n\n\t        for (var i = firstChar.length; i < key.length; i++) {\n\t            if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {\n\t                return quoteString(key, true)\n\t            }\n\t        }\n\n\t        return key\n\t    }\n\n\t    function serializeArray (value) {\n\t        if (stack.indexOf(value) >= 0) {\n\t            throw TypeError('Converting circular structure to JSON5')\n\t        }\n\n\t        stack.push(value);\n\n\t        var stepback = indent;\n\t        indent = indent + gap;\n\n\t        var partial = [];\n\t        for (var i = 0; i < value.length; i++) {\n\t            var propertyString = serializeProperty(String(i), value);\n\t            partial.push((propertyString !== undefined) ? propertyString : 'null');\n\t        }\n\n\t        var final;\n\t        if (partial.length === 0) {\n\t            final = '[]';\n\t        } else {\n\t            if (gap === '') {\n\t                var properties = partial.join(',');\n\t                final = '[' + properties + ']';\n\t            } else {\n\t                var separator = ',\\n' + indent;\n\t                var properties$1 = partial.join(separator);\n\t                final = '[\\n' + indent + properties$1 + ',\\n' + stepback + ']';\n\t            }\n\t        }\n\n\t        stack.pop();\n\t        indent = stepback;\n\t        return final\n\t    }\n\t};\n\n\tvar JSON5 = {\n\t    parse: parse,\n\t    stringify: stringify,\n\t};\n\n\tvar lib = JSON5;\n\n\tvar es5 = lib;\n\n\treturn es5;\n\n})));\n","/* istanbul ignore file */\n\n\n// normalize-selector-rev-02.js\n/*\n  author: kyle simpson (@getify)\n  original source: https://gist.github.com/getify/9679380\n\n  modified for tests by david kaye (@dfkaye)\n  21 march 2014\n\n  rev-02 incorporate kyle's changes 3/2/42014\n*/\n\nexport function normalizeSelector(sel) {\n  // save unmatched text, if any\n  function saveUnmatched() {\n    if (unmatched) {\n      // whitespace needed after combinator?\n      if (tokens.length > 0 && /^[~+>]$/.test(tokens[tokens.length - 1])) {\n        tokens.push(\" \");\n      }\n\n      // save unmatched text\n      tokens.push(unmatched);\n    }\n  }\n\n  var tokens = [],\n    match,\n    unmatched,\n    regex,\n    state = [0],\n    next_match_idx = 0,\n    prev_match_idx,\n    not_escaped_pattern = /(?:[^\\\\]|(?:^|[^\\\\])(?:\\\\\\\\)+)$/,\n    whitespace_pattern = /^\\s+$/,\n    state_patterns = [\n      /\\s+|\\/\\*|[\"'>~+[(]/g, // general\n      /\\s+|\\/\\*|[\"'[\\]()]/g, // [..] set\n      /\\s+|\\/\\*|[\"'[\\]()]/g, // (..) set\n      null, // string literal (placeholder)\n      /\\*\\//g, // comment\n    ];\n  sel = sel.trim();\n\n  // eslint-disable-next-line no-constant-condition\n  while (true) {\n    unmatched = \"\";\n\n    regex = state_patterns[state[state.length - 1]];\n\n    regex.lastIndex = next_match_idx;\n    match = regex.exec(sel);\n\n    // matched text to process?\n    if (match) {\n      prev_match_idx = next_match_idx;\n      next_match_idx = regex.lastIndex;\n\n      // collect the previous string chunk not matched before this token\n      if (prev_match_idx < next_match_idx - match[0].length) {\n        unmatched = sel.substring(\n          prev_match_idx,\n          next_match_idx - match[0].length\n        );\n      }\n\n      // general, [ ] pair, ( ) pair?\n      if (state[state.length - 1] < 3) {\n        saveUnmatched();\n\n        // starting a [ ] pair?\n        if (match[0] === \"[\") {\n          state.push(1);\n        }\n        // starting a ( ) pair?\n        else if (match[0] === \"(\") {\n          state.push(2);\n        }\n        // starting a string literal?\n        else if (/^[\"']$/.test(match[0])) {\n          state.push(3);\n          state_patterns[3] = new RegExp(match[0], \"g\");\n        }\n        // starting a comment?\n        else if (match[0] === \"/*\") {\n          state.push(4);\n        }\n        // ending a [ ] or ( ) pair?\n        else if (/^[\\])]$/.test(match[0]) && state.length > 0) {\n          state.pop();\n        }\n        // handling whitespace or a combinator?\n        else if (/^(?:\\s+|[~+>])$/.test(match[0])) {\n          // need to insert whitespace before?\n          if (\n            tokens.length > 0 &&\n            !whitespace_pattern.test(tokens[tokens.length - 1]) &&\n            state[state.length - 1] === 0\n          ) {\n            // add normalized whitespace\n            tokens.push(\" \");\n          }\n\n          // case-insensitive attribute selector CSS L4\n          if (\n            state[state.length - 1] === 1 &&\n            tokens.length === 5 &&\n            tokens[2].charAt(tokens[2].length - 1) === \"=\"\n          ) {\n            tokens[4] = \" \" + tokens[4];\n          }\n\n          // whitespace token we can skip?\n          if (whitespace_pattern.test(match[0])) {\n            continue;\n          }\n        }\n\n        // save matched text\n        tokens.push(match[0]);\n      }\n      // otherwise, string literal or comment\n      else {\n        // save unmatched text\n        tokens[tokens.length - 1] += unmatched;\n\n        // unescaped terminator to string literal or comment?\n        if (not_escaped_pattern.test(tokens[tokens.length - 1])) {\n          // comment terminator?\n          if (state[state.length - 1] === 4) {\n            // ok to drop comment?\n            if (\n              tokens.length < 2 ||\n              whitespace_pattern.test(tokens[tokens.length - 2])\n            ) {\n              tokens.pop();\n            }\n            // otherwise, turn comment into whitespace\n            else {\n              tokens[tokens.length - 1] = \" \";\n            }\n\n            // handled already\n            match[0] = \"\";\n          }\n\n          state.pop();\n        }\n\n        // append matched text to existing token\n        tokens[tokens.length - 1] += match[0];\n      }\n    }\n    // otherwise, end of processing (no more matches)\n    else {\n      unmatched = sel.substr(next_match_idx);\n      saveUnmatched();\n\n      break;\n    }\n  }\n\n  return tokens.join(\"\").trim();\n}\n","import { normalizeSelector } from './normalize';\n\n/**\n* Finds first matching elements on the page that may be in a shadow root using a complex selector of n-depth\n*\n* Don't have to specify all shadow roots to button, tree is travered to find the correct element\n*\n* Example querySelectorAllDeep('downloads-item:nth-child(4) #remove');\n*\n* Example should work on chrome://downloads outputting the remove button inside of a download card component\n*\n* Example find first active download link element querySelectorDeep('#downloads-list .is-active a[href^=\"https://\"]');\n*\n* Another example querySelectorAllDeep('#downloads-list div#title-area + a');\ne.g.\n*/\nexport function querySelectorAllDeep(selector, root = document, allElements = null) {\n    return _querySelectorDeep(selector, true, root, allElements);\n}\n\nexport function querySelectorDeep(selector, root = document, allElements = null) {\n    return _querySelectorDeep(selector, false, root, allElements);\n}\n\nfunction _querySelectorDeep(selector, findMany, root, allElements = null) {\n    selector = normalizeSelector(selector);\n    let lightElement = root.querySelector(selector);\n\n    if (document.head.createShadowRoot || document.head.attachShadow) {\n        // no need to do any special if selector matches something specific in light-dom\n        if (!findMany && lightElement) {\n            return lightElement;\n        }\n\n        // split on commas because those are a logical divide in the operation\n        const selectionsToMake = splitByCharacterUnlessQuoted(selector, ',');\n\n        return selectionsToMake.reduce((acc, minimalSelector) => {\n            // if not finding many just reduce the first match\n            if (!findMany && acc) {\n                return acc;\n            }\n            // do best to support complex selectors and split the query\n            const splitSelector = splitByCharacterUnlessQuoted(minimalSelector\n                    //remove white space at start of selector\n                    .replace(/^\\s+/g, '')\n                    .replace(/\\s*([>+~]+)\\s*/g, '$1'), ' ')\n                    // filter out entry white selectors\n                    .filter((entry) => !!entry)\n                    // convert \"a > b\" to [\"a\", \"b\"]\n                    .map((entry) => splitByCharacterUnlessQuoted(entry, '>'));\n\n            const possibleElementsIndex = splitSelector.length - 1;\n            const lastSplitPart = splitSelector[possibleElementsIndex][splitSelector[possibleElementsIndex].length - 1];\n            const possibleElements = collectAllElementsDeep(lastSplitPart, root, allElements);\n            const findElements = findMatchingElement(splitSelector, possibleElementsIndex, root);\n            if (findMany) {\n                acc = acc.concat(possibleElements.filter(findElements));\n                return acc;\n            } else {\n                acc = possibleElements.find(findElements);\n                return acc || null;\n            }\n        }, findMany ? [] : null);\n\n\n    } else {\n        if (!findMany) {\n            return lightElement;\n        } else {\n            return root.querySelectorAll(selector);\n        }\n    }\n\n}\n\nfunction findMatchingElement(splitSelector, possibleElementsIndex, root) {\n    return (element) => {\n        let position = possibleElementsIndex;\n        let parent = element;\n        let foundElement = false;\n        while (parent && !isDocumentNode(parent)) {\n            let foundMatch = true;\n            if (splitSelector[position].length === 1) {\n                foundMatch = parent.matches(splitSelector[position]);\n            } else {\n                // selector is in the format \"a > b\"\n                // make sure a few parents match in order\n                const reversedParts = ([]).concat(splitSelector[position]).reverse();\n                let newParent = parent;\n                for (const part of reversedParts) {\n                    if (!newParent || !newParent.matches(part)) {\n                        foundMatch = false;\n                        break;\n                    }\n                    newParent = findParentOrHost(newParent, root);\n                }\n            }\n\n            if (foundMatch && position === 0) {\n                foundElement = true;\n                break;\n            }\n            if (foundMatch) {\n                position--;\n            }\n            parent = findParentOrHost(parent, root);\n        }\n        return foundElement;\n    };\n\n}\n\nfunction splitByCharacterUnlessQuoted(selector, character) {\n    return selector.match(/\\\\?.|^$/g).reduce((p, c) => {\n        if (c === '\"' && !p.sQuote) {\n            p.quote ^= 1;\n            p.a[p.a.length - 1] += c;\n        } else if (c === '\\'' && !p.quote) {\n            p.sQuote ^= 1;\n            p.a[p.a.length - 1] += c;\n\n        } else if (!p.quote && !p.sQuote && c === character) {\n            p.a.push('');\n        } else {\n            p.a[p.a.length - 1] += c;\n        }\n        return p;\n    }, { a: [''] }).a;\n}\n\n/**\n * Checks if the node is a document node or not.\n * @param {Node} node\n * @returns {node is Document | DocumentFragment}\n */\nfunction isDocumentNode(node) {\n    return node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.DOCUMENT_NODE;\n}\n\nfunction findParentOrHost(element, root) {\n    const parentNode = element.parentNode;\n    return (parentNode && parentNode.host && parentNode.nodeType === 11) ? parentNode.host : parentNode === root ? null : parentNode;\n}\n\n/**\n * Finds all elements on the page, inclusive of those within shadow roots.\n * @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'\n * @return {!Array<string>} List of anchor hrefs.\n * @author ebidel@ (Eric Bidelman)\n * License Apache-2.0\n */\nexport function collectAllElementsDeep(selector = null, root, cachedElements = null) {\n    let allElements = [];\n\n    if (cachedElements) {\n        allElements = cachedElements;\n    } else {\n        const findAllElements = function(nodes) {\n            for (let i = 0; i < nodes.length; i++) {\n                const el = nodes[i];\n                allElements.push(el);\n                // If the element has a shadow root, dig deeper.\n                if (el.shadowRoot) {\n                    findAllElements(el.shadowRoot.querySelectorAll('*'));\n                }\n            }\n        };\n        if(root.shadowRoot) {\n            findAllElements(root.shadowRoot.querySelectorAll('*'));\n        }\n        findAllElements(root.querySelectorAll('*'));\n    }\n\n    return selector ? allElements.filter(el => el.matches(selector)) : allElements;\t}\n\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    if (typeof b !== \"function\" && b !== null)\r\n        throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n    function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n    var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n    var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n    var _, done = false;\r\n    for (var i = decorators.length - 1; i >= 0; i--) {\r\n        var context = {};\r\n        for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n        for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n        context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n        var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n        if (kind === \"accessor\") {\r\n            if (result === void 0) continue;\r\n            if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n            if (_ = accept(result.get)) descriptor.get = _;\r\n            if (_ = accept(result.set)) descriptor.set = _;\r\n            if (_ = accept(result.init)) initializers.unshift(_);\r\n        }\r\n        else if (_ = accept(result)) {\r\n            if (kind === \"field\") initializers.unshift(_);\r\n            else descriptor[key] = _;\r\n        }\r\n    }\r\n    if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n    done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n    var useValue = arguments.length > 2;\r\n    for (var i = 0; i < initializers.length; i++) {\r\n        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n    }\r\n    return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n    return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n    if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n    return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n    return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    var desc = Object.getOwnPropertyDescriptor(m, k);\r\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n        desc = { enumerable: true, get: function() { return m[k]; } };\r\n    }\r\n    Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n        if (ar || !(i in from)) {\r\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n            ar[i] = from[i];\r\n        }\r\n    }\r\n    return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n    o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n    ownKeys = Object.getOwnPropertyNames || function (o) {\r\n        var ar = [];\r\n        for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n        return ar;\r\n    };\r\n    return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n    __setModuleDefault(result, mod);\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n    if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n    return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n    if (value !== null && value !== void 0) {\r\n        if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n        var dispose, inner;\r\n        if (async) {\r\n            if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n            dispose = value[Symbol.asyncDispose];\r\n        }\r\n        if (dispose === void 0) {\r\n            if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n            dispose = value[Symbol.dispose];\r\n            if (async) inner = dispose;\r\n        }\r\n        if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n        if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n        env.stack.push({ value: value, dispose: dispose, async: async });\r\n    }\r\n    else if (async) {\r\n        env.stack.push({ async: true });\r\n    }\r\n    return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n    var e = new Error(message);\r\n    return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n    function fail(e) {\r\n        env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n        env.hasError = true;\r\n    }\r\n    var r, s = 0;\r\n    function next() {\r\n        while (r = env.stack.pop()) {\r\n            try {\r\n                if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n                if (r.dispose) {\r\n                    var result = r.dispose.call(r.value);\r\n                    if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n                }\r\n                else s |= 1;\r\n            }\r\n            catch (e) {\r\n                fail(e);\r\n            }\r\n        }\r\n        if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n        if (env.hasError) throw env.error;\r\n    }\r\n    return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n    if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n        return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n            return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n        });\r\n    }\r\n    return path;\r\n}\r\n\r\nexport default {\r\n    __extends: __extends,\r\n    __assign: __assign,\r\n    __rest: __rest,\r\n    __decorate: __decorate,\r\n    __param: __param,\r\n    __esDecorate: __esDecorate,\r\n    __runInitializers: __runInitializers,\r\n    __propKey: __propKey,\r\n    __setFunctionName: __setFunctionName,\r\n    __metadata: __metadata,\r\n    __awaiter: __awaiter,\r\n    __generator: __generator,\r\n    __createBinding: __createBinding,\r\n    __exportStar: __exportStar,\r\n    __values: __values,\r\n    __read: __read,\r\n    __spread: __spread,\r\n    __spreadArrays: __spreadArrays,\r\n    __spreadArray: __spreadArray,\r\n    __await: __await,\r\n    __asyncGenerator: __asyncGenerator,\r\n    __asyncDelegator: __asyncDelegator,\r\n    __asyncValues: __asyncValues,\r\n    __makeTemplateObject: __makeTemplateObject,\r\n    __importStar: __importStar,\r\n    __importDefault: __importDefault,\r\n    __classPrivateFieldGet: __classPrivateFieldGet,\r\n    __classPrivateFieldSet: __classPrivateFieldSet,\r\n    __classPrivateFieldIn: __classPrivateFieldIn,\r\n    __addDisposableResource: __addDisposableResource,\r\n    __disposeResources: __disposeResources,\r\n    __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class\n * @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.\n * @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.\n *\n * @example\n * const point = new Point(-77, 38);\n */\nexport default function Point(x, y) {\n    this.x = x;\n    this.y = y;\n}\n\nPoint.prototype = {\n    /**\n     * Clone this point, returning a new point that can be modified\n     * without affecting the old one.\n     * @return {Point} the clone\n     */\n    clone() { return new Point(this.x, this.y); },\n\n    /**\n     * Add this point's x & y coordinates to another point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    add(p) { return this.clone()._add(p); },\n\n    /**\n     * Subtract this point's x & y coordinates to from point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    sub(p) { return this.clone()._sub(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    multByPoint(p) { return this.clone()._multByPoint(p); },\n\n    /**\n     * Divide this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    divByPoint(p) { return this.clone()._divByPoint(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {number} k factor\n     * @return {Point} output point\n     */\n    mult(k) { return this.clone()._mult(k); },\n\n    /**\n     * Divide this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {number} k factor\n     * @return {Point} output point\n     */\n    div(k) { return this.clone()._div(k); },\n\n    /**\n     * Rotate this point around the 0, 0 origin by an angle a,\n     * given in radians\n     * @param {number} a angle to rotate around, in radians\n     * @return {Point} output point\n     */\n    rotate(a) { return this.clone()._rotate(a); },\n\n    /**\n     * Rotate this point around p point by an angle a,\n     * given in radians\n     * @param {number} a angle to rotate around, in radians\n     * @param {Point} p Point to rotate around\n     * @return {Point} output point\n     */\n    rotateAround(a, p) { return this.clone()._rotateAround(a, p); },\n\n    /**\n     * Multiply this point by a 4x1 transformation matrix\n     * @param {[number, number, number, number]} m transformation matrix\n     * @return {Point} output point\n     */\n    matMult(m) { return this.clone()._matMult(m); },\n\n    /**\n     * Calculate this point but as a unit vector from 0, 0, meaning\n     * that the distance from the resulting point to the 0, 0\n     * coordinate will be equal to 1 and the angle from the resulting\n     * point to the 0, 0 coordinate will be the same as before.\n     * @return {Point} unit vector point\n     */\n    unit() { return this.clone()._unit(); },\n\n    /**\n     * Compute a perpendicular point, where the new y coordinate\n     * is the old x coordinate and the new x coordinate is the old y\n     * coordinate multiplied by -1\n     * @return {Point} perpendicular point\n     */\n    perp() { return this.clone()._perp(); },\n\n    /**\n     * Return a version of this point with the x & y coordinates\n     * rounded to integers.\n     * @return {Point} rounded point\n     */\n    round() { return this.clone()._round(); },\n\n    /**\n     * Return the magnitude of this point: this is the Euclidean\n     * distance from the 0, 0 coordinate to this point's x and y\n     * coordinates.\n     * @return {number} magnitude\n     */\n    mag() {\n        return Math.sqrt(this.x * this.x + this.y * this.y);\n    },\n\n    /**\n     * Judge whether this point is equal to another point, returning\n     * true or false.\n     * @param {Point} other the other point\n     * @return {boolean} whether the points are equal\n     */\n    equals(other) {\n        return this.x === other.x &&\n               this.y === other.y;\n    },\n\n    /**\n     * Calculate the distance from this point to another point\n     * @param {Point} p the other point\n     * @return {number} distance\n     */\n    dist(p) {\n        return Math.sqrt(this.distSqr(p));\n    },\n\n    /**\n     * Calculate the distance from this point to another point,\n     * without the square root step. Useful if you're comparing\n     * relative distances.\n     * @param {Point} p the other point\n     * @return {number} distance\n     */\n    distSqr(p) {\n        const dx = p.x - this.x,\n            dy = p.y - this.y;\n        return dx * dx + dy * dy;\n    },\n\n    /**\n     * Get the angle from the 0, 0 coordinate to this point, in radians\n     * coordinates.\n     * @return {number} angle\n     */\n    angle() {\n        return Math.atan2(this.y, this.x);\n    },\n\n    /**\n     * Get the angle from this point to another point, in radians\n     * @param {Point} b the other point\n     * @return {number} angle\n     */\n    angleTo(b) {\n        return Math.atan2(this.y - b.y, this.x - b.x);\n    },\n\n    /**\n     * Get the angle between this point and another point, in radians\n     * @param {Point} b the other point\n     * @return {number} angle\n     */\n    angleWith(b) {\n        return this.angleWithSep(b.x, b.y);\n    },\n\n    /**\n     * Find the angle of the two vectors, solving the formula for\n     * the cross product a x b = |a||b|sin(θ) for θ.\n     * @param {number} x the x-coordinate\n     * @param {number} y the y-coordinate\n     * @return {number} the angle in radians\n     */\n    angleWithSep(x, y) {\n        return Math.atan2(\n            this.x * y - this.y * x,\n            this.x * x + this.y * y);\n    },\n\n    /** @param {[number, number, number, number]} m */\n    _matMult(m) {\n        const x = m[0] * this.x + m[1] * this.y,\n            y = m[2] * this.x + m[3] * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _add(p) {\n        this.x += p.x;\n        this.y += p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _sub(p) {\n        this.x -= p.x;\n        this.y -= p.y;\n        return this;\n    },\n\n    /** @param {number} k */\n    _mult(k) {\n        this.x *= k;\n        this.y *= k;\n        return this;\n    },\n\n    /** @param {number} k */\n    _div(k) {\n        this.x /= k;\n        this.y /= k;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _multByPoint(p) {\n        this.x *= p.x;\n        this.y *= p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _divByPoint(p) {\n        this.x /= p.x;\n        this.y /= p.y;\n        return this;\n    },\n\n    _unit() {\n        this._div(this.mag());\n        return this;\n    },\n\n    _perp() {\n        const y = this.y;\n        this.y = this.x;\n        this.x = -y;\n        return this;\n    },\n\n    /** @param {number} angle */\n    _rotate(angle) {\n        const cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = cos * this.x - sin * this.y,\n            y = sin * this.x + cos * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    /**\n     * @param {number} angle\n     * @param {Point} p\n     */\n    _rotateAround(angle, p) {\n        const cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n            y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    _round() {\n        this.x = Math.round(this.x);\n        this.y = Math.round(this.y);\n        return this;\n    },\n\n    constructor: Point\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, return it unchanged.\n * @param {Point | [number, number] | {x: number, y: number}} p input value\n * @return {Point} constructed point.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (p) {\n    if (p instanceof Point) {\n        return /** @type {Point} */ (p);\n    }\n    if (Array.isArray(p)) {\n        return new Point(+p[0], +p[1]);\n    }\n    if (p.x !== undefined && p.y !== undefined) {\n        return new Point(+p.x, +p.y);\n    }\n    throw new Error('Expected [x, y] or {x, y} point format');\n};\n","'use strict';\n\nmodule.exports = UnitBezier;\n\nfunction UnitBezier(p1x, p1y, p2x, p2y) {\n    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n    this.cx = 3.0 * p1x;\n    this.bx = 3.0 * (p2x - p1x) - this.cx;\n    this.ax = 1.0 - this.cx - this.bx;\n\n    this.cy = 3.0 * p1y;\n    this.by = 3.0 * (p2y - p1y) - this.cy;\n    this.ay = 1.0 - this.cy - this.by;\n\n    this.p1x = p1x;\n    this.p1y = p1y;\n    this.p2x = p2x;\n    this.p2y = p2y;\n}\n\nUnitBezier.prototype = {\n    sampleCurveX: function (t) {\n        // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n        return ((this.ax * t + this.bx) * t + this.cx) * t;\n    },\n\n    sampleCurveY: function (t) {\n        return ((this.ay * t + this.by) * t + this.cy) * t;\n    },\n\n    sampleCurveDerivativeX: function (t) {\n        return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n    },\n\n    solveCurveX: function (x, epsilon) {\n        if (epsilon === undefined) epsilon = 1e-6;\n\n        if (x < 0.0) return 0.0;\n        if (x > 1.0) return 1.0;\n\n        var t = x;\n\n        // First try a few iterations of Newton's method - normally very fast.\n        for (var i = 0; i < 8; i++) {\n            var x2 = this.sampleCurveX(t) - x;\n            if (Math.abs(x2) < epsilon) return t;\n\n            var d2 = this.sampleCurveDerivativeX(t);\n            if (Math.abs(d2) < 1e-6) break;\n\n            t = t - x2 / d2;\n        }\n\n        // Fall back to the bisection method for reliability.\n        var t0 = 0.0;\n        var t1 = 1.0;\n        t = x;\n\n        for (i = 0; i < 20; i++) {\n            x2 = this.sampleCurveX(t);\n            if (Math.abs(x2 - x) < epsilon) break;\n\n            if (x > x2) {\n                t0 = t;\n            } else {\n                t1 = t;\n            }\n\n            t = (t1 - t0) * 0.5 + t0;\n        }\n\n        return t;\n    },\n\n    solve: function (x, epsilon) {\n        return this.sampleCurveY(this.solveCurveX(x, epsilon));\n    }\n};\n","let supportsOffscreenCanvas: boolean;\n\nexport function offscreenCanvasSupported(): boolean {\n    if (supportsOffscreenCanvas == null) {\n        supportsOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' &&\n            new OffscreenCanvas(1, 1).getContext('2d') &&\n            typeof createImageBitmap === 'function';\n    }\n\n    return supportsOffscreenCanvas;\n}\n","import {offscreenCanvasSupported} from './offscreen_canvas_supported';\n\nlet offscreenCanvasDistorted: boolean;\n\n/**\n * Some browsers don't return the exact pixels from a canvas to prevent user fingerprinting (see #3185).\n * This function writes pixels to an OffscreenCanvas and reads them back using getImageData, returning false\n * if they don't match.\n *\n * @returns true if the browser supports OffscreenCanvas but it distorts getImageData results, false otherwise.\n */\nexport function isOffscreenCanvasDistorted(): boolean {\n    if (offscreenCanvasDistorted == null) {\n        offscreenCanvasDistorted = false;\n        if (offscreenCanvasSupported()) {\n            const size = 5;\n            const canvas = new OffscreenCanvas(size, size);\n            const context = canvas.getContext('2d', {willReadFrequently: true});\n            if (context) {\n                // fill each pixel with an RGB value that should make the byte at index i equal to i (except alpha channel):\n                // [0, 1, 2, 255, 4, 5, 6, 255, 8, 9, 10, 255, ...]\n                for (let i = 0; i < size * size; i++) {\n                    const base = i * 4;\n                    context.fillStyle = `rgb(${base},${base + 1},${base + 2})`;\n                    context.fillRect(i % size, Math.floor(i / size), 1, 1);\n                }\n                const data = context.getImageData(0, 0, size, size).data;\n                for (let i = 0; i < size * size * 4; i++) {\n                    if (i % 4 !== 3 && data[i] !== i) {\n                        offscreenCanvasDistorted = true;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    return offscreenCanvasDistorted || false;\n}\n","/**\n * Common utilities\n * @module glMatrix\n */\n\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== \"undefined\" ? Float32Array : Array;\nexport var RANDOM = Math.random;\nexport var ANGLE_ORDER = \"zyx\";\n\n/**\n * Symmetric round\n * see https://www.npmjs.com/package/round-half-up-symmetric#user-content-detailed-background\n *\n * @param {Number} a value to round\n */\nexport function round(a) {\n  if (a >= 0) return Math.round(a);\n  return a % 0.5 === 0 ? Math.floor(a) : Math.round(a);\n}\n\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\nexport function setMatrixArrayType(type) {\n  ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\nvar radian = 180 / Math.PI;\n\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\nexport function toRadian(a) {\n  return a * degree;\n}\n\n/**\n * Convert Radian To Degree\n *\n * @param {Number} a Angle in Radians\n */\nexport function toDegree(a) {\n  return a * radian;\n}\n\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a          The first number to test.\n * @param {Number} b          The second number to test.\n * @param {Number} tolerance  Absolute or relative tolerance (default glMatrix.EPSILON)\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\nexport function equals(a, b) {\n  var tolerance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EPSILON;\n  return Math.abs(a - b) <= tolerance * Math.max(1, Math.abs(a), Math.abs(b));\n}","import * as glMatrix from \"./common.js\";\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n  }\n  return out;\n}\n\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\nexport function fromValues(x, y, z, w) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\nexport function set(out, x, y, z, w) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  return out;\n}\n\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  out[3] = a[3] * b[3];\n  return out;\n}\n\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  out[3] = a[3] / b[3];\n  return out;\n}\n\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  out[3] = Math.ceil(a[3]);\n  return out;\n}\n\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  out[3] = Math.floor(a[3]);\n  return out;\n}\n\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  out[3] = Math.min(a[3], b[3]);\n  return out;\n}\n\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  out[3] = Math.max(a[3], b[3]);\n  return out;\n}\n\n/**\n * symmetric round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  out[2] = glMatrix.round(a[2]);\n  out[3] = glMatrix.round(a[3]);\n  return out;\n}\n\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  return out;\n}\n\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  return out;\n}\n\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return x * x + y * y + z * z + w * w;\n}\n\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return Math.sqrt(x * x + y * y + z * z + w * w);\n}\n\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return x * x + y * y + z * z + w * w;\n}\n\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = -a[3];\n  return out;\n}\n\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  out[3] = 1.0 / a[3];\n  return out;\n}\n\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  var len = x * x + y * y + z * z + w * w;\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n  }\n  out[0] = x * len;\n  out[1] = y * len;\n  out[2] = z * len;\n  out[3] = w * len;\n  return out;\n}\n\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} out the receiving vector\n * @param {ReadonlyVec4} u the first vector\n * @param {ReadonlyVec4} v the second vector\n * @param {ReadonlyVec4} w the third vector\n * @returns {vec4} result\n */\nexport function cross(out, u, v, w) {\n  var A = v[0] * w[1] - v[1] * w[0],\n    B = v[0] * w[2] - v[2] * w[0],\n    C = v[0] * w[3] - v[3] * w[0],\n    D = v[1] * w[2] - v[2] * w[1],\n    E = v[1] * w[3] - v[3] * w[1],\n    F = v[2] * w[3] - v[3] * w[2];\n  var G = u[0];\n  var H = u[1];\n  var I = u[2];\n  var J = u[3];\n  out[0] = H * F - I * E + J * D;\n  out[1] = -(G * F) + I * C - J * B;\n  out[2] = G * E - H * C + J * A;\n  out[3] = -(G * D) + H * B - I * A;\n  return out;\n}\n\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  var aw = a[3];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  out[3] = aw + t * (b[3] - aw);\n  return out;\n}\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {vec4} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\n\n  // Marsaglia, George. Choosing a Point from the Surface of a\n  // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n  // http://projecteuclid.org/euclid.aoms/1177692644;\n  var v1, v2, v3, v4;\n  var s1, s2;\n  var rand;\n  rand = glMatrix.RANDOM();\n  v1 = rand * 2 - 1;\n  v2 = (4 * glMatrix.RANDOM() - 2) * Math.sqrt(rand * -rand + rand);\n  s1 = v1 * v1 + v2 * v2;\n  rand = glMatrix.RANDOM();\n  v3 = rand * 2 - 1;\n  v4 = (4 * glMatrix.RANDOM() - 2) * Math.sqrt(rand * -rand + rand);\n  s2 = v3 * v3 + v4 * v4;\n  var d = Math.sqrt((1 - s1) / s2);\n  out[0] = scale * v1;\n  out[1] = scale * v2;\n  out[2] = scale * v3 * d;\n  out[3] = scale * v4 * d;\n  return out;\n}\n\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n    y = a[1],\n    z = a[2],\n    w = a[3];\n  out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n  out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n  out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n  out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n  return out;\n}\n\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q normalized quaternion to transform with\n * @returns {vec4} out\n */\nexport function transformQuat(out, a, q) {\n  // Fast Vector Rotation using Quaternions by Robert Eisele\n  // https://raw.org/proof/vector-rotation-using-quaternions/\n\n  var qx = q[0],\n    qy = q[1],\n    qz = q[2],\n    qw = q[3];\n  var vx = a[0],\n    vy = a[1],\n    vz = a[2];\n\n  // t = q x v\n  var tx = qy * vz - qz * vy;\n  var ty = qz * vx - qx * vz;\n  var tz = qx * vy - qy * vx;\n\n  // t = 2t\n  tx = tx + tx;\n  ty = ty + ty;\n  tz = tz + tz;\n\n  // v + w t + q x t\n  out[0] = vx + qw * tx + qy * tz - qz * ty;\n  out[1] = vy + qw * ty + qz * tx - qx * tz;\n  out[2] = vz + qw * tz + qx * ty - qy * tx;\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  return out;\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n  return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec4.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 4;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      vec[3] = a[i + 3];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n      a[i + 3] = vec[3];\n    }\n    return a;\n  };\n}();","/**\n * The maximum value of a coordinate in the internal tile coordinate system. Coordinates of\n * all source features normalized to this extent upon load.\n *\n * The value is a consequence of the following:\n *\n * * Vertex buffer store positions as signed 16 bit integers.\n * * One bit is lost for signedness to support tile buffers.\n * * One bit is lost because the line vertex buffer used to pack 1 bit of other data into the int.\n * * One bit is lost to support features extending past the extent on the right edge of the tile.\n * * This leaves us with 2^13 = 8192\n */\nexport const EXTENT = 8192;","import Point from '@mapbox/point-geometry';\nimport UnitBezier from '@mapbox/unitbezier';\nimport {isOffscreenCanvasDistorted} from './offscreen_canvas_distorted';\nimport type {Size} from './image';\nimport type {WorkerGlobalScopeInterface} from './web_worker';\nimport {mat3, mat4, quat, vec2, vec3, type vec4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport type {Event} from './evented';\n\n/**\n * Returns a new 64 bit float vec4 of zeroes.\n */\nexport function createVec4f64(): vec4 { return new Float64Array(4) as any; }\n/**\n * Returns a new 64 bit float vec3 of zeroes.\n */\nexport function createVec3f64(): vec3 { return new Float64Array(3) as any; }\n/**\n * Returns a new 64 bit float mat4 of zeroes.\n */\nexport function createMat4f64(): mat4 { return new Float64Array(16) as any; }\n/**\n * Returns a new 32 bit float mat4 of zeroes.\n */\nexport function createMat4f32(): mat4 { return new Float32Array(16) as any; }\n/**\n * Returns a new 64 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f64(): mat4 {\n    const m = new Float64Array(16) as any;\n    mat4.identity(m);\n    return m;\n}\n/**\n * Returns a new 32 bit float mat4 set to identity.\n */\nexport function createIdentityMat4f32(): mat4 {\n    const m = new Float32Array(16) as any;\n    mat4.identity(m);\n    return m;\n}\n\n/**\n * Returns a translation in tile units that correctly incorporates the view angle and the *-translate and *-translate-anchor properties.\n * @param inViewportPixelUnitsUnits - True when the units accepted by the matrix are in viewport pixels instead of tile units.\n */\nexport function translatePosition(\n    transform: { bearingInRadians: number; zoom: number },\n    tile: { tileID: OverscaledTileID; tileSize: number },\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    inViewportPixelUnitsUnits: boolean = false\n): [number, number] {\n    if (!translate[0] && !translate[1]) return [0, 0];\n\n    const angle = inViewportPixelUnitsUnits ?\n        (translateAnchor === 'map' ? -transform.bearingInRadians : 0) :\n        (translateAnchor === 'viewport' ? transform.bearingInRadians : 0);\n\n    if (angle) {\n        const sinA = Math.sin(angle);\n        const cosA = Math.cos(angle);\n        translate = [\n            translate[0] * cosA - translate[1] * sinA,\n            translate[0] * sinA + translate[1] * cosA\n        ];\n    }\n\n    return [\n        inViewportPixelUnitsUnits ? translate[0] : pixelsToTileUnits(tile, translate[0], transform.zoom),\n        inViewportPixelUnitsUnits ? translate[1] : pixelsToTileUnits(tile, translate[1], transform.zoom)];\n}\n\n/**\n * Returns the signed distance between a point and a plane.\n * @param plane - The plane equation, in the form where the first three components are the normal and the fourth component is the plane's distance from origin along normal.\n * @param point - The point whose distance from plane is returned.\n * @returns Signed distance of the point from the plane. Positive distances are in the half space where the plane normal points to, negative otherwise.\n */\nexport function pointPlaneSignedDistance(\n    plane: vec4 | [number, number, number, number],\n    point: vec3 | [number, number, number]\n): number {\n    return plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3];\n}\n\n/**\n * Finds an intersection points of three planes. Returns `null` if no such (single) point exists.\n * The planes *must* be in Hessian normal form - their xyz components must form a unit vector.\n */\nexport function threePlaneIntersection(plane0: vec4, plane1: vec4, plane2: vec4): vec3 | null {\n    // https://mathworld.wolfram.com/Plane-PlaneIntersection.html\n    const det = mat3.determinant([\n        plane0[0], plane0[1], plane0[2],\n        plane1[0], plane1[1], plane1[2],\n        plane2[0], plane2[1], plane2[2]\n    ] as mat3);\n    if (det === 0) {\n        return null;\n    }\n    const cross12 = vec3.cross([] as any, [plane1[0], plane1[1], plane1[2]], [plane2[0], plane2[1], plane2[2]]);\n    const cross20 = vec3.cross([] as any, [plane2[0], plane2[1], plane2[2]], [plane0[0], plane0[1], plane0[2]]);\n    const cross01 = vec3.cross([] as any, [plane0[0], plane0[1], plane0[2]], [plane1[0], plane1[1], plane1[2]]);\n    const sum = vec3.scale([] as any, cross12, -plane0[3]);\n    vec3.add(sum, sum, vec3.scale([] as any, cross20, -plane1[3]));\n    vec3.add(sum, sum, vec3.scale([] as any, cross01, -plane2[3]));\n    vec3.scale(sum, sum, 1.0 / det);\n    return sum;\n}\n\n/**\n * Returns a parameter `t` such that the point obtained by\n * `origin + direction * t` lies on the given plane.\n * If the ray is parallel to the plane, returns null.\n * Returns a negative value if the ray is pointing away from the plane.\n * Direction does not need to be normalized.\n */\nexport function rayPlaneIntersection(origin: vec3, direction: vec3, plane: vec4): number | null {\n    const dotOriginPlane = origin[0] * plane[0] + origin[1] * plane[1] + origin[2] * plane[2];\n    const dotDirectionPlane = direction[0] * plane[0] + direction[1] * plane[1] + direction[2] * plane[2];\n    if (dotDirectionPlane === 0) {\n        return null;\n    }\n    return (-dotOriginPlane -plane[3]) / dotDirectionPlane;\n}\n\n/**\n * Solves a quadratic equation in the form ax^2 + bx + c = 0 and returns its roots in no particular order.\n * Returns null if the equation has no roots or if it has infinitely many roots.\n */\nexport function solveQuadratic(a: number, b: number, c: number): {\n    t0: number;\n    t1: number;\n} {\n    const d = b * b - 4 * a * c;\n    if (d < 0 || (a === 0 && b === 0)) {\n        return null;\n    }\n\n    // Uses a more precise solution from the book Ray Tracing Gems, chapter 7.\n    // https://www.realtimerendering.com/raytracinggems/rtg/index.html\n    const q = -0.5 * (b + Math.sign(b) * Math.sqrt(d));\n    if (Math.abs(q) > 1e-12) {\n        return {\n            t0: c / q,\n            t1: q / a\n        };\n    } else {\n        // Use the schoolbook way if q is too small\n        return {\n            t0: (-b + Math.sqrt(d)) * 0.5 / a,\n            t1: (-b + Math.sqrt(d)) * 0.5 / a\n        };\n    }\n}\n\n/**\n * Returns the angle in radians between two 2D vectors.\n * The angle is signed and describes how much the first vector would need to be be rotated clockwise\n * (assuming X is right and Y is down) so that it points in the same direction as the second vector.\n * @param vec1x - The X component of the first vector.\n * @param vec1y - The Y component of the first vector.\n * @param vec2x - The X component of the second vector.\n * @param vec2y - The Y component of the second vector.\n * @returns The signed angle between the two vectors, in range -PI..PI.\n */\nexport function angleToRotateBetweenVectors2D(vec1x: number, vec1y: number, vec2x: number, vec2y: number): number {\n    // Normalize both vectors\n    const length1 = Math.sqrt(vec1x * vec1x + vec1y * vec1y);\n    const length2 = Math.sqrt(vec2x * vec2x + vec2y * vec2y);\n    vec1x /= length1;\n    vec1y /= length1;\n    vec2x /= length2;\n    vec2y /= length2;\n    const dot = vec1x * vec2x + vec1y * vec2y;\n    const angle = Math.acos(dot);\n    // dot second vector with vector to the right of first (-vec1y, vec1x)\n    const isVec2RightOfVec1 = (-vec1y * vec2x + vec1x * vec2y) > 0;\n    if (isVec2RightOfVec1) {\n        return angle;\n    } else {\n        return -angle;\n    }\n}\n\n/**\n * For two angles in degrees, returns how many degrees to add to the first angle in order to obtain the second angle.\n * The returned difference value is always the shorted of the two - its absolute value is never greater than 180°.\n */\nexport function differenceOfAnglesDegrees(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, 360);\n    const b = mod(degreesB, 360);\n    const diff1 = b - a;\n    const diff2 = (b > a) ? (diff1 - 360) : (diff1 + 360);\n    if (Math.abs(diff1) < Math.abs(diff2)) {\n        return diff1;\n    } else {\n        return diff2;\n    }\n}\n\n/**\n * For two angles in radians, returns how many radians to add to the first angle in order to obtain the second angle.\n * The returned difference value is always the shorted of the two - its absolute value is never greater than PI.\n */\nexport function differenceOfAnglesRadians(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, Math.PI * 2);\n    const b = mod(degreesB, Math.PI * 2);\n    const diff1 = b - a;\n    const diff2 = (b > a) ? (diff1 - Math.PI * 2) : (diff1 + Math.PI * 2);\n    if (Math.abs(diff1) < Math.abs(diff2)) {\n        return diff1;\n    } else {\n        return diff2;\n    }\n}\n\n/**\n * When given two angles in degrees, returns the angular distance between them - the shorter one of the two possible arcs.\n */\nexport function distanceOfAnglesDegrees(degreesA: number, degreesB: number): number {\n    const a = mod(degreesA, 360);\n    const b = mod(degreesB, 360);\n    return Math.min(\n        Math.abs(a - b),\n        Math.abs(a - b + 360),\n        Math.abs(a - b - 360)\n    );\n}\n\n/**\n * When given two angles in radians, returns the angular distance between them - the shorter one of the two possible arcs.\n */\nexport function distanceOfAnglesRadians(radiansA: number, radiansB: number): number {\n    const a = mod(radiansA, Math.PI * 2);\n    const b = mod(radiansB, Math.PI * 2);\n    return Math.min(\n        Math.abs(a - b),\n        Math.abs(a - b + Math.PI * 2),\n        Math.abs(a - b - Math.PI * 2)\n    );\n}\n\n/**\n * Modulo function, as opposed to javascript's `%`, which is a remainder.\n * This functions will return positive values, even if the first operand is negative.\n */\nexport function mod(n, m) {\n    return ((n % m) + m) % m;\n}\n\n/**\n * Takes a value in *old range*, linearly maps that range to *new range*, and returns the value in that new range.\n * Additionally, if the value is outside *old range*, it is clamped inside it.\n * Also works if one of the ranges is flipped (its `min` being larger than `max`).\n */\nexport function remapSaturate(value: number, oldRangeMin: number, oldRangeMax: number, newRangeMin: number, newRangeMax: number): number {\n    const inOldRange = clamp((value - oldRangeMin) / (oldRangeMax - oldRangeMin), 0.0, 1.0);\n    return lerp(newRangeMin, newRangeMax, inOldRange);\n}\n\n/**\n * Linearly interpolate between two values, similar to `mix` function from GLSL. No clamping is done.\n * @param a - The first value to interpolate. This value is returned when mix=0.\n * @param b - The second value to interpolate. This value is returned when mix=1.\n * @param mix - The interpolation factor. Range 0..1 interpolates between `a` and `b`, but values outside this range are also accepted.\n */\nexport function lerp(a: number, b: number, mix: number): number {\n    return a * (1.0 - mix) + b * mix;\n}\n\n/**\n * For a given collection of 2D points, returns their axis-aligned bounding box,\n * in the format [minX, minY, maxX, maxY].\n */\nexport function getAABB(points: Array<Point>): [number, number, number, number] {\n    let tlX = Infinity;\n    let tlY = Infinity;\n    let brX = -Infinity;\n    let brY = -Infinity;\n\n    for (const p of points) {\n        tlX = Math.min(tlX, p.x);\n        tlY = Math.min(tlY, p.y);\n        brX = Math.max(brX, p.x);\n        brY = Math.max(brY, p.y);\n    }\n\n    return [tlX, tlY, brX, brY];\n}\n\n/**\n * For a given set of tile ids, returns the edge tile ids for the bounding box.\n */\nexport function getEdgeTiles(tileIDs: OverscaledTileID[]): Set<OverscaledTileID> {\n    if (!tileIDs.length) return new Set<OverscaledTileID>();\n\n    // set a common zoom for calculation (highest zoom) to reproject all tiles to this same zoom\n    const targetZ = Math.max(...tileIDs.map(id => id.canonical.z));\n\n    // vars to store the min and max tile x/y coordinates for edge finding\n    let minX = Infinity, maxX = -Infinity;\n    let minY = Infinity, maxY = -Infinity;\n\n    // project all tiles to targetZ while maintaining the reference to the original tile\n    const projected: {id: OverscaledTileID; x: number; y: number}[] = [];\n    for (const id of tileIDs) {\n        const {x, y, z} = id.canonical;\n        const scale = Math.pow(2, targetZ - z);\n        const px = x * scale;\n        const py = y * scale;\n\n        projected.push({id, x: px, y: py});\n\n        if (px < minX) minX = px;\n        if (px > maxX) maxX = px;\n        if (py < minY) minY = py;\n        if (py > maxY) maxY = py;\n    }\n\n    // find edge tiles using the reprojected tile ids\n    const edgeTiles: Set<OverscaledTileID> = new Set<OverscaledTileID>();\n    for (const p of projected) {\n        if (p.x === minX || p.x === maxX || p.y === minY || p.y === maxY) {\n            edgeTiles.add(p.id);\n        }\n    }\n\n    return edgeTiles;\n}\n\n/**\n * Given a value `t` that varies between 0 and 1, return\n * an interpolation function that eases between 0 and 1 in a pleasing\n * cubic in-out fashion.\n */\nexport function easeCubicInOut(t: number): number {\n    if (t <= 0) return 0;\n    if (t >= 1) return 1;\n    const t2 = t * t,\n        t3 = t2 * t;\n    return 4 * (t < 0.5 ? t3 : 3 * (t - t2) + t3 - 0.75);\n}\n\n/**\n * Given given (x, y), (x1, y1) control points for a bezier curve,\n * return a function that interpolates along that curve.\n *\n * @param p1x - control point 1 x coordinate\n * @param p1y - control point 1 y coordinate\n * @param p2x - control point 2 x coordinate\n * @param p2y - control point 2 y coordinate\n */\nexport function bezier(p1x: number, p1y: number, p2x: number, p2y: number): (t: number) => number {\n    const bezier = new UnitBezier(p1x, p1y, p2x, p2y);\n    return (t: number) => {\n        return bezier.solve(t);\n    };\n}\n\n/**\n * A default bezier-curve powered easing function with\n * control points (0.25, 0.1) and (0.25, 1)\n */\nexport const defaultEasing = bezier(0.25, 0.1, 0.25, 1);\n\n/**\n * constrain n to the given range via min + max\n *\n * @param n - value\n * @param min - the minimum value to be returned\n * @param max - the maximum value to be returned\n * @returns the clamped value\n */\nexport function clamp(n: number, min: number, max: number): number {\n    return Math.min(max, Math.max(min, n));\n}\n\n/**\n * constrain n to the given range, excluding the minimum, via modular arithmetic\n *\n * @param n - value\n * @param min - the minimum value to be returned, exclusive\n * @param max - the maximum value to be returned, inclusive\n * @returns constrained number\n */\nexport function wrap(n: number, min: number, max: number): number {\n    const d = max - min;\n    const w = ((n - min) % d + d) % d + min;\n    return (w === min) ? max : w;\n}\n\n/**\n * Compute the difference between the keys in one object and the keys\n * in another object.\n *\n * @returns keys difference\n */\nexport function keysDifference<S, T>(\n    obj: {[key: string]: S},\n    other: {[key: string]: T}\n): Array<string> {\n    const difference = [];\n    for (const i in obj) {\n        if (!(i in other)) {\n            difference.push(i);\n        }\n    }\n    return difference;\n}\n\n/**\n * Given a destination object and optionally many source objects,\n * copy all properties from the source objects into the destination.\n * The last source object given overrides properties from previous\n * source objects.\n *\n * @param dest - destination object\n * @param sources - sources from which properties are pulled\n */\nexport function extend<T extends {}, U>(dest: T, source: U): T & U;\nexport function extend<T extends {}, U, V>(dest: T, source1: U, source2: V): T & U & V;\nexport function extend<T extends {}, U, V, W>(dest: T, source1: U, source2: V, source3: W): T & U & V & W;\nexport function extend(dest: object, ...sources: Array<any>): any;\nexport function extend(dest: object, ...sources: Array<any>): any {\n    for (const src of sources) {\n        for (const k in src) {\n            dest[k] = src[k];\n        }\n    }\n    return dest;\n}\n\n// See https://stackoverflow.com/questions/49401866/all-possible-keys-of-an-union-type\ntype KeysOfUnion<T> = T extends T ? keyof T: never;\n\n/**\n * Given an object and a number of properties as strings, return version\n * of that object with only those properties.\n *\n * @param src - the object\n * @param properties - an array of property names chosen\n * to appear on the resulting object.\n * @returns object with limited properties.\n * @example\n * ```ts\n * let foo = { name: 'Charlie', age: 10 };\n * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }\n * ```\n */\nexport function pick<T extends object>(src: T, properties: Array<KeysOfUnion<T>>): Partial<T> {\n    const result: Partial<T> = {};\n    for (let i = 0; i < properties.length; i++) {\n        const k = properties[i];\n        if (k in src) {\n            result[k] = src[k];\n        }\n    }\n    return result;\n}\n\nlet id = 1;\n\n/**\n * Return a unique numeric id, starting at 1 and incrementing with\n * each call.\n *\n * @returns unique numeric id.\n */\nexport function uniqueId(): number {\n    return id++;\n}\n\n/**\n * Return whether a given value is a power of two\n */\nexport function isPowerOfTwo(value: number): boolean {\n    return (Math.log(value) / Math.LN2) % 1 === 0;\n}\n\n/**\n * Return the next power of two, or the input value if already a power of two\n */\nexport function nextPowerOfTwo(value: number): number {\n    if (value <= 1) return 1;\n    return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\n/**\n * Computes scaling from zoom level.\n */\nexport function zoomScale(zoom: number) { return Math.pow(2, zoom); }\n\n/**\n * Computes zoom level from scaling.\n */\nexport function scaleZoom(scale: number) { return Math.log(scale) / Math.LN2; }\n\n/**\n * Evaluates the snapped zoom level based on zoomSnap. If zoomSnap is 0 or less, the zoom level is returned unchanged.\n * If delta is provided, it performs directional snapping (ceil for zoom-in, floor for zoom-out).\n * @param zoom - The input zoom level\n * @param zoomSnap - The grid interval to snap to, e.g. 1.0 for 1.0 zoom levels, 0.5 for 0.5 zoom levels, etc.\n * @param delta - Optional scroll delta or direction. If positive, snaps up; if negative, snaps down.\n * @returns The snapped zoom level\n */\nexport function evaluateZoomSnap(zoom: number, zoomSnap: number, delta?: number): number {\n    if (zoomSnap <= 0) return zoom;\n    const inv = 1 / zoomSnap;\n    if (delta === undefined || Math.abs(delta) < 1e-10) {\n        return Math.round(zoom * inv) / inv;\n    }\n    return (delta > 0 ? Math.ceil(zoom * inv - 1e-9) : Math.floor(zoom * inv + 1e-10)) / inv;\n}\n\n/**\n * Create an object by mapping all the values of an existing object while\n * preserving their keys.\n */\nexport function mapObject(input: any, iterator: Function, context?: any): any {\n    const output = {};\n    for (const key in input) {\n        output[key] = iterator.call(context || this, input[key], key, input);\n    }\n    return output;\n}\n\n/**\n * Create an object by filtering out values of an existing object.\n */\nexport function filterObject(input: any, iterator: Function, context?: any): any {\n    const output = {};\n    for (const key in input) {\n        if (iterator.call(context || this, input[key], key, input)) {\n            output[key] = input[key];\n        }\n    }\n    return output;\n}\n\n/**\n * Deeply compares two object literals.\n * @param a - first object literal to be compared\n * @param b - second object literal to be compared\n * @returns true if the two object literals are deeply equal, false otherwise\n */\nexport function deepEqual(a?: unknown | null, b?: unknown | null): boolean {\n    if (Array.isArray(a)) {\n        if (!Array.isArray(b) || a.length !== b.length) return false;\n        for (let i = 0; i < a.length; i++) {\n            if (!deepEqual(a[i], b[i])) return false;\n        }\n        return true;\n    }\n    if (typeof a === 'object' && a !== null && b !== null) {\n        if (!(typeof b === 'object')) return false;\n        const keys = Object.keys(a);\n        if (keys.length !== Object.keys(b).length) return false;\n        for (const key in a) {\n            if (!deepEqual(a[key], b[key])) return false;\n        }\n        return true;\n    }\n    return a === b;\n}\n\n/**\n * Deeply clones two objects.\n */\nexport function clone<T>(input: T): T {\n    if (Array.isArray(input)) {\n        return input.map(clone) as any as T;\n    } else if (typeof input === 'object' && input) {\n        return mapObject(input, clone) as any as T;\n    } else {\n        return input;\n    }\n}\n\n/**\n * Check if two arrays have at least one common element.\n */\nexport function arraysIntersect<T>(a: Array<T>, b: Array<T>): boolean {\n    for (let l = 0; l < a.length; l++) {\n        if (b.indexOf(a[l]) >= 0) return true;\n    }\n    return false;\n}\n\n/**\n * Print a warning message to the console and ensure duplicate warning messages\n * are not printed.\n */\nconst warnOnceHistory: {[key: string]: boolean} = {};\n\nexport function warnOnce(message: string): void {\n    if (!warnOnceHistory[message]) {\n        // console isn't defined in some WebWorkers, see #2558\n        if (typeof console !== 'undefined') console.warn(message);\n        warnOnceHistory[message] = true;\n    }\n}\n\n/**\n * Indicates if the provided Points are in a counter clockwise (true) or clockwise (false) order\n *\n * @returns true for a counter clockwise set of points\n */\n// https://bryceboe.com/2006/10/23/line-segment-intersection-algorithm/\nexport function isCounterClockwise(a: Point, b: Point, c: Point): boolean {\n    return (c.y - a.y) * (b.x - a.x) > (b.y - a.y) * (c.x - a.x);\n}\n\n/**\n * For two lines a and b in 2d space, defined by any two points along the lines,\n * find the intersection point, or return null if the lines are parallel\n *\n * @param a1 - First point on line a\n * @param a2 - Second point on line a\n * @param b1 - First point on line b\n * @param b2 - Second point on line b\n *\n * @returns the intersection point of the two lines or null if they are parallel\n */\nexport function findLineIntersection(a1: Point, a2: Point, b1: Point, b2: Point): Point | null {\n    const aDeltaY = a2.y - a1.y;\n    const aDeltaX = a2.x - a1.x;\n    const bDeltaY = b2.y - b1.y;\n    const bDeltaX = b2.x - b1.x;\n\n    const denominator = (bDeltaY * aDeltaX) - (bDeltaX * aDeltaY);\n\n    if (denominator === 0) {\n        // Lines are parallel\n        return null;\n    }\n\n    const originDeltaY = a1.y - b1.y;\n    const originDeltaX = a1.x - b1.x;\n    const aInterpolation = (bDeltaX * originDeltaY - bDeltaY * originDeltaX) / denominator;\n\n    // Find intersection by projecting out from origin of first segment\n    return new Point(a1.x + (aInterpolation * aDeltaX), a1.y + (aInterpolation * aDeltaY));\n}\n\n/**\n * Converts spherical coordinates to cartesian coordinates.\n *\n * @param spherical - Spherical coordinates, in [radial, azimuthal, polar]\n * @returns cartesian coordinates in [x, y, z]\n */\n\nexport function sphericalToCartesian([r, azimuthal, polar]: [number, number, number]): {\n    x: number;\n    y: number;\n    z: number;\n} {\n    // We abstract \"north\"/\"up\" (compass-wise) to be 0° when really this is 90° (π/2):\n    // correct for that here\n    azimuthal += 90;\n\n    // Convert azimuthal and polar angles to radians\n    azimuthal *= Math.PI / 180;\n    polar *= Math.PI / 180;\n\n    return {\n        x: r * Math.cos(azimuthal) * Math.sin(polar),\n        y: r * Math.sin(azimuthal) * Math.sin(polar),\n        z: r * Math.cos(polar)\n    };\n}\n\n/**\n *  Returns true if the when run in the web-worker context.\n *\n * @returns `true` if the when run in the web-worker context.\n */\nexport function isWorker(self: any): self is WorkerGlobalScopeInterface {\n    // @ts-ignore\n    return typeof WorkerGlobalScope !== 'undefined' && typeof self !== 'undefined' && self instanceof WorkerGlobalScope;\n}\n\n/**\n * Parses data from 'Cache-Control' headers.\n *\n * @param cacheControl - Value of 'Cache-Control' header\n * @returns object containing parsed header info.\n */\n\nexport function parseCacheControl(cacheControl: string): any {\n    // Taken from [Wreck](https://github.com/hapijs/wreck)\n    const re = /(?:^|(?:\\s*\\,\\s*))([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)(?:\\=(?:([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)|(?:\\\"((?:[^\"\\\\]|\\\\.)*)\\\")))?/g;\n\n    const header = {};\n    cacheControl.replace(re, ($0, $1, $2, $3) => {\n        const value = $2 || $3;\n        header[$1] = value ? value.toLowerCase() : true;\n        return '';\n    });\n\n    if (header['max-age']) {\n        const maxAge = parseInt(header['max-age'], 10);\n        if (isNaN(maxAge)) delete header['max-age'];\n        else header['max-age'] = maxAge;\n    }\n\n    return header;\n}\n\nlet _isSafari = null;\n\n/**\n * Returns true when run in WebKit derived browsers.\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n *\n * @param scope - Since this function is used both on the main thread and WebWorker context,\n *      let the calling scope pass in the global scope object.\n * @returns `true` when run in WebKit derived browsers.\n */\nexport function isSafari(scope: any): boolean {\n    if (_isSafari == null) {\n        const userAgent = scope.navigator ? scope.navigator.userAgent : null;\n        _isSafari = !!scope.safari ||\n        !!(userAgent && (/\\b(iPad|iPhone|iPod)\\b/.test(userAgent) || (!!userAgent.match('Safari') && !userAgent.match('Chrome'))));\n    }\n    return _isSafari;\n}\n\nexport function storageAvailable(type: string): boolean {\n    try {\n        const storage = window[type];\n        storage.setItem('_mapbox_test_', 1);\n        storage.removeItem('_mapbox_test_');\n        return true;\n    } catch {\n        return false;\n    }\n}\n\n// The following methods are from https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem\n//Unicode compliant base64 encoder for strings\nexport function b64EncodeUnicode(str: string) {\n    return btoa(\n        encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n            (match, p1) => {\n                return String.fromCharCode(Number('0x' + p1)); //eslint-disable-line\n            }\n        )\n    );\n}\n\n// Unicode compliant decoder for base64-encoded strings\nexport function b64DecodeUnicode(str: string) {\n    return decodeURIComponent(atob(str).split('').map((c) => {\n        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); //eslint-disable-line\n    }).join(''));\n}\n\nexport function isImageBitmap(image: any): image is ImageBitmap {\n    return typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;\n}\n\n/**\n * Converts an ArrayBuffer to an ImageBitmap.\n *\n * Used mostly for testing purposes only, because mocking libs don't know how to work with ArrayBuffers, but work\n * perfectly fine with ImageBitmaps. Might also be used for environments (other than testing) not supporting\n * ArrayBuffers.\n *\n * @param data - Data to convert\n * @returns - A  promise resolved when the conversion is finished\n */\nexport const arrayBufferToImageBitmap = async (data: ArrayBuffer): Promise<ImageBitmap> => {\n    if (data.byteLength === 0) {\n        return createImageBitmap(new ImageData(1, 1));\n    }\n    const blob: Blob = new Blob([new Uint8Array(data)], {type: 'image/png'});\n    try {\n        return createImageBitmap(blob);\n    } catch (e) {\n        throw new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`);\n    }\n};\n\nconst transparentPngUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=';\n\n/**\n * Converts an ArrayBuffer to an HTMLImageElement.\n *\n * Used mostly for testing purposes only, because mocking libs don't know how to work with ArrayBuffers, but work\n * perfectly fine with ImageBitmaps. Might also be used for environments (other than testing) not supporting\n * ArrayBuffers.\n *\n * @param data - Data to convert\n * @returns - A promise resolved when the conversion is finished\n */\nexport const arrayBufferToImage = (data: ArrayBuffer): Promise<HTMLImageElement> => {\n    return new Promise((resolve, reject) => {\n        const img: HTMLImageElement = new Image();\n        img.onload = () => {\n            resolve(img);\n            URL.revokeObjectURL(img.src);\n            // prevent image dataURI memory leak in Safari;\n            // but don't free the image immediately because it might be uploaded in the next frame\n            // https://github.com/mapbox/mapbox-gl-js/issues/10226\n            img.onload = null;\n            window.requestAnimationFrame(() => { img.src = transparentPngUrl; });\n        };\n        img.onerror = () => reject(new Error('Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.'));\n        const blob: Blob = new Blob([new Uint8Array(data)], {type: 'image/png'});\n        img.src = data.byteLength ? URL.createObjectURL(blob) : transparentPngUrl;\n    });\n};\n\n/**\n * Computes the webcodecs VideoFrame API options to select a rectangle out of\n * an image and write it into the destination rectangle.\n *\n * Rect (x/y/width/height) select the overlapping rectangle from the source image\n * and layout (offset/stride) write that overlapping rectangle to the correct place\n * in the destination image.\n *\n * Offset is the byte offset in the dest image that the first pixel appears at\n * and stride is the number of bytes to the start of the next row:\n * ┌───────────┐\n * │  dest     │\n * │       ┌───┼───────┐\n * │offset→│▓▓▓│ source│\n * │       │▓▓▓│       │\n * │       └───┼───────┘\n * │stride ⇠╌╌╌│\n * │╌╌╌╌╌╌→    │\n * └───────────┘\n *\n * @param image - source image containing a width and height attribute\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns the layout and rect options to pass into VideoFrame API\n */\nfunction computeVideoFrameParameters(image: Size, x: number, y: number, width: number, height: number): VideoFrameCopyToOptions {\n    const destRowOffset = Math.max(-x, 0) * 4;\n    const firstSourceRow = Math.max(0, y);\n    const firstDestRow = firstSourceRow - y;\n    const offset = firstDestRow * width * 4 + destRowOffset;\n    const stride = width * 4;\n\n    const sourceLeft = Math.max(0, x);\n    const sourceTop = Math.max(0, y);\n    const sourceRight = Math.min(image.width, x + width);\n    const sourceBottom = Math.min(image.height, y + height);\n    return {\n        rect: {\n            x: sourceLeft,\n            y: sourceTop,\n            width: sourceRight - sourceLeft,\n            height: sourceBottom - sourceTop\n        },\n        layout: [{offset, stride}]\n    };\n}\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using webcodec VideoFrame API.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport async function readImageUsingVideoFrame(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (typeof VideoFrame === 'undefined') {\n        throw new Error('VideoFrame not supported');\n    }\n    const frame = new VideoFrame(image, {timestamp: 0});\n    try {\n        const format = frame?.format;\n        if (!format || !(format.startsWith('BGR') || format.startsWith('RGB'))) {\n            throw new Error(`Unrecognized format ${format}`);\n        }\n        const swapBR = format.startsWith('BGR');\n        const result = new Uint8ClampedArray(width * height * 4);\n        await frame.copyTo(result, computeVideoFrameParameters(image, x, y, width, height));\n        if (swapBR) {\n            for (let i = 0; i < result.length; i += 4) {\n                const tmp = result[i];\n                result[i] = result[i + 2];\n                result[i + 2] = tmp;\n            }\n        }\n        return result;\n    } finally {\n        frame.close();\n    }\n}\n\nlet offscreenCanvas: OffscreenCanvas;\nlet offscreenCanvasContext: OffscreenCanvasRenderingContext2D;\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using OffscreenCanvas\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport function readImageDataUsingOffscreenCanvas(\n    imgBitmap: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Uint8ClampedArray {\n    const origWidth = imgBitmap.width;\n    const origHeight = imgBitmap.height;\n    // Lazily initialize OffscreenCanvas\n    if (!offscreenCanvas || !offscreenCanvasContext) {\n        // Dem tiles are typically 256x256\n        offscreenCanvas = new OffscreenCanvas(origWidth, origHeight);\n        offscreenCanvasContext = offscreenCanvas.getContext('2d', {willReadFrequently: true});\n    }\n\n    offscreenCanvas.width = origWidth;\n    offscreenCanvas.height = origHeight;\n\n    offscreenCanvasContext.drawImage(imgBitmap, 0, 0, origWidth, origHeight);\n    const imgData = offscreenCanvasContext.getImageData(x, y, width, height);\n    offscreenCanvasContext.clearRect(0, 0, origWidth, origHeight);\n    return imgData.data;\n}\n\n/**\n * Reads RGBA pixels from an preferring OffscreenCanvas, but falling back to VideoFrame if supported and\n * the browser is mangling OffscreenCanvas getImageData results.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image\n */\nexport async function getImageData(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (isOffscreenCanvasDistorted()) {\n        try {\n            return await readImageUsingVideoFrame(image, x, y, width, height);\n        } catch {\n            // fall back to OffscreenCanvas\n        }\n    }\n    return readImageDataUsingOffscreenCanvas(image, x, y, width, height);\n}\n\n/**\n * Allows to unsubscribe from events without the need to store the method reference.\n */\nexport interface Subscription {\n    /**\n     * Unsubscribes from the event.\n     */\n    unsubscribe(): void;\n}\n\nexport interface Subscriber {\n    addEventListener: typeof window.addEventListener;\n    removeEventListener: typeof window.removeEventListener;\n}\n\n/**\n * This method is used in order to register an event listener using a lambda function.\n * The return value will allow unsubscribing from the event, without the need to store the method reference.\n * @param target - The target\n * @param message - The message\n * @param listener - The listener\n * @param options - The options\n * @returns a subscription object that can be used to unsubscribe from the event\n */\nexport function subscribe(target: Subscriber, message: keyof WindowEventMap, listener: (...args: any) => void, options: boolean | AddEventListenerOptions): Subscription {\n    target.addEventListener(message, listener, options);\n    return {\n        unsubscribe: () => {\n            target.removeEventListener(message, listener, options);\n        }\n    };\n}\n\n/**\n * This method converts degrees to radians.\n * The return value is the radian value.\n * @param degrees - The number of degrees\n * @returns radians\n */\nexport function degreesToRadians(degrees: number): number {\n    return degrees * Math.PI / 180;\n}\n\n/**\n * This method converts radians to degrees.\n * The return value is the degrees value.\n * @param degrees - The number of radians\n * @returns degrees\n */\nexport function radiansToDegrees(degrees: number): number {\n    return degrees / Math.PI * 180;\n}\n\nexport type RollPitchBearing = {\n    roll: number;\n    pitch: number;\n    bearing: number;\n};\n\nexport function rollPitchBearingEqual(a: RollPitchBearing, b: RollPitchBearing): boolean {\n    return a.roll == b.roll && a.pitch == b.pitch && a.bearing == b.bearing;\n}\n\n/**\n * This method converts a rotation quaternion to roll, pitch, and bearing angles in degrees.\n * @param rotation - The rotation quaternion\n * @returns roll, pitch, and bearing angles in degrees\n */\nexport function getRollPitchBearing(rotation: quat): RollPitchBearing {\n    const m: mat3 = new Float64Array(9) as any;\n    mat3.fromQuat(m, rotation);\n\n    const xAngle = radiansToDegrees(-Math.asin(clamp(m[2], -1, 1)));\n    let roll: number;\n    let bearing: number;\n    if (Math.hypot(m[5], m[8]) < 1.0e-3) {\n        roll = 0.0;\n        bearing = -radiansToDegrees(Math.atan2(m[3], m[4]));\n    } else {\n        roll = radiansToDegrees((m[5] === 0.0 && m[8] === 0.0) ? 0.0 :  Math.atan2(m[5], m[8]));\n        bearing = radiansToDegrees((m[1] === 0.0 && m[0] === 0.0) ? 0.0 : Math.atan2(m[1], m[0]));\n    }\n\n    return {roll, pitch: xAngle + 90.0, bearing};\n}\n\nexport function getAngleDelta(lastPoint: Point, currentPoint: Point, center: Point): number {\n    const pointVect = vec2.fromValues(currentPoint.x - center.x, currentPoint.y - center.y);\n    const lastPointVec = vec2.fromValues(lastPoint.x - center.x, lastPoint.y - center.y);\n\n    const crossProduct = pointVect[0] * lastPointVec[1] - pointVect[1] * lastPointVec[0];\n    const angleRadians = Math.atan2(crossProduct, vec2.dot(pointVect, lastPointVec));\n    return radiansToDegrees(angleRadians);\n}\n\n/**\n * This method converts roll, pitch, and bearing angles in degrees to a rotation quaternion.\n * @param roll - Roll angle in degrees\n * @param pitch - Pitch angle in degrees\n * @param bearing - Bearing angle in degrees\n * @returns The rotation quaternion\n */\nexport function rollPitchBearingToQuat(roll: number, pitch: number, bearing: number): quat {\n    const rotation: quat = new Float64Array(4) as any;\n    quat.fromEuler(rotation, roll, pitch - 90.0, bearing);\n    return rotation;\n}\n\n/**\n * Makes optional keys required and add the the undefined type.\n *\n * ```\n * interface Test {\n *  foo: number;\n *  bar?: number;\n *  baz: number | undefined;\n * }\n *\n * Complete<Test> {\n *  foo: number;\n *  bar: number | undefined;\n *  baz: number | undefined;\n * }\n *\n * ```\n *\n * See https://medium.com/terria/typescript-transforming-optional-properties-to-required-properties-that-may-be-undefined-7482cb4e1585\n */\n\nexport type Complete<T> = {\n    [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);\n};\n\n/**\n * A helper to allow require of at least one property\n */\nexport type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>; }[keyof T];\n\n/**\n* A helper to allow require exactly one one property\n */\nexport type ExactlyOne<T, Keys extends keyof T = keyof T> = {\n    [K in Keys]: Required<Pick<T, K>> & { [P in Exclude<Keys, K>]?: never }\n}[Keys];\n\nexport type TileJSON = {\n    tilejson: '2.2.0' | '2.1.0' | '2.0.1' | '2.0.0' | '1.0.0';\n    name?: string;\n    description?: string;\n    version?: string;\n    attribution?: string;\n    template?: string;\n    tiles: Array<string>;\n    grids?: Array<string>;\n    data?: Array<string>;\n    minzoom?: number;\n    maxzoom?: number;\n    bounds?: [number, number, number, number];\n    center?: [number, number, number];\n    vector_layers: [{id: string}]; // this is partial but enough for what we need\n};\n\n/**\n * The maximum world tile zoom (Z).\n * In other words, the upper bound supported for tile zoom.\n */\nexport const MAX_TILE_ZOOM = 25;\n\n/**\n * The minimum world tile zoom (Z).\n * In other words, the lower bound supported for tile zoom.\n */\nexport const MIN_TILE_ZOOM = 0;\n\nexport const MAX_VALID_LATITUDE = 85.051129;\n\nconst touchableEvents = {\n    touchstart: true,\n    touchmove: true,\n    touchmoveWindow: true,\n    touchend: true,\n    touchcancel: true\n};\n\nconst pointableEvents = {\n    dblclick: true,\n    click: true,\n    mouseover: true,\n    mouseout: true,\n    mousedown: true,\n    mousemove: true,\n    mousemoveWindow: true,\n    mouseup: true,\n    mouseupWindow: true,\n    contextmenu: true,\n    wheel: true\n};\n\nexport function isTouchableEvent(event: Event, eventType: string): event is TouchEvent {\n    return touchableEvents[eventType] && 'touches' in event;\n}\n\n/**\n * Checks if an event is a pointable event (mouse or wheel event).\n * Uses the event target's window context for cross-window support.\n */\nexport function isPointableEvent(event: Event, eventType: string): event is MouseEvent {\n    if (!pointableEvents[eventType]) return false;\n\n    // Get the window context from the event target to use the correct constructor.\n    const domEvent = event as globalThis.Event;\n    const target = domEvent?.target as Element | null;\n    const targetWindow = target?.ownerDocument?.defaultView || window;\n    return domEvent instanceof targetWindow.MouseEvent || domEvent instanceof targetWindow.WheelEvent;\n}\n\nexport function isTouchableOrPointableType(eventType: string): boolean {\n    return touchableEvents[eventType] || pointableEvents[eventType];\n}\n","/*\nThis file was copied from https://github.com/mapbox/grid-index and was\nmigrated from JavaScript to TypeScript.\n\nCopyright (c) 2016, Mapbox\n\nPermission to use, copy, modify, and/or distribute this software for any purpose\nwith or without fee is hereby granted, provided that the above copyright notice\nand this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\nOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\nTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n*/\n\nconst NUM_PARAMS = 3;\n\nexport type SerializedGrid = {\n    buffer: ArrayBuffer;\n};\n\nexport class TransferableGridIndex {\n    cells: number[][];\n    arrayBuffer: ArrayBuffer;\n    d: number;\n    keys: number[];\n    bboxes: number[];\n    n: number;\n    extent: number;\n    padding: number;\n    scale: any;\n    uid: number;\n    min: number;\n    max: number;\n\n    constructor(extent: number | ArrayBuffer, n?: number, padding?: number) {\n        const cells = this.cells = [];\n\n        if (extent instanceof ArrayBuffer) {\n            this.arrayBuffer = extent;\n            const array = new Int32Array(this.arrayBuffer);\n            extent = array[0];\n            n = array[1];\n            padding = array[2];\n\n            this.d = n + 2 * padding;\n            for (let k = 0; k < this.d * this.d; k++) {\n                const start = array[NUM_PARAMS + k];\n                const end = array[NUM_PARAMS + k + 1];\n                cells.push(start === end ? null : array.subarray(start, end));\n            }\n            const keysOffset = array[NUM_PARAMS + cells.length];\n            const bboxesOffset = array[NUM_PARAMS + cells.length + 1];\n            this.keys = array.subarray(keysOffset, bboxesOffset) as any as number[];\n            this.bboxes = array.subarray(bboxesOffset) as any as number[];\n\n            this.insert = this._insertReadonly;\n\n        } else {\n            this.d = n + 2 * padding;\n            for (let i = 0; i < this.d * this.d; i++) {\n                cells.push([]);\n            }\n            this.keys = [];\n            this.bboxes = [];\n        }\n\n        this.n = n;\n        this.extent = extent;\n        this.padding = padding;\n        this.scale = n / extent;\n        this.uid = 0;\n\n        const p = (padding / n) * extent;\n        this.min = -p;\n        this.max = extent + p;\n    }\n\n    insert(key: number, x1: number, y1: number, x2: number, y2: number) {\n        this._forEachCell(x1, y1, x2, y2, this._insertCell, this.uid++, undefined, undefined);\n        this.keys.push(key);\n        this.bboxes.push(x1);\n        this.bboxes.push(y1);\n        this.bboxes.push(x2);\n        this.bboxes.push(y2);\n    }\n\n    _insertReadonly() {\n        throw new Error('Cannot insert into a GridIndex created from an ArrayBuffer.');\n    }\n\n    _insertCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number) {\n        this.cells[cellIndex].push(uid);\n    }\n\n    query(x1: number, y1: number, x2: number, y2: number, intersectionTest?: Function): number[] {\n        const min = this.min;\n        const max = this.max;\n        if (x1 <= min && y1 <= min && max <= x2 && max <= y2 && !intersectionTest) {\n            // We use `Array.slice` because `this.keys` may be a `Int32Array` and\n            // some browsers (Safari and IE) do not support `TypedArray.slice`\n            // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice#Browser_compatibility\n            return Array.prototype.slice.call(this.keys);\n\n        } else {\n            const result = [];\n            const seenUids = {};\n            this._forEachCell(x1, y1, x2, y2, this._queryCell, result, seenUids, intersectionTest);\n            return result;\n        }\n    }\n\n    _queryCell(x1: number, y1: number, x2: number, y2:number, cellIndex:number, result, seenUids, intersectionTest: Function) {\n        const cell = this.cells[cellIndex];\n        if (cell !== null) {\n            const keys = this.keys;\n            const bboxes = this.bboxes;\n            for (let u = 0; u < cell.length; u++) {\n                const uid = cell[u];\n                if (seenUids[uid] === undefined) {\n                    const offset = uid * 4;\n                    if (intersectionTest ?\n                        intersectionTest(bboxes[offset + 0], bboxes[offset + 1], bboxes[offset + 2], bboxes[offset + 3]) :\n                        ((x1 <= bboxes[offset + 2]) &&\n                        (y1 <= bboxes[offset + 3]) &&\n                        (x2 >= bboxes[offset + 0]) &&\n                        (y2 >= bboxes[offset + 1]))) {\n                        seenUids[uid] = true;\n                        result.push(keys[uid]);\n                    } else {\n                        seenUids[uid] = false;\n                    }\n                }\n            }\n        }\n    }\n\n    _forEachCell(x1: number, y1: number, x2:number, y2:number, fn: Function, arg1, arg2, intersectionTest) {\n        const cx1 = this._convertToCellCoord(x1);\n        const cy1 = this._convertToCellCoord(y1);\n        const cx2 = this._convertToCellCoord(x2);\n        const cy2 = this._convertToCellCoord(y2);\n        for (let x = cx1; x <= cx2; x++) {\n            for (let y = cy1; y <= cy2; y++) {\n                const cellIndex = this.d * y + x;\n                if (intersectionTest && !intersectionTest(\n                    this._convertFromCellCoord(x),\n                    this._convertFromCellCoord(y),\n                    this._convertFromCellCoord(x + 1),\n                    this._convertFromCellCoord(y + 1))) continue;\n                if (fn.call(this, x1, y1, x2, y2, cellIndex, arg1, arg2, intersectionTest)) return;\n            }\n        }\n    }\n\n    _convertFromCellCoord (x) {\n        return (x - this.padding) / this.scale;\n    }\n\n    _convertToCellCoord(x) {\n        return Math.max(0, Math.min(this.d - 1, Math.floor(x * this.scale) + this.padding));\n    }\n\n    toArrayBuffer(): ArrayBuffer {\n        if (this.arrayBuffer) return this.arrayBuffer;\n\n        const cells = this.cells;\n\n        const metadataLength = NUM_PARAMS + this.cells.length + 1 + 1;\n        let totalCellLength = 0;\n        for (let i = 0; i < this.cells.length; i++) {\n            totalCellLength += this.cells[i].length;\n        }\n\n        const array = new Int32Array(metadataLength + totalCellLength + this.keys.length + this.bboxes.length);\n        array[0] = this.extent;\n        array[1] = this.n;\n        array[2] = this.padding;\n\n        let offset = metadataLength;\n        for (let k = 0; k < cells.length; k++) {\n            const cell = cells[k];\n            array[NUM_PARAMS + k] = offset;\n            array.set(cell, offset);\n            offset += cell.length;\n        }\n\n        array[NUM_PARAMS + cells.length] = offset;\n        array.set(this.keys, offset);\n        offset += this.keys.length;\n\n        array[NUM_PARAMS + cells.length + 1] = offset;\n        array.set(this.bboxes, offset);\n        offset += this.bboxes.length;\n\n        return array.buffer;\n    }\n\n    public static serialize(grid: TransferableGridIndex, transferables?: Array<Transferable>): SerializedGrid {\n        const buffer = grid.toArrayBuffer();\n        if (transferables) {\n            transferables.push(buffer);\n        }\n        return {buffer};\n    }\n\n    public static deserialize(serialized: SerializedGrid): TransferableGridIndex {\n        return new TransferableGridIndex(serialized.buffer);\n    }\n}\n","var $version = 8;\nvar $root = {\n\tversion: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: [\n\t\t\t8\n\t\t]\n\t},\n\tname: {\n\t\ttype: \"string\"\n\t},\n\tmetadata: {\n\t\ttype: \"*\"\n\t},\n\tcenter: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2\n\t},\n\tcenterAltitude: {\n\t\ttype: \"number\"\n\t},\n\tzoom: {\n\t\ttype: \"number\"\n\t},\n\tbearing: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\"\n\t},\n\tpitch: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"degrees\"\n\t},\n\troll: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"degrees\"\n\t},\n\tstate: {\n\t\ttype: \"state\",\n\t\t\"default\": {\n\t\t}\n\t},\n\tlight: {\n\t\ttype: \"light\"\n\t},\n\tsky: {\n\t\ttype: \"sky\"\n\t},\n\tprojection: {\n\t\ttype: \"projection\"\n\t},\n\tterrain: {\n\t\ttype: \"terrain\"\n\t},\n\tsources: {\n\t\trequired: true,\n\t\ttype: \"sources\"\n\t},\n\tsprite: {\n\t\ttype: \"sprite\"\n\t},\n\tglyphs: {\n\t\ttype: \"string\"\n\t},\n\t\"font-faces\": {\n\t\ttype: \"fontFaces\"\n\t},\n\ttransition: {\n\t\ttype: \"transition\"\n\t},\n\tlayers: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tvalue: \"layer\"\n\t}\n};\nvar sources = {\n\t\"*\": {\n\t\ttype: \"source\"\n\t}\n};\nvar source = [\n\t\"source_vector\",\n\t\"source_raster\",\n\t\"source_raster_dem\",\n\t\"source_geojson\",\n\t\"source_video\",\n\t\"source_image\"\n];\nvar source_vector = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvector: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tscheme: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\txyz: {\n\t\t\t},\n\t\t\ttms: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"xyz\"\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tpromoteId: {\n\t\ttype: \"promoteId\"\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tencoding: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmvt: {\n\t\t\t},\n\t\t\tmlt: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"mvt\"\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_raster = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\traster: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\ttileSize: {\n\t\ttype: \"number\",\n\t\t\"default\": 512,\n\t\tunits: \"pixels\"\n\t},\n\tscheme: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\txyz: {\n\t\t\t},\n\t\t\ttms: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"xyz\"\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_raster_dem = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\t\"raster-dem\": {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\ttileSize: {\n\t\ttype: \"number\",\n\t\t\"default\": 512,\n\t\tunits: \"pixels\"\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tencoding: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tterrarium: {\n\t\t\t},\n\t\t\tmapbox: {\n\t\t\t},\n\t\t\tcustom: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"mapbox\"\n\t},\n\tredFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tblueFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tgreenFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tbaseShift: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_geojson = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tgeojson: {\n\t\t\t}\n\t\t}\n\t},\n\tdata: {\n\t\trequired: true,\n\t\ttype: \"*\"\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 18\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tbuffer: {\n\t\ttype: \"number\",\n\t\t\"default\": 128,\n\t\tmaximum: 512,\n\t\tminimum: 0\n\t},\n\tfilter: {\n\t\ttype: \"filter\"\n\t},\n\ttolerance: {\n\t\ttype: \"number\",\n\t\t\"default\": 0.375\n\t},\n\tcluster: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tclusterRadius: {\n\t\ttype: \"number\",\n\t\t\"default\": 50,\n\t\tminimum: 0\n\t},\n\tclusterMaxZoom: {\n\t\ttype: \"number\"\n\t},\n\tclusterMinPoints: {\n\t\ttype: \"number\"\n\t},\n\tclusterProperties: {\n\t\ttype: \"*\"\n\t},\n\tlineMetrics: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tgenerateId: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tpromoteId: {\n\t\ttype: \"promoteId\"\n\t}\n};\nvar source_video = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvideo: {\n\t\t\t}\n\t\t}\n\t},\n\turls: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tcoordinates: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tlength: 4,\n\t\tvalue: {\n\t\t\ttype: \"array\",\n\t\t\tlength: 2,\n\t\t\tvalue: \"number\"\n\t\t}\n\t}\n};\nvar source_image = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\timage: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\trequired: true,\n\t\ttype: \"string\"\n\t},\n\tcoordinates: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tlength: 4,\n\t\tvalue: {\n\t\t\ttype: \"array\",\n\t\t\tlength: 2,\n\t\t\tvalue: \"number\"\n\t\t}\n\t}\n};\nvar layer = {\n\tid: {\n\t\ttype: \"string\",\n\t\trequired: true\n\t},\n\ttype: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tfill: {\n\t\t\t},\n\t\t\tline: {\n\t\t\t},\n\t\t\tsymbol: {\n\t\t\t},\n\t\t\tcircle: {\n\t\t\t},\n\t\t\theatmap: {\n\t\t\t},\n\t\t\t\"fill-extrusion\": {\n\t\t\t},\n\t\t\traster: {\n\t\t\t},\n\t\t\thillshade: {\n\t\t\t},\n\t\t\t\"color-relief\": {\n\t\t\t},\n\t\t\tbackground: {\n\t\t\t}\n\t\t},\n\t\trequired: true\n\t},\n\tmetadata: {\n\t\ttype: \"*\"\n\t},\n\tsource: {\n\t\ttype: \"string\"\n\t},\n\t\"source-layer\": {\n\t\ttype: \"string\"\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\tmaximum: 24\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\tmaximum: 24\n\t},\n\tfilter: {\n\t\ttype: \"filter\"\n\t},\n\tlayout: {\n\t\ttype: \"layout\"\n\t},\n\tpaint: {\n\t\ttype: \"paint\"\n\t}\n};\nvar layout = [\n\t\"layout_fill\",\n\t\"layout_line\",\n\t\"layout_circle\",\n\t\"layout_heatmap\",\n\t\"layout_fill-extrusion\",\n\t\"layout_symbol\",\n\t\"layout_raster\",\n\t\"layout_hillshade\",\n\t\"layout_color-relief\",\n\t\"layout_background\"\n];\nvar layout_background = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_fill = {\n\t\"fill-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_circle = {\n\t\"circle-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_heatmap = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_line = {\n\t\"line-cap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tbutt: {\n\t\t\t},\n\t\t\tround: {\n\t\t\t},\n\t\t\tsquare: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"butt\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-join\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tbevel: {\n\t\t\t},\n\t\t\tround: {\n\t\t\t},\n\t\t\tmiter: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"miter\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-miter-limit\": {\n\t\ttype: \"number\",\n\t\t\"default\": 2,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"line-join\": \"miter\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-round-limit\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1.05,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"line-join\": \"round\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_symbol = {\n\t\"symbol-placement\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tpoint: {\n\t\t\t},\n\t\t\tline: {\n\t\t\t},\n\t\t\t\"line-center\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"point\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-spacing\": {\n\t\ttype: \"number\",\n\t\t\"default\": 250,\n\t\tminimum: 1,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"symbol-placement\": \"line\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-avoid-edges\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"symbol-z-order\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tauto: {\n\t\t\t},\n\t\t\t\"viewport-y\": {\n\t\t\t},\n\t\t\tsource: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-allow-overlap\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t{\n\t\t\t\t\"!\": \"icon-overlap\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-overlap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnever: {\n\t\t\t},\n\t\t\talways: {\n\t\t\t},\n\t\t\tcooperative: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-ignore-placement\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-optional\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-rotation-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-size\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tunits: \"factor of the original icon size\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-text-fit\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnone: {\n\t\t\t},\n\t\t\twidth: {\n\t\t\t},\n\t\t\theight: {\n\t\t\t},\n\t\t\tboth: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"none\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-text-fit-padding\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"icon-text-fit\": [\n\t\t\t\t\t\"both\",\n\t\t\t\t\t\"width\",\n\t\t\t\t\t\"height\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-image\": {\n\t\ttype: \"resolvedImage\",\n\t\ttokens: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-padding\": {\n\t\ttype: \"padding\",\n\t\t\"default\": [\n\t\t\t2\n\t\t],\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-keep-upright\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t{\n\t\t\t\t\"icon-rotation-alignment\": \"map\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-offset\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-rotation-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\t\"viewport-glyph\": {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-field\": {\n\t\ttype: \"formatted\",\n\t\t\"default\": \"\",\n\t\ttokens: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-font\": {\n\t\ttype: \"array\",\n\t\tvalue: \"string\",\n\t\t\"default\": [\n\t\t\t\"Open Sans Regular\",\n\t\t\t\"Arial Unicode MS Regular\"\n\t\t],\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-size\": {\n\t\ttype: \"number\",\n\t\t\"default\": 16,\n\t\tminimum: 0,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-max-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 10,\n\t\tminimum: 0,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-line-height\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1.2,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-letter-spacing\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-justify\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tauto: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-radial-offset\": {\n\t\ttype: \"number\",\n\t\tunits: \"ems\",\n\t\t\"default\": 0,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\t\"property-type\": \"data-driven\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t}\n\t},\n\t\"text-variable-anchor\": {\n\t\ttype: \"array\",\n\t\tvalue: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-variable-anchor-offset\": {\n\t\ttype: \"variableAnchorOffsetCollection\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-variable-anchor\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-max-angle\": {\n\t\ttype: \"number\",\n\t\t\"default\": 45,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-writing-mode\": {\n\t\ttype: \"array\",\n\t\tvalue: \"enum\",\n\t\tvalues: {\n\t\t\thorizontal: {\n\t\t\t},\n\t\t\tvertical: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-padding\": {\n\t\ttype: \"number\",\n\t\t\"default\": 2,\n\t\tminimum: 0,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-keep-upright\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"text-rotation-alignment\": \"map\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-transform\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnone: {\n\t\t\t},\n\t\t\tuppercase: {\n\t\t\t},\n\t\t\tlowercase: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"none\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-offset\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tunits: \"ems\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-radial-offset\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-allow-overlap\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-overlap\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-overlap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnever: {\n\t\t\t},\n\t\t\talways: {\n\t\t\t},\n\t\t\tcooperative: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-ignore-placement\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-optional\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_raster = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar layout_hillshade = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar filter = {\n\ttype: \"boolean\",\n\texpression: {\n\t\tinterpolated: false,\n\t\tparameters: [\n\t\t\t\"zoom\",\n\t\t\t\"feature\"\n\t\t]\n\t},\n\t\"property-type\": \"data-driven\"\n};\nvar filter_operator = {\n\ttype: \"enum\",\n\tvalues: {\n\t\t\"==\": {\n\t\t},\n\t\t\"!=\": {\n\t\t},\n\t\t\">\": {\n\t\t},\n\t\t\">=\": {\n\t\t},\n\t\t\"<\": {\n\t\t},\n\t\t\"<=\": {\n\t\t},\n\t\t\"in\": {\n\t\t},\n\t\t\"!in\": {\n\t\t},\n\t\tall: {\n\t\t},\n\t\tany: {\n\t\t},\n\t\tnone: {\n\t\t},\n\t\thas: {\n\t\t},\n\t\t\"!has\": {\n\t\t}\n\t}\n};\nvar geometry_type = {\n\ttype: \"enum\",\n\tvalues: {\n\t\tPoint: {\n\t\t},\n\t\tLineString: {\n\t\t},\n\t\tPolygon: {\n\t\t}\n\t}\n};\nvar function_stop = {\n\ttype: \"array\",\n\tminimum: 0,\n\tmaximum: 24,\n\tvalue: [\n\t\t\"number\",\n\t\t\"color\"\n\t],\n\tlength: 2\n};\nvar expression$1 = {\n\ttype: \"array\",\n\tvalue: \"expression_name\",\n\tminimum: 1\n};\nvar light = {\n\tanchor: {\n\t\ttype: \"enum\",\n\t\t\"default\": \"viewport\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"property-type\": \"data-constant\",\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t}\n\t},\n\tposition: {\n\t\ttype: \"array\",\n\t\t\"default\": [\n\t\t\t1.15,\n\t\t\t210,\n\t\t\t30\n\t\t],\n\t\tlength: 3,\n\t\tvalue: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t}\n\t},\n\tcolor: {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\tintensity: {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t}\n};\nvar sky = {\n\t\"sky-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#88C6FC\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"horizon-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"fog-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"fog-ground-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"horizon-fog-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"sky-horizon-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"atmosphere-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t}\n};\nvar terrain = {\n\tsource: {\n\t\ttype: \"string\",\n\t\trequired: true\n\t},\n\texaggeration: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\t\"default\": 1\n\t}\n};\nvar projection = {\n\ttype: {\n\t\ttype: \"projectionDefinition\",\n\t\t\"default\": \"mercator\",\n\t\t\"property-type\": \"data-constant\",\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t}\n\t}\n};\nvar paint = [\n\t\"paint_fill\",\n\t\"paint_line\",\n\t\"paint_circle\",\n\t\"paint_heatmap\",\n\t\"paint_fill-extrusion\",\n\t\"paint_symbol\",\n\t\"paint_raster\",\n\t\"paint_hillshade\",\n\t\"paint_color-relief\",\n\t\"paint_background\"\n];\nvar paint_fill = {\n\t\"fill-antialias\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-outline-color\": {\n\t\ttype: \"color\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-pattern\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"fill-antialias\": true\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"fill-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t}\n};\nvar paint_line = {\n\t\"line-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"line-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-gap-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-offset\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-dasharray\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"line widths\",\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t},\n\t\"line-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t},\n\t\"line-gradient\": {\n\t\ttype: \"color\",\n\t\ttransition: false,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-dasharray\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tsource: \"geojson\",\n\t\t\t\thas: {\n\t\t\t\t\tlineMetrics: true\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"line-progress\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t}\n};\nvar paint_circle = {\n\t\"circle-radius\": {\n\t\ttype: \"number\",\n\t\t\"default\": 5,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"circle-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-pitch-scale\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"viewport\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-stroke-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-stroke-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-stroke-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t}\n};\nvar paint_heatmap = {\n\t\"heatmap-radius\": {\n\t\ttype: \"number\",\n\t\t\"default\": 30,\n\t\tminimum: 1,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"heatmap-weight\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"heatmap-intensity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"heatmap-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": [\n\t\t\t\"interpolate\",\n\t\t\t[\n\t\t\t\t\"linear\"\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"heatmap-density\"\n\t\t\t],\n\t\t\t0,\n\t\t\t\"rgba(0, 0, 255, 0)\",\n\t\t\t0.1,\n\t\t\t\"royalblue\",\n\t\t\t0.3,\n\t\t\t\"cyan\",\n\t\t\t0.5,\n\t\t\t\"lime\",\n\t\t\t0.7,\n\t\t\t\"yellow\",\n\t\t\t1,\n\t\t\t\"red\"\n\t\t],\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"heatmap-density\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t},\n\t\"heatmap-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_symbol = {\n\t\"icon-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"icon-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\toverridable: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t\"text-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_raster = {\n\t\"raster-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-hue-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\ttransition: true,\n\t\tunits: \"degrees\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-brightness-min\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-brightness-max\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-saturation\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: -1,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-contrast\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: -1,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-resampling\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tlinear: {\n\t\t\t},\n\t\t\tnearest: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"linear\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-fade-duration\": {\n\t\ttype: \"number\",\n\t\t\"default\": 300,\n\t\tminimum: 0,\n\t\ttransition: false,\n\t\tunits: \"milliseconds\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_hillshade = {\n\t\"hillshade-illumination-direction\": {\n\t\ttype: \"numberArray\",\n\t\t\"default\": 335,\n\t\tminimum: 0,\n\t\tmaximum: 359,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-illumination-altitude\": {\n\t\ttype: \"numberArray\",\n\t\t\"default\": 45,\n\t\tminimum: 0,\n\t\tmaximum: 90,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-illumination-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"viewport\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-exaggeration\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-shadow-color\": {\n\t\ttype: \"colorArray\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-highlight-color\": {\n\t\ttype: \"colorArray\",\n\t\t\"default\": \"#FFFFFF\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-accent-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-method\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tstandard: {\n\t\t\t},\n\t\t\tbasic: {\n\t\t\t},\n\t\t\tcombined: {\n\t\t\t},\n\t\t\tigor: {\n\t\t\t},\n\t\t\tmultidirectional: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"standard\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_background = {\n\t\"background-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"background-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"background-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded\"\n\t},\n\t\"background-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar transition = {\n\tduration: {\n\t\ttype: \"number\",\n\t\t\"default\": 300,\n\t\tminimum: 0,\n\t\tunits: \"milliseconds\"\n\t},\n\tdelay: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"milliseconds\"\n\t}\n};\nvar promoteId = {\n\t\"*\": {\n\t\ttype: \"string\"\n\t}\n};\nvar interpolation = {\n\ttype: \"array\",\n\tvalue: \"interpolation_name\",\n\tminimum: 1\n};\nvar interpolation_name = {\n\ttype: \"enum\",\n\tvalues: {\n\t\tlinear: {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\texponential: {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t\t\"base\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"base\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t},\n\t\t\"cubic-bezier\": {\n\t\t\tsyntax: {\n\t\t\t\toverloads: [\n\t\t\t\t\t{\n\t\t\t\t\t\tparameters: [\n\t\t\t\t\t\t\t\"x1\",\n\t\t\t\t\t\t\t\"y1\",\n\t\t\t\t\t\t\t\"x2\",\n\t\t\t\t\t\t\t\"y2\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"output-type\": \"interpolation\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\tparameters: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"x1\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"y1\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"x2\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"y2\",\n\t\t\t\t\t\ttype: \"number literal\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t}\n\t}\n};\nvar v8Spec = {\n\t$version: $version,\n\t$root: $root,\n\tsources: sources,\n\tsource: source,\n\tsource_vector: source_vector,\n\tsource_raster: source_raster,\n\tsource_raster_dem: source_raster_dem,\n\tsource_geojson: source_geojson,\n\tsource_video: source_video,\n\tsource_image: source_image,\n\tlayer: layer,\n\tlayout: layout,\n\tlayout_background: layout_background,\n\tlayout_fill: layout_fill,\n\tlayout_circle: layout_circle,\n\tlayout_heatmap: layout_heatmap,\n\t\"layout_fill-extrusion\": {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n},\n\tlayout_line: layout_line,\n\tlayout_symbol: layout_symbol,\n\tlayout_raster: layout_raster,\n\tlayout_hillshade: layout_hillshade,\n\t\"layout_color-relief\": {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"global-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n},\n\tfilter: filter,\n\tfilter_operator: filter_operator,\n\tgeometry_type: geometry_type,\n\t\"function\": {\n\texpression: {\n\t\ttype: \"expression\"\n\t},\n\tstops: {\n\t\ttype: \"array\",\n\t\tvalue: \"function_stop\"\n\t},\n\tbase: {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0\n\t},\n\tproperty: {\n\t\ttype: \"string\",\n\t\t\"default\": \"$zoom\"\n\t},\n\ttype: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tidentity: {\n\t\t\t},\n\t\t\texponential: {\n\t\t\t},\n\t\t\tinterval: {\n\t\t\t},\n\t\t\tcategorical: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"exponential\"\n\t},\n\tcolorSpace: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\trgb: {\n\t\t\t},\n\t\t\tlab: {\n\t\t\t},\n\t\t\thcl: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"rgb\"\n\t},\n\t\"default\": {\n\t\ttype: \"*\",\n\t\trequired: false\n\t}\n},\n\tfunction_stop: function_stop,\n\texpression: expression$1,\n\tlight: light,\n\tsky: sky,\n\tterrain: terrain,\n\tprojection: projection,\n\tpaint: paint,\n\tpaint_fill: paint_fill,\n\t\"paint_fill-extrusion\": {\n\t\"fill-extrusion-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-extrusion-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"fill-extrusion-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t},\n\t\"fill-extrusion-height\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"meters\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-base\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"meters\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"fill-extrusion-height\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-vertical-gradient\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n},\n\tpaint_line: paint_line,\n\tpaint_circle: paint_circle,\n\tpaint_heatmap: paint_heatmap,\n\tpaint_symbol: paint_symbol,\n\tpaint_raster: paint_raster,\n\tpaint_hillshade: paint_hillshade,\n\t\"paint_color-relief\": {\n\t\"color-relief-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"color-relief-color\": {\n\t\ttype: \"color\",\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"elevation\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t}\n},\n\tpaint_background: paint_background,\n\ttransition: transition,\n\t\"property-type\": {\n\t\"data-driven\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"cross-faded\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"cross-faded-data-driven\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"color-ramp\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"data-constant\": {\n\t\ttype: \"property-type\"\n\t},\n\tconstant: {\n\t\ttype: \"property-type\"\n\t}\n},\n\tpromoteId: promoteId,\n\tinterpolation: interpolation,\n\tinterpolation_name: interpolation_name\n};\n\nconst refProperties = [\n    'type',\n    'source',\n    'source-layer',\n    'minzoom',\n    'maxzoom',\n    'filter',\n    'layout'\n];\n\nfunction deref(layer, parent) {\n    const result = {};\n    for (const k in layer) {\n        if (k !== 'ref') {\n            result[k] = layer[k];\n        }\n    }\n    refProperties.forEach((k) => {\n        if (k in parent) {\n            result[k] = parent[k];\n        }\n    });\n    return result;\n}\n/**\n *\n * The input is not modified. The output may contain references to portions\n * of the input.\n *\n * @param layers - array of layers, some of which may contain `ref` properties\n * whose value is the `id` of another property\n * @returns a new array where such layers have been augmented with the 'type', 'source', etc. properties\n * from the parent layer, and the `ref` property has been removed.\n */\nfunction derefLayers(layers) {\n    layers = layers.slice();\n    const map = Object.create(null);\n    for (let i = 0; i < layers.length; i++) {\n        map[layers[i].id] = layers[i];\n    }\n    for (let i = 0; i < layers.length; i++) {\n        if ('ref' in layers[i]) {\n            layers[i] = deref(layers[i], map[layers[i].ref]);\n        }\n    }\n    return layers;\n}\n\n/**\n * Deeply compares two object literals.\n *\n * @private\n */\nfunction deepEqual(a, b) {\n    if (Array.isArray(a)) {\n        if (!Array.isArray(b) || a.length !== b.length)\n            return false;\n        for (let i = 0; i < a.length; i++) {\n            if (!deepEqual(a[i], b[i]))\n                return false;\n        }\n        return true;\n    }\n    if (typeof a === 'object' && a !== null && b !== null) {\n        if (!(typeof b === 'object'))\n            return false;\n        const keys = Object.keys(a);\n        if (keys.length !== Object.keys(b).length)\n            return false;\n        for (const key in a) {\n            if (!deepEqual(a[key], b[key]))\n                return false;\n        }\n        return true;\n    }\n    return a === b;\n}\n\n/**\n * The main reason for this method is to allow type check when adding a command to the array.\n * @param commands - The commands array to add to\n * @param command - The command to add\n */\nfunction addCommand(commands, command) {\n    commands.push(command);\n}\nfunction addSource(sourceId, after, commands) {\n    addCommand(commands, { command: 'addSource', args: [sourceId, after[sourceId]] });\n}\nfunction removeSource(sourceId, commands, sourcesRemoved) {\n    addCommand(commands, { command: 'removeSource', args: [sourceId] });\n    sourcesRemoved[sourceId] = true;\n}\nfunction updateSource(sourceId, after, commands, sourcesRemoved) {\n    removeSource(sourceId, commands, sourcesRemoved);\n    addSource(sourceId, after, commands);\n}\nfunction canUpdateGeoJSON(before, after, sourceId) {\n    let prop;\n    for (prop in before[sourceId]) {\n        if (!Object.prototype.hasOwnProperty.call(before[sourceId], prop))\n            continue;\n        if (prop !== 'data' && !deepEqual(before[sourceId][prop], after[sourceId][prop])) {\n            return false;\n        }\n    }\n    for (prop in after[sourceId]) {\n        if (!Object.prototype.hasOwnProperty.call(after[sourceId], prop))\n            continue;\n        if (prop !== 'data' && !deepEqual(before[sourceId][prop], after[sourceId][prop])) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction diffSources(before, after, commands, sourcesRemoved) {\n    before = before || {};\n    after = after || {};\n    let sourceId;\n    // look for sources to remove\n    for (sourceId in before) {\n        if (!Object.prototype.hasOwnProperty.call(before, sourceId))\n            continue;\n        if (!Object.prototype.hasOwnProperty.call(after, sourceId)) {\n            removeSource(sourceId, commands, sourcesRemoved);\n        }\n    }\n    // look for sources to add/update\n    for (sourceId in after) {\n        if (!Object.prototype.hasOwnProperty.call(after, sourceId))\n            continue;\n        if (!Object.prototype.hasOwnProperty.call(before, sourceId)) {\n            addSource(sourceId, after, commands);\n        }\n        else if (!deepEqual(before[sourceId], after[sourceId])) {\n            if (before[sourceId].type === 'geojson' &&\n                after[sourceId].type === 'geojson' &&\n                canUpdateGeoJSON(before, after, sourceId)) {\n                addCommand(commands, {\n                    command: 'setGeoJSONSourceData',\n                    args: [sourceId, after[sourceId].data]\n                });\n            }\n            else {\n                // no update command, must remove then add\n                updateSource(sourceId, after, commands, sourcesRemoved);\n            }\n        }\n    }\n}\nfunction diffLayerPropertyChanges(before, after, commands, layerId, klass, command) {\n    before = before || {};\n    after = after || {};\n    for (const prop in before) {\n        if (!Object.prototype.hasOwnProperty.call(before, prop))\n            continue;\n        if (!deepEqual(before[prop], after[prop])) {\n            commands.push({ command, args: [layerId, prop, after[prop], klass] });\n        }\n    }\n    for (const prop in after) {\n        if (!Object.prototype.hasOwnProperty.call(after, prop) ||\n            Object.prototype.hasOwnProperty.call(before, prop))\n            continue;\n        if (!deepEqual(before[prop], after[prop])) {\n            commands.push({ command, args: [layerId, prop, after[prop], klass] });\n        }\n    }\n}\nfunction pluckId(layer) {\n    return layer.id;\n}\nfunction indexById(group, layer) {\n    group[layer.id] = layer;\n    return group;\n}\nfunction diffLayers(before, after, commands) {\n    before = before || [];\n    after = after || [];\n    // order of layers by id\n    const beforeOrder = before.map(pluckId);\n    const afterOrder = after.map(pluckId);\n    // index of layer by id\n    const beforeIndex = before.reduce(indexById, {});\n    const afterIndex = after.reduce(indexById, {});\n    // track order of layers as if they have been mutated\n    const tracker = beforeOrder.slice();\n    // layers that have been added do not need to be diffed\n    const clean = Object.create(null);\n    let layerId;\n    let beforeLayer;\n    let afterLayer;\n    let insertBeforeLayerId;\n    let prop;\n    // remove layers\n    for (let i = 0, d = 0; i < beforeOrder.length; i++) {\n        layerId = beforeOrder[i];\n        if (!Object.prototype.hasOwnProperty.call(afterIndex, layerId)) {\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            tracker.splice(tracker.indexOf(layerId, d), 1);\n        }\n        else {\n            // limit where in tracker we need to look for a match\n            d++;\n        }\n    }\n    // add/reorder layers\n    for (let i = 0, d = 0; i < afterOrder.length; i++) {\n        // work backwards as insert is before an existing layer\n        layerId = afterOrder[afterOrder.length - 1 - i];\n        if (tracker[tracker.length - 1 - i] === layerId)\n            continue;\n        if (Object.prototype.hasOwnProperty.call(beforeIndex, layerId)) {\n            // remove the layer before we insert at the correct position\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            tracker.splice(tracker.lastIndexOf(layerId, tracker.length - d), 1);\n        }\n        else {\n            // limit where in tracker we need to look for a match\n            d++;\n        }\n        // add layer at correct position\n        insertBeforeLayerId = tracker[tracker.length - i];\n        addCommand(commands, {\n            command: 'addLayer',\n            args: [afterIndex[layerId], insertBeforeLayerId]\n        });\n        tracker.splice(tracker.length - i, 0, layerId);\n        clean[layerId] = true;\n    }\n    // update layers\n    for (let i = 0; i < afterOrder.length; i++) {\n        layerId = afterOrder[i];\n        beforeLayer = beforeIndex[layerId];\n        afterLayer = afterIndex[layerId];\n        // no need to update if previously added (new or moved)\n        if (clean[layerId] || deepEqual(beforeLayer, afterLayer))\n            continue;\n        // If source, source-layer, or type have changes, then remove the layer\n        // and add it back 'from scratch'.\n        if (!deepEqual(beforeLayer.source, afterLayer.source) ||\n            !deepEqual(beforeLayer['source-layer'], afterLayer['source-layer']) ||\n            !deepEqual(beforeLayer.type, afterLayer.type)) {\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            // we add the layer back at the same position it was already in, so\n            // there's no need to update the `tracker`\n            insertBeforeLayerId = tracker[tracker.lastIndexOf(layerId) + 1];\n            addCommand(commands, { command: 'addLayer', args: [afterLayer, insertBeforeLayerId] });\n            continue;\n        }\n        // layout, paint, filter, minzoom, maxzoom\n        diffLayerPropertyChanges(beforeLayer.layout, afterLayer.layout, commands, layerId, null, 'setLayoutProperty');\n        diffLayerPropertyChanges(beforeLayer.paint, afterLayer.paint, commands, layerId, null, 'setPaintProperty');\n        if (!deepEqual(beforeLayer.filter, afterLayer.filter)) {\n            addCommand(commands, { command: 'setFilter', args: [layerId, afterLayer.filter] });\n        }\n        if (!deepEqual(beforeLayer.minzoom, afterLayer.minzoom) ||\n            !deepEqual(beforeLayer.maxzoom, afterLayer.maxzoom)) {\n            addCommand(commands, {\n                command: 'setLayerZoomRange',\n                args: [layerId, afterLayer.minzoom, afterLayer.maxzoom]\n            });\n        }\n        // handle all other layer props, including paint.*\n        for (prop in beforeLayer) {\n            if (!Object.prototype.hasOwnProperty.call(beforeLayer, prop))\n                continue;\n            if (prop === 'layout' ||\n                prop === 'paint' ||\n                prop === 'filter' ||\n                prop === 'metadata' ||\n                prop === 'minzoom' ||\n                prop === 'maxzoom')\n                continue;\n            if (prop.indexOf('paint.') === 0) {\n                diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), 'setPaintProperty');\n            }\n            else if (!deepEqual(beforeLayer[prop], afterLayer[prop])) {\n                addCommand(commands, {\n                    command: 'setLayerProperty',\n                    args: [layerId, prop, afterLayer[prop]]\n                });\n            }\n        }\n        for (prop in afterLayer) {\n            if (!Object.prototype.hasOwnProperty.call(afterLayer, prop) ||\n                Object.prototype.hasOwnProperty.call(beforeLayer, prop))\n                continue;\n            if (prop === 'layout' ||\n                prop === 'paint' ||\n                prop === 'filter' ||\n                prop === 'metadata' ||\n                prop === 'minzoom' ||\n                prop === 'maxzoom')\n                continue;\n            if (prop.indexOf('paint.') === 0) {\n                diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), 'setPaintProperty');\n            }\n            else if (!deepEqual(beforeLayer[prop], afterLayer[prop])) {\n                addCommand(commands, {\n                    command: 'setLayerProperty',\n                    args: [layerId, prop, afterLayer[prop]]\n                });\n            }\n        }\n    }\n}\n/**\n * Diff two stylesheet\n *\n * Creates semanticly aware diffs that can easily be applied at runtime.\n * Operations produced by the diff closely resemble the maplibre-gl-js API. Any\n * error creating the diff will fall back to the 'setStyle' operation.\n *\n * Example diff:\n * [\n *     { command: 'setConstant', args: ['@water', '#0000FF'] },\n *     { command: 'setPaintProperty', args: ['background', 'background-color', 'black'] }\n * ]\n *\n * @private\n * @param {*} [before] stylesheet to compare from\n * @param {*} after stylesheet to compare to\n * @returns Array list of changes\n */\nfunction diff(before, after) {\n    if (!before)\n        return [{ command: 'setStyle', args: [after] }];\n    let commands = [];\n    try {\n        // Handle changes to top-level properties\n        if (!deepEqual(before.version, after.version)) {\n            return [{ command: 'setStyle', args: [after] }];\n        }\n        if (!deepEqual(before.center, after.center)) {\n            commands.push({ command: 'setCenter', args: [after.center] });\n        }\n        if (!deepEqual(before.state, after.state)) {\n            commands.push({ command: 'setGlobalState', args: [after.state] });\n        }\n        if (!deepEqual(before.centerAltitude, after.centerAltitude)) {\n            commands.push({ command: 'setCenterAltitude', args: [after.centerAltitude] });\n        }\n        if (!deepEqual(before.zoom, after.zoom)) {\n            commands.push({ command: 'setZoom', args: [after.zoom] });\n        }\n        if (!deepEqual(before.bearing, after.bearing)) {\n            commands.push({ command: 'setBearing', args: [after.bearing] });\n        }\n        if (!deepEqual(before.pitch, after.pitch)) {\n            commands.push({ command: 'setPitch', args: [after.pitch] });\n        }\n        if (!deepEqual(before.roll, after.roll)) {\n            commands.push({ command: 'setRoll', args: [after.roll] });\n        }\n        if (!deepEqual(before.sprite, after.sprite)) {\n            commands.push({ command: 'setSprite', args: [after.sprite] });\n        }\n        if (!deepEqual(before.glyphs, after.glyphs)) {\n            commands.push({ command: 'setGlyphs', args: [after.glyphs] });\n        }\n        if (!deepEqual(before.transition, after.transition)) {\n            commands.push({ command: 'setTransition', args: [after.transition] });\n        }\n        if (!deepEqual(before.light, after.light)) {\n            commands.push({ command: 'setLight', args: [after.light] });\n        }\n        if (!deepEqual(before.terrain, after.terrain)) {\n            commands.push({ command: 'setTerrain', args: [after.terrain] });\n        }\n        if (!deepEqual(before.sky, after.sky)) {\n            commands.push({ command: 'setSky', args: [after.sky] });\n        }\n        if (!deepEqual(before.projection, after.projection)) {\n            commands.push({ command: 'setProjection', args: [after.projection] });\n        }\n        // Handle changes to `sources`\n        // If a source is to be removed, we also--before the removeSource\n        // command--need to remove all the style layers that depend on it.\n        const sourcesRemoved = {};\n        // First collect the {add,remove}Source commands\n        const removeOrAddSourceCommands = [];\n        diffSources(before.sources, after.sources, removeOrAddSourceCommands, sourcesRemoved);\n        // Push a removeLayer command for each style layer that depends on a\n        // source that's being removed.\n        // Also, exclude any such layers them from the input to `diffLayers`\n        // below, so that diffLayers produces the appropriate `addLayers`\n        // command\n        const beforeLayers = [];\n        if (before.layers) {\n            before.layers.forEach((layer) => {\n                if ('source' in layer && sourcesRemoved[layer.source]) {\n                    commands.push({ command: 'removeLayer', args: [layer.id] });\n                }\n                else {\n                    beforeLayers.push(layer);\n                }\n            });\n        }\n        commands = commands.concat(removeOrAddSourceCommands);\n        // Handle changes to `layers`\n        diffLayers(beforeLayers, after.layers, commands);\n    }\n    catch (e) {\n        // fall back to setStyle\n        console.warn('Unable to compute style diff:', e);\n        commands = [{ command: 'setStyle', args: [after] }];\n    }\n    return commands;\n}\n\n// Note: Do not inherit from Error. It breaks when transpiling to ES5.\nclass ValidationError {\n    constructor(key, value, message, identifier) {\n        this.message = (key ? `${key}: ` : '') + message;\n        if (identifier)\n            this.identifier = identifier;\n        if (value !== null && value !== undefined && value.__line__) {\n            this.line = value.__line__;\n        }\n    }\n}\n\n// Note: Do not inherit from Error. It breaks when transpiling to ES5.\nclass ParsingError {\n    constructor(error) {\n        this.error = error;\n        this.message = error.message;\n        const match = error.message.match(/line (\\d+)/);\n        this.line = match ? parseInt(match[1], 10) : 0;\n    }\n}\n\nfunction extendBy(output, ...inputs) {\n    for (const input of inputs) {\n        for (const k in input) {\n            output[k] = input[k];\n        }\n    }\n    return output;\n}\n\nclass ExpressionParsingError extends Error {\n    constructor(key, message) {\n        super(message);\n        this.message = message;\n        this.key = key;\n    }\n}\n\n/**\n * Tracks `let` bindings during expression parsing.\n * @private\n */\nclass Scope {\n    constructor(parent, bindings = []) {\n        this.parent = parent;\n        this.bindings = {};\n        for (const [name, expression] of bindings) {\n            this.bindings[name] = expression;\n        }\n    }\n    concat(bindings) {\n        return new Scope(this, bindings);\n    }\n    get(name) {\n        if (this.bindings[name]) {\n            return this.bindings[name];\n        }\n        if (this.parent) {\n            return this.parent.get(name);\n        }\n        throw new Error(`${name} not found in scope.`);\n    }\n    has(name) {\n        if (this.bindings[name])\n            return true;\n        return this.parent ? this.parent.has(name) : false;\n    }\n}\n\nconst NullType = { kind: 'null' };\nconst NumberType = { kind: 'number' };\nconst StringType = { kind: 'string' };\nconst BooleanType = { kind: 'boolean' };\nconst ColorType = { kind: 'color' };\nconst ProjectionDefinitionType = {\n    kind: 'projectionDefinition'\n};\nconst ObjectType = { kind: 'object' };\nconst ValueType = { kind: 'value' };\nconst ErrorType = { kind: 'error' };\nconst CollatorType = { kind: 'collator' };\nconst FormattedType = { kind: 'formatted' };\nconst PaddingType = { kind: 'padding' };\nconst ColorArrayType = { kind: 'colorArray' };\nconst NumberArrayType = { kind: 'numberArray' };\nconst ResolvedImageType = { kind: 'resolvedImage' };\nconst VariableAnchorOffsetCollectionType = {\n    kind: 'variableAnchorOffsetCollection'\n};\nfunction array(itemType, N) {\n    return {\n        kind: 'array',\n        itemType,\n        N\n    };\n}\nfunction typeToString(type) {\n    if (type.kind === 'array') {\n        const itemType = typeToString(type.itemType);\n        return typeof type.N === 'number'\n            ? `array<${itemType}, ${type.N}>`\n            : type.itemType.kind === 'value'\n                ? 'array'\n                : `array<${itemType}>`;\n    }\n    else {\n        return type.kind;\n    }\n}\nconst valueMemberTypes = [\n    NullType,\n    NumberType,\n    StringType,\n    BooleanType,\n    ColorType,\n    ProjectionDefinitionType,\n    FormattedType,\n    ObjectType,\n    array(ValueType),\n    PaddingType,\n    NumberArrayType,\n    ColorArrayType,\n    ResolvedImageType,\n    VariableAnchorOffsetCollectionType\n];\n/**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message.\n * @private\n */\nfunction checkSubtype(expected, t) {\n    if (t.kind === 'error') {\n        // Error is a subtype of every type\n        return null;\n    }\n    else if (expected.kind === 'array') {\n        if (t.kind === 'array' &&\n            ((t.N === 0 && t.itemType.kind === 'value') ||\n                !checkSubtype(expected.itemType, t.itemType)) &&\n            (typeof expected.N !== 'number' || expected.N === t.N)) {\n            return null;\n        }\n    }\n    else if (expected.kind === t.kind) {\n        return null;\n    }\n    else if (expected.kind === 'value') {\n        for (const memberType of valueMemberTypes) {\n            if (!checkSubtype(memberType, t)) {\n                return null;\n            }\n        }\n    }\n    return `Expected ${typeToString(expected)} but found ${typeToString(t)} instead.`;\n}\nfunction isValidType(provided, allowedTypes) {\n    return allowedTypes.some((t) => t.kind === provided.kind);\n}\nfunction isValidNativeType(provided, allowedTypes) {\n    return allowedTypes.some((t) => {\n        if (t === 'null') {\n            return provided === null;\n        }\n        else if (t === 'array') {\n            return Array.isArray(provided);\n        }\n        else if (t === 'object') {\n            return provided && !Array.isArray(provided) && typeof provided === 'object';\n        }\n        else {\n            return t === typeof provided;\n        }\n    });\n}\n/**\n * Verify whether the specified type is of the same type as the specified sample.\n *\n * @param provided Type to verify\n * @param sample Sample type to reference\n * @returns `true` if both objects are of the same type, `false` otherwise\n * @example basic types\n * if (verifyType(outputType, ValueType)) {\n *     // type narrowed to:\n *     outputType.kind; // 'value'\n * }\n * @example array types\n * if (verifyType(outputType, array(NumberType))) {\n *     // type narrowed to:\n *     outputType.kind; // 'array'\n *     outputType.itemType; // NumberTypeT\n *     outputType.itemType.kind; // 'number'\n * }\n */\nfunction verifyType(provided, sample) {\n    if (provided.kind === 'array' && sample.kind === 'array') {\n        return provided.itemType.kind === sample.itemType.kind && typeof provided.N === 'number';\n    }\n    return provided.kind === sample.kind;\n}\n\n// See https://observablehq.com/@mbostock/lab-and-rgb\nconst Xn = 0.96422, Yn = 1, Zn = 0.82521, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI;\nfunction constrainAngle(angle) {\n    angle = angle % 360;\n    if (angle < 0) {\n        angle += 360;\n    }\n    return angle;\n}\nfunction rgbToLab([r, g, b, alpha]) {\n    r = rgb2xyz(r);\n    g = rgb2xyz(g);\n    b = rgb2xyz(b);\n    let x, z;\n    const y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn);\n    if (r === g && g === b) {\n        x = z = y;\n    }\n    else {\n        x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n        z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n    }\n    const l = 116 * y - 16;\n    return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z), alpha];\n}\nfunction rgb2xyz(x) {\n    return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\nfunction xyz2lab(t) {\n    return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\nfunction labToRgb([l, a, b, alpha]) {\n    let y = (l + 16) / 116, x = isNaN(a) ? y : y + a / 500, z = isNaN(b) ? y : y - b / 200;\n    y = Yn * lab2xyz(y);\n    x = Xn * lab2xyz(x);\n    z = Zn * lab2xyz(z);\n    return [\n        xyz2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), // D50 -> sRGB\n        xyz2rgb(-0.9787684 * x + 1.9161415 * y + 0.033454 * z),\n        xyz2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n        alpha\n    ];\n}\nfunction xyz2rgb(x) {\n    x = x <= 0.00304 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055;\n    return x < 0 ? 0 : x > 1 ? 1 : x; // clip to 0..1 range\n}\nfunction lab2xyz(t) {\n    return t > t1 ? t * t * t : t2 * (t - t0);\n}\nfunction rgbToHcl(rgbColor) {\n    const [l, a, b, alpha] = rgbToLab(rgbColor);\n    const c = Math.sqrt(a * a + b * b);\n    const h = Math.round(c * 10000) ? constrainAngle(Math.atan2(b, a) * rad2deg) : NaN;\n    return [h, c, l, alpha];\n}\nfunction hclToRgb([h, c, l, alpha]) {\n    h = isNaN(h) ? 0 : h * deg2rad;\n    return labToRgb([l, Math.cos(h) * c, Math.sin(h) * c, alpha]);\n}\n// https://drafts.csswg.org/css-color-4/#hsl-to-rgb\nfunction hslToRgb([h, s, l, alpha]) {\n    h = constrainAngle(h);\n    s /= 100;\n    l /= 100;\n    function f(n) {\n        const k = (n + h / 30) % 12;\n        const a = s * Math.min(l, 1 - l);\n        return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n    }\n    return [f(0), f(8), f(4), alpha];\n}\n\n// polyfill for Object.hasOwn\nconst hasOwnProperty = Object.hasOwn ||\n    function hasOwnProperty(object, key) {\n        return Object.prototype.hasOwnProperty.call(object, key);\n    };\nfunction getOwn(object, key) {\n    return hasOwnProperty(object, key) ? object[key] : undefined;\n}\n\n/**\n * CSS color parser compliant with CSS Color 4 Specification.\n * Supports: named colors, `transparent` keyword, all rgb hex notations,\n * rgb(), rgba(), hsl() and hsla() functions.\n * Does not round the parsed values to integers from the range 0..255.\n *\n * Syntax:\n *\n * <alpha-value> = <number> | <percentage>\n *         <hue> = <number> | <angle>\n *\n *         rgb() = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? )\n *         rgb() = rgb( <percentage>#{3} , <alpha-value>? )    | rgb( <number>#{3} , <alpha-value>? )\n *\n *         hsl() = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? )\n *         hsl() = hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )\n *\n * Caveats:\n *   - <angle> - <number> with optional `deg` suffix; `grad`, `rad`, `turn` are not supported\n *   - `none` keyword is not supported\n *   - comments inside rgb()/hsl() are not supported\n *   - legacy color syntax rgba() is supported with an identical grammar and behavior to rgb()\n *   - legacy color syntax hsla() is supported with an identical grammar and behavior to hsl()\n *\n * @param input CSS color string to parse.\n * @returns Color in sRGB color space, with `red`, `green`, `blue`\n * and `alpha` channels normalized to the range 0..1,\n * or `undefined` if the input is not a valid color string.\n */\nfunction parseCssColor(input) {\n    input = input.toLowerCase().trim();\n    if (input === 'transparent') {\n        return [0, 0, 0, 0];\n    }\n    // 'white', 'black', 'blue'\n    const namedColorsMatch = getOwn(namedColors, input);\n    if (namedColorsMatch) {\n        const [r, g, b] = namedColorsMatch;\n        return [r / 255, g / 255, b / 255, 1];\n    }\n    // #f0c, #f0cf, #ff00cc, #ff00ccff\n    if (input.startsWith('#')) {\n        const hexRegexp = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/;\n        if (hexRegexp.test(input)) {\n            const step = input.length < 6 ? 1 : 2;\n            let i = 1;\n            return [\n                parseHex(input.slice(i, (i += step))),\n                parseHex(input.slice(i, (i += step))),\n                parseHex(input.slice(i, (i += step))),\n                parseHex(input.slice(i, i + step) || 'ff')\n            ];\n        }\n    }\n    // rgb(128 0 0), rgb(50% 0% 0%), rgba(255,0,255,0.6), rgb(255 0 255 / 60%), rgb(100% 0% 100% /.6)\n    if (input.startsWith('rgb')) {\n        const rgbRegExp = /^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/;\n        const rgbMatch = input.match(rgbRegExp);\n        if (rgbMatch) {\n            const [_, // eslint-disable-line @typescript-eslint/no-unused-vars\n            r, // <numeric>\n            rp, // %         (optional)\n            f1, // ,         (optional)\n            g, // <numeric>\n            gp, // %         (optional)\n            f2, // ,         (optional)\n            b, // <numeric>\n            bp, // %         (optional)\n            f3, // ,|/       (optional)\n            a, // <numeric> (optional)\n            ap // %         (optional)\n            ] = rgbMatch;\n            const argFormat = [f1 || ' ', f2 || ' ', f3].join('');\n            if (argFormat === '  ' ||\n                argFormat === '  /' ||\n                argFormat === ',,' ||\n                argFormat === ',,,') {\n                const valFormat = [rp, gp, bp].join('');\n                const maxValue = valFormat === '%%%' ? 100 : valFormat === '' ? 255 : 0;\n                if (maxValue) {\n                    const rgba = [\n                        clamp(+r / maxValue, 0, 1),\n                        clamp(+g / maxValue, 0, 1),\n                        clamp(+b / maxValue, 0, 1),\n                        a ? parseAlpha(+a, ap) : 1\n                    ];\n                    if (validateNumbers(rgba)) {\n                        return rgba;\n                    }\n                    // invalid numbers\n                }\n                // values must be all numbers or all percentages\n            }\n            return; // comma optional syntax requires no commas at all\n        }\n    }\n    // hsl(120 50% 80%), hsla(120deg,50%,80%,.9), hsl(12e1 50% 80% / 90%)\n    const hslRegExp = /^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/;\n    const hslMatch = input.match(hslRegExp);\n    if (hslMatch) {\n        const [_, // eslint-disable-line @typescript-eslint/no-unused-vars\n        h, // <numeric>\n        f1, // ,         (optional)\n        s, // <numeric>\n        f2, // ,         (optional)\n        l, // <numeric>\n        f3, // ,|/       (optional)\n        a, // <numeric> (optional)\n        ap // %         (optional)\n        ] = hslMatch;\n        const argFormat = [f1 || ' ', f2 || ' ', f3].join('');\n        if (argFormat === '  ' ||\n            argFormat === '  /' ||\n            argFormat === ',,' ||\n            argFormat === ',,,') {\n            const hsla = [\n                +h,\n                clamp(+s, 0, 100),\n                clamp(+l, 0, 100),\n                a ? parseAlpha(+a, ap) : 1\n            ];\n            if (validateNumbers(hsla)) {\n                return hslToRgb(hsla);\n            }\n            // invalid numbers\n        }\n        // comma optional syntax requires no commas at all\n    }\n}\nfunction parseHex(hex) {\n    return parseInt(hex.padEnd(2, hex), 16) / 255;\n}\nfunction parseAlpha(a, asPercentage) {\n    return clamp(asPercentage ? a / 100 : a, 0, 1);\n}\nfunction clamp(n, min, max) {\n    return Math.min(Math.max(min, n), max);\n}\n/**\n * The regular expression for numeric values is not super specific, and it may\n * happen that it will accept a value that is not a valid number. In order to\n * detect and eliminate such values this function exists.\n *\n * @param array Array of uncertain numbers.\n * @returns `true` if the specified array contains only valid numbers, `false` otherwise.\n */\nfunction validateNumbers(array) {\n    return !array.some(Number.isNaN);\n}\n/**\n * To generate:\n * - visit {@link https://www.w3.org/TR/css-color-4/#named-colors}\n * - run in the console:\n * @example\n * copy(`{\\n${[...document.querySelector('.named-color-table tbody').children].map((tr) => `${tr.cells[2].textContent.trim()}: [${tr.cells[4].textContent.trim().split(/\\s+/).join(', ')}],`).join('\\n')}\\n}`);\n */\nconst namedColors = {\n    aliceblue: [240, 248, 255],\n    antiquewhite: [250, 235, 215],\n    aqua: [0, 255, 255],\n    aquamarine: [127, 255, 212],\n    azure: [240, 255, 255],\n    beige: [245, 245, 220],\n    bisque: [255, 228, 196],\n    black: [0, 0, 0],\n    blanchedalmond: [255, 235, 205],\n    blue: [0, 0, 255],\n    blueviolet: [138, 43, 226],\n    brown: [165, 42, 42],\n    burlywood: [222, 184, 135],\n    cadetblue: [95, 158, 160],\n    chartreuse: [127, 255, 0],\n    chocolate: [210, 105, 30],\n    coral: [255, 127, 80],\n    cornflowerblue: [100, 149, 237],\n    cornsilk: [255, 248, 220],\n    crimson: [220, 20, 60],\n    cyan: [0, 255, 255],\n    darkblue: [0, 0, 139],\n    darkcyan: [0, 139, 139],\n    darkgoldenrod: [184, 134, 11],\n    darkgray: [169, 169, 169],\n    darkgreen: [0, 100, 0],\n    darkgrey: [169, 169, 169],\n    darkkhaki: [189, 183, 107],\n    darkmagenta: [139, 0, 139],\n    darkolivegreen: [85, 107, 47],\n    darkorange: [255, 140, 0],\n    darkorchid: [153, 50, 204],\n    darkred: [139, 0, 0],\n    darksalmon: [233, 150, 122],\n    darkseagreen: [143, 188, 143],\n    darkslateblue: [72, 61, 139],\n    darkslategray: [47, 79, 79],\n    darkslategrey: [47, 79, 79],\n    darkturquoise: [0, 206, 209],\n    darkviolet: [148, 0, 211],\n    deeppink: [255, 20, 147],\n    deepskyblue: [0, 191, 255],\n    dimgray: [105, 105, 105],\n    dimgrey: [105, 105, 105],\n    dodgerblue: [30, 144, 255],\n    firebrick: [178, 34, 34],\n    floralwhite: [255, 250, 240],\n    forestgreen: [34, 139, 34],\n    fuchsia: [255, 0, 255],\n    gainsboro: [220, 220, 220],\n    ghostwhite: [248, 248, 255],\n    gold: [255, 215, 0],\n    goldenrod: [218, 165, 32],\n    gray: [128, 128, 128],\n    green: [0, 128, 0],\n    greenyellow: [173, 255, 47],\n    grey: [128, 128, 128],\n    honeydew: [240, 255, 240],\n    hotpink: [255, 105, 180],\n    indianred: [205, 92, 92],\n    indigo: [75, 0, 130],\n    ivory: [255, 255, 240],\n    khaki: [240, 230, 140],\n    lavender: [230, 230, 250],\n    lavenderblush: [255, 240, 245],\n    lawngreen: [124, 252, 0],\n    lemonchiffon: [255, 250, 205],\n    lightblue: [173, 216, 230],\n    lightcoral: [240, 128, 128],\n    lightcyan: [224, 255, 255],\n    lightgoldenrodyellow: [250, 250, 210],\n    lightgray: [211, 211, 211],\n    lightgreen: [144, 238, 144],\n    lightgrey: [211, 211, 211],\n    lightpink: [255, 182, 193],\n    lightsalmon: [255, 160, 122],\n    lightseagreen: [32, 178, 170],\n    lightskyblue: [135, 206, 250],\n    lightslategray: [119, 136, 153],\n    lightslategrey: [119, 136, 153],\n    lightsteelblue: [176, 196, 222],\n    lightyellow: [255, 255, 224],\n    lime: [0, 255, 0],\n    limegreen: [50, 205, 50],\n    linen: [250, 240, 230],\n    magenta: [255, 0, 255],\n    maroon: [128, 0, 0],\n    mediumaquamarine: [102, 205, 170],\n    mediumblue: [0, 0, 205],\n    mediumorchid: [186, 85, 211],\n    mediumpurple: [147, 112, 219],\n    mediumseagreen: [60, 179, 113],\n    mediumslateblue: [123, 104, 238],\n    mediumspringgreen: [0, 250, 154],\n    mediumturquoise: [72, 209, 204],\n    mediumvioletred: [199, 21, 133],\n    midnightblue: [25, 25, 112],\n    mintcream: [245, 255, 250],\n    mistyrose: [255, 228, 225],\n    moccasin: [255, 228, 181],\n    navajowhite: [255, 222, 173],\n    navy: [0, 0, 128],\n    oldlace: [253, 245, 230],\n    olive: [128, 128, 0],\n    olivedrab: [107, 142, 35],\n    orange: [255, 165, 0],\n    orangered: [255, 69, 0],\n    orchid: [218, 112, 214],\n    palegoldenrod: [238, 232, 170],\n    palegreen: [152, 251, 152],\n    paleturquoise: [175, 238, 238],\n    palevioletred: [219, 112, 147],\n    papayawhip: [255, 239, 213],\n    peachpuff: [255, 218, 185],\n    peru: [205, 133, 63],\n    pink: [255, 192, 203],\n    plum: [221, 160, 221],\n    powderblue: [176, 224, 230],\n    purple: [128, 0, 128],\n    rebeccapurple: [102, 51, 153],\n    red: [255, 0, 0],\n    rosybrown: [188, 143, 143],\n    royalblue: [65, 105, 225],\n    saddlebrown: [139, 69, 19],\n    salmon: [250, 128, 114],\n    sandybrown: [244, 164, 96],\n    seagreen: [46, 139, 87],\n    seashell: [255, 245, 238],\n    sienna: [160, 82, 45],\n    silver: [192, 192, 192],\n    skyblue: [135, 206, 235],\n    slateblue: [106, 90, 205],\n    slategray: [112, 128, 144],\n    slategrey: [112, 128, 144],\n    snow: [255, 250, 250],\n    springgreen: [0, 255, 127],\n    steelblue: [70, 130, 180],\n    tan: [210, 180, 140],\n    teal: [0, 128, 128],\n    thistle: [216, 191, 216],\n    tomato: [255, 99, 71],\n    turquoise: [64, 224, 208],\n    violet: [238, 130, 238],\n    wheat: [245, 222, 179],\n    white: [255, 255, 255],\n    whitesmoke: [245, 245, 245],\n    yellow: [255, 255, 0],\n    yellowgreen: [154, 205, 50]\n};\n\nfunction interpolateNumber(from, to, t) {\n    return from + t * (to - from);\n}\nfunction interpolateArray(from, to, t) {\n    return from.map((d, i) => {\n        return interpolateNumber(d, to[i], t);\n    });\n}\n\n/**\n * Checks whether the specified color space is one of the supported interpolation color spaces.\n *\n * @param colorSpace Color space key to verify.\n * @returns `true` if the specified color space is one of the supported\n * interpolation color spaces, `false` otherwise\n */\nfunction isSupportedInterpolationColorSpace(colorSpace) {\n    return colorSpace === 'rgb' || colorSpace === 'hcl' || colorSpace === 'lab';\n}\n/**\n * Color representation used by WebGL.\n * Defined in sRGB color space and pre-blended with alpha.\n * @private\n */\nclass Color {\n    /**\n     * @param r Red component premultiplied by `alpha` 0..1\n     * @param g Green component premultiplied by `alpha` 0..1\n     * @param b Blue component premultiplied by `alpha` 0..1\n     * @param [alpha=1] Alpha component 0..1\n     * @param [premultiplied=true] Whether the `r`, `g` and `b` values have already\n     * been multiplied by alpha. If `true` nothing happens if `false` then they will\n     * be multiplied automatically.\n     */\n    constructor(r, g, b, alpha = 1, premultiplied = true) {\n        this.r = r;\n        this.g = g;\n        this.b = b;\n        this.a = alpha;\n        if (!premultiplied) {\n            this.r *= alpha;\n            this.g *= alpha;\n            this.b *= alpha;\n            if (!alpha) {\n                // alpha = 0 erases completely rgb channels. This behavior is not desirable\n                // if this particular color is later used in color interpolation.\n                // Because of that, a reference to original color is saved.\n                this.overwriteGetter('rgb', [r, g, b, alpha]);\n            }\n        }\n    }\n    /**\n     * Parses CSS color strings and converts colors to sRGB color space if needed.\n     * Officially supported color formats:\n     * - keyword, e.g. 'aquamarine' or 'steelblue'\n     * - hex (with 3, 4, 6 or 8 digits), e.g. '#f0f' or '#e9bebea9'\n     * - rgb and rgba, e.g. 'rgb(0,240,120)' or 'rgba(0%,94%,47%,0.1)' or 'rgb(0 240 120 / .3)'\n     * - hsl and hsla, e.g. 'hsl(0,0%,83%)' or 'hsla(0,0%,83%,.5)' or 'hsl(0 0% 83% / 20%)'\n     *\n     * @param input CSS color string to parse.\n     * @returns A `Color` instance, or `undefined` if the input is not a valid color string.\n     */\n    static parse(input) {\n        // in zoom-and-property function input could be an instance of Color class\n        if (input instanceof Color) {\n            return input;\n        }\n        if (typeof input !== 'string') {\n            return;\n        }\n        const rgba = parseCssColor(input);\n        if (rgba) {\n            return new Color(...rgba, false);\n        }\n    }\n    /**\n     * Used in color interpolation and by 'to-rgba' expression.\n     *\n     * @returns Gien color, with reversed alpha blending, in sRGB color space.\n     */\n    get rgb() {\n        const { r, g, b, a } = this;\n        const f = a || Infinity; // reverse alpha blending factor\n        return this.overwriteGetter('rgb', [r / f, g / f, b / f, a]);\n    }\n    /**\n     * Used in color interpolation.\n     *\n     * @returns Gien color, with reversed alpha blending, in HCL color space.\n     */\n    get hcl() {\n        return this.overwriteGetter('hcl', rgbToHcl(this.rgb));\n    }\n    /**\n     * Used in color interpolation.\n     *\n     * @returns Gien color, with reversed alpha blending, in LAB color space.\n     */\n    get lab() {\n        return this.overwriteGetter('lab', rgbToLab(this.rgb));\n    }\n    /**\n     * Lazy getter pattern. When getter is called for the first time lazy value\n     * is calculated and then overwrites getter function in given object instance.\n     *\n     * @example:\n     * const redColor = Color.parse('red');\n     * let x = redColor.hcl; // this will invoke `get hcl()`, which will calculate\n     * // the value of red in HCL space and invoke this `overwriteGetter` function\n     * // which in turn will set a field with a key 'hcl' in the `redColor` object.\n     * // In other words it will override `get hcl()` from its `Color` prototype\n     * // with its own property: hcl = [calculated red value in hcl].\n     * let y = redColor.hcl; // next call will no longer invoke getter but simply\n     * // return the previously calculated value\n     * x === y; // true - `x` is exactly the same object as `y`\n     *\n     * @param getterKey Getter key\n     * @param lazyValue Lazily calculated value to be memoized by current instance\n     * @private\n     */\n    overwriteGetter(getterKey, lazyValue) {\n        Object.defineProperty(this, getterKey, { value: lazyValue });\n        return lazyValue;\n    }\n    /**\n     * Used by 'to-string' expression.\n     *\n     * @returns Serialized color in format `rgba(r,g,b,a)`\n     * where r,g,b are numbers within 0..255 and alpha is number within 1..0\n     *\n     * @example\n     * var purple = new Color.parse('purple');\n     * purple.toString; // = \"rgba(128,0,128,1)\"\n     * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');\n     * translucentGreen.toString(); // = \"rgba(26,207,26,0.73)\"\n     */\n    toString() {\n        const [r, g, b, a] = this.rgb;\n        return `rgba(${[r, g, b].map((n) => Math.round(n * 255)).join(',')},${a})`;\n    }\n    static interpolate(from, to, t, spaceKey = 'rgb') {\n        switch (spaceKey) {\n            case 'rgb': {\n                const [r, g, b, alpha] = interpolateArray(from.rgb, to.rgb, t);\n                return new Color(r, g, b, alpha, false);\n            }\n            case 'hcl': {\n                const [hue0, chroma0, light0, alphaF] = from.hcl;\n                const [hue1, chroma1, light1, alphaT] = to.hcl;\n                // https://github.com/gka/chroma.js/blob/cd1b3c0926c7a85cbdc3b1453b3a94006de91a92/src/interpolator/_hsx.js\n                let hue, chroma;\n                if (!isNaN(hue0) && !isNaN(hue1)) {\n                    let dh = hue1 - hue0;\n                    if (hue1 > hue0 && dh > 180) {\n                        dh -= 360;\n                    }\n                    else if (hue1 < hue0 && hue0 - hue1 > 180) {\n                        dh += 360;\n                    }\n                    hue = hue0 + t * dh;\n                }\n                else if (!isNaN(hue0)) {\n                    hue = hue0;\n                    if (light1 === 1 || light1 === 0)\n                        chroma = chroma0;\n                }\n                else if (!isNaN(hue1)) {\n                    hue = hue1;\n                    if (light0 === 1 || light0 === 0)\n                        chroma = chroma1;\n                }\n                else {\n                    hue = NaN;\n                }\n                const [r, g, b, alpha] = hclToRgb([\n                    hue,\n                    chroma !== null && chroma !== void 0 ? chroma : interpolateNumber(chroma0, chroma1, t),\n                    interpolateNumber(light0, light1, t),\n                    interpolateNumber(alphaF, alphaT, t)\n                ]);\n                return new Color(r, g, b, alpha, false);\n            }\n            case 'lab': {\n                const [r, g, b, alpha] = labToRgb(interpolateArray(from.lab, to.lab, t));\n                return new Color(r, g, b, alpha, false);\n            }\n        }\n    }\n}\nColor.black = new Color(0, 0, 0, 1);\nColor.white = new Color(1, 1, 1, 1);\nColor.transparent = new Color(0, 0, 0, 0);\nColor.red = new Color(1, 0, 0, 1);\n\nclass Collator {\n    constructor(caseSensitive, diacriticSensitive, locale) {\n        if (caseSensitive)\n            this.sensitivity = diacriticSensitive ? 'variant' : 'case';\n        else\n            this.sensitivity = diacriticSensitive ? 'accent' : 'base';\n        this.locale = locale;\n        this.collator = new Intl.Collator(this.locale ? this.locale : [], {\n            sensitivity: this.sensitivity,\n            usage: 'search'\n        });\n    }\n    compare(lhs, rhs) {\n        return this.collator.compare(lhs, rhs);\n    }\n    resolvedLocale() {\n        // We create a Collator without \"usage: search\" because we don't want\n        // the search options encoded in our result (e.g. \"en-u-co-search\")\n        return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;\n    }\n}\n\nconst VERTICAL_ALIGN_OPTIONS = ['bottom', 'center', 'top'];\nclass FormattedSection {\n    constructor(text, image, scale, fontStack, textColor, verticalAlign) {\n        this.text = text;\n        this.image = image;\n        this.scale = scale;\n        this.fontStack = fontStack;\n        this.textColor = textColor;\n        this.verticalAlign = verticalAlign;\n    }\n}\nclass Formatted {\n    constructor(sections) {\n        this.sections = sections;\n    }\n    static fromString(unformatted) {\n        return new Formatted([new FormattedSection(unformatted, null, null, null, null, null)]);\n    }\n    isEmpty() {\n        if (this.sections.length === 0)\n            return true;\n        return !this.sections.some((section) => section.text.length !== 0 || (section.image && section.image.name.length !== 0));\n    }\n    static factory(text) {\n        if (text instanceof Formatted) {\n            return text;\n        }\n        else {\n            return Formatted.fromString(text);\n        }\n    }\n    toString() {\n        if (this.sections.length === 0)\n            return '';\n        return this.sections.map((section) => section.text).join('');\n    }\n}\n\n/**\n * A set of four numbers representing padding around a box. Create instances from\n * bare arrays or numeric values using the static method `Padding.parse`.\n * @private\n */\nclass Padding {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * Numeric padding values\n     * @param input A padding value\n     * @returns A `Padding` instance, or `undefined` if the input is not a valid padding value.\n     */\n    static parse(input) {\n        if (input instanceof Padding) {\n            return input;\n        }\n        // Backwards compatibility: bare number is treated the same as array with single value.\n        // Padding applies to all four sides.\n        if (typeof input === 'number') {\n            return new Padding([input, input, input, input]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        if (input.length < 1 || input.length > 4) {\n            return undefined;\n        }\n        for (const val of input) {\n            if (typeof val !== 'number') {\n                return undefined;\n            }\n        }\n        // Expand shortcut properties into explicit 4-sided values\n        switch (input.length) {\n            case 1:\n                input = [input[0], input[0], input[0], input[0]];\n                break;\n            case 2:\n                input = [input[0], input[1], input[0], input[1]];\n                break;\n            case 3:\n                input = [input[0], input[1], input[2], input[1]];\n                break;\n        }\n        return new Padding(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t) {\n        return new Padding(interpolateArray(from.values, to.values, t));\n    }\n}\n\n/**\n * An array of numbers. Create instances from\n * bare arrays or numeric values using the static method `NumberArray.parse`.\n * @private\n */\nclass NumberArray {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * Numeric NumberArray values\n     * @param input A NumberArray value\n     * @returns A `NumberArray` instance, or `undefined` if the input is not a valid NumberArray value.\n     */\n    static parse(input) {\n        if (input instanceof NumberArray) {\n            return input;\n        }\n        // Backwards compatibility (e.g. hillshade-illumination-direction): bare number is treated the same as array with single value.\n        if (typeof input === 'number') {\n            return new NumberArray([input]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        for (const val of input) {\n            if (typeof val !== 'number') {\n                return undefined;\n            }\n        }\n        return new NumberArray(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t) {\n        return new NumberArray(interpolateArray(from.values, to.values, t));\n    }\n}\n\n/**\n * An array of colors. Create instances from\n * bare arrays or strings using the static method `ColorArray.parse`.\n * @private\n */\nclass ColorArray {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * ColorArray values\n     * @param input A ColorArray value\n     * @returns A `ColorArray` instance, or `undefined` if the input is not a valid ColorArray value.\n     */\n    static parse(input) {\n        if (input instanceof ColorArray) {\n            return input;\n        }\n        // Backwards compatibility (e.g. hillshade-shadow-color): bare Color is treated the same as array with single value.\n        if (typeof input === 'string') {\n            const parsed_val = Color.parse(input);\n            if (!parsed_val) {\n                return undefined;\n            }\n            return new ColorArray([parsed_val]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        const colors = [];\n        for (const val of input) {\n            if (typeof val !== 'string') {\n                return undefined;\n            }\n            const parsed_val = Color.parse(val);\n            if (!parsed_val) {\n                return undefined;\n            }\n            colors.push(parsed_val);\n        }\n        return new ColorArray(colors);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t, spaceKey = 'rgb') {\n        const colors = [];\n        if (from.values.length != to.values.length) {\n            throw new Error(`colorArray: Arrays have mismatched length (${from.values.length} vs. ${to.values.length}), cannot interpolate.`);\n        }\n        for (let i = 0; i < from.values.length; i++) {\n            colors.push(Color.interpolate(from.values[i], to.values[i], t, spaceKey));\n        }\n        return new ColorArray(colors);\n    }\n}\n\nclass RuntimeError extends Error {\n    constructor(message) {\n        super(message);\n        this.name = 'RuntimeError';\n    }\n    toJSON() {\n        return this.message;\n    }\n}\n\n/** Set of valid anchor positions, as a set for validation */\nconst anchors = new Set([\n    'center',\n    'left',\n    'right',\n    'top',\n    'bottom',\n    'top-left',\n    'top-right',\n    'bottom-left',\n    'bottom-right'\n]);\n/**\n * Utility class to assist managing values for text-variable-anchor-offset property. Create instances from\n * bare arrays using the static method `VariableAnchorOffsetCollection.parse`.\n * @private\n */\nclass VariableAnchorOffsetCollection {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    static parse(input) {\n        if (input instanceof VariableAnchorOffsetCollection) {\n            return input;\n        }\n        if (!Array.isArray(input) || input.length < 1 || input.length % 2 !== 0) {\n            return undefined;\n        }\n        for (let i = 0; i < input.length; i += 2) {\n            // Elements in even positions should be anchor positions; Elements in odd positions should be offset values\n            const anchorValue = input[i];\n            const offsetValue = input[i + 1];\n            if (typeof anchorValue !== 'string' || !anchors.has(anchorValue)) {\n                return undefined;\n            }\n            if (!Array.isArray(offsetValue) ||\n                offsetValue.length !== 2 ||\n                typeof offsetValue[0] !== 'number' ||\n                typeof offsetValue[1] !== 'number') {\n                return undefined;\n            }\n        }\n        return new VariableAnchorOffsetCollection(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n    static interpolate(from, to, t) {\n        const fromValues = from.values;\n        const toValues = to.values;\n        if (fromValues.length !== toValues.length) {\n            throw new RuntimeError(`Cannot interpolate values of different length. from: ${from.toString()}, to: ${to.toString()}`);\n        }\n        const output = [];\n        for (let i = 0; i < fromValues.length; i += 2) {\n            // Anchor entries must match\n            if (fromValues[i] !== toValues[i]) {\n                throw new RuntimeError(`Cannot interpolate values containing mismatched anchors. from[${i}]: ${fromValues[i]}, to[${i}]: ${toValues[i]}`);\n            }\n            output.push(fromValues[i]);\n            // Interpolate the offset values for each anchor\n            const [fx, fy] = fromValues[i + 1];\n            const [tx, ty] = toValues[i + 1];\n            output.push([interpolateNumber(fx, tx, t), interpolateNumber(fy, ty, t)]);\n        }\n        return new VariableAnchorOffsetCollection(output);\n    }\n}\n\nclass ResolvedImage {\n    constructor(options) {\n        this.name = options.name;\n        this.available = options.available;\n    }\n    toString() {\n        return this.name;\n    }\n    static fromString(name) {\n        if (!name)\n            return null; // treat empty values as no image\n        return new ResolvedImage({ name, available: false });\n    }\n}\n\nclass ProjectionDefinition {\n    constructor(from, to, transition) {\n        this.from = from;\n        this.to = to;\n        this.transition = transition;\n    }\n    static interpolate(from, to, t) {\n        return new ProjectionDefinition(from, to, t);\n    }\n    static parse(input) {\n        if (input instanceof ProjectionDefinition) {\n            return input;\n        }\n        if (Array.isArray(input) &&\n            input.length === 3 &&\n            typeof input[0] === 'string' &&\n            typeof input[1] === 'string' &&\n            typeof input[2] === 'number') {\n            return new ProjectionDefinition(input[0], input[1], input[2]);\n        }\n        if (typeof input === 'object' &&\n            typeof input.from === 'string' &&\n            typeof input.to === 'string' &&\n            typeof input.transition === 'number') {\n            return new ProjectionDefinition(input.from, input.to, input.transition);\n        }\n        if (typeof input === 'string') {\n            return new ProjectionDefinition(input, input, 1);\n        }\n        return undefined;\n    }\n}\n\nfunction validateRGBA(r, g, b, a) {\n    if (!(typeof r === 'number' &&\n        r >= 0 &&\n        r <= 255 &&\n        typeof g === 'number' &&\n        g >= 0 &&\n        g <= 255 &&\n        typeof b === 'number' &&\n        b >= 0 &&\n        b <= 255)) {\n        const value = typeof a === 'number' ? [r, g, b, a] : [r, g, b];\n        return `Invalid rgba value [${value.join(', ')}]: 'r', 'g', and 'b' must be between 0 and 255.`;\n    }\n    if (!(typeof a === 'undefined' || (typeof a === 'number' && a >= 0 && a <= 1))) {\n        return `Invalid rgba value [${[r, g, b, a].join(', ')}]: 'a' must be between 0 and 1.`;\n    }\n    return null;\n}\nfunction isValue(mixed) {\n    if (mixed === null ||\n        typeof mixed === 'string' ||\n        typeof mixed === 'boolean' ||\n        typeof mixed === 'number' ||\n        mixed instanceof ProjectionDefinition ||\n        mixed instanceof Color ||\n        mixed instanceof Collator ||\n        mixed instanceof Formatted ||\n        mixed instanceof Padding ||\n        mixed instanceof NumberArray ||\n        mixed instanceof ColorArray ||\n        mixed instanceof VariableAnchorOffsetCollection ||\n        mixed instanceof ResolvedImage) {\n        return true;\n    }\n    else if (Array.isArray(mixed)) {\n        for (const item of mixed) {\n            if (!isValue(item)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    else if (typeof mixed === 'object') {\n        for (const key in mixed) {\n            if (!isValue(mixed[key])) {\n                return false;\n            }\n        }\n        return true;\n    }\n    else {\n        return false;\n    }\n}\nfunction typeOf(value) {\n    if (value === null) {\n        return NullType;\n    }\n    else if (typeof value === 'string') {\n        return StringType;\n    }\n    else if (typeof value === 'boolean') {\n        return BooleanType;\n    }\n    else if (typeof value === 'number') {\n        return NumberType;\n    }\n    else if (value instanceof Color) {\n        return ColorType;\n    }\n    else if (value instanceof ProjectionDefinition) {\n        return ProjectionDefinitionType;\n    }\n    else if (value instanceof Collator) {\n        return CollatorType;\n    }\n    else if (value instanceof Formatted) {\n        return FormattedType;\n    }\n    else if (value instanceof Padding) {\n        return PaddingType;\n    }\n    else if (value instanceof NumberArray) {\n        return NumberArrayType;\n    }\n    else if (value instanceof ColorArray) {\n        return ColorArrayType;\n    }\n    else if (value instanceof VariableAnchorOffsetCollection) {\n        return VariableAnchorOffsetCollectionType;\n    }\n    else if (value instanceof ResolvedImage) {\n        return ResolvedImageType;\n    }\n    else if (Array.isArray(value)) {\n        const length = value.length;\n        let itemType;\n        for (const item of value) {\n            const t = typeOf(item);\n            if (!itemType) {\n                itemType = t;\n            }\n            else if (itemType === t) {\n                continue;\n            }\n            else {\n                itemType = ValueType;\n                break;\n            }\n        }\n        return array(itemType || ValueType, length);\n    }\n    else {\n        return ObjectType;\n    }\n}\nfunction valueToString(value) {\n    const type = typeof value;\n    if (value === null) {\n        return '';\n    }\n    else if (type === 'string' || type === 'number' || type === 'boolean') {\n        return String(value);\n    }\n    else if (value instanceof Color ||\n        value instanceof ProjectionDefinition ||\n        value instanceof Formatted ||\n        value instanceof Padding ||\n        value instanceof NumberArray ||\n        value instanceof ColorArray ||\n        value instanceof VariableAnchorOffsetCollection ||\n        value instanceof ResolvedImage) {\n        return value.toString();\n    }\n    else {\n        return JSON.stringify(value);\n    }\n}\n\nclass Literal {\n    constructor(type, value) {\n        this.type = type;\n        this.value = value;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'literal' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (!isValue(args[1]))\n            return context.error('invalid value');\n        const value = args[1];\n        let type = typeOf(value);\n        // special case: infer the item type if possible for zero-length arrays\n        const expected = context.expectedType;\n        if (type.kind === 'array' &&\n            type.N === 0 &&\n            expected &&\n            expected.kind === 'array' &&\n            (typeof expected.N !== 'number' || expected.N === 0)) {\n            type = expected;\n        }\n        return new Literal(type, value);\n    }\n    evaluate() {\n        return this.value;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nconst types$1 = {\n    string: StringType,\n    number: NumberType,\n    boolean: BooleanType,\n    object: ObjectType\n};\nclass Assertion {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2)\n            return context.error('Expected at least one argument.');\n        let i = 1;\n        let type;\n        const name = args[0];\n        if (name === 'array') {\n            let itemType;\n            if (args.length > 2) {\n                const type = args[1];\n                if (typeof type !== 'string' || !(type in types$1) || type === 'object')\n                    return context.error('The item type argument of \"array\" must be one of string, number, boolean', 1);\n                itemType = types$1[type];\n                i++;\n            }\n            else {\n                itemType = ValueType;\n            }\n            let N;\n            if (args.length > 3) {\n                if (args[2] !== null &&\n                    (typeof args[2] !== 'number' || args[2] < 0 || args[2] !== Math.floor(args[2]))) {\n                    return context.error('The length argument to \"array\" must be a positive integer literal', 2);\n                }\n                N = args[2];\n                i++;\n            }\n            type = array(itemType, N);\n        }\n        else {\n            if (!types$1[name])\n                throw new Error(`Types doesn't contain name = ${name}`);\n            type = types$1[name];\n        }\n        const parsed = [];\n        for (; i < args.length; i++) {\n            const input = context.parse(args[i], i, ValueType);\n            if (!input)\n                return null;\n            parsed.push(input);\n        }\n        return new Assertion(type, parsed);\n    }\n    evaluate(ctx) {\n        for (let i = 0; i < this.args.length; i++) {\n            const value = this.args[i].evaluate(ctx);\n            const error = checkSubtype(this.type, typeOf(value));\n            if (!error) {\n                return value;\n            }\n            else if (i === this.args.length - 1) {\n                throw new RuntimeError(`Expected value to be of type ${typeToString(this.type)}, but found ${typeToString(typeOf(value))} instead.`);\n            }\n        }\n        throw new Error();\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every((arg) => arg.outputDefined());\n    }\n}\n\nconst types = {\n    'to-boolean': BooleanType,\n    'to-color': ColorType,\n    'to-number': NumberType,\n    'to-string': StringType\n};\n/**\n * Special form for error-coalescing coercion expressions \"to-number\",\n * \"to-color\".  Since these coercions can fail at runtime, they accept multiple\n * arguments, only evaluating one at a time until one succeeds.\n *\n * @private\n */\nclass Coercion {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2)\n            return context.error('Expected at least one argument.');\n        const name = args[0];\n        if (!types[name])\n            throw new Error(`Can't parse ${name} as it is not part of the known types`);\n        if ((name === 'to-boolean' || name === 'to-string') && args.length !== 2)\n            return context.error('Expected one argument.');\n        const type = types[name];\n        const parsed = [];\n        for (let i = 1; i < args.length; i++) {\n            const input = context.parse(args[i], i, ValueType);\n            if (!input)\n                return null;\n            parsed.push(input);\n        }\n        return new Coercion(type, parsed);\n    }\n    evaluate(ctx) {\n        switch (this.type.kind) {\n            case 'boolean':\n                return Boolean(this.args[0].evaluate(ctx));\n            case 'color': {\n                let input;\n                let error;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    error = null;\n                    if (input instanceof Color) {\n                        return input;\n                    }\n                    else if (typeof input === 'string') {\n                        const c = ctx.parseColor(input);\n                        if (c)\n                            return c;\n                    }\n                    else if (Array.isArray(input)) {\n                        if (input.length < 3 || input.length > 4) {\n                            error = `Invalid rgba value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;\n                        }\n                        else {\n                            error = validateRGBA(input[0], input[1], input[2], input[3]);\n                        }\n                        if (!error) {\n                            return new Color(input[0] / 255, input[1] / 255, input[2] / 255, input[3]);\n                        }\n                    }\n                }\n                throw new RuntimeError(error ||\n                    `Could not parse color from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'padding': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const pad = Padding.parse(input);\n                    if (pad) {\n                        return pad;\n                    }\n                }\n                throw new RuntimeError(`Could not parse padding from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'numberArray': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const val = NumberArray.parse(input);\n                    if (val) {\n                        return val;\n                    }\n                }\n                throw new RuntimeError(`Could not parse numberArray from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'colorArray': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const val = ColorArray.parse(input);\n                    if (val) {\n                        return val;\n                    }\n                }\n                throw new RuntimeError(`Could not parse colorArray from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'variableAnchorOffsetCollection': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const coll = VariableAnchorOffsetCollection.parse(input);\n                    if (coll) {\n                        return coll;\n                    }\n                }\n                throw new RuntimeError(`Could not parse variableAnchorOffsetCollection from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'number': {\n                let value = null;\n                for (const arg of this.args) {\n                    value = arg.evaluate(ctx);\n                    if (value === null)\n                        return 0;\n                    const num = Number(value);\n                    if (isNaN(num))\n                        continue;\n                    return num;\n                }\n                throw new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`);\n            }\n            case 'formatted':\n                // There is no explicit 'to-formatted' but this coercion can be implicitly\n                // created by properties that expect the 'formatted' type.\n                return Formatted.fromString(valueToString(this.args[0].evaluate(ctx)));\n            case 'resolvedImage':\n                return ResolvedImage.fromString(valueToString(this.args[0].evaluate(ctx)));\n            case 'projectionDefinition':\n                return this.args[0].evaluate(ctx);\n            default:\n                return valueToString(this.args[0].evaluate(ctx));\n        }\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every((arg) => arg.outputDefined());\n    }\n}\n\nconst geometryTypes = ['Unknown', 'Point', 'LineString', 'Polygon'];\nclass EvaluationContext {\n    constructor() {\n        this.globals = null;\n        this.feature = null;\n        this.featureState = null;\n        this.formattedSection = null;\n        this._parseColorCache = new Map();\n        this.availableImages = null;\n        this.canonical = null;\n    }\n    id() {\n        return this.feature && 'id' in this.feature ? this.feature.id : null;\n    }\n    geometryType() {\n        return this.feature\n            ? typeof this.feature.type === 'number'\n                ? geometryTypes[this.feature.type]\n                : this.feature.type\n            : null;\n    }\n    geometry() {\n        return this.feature && 'geometry' in this.feature ? this.feature.geometry : null;\n    }\n    canonicalID() {\n        return this.canonical;\n    }\n    properties() {\n        return (this.feature && this.feature.properties) || {};\n    }\n    parseColor(input) {\n        let cached = this._parseColorCache.get(input);\n        if (!cached) {\n            cached = Color.parse(input);\n            this._parseColorCache.set(input, cached);\n        }\n        return cached;\n    }\n}\n\n/**\n * State associated parsing at a given point in an expression tree.\n * @private\n */\nclass ParsingContext {\n    constructor(registry, isConstantFunc, path = [], expectedType, scope = new Scope(), errors = []) {\n        this.registry = registry;\n        this.path = path;\n        this.key = path.map((part) => `[${part}]`).join('');\n        this.scope = scope;\n        this.errors = errors;\n        this.expectedType = expectedType;\n        this._isConstant = isConstantFunc;\n    }\n    /**\n     * @param expr the JSON expression to parse\n     * @param index the optional argument index if this expression is an argument of a parent expression that's being parsed\n     * @param options\n     * @param options.omitTypeAnnotations set true to omit inferred type annotations.  Caller beware: with this option set, the parsed expression's type will NOT satisfy `expectedType` if it would normally be wrapped in an inferred annotation.\n     * @private\n     */\n    parse(expr, index, expectedType, bindings, options = {}) {\n        if (index) {\n            return this.concat(index, expectedType, bindings)._parse(expr, options);\n        }\n        return this._parse(expr, options);\n    }\n    _parse(expr, options) {\n        if (expr === null ||\n            typeof expr === 'string' ||\n            typeof expr === 'boolean' ||\n            typeof expr === 'number') {\n            expr = ['literal', expr];\n        }\n        function annotate(parsed, type, typeAnnotation) {\n            if (typeAnnotation === 'assert') {\n                return new Assertion(type, [parsed]);\n            }\n            else if (typeAnnotation === 'coerce') {\n                return new Coercion(type, [parsed]);\n            }\n            else {\n                return parsed;\n            }\n        }\n        if (Array.isArray(expr)) {\n            if (expr.length === 0) {\n                return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');\n            }\n            const op = expr[0];\n            if (typeof op !== 'string') {\n                this.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n                return null;\n            }\n            const Expr = this.registry[op];\n            if (Expr) {\n                let parsed = Expr.parse(expr, this);\n                if (!parsed)\n                    return null;\n                if (this.expectedType) {\n                    const expected = this.expectedType;\n                    const actual = parsed.type;\n                    // When we expect a number, string, boolean, or array but have a value, wrap it in an assertion.\n                    // When we expect a color or formatted string, but have a string or value, wrap it in a coercion.\n                    // Otherwise, we do static type-checking.\n                    //\n                    // These behaviors are overridable for:\n                    //   * The \"coalesce\" operator, which needs to omit type annotations.\n                    //   * String-valued properties (e.g. `text-field`), where coercion is more convenient than assertion.\n                    //\n                    if ((expected.kind === 'string' ||\n                        expected.kind === 'number' ||\n                        expected.kind === 'boolean' ||\n                        expected.kind === 'object' ||\n                        expected.kind === 'array') &&\n                        actual.kind === 'value') {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');\n                    }\n                    else if (('projectionDefinition' === expected.kind &&\n                        ['string', 'array'].includes(actual.kind)) ||\n                        (['color', 'formatted', 'resolvedImage'].includes(expected.kind) &&\n                            ['value', 'string'].includes(actual.kind)) ||\n                        (['padding', 'numberArray'].includes(expected.kind) &&\n                            ['value', 'number', 'array'].includes(actual.kind)) ||\n                        ('colorArray' === expected.kind &&\n                            ['value', 'string', 'array'].includes(actual.kind)) ||\n                        ('variableAnchorOffsetCollection' === expected.kind &&\n                            ['value', 'array'].includes(actual.kind))) {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n                    }\n                    else if (this.checkSubtype(expected, actual)) {\n                        return null;\n                    }\n                }\n                // If an expression's arguments are all literals, we can evaluate\n                // it immediately and replace it with a literal value in the\n                // parsed/compiled result. Expressions that expect an image should\n                // not be resolved here so we can later get the available images.\n                if (!(parsed instanceof Literal) &&\n                    parsed.type.kind !== 'resolvedImage' &&\n                    this._isConstant(parsed)) {\n                    const ec = new EvaluationContext();\n                    try {\n                        parsed = new Literal(parsed.type, parsed.evaluate(ec));\n                    }\n                    catch (e) {\n                        this.error(e.message);\n                        return null;\n                    }\n                }\n                return parsed;\n            }\n            return this.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n        }\n        else if (typeof expr === 'undefined') {\n            return this.error(\"'undefined' value invalid. Use null instead.\");\n        }\n        else if (typeof expr === 'object') {\n            return this.error('Bare objects invalid. Use [\"literal\", {...}] instead.');\n        }\n        else {\n            return this.error(`Expected an array, but found ${typeof expr} instead.`);\n        }\n    }\n    /**\n     * Returns a copy of this context suitable for parsing the subexpression at\n     * index `index`, optionally appending to 'let' binding map.\n     *\n     * Note that `errors` property, intended for collecting errors while\n     * parsing, is copied by reference rather than cloned.\n     * @private\n     */\n    concat(index, expectedType, bindings) {\n        const path = typeof index === 'number' ? this.path.concat(index) : this.path;\n        const scope = bindings ? this.scope.concat(bindings) : this.scope;\n        return new ParsingContext(this.registry, this._isConstant, path, expectedType || null, scope, this.errors);\n    }\n    /**\n     * Push a parsing (or type checking) error into the `this.errors`\n     * @param error The message\n     * @param keys Optionally specify the source of the error at a child\n     * of the current expression at `this.key`.\n     * @private\n     */\n    error(error, ...keys) {\n        const key = `${this.key}${keys.map((k) => `[${k}]`).join('')}`;\n        this.errors.push(new ExpressionParsingError(key, error));\n    }\n    /**\n     * Returns null if `t` is a subtype of `expected`; otherwise returns an\n     * error message and also pushes it to `this.errors`.\n     * @param expected The expected type\n     * @param t The actual type\n     * @returns null if `t` is a subtype of `expected`; otherwise returns an error message\n     */\n    checkSubtype(expected, t) {\n        const error = checkSubtype(expected, t);\n        if (error)\n            this.error(error);\n        return error;\n    }\n}\n\nclass Let {\n    constructor(bindings, result) {\n        this.type = result.type;\n        this.bindings = [].concat(bindings);\n        this.result = result;\n    }\n    evaluate(ctx) {\n        return this.result.evaluate(ctx);\n    }\n    eachChild(fn) {\n        for (const binding of this.bindings) {\n            fn(binding[1]);\n        }\n        fn(this.result);\n    }\n    static parse(args, context) {\n        if (args.length < 4)\n            return context.error(`Expected at least 3 arguments, but found ${args.length - 1} instead.`);\n        const bindings = [];\n        for (let i = 1; i < args.length - 1; i += 2) {\n            const name = args[i];\n            if (typeof name !== 'string') {\n                return context.error(`Expected string, but found ${typeof name} instead.`, i);\n            }\n            if (/[^a-zA-Z0-9_]/.test(name)) {\n                return context.error(\"Variable names must contain only alphanumeric characters or '_'.\", i);\n            }\n            const value = context.parse(args[i + 1], i + 1);\n            if (!value)\n                return null;\n            bindings.push([name, value]);\n        }\n        const result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings);\n        if (!result)\n            return null;\n        return new Let(bindings, result);\n    }\n    outputDefined() {\n        return this.result.outputDefined();\n    }\n}\n\nclass Var {\n    constructor(name, boundExpression) {\n        this.type = boundExpression.type;\n        this.name = name;\n        this.boundExpression = boundExpression;\n    }\n    static parse(args, context) {\n        if (args.length !== 2 || typeof args[1] !== 'string')\n            return context.error(\"'var' expression requires exactly one string literal argument.\");\n        const name = args[1];\n        if (!context.scope.has(name)) {\n            return context.error(`Unknown variable \"${name}\". Make sure \"${name}\" has been bound in an enclosing \"let\" expression before using it.`, 1);\n        }\n        return new Var(name, context.scope.get(name));\n    }\n    evaluate(ctx) {\n        return this.boundExpression.evaluate(ctx);\n    }\n    eachChild() { }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass At {\n    constructor(type, index, input) {\n        this.type = type;\n        this.index = index;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 3)\n            return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n        const index = context.parse(args[1], 1, NumberType);\n        const input = context.parse(args[2], 2, array(context.expectedType || ValueType));\n        if (!index || !input)\n            return null;\n        const t = input.type;\n        return new At(t.itemType, index, input);\n    }\n    evaluate(ctx) {\n        const index = this.index.evaluate(ctx);\n        const array = this.input.evaluate(ctx);\n        if (index < 0) {\n            throw new RuntimeError(`Array index out of bounds: ${index} < 0.`);\n        }\n        if (index >= array.length) {\n            throw new RuntimeError(`Array index out of bounds: ${index} > ${array.length - 1}.`);\n        }\n        if (index !== Math.floor(index)) {\n            throw new RuntimeError(`Array index must be an integer, but found ${index} instead.`);\n        }\n        return array[index];\n    }\n    eachChild(fn) {\n        fn(this.index);\n        fn(this.input);\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass In {\n    constructor(needle, haystack) {\n        this.type = BooleanType;\n        this.needle = needle;\n        this.haystack = haystack;\n    }\n    static parse(args, context) {\n        if (args.length !== 3) {\n            return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n        }\n        const needle = context.parse(args[1], 1, ValueType);\n        const haystack = context.parse(args[2], 2, ValueType);\n        if (!needle || !haystack)\n            return null;\n        if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n            return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(needle.type)} instead`);\n        }\n        return new In(needle, haystack);\n    }\n    evaluate(ctx) {\n        const needle = this.needle.evaluate(ctx);\n        const haystack = this.haystack.evaluate(ctx);\n        if (!haystack)\n            return false;\n        if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n            throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(typeOf(needle))} instead.`);\n        }\n        if (!isValidNativeType(haystack, ['string', 'array'])) {\n            throw new RuntimeError(`Expected second argument to be of type array or string, but found ${typeToString(typeOf(haystack))} instead.`);\n        }\n        return haystack.indexOf(needle) >= 0;\n    }\n    eachChild(fn) {\n        fn(this.needle);\n        fn(this.haystack);\n    }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass IndexOf {\n    constructor(needle, haystack, fromIndex) {\n        this.type = NumberType;\n        this.needle = needle;\n        this.haystack = haystack;\n        this.fromIndex = fromIndex;\n    }\n    static parse(args, context) {\n        if (args.length <= 2 || args.length >= 5) {\n            return context.error(`Expected 2 or 3 arguments, but found ${args.length - 1} instead.`);\n        }\n        const needle = context.parse(args[1], 1, ValueType);\n        const haystack = context.parse(args[2], 2, ValueType);\n        if (!needle || !haystack)\n            return null;\n        if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n            return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(needle.type)} instead`);\n        }\n        if (args.length === 4) {\n            const fromIndex = context.parse(args[3], 3, NumberType);\n            if (!fromIndex)\n                return null;\n            return new IndexOf(needle, haystack, fromIndex);\n        }\n        else {\n            return new IndexOf(needle, haystack);\n        }\n    }\n    evaluate(ctx) {\n        const needle = this.needle.evaluate(ctx);\n        const haystack = this.haystack.evaluate(ctx);\n        if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n            throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${typeToString(typeOf(needle))} instead.`);\n        }\n        let fromIndex;\n        if (this.fromIndex) {\n            fromIndex = this.fromIndex.evaluate(ctx);\n        }\n        if (isValidNativeType(haystack, ['string'])) {\n            const rawIndex = haystack.indexOf(needle, fromIndex);\n            if (rawIndex === -1) {\n                return -1;\n            }\n            else {\n                // The index may be affected by surrogate pairs, so get the length of the preceding substring.\n                return [...haystack.slice(0, rawIndex)].length;\n            }\n        }\n        else if (isValidNativeType(haystack, ['array'])) {\n            return haystack.indexOf(needle, fromIndex);\n        }\n        else {\n            throw new RuntimeError(`Expected second argument to be of type array or string, but found ${typeToString(typeOf(haystack))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.needle);\n        fn(this.haystack);\n        if (this.fromIndex) {\n            fn(this.fromIndex);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass Match {\n    constructor(inputType, outputType, input, cases, outputs, otherwise) {\n        this.inputType = inputType;\n        this.type = outputType;\n        this.input = input;\n        this.cases = cases;\n        this.outputs = outputs;\n        this.otherwise = otherwise;\n    }\n    static parse(args, context) {\n        if (args.length < 5)\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        if (args.length % 2 !== 1)\n            return context.error('Expected an even number of arguments.');\n        let inputType;\n        let outputType;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        const cases = {};\n        const outputs = [];\n        for (let i = 2; i < args.length - 1; i += 2) {\n            let labels = args[i];\n            const value = args[i + 1];\n            if (!Array.isArray(labels)) {\n                labels = [labels];\n            }\n            const labelContext = context.concat(i);\n            if (labels.length === 0) {\n                return labelContext.error('Expected at least one branch label.');\n            }\n            for (const label of labels) {\n                if (typeof label !== 'number' && typeof label !== 'string') {\n                    return labelContext.error('Branch labels must be numbers or strings.');\n                }\n                else if (typeof label === 'number' && Math.abs(label) > Number.MAX_SAFE_INTEGER) {\n                    return labelContext.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);\n                }\n                else if (typeof label === 'number' && Math.floor(label) !== label) {\n                    return labelContext.error('Numeric branch labels must be integer values.');\n                }\n                else if (!inputType) {\n                    inputType = typeOf(label);\n                }\n                else if (labelContext.checkSubtype(inputType, typeOf(label))) {\n                    return null;\n                }\n                if (typeof cases[String(label)] !== 'undefined') {\n                    return labelContext.error('Branch labels must be unique.');\n                }\n                cases[String(label)] = outputs.length;\n            }\n            const result = context.parse(value, i, outputType);\n            if (!result)\n                return null;\n            outputType = outputType || result.type;\n            outputs.push(result);\n        }\n        const input = context.parse(args[1], 1, ValueType);\n        if (!input)\n            return null;\n        const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n        if (!otherwise)\n            return null;\n        if (input.type.kind !== 'value' &&\n            context.concat(1).checkSubtype(inputType, input.type)) {\n            return null;\n        }\n        return new Match(inputType, outputType, input, cases, outputs, otherwise);\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        const output = (typeOf(input) === this.inputType && this.outputs[this.cases[input]]) || this.otherwise;\n        return output.evaluate(ctx);\n    }\n    eachChild(fn) {\n        fn(this.input);\n        this.outputs.forEach(fn);\n        fn(this.otherwise);\n    }\n    outputDefined() {\n        return this.outputs.every((out) => out.outputDefined()) && this.otherwise.outputDefined();\n    }\n}\n\nclass Case {\n    constructor(type, branches, otherwise) {\n        this.type = type;\n        this.branches = branches;\n        this.otherwise = otherwise;\n    }\n    static parse(args, context) {\n        if (args.length < 4)\n            return context.error(`Expected at least 3 arguments, but found only ${args.length - 1}.`);\n        if (args.length % 2 !== 0)\n            return context.error('Expected an odd number of arguments.');\n        let outputType;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        const branches = [];\n        for (let i = 1; i < args.length - 1; i += 2) {\n            const test = context.parse(args[i], i, BooleanType);\n            if (!test)\n                return null;\n            const result = context.parse(args[i + 1], i + 1, outputType);\n            if (!result)\n                return null;\n            branches.push([test, result]);\n            outputType = outputType || result.type;\n        }\n        const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n        if (!otherwise)\n            return null;\n        if (!outputType)\n            throw new Error(\"Can't infer output type\");\n        return new Case(outputType, branches, otherwise);\n    }\n    evaluate(ctx) {\n        for (const [test, expression] of this.branches) {\n            if (test.evaluate(ctx)) {\n                return expression.evaluate(ctx);\n            }\n        }\n        return this.otherwise.evaluate(ctx);\n    }\n    eachChild(fn) {\n        for (const [test, expression] of this.branches) {\n            fn(test);\n            fn(expression);\n        }\n        fn(this.otherwise);\n    }\n    outputDefined() {\n        return (this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined());\n    }\n}\n\nclass Slice {\n    constructor(type, input, beginIndex, endIndex) {\n        this.type = type;\n        this.input = input;\n        this.beginIndex = beginIndex;\n        this.endIndex = endIndex;\n    }\n    static parse(args, context) {\n        if (args.length <= 2 || args.length >= 5) {\n            return context.error(`Expected 2 or 3 arguments, but found ${args.length - 1} instead.`);\n        }\n        const input = context.parse(args[1], 1, ValueType);\n        const beginIndex = context.parse(args[2], 2, NumberType);\n        if (!input || !beginIndex)\n            return null;\n        if (!isValidType(input.type, [array(ValueType), StringType, ValueType])) {\n            return context.error(`Expected first argument to be of type array or string, but found ${typeToString(input.type)} instead`);\n        }\n        if (args.length === 4) {\n            const endIndex = context.parse(args[3], 3, NumberType);\n            if (!endIndex)\n                return null;\n            return new Slice(input.type, input, beginIndex, endIndex);\n        }\n        else {\n            return new Slice(input.type, input, beginIndex);\n        }\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        const beginIndex = this.beginIndex.evaluate(ctx);\n        let endIndex;\n        if (this.endIndex) {\n            endIndex = this.endIndex.evaluate(ctx);\n        }\n        if (isValidNativeType(input, ['string'])) {\n            // Indices may be affected by surrogate pairs.\n            return [...input].slice(beginIndex, endIndex).join('');\n        }\n        else if (isValidNativeType(input, ['array'])) {\n            return input.slice(beginIndex, endIndex);\n        }\n        else {\n            throw new RuntimeError(`Expected first argument to be of type array or string, but found ${typeToString(typeOf(input))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n        fn(this.beginIndex);\n        if (this.endIndex) {\n            fn(this.endIndex);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\n/**\n * Returns the index of the last stop <= input, or 0 if it doesn't exist.\n * @private\n */\nfunction findStopLessThanOrEqualTo(stops, input) {\n    const lastIndex = stops.length - 1;\n    let lowerIndex = 0;\n    let upperIndex = lastIndex;\n    let currentIndex = 0;\n    let currentValue, nextValue;\n    while (lowerIndex <= upperIndex) {\n        currentIndex = Math.floor((lowerIndex + upperIndex) / 2);\n        currentValue = stops[currentIndex];\n        nextValue = stops[currentIndex + 1];\n        if (currentValue <= input) {\n            if (currentIndex === lastIndex || input < nextValue) {\n                // Search complete\n                return currentIndex;\n            }\n            lowerIndex = currentIndex + 1;\n        }\n        else if (currentValue > input) {\n            upperIndex = currentIndex - 1;\n        }\n        else {\n            throw new RuntimeError('Input is not a number.');\n        }\n    }\n    return 0;\n}\n\nclass Step {\n    constructor(type, input, stops) {\n        this.type = type;\n        this.input = input;\n        this.labels = [];\n        this.outputs = [];\n        for (const [label, expression] of stops) {\n            this.labels.push(label);\n            this.outputs.push(expression);\n        }\n    }\n    static parse(args, context) {\n        if (args.length - 1 < 4) {\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        }\n        if ((args.length - 1) % 2 !== 0) {\n            return context.error('Expected an even number of arguments.');\n        }\n        const input = context.parse(args[1], 1, NumberType);\n        if (!input)\n            return null;\n        const stops = [];\n        let outputType = null;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        for (let i = 1; i < args.length; i += 2) {\n            const label = i === 1 ? -Infinity : args[i];\n            const value = args[i + 1];\n            const labelKey = i;\n            const valueKey = i + 1;\n            if (typeof label !== 'number') {\n                return context.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n            }\n            if (stops.length && stops[stops.length - 1][0] >= label) {\n                return context.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n            }\n            const parsed = context.parse(value, valueKey, outputType);\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            stops.push([label, parsed]);\n        }\n        return new Step(outputType, input, stops);\n    }\n    evaluate(ctx) {\n        const labels = this.labels;\n        const outputs = this.outputs;\n        if (labels.length === 1) {\n            return outputs[0].evaluate(ctx);\n        }\n        const value = this.input.evaluate(ctx);\n        if (value <= labels[0]) {\n            return outputs[0].evaluate(ctx);\n        }\n        const stopCount = labels.length;\n        if (value >= labels[stopCount - 1]) {\n            return outputs[stopCount - 1].evaluate(ctx);\n        }\n        const index = findStopLessThanOrEqualTo(labels, value);\n        return outputs[index].evaluate(ctx);\n    }\n    eachChild(fn) {\n        fn(this.input);\n        for (const expression of this.outputs) {\n            fn(expression);\n        }\n    }\n    outputDefined() {\n        return this.outputs.every((out) => out.outputDefined());\n    }\n}\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar unitbezier;\nvar hasRequiredUnitbezier;\n\nfunction requireUnitbezier () {\n\tif (hasRequiredUnitbezier) return unitbezier;\n\thasRequiredUnitbezier = 1;\n\n\tunitbezier = UnitBezier;\n\n\tfunction UnitBezier(p1x, p1y, p2x, p2y) {\n\t    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n\t    this.cx = 3.0 * p1x;\n\t    this.bx = 3.0 * (p2x - p1x) - this.cx;\n\t    this.ax = 1.0 - this.cx - this.bx;\n\n\t    this.cy = 3.0 * p1y;\n\t    this.by = 3.0 * (p2y - p1y) - this.cy;\n\t    this.ay = 1.0 - this.cy - this.by;\n\n\t    this.p1x = p1x;\n\t    this.p1y = p1y;\n\t    this.p2x = p2x;\n\t    this.p2y = p2y;\n\t}\n\n\tUnitBezier.prototype = {\n\t    sampleCurveX: function (t) {\n\t        // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n\t        return ((this.ax * t + this.bx) * t + this.cx) * t;\n\t    },\n\n\t    sampleCurveY: function (t) {\n\t        return ((this.ay * t + this.by) * t + this.cy) * t;\n\t    },\n\n\t    sampleCurveDerivativeX: function (t) {\n\t        return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n\t    },\n\n\t    solveCurveX: function (x, epsilon) {\n\t        if (epsilon === undefined) epsilon = 1e-6;\n\n\t        if (x < 0.0) return 0.0;\n\t        if (x > 1.0) return 1.0;\n\n\t        var t = x;\n\n\t        // First try a few iterations of Newton's method - normally very fast.\n\t        for (var i = 0; i < 8; i++) {\n\t            var x2 = this.sampleCurveX(t) - x;\n\t            if (Math.abs(x2) < epsilon) return t;\n\n\t            var d2 = this.sampleCurveDerivativeX(t);\n\t            if (Math.abs(d2) < 1e-6) break;\n\n\t            t = t - x2 / d2;\n\t        }\n\n\t        // Fall back to the bisection method for reliability.\n\t        var t0 = 0.0;\n\t        var t1 = 1.0;\n\t        t = x;\n\n\t        for (i = 0; i < 20; i++) {\n\t            x2 = this.sampleCurveX(t);\n\t            if (Math.abs(x2 - x) < epsilon) break;\n\n\t            if (x > x2) {\n\t                t0 = t;\n\t            } else {\n\t                t1 = t;\n\t            }\n\n\t            t = (t1 - t0) * 0.5 + t0;\n\t        }\n\n\t        return t;\n\t    },\n\n\t    solve: function (x, epsilon) {\n\t        return this.sampleCurveY(this.solveCurveX(x, epsilon));\n\t    }\n\t};\n\treturn unitbezier;\n}\n\nvar unitbezierExports = requireUnitbezier();\nvar UnitBezier = /*@__PURE__*/getDefaultExportFromCjs(unitbezierExports);\n\nclass Interpolate {\n    constructor(type, operator, interpolation, input, stops) {\n        this.type = type;\n        this.operator = operator;\n        this.interpolation = interpolation;\n        this.input = input;\n        this.labels = [];\n        this.outputs = [];\n        for (const [label, expression] of stops) {\n            this.labels.push(label);\n            this.outputs.push(expression);\n        }\n    }\n    static interpolationFactor(interpolation, input, lower, upper) {\n        let t = 0;\n        if (interpolation.name === 'exponential') {\n            t = exponentialInterpolation(input, interpolation.base, lower, upper);\n        }\n        else if (interpolation.name === 'linear') {\n            t = exponentialInterpolation(input, 1, lower, upper);\n        }\n        else if (interpolation.name === 'cubic-bezier') {\n            const c = interpolation.controlPoints;\n            const ub = new UnitBezier(c[0], c[1], c[2], c[3]);\n            t = ub.solve(exponentialInterpolation(input, 1, lower, upper));\n        }\n        return t;\n    }\n    static parse(args, context) {\n        let [operator, interpolation, input, ...rest] = args;\n        if (!Array.isArray(interpolation) || interpolation.length === 0) {\n            return context.error('Expected an interpolation type expression.', 1);\n        }\n        if (interpolation[0] === 'linear') {\n            interpolation = { name: 'linear' };\n        }\n        else if (interpolation[0] === 'exponential') {\n            const base = interpolation[1];\n            if (typeof base !== 'number')\n                return context.error('Exponential interpolation requires a numeric base.', 1, 1);\n            interpolation = {\n                name: 'exponential',\n                base\n            };\n        }\n        else if (interpolation[0] === 'cubic-bezier') {\n            const controlPoints = interpolation.slice(1);\n            if (controlPoints.length !== 4 ||\n                controlPoints.some((t) => typeof t !== 'number' || t < 0 || t > 1)) {\n                return context.error('Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.', 1);\n            }\n            interpolation = {\n                name: 'cubic-bezier',\n                controlPoints: controlPoints\n            };\n        }\n        else {\n            return context.error(`Unknown interpolation type ${String(interpolation[0])}`, 1, 0);\n        }\n        if (args.length - 1 < 4) {\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        }\n        if ((args.length - 1) % 2 !== 0) {\n            return context.error('Expected an even number of arguments.');\n        }\n        input = context.parse(input, 2, NumberType);\n        if (!input)\n            return null;\n        const stops = [];\n        let outputType = null;\n        if ((operator === 'interpolate-hcl' || operator === 'interpolate-lab') &&\n            context.expectedType != ColorArrayType) {\n            outputType = ColorType;\n        }\n        else if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        for (let i = 0; i < rest.length; i += 2) {\n            const label = rest[i];\n            const value = rest[i + 1];\n            const labelKey = i + 3;\n            const valueKey = i + 4;\n            if (typeof label !== 'number') {\n                return context.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n            }\n            if (stops.length && stops[stops.length - 1][0] >= label) {\n                return context.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n            }\n            const parsed = context.parse(value, valueKey, outputType);\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            stops.push([label, parsed]);\n        }\n        if (!verifyType(outputType, NumberType) &&\n            !verifyType(outputType, ProjectionDefinitionType) &&\n            !verifyType(outputType, ColorType) &&\n            !verifyType(outputType, PaddingType) &&\n            !verifyType(outputType, NumberArrayType) &&\n            !verifyType(outputType, ColorArrayType) &&\n            !verifyType(outputType, VariableAnchorOffsetCollectionType) &&\n            !verifyType(outputType, array(NumberType))) {\n            return context.error(`Type ${typeToString(outputType)} is not interpolatable.`);\n        }\n        return new Interpolate(outputType, operator, interpolation, input, stops);\n    }\n    evaluate(ctx) {\n        const labels = this.labels;\n        const outputs = this.outputs;\n        if (labels.length === 1) {\n            return outputs[0].evaluate(ctx);\n        }\n        const value = this.input.evaluate(ctx);\n        if (value <= labels[0]) {\n            return outputs[0].evaluate(ctx);\n        }\n        const stopCount = labels.length;\n        if (value >= labels[stopCount - 1]) {\n            return outputs[stopCount - 1].evaluate(ctx);\n        }\n        const index = findStopLessThanOrEqualTo(labels, value);\n        const lower = labels[index];\n        const upper = labels[index + 1];\n        const t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);\n        const outputLower = outputs[index].evaluate(ctx);\n        const outputUpper = outputs[index + 1].evaluate(ctx);\n        switch (this.operator) {\n            case 'interpolate':\n                switch (this.type.kind) {\n                    case 'number':\n                        return interpolateNumber(outputLower, outputUpper, t);\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t);\n                    case 'padding':\n                        return Padding.interpolate(outputLower, outputUpper, t);\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t);\n                    case 'numberArray':\n                        return NumberArray.interpolate(outputLower, outputUpper, t);\n                    case 'variableAnchorOffsetCollection':\n                        return VariableAnchorOffsetCollection.interpolate(outputLower, outputUpper, t);\n                    case 'array':\n                        return interpolateArray(outputLower, outputUpper, t);\n                    case 'projectionDefinition':\n                        return ProjectionDefinition.interpolate(outputLower, outputUpper, t);\n                }\n            case 'interpolate-hcl':\n                switch (this.type.kind) {\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t, 'hcl');\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t, 'hcl');\n                }\n            case 'interpolate-lab':\n                switch (this.type.kind) {\n                    case 'color':\n                        return Color.interpolate(outputLower, outputUpper, t, 'lab');\n                    case 'colorArray':\n                        return ColorArray.interpolate(outputLower, outputUpper, t, 'lab');\n                }\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n        for (const expression of this.outputs) {\n            fn(expression);\n        }\n    }\n    outputDefined() {\n        return this.outputs.every((out) => out.outputDefined());\n    }\n}\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n * How it works: Two consecutive stop values define a (scaled and shifted) exponential function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n *                     = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`.  In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n */\nfunction exponentialInterpolation(input, base, lowerValue, upperValue) {\n    const difference = upperValue - lowerValue;\n    const progress = input - lowerValue;\n    if (difference === 0) {\n        return 0;\n    }\n    else if (base === 1) {\n        return progress / difference;\n    }\n    else {\n        return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n    }\n}\nconst interpolateFactory = {\n    color: Color.interpolate,\n    number: interpolateNumber,\n    padding: Padding.interpolate,\n    numberArray: NumberArray.interpolate,\n    colorArray: ColorArray.interpolate,\n    variableAnchorOffsetCollection: VariableAnchorOffsetCollection.interpolate,\n    array: interpolateArray\n};\n\nclass Coalesce {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2) {\n            return context.error('Expected at least one argument.');\n        }\n        let outputType = null;\n        const expectedType = context.expectedType;\n        if (expectedType && expectedType.kind !== 'value') {\n            outputType = expectedType;\n        }\n        const parsedArgs = [];\n        for (const arg of args.slice(1)) {\n            const parsed = context.parse(arg, 1 + parsedArgs.length, outputType, undefined, {\n                typeAnnotation: 'omit'\n            });\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            parsedArgs.push(parsed);\n        }\n        if (!outputType)\n            throw new Error('No output type');\n        // Above, we parse arguments without inferred type annotation so that\n        // they don't produce a runtime error for `null` input, which would\n        // preempt the desired null-coalescing behavior.\n        // Thus, if any of our arguments would have needed an annotation, we\n        // need to wrap the enclosing coalesce expression with it instead.\n        const needsAnnotation = expectedType && parsedArgs.some((arg) => checkSubtype(expectedType, arg.type));\n        return needsAnnotation\n            ? new Coalesce(ValueType, parsedArgs)\n            : new Coalesce(outputType, parsedArgs);\n    }\n    evaluate(ctx) {\n        let result = null;\n        let argCount = 0;\n        let requestedImageName;\n        for (const arg of this.args) {\n            argCount++;\n            result = arg.evaluate(ctx);\n            // we need to keep track of the first requested image in a coalesce statement\n            // if coalesce can't find a valid image, we return the first image name so styleimagemissing can fire\n            if (result && result instanceof ResolvedImage && !result.available) {\n                if (!requestedImageName) {\n                    requestedImageName = result.name;\n                }\n                result = null;\n                if (argCount === this.args.length) {\n                    result = requestedImageName;\n                }\n            }\n            if (result !== null)\n                break;\n        }\n        return result;\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every((arg) => arg.outputDefined());\n    }\n}\n\nfunction isComparableType(op, type) {\n    if (op === '==' || op === '!=') {\n        // equality operator\n        return (type.kind === 'boolean' ||\n            type.kind === 'string' ||\n            type.kind === 'number' ||\n            type.kind === 'null' ||\n            type.kind === 'value');\n    }\n    else {\n        // ordering operator\n        return type.kind === 'string' || type.kind === 'number' || type.kind === 'value';\n    }\n}\nfunction eq(ctx, a, b) {\n    return a === b;\n}\nfunction neq(ctx, a, b) {\n    return a !== b;\n}\nfunction lt(ctx, a, b) {\n    return a < b;\n}\nfunction gt(ctx, a, b) {\n    return a > b;\n}\nfunction lteq(ctx, a, b) {\n    return a <= b;\n}\nfunction gteq(ctx, a, b) {\n    return a >= b;\n}\nfunction eqCollate(ctx, a, b, c) {\n    return c.compare(a, b) === 0;\n}\nfunction neqCollate(ctx, a, b, c) {\n    return !eqCollate(ctx, a, b, c);\n}\nfunction ltCollate(ctx, a, b, c) {\n    return c.compare(a, b) < 0;\n}\nfunction gtCollate(ctx, a, b, c) {\n    return c.compare(a, b) > 0;\n}\nfunction lteqCollate(ctx, a, b, c) {\n    return c.compare(a, b) <= 0;\n}\nfunction gteqCollate(ctx, a, b, c) {\n    return c.compare(a, b) >= 0;\n}\n/**\n * Special form for comparison operators, implementing the signatures:\n * - (T, T, ?Collator) => boolean\n * - (T, value, ?Collator) => boolean\n * - (value, T, ?Collator) => boolean\n *\n * For inequalities, T must be either value, string, or number. For ==/!=, it\n * can also be boolean or null.\n *\n * Equality semantics are equivalent to Javascript's strict equality (===/!==)\n * -- i.e., when the arguments' types don't match, == evaluates to false, != to\n * true.\n *\n * When types don't match in an ordering comparison, a runtime error is thrown.\n *\n * @private\n */\nfunction makeComparison(op, compareBasic, compareWithCollator) {\n    const isOrderComparison = op !== '==' && op !== '!=';\n    return class Comparison {\n        constructor(lhs, rhs, collator) {\n            this.type = BooleanType;\n            this.lhs = lhs;\n            this.rhs = rhs;\n            this.collator = collator;\n            this.hasUntypedArgument = lhs.type.kind === 'value' || rhs.type.kind === 'value';\n        }\n        static parse(args, context) {\n            if (args.length !== 3 && args.length !== 4)\n                return context.error('Expected two or three arguments.');\n            const op = args[0];\n            let lhs = context.parse(args[1], 1, ValueType);\n            if (!lhs)\n                return null;\n            if (!isComparableType(op, lhs.type)) {\n                return context\n                    .concat(1)\n                    .error(`\"${op}\" comparisons are not supported for type '${typeToString(lhs.type)}'.`);\n            }\n            let rhs = context.parse(args[2], 2, ValueType);\n            if (!rhs)\n                return null;\n            if (!isComparableType(op, rhs.type)) {\n                return context\n                    .concat(2)\n                    .error(`\"${op}\" comparisons are not supported for type '${typeToString(rhs.type)}'.`);\n            }\n            if (lhs.type.kind !== rhs.type.kind &&\n                lhs.type.kind !== 'value' &&\n                rhs.type.kind !== 'value') {\n                return context.error(`Cannot compare types '${typeToString(lhs.type)}' and '${typeToString(rhs.type)}'.`);\n            }\n            if (isOrderComparison) {\n                // typing rules specific to less/greater than operators\n                if (lhs.type.kind === 'value' && rhs.type.kind !== 'value') {\n                    // (value, T)\n                    lhs = new Assertion(rhs.type, [lhs]);\n                }\n                else if (lhs.type.kind !== 'value' && rhs.type.kind === 'value') {\n                    // (T, value)\n                    rhs = new Assertion(lhs.type, [rhs]);\n                }\n            }\n            let collator = null;\n            if (args.length === 4) {\n                if (lhs.type.kind !== 'string' &&\n                    rhs.type.kind !== 'string' &&\n                    lhs.type.kind !== 'value' &&\n                    rhs.type.kind !== 'value') {\n                    return context.error('Cannot use collator to compare non-string types.');\n                }\n                collator = context.parse(args[3], 3, CollatorType);\n                if (!collator)\n                    return null;\n            }\n            return new Comparison(lhs, rhs, collator);\n        }\n        evaluate(ctx) {\n            const lhs = this.lhs.evaluate(ctx);\n            const rhs = this.rhs.evaluate(ctx);\n            if (isOrderComparison && this.hasUntypedArgument) {\n                const lt = typeOf(lhs);\n                const rt = typeOf(rhs);\n                // check that type is string or number, and equal\n                if (lt.kind !== rt.kind || !(lt.kind === 'string' || lt.kind === 'number')) {\n                    throw new RuntimeError(`Expected arguments for \"${op}\" to be (string, string) or (number, number), but found (${lt.kind}, ${rt.kind}) instead.`);\n                }\n            }\n            if (this.collator && !isOrderComparison && this.hasUntypedArgument) {\n                const lt = typeOf(lhs);\n                const rt = typeOf(rhs);\n                if (lt.kind !== 'string' || rt.kind !== 'string') {\n                    return compareBasic(ctx, lhs, rhs);\n                }\n            }\n            return this.collator\n                ? compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx))\n                : compareBasic(ctx, lhs, rhs);\n        }\n        eachChild(fn) {\n            fn(this.lhs);\n            fn(this.rhs);\n            if (this.collator) {\n                fn(this.collator);\n            }\n        }\n        outputDefined() {\n            return true;\n        }\n    };\n}\nconst Equals = makeComparison('==', eq, eqCollate);\nconst NotEquals = makeComparison('!=', neq, neqCollate);\nconst LessThan = makeComparison('<', lt, ltCollate);\nconst GreaterThan = makeComparison('>', gt, gtCollate);\nconst LessThanOrEqual = makeComparison('<=', lteq, lteqCollate);\nconst GreaterThanOrEqual = makeComparison('>=', gteq, gteqCollate);\n\nclass CollatorExpression {\n    constructor(caseSensitive, diacriticSensitive, locale) {\n        this.type = CollatorType;\n        this.locale = locale;\n        this.caseSensitive = caseSensitive;\n        this.diacriticSensitive = diacriticSensitive;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error('Expected one argument.');\n        const options = args[1];\n        if (typeof options !== 'object' || Array.isArray(options))\n            return context.error('Collator options argument must be an object.');\n        const caseSensitive = context.parse(options['case-sensitive'] === undefined ? false : options['case-sensitive'], 1, BooleanType);\n        if (!caseSensitive)\n            return null;\n        const diacriticSensitive = context.parse(options['diacritic-sensitive'] === undefined ? false : options['diacritic-sensitive'], 1, BooleanType);\n        if (!diacriticSensitive)\n            return null;\n        let locale = null;\n        if (options['locale']) {\n            locale = context.parse(options['locale'], 1, StringType);\n            if (!locale)\n                return null;\n        }\n        return new CollatorExpression(caseSensitive, diacriticSensitive, locale);\n    }\n    evaluate(ctx) {\n        return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);\n    }\n    eachChild(fn) {\n        fn(this.caseSensitive);\n        fn(this.diacriticSensitive);\n        if (this.locale) {\n            fn(this.locale);\n        }\n    }\n    outputDefined() {\n        // Technically the set of possible outputs is the combinatoric set of Collators produced\n        // by all possible outputs of locale/caseSensitive/diacriticSensitive\n        // But for the primary use of Collators in comparison operators, we ignore the Collator's\n        // possible outputs anyway, so we can get away with leaving this false for now.\n        return false;\n    }\n}\n\nclass NumberFormat {\n    constructor(number, locale, currency, minFractionDigits, maxFractionDigits) {\n        this.type = StringType;\n        this.number = number;\n        this.locale = locale;\n        this.currency = currency;\n        this.minFractionDigits = minFractionDigits;\n        this.maxFractionDigits = maxFractionDigits;\n    }\n    static parse(args, context) {\n        if (args.length !== 3)\n            return context.error('Expected two arguments.');\n        const number = context.parse(args[1], 1, NumberType);\n        if (!number)\n            return null;\n        const options = args[2];\n        if (typeof options !== 'object' || Array.isArray(options))\n            return context.error('NumberFormat options argument must be an object.');\n        let locale = null;\n        if (options['locale']) {\n            locale = context.parse(options['locale'], 1, StringType);\n            if (!locale)\n                return null;\n        }\n        let currency = null;\n        if (options['currency']) {\n            currency = context.parse(options['currency'], 1, StringType);\n            if (!currency)\n                return null;\n        }\n        let minFractionDigits = null;\n        if (options['min-fraction-digits']) {\n            minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType);\n            if (!minFractionDigits)\n                return null;\n        }\n        let maxFractionDigits = null;\n        if (options['max-fraction-digits']) {\n            maxFractionDigits = context.parse(options['max-fraction-digits'], 1, NumberType);\n            if (!maxFractionDigits)\n                return null;\n        }\n        return new NumberFormat(number, locale, currency, minFractionDigits, maxFractionDigits);\n    }\n    evaluate(ctx) {\n        return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {\n            style: this.currency ? 'currency' : 'decimal',\n            currency: this.currency ? this.currency.evaluate(ctx) : undefined,\n            minimumFractionDigits: this.minFractionDigits\n                ? this.minFractionDigits.evaluate(ctx)\n                : undefined,\n            maximumFractionDigits: this.maxFractionDigits\n                ? this.maxFractionDigits.evaluate(ctx)\n                : undefined\n        }).format(this.number.evaluate(ctx));\n    }\n    eachChild(fn) {\n        fn(this.number);\n        if (this.locale) {\n            fn(this.locale);\n        }\n        if (this.currency) {\n            fn(this.currency);\n        }\n        if (this.minFractionDigits) {\n            fn(this.minFractionDigits);\n        }\n        if (this.maxFractionDigits) {\n            fn(this.maxFractionDigits);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass FormatExpression {\n    constructor(sections) {\n        this.type = FormattedType;\n        this.sections = sections;\n    }\n    static parse(args, context) {\n        if (args.length < 2) {\n            return context.error('Expected at least one argument.');\n        }\n        const firstArg = args[1];\n        if (!Array.isArray(firstArg) && typeof firstArg === 'object') {\n            return context.error('First argument must be an image or text section.');\n        }\n        const sections = [];\n        let nextTokenMayBeObject = false;\n        for (let i = 1; i <= args.length - 1; ++i) {\n            const arg = args[i];\n            if (nextTokenMayBeObject && typeof arg === 'object' && !Array.isArray(arg)) {\n                nextTokenMayBeObject = false;\n                let scale = null;\n                if (arg['font-scale']) {\n                    scale = context.parse(arg['font-scale'], 1, NumberType);\n                    if (!scale)\n                        return null;\n                }\n                let font = null;\n                if (arg['text-font']) {\n                    font = context.parse(arg['text-font'], 1, array(StringType));\n                    if (!font)\n                        return null;\n                }\n                let textColor = null;\n                if (arg['text-color']) {\n                    textColor = context.parse(arg['text-color'], 1, ColorType);\n                    if (!textColor)\n                        return null;\n                }\n                let verticalAlign = null;\n                if (arg['vertical-align']) {\n                    if (typeof arg['vertical-align'] === 'string' &&\n                        !VERTICAL_ALIGN_OPTIONS.includes(arg['vertical-align'])) {\n                        return context.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${arg['vertical-align']}' instead.`);\n                    }\n                    verticalAlign = context.parse(arg['vertical-align'], 1, StringType);\n                    if (!verticalAlign)\n                        return null;\n                }\n                const lastExpression = sections[sections.length - 1];\n                lastExpression.scale = scale;\n                lastExpression.font = font;\n                lastExpression.textColor = textColor;\n                lastExpression.verticalAlign = verticalAlign;\n            }\n            else {\n                const content = context.parse(args[i], 1, ValueType);\n                if (!content)\n                    return null;\n                const kind = content.type.kind;\n                if (kind !== 'string' &&\n                    kind !== 'value' &&\n                    kind !== 'null' &&\n                    kind !== 'resolvedImage')\n                    return context.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");\n                nextTokenMayBeObject = true;\n                sections.push({\n                    content,\n                    scale: null,\n                    font: null,\n                    textColor: null,\n                    verticalAlign: null\n                });\n            }\n        }\n        return new FormatExpression(sections);\n    }\n    evaluate(ctx) {\n        const evaluateSection = (section) => {\n            const evaluatedContent = section.content.evaluate(ctx);\n            if (typeOf(evaluatedContent) === ResolvedImageType) {\n                return new FormattedSection('', evaluatedContent, null, null, null, section.verticalAlign ? section.verticalAlign.evaluate(ctx) : null);\n            }\n            return new FormattedSection(valueToString(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(',') : null, section.textColor ? section.textColor.evaluate(ctx) : null, section.verticalAlign ? section.verticalAlign.evaluate(ctx) : null);\n        };\n        return new Formatted(this.sections.map(evaluateSection));\n    }\n    eachChild(fn) {\n        for (const section of this.sections) {\n            fn(section.content);\n            if (section.scale) {\n                fn(section.scale);\n            }\n            if (section.font) {\n                fn(section.font);\n            }\n            if (section.textColor) {\n                fn(section.textColor);\n            }\n            if (section.verticalAlign) {\n                fn(section.verticalAlign);\n            }\n        }\n    }\n    outputDefined() {\n        // Technically the combinatoric set of all children\n        // Usually, this.text will be undefined anyway\n        return false;\n    }\n}\n\nclass ImageExpression {\n    constructor(input) {\n        this.type = ResolvedImageType;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 2) {\n            return context.error('Expected two arguments.');\n        }\n        const name = context.parse(args[1], 1, StringType);\n        if (!name)\n            return context.error('No image name provided.');\n        return new ImageExpression(name);\n    }\n    evaluate(ctx) {\n        const evaluatedImageName = this.input.evaluate(ctx);\n        const value = ResolvedImage.fromString(evaluatedImageName);\n        if (value && ctx.availableImages)\n            value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;\n        return value;\n    }\n    eachChild(fn) {\n        fn(this.input);\n    }\n    outputDefined() {\n        // The output of image is determined by the list of available images in the evaluation context\n        return false;\n    }\n}\n\nclass Length {\n    constructor(input) {\n        this.type = NumberType;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n        const input = context.parse(args[1], 1);\n        if (!input)\n            return null;\n        if (input.type.kind !== 'array' &&\n            input.type.kind !== 'string' &&\n            input.type.kind !== 'value')\n            return context.error(`Expected argument of type string or array, but found ${typeToString(input.type)} instead.`);\n        return new Length(input);\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        if (typeof input === 'string') {\n            // The length may be affected by surrogate pairs.\n            return [...input].length;\n        }\n        else if (Array.isArray(input)) {\n            return input.length;\n        }\n        else {\n            throw new RuntimeError(`Expected value to be of type string or array, but found ${typeToString(typeOf(input))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nconst EXTENT = 8192;\nfunction getTileCoordinates(p, canonical) {\n    const x = mercatorXfromLng(p[0]);\n    const y = mercatorYfromLat(p[1]);\n    const tilesAtZoom = Math.pow(2, canonical.z);\n    return [Math.round(x * tilesAtZoom * EXTENT), Math.round(y * tilesAtZoom * EXTENT)];\n}\nfunction getLngLatFromTileCoord(coord, canonical) {\n    const tilesAtZoom = Math.pow(2, canonical.z);\n    const x = (coord[0] / EXTENT + canonical.x) / tilesAtZoom;\n    const y = (coord[1] / EXTENT + canonical.y) / tilesAtZoom;\n    return [lngFromMercatorXfromLng(x), latFromMercatorY(y)];\n}\nfunction mercatorXfromLng(lng) {\n    return (180 + lng) / 360;\n}\nfunction lngFromMercatorXfromLng(mercatorX) {\n    return mercatorX * 360 - 180;\n}\nfunction mercatorYfromLat(lat) {\n    return (180 - (180 / Math.PI) * Math.log(Math.tan(Math.PI / 4 + (lat * Math.PI) / 360))) / 360;\n}\nfunction latFromMercatorY(mercatorY) {\n    return (360 / Math.PI) * Math.atan(Math.exp(((180 - mercatorY * 360) * Math.PI) / 180)) - 90;\n}\nfunction updateBBox(bbox, coord) {\n    bbox[0] = Math.min(bbox[0], coord[0]);\n    bbox[1] = Math.min(bbox[1], coord[1]);\n    bbox[2] = Math.max(bbox[2], coord[0]);\n    bbox[3] = Math.max(bbox[3], coord[1]);\n}\nfunction boxWithinBox(bbox1, bbox2) {\n    if (bbox1[0] <= bbox2[0])\n        return false;\n    if (bbox1[2] >= bbox2[2])\n        return false;\n    if (bbox1[1] <= bbox2[1])\n        return false;\n    if (bbox1[3] >= bbox2[3])\n        return false;\n    return true;\n}\nfunction rayIntersect(p, p1, p2) {\n    return (p1[1] > p[1] !== p2[1] > p[1] &&\n        p[0] < ((p2[0] - p1[0]) * (p[1] - p1[1])) / (p2[1] - p1[1]) + p1[0]);\n}\nfunction pointOnBoundary(p, p1, p2) {\n    const x1 = p[0] - p1[0];\n    const y1 = p[1] - p1[1];\n    const x2 = p[0] - p2[0];\n    const y2 = p[1] - p2[1];\n    return x1 * y2 - x2 * y1 === 0 && x1 * x2 <= 0 && y1 * y2 <= 0;\n}\n// a, b are end points for line segment1, c and d are end points for line segment2\nfunction segmentIntersectSegment(a, b, c, d) {\n    // check if two segments are parallel or not\n    // precondition is end point a, b is inside polygon, if line a->b is\n    // parallel to polygon edge c->d, then a->b won't intersect with c->d\n    const vectorP = [b[0] - a[0], b[1] - a[1]];\n    const vectorQ = [d[0] - c[0], d[1] - c[1]];\n    if (perp(vectorQ, vectorP) === 0)\n        return false;\n    // If lines are intersecting with each other, the relative location should be:\n    // a and b lie in different sides of segment c->d\n    // c and d lie in different sides of segment a->b\n    if (twoSided(a, b, c, d) && twoSided(c, d, a, b))\n        return true;\n    return false;\n}\nfunction lineIntersectPolygon(p1, p2, polygon) {\n    for (const ring of polygon) {\n        // loop through every edge of the ring\n        for (let j = 0; j < ring.length - 1; ++j) {\n            if (segmentIntersectSegment(p1, p2, ring[j], ring[j + 1])) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n// ray casting algorithm for detecting if point is in polygon\nfunction pointWithinPolygon(point, rings, trueIfOnBoundary = false) {\n    let inside = false;\n    for (const ring of rings) {\n        for (let j = 0; j < ring.length - 1; j++) {\n            if (pointOnBoundary(point, ring[j], ring[j + 1]))\n                return trueIfOnBoundary;\n            if (rayIntersect(point, ring[j], ring[j + 1]))\n                inside = !inside;\n        }\n    }\n    return inside;\n}\nfunction pointWithinPolygons(point, polygons) {\n    for (const polygon of polygons) {\n        if (pointWithinPolygon(point, polygon))\n            return true;\n    }\n    return false;\n}\nfunction lineStringWithinPolygon(line, polygon) {\n    // First, check if geometry points of line segments are all inside polygon\n    for (const point of line) {\n        if (!pointWithinPolygon(point, polygon)) {\n            return false;\n        }\n    }\n    // Second, check if there is line segment intersecting polygon edge\n    for (let i = 0; i < line.length - 1; ++i) {\n        if (lineIntersectPolygon(line[i], line[i + 1], polygon)) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction lineStringWithinPolygons(line, polygons) {\n    for (const polygon of polygons) {\n        if (lineStringWithinPolygon(line, polygon))\n            return true;\n    }\n    return false;\n}\nfunction perp(v1, v2) {\n    return v1[0] * v2[1] - v1[1] * v2[0];\n}\n// check if p1 and p2 are in different sides of line segment q1->q2\nfunction twoSided(p1, p2, q1, q2) {\n    // q1->p1 (x1, y1), q1->p2 (x2, y2), q1->q2 (x3, y3)\n    const x1 = p1[0] - q1[0];\n    const y1 = p1[1] - q1[1];\n    const x2 = p2[0] - q1[0];\n    const y2 = p2[1] - q1[1];\n    const x3 = q2[0] - q1[0];\n    const y3 = q2[1] - q1[1];\n    const det1 = x1 * y3 - x3 * y1;\n    const det2 = x2 * y3 - x3 * y2;\n    if ((det1 > 0 && det2 < 0) || (det1 < 0 && det2 > 0))\n        return true;\n    return false;\n}\n\nfunction getTilePolygon(coordinates, bbox, canonical) {\n    const polygon = [];\n    for (let i = 0; i < coordinates.length; i++) {\n        const ring = [];\n        for (let j = 0; j < coordinates[i].length; j++) {\n            const coord = getTileCoordinates(coordinates[i][j], canonical);\n            updateBBox(bbox, coord);\n            ring.push(coord);\n        }\n        polygon.push(ring);\n    }\n    return polygon;\n}\nfunction getTilePolygons(coordinates, bbox, canonical) {\n    const polygons = [];\n    for (let i = 0; i < coordinates.length; i++) {\n        const polygon = getTilePolygon(coordinates[i], bbox, canonical);\n        polygons.push(polygon);\n    }\n    return polygons;\n}\nfunction updatePoint(p, bbox, polyBBox, worldSize) {\n    if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {\n        const halfWorldSize = worldSize * 0.5;\n        let shift = p[0] - polyBBox[0] > halfWorldSize\n            ? -worldSize\n            : polyBBox[0] - p[0] > halfWorldSize\n                ? worldSize\n                : 0;\n        if (shift === 0) {\n            shift =\n                p[0] - polyBBox[2] > halfWorldSize\n                    ? -worldSize\n                    : polyBBox[2] - p[0] > halfWorldSize\n                        ? worldSize\n                        : 0;\n        }\n        p[0] += shift;\n    }\n    updateBBox(bbox, p);\n}\nfunction resetBBox(bbox) {\n    bbox[0] = bbox[1] = Infinity;\n    bbox[2] = bbox[3] = -Infinity;\n}\nfunction getTilePoints(geometry, pointBBox, polyBBox, canonical) {\n    const worldSize = Math.pow(2, canonical.z) * EXTENT;\n    const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n    const tilePoints = [];\n    for (const points of geometry) {\n        for (const point of points) {\n            const p = [point.x + shifts[0], point.y + shifts[1]];\n            updatePoint(p, pointBBox, polyBBox, worldSize);\n            tilePoints.push(p);\n        }\n    }\n    return tilePoints;\n}\nfunction getTileLines(geometry, lineBBox, polyBBox, canonical) {\n    const worldSize = Math.pow(2, canonical.z) * EXTENT;\n    const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n    const tileLines = [];\n    for (const line of geometry) {\n        const tileLine = [];\n        for (const point of line) {\n            const p = [point.x + shifts[0], point.y + shifts[1]];\n            updateBBox(lineBBox, p);\n            tileLine.push(p);\n        }\n        tileLines.push(tileLine);\n    }\n    if (lineBBox[2] - lineBBox[0] <= worldSize / 2) {\n        resetBBox(lineBBox);\n        for (const line of tileLines) {\n            for (const p of line) {\n                updatePoint(p, lineBBox, polyBBox, worldSize);\n            }\n        }\n    }\n    return tileLines;\n}\nfunction pointsWithinPolygons(ctx, polygonGeometry) {\n    const pointBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const canonical = ctx.canonicalID();\n    if (polygonGeometry.type === 'Polygon') {\n        const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n        const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n        if (!boxWithinBox(pointBBox, polyBBox))\n            return false;\n        for (const point of tilePoints) {\n            if (!pointWithinPolygon(point, tilePolygon))\n                return false;\n        }\n    }\n    if (polygonGeometry.type === 'MultiPolygon') {\n        const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n        const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n        if (!boxWithinBox(pointBBox, polyBBox))\n            return false;\n        for (const point of tilePoints) {\n            if (!pointWithinPolygons(point, tilePolygons))\n                return false;\n        }\n    }\n    return true;\n}\nfunction linesWithinPolygons(ctx, polygonGeometry) {\n    const lineBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const canonical = ctx.canonicalID();\n    if (polygonGeometry.type === 'Polygon') {\n        const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n        const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n        if (!boxWithinBox(lineBBox, polyBBox))\n            return false;\n        for (const line of tileLines) {\n            if (!lineStringWithinPolygon(line, tilePolygon))\n                return false;\n        }\n    }\n    if (polygonGeometry.type === 'MultiPolygon') {\n        const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n        const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n        if (!boxWithinBox(lineBBox, polyBBox))\n            return false;\n        for (const line of tileLines) {\n            if (!lineStringWithinPolygons(line, tilePolygons))\n                return false;\n        }\n    }\n    return true;\n}\nclass Within {\n    constructor(geojson, geometries) {\n        this.type = BooleanType;\n        this.geojson = geojson;\n        this.geometries = geometries;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'within' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (isValue(args[1])) {\n            const geojson = args[1];\n            if (geojson.type === 'FeatureCollection') {\n                const polygonsCoords = [];\n                for (const polygon of geojson.features) {\n                    const { type, coordinates } = polygon.geometry;\n                    if (type === 'Polygon') {\n                        polygonsCoords.push(coordinates);\n                    }\n                    if (type === 'MultiPolygon') {\n                        polygonsCoords.push(...coordinates);\n                    }\n                }\n                if (polygonsCoords.length) {\n                    const multipolygonWrapper = {\n                        type: 'MultiPolygon',\n                        coordinates: polygonsCoords\n                    };\n                    return new Within(geojson, multipolygonWrapper);\n                }\n            }\n            else if (geojson.type === 'Feature') {\n                const type = geojson.geometry.type;\n                if (type === 'Polygon' || type === 'MultiPolygon') {\n                    return new Within(geojson, geojson.geometry);\n                }\n            }\n            else if (geojson.type === 'Polygon' || geojson.type === 'MultiPolygon') {\n                return new Within(geojson, geojson);\n            }\n        }\n        return context.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\");\n    }\n    evaluate(ctx) {\n        if (ctx.geometry() != null && ctx.canonicalID() != null) {\n            if (ctx.geometryType() === 'Point') {\n                return pointsWithinPolygons(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'LineString') {\n                return linesWithinPolygons(ctx, this.geometries);\n            }\n        }\n        return false;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass TinyQueue {\n    constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n        this.data = data;\n        this.length = this.data.length;\n        this.compare = compare;\n\n        if (this.length > 0) {\n            for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n        }\n    }\n\n    push(item) {\n        this.data.push(item);\n        this._up(this.length++);\n    }\n\n    pop() {\n        if (this.length === 0) return undefined;\n\n        const top = this.data[0];\n        const bottom = this.data.pop();\n\n        if (--this.length > 0) {\n            this.data[0] = bottom;\n            this._down(0);\n        }\n\n        return top;\n    }\n\n    peek() {\n        return this.data[0];\n    }\n\n    _up(pos) {\n        const {data, compare} = this;\n        const item = data[pos];\n\n        while (pos > 0) {\n            const parent = (pos - 1) >> 1;\n            const current = data[parent];\n            if (compare(item, current) >= 0) break;\n            data[pos] = current;\n            pos = parent;\n        }\n\n        data[pos] = item;\n    }\n\n    _down(pos) {\n        const {data, compare} = this;\n        const halfLength = this.length >> 1;\n        const item = data[pos];\n\n        while (pos < halfLength) {\n            let bestChild = (pos << 1) + 1; // initially it is the left child\n            const right = bestChild + 1;\n\n            if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n                bestChild = right;\n            }\n            if (compare(data[bestChild], item) >= 0) break;\n\n            data[pos] = data[bestChild];\n            pos = bestChild;\n        }\n\n        data[pos] = item;\n    }\n}\n\n/**\n * Rearranges items so that all items in the [left, k] are the smallest.\n * The k-th element will have the (k - left + 1)-th smallest value in [left, right].\n *\n * @template T\n * @param {T[]} arr the array to partially sort (in place)\n * @param {number} k middle index for partial sorting (as defined above)\n * @param {number} [left=0] left index of the range to sort\n * @param {number} [right=arr.length-1] right index\n * @param {(a: T, b: T) => number} [compare = (a, b) => a - b] compare function\n */\nfunction quickselect(arr, k, left = 0, right = arr.length - 1, compare = defaultCompare) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            const n = right - left + 1;\n            const m = k - left + 1;\n            const z = Math.log(n);\n            const s = 0.5 * Math.exp(2 * z / 3);\n            const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            quickselect(arr, k, newLeft, newRight, compare);\n        }\n\n        const t = arr[k];\n        let i = left;\n        /** @type {number} */\n        let j = right;\n\n        swap(arr, left, k);\n        if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n        while (i < j) {\n            swap(arr, i, j);\n            i++;\n            j--;\n            while (compare(arr[i], t) < 0) i++;\n            while (compare(arr[j], t) > 0) j--;\n        }\n\n        if (compare(arr[left], t) === 0) swap(arr, left, j);\n        else {\n            j++;\n            swap(arr, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\n/**\n * @template T\n * @param {T[]} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\n/**\n * @template T\n * @param {T} a\n * @param {T} b\n * @returns {number}\n */\nfunction defaultCompare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * Classifies an array of rings into polygons with outer rings and holes\n * @param rings - the rings to classify\n * @param maxRings - the maximum number of rings to include in a polygon, use 0 to include all rings\n * @returns an array of polygons with internal rings as holes\n */\nfunction classifyRings(rings, maxRings) {\n    const len = rings.length;\n    if (len <= 1)\n        return [rings];\n    const polygons = [];\n    let polygon;\n    let ccw;\n    for (const ring of rings) {\n        const area = calculateSignedArea(ring);\n        if (area === 0)\n            continue;\n        ring.area = Math.abs(area);\n        if (ccw === undefined)\n            ccw = area < 0;\n        if (ccw === area < 0) {\n            if (polygon)\n                polygons.push(polygon);\n            polygon = [ring];\n        }\n        else {\n            polygon.push(ring);\n        }\n    }\n    if (polygon)\n        polygons.push(polygon);\n    // Earcut performance degrades with the # of rings in a polygon. For this\n    // reason, we limit strip out all but the `maxRings` largest rings.\n    if (maxRings > 1) {\n        for (let j = 0; j < polygons.length; j++) {\n            if (polygons[j].length <= maxRings)\n                continue;\n            quickselect(polygons[j], maxRings, 1, polygons[j].length - 1, compareAreas);\n            polygons[j] = polygons[j].slice(0, maxRings);\n        }\n    }\n    return polygons;\n}\nfunction compareAreas(a, b) {\n    return b.area - a.area;\n}\n/**\n * Returns the signed area for the polygon ring.  Positive areas are exterior rings and\n * have a clockwise winding.  Negative areas are interior rings and have a counter clockwise\n * ordering.\n *\n * @param ring - Exterior or interior ring\n * @returns Signed area\n */\nfunction calculateSignedArea(ring) {\n    let sum = 0;\n    for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n        p1 = ring[i];\n        p2 = ring[j];\n        sum += (p2.x - p1.x) * (p1.y + p2.y);\n    }\n    return sum;\n}\n\n// This is taken from https://github.com/mapbox/cheap-ruler/ in order to take only the relevant parts\n// Values that define WGS84 ellipsoid model of the Earth\nconst RE = 6378.137; // equatorial radius\nconst FE = 1 / 298.257223563; // flattening\nconst E2 = FE * (2 - FE);\nconst RAD = Math.PI / 180;\nclass CheapRuler {\n    constructor(lat) {\n        // Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional\n        const m = RAD * RE * 1000;\n        const coslat = Math.cos(lat * RAD);\n        const w2 = 1 / (1 - E2 * (1 - coslat * coslat));\n        const w = Math.sqrt(w2);\n        // multipliers for converting longitude and latitude degrees into distance\n        this.kx = m * w * coslat; // based on normal radius of curvature\n        this.ky = m * w * w2 * (1 - E2); // based on meridional radius of curvature\n    }\n    /**\n     * Given two points of the form [longitude, latitude], returns the distance.\n     *\n     * @param a - point [longitude, latitude]\n     * @param b - point [longitude, latitude]\n     * @returns distance\n     * @example\n     * const distance = ruler.distance([30.5, 50.5], [30.51, 50.49]);\n     * //=distance\n     */\n    distance(a, b) {\n        const dx = this.wrap(a[0] - b[0]) * this.kx;\n        const dy = (a[1] - b[1]) * this.ky;\n        return Math.sqrt(dx * dx + dy * dy);\n    }\n    /**\n     * Returns an object of the form {point, index, t}, where point is closest point on the line\n     * from the given point, index is the start index of the segment with the closest point,\n     * and t is a parameter from 0 to 1 that indicates where the closest point is on that segment.\n     *\n     * @param line - an array of points that form the line\n     * @param p - point [longitude, latitude]\n     * @returns the nearest point, its index in the array and the proportion along the line\n     * @example\n     * const point = ruler.pointOnLine(line, [-67.04, 50.5]).point;\n     * //=point\n     */\n    pointOnLine(line, p) {\n        let minDist = Infinity;\n        let minX, minY, minI, minT;\n        for (let i = 0; i < line.length - 1; i++) {\n            let x = line[i][0];\n            let y = line[i][1];\n            let dx = this.wrap(line[i + 1][0] - x) * this.kx;\n            let dy = (line[i + 1][1] - y) * this.ky;\n            let t = 0;\n            if (dx !== 0 || dy !== 0) {\n                t =\n                    (this.wrap(p[0] - x) * this.kx * dx + (p[1] - y) * this.ky * dy) /\n                        (dx * dx + dy * dy);\n                if (t > 1) {\n                    x = line[i + 1][0];\n                    y = line[i + 1][1];\n                }\n                else if (t > 0) {\n                    x += (dx / this.kx) * t;\n                    y += (dy / this.ky) * t;\n                }\n            }\n            dx = this.wrap(p[0] - x) * this.kx;\n            dy = (p[1] - y) * this.ky;\n            const sqDist = dx * dx + dy * dy;\n            if (sqDist < minDist) {\n                minDist = sqDist;\n                minX = x;\n                minY = y;\n                minI = i;\n                minT = t;\n            }\n        }\n        return {\n            point: [minX, minY],\n            index: minI,\n            t: Math.max(0, Math.min(1, minT))\n        };\n    }\n    wrap(deg) {\n        while (deg < -180)\n            deg += 360;\n        while (deg > 180)\n            deg -= 360;\n        return deg;\n    }\n}\n\nconst MinPointsSize = 100;\nconst MinLinePointsSize = 50;\nfunction compareDistPair(a, b) {\n    return b[0] - a[0];\n}\nfunction getRangeSize(range) {\n    return range[1] - range[0] + 1;\n}\nfunction isRangeSafe(range, threshold) {\n    return range[1] >= range[0] && range[1] < threshold;\n}\nfunction splitRange(range, isLine) {\n    if (range[0] > range[1]) {\n        return [null, null];\n    }\n    const size = getRangeSize(range);\n    if (isLine) {\n        if (size === 2) {\n            return [range, null];\n        }\n        const size1 = Math.floor(size / 2);\n        return [\n            [range[0], range[0] + size1],\n            [range[0] + size1, range[1]]\n        ];\n    }\n    if (size === 1) {\n        return [range, null];\n    }\n    const size1 = Math.floor(size / 2) - 1;\n    return [\n        [range[0], range[0] + size1],\n        [range[0] + size1 + 1, range[1]]\n    ];\n}\nfunction getBBox(coords, range) {\n    if (!isRangeSafe(range, coords.length)) {\n        return [Infinity, Infinity, -Infinity, -Infinity];\n    }\n    const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n    for (let i = range[0]; i <= range[1]; ++i) {\n        updateBBox(bbox, coords[i]);\n    }\n    return bbox;\n}\nfunction getPolygonBBox(polygon) {\n    const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n    for (const ring of polygon) {\n        for (const coord of ring) {\n            updateBBox(bbox, coord);\n        }\n    }\n    return bbox;\n}\nfunction isValidBBox(bbox) {\n    return (bbox[0] !== -Infinity &&\n        bbox[1] !== -Infinity &&\n        bbox[2] !== Infinity &&\n        bbox[3] !== Infinity);\n}\n// Calculate the distance between two bounding boxes.\n// Calculate the delta in x and y direction, and use two fake points {0.0, 0.0}\n// and {dx, dy} to calculate the distance. Distance will be 0.0 if bounding box are overlapping.\nfunction bboxToBBoxDistance(bbox1, bbox2, ruler) {\n    if (!isValidBBox(bbox1) || !isValidBBox(bbox2)) {\n        return NaN;\n    }\n    let dx = 0.0;\n    let dy = 0.0;\n    // bbox1 in left side\n    if (bbox1[2] < bbox2[0]) {\n        dx = bbox2[0] - bbox1[2];\n    }\n    // bbox1 in right side\n    if (bbox1[0] > bbox2[2]) {\n        dx = bbox1[0] - bbox2[2];\n    }\n    // bbox1 in above side\n    if (bbox1[1] > bbox2[3]) {\n        dy = bbox1[1] - bbox2[3];\n    }\n    // bbox1 in down side\n    if (bbox1[3] < bbox2[1]) {\n        dy = bbox2[1] - bbox1[3];\n    }\n    return ruler.distance([0.0, 0.0], [dx, dy]);\n}\nfunction pointToLineDistance(point, line, ruler) {\n    const nearestPoint = ruler.pointOnLine(line, point);\n    return ruler.distance(point, nearestPoint.point);\n}\nfunction segmentToSegmentDistance(p1, p2, q1, q2, ruler) {\n    const dist1 = Math.min(pointToLineDistance(p1, [q1, q2], ruler), pointToLineDistance(p2, [q1, q2], ruler));\n    const dist2 = Math.min(pointToLineDistance(q1, [p1, p2], ruler), pointToLineDistance(q2, [p1, p2], ruler));\n    return Math.min(dist1, dist2);\n}\nfunction lineToLineDistance(line1, range1, line2, range2, ruler) {\n    const rangeSafe = isRangeSafe(range1, line1.length) && isRangeSafe(range2, line2.length);\n    if (!rangeSafe) {\n        return Infinity;\n    }\n    let dist = Infinity;\n    for (let i = range1[0]; i < range1[1]; ++i) {\n        const p1 = line1[i];\n        const p2 = line1[i + 1];\n        for (let j = range2[0]; j < range2[1]; ++j) {\n            const q1 = line2[j];\n            const q2 = line2[j + 1];\n            if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                return 0.0;\n            }\n            dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n        }\n    }\n    return dist;\n}\nfunction pointsToPointsDistance(points1, range1, points2, range2, ruler) {\n    const rangeSafe = isRangeSafe(range1, points1.length) && isRangeSafe(range2, points2.length);\n    if (!rangeSafe) {\n        return NaN;\n    }\n    let dist = Infinity;\n    for (let i = range1[0]; i <= range1[1]; ++i) {\n        for (let j = range2[0]; j <= range2[1]; ++j) {\n            dist = Math.min(dist, ruler.distance(points1[i], points2[j]));\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n    }\n    return dist;\n}\nfunction pointToPolygonDistance(point, polygon, ruler) {\n    if (pointWithinPolygon(point, polygon, true)) {\n        return 0.0;\n    }\n    let dist = Infinity;\n    for (const ring of polygon) {\n        const front = ring[0];\n        const back = ring[ring.length - 1];\n        if (front !== back) {\n            dist = Math.min(dist, pointToLineDistance(point, [back, front], ruler));\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n        const nearestPoint = ruler.pointOnLine(ring, point);\n        dist = Math.min(dist, ruler.distance(point, nearestPoint.point));\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction lineToPolygonDistance(line, range, polygon, ruler) {\n    if (!isRangeSafe(range, line.length)) {\n        return NaN;\n    }\n    for (let i = range[0]; i <= range[1]; ++i) {\n        if (pointWithinPolygon(line[i], polygon, true)) {\n            return 0.0;\n        }\n    }\n    let dist = Infinity;\n    for (let i = range[0]; i < range[1]; ++i) {\n        const p1 = line[i];\n        const p2 = line[i + 1];\n        for (const ring of polygon) {\n            for (let j = 0, len = ring.length, k = len - 1; j < len; k = j++) {\n                const q1 = ring[k];\n                const q2 = ring[j];\n                if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                    return 0.0;\n                }\n                dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n            }\n        }\n    }\n    return dist;\n}\nfunction polygonIntersect(poly1, poly2) {\n    for (const ring of poly1) {\n        for (const point of ring) {\n            if (pointWithinPolygon(point, poly2, true)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction polygonToPolygonDistance(polygon1, polygon2, ruler, currentMiniDist = Infinity) {\n    const bbox1 = getPolygonBBox(polygon1);\n    const bbox2 = getPolygonBBox(polygon2);\n    if (currentMiniDist !== Infinity &&\n        bboxToBBoxDistance(bbox1, bbox2, ruler) >= currentMiniDist) {\n        return currentMiniDist;\n    }\n    if (boxWithinBox(bbox1, bbox2)) {\n        if (polygonIntersect(polygon1, polygon2)) {\n            return 0.0;\n        }\n    }\n    else if (polygonIntersect(polygon2, polygon1)) {\n        return 0.0;\n    }\n    let dist = Infinity;\n    for (const ring1 of polygon1) {\n        for (let i = 0, len1 = ring1.length, l = len1 - 1; i < len1; l = i++) {\n            const p1 = ring1[l];\n            const p2 = ring1[i];\n            for (const ring2 of polygon2) {\n                for (let j = 0, len2 = ring2.length, k = len2 - 1; j < len2; k = j++) {\n                    const q1 = ring2[k];\n                    const q2 = ring2[j];\n                    if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                        return 0.0;\n                    }\n                    dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n                }\n            }\n        }\n    }\n    return dist;\n}\nfunction updateQueue(distQueue, miniDist, ruler, points, polyBBox, rangeA) {\n    if (!rangeA) {\n        return;\n    }\n    const tempDist = bboxToBBoxDistance(getBBox(points, rangeA), polyBBox, ruler);\n    // Insert new pair to the queue if the bbox distance is less than\n    // miniDist, The pair with biggest distance will be at the top\n    if (tempDist < miniDist) {\n        distQueue.push([tempDist, rangeA, [0, 0]]);\n    }\n}\nfunction updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, range1, range2) {\n    if (!range1 || !range2) {\n        return;\n    }\n    const tempDist = bboxToBBoxDistance(getBBox(pointSet1, range1), getBBox(pointSet2, range2), ruler);\n    // Insert new pair to the queue if the bbox distance is less than\n    // miniDist, The pair with biggest distance will be at the top\n    if (tempDist < miniDist) {\n        distQueue.push([tempDist, range1, range2]);\n    }\n}\n// Divide and conquer, the time complexity is O(n*lgn), faster than Brute force\n// O(n*n) Most of the time, use index for in-place processing.\nfunction pointsToPolygonDistance(points, isLine, polygon, ruler, currentMiniDist = Infinity) {\n    let miniDist = Math.min(ruler.distance(points[0], polygon[0][0]), currentMiniDist);\n    if (miniDist === 0.0) {\n        return miniDist;\n    }\n    const distQueue = new TinyQueue([[0, [0, points.length - 1], [0, 0]]], compareDistPair);\n    const polyBBox = getPolygonBBox(polygon);\n    while (distQueue.length > 0) {\n        const distPair = distQueue.pop();\n        if (distPair[0] >= miniDist) {\n            continue;\n        }\n        const range = distPair[1];\n        // In case the set size are relatively small, we could use brute-force directly\n        const threshold = isLine ? MinLinePointsSize : MinPointsSize;\n        if (getRangeSize(range) <= threshold) {\n            if (!isRangeSafe(range, points.length)) {\n                return NaN;\n            }\n            if (isLine) {\n                const tempDist = lineToPolygonDistance(points, range, polygon, ruler);\n                if (isNaN(tempDist) || tempDist === 0.0) {\n                    return tempDist;\n                }\n                miniDist = Math.min(miniDist, tempDist);\n            }\n            else {\n                for (let i = range[0]; i <= range[1]; ++i) {\n                    const tempDist = pointToPolygonDistance(points[i], polygon, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return 0.0;\n                    }\n                }\n            }\n        }\n        else {\n            const newRangesA = splitRange(range, isLine);\n            updateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[0]);\n            updateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[1]);\n        }\n    }\n    return miniDist;\n}\nfunction pointSetToPointSetDistance(pointSet1, isLine1, pointSet2, isLine2, ruler, currentMiniDist = Infinity) {\n    let miniDist = Math.min(currentMiniDist, ruler.distance(pointSet1[0], pointSet2[0]));\n    if (miniDist === 0.0) {\n        return miniDist;\n    }\n    const distQueue = new TinyQueue([[0, [0, pointSet1.length - 1], [0, pointSet2.length - 1]]], compareDistPair);\n    while (distQueue.length > 0) {\n        const distPair = distQueue.pop();\n        if (distPair[0] >= miniDist) {\n            continue;\n        }\n        const rangeA = distPair[1];\n        const rangeB = distPair[2];\n        const threshold1 = isLine1 ? MinLinePointsSize : MinPointsSize;\n        const threshold2 = isLine2 ? MinLinePointsSize : MinPointsSize;\n        // In case the set size are relatively small, we could use brute-force directly\n        if (getRangeSize(rangeA) <= threshold1 && getRangeSize(rangeB) <= threshold2) {\n            if (!isRangeSafe(rangeA, pointSet1.length) && isRangeSafe(rangeB, pointSet2.length)) {\n                return NaN;\n            }\n            let tempDist;\n            if (isLine1 && isLine2) {\n                tempDist = lineToLineDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n                miniDist = Math.min(miniDist, tempDist);\n            }\n            else if (isLine1 && !isLine2) {\n                const sublibe = pointSet1.slice(rangeA[0], rangeA[1] + 1);\n                for (let i = rangeB[0]; i <= rangeB[1]; ++i) {\n                    tempDist = pointToLineDistance(pointSet2[i], sublibe, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return miniDist;\n                    }\n                }\n            }\n            else if (!isLine1 && isLine2) {\n                const sublibe = pointSet2.slice(rangeB[0], rangeB[1] + 1);\n                for (let i = rangeA[0]; i <= rangeA[1]; ++i) {\n                    tempDist = pointToLineDistance(pointSet1[i], sublibe, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return miniDist;\n                    }\n                }\n            }\n            else {\n                tempDist = pointsToPointsDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n                miniDist = Math.min(miniDist, tempDist);\n            }\n        }\n        else {\n            const newRangesA = splitRange(rangeA, isLine1);\n            const newRangesB = splitRange(rangeB, isLine2);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[0]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[1]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[0]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[1]);\n        }\n    }\n    return miniDist;\n}\nfunction pointToGeometryDistance(ctx, geometries) {\n    const tilePoints = ctx.geometry();\n    const pointPosition = tilePoints\n        .flat()\n        .map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n    if (tilePoints.length === 0) {\n        return NaN;\n    }\n    const ruler = new CheapRuler(pointPosition[0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        switch (geometry.type) {\n            case 'Point':\n                dist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, [geometry.coordinates], false, ruler, dist));\n                break;\n            case 'LineString':\n                dist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, geometry.coordinates, true, ruler, dist));\n                break;\n            case 'Polygon':\n                dist = Math.min(dist, pointsToPolygonDistance(pointPosition, false, geometry.coordinates, ruler, dist));\n                break;\n        }\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction lineStringToGeometryDistance(ctx, geometries) {\n    const tileLine = ctx.geometry();\n    const linePositions = tileLine\n        .flat()\n        .map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n    if (tileLine.length === 0) {\n        return NaN;\n    }\n    const ruler = new CheapRuler(linePositions[0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        switch (geometry.type) {\n            case 'Point':\n                dist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, [geometry.coordinates], false, ruler, dist));\n                break;\n            case 'LineString':\n                dist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, geometry.coordinates, true, ruler, dist));\n                break;\n            case 'Polygon':\n                dist = Math.min(dist, pointsToPolygonDistance(linePositions, true, geometry.coordinates, ruler, dist));\n                break;\n        }\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction polygonToGeometryDistance(ctx, geometries) {\n    const tilePolygon = ctx.geometry();\n    if (tilePolygon.length === 0 || tilePolygon[0].length === 0) {\n        return NaN;\n    }\n    const polygons = classifyRings(tilePolygon, 0).map((polygon) => {\n        return polygon.map((ring) => {\n            return ring.map((p) => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n        });\n    });\n    const ruler = new CheapRuler(polygons[0][0][0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        for (const polygon of polygons) {\n            switch (geometry.type) {\n                case 'Point':\n                    dist = Math.min(dist, pointsToPolygonDistance([geometry.coordinates], false, polygon, ruler, dist));\n                    break;\n                case 'LineString':\n                    dist = Math.min(dist, pointsToPolygonDistance(geometry.coordinates, true, polygon, ruler, dist));\n                    break;\n                case 'Polygon':\n                    dist = Math.min(dist, polygonToPolygonDistance(polygon, geometry.coordinates, ruler, dist));\n                    break;\n            }\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n    }\n    return dist;\n}\nfunction toSimpleGeometry(geometry) {\n    if (geometry.type === 'MultiPolygon') {\n        return geometry.coordinates.map((polygon) => {\n            return {\n                type: 'Polygon',\n                coordinates: polygon\n            };\n        });\n    }\n    if (geometry.type === 'MultiLineString') {\n        return geometry.coordinates.map((lineString) => {\n            return {\n                type: 'LineString',\n                coordinates: lineString\n            };\n        });\n    }\n    if (geometry.type === 'MultiPoint') {\n        return geometry.coordinates.map((point) => {\n            return {\n                type: 'Point',\n                coordinates: point\n            };\n        });\n    }\n    return [geometry];\n}\nclass Distance {\n    constructor(geojson, geometries) {\n        this.type = NumberType;\n        this.geojson = geojson;\n        this.geometries = geometries;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'distance' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (isValue(args[1])) {\n            const geojson = args[1];\n            if (geojson.type === 'FeatureCollection') {\n                return new Distance(geojson, geojson.features.map((feature) => toSimpleGeometry(feature.geometry)).flat());\n            }\n            else if (geojson.type === 'Feature') {\n                return new Distance(geojson, toSimpleGeometry(geojson.geometry));\n            }\n            else if ('type' in geojson && 'coordinates' in geojson) {\n                return new Distance(geojson, toSimpleGeometry(geojson));\n            }\n        }\n        return context.error(\"'distance' expression requires valid geojson object that contains polygon geometry type.\");\n    }\n    evaluate(ctx) {\n        if (ctx.geometry() != null && ctx.canonicalID() != null) {\n            if (ctx.geometryType() === 'Point') {\n                return pointToGeometryDistance(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'LineString') {\n                return lineStringToGeometryDistance(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'Polygon') {\n                return polygonToGeometryDistance(ctx, this.geometries);\n            }\n        }\n        return NaN;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass GlobalState {\n    constructor(key) {\n        this.type = ValueType;\n        this.key = key;\n    }\n    static parse(args, context) {\n        if (args.length !== 2) {\n            return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n        }\n        const key = args[1];\n        if (key === undefined || key === null) {\n            return context.error('Global state property must be defined.');\n        }\n        if (typeof key !== 'string') {\n            return context.error(`Global state property must be string, but found ${typeof args[1]} instead.`);\n        }\n        return new GlobalState(key);\n    }\n    evaluate(ctx) {\n        var _a;\n        const globalState = (_a = ctx.globals) === null || _a === void 0 ? void 0 : _a.globalState;\n        if (!globalState || Object.keys(globalState).length === 0)\n            return null;\n        return getOwn(globalState, this.key);\n    }\n    eachChild() { }\n    outputDefined() {\n        return false;\n    }\n}\n\nconst expressions$1 = {\n    // special forms\n    '==': Equals,\n    '!=': NotEquals,\n    '>': GreaterThan,\n    '<': LessThan,\n    '>=': GreaterThanOrEqual,\n    '<=': LessThanOrEqual,\n    array: Assertion,\n    at: At,\n    boolean: Assertion,\n    case: Case,\n    coalesce: Coalesce,\n    collator: CollatorExpression,\n    format: FormatExpression,\n    image: ImageExpression,\n    in: In,\n    'index-of': IndexOf,\n    interpolate: Interpolate,\n    'interpolate-hcl': Interpolate,\n    'interpolate-lab': Interpolate,\n    length: Length,\n    let: Let,\n    literal: Literal,\n    match: Match,\n    number: Assertion,\n    'number-format': NumberFormat,\n    object: Assertion,\n    slice: Slice,\n    step: Step,\n    string: Assertion,\n    'to-boolean': Coercion,\n    'to-color': Coercion,\n    'to-number': Coercion,\n    'to-string': Coercion,\n    var: Var,\n    within: Within,\n    distance: Distance,\n    'global-state': GlobalState\n};\n\nclass CompoundExpression {\n    constructor(name, type, evaluate, args) {\n        this.name = name;\n        this.type = type;\n        this._evaluate = evaluate;\n        this.args = args;\n    }\n    evaluate(ctx) {\n        return this._evaluate(ctx, this.args);\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return false;\n    }\n    static parse(args, context) {\n        const op = args[0];\n        const definition = CompoundExpression.definitions[op];\n        if (!definition) {\n            return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n        }\n        // Now check argument types against each signature\n        const type = Array.isArray(definition) ? definition[0] : definition.type;\n        const availableOverloads = Array.isArray(definition)\n            ? [[definition[1], definition[2]]]\n            : definition.overloads;\n        const overloads = availableOverloads.filter(([signature]) => !Array.isArray(signature) || // varags\n            signature.length === args.length - 1 // correct param count\n        );\n        let signatureContext = null;\n        for (const [params, evaluate] of overloads) {\n            // Use a fresh context for each attempted signature so that, if\n            // we eventually succeed, we haven't polluted `context.errors`.\n            signatureContext = new ParsingContext(context.registry, isExpressionConstant, context.path, null, context.scope);\n            // First parse all the args, potentially coercing to the\n            // types expected by this overload.\n            const parsedArgs = [];\n            let argParseFailed = false;\n            for (let i = 1; i < args.length; i++) {\n                const arg = args[i];\n                const expectedType = Array.isArray(params)\n                    ? params[i - 1]\n                    : params.type;\n                const parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);\n                if (!parsed) {\n                    argParseFailed = true;\n                    break;\n                }\n                parsedArgs.push(parsed);\n            }\n            if (argParseFailed) {\n                // Couldn't coerce args of this overload to expected type, move\n                // on to next one.\n                continue;\n            }\n            if (Array.isArray(params)) {\n                if (params.length !== parsedArgs.length) {\n                    signatureContext.error(`Expected ${params.length} arguments, but found ${parsedArgs.length} instead.`);\n                    continue;\n                }\n            }\n            for (let i = 0; i < parsedArgs.length; i++) {\n                const expected = Array.isArray(params) ? params[i] : params.type;\n                const arg = parsedArgs[i];\n                signatureContext.concat(i + 1).checkSubtype(expected, arg.type);\n            }\n            if (signatureContext.errors.length === 0) {\n                return new CompoundExpression(op, type, evaluate, parsedArgs);\n            }\n        }\n        if (overloads.length === 1) {\n            context.errors.push(...signatureContext.errors);\n        }\n        else {\n            const expected = overloads.length ? overloads : availableOverloads;\n            const signatures = expected\n                .map(([params]) => stringifySignature(params))\n                .join(' | ');\n            const actualTypes = [];\n            // For error message, re-parse arguments without trying to\n            // apply any coercions\n            for (let i = 1; i < args.length; i++) {\n                const parsed = context.parse(args[i], 1 + actualTypes.length);\n                if (!parsed)\n                    return null;\n                actualTypes.push(typeToString(parsed.type));\n            }\n            context.error(`Expected arguments of type ${signatures}, but found (${actualTypes.join(', ')}) instead.`);\n        }\n        return null;\n    }\n    static register(registry, definitions) {\n        CompoundExpression.definitions = definitions;\n        for (const name in definitions) {\n            registry[name] = CompoundExpression;\n        }\n    }\n}\nfunction rgba(ctx, [r, g, b, a]) {\n    r = r.evaluate(ctx);\n    g = g.evaluate(ctx);\n    b = b.evaluate(ctx);\n    const alpha = a ? a.evaluate(ctx) : 1;\n    const error = validateRGBA(r, g, b, alpha);\n    if (error)\n        throw new RuntimeError(error);\n    return new Color(r / 255, g / 255, b / 255, alpha, false);\n}\nfunction has(key, obj) {\n    return key in obj;\n}\nfunction get(key, obj) {\n    const v = obj[key];\n    return typeof v === 'undefined' ? null : v;\n}\nfunction binarySearch(v, a, i, j) {\n    while (i <= j) {\n        const m = (i + j) >> 1;\n        if (a[m] === v)\n            return true;\n        if (a[m] > v)\n            j = m - 1;\n        else\n            i = m + 1;\n    }\n    return false;\n}\nfunction varargs(type) {\n    return { type };\n}\nCompoundExpression.register(expressions$1, {\n    error: [\n        ErrorType,\n        [StringType],\n        (ctx, [v]) => {\n            throw new RuntimeError(v.evaluate(ctx));\n        }\n    ],\n    typeof: [StringType, [ValueType], (ctx, [v]) => typeToString(typeOf(v.evaluate(ctx)))],\n    'to-rgba': [\n        array(NumberType, 4),\n        [ColorType],\n        (ctx, [v]) => {\n            const [r, g, b, a] = v.evaluate(ctx).rgb;\n            return [r * 255, g * 255, b * 255, a];\n        }\n    ],\n    rgb: [ColorType, [NumberType, NumberType, NumberType], rgba],\n    rgba: [ColorType, [NumberType, NumberType, NumberType, NumberType], rgba],\n    has: {\n        type: BooleanType,\n        overloads: [\n            [[StringType], (ctx, [key]) => has(key.evaluate(ctx), ctx.properties())],\n            [\n                [StringType, ObjectType],\n                (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx))\n            ]\n        ]\n    },\n    get: {\n        type: ValueType,\n        overloads: [\n            [[StringType], (ctx, [key]) => get(key.evaluate(ctx), ctx.properties())],\n            [\n                [StringType, ObjectType],\n                (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))\n            ]\n        ]\n    },\n    'feature-state': [\n        ValueType,\n        [StringType],\n        (ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})\n    ],\n    properties: [ObjectType, [], (ctx) => ctx.properties()],\n    'geometry-type': [StringType, [], (ctx) => ctx.geometryType()],\n    id: [ValueType, [], (ctx) => ctx.id()],\n    zoom: [NumberType, [], (ctx) => ctx.globals.zoom],\n    'heatmap-density': [NumberType, [], (ctx) => ctx.globals.heatmapDensity || 0],\n    elevation: [NumberType, [], (ctx) => ctx.globals.elevation || 0],\n    'line-progress': [NumberType, [], (ctx) => ctx.globals.lineProgress || 0],\n    accumulated: [\n        ValueType,\n        [],\n        (ctx) => (ctx.globals.accumulated === undefined ? null : ctx.globals.accumulated)\n    ],\n    '+': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => {\n            let result = 0;\n            for (const arg of args) {\n                result += arg.evaluate(ctx);\n            }\n            return result;\n        }\n    ],\n    '*': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => {\n            let result = 1;\n            for (const arg of args) {\n                result *= arg.evaluate(ctx);\n            }\n            return result;\n        }\n    ],\n    '-': {\n        type: NumberType,\n        overloads: [\n            [[NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)],\n            [[NumberType], (ctx, [a]) => -a.evaluate(ctx)]\n        ]\n    },\n    '/': [NumberType, [NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)],\n    '%': [NumberType, [NumberType, NumberType], (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)],\n    ln2: [NumberType, [], () => Math.LN2],\n    pi: [NumberType, [], () => Math.PI],\n    e: [NumberType, [], () => Math.E],\n    '^': [\n        NumberType,\n        [NumberType, NumberType],\n        (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n    ],\n    sqrt: [NumberType, [NumberType], (ctx, [x]) => Math.sqrt(x.evaluate(ctx))],\n    log10: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10],\n    ln: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx))],\n    log2: [NumberType, [NumberType], (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2],\n    sin: [NumberType, [NumberType], (ctx, [n]) => Math.sin(n.evaluate(ctx))],\n    cos: [NumberType, [NumberType], (ctx, [n]) => Math.cos(n.evaluate(ctx))],\n    tan: [NumberType, [NumberType], (ctx, [n]) => Math.tan(n.evaluate(ctx))],\n    asin: [NumberType, [NumberType], (ctx, [n]) => Math.asin(n.evaluate(ctx))],\n    acos: [NumberType, [NumberType], (ctx, [n]) => Math.acos(n.evaluate(ctx))],\n    atan: [NumberType, [NumberType], (ctx, [n]) => Math.atan(n.evaluate(ctx))],\n    min: [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => Math.min(...args.map((arg) => arg.evaluate(ctx)))\n    ],\n    max: [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => Math.max(...args.map((arg) => arg.evaluate(ctx)))\n    ],\n    abs: [NumberType, [NumberType], (ctx, [n]) => Math.abs(n.evaluate(ctx))],\n    round: [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => {\n            const v = n.evaluate(ctx);\n            // Javascript's Math.round() rounds towards +Infinity for halfway\n            // values, even when they're negative. It's more common to round\n            // away from 0 (e.g., this is what python and C++ do)\n            return v < 0 ? -Math.round(-v) : Math.round(v);\n        }\n    ],\n    floor: [NumberType, [NumberType], (ctx, [n]) => Math.floor(n.evaluate(ctx))],\n    ceil: [NumberType, [NumberType], (ctx, [n]) => Math.ceil(n.evaluate(ctx))],\n    'filter-==': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => ctx.properties()[k.value] === v.value\n    ],\n    'filter-id-==': [BooleanType, [ValueType], (ctx, [v]) => ctx.id() === v.value],\n    'filter-type-==': [\n        BooleanType,\n        [StringType],\n        (ctx, [v]) => ctx.geometryType() === v.value\n    ],\n    'filter-<': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a < b;\n        }\n    ],\n    'filter-id-<': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a < b;\n        }\n    ],\n    'filter->': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a > b;\n        }\n    ],\n    'filter-id->': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a > b;\n        }\n    ],\n    'filter-<=': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a <= b;\n        }\n    ],\n    'filter-id-<=': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a <= b;\n        }\n    ],\n    'filter->=': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a >= b;\n        }\n    ],\n    'filter-id->=': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a >= b;\n        }\n    ],\n    'filter-has': [BooleanType, [ValueType], (ctx, [k]) => k.value in ctx.properties()],\n    'filter-has-id': [BooleanType, [], (ctx) => ctx.id() !== null && ctx.id() !== undefined],\n    'filter-type-in': [\n        BooleanType,\n        [array(StringType)],\n        (ctx, [v]) => v.value.indexOf(ctx.geometryType()) >= 0\n    ],\n    'filter-id-in': [\n        BooleanType,\n        [array(ValueType)],\n        (ctx, [v]) => v.value.indexOf(ctx.id()) >= 0\n    ],\n    'filter-in-small': [\n        BooleanType,\n        [StringType, array(ValueType)],\n        // assumes v is an array literal\n        (ctx, [k, v]) => v.value.indexOf(ctx.properties()[k.value]) >= 0\n    ],\n    'filter-in-large': [\n        BooleanType,\n        [StringType, array(ValueType)],\n        // assumes v is a array literal with values sorted in ascending order and of a single type\n        (ctx, [k, v]) => binarySearch(ctx.properties()[k.value], v.value, 0, v.value.length - 1)\n    ],\n    all: {\n        type: BooleanType,\n        overloads: [\n            [[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)],\n            [\n                varargs(BooleanType),\n                (ctx, args) => {\n                    for (const arg of args) {\n                        if (!arg.evaluate(ctx))\n                            return false;\n                    }\n                    return true;\n                }\n            ]\n        ]\n    },\n    any: {\n        type: BooleanType,\n        overloads: [\n            [[BooleanType, BooleanType], (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)],\n            [\n                varargs(BooleanType),\n                (ctx, args) => {\n                    for (const arg of args) {\n                        if (arg.evaluate(ctx))\n                            return true;\n                    }\n                    return false;\n                }\n            ]\n        ]\n    },\n    '!': [BooleanType, [BooleanType], (ctx, [b]) => !b.evaluate(ctx)],\n    'is-supported-script': [\n        BooleanType,\n        [StringType],\n        // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant\n        (ctx, [s]) => {\n            const isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;\n            if (isSupportedScript) {\n                return isSupportedScript(s.evaluate(ctx));\n            }\n            return true;\n        }\n    ],\n    upcase: [StringType, [StringType], (ctx, [s]) => s.evaluate(ctx).toUpperCase()],\n    downcase: [StringType, [StringType], (ctx, [s]) => s.evaluate(ctx).toLowerCase()],\n    concat: [\n        StringType,\n        varargs(ValueType),\n        (ctx, args) => args.map((arg) => valueToString(arg.evaluate(ctx))).join('')\n    ],\n    'resolved-locale': [\n        StringType,\n        [CollatorType],\n        (ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()\n    ]\n});\nfunction stringifySignature(signature) {\n    if (Array.isArray(signature)) {\n        return `(${signature.map(typeToString).join(', ')})`;\n    }\n    else {\n        return `(${typeToString(signature.type)}...)`;\n    }\n}\nfunction isExpressionConstant(expression) {\n    if (expression instanceof Var) {\n        return isExpressionConstant(expression.boundExpression);\n    }\n    else if (expression instanceof CompoundExpression && expression.name === 'error') {\n        return false;\n    }\n    else if (expression instanceof CollatorExpression) {\n        // Although the results of a Collator expression with fixed arguments\n        // generally shouldn't change between executions, we can't serialize them\n        // as constant expressions because results change based on environment.\n        return false;\n    }\n    else if (expression instanceof Within) {\n        return false;\n    }\n    else if (expression instanceof Distance) {\n        return false;\n    }\n    else if (expression instanceof GlobalState) {\n        return false;\n    }\n    const isTypeAnnotation = expression instanceof Coercion || expression instanceof Assertion;\n    let childrenConstant = true;\n    expression.eachChild((child) => {\n        // We can _almost_ assume that if `expressions` children are constant,\n        // they would already have been evaluated to Literal values when they\n        // were parsed.  Type annotations are the exception, because they might\n        // have been inferred and added after a child was parsed.\n        // So we recurse into isConstant() for the children of type annotations,\n        // but otherwise simply check whether they are Literals.\n        if (isTypeAnnotation) {\n            childrenConstant = childrenConstant && isExpressionConstant(child);\n        }\n        else {\n            childrenConstant = childrenConstant && child instanceof Literal;\n        }\n    });\n    if (!childrenConstant) {\n        return false;\n    }\n    return (isFeatureConstant(expression) &&\n        isGlobalPropertyConstant(expression, [\n            'zoom',\n            'heatmap-density',\n            'elevation',\n            'line-progress',\n            'accumulated',\n            'is-supported-script'\n        ]));\n}\nfunction isFeatureConstant(e) {\n    if (e instanceof CompoundExpression) {\n        if (e.name === 'get' && e.args.length === 1) {\n            return false;\n        }\n        else if (e.name === 'feature-state') {\n            return false;\n        }\n        else if (e.name === 'has' && e.args.length === 1) {\n            return false;\n        }\n        else if (e.name === 'properties' || e.name === 'geometry-type' || e.name === 'id') {\n            return false;\n        }\n        else if (/^filter-/.test(e.name)) {\n            return false;\n        }\n    }\n    if (e instanceof Within) {\n        return false;\n    }\n    if (e instanceof Distance) {\n        return false;\n    }\n    let result = true;\n    e.eachChild((arg) => {\n        if (result && !isFeatureConstant(arg)) {\n            result = false;\n        }\n    });\n    return result;\n}\nfunction isStateConstant(e) {\n    if (e instanceof CompoundExpression) {\n        if (e.name === 'feature-state') {\n            return false;\n        }\n    }\n    let result = true;\n    e.eachChild((arg) => {\n        if (result && !isStateConstant(arg)) {\n            result = false;\n        }\n    });\n    return result;\n}\nfunction isGlobalPropertyConstant(e, properties) {\n    if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {\n        return false;\n    }\n    let result = true;\n    e.eachChild((arg) => {\n        if (result && !isGlobalPropertyConstant(arg, properties)) {\n            result = false;\n        }\n    });\n    return result;\n}\n\nfunction success(value) {\n    return { result: 'success', value };\n}\nfunction error(value) {\n    return { result: 'error', value };\n}\n\nfunction supportsPropertyExpression(spec) {\n    return (spec['property-type'] === 'data-driven' ||\n        spec['property-type'] === 'cross-faded-data-driven');\n}\nfunction supportsZoomExpression(spec) {\n    return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1;\n}\nfunction supportsInterpolation(spec) {\n    return !!spec.expression && spec.expression.interpolated;\n}\n\nfunction getType(val) {\n    if (val instanceof Number) {\n        return 'number';\n    }\n    else if (val instanceof String) {\n        return 'string';\n    }\n    else if (val instanceof Boolean) {\n        return 'boolean';\n    }\n    else if (Array.isArray(val)) {\n        return 'array';\n    }\n    else if (val === null) {\n        return 'null';\n    }\n    else {\n        return typeof val;\n    }\n}\n\nfunction isFunction$1(value) {\n    return (typeof value === 'object' &&\n        value !== null &&\n        !Array.isArray(value) &&\n        typeOf(value) === ObjectType);\n}\nfunction identityFunction(x) {\n    return x;\n}\nfunction getParseFunction(propertySpec) {\n    switch (propertySpec.type) {\n        case 'color':\n            return Color.parse;\n        case 'padding':\n            return Padding.parse;\n        case 'numberArray':\n            return NumberArray.parse;\n        case 'colorArray':\n            return ColorArray.parse;\n        default:\n            return null;\n    }\n}\nfunction getInnerFunction(type) {\n    switch (type) {\n        case 'exponential':\n            return evaluateExponentialFunction;\n        case 'interval':\n            return evaluateIntervalFunction;\n        case 'categorical':\n            return evaluateCategoricalFunction;\n        case 'identity':\n            return evaluateIdentityFunction;\n        default:\n            throw new Error(`Unknown function type \"${type}\"`);\n    }\n}\nfunction createFunction(parameters, propertySpec) {\n    const zoomAndFeatureDependent = parameters.stops && typeof parameters.stops[0][0] === 'object';\n    const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n    const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n    const type = parameters.type || (supportsInterpolation(propertySpec) ? 'exponential' : 'interval');\n    const parseFn = getParseFunction(propertySpec);\n    if (parseFn) {\n        parameters = extendBy({}, parameters);\n        if (parameters.stops) {\n            parameters.stops = parameters.stops.map((stop) => {\n                return [stop[0], parseFn(stop[1])];\n            });\n        }\n        if (parameters.default) {\n            parameters.default = parseFn(parameters.default);\n        }\n        else {\n            parameters.default = parseFn(propertySpec.default);\n        }\n    }\n    if (parameters.colorSpace && !isSupportedInterpolationColorSpace(parameters.colorSpace)) {\n        throw new Error(`Unknown color space: \"${parameters.colorSpace}\"`);\n    }\n    const innerFun = getInnerFunction(type);\n    let hashedStops;\n    let categoricalKeyType;\n    if (type === 'categorical') {\n        // For categorical functions, generate an Object as a hashmap of the stops for fast searching\n        hashedStops = Object.create(null);\n        for (const stop of parameters.stops) {\n            hashedStops[stop[0]] = stop[1];\n        }\n        // Infer key type based on first stop key-- used to encforce strict type checking later\n        categoricalKeyType = typeof parameters.stops[0][0];\n    }\n    if (zoomAndFeatureDependent) {\n        const featureFunctions = {};\n        const zoomStops = [];\n        for (let s = 0; s < parameters.stops.length; s++) {\n            const stop = parameters.stops[s];\n            const zoom = stop[0].zoom;\n            if (featureFunctions[zoom] === undefined) {\n                featureFunctions[zoom] = {\n                    zoom,\n                    type: parameters.type,\n                    property: parameters.property,\n                    default: parameters.default,\n                    stops: []\n                };\n                zoomStops.push(zoom);\n            }\n            featureFunctions[zoom].stops.push([stop[0].value, stop[1]]);\n        }\n        const featureFunctionStops = [];\n        for (const z of zoomStops) {\n            featureFunctionStops.push([\n                featureFunctions[z].zoom,\n                createFunction(featureFunctions[z], propertySpec)\n            ]);\n        }\n        const interpolationType = { name: 'linear' };\n        return {\n            kind: 'composite',\n            interpolationType,\n            interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n            zoomStops: featureFunctionStops.map((s) => s[0]),\n            evaluate({ zoom }, properties) {\n                return evaluateExponentialFunction({\n                    stops: featureFunctionStops,\n                    base: parameters.base\n                }, propertySpec, zoom).evaluate(zoom, properties);\n            }\n        };\n    }\n    else if (zoomDependent) {\n        const interpolationType = type === 'exponential'\n            ? { name: 'exponential', base: parameters.base !== undefined ? parameters.base : 1 }\n            : null;\n        return {\n            kind: 'camera',\n            interpolationType,\n            interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n            zoomStops: parameters.stops.map((s) => s[0]),\n            evaluate: ({ zoom }) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)\n        };\n    }\n    else {\n        return {\n            kind: 'source',\n            evaluate(_, feature) {\n                const value = feature && feature.properties\n                    ? feature.properties[parameters.property]\n                    : undefined;\n                if (value === undefined) {\n                    return coalesce$1(parameters.default, propertySpec.default);\n                }\n                return innerFun(parameters, propertySpec, value, hashedStops, categoricalKeyType);\n            }\n        };\n    }\n}\nfunction coalesce$1(a, b, c) {\n    if (a !== undefined)\n        return a;\n    if (b !== undefined)\n        return b;\n    if (c !== undefined)\n        return c;\n}\nfunction evaluateCategoricalFunction(parameters, propertySpec, input, hashedStops, keyType) {\n    const evaluated = typeof input === keyType ? hashedStops[input] : undefined; // Enforce strict typing on input\n    return coalesce$1(evaluated, parameters.default, propertySpec.default);\n}\nfunction evaluateIntervalFunction(parameters, propertySpec, input) {\n    // Edge cases\n    if (getType(input) !== 'number')\n        return coalesce$1(parameters.default, propertySpec.default);\n    const n = parameters.stops.length;\n    if (n === 1)\n        return parameters.stops[0][1];\n    if (input <= parameters.stops[0][0])\n        return parameters.stops[0][1];\n    if (input >= parameters.stops[n - 1][0])\n        return parameters.stops[n - 1][1];\n    const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n    return parameters.stops[index][1];\n}\nfunction evaluateExponentialFunction(parameters, propertySpec, input) {\n    const base = parameters.base !== undefined ? parameters.base : 1;\n    // Edge cases\n    if (getType(input) !== 'number')\n        return coalesce$1(parameters.default, propertySpec.default);\n    const n = parameters.stops.length;\n    if (n === 1)\n        return parameters.stops[0][1];\n    if (input <= parameters.stops[0][0])\n        return parameters.stops[0][1];\n    if (input >= parameters.stops[n - 1][0])\n        return parameters.stops[n - 1][1];\n    const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n    const t = interpolationFactor(input, base, parameters.stops[index][0], parameters.stops[index + 1][0]);\n    const outputLower = parameters.stops[index][1];\n    const outputUpper = parameters.stops[index + 1][1];\n    const interp = interpolateFactory[propertySpec.type] || identityFunction;\n    if (typeof outputLower.evaluate === 'function') {\n        return {\n            evaluate(...args) {\n                const evaluatedLower = outputLower.evaluate.apply(undefined, args);\n                const evaluatedUpper = outputUpper.evaluate.apply(undefined, args);\n                // Special case for fill-outline-color, which has no spec default.\n                if (evaluatedLower === undefined || evaluatedUpper === undefined) {\n                    return undefined;\n                }\n                return interp(evaluatedLower, evaluatedUpper, t, parameters.colorSpace);\n            }\n        };\n    }\n    return interp(outputLower, outputUpper, t, parameters.colorSpace);\n}\nfunction evaluateIdentityFunction(parameters, propertySpec, input) {\n    switch (propertySpec.type) {\n        case 'color':\n            input = Color.parse(input);\n            break;\n        case 'formatted':\n            input = Formatted.fromString(input.toString());\n            break;\n        case 'resolvedImage':\n            input = ResolvedImage.fromString(input.toString());\n            break;\n        case 'padding':\n            input = Padding.parse(input);\n            break;\n        case 'colorArray':\n            input = ColorArray.parse(input);\n            break;\n        case 'numberArray':\n            input = NumberArray.parse(input);\n            break;\n        default:\n            if (getType(input) !== propertySpec.type &&\n                (propertySpec.type !== 'enum' || !propertySpec.values[input])) {\n                input = undefined;\n            }\n    }\n    return coalesce$1(input, parameters.default, propertySpec.default);\n}\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n *\n * How it works:\n * Two consecutive stop values define a (scaled and shifted) exponential\n * function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n *                     = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`.  In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n */\nfunction interpolationFactor(input, base, lowerValue, upperValue) {\n    const difference = upperValue - lowerValue;\n    const progress = input - lowerValue;\n    if (difference === 0) {\n        return 0;\n    }\n    else if (base === 1) {\n        return progress / difference;\n    }\n    else {\n        return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n    }\n}\n\nclass StyleExpression {\n    constructor(expression, propertySpec, globalState) {\n        this.expression = expression;\n        this._warningHistory = {};\n        this._evaluator = new EvaluationContext();\n        this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n        this._enumValues =\n            propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        this._evaluator.globals = globals;\n        this._evaluator.feature = feature;\n        this._evaluator.featureState = featureState;\n        this._evaluator.canonical = canonical;\n        this._evaluator.availableImages = availableImages || null;\n        this._evaluator.formattedSection = formattedSection;\n        return this.expression.evaluate(this._evaluator);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        this._evaluator.globals = globals;\n        this._evaluator.feature = feature || null;\n        this._evaluator.featureState = featureState || null;\n        this._evaluator.canonical = canonical;\n        this._evaluator.availableImages = availableImages || null;\n        this._evaluator.formattedSection = formattedSection || null;\n        try {\n            const val = this.expression.evaluate(this._evaluator);\n            if (val === null || val === undefined || (typeof val === 'number' && val !== val)) {\n                return this._defaultValue;\n            }\n            if (this._enumValues && !(val in this._enumValues)) {\n                throw new RuntimeError(`Expected value to be one of ${Object.keys(this._enumValues)\n                    .map((v) => JSON.stringify(v))\n                    .join(', ')}, but found ${JSON.stringify(val)} instead.`);\n            }\n            return val;\n        }\n        catch (e) {\n            if (!this._warningHistory[e.message]) {\n                this._warningHistory[e.message] = true;\n                if (typeof console !== 'undefined') {\n                    console.warn(e.message);\n                }\n            }\n            return this._defaultValue;\n        }\n    }\n}\nfunction isExpression(expression) {\n    return (Array.isArray(expression) &&\n        expression.length > 0 &&\n        typeof expression[0] === 'string' &&\n        expression[0] in expressions$1);\n}\n/**\n * Parse and typecheck the given style spec JSON expression.  If\n * options.defaultValue is provided, then the resulting StyleExpression's\n * `evaluate()` method will handle errors by logging a warning (once per\n * message) and returning the default value.  Otherwise, it will throw\n * evaluation errors.\n *\n * @private\n */\nfunction createExpression(expression, propertySpec, globalState) {\n    const parser = new ParsingContext(expressions$1, isExpressionConstant, [], propertySpec ? getExpectedType(propertySpec) : undefined);\n    // For string-valued properties, coerce to string at the top level rather than asserting.\n    const parsed = parser.parse(expression, undefined, undefined, undefined, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : undefined);\n    if (!parsed) {\n        return error(parser.errors);\n    }\n    return success(new StyleExpression(parsed, propertySpec, globalState));\n}\nclass ZoomConstantExpression {\n    constructor(kind, expression, globalState) {\n        this.kind = kind;\n        this._styleExpression = expression;\n        this.isStateDependent =\n            kind !== 'constant' && !isStateConstant(expression.expression);\n        this.globalStateRefs = findGlobalStateRefs(expression.expression);\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n}\nclass ZoomDependentExpression {\n    constructor(kind, expression, zoomStops, interpolationType, globalState) {\n        this.kind = kind;\n        this.zoomStops = zoomStops;\n        this._styleExpression = expression;\n        this.isStateDependent =\n            kind !== 'camera' && !isStateConstant(expression.expression);\n        this.globalStateRefs = findGlobalStateRefs(expression.expression);\n        this.interpolationType = interpolationType;\n        this._globalState = globalState;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        if (this._globalState) {\n            globals = addGlobalState(globals, this._globalState);\n        }\n        return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    interpolationFactor(input, lower, upper) {\n        if (this.interpolationType) {\n            return Interpolate.interpolationFactor(this.interpolationType, input, lower, upper);\n        }\n        else {\n            return 0;\n        }\n    }\n}\nfunction isZoomExpression(expression) {\n    return expression._styleExpression !== undefined;\n}\nfunction createPropertyExpression(expressionInput, propertySpec, globalState) {\n    const expression = createExpression(expressionInput, propertySpec, globalState);\n    if (expression.result === 'error') {\n        return expression;\n    }\n    const parsed = expression.value.expression;\n    const isFeatureConstantResult = isFeatureConstant(parsed);\n    if (!isFeatureConstantResult && !supportsPropertyExpression(propertySpec)) {\n        return error([new ExpressionParsingError('', 'data expressions not supported')]);\n    }\n    const isZoomConstant = isGlobalPropertyConstant(parsed, ['zoom']);\n    if (!isZoomConstant && !supportsZoomExpression(propertySpec)) {\n        return error([new ExpressionParsingError('', 'zoom expressions not supported')]);\n    }\n    const zoomCurve = findZoomCurve(parsed);\n    if (!zoomCurve && !isZoomConstant) {\n        return error([\n            new ExpressionParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')\n        ]);\n    }\n    else if (zoomCurve instanceof ExpressionParsingError) {\n        return error([zoomCurve]);\n    }\n    else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {\n        return error([\n            new ExpressionParsingError('', '\"interpolate\" expressions cannot be used with this property')\n        ]);\n    }\n    if (!zoomCurve) {\n        return success(isFeatureConstantResult\n            ? new ZoomConstantExpression('constant', expression.value, globalState)\n            : new ZoomConstantExpression('source', expression.value, globalState));\n    }\n    const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : undefined;\n    return success(isFeatureConstantResult\n        ? new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType, globalState)\n        : new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType, globalState));\n}\n// serialization wrapper for old-style stop functions normalized to the\n// expression interface\nclass StylePropertyFunction {\n    constructor(parameters, specification) {\n        this._parameters = parameters;\n        this._specification = specification;\n        extendBy(this, createFunction(this._parameters, this._specification));\n    }\n    static deserialize(serialized) {\n        return new StylePropertyFunction(serialized._parameters, serialized._specification);\n    }\n    static serialize(input) {\n        return {\n            _parameters: input._parameters,\n            _specification: input._specification\n        };\n    }\n}\nfunction normalizePropertyExpression(value, specification, globalState) {\n    if (isFunction$1(value)) {\n        return new StylePropertyFunction(value, specification);\n    }\n    else if (isExpression(value)) {\n        const expression = createPropertyExpression(value, specification, globalState);\n        if (expression.result === 'error') {\n            // this should have been caught in validation\n            throw new Error(expression.value.map((err) => `${err.key}: ${err.message}`).join(', '));\n        }\n        return expression.value;\n    }\n    else {\n        let constant = value;\n        if (specification.type === 'color' && typeof value === 'string') {\n            constant = Color.parse(value);\n        }\n        else if (specification.type === 'padding' &&\n            (typeof value === 'number' || Array.isArray(value))) {\n            constant = Padding.parse(value);\n        }\n        else if (specification.type === 'numberArray' &&\n            (typeof value === 'number' || Array.isArray(value))) {\n            constant = NumberArray.parse(value);\n        }\n        else if (specification.type === 'colorArray' &&\n            (typeof value === 'string' || Array.isArray(value))) {\n            constant = ColorArray.parse(value);\n        }\n        else if (specification.type === 'variableAnchorOffsetCollection' &&\n            Array.isArray(value)) {\n            constant = VariableAnchorOffsetCollection.parse(value);\n        }\n        else if (specification.type === 'projectionDefinition' && typeof value === 'string') {\n            constant = ProjectionDefinition.parse(value);\n        }\n        return {\n            globalStateRefs: new Set(),\n            _globalState: null,\n            kind: 'constant',\n            evaluate: () => constant\n        };\n    }\n}\n// Zoom-dependent expressions may only use [\"zoom\"] as the input to a top-level \"step\" or \"interpolate\"\n// expression (collectively referred to as a \"curve\"). The curve may be wrapped in one or more \"let\" or\n// \"coalesce\" expressions.\nfunction findZoomCurve(expression) {\n    let result = null;\n    if (expression instanceof Let) {\n        result = findZoomCurve(expression.result);\n    }\n    else if (expression instanceof Coalesce) {\n        for (const arg of expression.args) {\n            result = findZoomCurve(arg);\n            if (result) {\n                break;\n            }\n        }\n    }\n    else if ((expression instanceof Step || expression instanceof Interpolate) &&\n        expression.input instanceof CompoundExpression &&\n        expression.input.name === 'zoom') {\n        result = expression;\n    }\n    if (result instanceof ExpressionParsingError) {\n        return result;\n    }\n    expression.eachChild((child) => {\n        const childResult = findZoomCurve(child);\n        if (childResult instanceof ExpressionParsingError) {\n            result = childResult;\n        }\n        else if (!result && childResult) {\n            result = new ExpressionParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.');\n        }\n        else if (result && childResult && result !== childResult) {\n            result = new ExpressionParsingError('', 'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.');\n        }\n    });\n    return result;\n}\nfunction findGlobalStateRefs(expression, results = new Set()) {\n    if (expression instanceof GlobalState) {\n        results.add(expression.key);\n    }\n    expression.eachChild((childExpression) => {\n        findGlobalStateRefs(childExpression, results);\n    });\n    return results;\n}\nfunction getExpectedType(spec) {\n    const types = {\n        color: ColorType,\n        string: StringType,\n        number: NumberType,\n        enum: StringType,\n        boolean: BooleanType,\n        formatted: FormattedType,\n        padding: PaddingType,\n        numberArray: NumberArrayType,\n        colorArray: ColorArrayType,\n        projectionDefinition: ProjectionDefinitionType,\n        resolvedImage: ResolvedImageType,\n        variableAnchorOffsetCollection: VariableAnchorOffsetCollectionType\n    };\n    if (spec.type === 'array') {\n        return array(types[spec.value] || ValueType, spec.length);\n    }\n    return types[spec.type];\n}\nfunction getDefaultValue(spec) {\n    if (spec.type === 'color' && isFunction$1(spec.default)) {\n        // Special case for heatmap-color: it uses the 'default:' to define a\n        // default color ramp, but createExpression expects a simple value to fall\n        // back to in case of runtime errors\n        return new Color(0, 0, 0, 0);\n    }\n    switch (spec.type) {\n        case 'color':\n            return Color.parse(spec.default) || null;\n        case 'padding':\n            return Padding.parse(spec.default) || null;\n        case 'numberArray':\n            return NumberArray.parse(spec.default) || null;\n        case 'colorArray':\n            return ColorArray.parse(spec.default) || null;\n        case 'variableAnchorOffsetCollection':\n            return VariableAnchorOffsetCollection.parse(spec.default) || null;\n        case 'projectionDefinition':\n            return ProjectionDefinition.parse(spec.default) || null;\n        default:\n            return spec.default === undefined ? null : spec.default;\n    }\n}\nfunction addGlobalState(globals, globalState) {\n    const { zoom, heatmapDensity, elevation, lineProgress, isSupportedScript, accumulated } = globals !== null && globals !== void 0 ? globals : {};\n    return {\n        zoom,\n        heatmapDensity,\n        elevation,\n        lineProgress,\n        isSupportedScript,\n        accumulated,\n        globalState\n    };\n}\n\nfunction isExpressionFilter(filter) {\n    if (filter === true || filter === false) {\n        return true;\n    }\n    if (!Array.isArray(filter) || filter.length === 0) {\n        return false;\n    }\n    switch (filter[0]) {\n        case 'has':\n            return filter.length >= 2 && filter[1] !== '$id' && filter[1] !== '$type';\n        case 'in':\n            return (filter.length >= 3 && (typeof filter[1] !== 'string' || Array.isArray(filter[2])));\n        case '!in':\n        case '!has':\n        case 'none':\n            return false;\n        case '==':\n        case '!=':\n        case '>':\n        case '>=':\n        case '<':\n        case '<=':\n            return filter.length !== 3 || Array.isArray(filter[1]) || Array.isArray(filter[2]);\n        case 'any':\n        case 'all':\n            for (const f of filter.slice(1)) {\n                if (!isExpressionFilter(f) && typeof f !== 'boolean') {\n                    return false;\n                }\n            }\n            return true;\n        default:\n            return true;\n    }\n}\nconst filterSpec = {\n    type: 'boolean',\n    default: false,\n    transition: false,\n    'property-type': 'data-driven',\n    expression: {\n        interpolated: false,\n        parameters: ['zoom', 'feature']\n    }\n};\n/**\n * Given a filter expressed as nested arrays, return a new function\n * that evaluates whether a given feature (with a .properties or .tags property)\n * passes its test.\n *\n * @private\n * @param filter MapLibre filter\n * @param [globalState] Global state object to be used for evaluating 'global-state' expressions\n * @returns filter-evaluating function\n */\nfunction featureFilter(filter, globalState) {\n    if (filter === null || filter === undefined) {\n        return { filter: () => true, needGeometry: false, getGlobalStateRefs: () => new Set() };\n    }\n    if (!isExpressionFilter(filter)) {\n        filter = convertFilter$1(filter);\n    }\n    const compiled = createExpression(filter, filterSpec, globalState);\n    if (compiled.result === 'error') {\n        throw new Error(compiled.value.map((err) => `${err.key}: ${err.message}`).join(', '));\n    }\n    else {\n        const needGeometry = geometryNeeded(filter);\n        return {\n            filter: (globalProperties, feature, canonical) => compiled.value.evaluate(globalProperties, feature, {}, canonical),\n            needGeometry,\n            getGlobalStateRefs: () => findGlobalStateRefs(compiled.value.expression)\n        };\n    }\n}\n// Comparison function to sort numbers and strings\nfunction compare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\nfunction geometryNeeded(filter) {\n    if (!Array.isArray(filter))\n        return false;\n    if (filter[0] === 'within' || filter[0] === 'distance')\n        return true;\n    for (let index = 1; index < filter.length; index++) {\n        if (geometryNeeded(filter[index]))\n            return true;\n    }\n    return false;\n}\nfunction convertFilter$1(filter) {\n    if (!filter)\n        return true;\n    const op = filter[0];\n    if (filter.length <= 1)\n        return op !== 'any';\n    const converted = op === '=='\n        ? convertComparisonOp$1(filter[1], filter[2], '==')\n        : op === '!='\n            ? convertNegation(convertComparisonOp$1(filter[1], filter[2], '=='))\n            : op === '<' || op === '>' || op === '<=' || op === '>='\n                ? convertComparisonOp$1(filter[1], filter[2], op)\n                : op === 'any'\n                    ? convertDisjunctionOp(filter.slice(1))\n                    : op === 'all'\n                        ? ['all'].concat(filter.slice(1).map(convertFilter$1))\n                        : op === 'none'\n                            ? ['all'].concat(filter.slice(1).map(convertFilter$1).map(convertNegation))\n                            : op === 'in'\n                                ? convertInOp$1(filter[1], filter.slice(2))\n                                : op === '!in'\n                                    ? convertNegation(convertInOp$1(filter[1], filter.slice(2)))\n                                    : op === 'has'\n                                        ? convertHasOp$1(filter[1])\n                                        : op === '!has'\n                                            ? convertNegation(convertHasOp$1(filter[1]))\n                                            : true;\n    return converted;\n}\nfunction convertComparisonOp$1(property, value, op) {\n    switch (property) {\n        case '$type':\n            return [`filter-type-${op}`, value];\n        case '$id':\n            return [`filter-id-${op}`, value];\n        default:\n            return [`filter-${op}`, property, value];\n    }\n}\nfunction convertDisjunctionOp(filters) {\n    return ['any'].concat(filters.map(convertFilter$1));\n}\nfunction convertInOp$1(property, values) {\n    if (values.length === 0) {\n        return false;\n    }\n    switch (property) {\n        case '$type':\n            return ['filter-type-in', ['literal', values]];\n        case '$id':\n            return ['filter-id-in', ['literal', values]];\n        default:\n            if (values.length > 200 && !values.some((v) => typeof v !== typeof values[0])) {\n                return ['filter-in-large', property, ['literal', values.sort(compare)]];\n            }\n            else {\n                return ['filter-in-small', property, ['literal', values]];\n            }\n    }\n}\nfunction convertHasOp$1(property) {\n    switch (property) {\n        case '$type':\n            return true;\n        case '$id':\n            return ['filter-has-id'];\n        default:\n            return ['filter-has', property];\n    }\n}\nfunction convertNegation(filter) {\n    return ['!', filter];\n}\n\n/*\n * Convert the given filter to an expression, storing the expected types for\n * any feature properties referenced in expectedTypes.\n *\n * These expected types are needed in order to construct preflight type checks\n * needed for handling 'any' filters. A preflight type check is necessary in\n * order to mimic legacy filters' semantics around expected type mismatches.\n * For example, consider the legacy filter:\n *\n *     [\"any\", [\"all\", [\">\", \"y\", 0], [\">\", \"y\", 0]], [\">\", \"x\", 0]]\n *\n * Naively, we might convert this to the expression:\n *\n *     [\"any\", [\"all\", [\">\", [\"get\", \"y\"], 0], [\">\", [\"get\", \"z\"], 0]], [\">\", [\"get\", \"x\"], 0]]\n *\n * But if we tried to evaluate this against, say `{x: 1, y: null, z: 0}`, the\n * [\">\", [\"get\", \"y\"], 0] would cause an evaluation error, leading to the\n * entire filter returning false. Legacy filter semantics, though, ask for\n * [\">\", \"y\", 0] to simply return `false` when `y` is of the wrong type,\n * allowing the subsequent terms of the outer \"any\" expression to be evaluated\n * (resulting, in this case, in a `true` value, because x > 0).\n *\n * We account for this by inserting a preflight type-checking expression before\n * each \"any\" term, allowing us to avoid evaluating the actual converted filter\n * if any type mismatches would cause it to produce an evaluation error:\n *\n *     [\"any\",\n *       [\"case\",\n *         [\"all\", [\"==\", [\"typeof\", [\"get\", \"y\"]], \"number\"], [\"==\", [\"typeof\", [\"get\", \"z\"], \"number]],\n *         [\"all\", [\">\", [\"get\", \"y\"], 0], [\">\", [\"get\", \"z\"], 0]],\n *         false\n *       ],\n *       [\"case\",\n *         [\"==\", [\"typeof\", [\"get\", \"x\"], \"number\"]],\n *         [\">\", [\"get\", \"x\"], 0],\n *         false\n *       ]\n *     ]\n *\n * An alternative, possibly more direct approach would be to use type checks\n * in the conversion of each comparison operator, so that the converted version\n * of each individual ==, >=, etc. would mimic the legacy filter semantics. The\n * downside of this approach is that it can lead to many more type checks than\n * would otherwise be necessary: outside the context of an \"any\" expression,\n * bailing out due to a runtime type error (expression semantics) and returning\n * false (legacy filter semantics) are equivalent: they cause the filter to\n * produce a `false` result.\n */\nfunction convertFilter(filter, expectedTypes = {}) {\n    if (isExpressionFilter(filter))\n        return filter;\n    if (!filter)\n        return true;\n    const legacyFilter = filter;\n    const legacyOp = legacyFilter[0];\n    if (filter.length <= 1)\n        return legacyOp !== 'any';\n    switch (legacyOp) {\n        case '==':\n        case '!=':\n        case '<':\n        case '>':\n        case '<=':\n        case '>=': {\n            const [, property, value] = filter;\n            return convertComparisonOp(property, value, legacyOp, expectedTypes);\n        }\n        case 'any': {\n            const [, ...conditions] = legacyFilter;\n            const children = conditions.map((f) => {\n                const types = {};\n                const child = convertFilter(f, types);\n                const typechecks = runtimeTypeChecks(types);\n                return typechecks === true\n                    ? child\n                    : ['case', typechecks, child, false];\n            });\n            return ['any', ...children];\n        }\n        case 'all': {\n            const [, ...conditions] = legacyFilter;\n            const children = conditions.map((f) => convertFilter(f, expectedTypes));\n            return children.length > 1 ? ['all', ...children] : children[0];\n        }\n        case 'none': {\n            const [, ...conditions] = legacyFilter;\n            return ['!', convertFilter(['any', ...conditions], {})];\n        }\n        case 'in': {\n            const [, property, ...values] = legacyFilter;\n            return convertInOp(property, values);\n        }\n        case '!in': {\n            const [, property, ...values] = legacyFilter;\n            return convertInOp(property, values, true);\n        }\n        case 'has':\n            return convertHasOp(legacyFilter[1]);\n        case '!has':\n            return ['!', convertHasOp(legacyFilter[1])];\n        default:\n            return true;\n    }\n}\n// Given a set of feature properties and an expected type for each one,\n// construct an boolean expression that tests whether each property has the\n// right type.\n// E.g.: for {name: 'string', population: 'number'}, return\n// [ 'all',\n//   ['==', ['typeof', ['get', 'name'], 'string']],\n//   ['==', ['typeof', ['get', 'population'], 'number]]\n// ]\nfunction runtimeTypeChecks(expectedTypes) {\n    const conditions = [];\n    for (const property in expectedTypes) {\n        const get = property === '$id' ? ['id'] : ['get', property];\n        conditions.push(['==', ['typeof', get], expectedTypes[property]]);\n    }\n    if (conditions.length === 0)\n        return true;\n    if (conditions.length === 1)\n        return conditions[0];\n    return ['all', ...conditions];\n}\nfunction convertComparisonOp(property, value, op, expectedTypes) {\n    let get;\n    if (property === '$type') {\n        return [op, ['geometry-type'], value];\n    }\n    else if (property === '$id') {\n        get = ['id'];\n    }\n    else {\n        get = ['get', property];\n    }\n    if (expectedTypes && value !== null) {\n        const type = typeof value;\n        expectedTypes[property] = type;\n    }\n    if (op === '==' && property !== '$id' && value === null) {\n        return [\n            'all',\n            ['has', property], // missing property != null for legacy filters\n            ['==', get, null]\n        ];\n    }\n    else if (op === '!=' && property !== '$id' && value === null) {\n        return [\n            'any',\n            ['!', ['has', property]], // missing property != null for legacy filters\n            ['!=', get, null]\n        ];\n    }\n    return [op, get, value];\n}\nfunction convertInOp(property, values, negate = false) {\n    if (values.length === 0)\n        return negate;\n    let get;\n    if (property === '$type') {\n        get = ['geometry-type'];\n    }\n    else if (property === '$id') {\n        get = ['id'];\n    }\n    else {\n        get = ['get', property];\n    }\n    // Determine if the list of values to be searched is homogenously typed.\n    // If so (and if the type is string or number), then we can use a\n    // [match, input, [...values], true, false] construction rather than a\n    // bunch of `==` tests.\n    let uniformTypes = true;\n    const type = typeof values[0];\n    for (const value of values) {\n        if (typeof value !== type) {\n            uniformTypes = false;\n            break;\n        }\n    }\n    if (uniformTypes && (type === 'string' || type === 'number')) {\n        // Match expressions must have unique values.\n        const uniqueValues = values.sort().filter((v, i) => i === 0 || values[i - 1] !== v);\n        return ['match', get, uniqueValues, !negate, negate];\n    }\n    if (negate) {\n        return ['all', ...values.map((v) => ['!=', get, v])];\n    }\n    else {\n        return ['any', ...values.map((v) => ['==', get, v])];\n    }\n}\nfunction convertHasOp(property) {\n    if (property === '$type') {\n        return true;\n    }\n    else if (property === '$id') {\n        return ['!=', ['id'], null];\n    }\n    else {\n        return ['has', property];\n    }\n}\n\nfunction convertLiteral(value) {\n    return typeof value === 'object' ? ['literal', value] : value;\n}\nfunction convertFunction(parameters, propertySpec) {\n    let stops = parameters.stops;\n    if (!stops) {\n        // identity function\n        return convertIdentityFunction(parameters, propertySpec);\n    }\n    const zoomAndFeatureDependent = stops && typeof stops[0][0] === 'object';\n    const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n    const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n    stops = stops.map((stop) => {\n        if (!featureDependent && propertySpec.tokens && typeof stop[1] === 'string') {\n            return [stop[0], convertTokenString(stop[1])];\n        }\n        return [stop[0], convertLiteral(stop[1])];\n    });\n    if (zoomAndFeatureDependent) {\n        return convertZoomAndPropertyFunction(parameters, propertySpec, stops);\n    }\n    else if (zoomDependent) {\n        return convertZoomFunction(parameters, propertySpec, stops);\n    }\n    else {\n        return convertPropertyFunction(parameters, propertySpec, stops);\n    }\n}\nfunction convertIdentityFunction(parameters, propertySpec) {\n    const get = ['get', parameters.property];\n    if (parameters.default === undefined) {\n        // By default, expressions for string-valued properties get coerced. To preserve\n        // legacy function semantics, insert an explicit assertion instead.\n        return propertySpec.type === 'string' ? ['string', get] : get;\n    }\n    else if (propertySpec.type === 'enum') {\n        return ['match', get, Object.keys(propertySpec.values), get, parameters.default];\n    }\n    else {\n        const expression = [\n            propertySpec.type === 'color' ? 'to-color' : propertySpec.type,\n            get,\n            convertLiteral(parameters.default)\n        ];\n        if (propertySpec.type === 'array') {\n            expression.splice(1, 0, propertySpec.value, propertySpec.length || null);\n        }\n        return expression;\n    }\n}\nfunction getInterpolateOperator(parameters) {\n    switch (parameters.colorSpace) {\n        case 'hcl':\n            return 'interpolate-hcl';\n        case 'lab':\n            return 'interpolate-lab';\n        default:\n            return 'interpolate';\n    }\n}\nfunction convertZoomAndPropertyFunction(parameters, propertySpec, stops) {\n    const featureFunctionParameters = {};\n    const featureFunctionStops = {};\n    const zoomStops = [];\n    for (let s = 0; s < stops.length; s++) {\n        const stop = stops[s];\n        const zoom = stop[0].zoom;\n        if (featureFunctionParameters[zoom] === undefined) {\n            featureFunctionParameters[zoom] = {\n                zoom,\n                type: parameters.type,\n                property: parameters.property,\n                default: parameters.default\n            };\n            featureFunctionStops[zoom] = [];\n            zoomStops.push(zoom);\n        }\n        featureFunctionStops[zoom].push([stop[0].value, stop[1]]);\n    }\n    // the interpolation type for the zoom dimension of a zoom-and-property\n    // function is determined directly from the style property specification\n    // for which it's being used: linear for interpolatable properties, step\n    // otherwise.\n    const functionType = getFunctionType({}, propertySpec);\n    if (functionType === 'exponential') {\n        const expression = [getInterpolateOperator(parameters), ['linear'], ['zoom']];\n        for (const z of zoomStops) {\n            const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n            appendStopPair(expression, z, output, false);\n        }\n        return expression;\n    }\n    else {\n        const expression = ['step', ['zoom']];\n        for (const z of zoomStops) {\n            const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n            appendStopPair(expression, z, output, true);\n        }\n        fixupDegenerateStepCurve(expression);\n        return expression;\n    }\n}\nfunction coalesce(a, b) {\n    if (a !== undefined)\n        return a;\n    if (b !== undefined)\n        return b;\n}\nfunction getFallback(parameters, propertySpec) {\n    const defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));\n    /*\n     * Some fields with type: resolvedImage have an undefined default.\n     * Because undefined is an invalid value for resolvedImage, set fallback to\n     * an empty string instead of undefined to ensure output\n     * passes validation.\n     */\n    if (defaultValue === undefined && propertySpec.type === 'resolvedImage') {\n        return '';\n    }\n    return defaultValue;\n}\nfunction convertPropertyFunction(parameters, propertySpec, stops) {\n    const type = getFunctionType(parameters, propertySpec);\n    const get = ['get', parameters.property];\n    if (type === 'categorical' && typeof stops[0][0] === 'boolean') {\n        const expression = ['case'];\n        for (const stop of stops) {\n            expression.push(['==', get, stop[0]], stop[1]);\n        }\n        expression.push(getFallback(parameters, propertySpec));\n        return expression;\n    }\n    else if (type === 'categorical') {\n        const expression = ['match', get];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], false);\n        }\n        expression.push(getFallback(parameters, propertySpec));\n        return expression;\n    }\n    else if (type === 'interval') {\n        const expression = ['step', ['number', get]];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], true);\n        }\n        fixupDegenerateStepCurve(expression);\n        return parameters.default === undefined\n            ? expression\n            : [\n                'case',\n                ['==', ['typeof', get], 'number'],\n                expression,\n                convertLiteral(parameters.default)\n            ];\n    }\n    else if (type === 'exponential') {\n        const base = parameters.base !== undefined ? parameters.base : 1;\n        const expression = [\n            getInterpolateOperator(parameters),\n            base === 1 ? ['linear'] : ['exponential', base],\n            ['number', get]\n        ];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], false);\n        }\n        return parameters.default === undefined\n            ? expression\n            : [\n                'case',\n                ['==', ['typeof', get], 'number'],\n                expression,\n                convertLiteral(parameters.default)\n            ];\n    }\n    else {\n        throw new Error(`Unknown property function type ${type}`);\n    }\n}\nfunction convertZoomFunction(parameters, propertySpec, stops, input = ['zoom']) {\n    const type = getFunctionType(parameters, propertySpec);\n    let expression;\n    let isStep = false;\n    if (type === 'interval') {\n        expression = ['step', input];\n        isStep = true;\n    }\n    else if (type === 'exponential') {\n        const base = parameters.base !== undefined ? parameters.base : 1;\n        expression = [\n            getInterpolateOperator(parameters),\n            base === 1 ? ['linear'] : ['exponential', base],\n            input\n        ];\n    }\n    else {\n        throw new Error(`Unknown zoom function type \"${type}\"`);\n    }\n    for (const stop of stops) {\n        appendStopPair(expression, stop[0], stop[1], isStep);\n    }\n    fixupDegenerateStepCurve(expression);\n    return expression;\n}\nfunction fixupDegenerateStepCurve(expression) {\n    // degenerate step curve (i.e. a constant function): add a noop stop\n    if (expression[0] === 'step' && expression.length === 3) {\n        expression.push(0);\n        expression.push(expression[3]);\n    }\n}\nfunction appendStopPair(curve, input, output, isStep) {\n    // Skip duplicate stop values. They were not validated for functions, but they are for expressions.\n    // https://github.com/mapbox/mapbox-gl-js/issues/4107\n    if (curve.length > 3 && input === curve[curve.length - 2]) {\n        return;\n    }\n    // step curves don't get the first input value, as it is redundant.\n    if (!(isStep && curve.length === 2)) {\n        curve.push(input);\n    }\n    curve.push(output);\n}\nfunction getFunctionType(parameters, propertySpec) {\n    if (parameters.type) {\n        return parameters.type;\n    }\n    else {\n        return propertySpec.expression.interpolated ? 'exponential' : 'interval';\n    }\n}\n// \"String with {name} token\" => [\"concat\", \"String with \", [\"get\", \"name\"], \" token\"]\nfunction convertTokenString(s) {\n    const result = ['concat'];\n    const re = /{([^{}]+)}/g;\n    let pos = 0;\n    for (let match = re.exec(s); match !== null; match = re.exec(s)) {\n        const literal = s.slice(pos, re.lastIndex - match[0].length);\n        pos = re.lastIndex;\n        if (literal.length > 0)\n            result.push(literal);\n        result.push(['get', match[1]]);\n    }\n    if (result.length === 1) {\n        return s;\n    }\n    if (pos < s.length) {\n        result.push(s.slice(pos));\n    }\n    else if (result.length === 2) {\n        return ['to-string', result[1]];\n    }\n    return result;\n}\n\nfunction getPropertyReference(propertyName) {\n    for (let i = 0; i < v8Spec.layout.length; i++) {\n        for (const key in v8Spec[v8Spec.layout[i]]) {\n            if (key === propertyName)\n                return v8Spec[v8Spec.layout[i]][key];\n        }\n    }\n    for (let i = 0; i < v8Spec.paint.length; i++) {\n        for (const key in v8Spec[v8Spec.paint[i]]) {\n            if (key === propertyName)\n                return v8Spec[v8Spec.paint[i]][key];\n        }\n    }\n    return null;\n}\nfunction eachSource(style, callback) {\n    for (const k in style.sources) {\n        callback(style.sources[k]);\n    }\n}\nfunction eachLayer(style, callback) {\n    for (const layer of style.layers) {\n        callback(layer);\n    }\n}\nfunction eachProperty(style, options, callback) {\n    function inner(layer, propertyType) {\n        const properties = layer[propertyType];\n        if (!properties)\n            return;\n        Object.keys(properties).forEach((key) => {\n            callback({\n                path: [layer.id, propertyType, key],\n                key,\n                value: properties[key],\n                reference: getPropertyReference(key),\n                set(x) {\n                    properties[key] = x;\n                }\n            });\n        });\n    }\n    eachLayer(style, (layer) => {\n        if (options.paint) {\n            inner(layer, 'paint');\n        }\n        if (options.layout) {\n            inner(layer, 'layout');\n        }\n    });\n}\n\nfunction stringify$1(obj) {\n    const type = typeof obj;\n    if (type === 'number' ||\n        type === 'boolean' ||\n        type === 'string' ||\n        obj === undefined ||\n        obj === null)\n        return JSON.stringify(obj);\n    if (Array.isArray(obj)) {\n        let str = '[';\n        for (const val of obj) {\n            str += `${stringify$1(val)},`;\n        }\n        return `${str}]`;\n    }\n    const keys = Object.keys(obj).sort();\n    let str = '{';\n    for (let i = 0; i < keys.length; i++) {\n        str += `${JSON.stringify(keys[i])}:${stringify$1(obj[keys[i]])},`;\n    }\n    return `${str}}`;\n}\nfunction getKey(layer) {\n    let key = '';\n    for (const k of refProperties) {\n        key += `/${stringify$1(layer[k])}`;\n    }\n    return key;\n}\n/**\n * Groups layers by their layout-affecting properties.\n * These are the properties that were formerly used by explicit `ref` mechanism\n * for layers: 'type', 'source', 'source-layer', 'minzoom', 'maxzoom',\n * 'filter', and 'layout'.\n *\n * The input is not modified. The output layers are references to the\n * input layers.\n *\n * @param layers - an array of {@link LayerSpecification}.\n * @param cachedKeys - an object to keep already calculated keys.\n * @returns an array of arrays of {@link LayerSpecification} objects, where each inner array\n * contains layers that share the same layout-affecting properties.\n */\nfunction groupByLayout(layers, cachedKeys) {\n    const groups = {};\n    for (let i = 0; i < layers.length; i++) {\n        const k = (cachedKeys && cachedKeys[layers[i].id]) || getKey(layers[i]);\n        // update the cache if there is one\n        if (cachedKeys)\n            cachedKeys[layers[i].id] = k;\n        let group = groups[k];\n        if (!group) {\n            group = groups[k] = [];\n        }\n        group.push(layers[i]);\n    }\n    const result = [];\n    for (const k in groups) {\n        result.push(groups[k]);\n    }\n    return result;\n}\n\nfunction emptyStyle() {\n    const style = {};\n    const version = v8Spec['$version'];\n    for (const styleKey in v8Spec['$root']) {\n        const specification = v8Spec['$root'][styleKey];\n        if (specification.required) {\n            let value = null;\n            if (styleKey === 'version') {\n                value = version;\n            }\n            else {\n                if (specification.type === 'array') {\n                    value = [];\n                }\n                else {\n                    value = {};\n                }\n            }\n            if (value != null) {\n                style[styleKey] = value;\n            }\n        }\n    }\n    return style;\n}\n\nfunction validateConstants(options) {\n    const key = options.key;\n    const constants = options.value;\n    if (constants) {\n        return [new ValidationError(key, constants, 'constants have been deprecated as of v8')];\n    }\n    else {\n        return [];\n    }\n}\n\n// Turn jsonlint-lines-primitives objects into primitive objects\nfunction unbundle(value) {\n    if (value instanceof Number || value instanceof String || value instanceof Boolean) {\n        return value.valueOf();\n    }\n    else {\n        return value;\n    }\n}\nfunction deepUnbundle(value) {\n    if (Array.isArray(value)) {\n        return value.map(deepUnbundle);\n    }\n    else if (value instanceof Object &&\n        !(value instanceof Number || value instanceof String || value instanceof Boolean)) {\n        const unbundledValue = {};\n        for (const key in value) {\n            unbundledValue[key] = deepUnbundle(value[key]);\n        }\n        return unbundledValue;\n    }\n    return unbundle(value);\n}\n\nfunction validateObject(options) {\n    const key = options.key;\n    const object = options.value;\n    const elementSpecs = options.valueSpec || {};\n    const elementValidators = options.objectElementValidators || {};\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const validateSpec = options.validateSpec;\n    let errors = [];\n    const type = getType(object);\n    if (type !== 'object') {\n        return [new ValidationError(key, object, `object expected, ${type} found`)];\n    }\n    for (const objectKey in object) {\n        const elementSpecKey = objectKey.split('.')[0]; // treat 'paint.*' as 'paint'\n        // objectKey comes from the user controlled style input, so elementSpecKey may be e.g. \"__proto__\"\n        const elementSpec = getOwn(elementSpecs, elementSpecKey) || elementSpecs['*'];\n        let validateElement;\n        if (getOwn(elementValidators, elementSpecKey)) {\n            validateElement = elementValidators[elementSpecKey];\n        }\n        else if (getOwn(elementSpecs, elementSpecKey)) {\n            if (object[objectKey] === undefined) {\n                // property is possible, set but set to undefined\n                // we only check it if it is required and not defaulted in the next loop\n                // without skipping here, we would alert to properties being set to undefined\n                continue;\n            }\n            validateElement = validateSpec;\n        }\n        else if (elementValidators['*']) {\n            validateElement = elementValidators['*'];\n        }\n        else if (elementSpecs['*']) {\n            validateElement = validateSpec;\n        }\n        else {\n            errors.push(new ValidationError(key, object[objectKey], `unknown property \"${objectKey}\"`));\n            continue;\n        }\n        errors = errors.concat(validateElement({\n            key: (key ? `${key}.` : key) + objectKey,\n            value: object[objectKey],\n            valueSpec: elementSpec,\n            style,\n            styleSpec,\n            object,\n            objectKey,\n            validateSpec\n        }, object));\n    }\n    for (const elementSpecKey in elementSpecs) {\n        // Don't check `required` when there's a custom validator for that property.\n        if (elementValidators[elementSpecKey]) {\n            continue;\n        }\n        if (elementSpecs[elementSpecKey].required &&\n            elementSpecs[elementSpecKey]['default'] === undefined &&\n            object[elementSpecKey] === undefined) {\n            errors.push(new ValidationError(key, object, `missing required property \"${elementSpecKey}\"`));\n        }\n    }\n    return errors;\n}\n\nfunction validateArray(options) {\n    const array = options.value;\n    const arraySpec = options.valueSpec;\n    const validateSpec = options.validateSpec;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const key = options.key;\n    const validateArrayElement = options.arrayElementValidator || validateSpec;\n    if (getType(array) !== 'array') {\n        return [new ValidationError(key, array, `array expected, ${getType(array)} found`)];\n    }\n    if (arraySpec.length && array.length !== arraySpec.length) {\n        return [\n            new ValidationError(key, array, `array length ${arraySpec.length} expected, length ${array.length} found`)\n        ];\n    }\n    let arrayElementSpec = {\n        type: arraySpec.value,\n        values: arraySpec.values\n    };\n    if (styleSpec.$version < 7) {\n        arrayElementSpec['function'] = arraySpec.function;\n    }\n    if (getType(arraySpec.value) === 'object') {\n        arrayElementSpec = arraySpec.value;\n    }\n    let errors = [];\n    for (let i = 0; i < array.length; i++) {\n        errors = errors.concat(validateArrayElement({\n            array,\n            arrayIndex: i,\n            value: array[i],\n            valueSpec: arrayElementSpec,\n            validateSpec: options.validateSpec,\n            style,\n            styleSpec,\n            key: `${key}[${i}]`\n        }));\n    }\n    return errors;\n}\n\nfunction validateNumber(options) {\n    const key = options.key;\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    let type = getType(value);\n    if (type === 'number' && value !== value) {\n        type = 'NaN';\n    }\n    if (type !== 'number') {\n        return [new ValidationError(key, value, `number expected, ${type} found`)];\n    }\n    if ('minimum' in valueSpec && value < valueSpec.minimum) {\n        return [\n            new ValidationError(key, value, `${value} is less than the minimum value ${valueSpec.minimum}`)\n        ];\n    }\n    if ('maximum' in valueSpec && value > valueSpec.maximum) {\n        return [\n            new ValidationError(key, value, `${value} is greater than the maximum value ${valueSpec.maximum}`)\n        ];\n    }\n    return [];\n}\n\nfunction validateFunction(options) {\n    const functionValueSpec = options.valueSpec;\n    const functionType = unbundle(options.value.type);\n    let stopKeyType;\n    let stopDomainValues = {};\n    let previousStopDomainValue;\n    let previousStopDomainZoom;\n    const isZoomFunction = functionType !== 'categorical' && options.value.property === undefined;\n    const isPropertyFunction = !isZoomFunction;\n    const isZoomAndPropertyFunction = getType(options.value.stops) === 'array' &&\n        getType(options.value.stops[0]) === 'array' &&\n        getType(options.value.stops[0][0]) === 'object';\n    const errors = validateObject({\n        key: options.key,\n        value: options.value,\n        valueSpec: options.styleSpec.function,\n        validateSpec: options.validateSpec,\n        style: options.style,\n        styleSpec: options.styleSpec,\n        objectElementValidators: {\n            stops: validateFunctionStops,\n            default: validateFunctionDefault\n        }\n    });\n    if (functionType === 'identity' && isZoomFunction) {\n        errors.push(new ValidationError(options.key, options.value, 'missing required property \"property\"'));\n    }\n    if (functionType !== 'identity' && !options.value.stops) {\n        errors.push(new ValidationError(options.key, options.value, 'missing required property \"stops\"'));\n    }\n    if (functionType === 'exponential' &&\n        options.valueSpec.expression &&\n        !supportsInterpolation(options.valueSpec)) {\n        errors.push(new ValidationError(options.key, options.value, 'exponential functions not supported'));\n    }\n    if (options.styleSpec.$version >= 8) {\n        if (isPropertyFunction && !supportsPropertyExpression(options.valueSpec)) {\n            errors.push(new ValidationError(options.key, options.value, 'property functions not supported'));\n        }\n        else if (isZoomFunction && !supportsZoomExpression(options.valueSpec)) {\n            errors.push(new ValidationError(options.key, options.value, 'zoom functions not supported'));\n        }\n    }\n    if ((functionType === 'categorical' || isZoomAndPropertyFunction) &&\n        options.value.property === undefined) {\n        errors.push(new ValidationError(options.key, options.value, '\"property\" property is required'));\n    }\n    return errors;\n    function validateFunctionStops(options) {\n        if (functionType === 'identity') {\n            return [\n                new ValidationError(options.key, options.value, 'identity function may not have a \"stops\" property')\n            ];\n        }\n        let errors = [];\n        const value = options.value;\n        errors = errors.concat(validateArray({\n            key: options.key,\n            value,\n            valueSpec: options.valueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec,\n            arrayElementValidator: validateFunctionStop\n        }));\n        if (getType(value) === 'array' && value.length === 0) {\n            errors.push(new ValidationError(options.key, value, 'array must have at least one stop'));\n        }\n        return errors;\n    }\n    function validateFunctionStop(options) {\n        let errors = [];\n        const value = options.value;\n        const key = options.key;\n        if (getType(value) !== 'array') {\n            return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n        }\n        if (value.length !== 2) {\n            return [\n                new ValidationError(key, value, `array length 2 expected, length ${value.length} found`)\n            ];\n        }\n        if (isZoomAndPropertyFunction) {\n            if (getType(value[0]) !== 'object') {\n                return [\n                    new ValidationError(key, value, `object expected, ${getType(value[0])} found`)\n                ];\n            }\n            if (value[0].zoom === undefined) {\n                return [new ValidationError(key, value, 'object stop key must have zoom')];\n            }\n            if (value[0].value === undefined) {\n                return [new ValidationError(key, value, 'object stop key must have value')];\n            }\n            if (previousStopDomainZoom && previousStopDomainZoom > unbundle(value[0].zoom)) {\n                return [\n                    new ValidationError(key, value[0].zoom, 'stop zoom values must appear in ascending order')\n                ];\n            }\n            if (unbundle(value[0].zoom) !== previousStopDomainZoom) {\n                previousStopDomainZoom = unbundle(value[0].zoom);\n                previousStopDomainValue = undefined;\n                stopDomainValues = {};\n            }\n            errors = errors.concat(validateObject({\n                key: `${key}[0]`,\n                value: value[0],\n                valueSpec: { zoom: {} },\n                validateSpec: options.validateSpec,\n                style: options.style,\n                styleSpec: options.styleSpec,\n                objectElementValidators: {\n                    zoom: validateNumber,\n                    value: validateStopDomainValue\n                }\n            }));\n        }\n        else {\n            errors = errors.concat(validateStopDomainValue({\n                key: `${key}[0]`,\n                value: value[0],\n                validateSpec: options.validateSpec,\n                style: options.style,\n                styleSpec: options.styleSpec\n            }, value));\n        }\n        if (isExpression(deepUnbundle(value[1]))) {\n            return errors.concat([\n                new ValidationError(`${key}[1]`, value[1], 'expressions are not allowed in function stops.')\n            ]);\n        }\n        return errors.concat(options.validateSpec({\n            key: `${key}[1]`,\n            value: value[1],\n            valueSpec: functionValueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec\n        }));\n    }\n    function validateStopDomainValue(options, stop) {\n        const type = getType(options.value);\n        const value = unbundle(options.value);\n        const reportValue = options.value !== null ? options.value : stop;\n        if (!stopKeyType) {\n            stopKeyType = type;\n        }\n        else if (type !== stopKeyType) {\n            return [\n                new ValidationError(options.key, reportValue, `${type} stop domain type must match previous stop domain type ${stopKeyType}`)\n            ];\n        }\n        if (type !== 'number' && type !== 'string' && type !== 'boolean') {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain value must be a number, string, or boolean')\n            ];\n        }\n        if (type !== 'number' && functionType !== 'categorical') {\n            let message = `number expected, ${type} found`;\n            if (supportsPropertyExpression(functionValueSpec) && functionType === undefined) {\n                message +=\n                    '\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.';\n            }\n            return [new ValidationError(options.key, reportValue, message)];\n        }\n        if (functionType === 'categorical' &&\n            type === 'number' &&\n            (!isFinite(value) || Math.floor(value) !== value)) {\n            return [\n                new ValidationError(options.key, reportValue, `integer expected, found ${value}`)\n            ];\n        }\n        if (functionType !== 'categorical' &&\n            type === 'number' &&\n            previousStopDomainValue !== undefined &&\n            value < previousStopDomainValue) {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain values must appear in ascending order')\n            ];\n        }\n        else {\n            previousStopDomainValue = value;\n        }\n        if (functionType === 'categorical' && value in stopDomainValues) {\n            return [\n                new ValidationError(options.key, reportValue, 'stop domain values must be unique')\n            ];\n        }\n        else {\n            stopDomainValues[value] = true;\n        }\n        return [];\n    }\n    function validateFunctionDefault(options) {\n        return options.validateSpec({\n            key: options.key,\n            value: options.value,\n            valueSpec: functionValueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec\n        });\n    }\n}\n\nfunction validateExpression(options) {\n    const expression = (options.expressionContext === 'property' ? createPropertyExpression : createExpression)(deepUnbundle(options.value), options.valueSpec);\n    if (expression.result === 'error') {\n        return expression.value.map((error) => {\n            return new ValidationError(`${options.key}${error.key}`, options.value, error.message);\n        });\n    }\n    const expressionObj = expression.value.expression ||\n        expression.value._styleExpression.expression;\n    if (options.expressionContext === 'property' &&\n        options.propertyKey === 'text-font' &&\n        !expressionObj.outputDefined()) {\n        return [\n            new ValidationError(options.key, options.value, `Invalid data expression for \"${options.propertyKey}\". Output values must be contained as literals within the expression.`)\n        ];\n    }\n    if (options.expressionContext === 'property' &&\n        options.propertyType === 'layout' &&\n        !isStateConstant(expressionObj)) {\n        return [\n            new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with layout properties.')\n        ];\n    }\n    if (options.expressionContext === 'filter' && !isStateConstant(expressionObj)) {\n        return [\n            new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with filters.')\n        ];\n    }\n    if (options.expressionContext && options.expressionContext.indexOf('cluster') === 0) {\n        if (!isGlobalPropertyConstant(expressionObj, ['zoom', 'feature-state'])) {\n            return [\n                new ValidationError(options.key, options.value, '\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')\n            ];\n        }\n        if (options.expressionContext === 'cluster-initial' && !isFeatureConstant(expressionObj)) {\n            return [\n                new ValidationError(options.key, options.value, 'Feature data expressions are not supported with initial expression part of cluster properties.')\n            ];\n        }\n    }\n    return [];\n}\n\nfunction validateBoolean(options) {\n    const value = options.value;\n    const key = options.key;\n    const type = getType(value);\n    if (type !== 'boolean') {\n        return [new ValidationError(key, value, `boolean expected, ${type} found`)];\n    }\n    return [];\n}\n\nfunction validateColor(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type !== 'string') {\n        return [new ValidationError(key, value, `color expected, ${type} found`)];\n    }\n    if (!Color.parse(String(value))) {\n        // cast String object to string primitive\n        return [new ValidationError(key, value, `color expected, \"${value}\" found`)];\n    }\n    return [];\n}\n\nfunction validateEnum(options) {\n    const key = options.key;\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    const errors = [];\n    if (Array.isArray(valueSpec.values)) {\n        // <=v7\n        if (valueSpec.values.indexOf(unbundle(value)) === -1) {\n            errors.push(new ValidationError(key, value, `expected one of [${valueSpec.values.join(', ')}], ${JSON.stringify(value)} found`));\n        }\n    }\n    else {\n        // >=v8\n        if (Object.keys(valueSpec.values).indexOf(unbundle(value)) === -1) {\n            errors.push(new ValidationError(key, value, `expected one of [${Object.keys(valueSpec.values).join(', ')}], ${JSON.stringify(value)} found`));\n        }\n    }\n    return errors;\n}\n\nfunction validateFilter(options) {\n    if (isExpressionFilter(deepUnbundle(options.value))) {\n        return validateExpression(extendBy({}, options, {\n            expressionContext: 'filter',\n            valueSpec: { value: 'boolean' }\n        }));\n    }\n    else {\n        return validateNonExpressionFilter(options);\n    }\n}\nfunction validateNonExpressionFilter(options) {\n    const value = options.value;\n    const key = options.key;\n    if (getType(value) !== 'array') {\n        return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n    }\n    const styleSpec = options.styleSpec;\n    let type;\n    let errors = [];\n    if (value.length < 1) {\n        return [new ValidationError(key, value, 'filter array must have at least 1 element')];\n    }\n    errors = errors.concat(validateEnum({\n        key: `${key}[0]`,\n        value: value[0],\n        valueSpec: styleSpec.filter_operator,\n        style: options.style,\n        styleSpec: options.styleSpec\n    }));\n    switch (unbundle(value[0])) {\n        case '<':\n        case '<=':\n        case '>':\n        case '>=':\n            if (value.length >= 2 && unbundle(value[1]) === '$type') {\n                errors.push(new ValidationError(key, value, `\"$type\" cannot be use with operator \"${value[0]}\"`));\n            }\n        /* falls through */\n        case '==':\n        case '!=':\n            if (value.length !== 3) {\n                errors.push(new ValidationError(key, value, `filter array for operator \"${value[0]}\" must have 3 elements`));\n            }\n        /* falls through */\n        case 'in':\n        case '!in':\n            if (value.length >= 2) {\n                type = getType(value[1]);\n                if (type !== 'string') {\n                    errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n                }\n            }\n            for (let i = 2; i < value.length; i++) {\n                type = getType(value[i]);\n                if (unbundle(value[1]) === '$type') {\n                    errors = errors.concat(validateEnum({\n                        key: `${key}[${i}]`,\n                        value: value[i],\n                        valueSpec: styleSpec.geometry_type,\n                        style: options.style,\n                        styleSpec: options.styleSpec\n                    }));\n                }\n                else if (type !== 'string' && type !== 'number' && type !== 'boolean') {\n                    errors.push(new ValidationError(`${key}[${i}]`, value[i], `string, number, or boolean expected, ${type} found`));\n                }\n            }\n            break;\n        case 'any':\n        case 'all':\n        case 'none':\n            for (let i = 1; i < value.length; i++) {\n                errors = errors.concat(validateNonExpressionFilter({\n                    key: `${key}[${i}]`,\n                    value: value[i],\n                    style: options.style,\n                    styleSpec: options.styleSpec\n                }));\n            }\n            break;\n        case 'has':\n        case '!has':\n            type = getType(value[1]);\n            if (value.length !== 2) {\n                errors.push(new ValidationError(key, value, `filter array for \"${value[0]}\" operator must have 2 elements`));\n            }\n            else if (type !== 'string') {\n                errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n            }\n            break;\n    }\n    return errors;\n}\n\nfunction validateProperty(options, propertyType) {\n    const key = options.key;\n    const validateSpec = options.validateSpec;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const value = options.value;\n    const propertyKey = options.objectKey;\n    const layerSpec = styleSpec[`${propertyType}_${options.layerType}`];\n    if (!layerSpec)\n        return [];\n    const transitionMatch = propertyKey.match(/^(.*)-transition$/);\n    if (propertyType === 'paint' &&\n        transitionMatch &&\n        layerSpec[transitionMatch[1]] &&\n        layerSpec[transitionMatch[1]].transition) {\n        return validateSpec({\n            key,\n            value,\n            valueSpec: styleSpec.transition,\n            style,\n            styleSpec\n        });\n    }\n    const valueSpec = options.valueSpec || layerSpec[propertyKey];\n    if (!valueSpec) {\n        return [new ValidationError(key, value, `unknown property \"${propertyKey}\"`)];\n    }\n    let tokenMatch;\n    if (getType(value) === 'string' &&\n        supportsPropertyExpression(valueSpec) &&\n        !valueSpec.tokens &&\n        (tokenMatch = /^{([^}]+)}$/.exec(value))) {\n        return [\n            new ValidationError(key, value, `\"${propertyKey}\" does not support interpolation syntax\\n` +\n                `Use an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(tokenMatch[1])} }\\`.`)\n        ];\n    }\n    const errors = [];\n    if (options.layerType === 'symbol') {\n        if (propertyKey === 'text-font' &&\n            isFunction$1(deepUnbundle(value)) &&\n            unbundle(value.type) === 'identity') {\n            errors.push(new ValidationError(key, value, '\"text-font\" does not support identity functions'));\n        }\n    }\n    return errors.concat(validateSpec({\n        key: options.key,\n        value,\n        valueSpec,\n        style,\n        styleSpec,\n        expressionContext: 'property',\n        propertyType,\n        propertyKey\n    }));\n}\n\nfunction validatePaintProperty(options) {\n    return validateProperty(options, 'paint');\n}\n\nfunction validateLayoutProperty(options) {\n    return validateProperty(options, 'layout');\n}\n\nfunction validateLayer(options) {\n    let errors = [];\n    const layer = options.value;\n    const key = options.key;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    if (getType(layer) !== 'object') {\n        return [new ValidationError(key, layer, `object expected, ${getType(layer)} found`)];\n    }\n    if (!layer.type && !layer.ref) {\n        errors.push(new ValidationError(key, layer, 'either \"type\" or \"ref\" is required'));\n    }\n    let type = unbundle(layer.type);\n    const ref = unbundle(layer.ref);\n    if (layer.id) {\n        const layerId = unbundle(layer.id);\n        for (let i = 0; i < options.arrayIndex; i++) {\n            const otherLayer = style.layers[i];\n            if (unbundle(otherLayer.id) === layerId) {\n                errors.push(new ValidationError(key, layer.id, `duplicate layer id \"${layer.id}\", previously used at line ${otherLayer.id.__line__}`));\n            }\n        }\n    }\n    if ('ref' in layer) {\n        ['type', 'source', 'source-layer', 'filter', 'layout'].forEach((p) => {\n            if (p in layer) {\n                errors.push(new ValidationError(key, layer[p], `\"${p}\" is prohibited for ref layers`));\n            }\n        });\n        let parent;\n        style.layers.forEach((layer) => {\n            if (unbundle(layer.id) === ref)\n                parent = layer;\n        });\n        if (!parent) {\n            errors.push(new ValidationError(key, layer.ref, `ref layer \"${ref}\" not found`));\n        }\n        else if (parent.ref) {\n            errors.push(new ValidationError(key, layer.ref, 'ref cannot reference another ref layer'));\n        }\n        else {\n            type = unbundle(parent.type);\n        }\n    }\n    else if (type !== 'background') {\n        if (!layer.source) {\n            errors.push(new ValidationError(key, layer, 'missing required property \"source\"'));\n        }\n        else {\n            const source = style.sources && style.sources[layer.source];\n            const sourceType = source && unbundle(source.type);\n            if (!source) {\n                errors.push(new ValidationError(key, layer.source, `source \"${layer.source}\" not found`));\n            }\n            else if (sourceType === 'vector' && type === 'raster') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster source`));\n            }\n            else if (sourceType !== 'raster-dem' && type === 'hillshade') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster-dem source`));\n            }\n            else if (sourceType !== 'raster-dem' && type === 'color-relief') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster-dem source`));\n            }\n            else if (sourceType === 'raster' && type !== 'raster') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a vector source`));\n            }\n            else if (sourceType === 'vector' && !layer['source-layer']) {\n                errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" must specify a \"source-layer\"`));\n            }\n            else if (sourceType === 'raster-dem' &&\n                type !== 'hillshade' &&\n                type !== 'color-relief') {\n                errors.push(new ValidationError(key, layer.source, \"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.\"));\n            }\n            else if (type === 'line' &&\n                layer.paint &&\n                layer.paint['line-gradient'] &&\n                (sourceType !== 'geojson' || !source.lineMetrics)) {\n                errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`));\n            }\n        }\n    }\n    errors = errors.concat(validateObject({\n        key,\n        value: layer,\n        valueSpec: styleSpec.layer,\n        style: options.style,\n        styleSpec: options.styleSpec,\n        validateSpec: options.validateSpec,\n        objectElementValidators: {\n            '*'() {\n                return [];\n            },\n            // We don't want to enforce the spec's `\"requires\": true` for backward compatibility with refs;\n            // the actual requirement is validated above. See https://github.com/mapbox/mapbox-gl-js/issues/5772.\n            type() {\n                return options.validateSpec({\n                    key: `${key}.type`,\n                    value: layer.type,\n                    valueSpec: styleSpec.layer.type,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    object: layer,\n                    objectKey: 'type'\n                });\n            },\n            filter: validateFilter,\n            layout(options) {\n                return validateObject({\n                    layer,\n                    key: options.key,\n                    value: options.value,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    objectElementValidators: {\n                        '*'(options) {\n                            return validateLayoutProperty(extendBy({ layerType: type }, options));\n                        }\n                    }\n                });\n            },\n            paint(options) {\n                return validateObject({\n                    layer,\n                    key: options.key,\n                    value: options.value,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    objectElementValidators: {\n                        '*'(options) {\n                            return validatePaintProperty(extendBy({ layerType: type }, options));\n                        }\n                    }\n                });\n            }\n        }\n    }));\n    return errors;\n}\n\nfunction validateString(options) {\n    const value = options.value;\n    const key = options.key;\n    const type = getType(value);\n    if (type !== 'string') {\n        return [new ValidationError(key, value, `string expected, ${type} found`)];\n    }\n    return [];\n}\n\nfunction validateRasterDEMSource(options) {\n    var _a;\n    const sourceName = (_a = options.sourceName) !== null && _a !== void 0 ? _a : '';\n    const rasterDEM = options.value;\n    const styleSpec = options.styleSpec;\n    const rasterDEMSpec = styleSpec.source_raster_dem;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(rasterDEM);\n    if (rasterDEM === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors.push(new ValidationError('source_raster_dem', rasterDEM, `object expected, ${rootType} found`));\n        return errors;\n    }\n    const encoding = unbundle(rasterDEM.encoding);\n    const isCustomEncoding = encoding === 'custom';\n    const customEncodingKeys = ['redFactor', 'greenFactor', 'blueFactor', 'baseShift'];\n    const encodingName = options.value.encoding ? `\"${options.value.encoding}\"` : 'Default';\n    for (const key in rasterDEM) {\n        if (!isCustomEncoding && customEncodingKeys.includes(key)) {\n            errors.push(new ValidationError(key, rasterDEM[key], `In \"${sourceName}\": \"${key}\" is only valid when \"encoding\" is set to \"custom\". ${encodingName} encoding found`));\n        }\n        else if (rasterDEMSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: rasterDEM[key],\n                valueSpec: rasterDEMSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors.push(new ValidationError(key, rasterDEM[key], `unknown property \"${key}\"`));\n        }\n    }\n    return errors;\n}\n\nconst objectElementValidators = {\n    promoteId: validatePromoteId\n};\nfunction validateSource(options) {\n    const value = options.value;\n    const key = options.key;\n    const styleSpec = options.styleSpec;\n    const style = options.style;\n    const validateSpec = options.validateSpec;\n    if (!value.type) {\n        return [new ValidationError(key, value, '\"type\" is required')];\n    }\n    const type = unbundle(value.type);\n    let errors;\n    switch (type) {\n        case 'vector':\n        case 'raster':\n            errors = validateObject({\n                key,\n                value,\n                valueSpec: styleSpec[`source_${type.replace('-', '_')}`],\n                style: options.style,\n                styleSpec,\n                objectElementValidators,\n                validateSpec\n            });\n            return errors;\n        case 'raster-dem':\n            errors = validateRasterDEMSource({\n                sourceName: key,\n                value,\n                style: options.style,\n                styleSpec,\n                validateSpec\n            });\n            return errors;\n        case 'geojson':\n            errors = validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_geojson,\n                style,\n                styleSpec,\n                validateSpec,\n                objectElementValidators\n            });\n            if (value.cluster) {\n                for (const prop in value.clusterProperties) {\n                    const [operator, mapExpr] = value.clusterProperties[prop];\n                    const reduceExpr = typeof operator === 'string'\n                        ? [operator, ['accumulated'], ['get', prop]]\n                        : operator;\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.map`,\n                        value: mapExpr,\n                        expressionContext: 'cluster-map'\n                    }));\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.reduce`,\n                        value: reduceExpr,\n                        expressionContext: 'cluster-reduce'\n                    }));\n                }\n            }\n            return errors;\n        case 'video':\n            return validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_video,\n                style,\n                validateSpec,\n                styleSpec\n            });\n        case 'image':\n            return validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_image,\n                style,\n                validateSpec,\n                styleSpec\n            });\n        case 'canvas':\n            return [\n                new ValidationError(key, null, 'Please use runtime APIs to add canvas sources, rather than including them in stylesheets.', 'source.canvas')\n            ];\n        default:\n            return validateEnum({\n                key: `${key}.type`,\n                value: value.type,\n                valueSpec: {\n                    values: ['vector', 'raster', 'raster-dem', 'geojson', 'video', 'image']\n                }});\n    }\n}\nfunction validatePromoteId({ key, value }) {\n    if (getType(value) === 'string') {\n        return validateString({ key, value });\n    }\n    else {\n        const errors = [];\n        for (const prop in value) {\n            errors.push(...validateString({ key: `${key}.${prop}`, value: value[prop] }));\n        }\n        return errors;\n    }\n}\n\nfunction validateLight(options) {\n    const light = options.value;\n    const styleSpec = options.styleSpec;\n    const lightSpec = styleSpec.light;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(light);\n    if (light === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors = errors.concat([\n            new ValidationError('light', light, `object expected, ${rootType} found`)\n        ]);\n        return errors;\n    }\n    for (const key in light) {\n        const transitionMatch = key.match(/^(.*)-transition$/);\n        if (transitionMatch &&\n            lightSpec[transitionMatch[1]] &&\n            lightSpec[transitionMatch[1]].transition) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: light[key],\n                valueSpec: styleSpec.transition,\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else if (lightSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: light[key],\n                valueSpec: lightSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([\n                new ValidationError(key, light[key], `unknown property \"${key}\"`)\n            ]);\n        }\n    }\n    return errors;\n}\n\nfunction validateSky(options) {\n    const sky = options.value;\n    const styleSpec = options.styleSpec;\n    const skySpec = styleSpec.sky;\n    const style = options.style;\n    const rootType = getType(sky);\n    if (sky === undefined) {\n        return [];\n    }\n    else if (rootType !== 'object') {\n        return [new ValidationError('sky', sky, `object expected, ${rootType} found`)];\n    }\n    let errors = [];\n    for (const key in sky) {\n        if (skySpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: sky[key],\n                valueSpec: skySpec[key],\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([\n                new ValidationError(key, sky[key], `unknown property \"${key}\"`)\n            ]);\n        }\n    }\n    return errors;\n}\n\nfunction validateTerrain(options) {\n    const terrain = options.value;\n    const styleSpec = options.styleSpec;\n    const terrainSpec = styleSpec.terrain;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(terrain);\n    if (terrain === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors = errors.concat([\n            new ValidationError('terrain', terrain, `object expected, ${rootType} found`)\n        ]);\n        return errors;\n    }\n    for (const key in terrain) {\n        if (terrainSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: terrain[key],\n                valueSpec: terrainSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([\n                new ValidationError(key, terrain[key], `unknown property \"${key}\"`)\n            ]);\n        }\n    }\n    return errors;\n}\n\nfunction validateFormatted(options) {\n    if (validateString(options).length === 0) {\n        return [];\n    }\n    return validateExpression(options);\n}\n\nfunction validateImage(options) {\n    if (validateString(options).length === 0) {\n        return [];\n    }\n    return validateExpression(options);\n}\n\nfunction validatePadding(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type === 'array') {\n        if (value.length < 1 || value.length > 4) {\n            return [\n                new ValidationError(key, value, `padding requires 1 to 4 values; ${value.length} values found`)\n            ];\n        }\n        const arrayElementSpec = {\n            type: 'number'\n        };\n        let errors = [];\n        for (let i = 0; i < value.length; i++) {\n            errors = errors.concat(options.validateSpec({\n                key: `${key}[${i}]`,\n                value: value[i],\n                validateSpec: options.validateSpec,\n                valueSpec: arrayElementSpec\n            }));\n        }\n        return errors;\n    }\n    else {\n        return validateNumber({\n            key,\n            value,\n            valueSpec: {}\n        });\n    }\n}\n\nfunction validateNumberArray(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type === 'array') {\n        const arrayElementSpec = {\n            type: 'number'\n        };\n        if (value.length < 1) {\n            return [\n                new ValidationError(key, value, 'array length at least 1 expected, length 0 found')\n            ];\n        }\n        let errors = [];\n        for (let i = 0; i < value.length; i++) {\n            errors = errors.concat(options.validateSpec({\n                key: `${key}[${i}]`,\n                value: value[i],\n                validateSpec: options.validateSpec,\n                valueSpec: arrayElementSpec\n            }));\n        }\n        return errors;\n    }\n    else {\n        return validateNumber({\n            key,\n            value,\n            valueSpec: {}\n        });\n    }\n}\n\nfunction validateColorArray(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type === 'array') {\n        if (value.length < 1) {\n            return [\n                new ValidationError(key, value, 'array length at least 1 expected, length 0 found')\n            ];\n        }\n        let errors = [];\n        for (let i = 0; i < value.length; i++) {\n            errors = errors.concat(validateColor({\n                key: `${key}[${i}]`,\n                value: value[i]}));\n        }\n        return errors;\n    }\n    else {\n        return validateColor({\n            key,\n            value});\n    }\n}\n\nfunction validateVariableAnchorOffsetCollection(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    const styleSpec = options.styleSpec;\n    if (type !== 'array' || value.length < 1 || value.length % 2 !== 0) {\n        return [\n            new ValidationError(key, value, 'variableAnchorOffsetCollection requires a non-empty array of even length')\n        ];\n    }\n    let errors = [];\n    for (let i = 0; i < value.length; i += 2) {\n        // Elements in even positions should be values from text-anchor enum\n        errors = errors.concat(validateEnum({\n            key: `${key}[${i}]`,\n            value: value[i],\n            valueSpec: styleSpec['layout_symbol']['text-anchor']\n        }));\n        // Elements in odd positions should be points (2-element numeric arrays)\n        errors = errors.concat(validateArray({\n            key: `${key}[${i + 1}]`,\n            value: value[i + 1],\n            valueSpec: {\n                length: 2,\n                value: 'number'\n            },\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec\n        }));\n    }\n    return errors;\n}\n\nfunction validateSprite(options) {\n    let errors = [];\n    const sprite = options.value;\n    const key = options.key;\n    if (!Array.isArray(sprite)) {\n        return validateString({\n            key,\n            value: sprite\n        });\n    }\n    else {\n        const allSpriteIds = [];\n        const allSpriteURLs = [];\n        for (const i in sprite) {\n            if (sprite[i].id && allSpriteIds.includes(sprite[i].id))\n                errors.push(new ValidationError(key, sprite, `all the sprites' ids must be unique, but ${sprite[i].id} is duplicated`));\n            allSpriteIds.push(sprite[i].id);\n            if (sprite[i].url && allSpriteURLs.includes(sprite[i].url))\n                errors.push(new ValidationError(key, sprite, `all the sprites' URLs must be unique, but ${sprite[i].url} is duplicated`));\n            allSpriteURLs.push(sprite[i].url);\n            const pairSpec = {\n                id: {\n                    type: 'string',\n                    required: true\n                },\n                url: {\n                    type: 'string',\n                    required: true\n                }\n            };\n            errors = errors.concat(validateObject({\n                key: `${key}[${i}]`,\n                value: sprite[i],\n                valueSpec: pairSpec,\n                validateSpec: options.validateSpec\n            }));\n        }\n        return errors;\n    }\n}\n\nfunction validateProjection(options) {\n    const projection = options.value;\n    const styleSpec = options.styleSpec;\n    const projectionSpec = styleSpec.projection;\n    const style = options.style;\n    const rootType = getType(projection);\n    if (projection === undefined) {\n        return [];\n    }\n    else if (rootType !== 'object') {\n        return [\n            new ValidationError('projection', projection, `object expected, ${rootType} found`)\n        ];\n    }\n    let errors = [];\n    for (const key in projection) {\n        if (projectionSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: projection[key],\n                valueSpec: projectionSpec[key],\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([\n                new ValidationError(key, projection[key], `unknown property \"${key}\"`)\n            ]);\n        }\n    }\n    return errors;\n}\n\nfunction validateProjectionDefinition(options) {\n    const key = options.key;\n    let value = options.value;\n    value = value instanceof String ? value.valueOf() : value;\n    const type = getType(value);\n    if (type === 'array' &&\n        !isProjectionDefinitionValue(value) &&\n        !isPropertyValueSpecification(value)) {\n        return [\n            new ValidationError(key, value, `projection expected, invalid array ${JSON.stringify(value)} found`)\n        ];\n    }\n    else if (!['array', 'string'].includes(type)) {\n        return [\n            new ValidationError(key, value, `projection expected, invalid type \"${type}\" found`)\n        ];\n    }\n    return [];\n}\nfunction isPropertyValueSpecification(value) {\n    if (['interpolate', 'step', 'literal'].includes(value[0])) {\n        return true;\n    }\n    return false;\n}\nfunction isProjectionDefinitionValue(value) {\n    return (Array.isArray(value) &&\n        value.length === 3 &&\n        typeof value[0] === 'string' &&\n        typeof value[1] === 'string' &&\n        typeof value[2] === 'number');\n}\n\nfunction isObjectLiteral(anything) {\n    return Boolean(anything) && anything.constructor === Object;\n}\n\nfunction validateState(options) {\n    if (!isObjectLiteral(options.value)) {\n        return [\n            new ValidationError(options.key, options.value, `object expected, ${getType(options.value)} found`)\n        ];\n    }\n    return [];\n}\n\nfunction validateFontFaces(options) {\n    const key = options.key;\n    const value = options.value;\n    const validateSpec = options.validateSpec;\n    const styleSpec = options.styleSpec;\n    const style = options.style;\n    if (!isObjectLiteral(value)) {\n        return [new ValidationError(key, value, `object expected, ${getType(value)} found`)];\n    }\n    const errors = [];\n    for (const fontName in value) {\n        const fontValue = value[fontName];\n        const fontValueType = getType(fontValue);\n        if (fontValueType === 'string') {\n            // Validate as a string URL\n            errors.push(...validateString({\n                key: `${key}.${fontName}`,\n                value: fontValue\n            }));\n        }\n        else if (fontValueType === 'array') {\n            // Validate as an array of font face objects\n            const fontFaceSpec = {\n                url: {\n                    type: 'string',\n                    required: true\n                },\n                'unicode-range': {\n                    type: 'array',\n                    value: 'string'\n                }\n            };\n            for (const [i, fontFace] of fontValue.entries()) {\n                errors.push(...validateObject({\n                    key: `${key}.${fontName}[${i}]`,\n                    value: fontFace,\n                    valueSpec: fontFaceSpec,\n                    styleSpec,\n                    style,\n                    validateSpec\n                }));\n            }\n        }\n        else {\n            errors.push(new ValidationError(`${key}.${fontName}`, fontValue, `string or array expected, ${fontValueType} found`));\n        }\n    }\n    return errors;\n}\n\nconst VALIDATORS = {\n    '*'() {\n        return [];\n    },\n    array: validateArray,\n    boolean: validateBoolean,\n    number: validateNumber,\n    color: validateColor,\n    constants: validateConstants,\n    enum: validateEnum,\n    filter: validateFilter,\n    function: validateFunction,\n    layer: validateLayer,\n    object: validateObject,\n    source: validateSource,\n    light: validateLight,\n    sky: validateSky,\n    terrain: validateTerrain,\n    projection: validateProjection,\n    projectionDefinition: validateProjectionDefinition,\n    string: validateString,\n    formatted: validateFormatted,\n    resolvedImage: validateImage,\n    padding: validatePadding,\n    numberArray: validateNumberArray,\n    colorArray: validateColorArray,\n    variableAnchorOffsetCollection: validateVariableAnchorOffsetCollection,\n    sprite: validateSprite,\n    state: validateState,\n    fontFaces: validateFontFaces\n};\n/**\n * Main recursive validation function used internally.\n * You should use `validateStyleMin` in the browser or `validateStyle` in node env.\n * @param options - the options object\n * @param options.key - string representing location of validation in style tree. Used only\n * for more informative error reporting.\n * @param options.value - current value from style being evaluated. May be anything from a\n * high level object that needs to be descended into deeper or a simple\n * scalar value.\n * @param options.valueSpec - current spec being evaluated. Tracks value.\n * @param options.styleSpec - current full spec being evaluated.\n * @param options.validateSpec - the validate function itself\n * @param options.style - the style object\n * @param options.objectElementValidators - optional object of functions that will be called\n * @returns an array of errors, or an empty array if no errors are found.\n */\nfunction validate(options) {\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    const styleSpec = options.styleSpec;\n    options.validateSpec = validate;\n    if (valueSpec.expression && isFunction$1(unbundle(value))) {\n        return validateFunction(options);\n    }\n    else if (valueSpec.expression && isExpression(deepUnbundle(value))) {\n        return validateExpression(options);\n    }\n    else if (valueSpec.type && VALIDATORS[valueSpec.type]) {\n        return VALIDATORS[valueSpec.type](options);\n    }\n    else {\n        const valid = validateObject(extendBy({}, options, {\n            valueSpec: valueSpec.type ? styleSpec[valueSpec.type] : valueSpec\n        }));\n        return valid;\n    }\n}\n\nfunction validateGlyphsUrl(options) {\n    const value = options.value;\n    const key = options.key;\n    const errors = validateString(options);\n    if (errors.length)\n        return errors;\n    if (value.indexOf('{fontstack}') === -1) {\n        errors.push(new ValidationError(key, value, '\"glyphs\" url must include a \"{fontstack}\" token'));\n    }\n    if (value.indexOf('{range}') === -1) {\n        errors.push(new ValidationError(key, value, '\"glyphs\" url must include a \"{range}\" token'));\n    }\n    return errors;\n}\n\n/**\n * Validate a MapLibre style against the style specification.\n * Use this when running in the browser.\n *\n * @param style - The style to be validated.\n * @param styleSpec - The style specification to validate against.\n * If omitted, the latest style spec is used.\n * @returns an array of errors, or an empty array if no errors are found.\n * @example\n *   const validate = require('@maplibre/maplibre-gl-style-spec/').validateStyleMin;\n *   const errors = validate(style);\n */\nfunction validateStyleMin(style, styleSpec = v8Spec) {\n    let errors = [];\n    errors = errors.concat(validate({\n        key: '',\n        value: style,\n        valueSpec: styleSpec.$root,\n        styleSpec,\n        style,\n        validateSpec: validate,\n        objectElementValidators: {\n            glyphs: validateGlyphsUrl,\n            '*'() {\n                return [];\n            }\n        }\n    }));\n    if (style['constants']) {\n        errors = errors.concat(validateConstants({\n            key: 'constants',\n            value: style['constants']}));\n    }\n    return sortErrors(errors);\n}\nvalidateStyleMin.source = wrapCleanErrors(injectValidateSpec(validateSource));\nvalidateStyleMin.sprite = wrapCleanErrors(injectValidateSpec(validateSprite));\nvalidateStyleMin.glyphs = wrapCleanErrors(injectValidateSpec(validateGlyphsUrl));\nvalidateStyleMin.light = wrapCleanErrors(injectValidateSpec(validateLight));\nvalidateStyleMin.sky = wrapCleanErrors(injectValidateSpec(validateSky));\nvalidateStyleMin.terrain = wrapCleanErrors(injectValidateSpec(validateTerrain));\nvalidateStyleMin.state = wrapCleanErrors(injectValidateSpec(validateState));\nvalidateStyleMin.layer = wrapCleanErrors(injectValidateSpec(validateLayer));\nvalidateStyleMin.filter = wrapCleanErrors(injectValidateSpec(validateFilter));\nvalidateStyleMin.paintProperty = wrapCleanErrors(injectValidateSpec(validatePaintProperty));\nvalidateStyleMin.layoutProperty = wrapCleanErrors(injectValidateSpec(validateLayoutProperty));\nfunction injectValidateSpec(validator) {\n    return function (options) {\n        return validator(Object.assign({}, options, { validateSpec: validate }));\n    };\n}\nfunction sortErrors(errors) {\n    return [].concat(errors).sort((a, b) => {\n        return a.line - b.line;\n    });\n}\nfunction wrapCleanErrors(inner) {\n    return function (...args) {\n        return sortErrors(inner.apply(this, args));\n    };\n}\n\n// Note: This regex matches even invalid JSON strings, but since we’re\n// working on the output of `JSON.stringify` we know that only valid strings\n// are present (unless the user supplied a weird `options.indent` but in\n// that case we don’t care since the output would be invalid anyway).\nconst stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n\nfunction stringify(passedObj, options = {}) {\n  const indent = JSON.stringify(\n    [1],\n    undefined,\n    options.indent === undefined ? 2 : options.indent\n  ).slice(2, -3);\n\n  const maxLength =\n    indent === \"\"\n      ? Infinity\n      : options.maxLength === undefined\n      ? 80\n      : options.maxLength;\n\n  let { replacer } = options;\n\n  return (function _stringify(obj, currentIndent, reserved) {\n    if (obj && typeof obj.toJSON === \"function\") {\n      obj = obj.toJSON();\n    }\n\n    const string = JSON.stringify(obj, replacer);\n\n    if (string === undefined) {\n      return string;\n    }\n\n    const length = maxLength - currentIndent.length - reserved;\n\n    if (string.length <= length) {\n      const prettified = string.replace(\n        stringOrChar,\n        (match, stringLiteral) => {\n          return stringLiteral || `${match} `;\n        }\n      );\n      if (prettified.length <= length) {\n        return prettified;\n      }\n    }\n\n    if (replacer != null) {\n      obj = JSON.parse(string);\n      replacer = undefined;\n    }\n\n    if (typeof obj === \"object\" && obj !== null) {\n      const nextIndent = currentIndent + indent;\n      const items = [];\n      let index = 0;\n      let start;\n      let end;\n\n      if (Array.isArray(obj)) {\n        start = \"[\";\n        end = \"]\";\n        const { length } = obj;\n        for (; index < length; index++) {\n          items.push(\n            _stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) ||\n              \"null\"\n          );\n        }\n      } else {\n        start = \"{\";\n        end = \"}\";\n        const keys = Object.keys(obj);\n        const { length } = keys;\n        for (; index < length; index++) {\n          const key = keys[index];\n          const keyPart = `${JSON.stringify(key)}: `;\n          const value = _stringify(\n            obj[key],\n            nextIndent,\n            keyPart.length + (index === length - 1 ? 0 : 1)\n          );\n          if (value !== undefined) {\n            items.push(keyPart + value);\n          }\n        }\n      }\n\n      if (items.length > 0) {\n        return [start, indent + items.join(`,\\n${nextIndent}`), end].join(\n          `\\n${currentIndent}`\n        );\n      }\n    }\n\n    return string;\n  })(passedObj, \"\", 0);\n}\n\nfunction sortKeysBy(obj, reference) {\n    const result = {};\n    for (const key in reference) {\n        if (obj[key] !== undefined) {\n            result[key] = obj[key];\n        }\n    }\n    for (const key in obj) {\n        if (result[key] === undefined) {\n            result[key] = obj[key];\n        }\n    }\n    return result;\n}\n/**\n * Format a MapLibre Style.  Returns a stringified style with its keys\n * sorted in the same order as the reference style.\n *\n * The optional `space` argument is passed to\n * [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)\n * to generate formatted output.\n *\n * If `space` is unspecified, a default of `2` spaces will be used.\n *\n * @private\n * @param {Object} style a MapLibre Style\n * @param {number} [space] space argument to pass to `JSON.stringify`\n * @returns {string} stringified formatted JSON\n * @example\n * var fs = require('fs');\n * var format = require('maplibre-gl-style-spec').format;\n * var style = fs.readFileSync('./source.json', 'utf8');\n * fs.writeFileSync('./dest.json', format(style));\n * fs.writeFileSync('./dest.min.json', format(style, 0));\n */\nfunction format(style, space = 2) {\n    style = sortKeysBy(style, v8Spec.$root);\n    if (style.layers) {\n        style.layers = style.layers.map((layer) => sortKeysBy(layer, v8Spec.layer));\n    }\n    return stringify(style, { indent: space });\n}\n\nfunction eachLayout(layer, callback) {\n    for (const k in layer) {\n        if (k.indexOf('layout') === 0) {\n            callback(layer[k], k);\n        }\n    }\n}\nfunction eachPaint(layer, callback) {\n    for (const k in layer) {\n        if (k.indexOf('paint') === 0) {\n            callback(layer[k], k);\n        }\n    }\n}\nfunction resolveConstant(style, value) {\n    if (typeof value === 'string' && value[0] === '@') {\n        return resolveConstant(style, style.constants[value]);\n    }\n    else {\n        return value;\n    }\n}\nfunction isFunction(value) {\n    return Array.isArray(value.stops);\n}\nfunction renameProperty(obj, from, to) {\n    obj[to] = obj[from];\n    delete obj[from];\n}\nfunction migrateV8(style) {\n    style.version = 8;\n    // Rename properties, reverse coordinates in source and layers\n    eachSource(style, (source) => {\n        if (source.type === 'video' && source['url'] !== undefined) {\n            renameProperty(source, 'url', 'urls');\n        }\n        if (source.type === 'video') {\n            source.coordinates.forEach((coord) => {\n                return coord.reverse();\n            });\n        }\n    });\n    eachLayer(style, (layer) => {\n        eachLayout(layer, (layout) => {\n            if (layout['symbol-min-distance'] !== undefined) {\n                renameProperty(layout, 'symbol-min-distance', 'symbol-spacing');\n            }\n        });\n        eachPaint(layer, (paint) => {\n            if (paint['background-image'] !== undefined) {\n                renameProperty(paint, 'background-image', 'background-pattern');\n            }\n            if (paint['line-image'] !== undefined) {\n                renameProperty(paint, 'line-image', 'line-pattern');\n            }\n            if (paint['fill-image'] !== undefined) {\n                renameProperty(paint, 'fill-image', 'fill-pattern');\n            }\n        });\n    });\n    // Inline Constants\n    eachProperty(style, { paint: true, layout: true }, (property) => {\n        const value = resolveConstant(style, property.value);\n        if (isFunction(value)) {\n            value.stops.forEach((stop) => {\n                stop[1] = resolveConstant(style, stop[1]);\n            });\n        }\n        property.set(value);\n    });\n    delete style['constants'];\n    eachLayer(style, (layer) => {\n        // get rid of text-max-size, icon-max-size\n        // turn text-size, icon-size into layout properties\n        // https://github.com/mapbox/mapbox-gl-style-spec/issues/255\n        eachLayout(layer, (layout) => {\n            delete layout['text-max-size'];\n            delete layout['icon-max-size'];\n        });\n        eachPaint(layer, (paint) => {\n            if (paint['text-size']) {\n                if (!layer.layout)\n                    layer.layout = {};\n                layer.layout['text-size'] = paint['text-size'];\n                delete paint['text-size'];\n            }\n            if (paint['icon-size']) {\n                if (!layer.layout)\n                    layer.layout = {};\n                layer.layout['icon-size'] = paint['icon-size'];\n                delete paint['icon-size'];\n            }\n        });\n    });\n    function migrateFontStack(font) {\n        function splitAndTrim(string) {\n            return string.split(',').map((s) => {\n                return s.trim();\n            });\n        }\n        if (Array.isArray(font)) {\n            // Assume it's a previously migrated font-array.\n            return font;\n        }\n        else if (typeof font === 'string') {\n            return splitAndTrim(font);\n        }\n        else if (typeof font === 'object') {\n            font.stops.forEach((stop) => {\n                stop[1] = splitAndTrim(stop[1]);\n            });\n            return font;\n        }\n        else {\n            throw new Error('unexpected font value');\n        }\n    }\n    eachLayer(style, (layer) => {\n        eachLayout(layer, (layout) => {\n            if (layout['text-font']) {\n                layout['text-font'] = migrateFontStack(layout['text-font']);\n            }\n        });\n    });\n    // Reverse order of symbol layers. This is an imperfect migration.\n    //\n    // The order of a symbol layer in the layers list affects two things:\n    // - how it is drawn relative to other layers (like oneway arrows below bridges)\n    // - the placement priority compared to other layers\n    //\n    // It's impossible to reverse the placement priority without breaking the draw order\n    // in some cases. This migration only reverses the order of symbol layers that\n    // are above all other types of layers.\n    //\n    // Symbol layers that are at the top of the map preserve their priority.\n    // Symbol layers that are below another type (line, fill) of layer preserve their draw order.\n    let firstSymbolLayer = 0;\n    for (let i = style.layers.length - 1; i >= 0; i--) {\n        const layer = style.layers[i];\n        if (layer.type !== 'symbol') {\n            firstSymbolLayer = i + 1;\n            break;\n        }\n    }\n    const symbolLayers = style.layers.splice(firstSymbolLayer);\n    symbolLayers.reverse();\n    style.layers = style.layers.concat(symbolLayers);\n    return style;\n}\n\n/**\n * Migrate the given style object in place to use expressions. Specifically,\n * this will convert (a) \"stop\" functions, and (b) legacy filters to their\n * expression equivalents.\n * @param style The style object to migrate.\n * @returns The migrated style object.\n */\nfunction expressions(style) {\n    const converted = [];\n    eachLayer(style, (layer) => {\n        if (layer.filter) {\n            layer.filter = convertFilter(layer.filter);\n        }\n    });\n    eachProperty(style, { paint: true, layout: true }, ({ path, key, value, reference, set }) => {\n        if (isExpression(value) || key.endsWith('-transition') || reference === null)\n            return;\n        if (typeof value === 'object' && !Array.isArray(value)) {\n            set(convertFunction(value, reference));\n            converted.push(path.join('.'));\n        }\n        else if (reference.tokens && typeof value === 'string') {\n            set(convertTokenString(value));\n        }\n    });\n    return style;\n}\n\n/**\n * Migrate color style values to supported format.\n *\n * @param colorToMigrate Color value to migrate, could be a string or an expression.\n * @returns Color style value in supported format.\n */\nfunction migrateColors(colorToMigrate) {\n    return JSON.parse(migrateHslColors(JSON.stringify(colorToMigrate)));\n}\n/**\n * Created to migrate from colors supported by the former CSS color parsing\n * library `csscolorparser` but not compliant with the CSS Color specification,\n * like `hsl(900, 0.15, 90%)`.\n *\n * @param colorToMigrate Serialized color style value.\n * @returns A serialized color style value in which all non-standard hsl color values\n * have been converted to a format that complies with the CSS Color specification.\n *\n * @example\n * migrateHslColors('\"hsl(900, 0.15, 90%)\"'); // returns '\"hsl(900, 15%, 90%)\"'\n * migrateHslColors('\"hsla(900, .15, .9)\"'); // returns '\"hsl(900, 15%, 90%)\"'\n * migrateHslColors('\"hsl(900, 15%, 90%)\"'); // returns '\"hsl(900, 15%, 90%)\"' - no changes\n */\nfunction migrateHslColors(colorToMigrate) {\n    return colorToMigrate.replace(/\"hsla?\\((.+?)\\)\"/gi, (match, hslArgs) => {\n        const argsMatch = hslArgs.match(/^(.+?)\\s*,\\s*(.+?)\\s*,\\s*(.+?)(?:\\s*,\\s*(.+))?$/i);\n        if (argsMatch) {\n            let [h, s, l, a] = argsMatch.slice(1);\n            [s, l] = [s, l].map((v) => (v.endsWith('%') ? v : `${parseFloat(v) * 100}%`));\n            return `\"hsl${typeof a === 'string' ? 'a' : ''}(${[h, s, l, a].filter(Boolean).join(',')})\"`;\n        }\n        return match;\n    });\n}\n\n/**\n * Migrate a Mapbox/MapLibre GL Style to the latest version.\n *\n * @param style - a MapLibre Style\n * @returns a migrated style\n * @example\n * const fs = require('fs');\n * const migrate = require('@maplibre/maplibre-gl-style-spec').migrate;\n * const style = fs.readFileSync('./style.json', 'utf8');\n * fs.writeFileSync('./style.json', JSON.stringify(migrate(style)));\n */\nfunction migrate(style) {\n    let migrated = false;\n    if (style.version === 7) {\n        style = migrateV8(style);\n        migrated = true;\n    }\n    if (style.version === 8) {\n        migrated = !!expressions(style);\n        migrated = true;\n    }\n    eachProperty(style, { paint: true, layout: true }, ({ value, reference, set }) => {\n        if ((reference === null || reference === void 0 ? void 0 : reference.type) === 'color') {\n            set(migrateColors(value));\n        }\n    });\n    if (!migrated) {\n        throw new Error(`Cannot migrate from ${style.version}`);\n    }\n    return style;\n}\n\nconst visibilitySpec = {\n    type: 'enum',\n    'property-type': 'data-constant',\n    expression: {\n        interpolated: false,\n        parameters: ['global-state']\n    },\n    values: { visible: {}, none: {} },\n    transition: false,\n    default: 'visible'\n};\nclass VisibilityExpressionClass {\n    constructor(visibility, globalState) {\n        this._globalState = globalState;\n        this.setValue(visibility);\n    }\n    evaluate() {\n        var _a;\n        return (_a = this._literalValue) !== null && _a !== void 0 ? _a : this._compiledValue.evaluate({});\n    }\n    setValue(visibility) {\n        if (visibility === null ||\n            visibility === undefined ||\n            visibility === 'visible' ||\n            visibility === 'none') {\n            this._literalValue = visibility === 'none' ? 'none' : 'visible';\n            this._compiledValue = undefined;\n            this._globalStateRefs = new Set();\n            return;\n        }\n        const compiled = createExpression(visibility, visibilitySpec, this._globalState);\n        if (compiled.result === 'error') {\n            this._literalValue = 'visible';\n            this._compiledValue = undefined;\n            throw new Error(compiled.value.map((err) => `${err.key}: ${err.message}`).join(', '));\n        }\n        this._literalValue = undefined;\n        this._compiledValue = compiled.value;\n        this._globalStateRefs = findGlobalStateRefs(compiled.value.expression);\n    }\n    getGlobalStateRefs() {\n        return this._globalStateRefs;\n    }\n}\n/**\n * Creates a visibility expression from a visibility specification.\n * @param visibility - the visibility specification, literal or expression\n * @param globalState - the global state object\n * @returns visibility expression object\n */\nfunction createVisibility(visibility, globalState) {\n    return new VisibilityExpressionClass(visibility, globalState);\n}\n\nconst v8 = v8Spec;\nconst expression = {\n    StyleExpression,\n    StylePropertyFunction,\n    ZoomConstantExpression,\n    ZoomDependentExpression,\n    createExpression,\n    createPropertyExpression,\n    isExpression,\n    isExpressionFilter,\n    isZoomExpression,\n    normalizePropertyExpression\n};\nconst styleFunction = {\n    convertFunction,\n    createFunction,\n    isFunction: isFunction$1\n};\nconst visit = { eachLayer, eachProperty, eachSource };\n\nexport { Color, ColorArray, ColorType, CompoundExpression, EvaluationContext, FormatExpression, Formatted, FormattedSection, FormattedType, Interpolate, Literal, NullType, NumberArray, Padding, ParsingError, ProjectionDefinition, ProjectionDefinitionType, ResolvedImage, Step, StyleExpression, StylePropertyFunction, ValidationError, VariableAnchorOffsetCollection, ZoomConstantExpression, ZoomDependentExpression, classifyRings, convertFilter, convertFunction, createExpression, createFunction, createPropertyExpression, createVisibility as createVisibilityExpression, derefLayers, diff, emptyStyle, expression, expressions$1 as expressions, featureFilter, format, styleFunction as function, groupByLayout, interpolateFactory as interpolates, isExpression, isFunction$1 as isFunction, isZoomExpression, v8Spec as latest, migrate, normalizePropertyExpression, supportsPropertyExpression, typeToString as toString, typeOf, v8, validate, validateStyleMin, visit };\n//# sourceMappingURL=index.mjs.map\n","/**\n * An error message to use when an operation is aborted\n */\nexport const ABORT_ERROR = 'AbortError';\n\nexport class AbortError extends Error {\n    name = ABORT_ERROR;\n\n    constructor(messageOrError: string | Error = ABORT_ERROR) {\n        super(messageOrError instanceof Error ? messageOrError.message : messageOrError);\n        if (messageOrError instanceof Error && messageOrError.stack) {\n            this.stack = messageOrError.stack;\n        }\n    }\n}\n\n/**\n * Check if an error is an abort error\n * @param error - An error object\n * @returns - true if the error is an abort error\n */\nexport function isAbortError(error: Error): boolean {\n    return error.name === ABORT_ERROR;\n}\n","import type {RequestParameters, GetResourceResponse} from './ajax';\n\n/**\n * This method type is used to register a protocol handler.\n * Use the abort controller for aborting requests.\n * Return a promise with the relevant resource response.\n */\nexport type AddProtocolAction = (requestParameters: RequestParameters, abortController: AbortController) => Promise<GetResourceResponse<any>>;\n\n/**\n * This is a global config object used to store the configuration\n * It is available in the workers as well.\n * Only serializable data should be stored in it.\n */\ntype Config = {\n    MAX_PARALLEL_IMAGE_REQUESTS: number;\n    MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;\n    MAX_TILE_CACHE_ZOOM_LEVELS: number;\n    REGISTERED_PROTOCOLS: {[x: string]: AddProtocolAction };\n    WORKER_URL: string;\n};\n\nexport const config: Config = {\n    MAX_PARALLEL_IMAGE_REQUESTS: 16,\n    MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: 8,\n    MAX_TILE_CACHE_ZOOM_LEVELS: 5,\n    REGISTERED_PROTOCOLS: {},\n    WORKER_URL: ''\n};\n","import {type AddProtocolAction, config} from '../util/config';\n\nexport function getProtocol(url: string) {\n    return config.REGISTERED_PROTOCOLS[url.substring(0, url.indexOf('://'))];\n}\n/**\n * Adds a custom load resource function that will be called when using a URL that starts with a custom url schema.\n * This will happen in the main thread, and workers might call it if they don't know how to handle the protocol.\n * The example below will be triggered for custom:// urls defined in the sources list in the style definitions.\n * The function passed will receive the request parameters and should return with the resulting resource,\n * for example a pbf vector tile, non-compressed, represented as ArrayBuffer.\n *\n * @param customProtocol - the protocol to hook, for example 'custom'\n * @param loadFn - the function to use when trying to fetch a tile specified by the customProtocol\n * @example\n * ```ts\n * // This will fetch a file using the fetch API (this is obviously a non interesting example...)\n * addProtocol('custom', async (params, abortController) => {\n *      const t = await fetch(`https://${params.url.split(\"://\")[1]}`);\n *      if (t.status == 200) {\n *          const buffer = await t.arrayBuffer();\n *          return {data: buffer}\n *      } else {\n *          throw new Error(`Tile fetch error: ${t.statusText}`);\n *      }\n *  });\n * // the following is an example of a way to return an error when trying to load a tile\n * addProtocol('custom2', async (params, abortController) => {\n *      throw new Error('someErrorMessage');\n * });\n * ```\n */\nexport function addProtocol(customProtocol: string, loadFn: AddProtocolAction) {\n    config.REGISTERED_PROTOCOLS[customProtocol] = loadFn;\n}\n\n/**\n * Removes a previously added protocol in the main thread.\n *\n * @param customProtocol - the custom protocol to remove registration for\n * @example\n * ```ts\n * removeProtocol('custom');\n * ```\n */\nexport function removeProtocol(customProtocol: string) {\n    delete config.REGISTERED_PROTOCOLS[customProtocol];\n}\n","import {extend, isWorker} from './util';\nimport {AbortError, isAbortError} from './abort_error';\nimport {getProtocol} from '../source/protocol_crud';\nimport {MessageType} from './actor_messages';\n\n/**\n * This is used to identify the global dispatcher id when sending a message from the worker without a target map id.\n */\nexport const GLOBAL_DISPATCHER_ID = 'global-dispatcher';\n\n/**\n * A type used to store the tile's expiration date and cache control definition\n */\nexport type ExpiryData = {cacheControl?: string | null; expires?: Date | string | null};\n\n/**\n * A `RequestParameters` object to be returned from Map.options.transformRequest callbacks.\n * @example\n * ```ts\n * // use transformRequest to modify requests that begin with `http://myHost`\n * transformRequest: function(url, resourceType) {\n *  if (resourceType === 'Source' && url.indexOf('http://myHost') > -1) {\n *    return {\n *      url: url.replace('http', 'https'),\n *      headers: { 'my-custom-header': true },\n *      credentials: 'include'  // Include cookies for cross-origin requests\n *    }\n *   }\n * }\n * ```\n */\nexport type RequestParameters = {\n    /**\n     * The URL to be requested.\n     */\n    url: string;\n    /**\n     * The headers to be sent with the request.\n     */\n    headers?: any;\n    /**\n     * Request method `'GET' | 'POST' | 'PUT'`.\n     */\n    method?: 'GET' | 'POST' | 'PUT';\n    /**\n     * Request body.\n     */\n    body?: string;\n    /**\n     * Response body type to be returned.\n     */\n    type?: 'string' | 'json' | 'arrayBuffer' | 'image';\n    /**\n     * `'same-origin'|'include'` Use 'include' to send cookies with cross-origin requests.\n     */\n    credentials?: 'same-origin' | 'include';\n    /**\n     * If `true`, Resource Timing API information will be collected for these transformed requests and returned in a resourceTiming property of relevant data events.\n     */\n    collectResourceTiming?: boolean;\n    /**\n     * Parameters supported only by browser fetch API. Property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. (https://developer.mozilla.org/en-US/docs/Web/API/Request/cache)\n     */\n    cache?: RequestCache;\n};\n\n/**\n * The response object returned from a successful AJAx request\n */\nexport type GetResourceResponse<T> = ExpiryData & {\n    data: T;\n};\n\n/**\n * The response callback used in various places\n */\nexport type ResponseCallback<T> = (\n    error?: Error | null,\n    data?: T | null,\n    cacheControl?: string | null,\n    expires?: string | Date | null\n) => void;\n\n/**\n * An error thrown when a HTTP request results in an error response.\n */\nexport class AJAXError extends Error {\n    /**\n     * The response's HTTP status code.\n     */\n    status: number;\n\n    /**\n     * The response's HTTP status text.\n     */\n    statusText: string;\n\n    /**\n     * The request's URL.\n     */\n    url: string;\n\n    /**\n     * The response's body.\n     */\n    body: Blob;\n\n    /**\n     * @param status - The response's HTTP status code.\n     * @param statusText - The response's HTTP status text.\n     * @param url - The request's URL.\n     * @param body - The response's body.\n     */\n    constructor(status: number, statusText: string, url: string, body: Blob) {\n        super(`AJAXError: ${statusText} (${status}): ${url}`);\n        this.status = status;\n        this.statusText = statusText;\n        this.url = url;\n        this.body = body;\n    }\n}\n\n/**\n * Ensure that we're sending the correct referrer from blob URL worker bundles.\n * For files loaded from the local file system, `location.origin` will be set\n * to the string(!) \"null\" (Firefox), or \"file://\" (Chrome, Safari, Edge),\n * and we will set an empty referrer. Otherwise, we're using the document's URL.\n */\nexport const getReferrer = () => isWorker(self) ?\n    self.worker && self.worker.referrer :\n    (window.location.protocol === 'blob:' ? window.parent : window).location.href;\n\n/**\n * Determines whether a URL is a file:// URL. This is obviously the case if it begins\n * with file://. Relative URLs are also file:// URLs iff the original document was loaded\n * via a file:// URL.\n * @param url - The URL to check\n * @returns `true` if the URL is a file:// URL, `false` otherwise\n */\nconst isFileURL = url => /^file:/.test(url) || (/^file:/.test(getReferrer()) && !/^\\w+:/.test(url));\n\nasync function makeFetchRequest(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    const request = new Request(requestParameters.url, {\n        method: requestParameters.method || 'GET',\n        body: requestParameters.body,\n        credentials: requestParameters.credentials,\n        headers: requestParameters.headers,\n        cache: requestParameters.cache,\n        referrer: getReferrer(),\n        signal: abortController.signal\n    });\n\n    // If the user has already set an Accept header, do not overwrite it here\n    if (requestParameters.type === 'json' && !request.headers.has('Accept')) {\n        request.headers.set('Accept', 'application/json');\n    }\n\n    let response: Response;\n    try {\n        response = await fetch(request);\n    } catch (e) {\n        // Pass through AbortErrors for upstream handling\n        if (isAbortError(e)) {\n            throw e;\n        }\n\n        // When the error is due to CORS policy, DNS issue or malformed URL, the fetch call does not resolve but throws a generic TypeError instead.\n        // It is preferable to throw an AJAXError so that the Map event \"error\" can catch it and still have\n        // access to the faulty url. In such case, we provide the arbitrary HTTP error code of `0`.\n        throw new AJAXError(0, e.message, requestParameters.url, new Blob());\n    }\n\n    if (!response.ok) {\n        const body = await response.blob();\n        throw new AJAXError(response.status, response.statusText, requestParameters.url, body);\n    }\n    let parsePromise: Promise<any>;\n    if ((requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image')) {\n        parsePromise = response.arrayBuffer();\n    } else if (requestParameters.type === 'json') {\n        parsePromise = response.json();\n    } else {\n        parsePromise = response.text();\n    }\n    const result = await parsePromise;\n    abortController.signal.throwIfAborted();\n    return {data: result, cacheControl: response.headers.get('Cache-Control'), expires: response.headers.get('Expires')};\n}\n\nfunction makeXMLHttpRequest(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    return new Promise((resolve, reject) => {\n        const xhr: XMLHttpRequest = new XMLHttpRequest();\n\n        xhr.open(requestParameters.method || 'GET', requestParameters.url, true);\n        if (requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image') {\n            xhr.responseType = 'arraybuffer';\n        }\n        for (const k in requestParameters.headers) {\n            xhr.setRequestHeader(k, requestParameters.headers[k]);\n        }\n        if (requestParameters.type === 'json') {\n            xhr.responseType = 'text';\n            // Do not overwrite the user-provided Accept header\n            if (!requestParameters.headers?.Accept) {\n                xhr.setRequestHeader('Accept', 'application/json');\n            }\n        }\n        xhr.withCredentials = requestParameters.credentials === 'include';\n        xhr.onerror = () => {\n            reject(new Error(xhr.statusText));\n        };\n        xhr.onload = () => {\n            if (abortController.signal.aborted) {\n                return;\n            }\n            if (((xhr.status >= 200 && xhr.status < 300) || xhr.status === 0) && xhr.response !== null) {\n                let data: unknown = xhr.response;\n                if (requestParameters.type === 'json') {\n                    // We're manually parsing JSON here to get better error messages.\n                    try {\n                        data = JSON.parse(xhr.response);\n                    } catch (err) {\n                        reject(err);\n                        return;\n                    }\n                }\n                resolve({data, cacheControl: xhr.getResponseHeader('Cache-Control'), expires: xhr.getResponseHeader('Expires')});\n            } else {\n                const body = new Blob([xhr.response], {type: xhr.getResponseHeader('Content-Type')});\n                reject(new AJAXError(xhr.status, xhr.statusText, requestParameters.url, body));\n            }\n        };\n        abortController.signal.addEventListener('abort', () => {\n            xhr.abort();\n            reject(new AbortError(abortController.signal.reason));\n        });\n        xhr.send(requestParameters.body);\n    });\n}\n\n/**\n * We're trying to use the Fetch API if possible. However, requests for resources with the file:// URI scheme don't work with the Fetch API.\n * In this case we unconditionally use XHR on the current thread since referrers don't matter.\n * This method can also use the registered method if `addProtocol` was called.\n * @param requestParameters - The request parameters\n * @param abortController - The abort controller allowing to cancel the request\n * @returns a promise resolving to the response, including cache control and expiry data\n */\nexport const makeRequest = function(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    if (/:\\/\\//.test(requestParameters.url) && !(/^https?:|^file:/.test(requestParameters.url))) {\n        const protocolLoadFn = getProtocol(requestParameters.url);\n        if (protocolLoadFn) {\n            return protocolLoadFn(requestParameters, abortController);\n        }\n        if (isWorker(self) && self.worker && self.worker.actor) {\n            return self.worker.actor.sendAsync({type: MessageType.getResource, data: requestParameters, targetMapId: GLOBAL_DISPATCHER_ID}, abortController);\n        }\n    }\n    if (!isFileURL(requestParameters.url)) {\n        if (fetch && Request && AbortController && Object.prototype.hasOwnProperty.call(Request.prototype, 'signal')) {\n            return makeFetchRequest(requestParameters, abortController);\n        }\n        if (isWorker(self) && self.worker && self.worker.actor) {\n            return self.worker.actor.sendAsync({type: MessageType.getResource, data: requestParameters, mustQueue: true, targetMapId: GLOBAL_DISPATCHER_ID}, abortController);\n        }\n    }\n    return makeXMLHttpRequest(requestParameters, abortController);\n};\n\nexport const getJSON = <T>(requestParameters: RequestParameters, abortController: AbortController): Promise<{data: T} & ExpiryData> => {\n    return makeRequest(extend(requestParameters, {type: 'json'}), abortController);\n};\n\nexport const getArrayBuffer = (requestParameters: RequestParameters, abortController: AbortController): Promise<{data: ArrayBuffer} & ExpiryData> => {\n    return makeRequest(extend(requestParameters, {type: 'arrayBuffer'}), abortController);\n};\n\nexport function sameOrigin(inComingUrl: string) {\n    // A relative URL \"/foo\" or \"./foo\" will throw exception in URL's ctor,\n    // try-catch is expansive so just use a heuristic check to avoid it\n    // also check data URL\n    if (!inComingUrl ||\n        inComingUrl.indexOf('://') <= 0 || // relative URL\n        inComingUrl.indexOf('data:image/') === 0 || // data image URL\n        inComingUrl.indexOf('blob:') === 0) { // blob\n        return true;\n    }\n    const urlObj = new URL(inComingUrl);\n    const locationObj = window.location;\n    return urlObj.protocol === locationObj.protocol && urlObj.host === locationObj.host;\n}\n\nexport const getVideo = (urls: Array<string>): Promise<HTMLVideoElement> => {\n    const video: HTMLVideoElement = window.document.createElement('video');\n    video.muted = true;\n    return new Promise((resolve) => {\n        video.onloadstart = () => {\n            resolve(video);\n        };\n        for (const url of urls) {\n            const s: HTMLSourceElement = window.document.createElement('source');\n            if (!sameOrigin(url)) {\n                video.crossOrigin = 'Anonymous';\n            }\n            s.src = url;\n            video.appendChild(s);\n        }\n    });\n};\n","import {TransferableGridIndex} from './transferable_grid_index';\nimport {Color, CompoundExpression, expressions, ResolvedImage, StylePropertyFunction,\n    StyleExpression, ZoomDependentExpression, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {AJAXError} from './ajax';\nimport {isImageBitmap} from './util';\n\n/**\n * A class that is serialized to and json, that can be constructed back to the original class in the worker or in the main thread\n */\ntype SerializedObject<S extends Serialized = any> = {\n    [_: string]: S;\n};\n\n/**\n * All the possible values that can be serialized and sent to and from the worker\n */\nexport type Serialized = null | void | boolean | number | string | Boolean | Number | String | Date | RegExp | ArrayBuffer | ArrayBufferView | ImageData | ImageBitmap | Blob | Array<Serialized> | SerializedObject;\n\ntype Registry = {\n    [_: string]: {\n        klass: {\n            new (...args: any): any;\n            deserialize?: (input: Serialized) => unknown;\n            serialize?: (input: any, transferables: Transferable[]) => SerializedObject;\n        };\n        omit: ReadonlyArray<string>;\n        shallow: ReadonlyArray<string>;\n    };\n};\n\n/**\n * Register options\n */\ntype RegisterOptions<T> = {\n    /**\n     * List of properties to omit from serialization (e.g., cached/computed properties)\n     */\n    omit?: ReadonlyArray<keyof T>;\n    /**\n     * List of properties that should be serialized by a simple shallow copy, rather than by a recursive call to serialize().\n     */\n    shallow?: ReadonlyArray<keyof T>;\n};\n\nconst registry: Registry = {};\n\n/**\n * Register the given class as serializable.\n *\n * @param options - the registration options\n */\nexport function register<T extends any>(\n    name: string,\n    klass: {\n        new (...args: any): T;\n    },\n    options: RegisterOptions<T> = {}\n) {\n    if (registry[name]) throw new Error(`${name} is already registered.`);\n    ((Object.defineProperty as any))(klass, '_classRegistryKey', {\n        value: name,\n        writeable: false\n    });\n    registry[name] = {\n        klass,\n        omit: options.omit as ReadonlyArray<string> || [],\n        shallow: options.shallow as ReadonlyArray<string> || []\n    };\n}\n\nregister('Object', Object);\nregister('Set', Set);\nregister('TransferableGridIndex', TransferableGridIndex);\n\nregister('Color', Color);\nregister('Error', Error);\nregister('AJAXError', AJAXError);\nregister('ResolvedImage', ResolvedImage);\n\nregister('StylePropertyFunction', StylePropertyFunction);\nregister('StyleExpression', StyleExpression, {omit: ['_evaluator']});\n\nregister('ZoomDependentExpression', ZoomDependentExpression);\nregister('ZoomConstantExpression', ZoomConstantExpression);\nregister('CompoundExpression', CompoundExpression, {omit: ['_evaluate']});\nfor (const name in expressions) {\n    if ((expressions[name] as any)._classRegistryKey) continue;\n    register(`Expression_${name}`, expressions[name]);\n}\n\nfunction isArrayBuffer(value: any): value is ArrayBuffer {\n    return value && typeof ArrayBuffer !== 'undefined' &&\n           (value instanceof ArrayBuffer || (value.constructor && value.constructor.name === 'ArrayBuffer'));\n}\n\nfunction getClassRegistryKey(input: Object|SerializedObject): string {\n    const klass = (input.constructor as any);\n    return (input as SerializedObject).$name || klass._classRegistryKey;\n}\n\nfunction isRegistered(input: unknown): boolean {\n    if (input === null || typeof input !== 'object') {\n        return false;\n    }\n    const classRegistryKey = getClassRegistryKey(input);\n    if (classRegistryKey && classRegistryKey !== 'Object') {\n        return true;\n    }\n    return false;\n}\n\nfunction isSerializeHandledByBuiltin(input: unknown) {\n    return (!isRegistered(input) && (\n        input === null ||\n        input === undefined ||\n        typeof input === 'boolean' ||\n        typeof input === 'number' ||\n        typeof input === 'string' ||\n        input instanceof Boolean ||\n        input instanceof Number ||\n        input instanceof String ||\n        input instanceof Date ||\n        input instanceof RegExp ||\n        input instanceof Blob ||\n        input instanceof Error ||\n        isArrayBuffer(input) ||\n        isImageBitmap(input) ||\n        ArrayBuffer.isView(input) ||\n        input instanceof ImageData)\n    );\n}\n\n/**\n * Serialize the given object for transfer to or from a web worker.\n *\n * For non-builtin types, recursively serialize each property (possibly\n * omitting certain properties - see register()), and package the result along\n * with the constructor's `name` so that the appropriate constructor can be\n * looked up in `deserialize()`.\n *\n * If a `transferables` array is provided, add any transferable objects (i.e.,\n * any ArrayBuffers or ArrayBuffer views) to the list. (If a copy is needed,\n * this should happen in the client code, before using serialize().)\n */\nexport function serialize(input: unknown, transferables?: Array<Transferable> | null): Serialized {\n    if (isSerializeHandledByBuiltin(input)) {\n        if (isArrayBuffer(input) || isImageBitmap(input)) {\n            if (transferables) {\n                transferables.push(input);\n            }\n        }\n        if (ArrayBuffer.isView(input)) {\n            const view = input;\n            if (transferables) {\n                transferables.push(view.buffer);\n            }\n        }\n        if (input instanceof ImageData) {\n            if (transferables) {\n                transferables.push(input.data.buffer);\n            }\n        }\n        return input;\n    }\n\n    if (Array.isArray(input)) {\n        const serialized: Array<Serialized> = [];\n        for (const item of input) {\n            serialized.push(serialize(item, transferables));\n        }\n        return serialized;\n    }\n\n    if (typeof input !== 'object') {\n        throw new Error(`can't serialize object of type ${typeof input}`);\n    }\n    const classRegistryKey = getClassRegistryKey(input);\n    if (!classRegistryKey) {\n        throw new Error(`can't serialize object of unregistered class ${input.constructor.name}`);\n    }\n    if (!registry[classRegistryKey]) throw new Error(`${classRegistryKey} is not registered.`);\n    const {klass} = registry[classRegistryKey];\n    const properties: SerializedObject = klass.serialize ?\n        // (Temporary workaround) allow a class to provide static\n        // `serialize()` and `deserialize()` methods to bypass the generic\n        // approach.\n        // This temporary workaround lets us use the generic serialization\n        // approach for objects whose members include instances of dynamic\n        // StructArray types. Once we refactor StructArray to be static,\n        // we can remove this complexity.\n        (klass.serialize(input, transferables) as SerializedObject) : {};\n\n    if (!klass.serialize) {\n        for (const key in input) {\n            if (!input.hasOwnProperty(key)) continue;\n            if (registry[classRegistryKey].omit.indexOf(key) >= 0) continue;\n            const property = input[key];\n            properties[key] = registry[classRegistryKey].shallow.indexOf(key) >= 0 ?\n                property :\n                serialize(property, transferables);\n        }\n        if (input instanceof Error) {\n            properties.message = input.message;\n        }\n    } else {\n        if (transferables && properties === transferables[transferables.length - 1]) {\n            throw new Error('statically serialized object won\\'t survive transfer of $name property');\n        }\n    }\n\n    if (properties.$name) {\n        throw new Error('$name property is reserved for worker serialization logic.');\n    }\n    if (classRegistryKey !== 'Object') {\n        properties.$name = classRegistryKey;\n    }\n\n    return properties;\n}\n\nexport function deserialize(input: Serialized): unknown {\n    if (isSerializeHandledByBuiltin(input)) {\n        return input;\n    }\n\n    if (Array.isArray(input)) {\n        return input.map(deserialize);\n    }\n\n    if (typeof input !== 'object') {\n        throw new Error(`can't deserialize object of type ${typeof input}`);\n    }\n    const classRegistryKey = getClassRegistryKey(input) || 'Object';\n    if (!registry[classRegistryKey]) {\n        throw new Error(`can't deserialize unregistered class ${classRegistryKey}`);\n    }\n    const {klass} = registry[classRegistryKey];\n    if (!klass) {\n        throw new Error(`can't deserialize unregistered class ${classRegistryKey}`);\n    }\n\n    if (klass.deserialize) {\n        return klass.deserialize(input);\n    }\n\n    const result = Object.create(klass.prototype);\n\n    for (const key of Object.keys(input)) {\n        if (key === '$name') continue;\n        const value = (input as SerializedObject)[key];\n        result[key] = registry[classRegistryKey].shallow.indexOf(key) >= 0 ? value : deserialize(value);\n    }\n\n    return result;\n}\n","/**\n * Invokes the wrapped function in a non-blocking way when trigger() is called.\n * Invocation requests are ignored until the function was actually invoked.\n */\nexport class ThrottledInvoker {\n    _channel: MessageChannel;\n    _triggered: boolean;\n    _methodToThrottle: Function;\n\n    constructor(methodToThrottle: Function) {\n        this._methodToThrottle = methodToThrottle;\n        this._triggered = false;\n        if (typeof MessageChannel !== 'undefined') {\n            this._channel = new MessageChannel();\n            this._channel.port2.onmessage = () => {\n                this._triggered = false;\n                this._methodToThrottle();\n            };\n        }\n    }\n\n    trigger() {\n        if (this._triggered) {\n            return;\n        }\n        this._triggered = true;\n        if (this._channel) {\n            this._channel.port1.postMessage(true);\n        } else {\n            setTimeout(() => {\n                this._triggered = false;\n                this._methodToThrottle();\n            }, 0);\n        }\n    }\n\n    remove() {\n        delete this._channel;\n        this._methodToThrottle = () => {};\n    }\n}\n","import {type Subscription, isWorker, subscribe} from './util';\nimport {serialize, deserialize, type Serialized} from './web_worker_transfer';\nimport {ThrottledInvoker} from './throttled_invoker';\n\nimport {\n    type MessageType,\n    type ActorMessage,\n    type RequestResponseMessageMap,\n} from './actor_messages';\n\n/**\n * An interface to be sent to the actor in order for it to allow communication between the worker and the main thread\n */\nexport interface ActorTarget {\n    addEventListener: typeof window.addEventListener;\n    removeEventListener: typeof window.removeEventListener;\n    postMessage: typeof window.postMessage;\n    terminate?: () => void;\n}\n\n/**\n * This is used to define the parameters of the message that is sent to the worker and back\n */\ntype MessageData = {\n    id: string;\n    type: MessageType | '<cancel>' | '<response>';\n    origin: string;\n    data?: Serialized;\n    targetMapId?: string | number | null;\n    mustQueue?: boolean;\n    error?: Serialized | null;\n    sourceMapId: string | number | null;\n};\n\ntype ResolveReject = {\n    resolve: (value?: RequestResponseMessageMap[MessageType][1]) => void;\n    reject: (reason?: Error) => void;\n};\n\n/**\n * This interface allowing to substitute only the sendAsync method of the Actor class.\n */\nexport interface IActor {\n    sendAsync<T extends MessageType>(message: ActorMessage<T>, abortController?: AbortController): Promise<RequestResponseMessageMap[T][1]>;\n}\n\nexport type MessageHandler<T extends MessageType> = (mapId: string | number, params: RequestResponseMessageMap[T][0], abortController?: AbortController) => Promise<RequestResponseMessageMap[T][1]>;\n\nconst addEventDefaultOptions: AddEventListenerOptions = {once: true};\n\n/**\n * An implementation of the [Actor design pattern](https://en.wikipedia.org/wiki/Actor_model)\n * that maintains the relationship between asynchronous tasks and the objects\n * that spin them off - in this case, tasks like parsing parts of styles,\n * owned by the styles\n */\nexport class Actor implements IActor {\n    target: ActorTarget;\n    mapId: string | number | null;\n    resolveRejects: { [x: string]: ResolveReject};\n    name: string;\n    tasks: { [x: string]: MessageData };\n    taskQueue: Array<string>;\n    abortControllers: { [x: number | string]: AbortController };\n    invoker: ThrottledInvoker;\n    globalScope: ActorTarget;\n    messageHandlers: { [x in MessageType]?: MessageHandler<MessageType>};\n    subscription: Subscription;\n\n    /**\n     * @param target - The target\n     * @param mapId - A unique identifier for the Map instance using this Actor.\n     */\n    constructor(target: ActorTarget, mapId?: string | number) {\n        this.target = target;\n        this.mapId = mapId;\n        this.resolveRejects = {};\n        this.tasks = {};\n        this.taskQueue = [];\n        this.abortControllers = {};\n        this.messageHandlers = {};\n        this.invoker = new ThrottledInvoker(() => this.process());\n        this.subscription = subscribe(this.target, 'message', (message) => this.receive(message), false);\n        this.globalScope = isWorker(self) ? target : window;\n    }\n\n    registerMessageHandler<T extends MessageType>(type: T, handler: MessageHandler<T>) {\n        this.messageHandlers[type] = handler;\n    }\n\n    unregisterMessageHandler<T extends MessageType>(type: T) {\n        delete this.messageHandlers[type];\n    }\n\n    /**\n     * Sends a message from a main-thread map to a Worker or from a Worker back to\n     * a main-thread map instance.\n     * @param message - the message to send\n     * @param abortController - an optional AbortController to abort the request\n     * @returns a promise that will be resolved with the response data\n     */\n    sendAsync<T extends MessageType>(message: ActorMessage<T>, abortController?: AbortController): Promise<RequestResponseMessageMap[T][1]> {\n        return new Promise((resolve, reject) => {\n            // We're using a string ID instead of numbers because they are being used as object keys\n            // anyway, and thus stringified implicitly. We use random IDs because an actor may receive\n            // message from multiple other actors which could run in different execution context. A\n            // linearly increasing ID could produce collisions.\n            const id = Math.round((Math.random() * 1e18)).toString(36).substring(0, 10);\n\n            const subscription =  abortController ? subscribe(abortController.signal, 'abort', () => {\n                subscription?.unsubscribe();\n                delete this.resolveRejects[id];\n                const cancelMessage: MessageData = {\n                    id,\n                    type: '<cancel>',\n                    origin: location.origin,\n                    targetMapId: message.targetMapId,\n                    sourceMapId: this.mapId\n                };\n                this.target.postMessage(cancelMessage);\n                // In case of abort the current behavior is to keep the promise pending.\n            }, addEventDefaultOptions) : null;\n\n            this.resolveRejects[id] = {\n                resolve: (value) => {\n                    subscription?.unsubscribe();\n                    resolve(value);\n                },\n                reject: (reason) => {\n                    subscription?.unsubscribe();\n                    reject(reason);\n                }\n            };\n\n            const buffers: Array<Transferable> = [];\n            const messageToPost: MessageData = {\n                ...message,\n                id,\n                sourceMapId: this.mapId,\n                origin: location.origin,\n                data: serialize(message.data, buffers)\n            };\n            this.target.postMessage(messageToPost, {transfer: buffers});\n        });\n    }\n\n    receive(message: {data: MessageData}) {\n        const data = message.data;\n        const id = data.id;\n        if (data.origin !== 'file://' && location.origin !== 'file://' && data.origin !== 'resource://android' && location.origin !== 'resource://android' && data.origin !== location.origin) {\n            return;\n        }\n        if (data.targetMapId && this.mapId !== data.targetMapId) {\n            return;\n        }\n        if (data.type === '<cancel>') {\n            // Remove the original request from the queue. This is only possible if it\n            // hasn't been kicked off yet. The id will remain in the queue, but because\n            // there is no associated task, it will be dropped once it's time to execute it.\n            delete this.tasks[id];\n            const abortController = this.abortControllers[id];\n            delete this.abortControllers[id];\n            if (abortController) {\n                abortController.abort();\n            }\n            return;\n        }\n        if (isWorker(self) || data.mustQueue) {\n            // In workers, store the tasks that we need to process before actually processing them. This\n            // is necessary because we want to keep receiving messages, and in particular,\n            // <cancel> messages. Some tasks may take a while in the worker thread, so before\n            // executing the next task in our queue, postMessage preempts this and <cancel>\n            // messages can be processed. We're using a MessageChannel object to get throttle the\n            // process() flow to one at a time.\n            this.tasks[id] = data;\n            this.taskQueue.push(id);\n            this.invoker.trigger();\n            return;\n        }\n        // In the main thread, process messages immediately so that other work does not slip in\n        // between getting partial data back from workers.\n        this.processTask(id, data);\n    }\n\n    process() {\n        if (this.taskQueue.length === 0) {\n            return;\n        }\n        const id = this.taskQueue.shift();\n        const task = this.tasks[id];\n        delete this.tasks[id];\n        // Schedule another process call if we know there's more to process _before_ invoking the\n        // current task. This is necessary so that processing continues even if the current task\n        // doesn't execute successfully.\n        if (this.taskQueue.length > 0) {\n            this.invoker.trigger();\n        }\n        if (!task) {\n            // If the task ID doesn't have associated task data anymore, it was canceled.\n            return;\n        }\n\n        this.processTask(id, task);\n    }\n\n    async processTask(id: string, task: MessageData) {\n        if (task.type === '<response>') {\n            // The `completeTask` function in the counterpart actor has been called, and we are now\n            // resolving or rejecting the promise in the originating actor, if there is one.\n            const resolveReject = this.resolveRejects[id];\n            delete this.resolveRejects[id];\n            if (!resolveReject) {\n                // If we get a response, but don't have a resolve or reject, the request was canceled.\n                return;\n            }\n            if (task.error) {\n                resolveReject.reject(deserialize(task.error) as Error);\n            } else {\n                resolveReject.resolve(deserialize(task.data));\n            }\n            return;\n        }\n        if (!this.messageHandlers[task.type]) {\n            this.completeTask(id, new Error(`Could not find a registered handler for ${task.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(', ')}`));\n            return;\n        }\n        const params = deserialize(task.data) as RequestResponseMessageMap[MessageType][0];\n        const abortController = new AbortController();\n        this.abortControllers[id] = abortController;\n        try {\n            const data = await this.messageHandlers[task.type](task.sourceMapId, params, abortController);\n            this.completeTask(id, null, data);\n        } catch (err) {\n            this.completeTask(id, err);\n        }\n    }\n\n    completeTask(id: string, err: Error, data?: RequestResponseMessageMap[MessageType][1]) {\n        const buffers: Array<Transferable> = [];\n        delete this.abortControllers[id];\n        const responseMessage: MessageData = {\n            id,\n            type: '<response>',\n            sourceMapId: this.mapId,\n            origin: location.origin,\n            error: err ? serialize(err) : null,\n            data: serialize(data, buffers)\n        };\n        this.target.postMessage(responseMessage, {transfer: buffers});\n    }\n\n    remove() {\n        this.invoker.remove();\n        this.subscription.unsubscribe();\n    }\n}\n","import {extend, type Subscription} from './util';\n\n/**\n * A listener method used as a callback to events\n */\nexport type Listener = (a: any) => any;\n\ntype Listeners = {[_: string]: Array<Listener>};\n\nfunction _addEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    const listenerExists = listenerList[type] && listenerList[type].indexOf(listener) !== -1;\n    if (!listenerExists) {\n        listenerList[type] = listenerList[type] || [];\n        listenerList[type].push(listener);\n    }\n}\n\nfunction _removeEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    if (listenerList && listenerList[type]) {\n        const index = listenerList[type].indexOf(listener);\n        if (index !== -1) {\n            listenerList[type].splice(index, 1);\n        }\n    }\n}\n\n/**\n * The event class\n */\nexport class Event {\n    readonly type: string;\n\n    constructor(type: string, data: any = {}) {\n        extend(this, data);\n        this.type = type;\n    }\n}\n\ninterface ErrorLike {\n    message: string;\n}\n\n/**\n * An error event\n */\nexport class ErrorEvent extends Event {\n    error: ErrorLike;\n\n    constructor(error: ErrorLike, data: any = {}) {\n        super('error', extend({error}, data));\n    }\n}\n\n/**\n * Methods mixed in to other classes for event capabilities.\n *\n * @group Event Related\n */\nexport class Evented {\n    _listeners: Listeners;\n    _oneTimeListeners: Listeners;\n    _eventedParent: Evented;\n    _eventedParentData: any | (() => any);\n\n    /**\n     * Adds a listener to a specified event type.\n     *\n     * @param type - The event type to add a listen for.\n     * @param listener - The function to be called when the event is fired.\n     * The listener function is called with the data object passed to `fire`,\n     * extended with `target` and `type` properties.\n     */\n    on(type: string, listener: Listener): Subscription {\n        this._listeners = this._listeners || {};\n        _addEventListener(type, listener, this._listeners);\n\n        return {\n            unsubscribe: () => {\n                this.off(type, listener);\n            }\n        };\n    }\n\n    /**\n     * Removes a previously registered event listener.\n     *\n     * @param type - The event type to remove listeners for.\n     * @param listener - The listener function to remove.\n     */\n    off(type: string, listener: Listener) {\n        _removeEventListener(type, listener, this._listeners);\n        _removeEventListener(type, listener, this._oneTimeListeners);\n\n        return this;\n    }\n\n    /**\n     * Adds a listener that will be called only once to a specified event type.\n     *\n     * The listener will be called first time the event fires after the listener is registered.\n     *\n     * @param type - The event type to listen for.\n     * @param listener - The function to be called when the event is fired the first time.\n     * @returns `this` or a promise if a listener is not provided\n     */\n    once(type: string, listener?: Listener): this | Promise<any> {\n        if (!listener) {\n            return new Promise((resolve) => this.once(type, resolve));\n        }\n        this._oneTimeListeners = this._oneTimeListeners || {};\n        _addEventListener(type, listener, this._oneTimeListeners);\n\n        return this;\n    }\n\n    fire(event: Event | string, properties?: any) {\n        // Compatibility with (type: string, properties: Object) signature from previous versions.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/6522,\n        //     https://github.com/mapbox/mapbox-gl-draw/issues/766\n        if (typeof event === 'string') {\n            event = new Event(event, properties || {});\n        }\n\n        const type = event.type;\n\n        if (this.listens(type)) {\n            (event as any).target = this;\n\n            // make sure adding or removing listeners inside other listeners won't cause an infinite loop\n            const listeners = this._listeners && this._listeners[type] ? this._listeners[type].slice() : [];\n            for (const listener of listeners) {\n                listener.call(this, event);\n            }\n\n            const oneTimeListeners = this._oneTimeListeners && this._oneTimeListeners[type] ? this._oneTimeListeners[type].slice() : [];\n            for (const listener of oneTimeListeners) {\n                _removeEventListener(type, listener, this._oneTimeListeners);\n                listener.call(this, event);\n            }\n\n            const parent = this._eventedParent;\n            if (parent) {\n                extend(\n                    event,\n                    typeof this._eventedParentData === 'function' ? this._eventedParentData() : this._eventedParentData\n                );\n                parent.fire(event);\n            }\n\n        // To ensure that no error events are dropped, print them to the\n        // console if they have no listeners.\n        } else if (event instanceof ErrorEvent) {\n            console.error(event.error);\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.\n     *\n     * @param type - The event type\n     * @returns `true` if there is at least one registered listener for specified event type, `false` otherwise\n     */\n    listens(type: string): boolean {\n        return (\n            (this._listeners && this._listeners[type] && this._listeners[type].length > 0) ||\n            (this._oneTimeListeners && this._oneTimeListeners[type] && this._oneTimeListeners[type].length > 0) ||\n            (this._eventedParent && this._eventedParent.listens(type))\n        );\n    }\n\n    /**\n     * Bubble all events fired by this instance of Evented to this parent instance of Evented.\n     */\n    setEventedParent(parent?: Evented | null, data?: any | (() => any)) {\n        this._eventedParent = parent;\n        this._eventedParentData = data;\n\n        return this;\n    }\n}\n","import {validateStyleMin} from '@maplibre/maplibre-gl-style-spec';\nimport {ErrorEvent} from '../util/evented';\n\nimport type {Evented} from '../util/evented';\n\ntype ValidationError = {\n    message: string;\n    line: number;\n    identifier?: string;\n};\n\nexport type Validator = (a: any) => ReadonlyArray<ValidationError>;\n\ntype ValidateStyle = {\n    source: Validator;\n    sprite: Validator;\n    glyphs: Validator;\n    layer: Validator;\n    light: Validator;\n    sky: Validator;\n    terrain: Validator;\n    filter: Validator;\n    paintProperty: Validator;\n    layoutProperty: Validator;\n    (b: any, a?: any | null): ReadonlyArray<ValidationError>;\n};\n\nexport const validateStyle = (validateStyleMin as unknown as ValidateStyle);\n\nexport const validateSource = validateStyle.source;\nexport const validateLight = validateStyle.light;\nexport const validateSky = validateStyle.sky;\nexport const validateTerrain = validateStyle.terrain;\nexport const validateFilter = validateStyle.filter;\nexport const validatePaintProperty = validateStyle.paintProperty;\nexport const validateLayoutProperty = validateStyle.layoutProperty;\n\nexport function emitValidationErrors(\n    emitter: Evented,\n    errors?: ReadonlyArray<{\n        message: string;\n        identifier?: string;\n    }> | null\n): boolean {\n    let hasErrors = false;\n    if (errors && errors.length) {\n        for (const error of errors) {\n            emitter.fire(new ErrorEvent(new Error(error.message)));\n            hasErrors = true;\n        }\n    }\n    return hasErrors;\n}\n","export class ZoomHistory {\n    lastZoom: number;\n    lastFloorZoom: number;\n    lastIntegerZoom: number;\n    lastIntegerZoomTime: number;\n    first: boolean;\n\n    constructor() {\n        this.first = true;\n    }\n\n    update(z: number, now: number) {\n        const floorZ = Math.floor(z);\n\n        if (this.first) {\n            this.first = false;\n            this.lastIntegerZoom = floorZ;\n            this.lastIntegerZoomTime = 0;\n            this.lastZoom = z;\n            this.lastFloorZoom = floorZ;\n            return true;\n        }\n\n        if (this.lastFloorZoom > floorZ) {\n            this.lastIntegerZoom = floorZ + 1;\n            this.lastIntegerZoomTime = now;\n        } else if (this.lastFloorZoom < floorZ) {\n            this.lastIntegerZoom = floorZ;\n            this.lastIntegerZoomTime = now;\n        }\n\n        if (z !== this.lastZoom) {\n            this.lastZoom = z;\n            this.lastFloorZoom = floorZ;\n            return true;\n        }\n\n        return false;\n    }\n}\n","// This file is generated. Edit build/generate-unicode-data.ts, then run `npm run generate-unicode-data`.\n\n/**\n * Returns whether the fallback fonts specified by the\n * `localIdeographFontFamily` map option apply to the given codepoint. \n */\nexport function codePointUsesLocalIdeographFontFamily(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u1100-\\u11FF\\u2E80-\\u2FDF\\u3000-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns whether the given codepoint participates in ideographic line\n * breaking.\n */\nexport function codePointAllowsIdeographicBreaking(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u2E80-\\u2FDF\\u2FF0-\\u303F\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FD-\\u30FF\\u3105-\\u312F\\u31A0-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE4F\\uFF00-\\uFFEF]|\\uD81B[\\uDFE0-\\uDFFF]|[\\uD81C-\\uD822\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFFF]|\\uD82C[\\uDC00-\\uDEFB]|\\uD83C[\\uDE00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * upright orientation.\n *\n * A character has upright orientation if it is drawn upright (unrotated)\n * whether the line is oriented horizontally or vertically, even if both\n * adjacent characters can be rotated. For example, a Chinese character is\n * always drawn upright. An uprightly oriented character causes an adjacent\n * “neutral” character to be drawn upright as well.\n */\nexport function codePointHasUprightVerticalOrientation(codePoint: number): boolean {\n    return /[\\u02EA\\u02EB\\u1100-\\u11FF\\u1400-\\u167F\\u18B0-\\u18F5\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u3007\\u3012\\u3013\\u3020-\\u302F\\u3031-\\u303F\\u3041-\\u3096\\u309D-\\u30FB\\u30FD-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u3190-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFE10-\\uFE1F\\uFE30-\\uFE48\\uFE50-\\uFE57\\uFE5F-\\uFE62\\uFE67-\\uFE6F\\uFF00-\\uFF07\\uFF0A-\\uFF0C\\uFF0E-\\uFF19\\uFF1F-\\uFF3A\\uFF3C\\uFF3E\\uFF40-\\uFF5A\\uFFE0-\\uFFE2\\uFFE4-\\uFFE7]|\\uD802[\\uDD80-\\uDD9F]|\\uD805[\\uDD80-\\uDDFF]|\\uD806[\\uDE00-\\uDEBF]|\\uD811[\\uDC00-\\uDE7F]|\\uD81B[\\uDFE0-\\uDFE4\\uDFF0-\\uDFF6]|[\\uD81C-\\uD822\\uD83D\\uD840-\\uD868\\uD86A-\\uD86D\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883\\uD885-\\uD88C][\\uDC00-\\uDFFF]|\\uD823[\\uDC00-\\uDCD5\\uDCFF-\\uDD1E\\uDD80-\\uDDF2]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD30-\\uDEFB]|\\uD833[\\uDEC0-\\uDFCF]|\\uD834[\\uDC00-\\uDDFF\\uDEE0-\\uDF7F]|\\uD836[\\uDC00-\\uDEAF]|\\uD83C[\\uDC00-\\uDE00\\uDF00-\\uDFFF]|\\uD83E[\\uDD00-\\uDEFF]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEAD\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0\\uDFF0-\\uDFFF]|\\uD87B[\\uDC00-\\uDE5D]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A\\uDF50-\\uDFFF]|\\uD88D[\\uDC00-\\uDC79]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * neutral orientation.\n *\n * A character has neutral orientation if it may be drawn rotated or unrotated\n * when the line is oriented vertically, depending on the orientation of the\n * adjacent characters. For example, along a vertically oriented line, the\n * vulgar fraction ½ is drawn upright among Chinese characters but rotated among\n * Latin letters. A neutrally oriented character does not influence whether an\n * adjacent character is drawn upright or rotated.\n */\nexport function codePointHasNeutralVerticalOrientation(codePoint: number): boolean {\n    return /[\\xA7\\xA9\\xAE\\xB1\\xBC-\\xBE\\xD7\\xF7\\u2016\\u2020\\u2021\\u2030\\u2031\\u203B\\u203C\\u2042\\u2047-\\u2049\\u2051\\u2100-\\u218F\\u221E\\u2234\\u2235\\u2300-\\u2307\\u230C-\\u231F\\u2324-\\u2328\\u232B\\u237D-\\u239A\\u23BE-\\u23CD\\u23CF\\u23D1-\\u23DB\\u23E2-\\u2422\\u2424-\\u24FF\\u25A0-\\u2619\\u2620-\\u2767\\u2776-\\u2793\\u2B12-\\u2B2F\\u2B50-\\u2B59\\u2BB8-\\u2BEB\\u3000-\\u303F\\u30A0-\\u30FF\\uE000-\\uF8FF\\uFE30-\\uFE6F\\uFF00-\\uFFEF\\uFFFC\\uFFFD]|[\\uDB80-\\uDBFF][\\uDC00-\\uDFFF]/gim.test(String.fromCodePoint(codePoint));\n}\n\n/**\n * Returns whether the give codepoint is likely to require complex text shaping.\n */\nexport function codePointRequiresComplexTextShaping(codePoint: number): boolean {\n    return /[\\u0900-\\u0DFF\\u0F00-\\u109F\\u1780-\\u17FF]/gim.test(String.fromCodePoint(codePoint));\n}\n","import {\n    codePointAllowsIdeographicBreaking,\n    codePointHasUprightVerticalOrientation,\n    codePointHasNeutralVerticalOrientation,\n    codePointRequiresComplexTextShaping\n} from '../util/unicode_properties.g';\n\nexport function charIsWhitespace(char: number) {\n    return /\\s/u.test(String.fromCodePoint(char));\n}\n\nexport function allowsIdeographicBreaking(chars: string) {\n    for (const char of chars) {\n        if (!codePointAllowsIdeographicBreaking(char.codePointAt(0))) return false;\n    }\n    return true;\n}\n\nexport function allowsVerticalWritingMode(chars: string) {\n    for (const char of chars) {\n        if (codePointHasUprightVerticalOrientation(char.codePointAt(0))) return true;\n    }\n    return false;\n}\n\nexport function allowsLetterSpacing(chars: string) {\n    for (const char of chars) {\n        if (!charAllowsLetterSpacing(char.codePointAt(0))) return false;\n    }\n    return true;\n}\n\n/**\n * Returns a regular expression matching the given script codes, excluding any\n * code that the execution environment lacks support for in regular expressions.\n */\nfunction sanitizedRegExpFromScriptCodes(scriptCodes: Array<string>): RegExp {\n    const supportedPropertyEscapes = scriptCodes.map(code => {\n        try {\n            return new RegExp(`\\\\p{sc=${code}}`, 'u').source;\n        } catch {\n            return null;\n        }\n    }).filter(pe => pe);\n    return new RegExp(supportedPropertyEscapes.join('|'), 'u');\n}\n\n/**\n * ISO 15924 script codes of scripts that disallow letter spacing as of Unicode\n * 16.0.0.\n *\n * In general, cursive scripts are incompatible with letter spacing.\n */\nconst cursiveScriptCodes = [\n    'Arab', // Arabic\n    'Dupl', // Duployan\n    'Mong', // Mongolian\n    'Ougr', // Old Uyghur\n    'Syrc', // Syriac\n];\n\nconst cursiveScriptRegExp = sanitizedRegExpFromScriptCodes(cursiveScriptCodes);\n\nexport function charAllowsLetterSpacing(char: number) {\n    return !cursiveScriptRegExp.test(String.fromCodePoint(char));\n}\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * rotated orientation.\n *\n * A character has rotated orientation if it is drawn rotated when the line is\n * oriented vertically, even if both adjacent characters are upright. For\n * example, a Latin letter is drawn rotated along a vertical line. A rotated\n * character causes an adjacent “neutral” character to be drawn rotated as well.\n */\nexport function charHasRotatedVerticalOrientation(char: number) {\n    return !(codePointHasUprightVerticalOrientation(char) ||\n             codePointHasNeutralVerticalOrientation(char));\n}\n\nexport function charInComplexShapingScript(char: number) {\n    return /\\p{sc=Arab}/u.test(String.fromCodePoint(char));\n}\n\n/**\n * ISO 15924 script codes of scripts that are primarily written horizontally\n * right-to-left according to Unicode 16.0.0.\n */\nconst rtlScriptCodes = [\n    'Adlm', // Adlam\n    'Arab', // Arabic\n    'Armi', // Imperial Aramaic\n    'Avst', // Avestan\n    'Chrs', // Chorasmian\n    'Cprt', // Cypriot\n    'Egyp', // Egyptian Hieroglyphs\n    'Elym', // Elymaic\n    'Gara', // Garay\n    'Hatr', // Hatran\n    'Hebr', // Hebrew\n    'Hung', // Old Hungarian\n    'Khar', // Kharoshthi\n    'Lydi', // Lydian\n    'Mand', // Mandaic\n    'Mani', // Manichaean\n    'Mend', // Mende Kikakui\n    'Merc', // Meroitic Cursive\n    'Mero', // Meroitic Hieroglyphs\n    'Narb', // Old North Arabian\n    'Nbat', // Nabataean\n    'Nkoo', // NKo\n    'Orkh', // Old Turkic\n    'Palm', // Palmyrene\n    'Phli', // Inscriptional Pahlavi\n    'Phlp', // Psalter Pahlavi\n    'Phnx', // Phoenician\n    'Prti', // Inscriptional Parthian\n    'Rohg', // Hanifi Rohingya\n    'Samr', // Samaritan\n    'Sarb', // Old South Arabian\n    'Sogo', // Old Sogdian\n    'Syrc', // Syriac\n    'Thaa', // Thaana\n    'Todr', // Todhri\n    'Yezi', // Yezidi\n];\n\nconst rtlScriptRegExp = sanitizedRegExpFromScriptCodes(rtlScriptCodes);\n\nexport function charInRTLScript(char: number) {\n    return rtlScriptRegExp.test(String.fromCodePoint(char));\n}\n\nexport function charInSupportedScript(char: number, canRenderRTL: boolean) {\n    // This is a rough heuristic: whether we \"can render\" a script\n    // actually depends on the properties of the font being used\n    // and whether differences from the ideal rendering are considered\n    // semantically significant.\n\n    // Even in Latin script, we \"can't render\" combinations such as the fi\n    // ligature, but we don't consider that semantically significant.\n    if (!canRenderRTL && charInRTLScript(char)) {\n        return false;\n    }\n    if (codePointRequiresComplexTextShaping(char)) {\n        return false;\n    }\n    return true;\n}\n\nexport function stringContainsRTLText(chars: string): boolean {\n    for (const char of chars) {\n        if (charInRTLScript(char.codePointAt(0))) {\n            return true;\n        }\n    }\n    return false;\n}\n\nexport function isStringInSupportedScript(chars: string, canRenderRTL: boolean) {\n    for (const char of chars) {\n        if (!charInSupportedScript(char.codePointAt(0), canRenderRTL)) {\n            return false;\n        }\n    }\n    return true;\n}\n","import {type PluginState, type RTLPluginStatus} from './rtl_text_plugin_status';\n\nexport interface RTLTextPlugin {\n    applyArabicShaping: (a: string) => string;\n    processBidirectionalText: ((b: string, a: Array<number>) => Array<string>);\n    processStyledBidirectionalText: ((c: string, b: Array<number>, a: Array<number>) => Array<[string, Array<number>]>);\n}\n\nclass RTLWorkerPlugin implements RTLTextPlugin {\n    readonly TIMEOUT = 5000;\n\n    applyArabicShaping: (a: string) => string = null;\n    processBidirectionalText: ((b: string, a: Array<number>) => Array<string>) = null;\n    processStyledBidirectionalText: ((c: string, b: Array<number>, a: Array<number>) => Array<[string, Array<number>]>) = null;\n    pluginStatus: RTLPluginStatus = 'unavailable';\n    pluginURL: string = null;\n    loadScriptResolve: () => void = () => {};\n\n    private setState(state: PluginState) {\n        this.pluginStatus = state.pluginStatus;\n        this.pluginURL = state.pluginURL;\n    }\n\n    private getState(): PluginState {\n        return {\n            pluginStatus: this.pluginStatus,\n            pluginURL: this.pluginURL\n        };\n    }\n\n    public setMethods(rtlTextPlugin: RTLTextPlugin) {\n        if (rtlWorkerPlugin.isParsed()) {\n            throw new Error('RTL text plugin already registered.');\n        }\n        this.applyArabicShaping = rtlTextPlugin.applyArabicShaping;\n        this.processBidirectionalText = rtlTextPlugin.processBidirectionalText;\n        this.processStyledBidirectionalText = rtlTextPlugin.processStyledBidirectionalText;\n        this.loadScriptResolve();\n    }\n\n    public isParsed(): boolean {\n        return this.applyArabicShaping != null &&\n            this.processBidirectionalText != null &&\n            this.processStyledBidirectionalText != null;\n    }\n\n    public getRTLTextPluginStatus() {\n        return this.pluginStatus;\n    }\n\n    public async syncState(incomingState: PluginState, importScripts: (url: string) => void): Promise<PluginState> {\n        // Parsed plugin cannot be changed, so just return its current state.\n        if (this.isParsed()) {\n            return this.getState();\n        }\n\n        if (incomingState.pluginStatus !== 'loading') {\n            // simply sync and done\n            this.setState(incomingState);\n            return incomingState;\n        }\n        const urlToLoad = incomingState.pluginURL;\n        const loadScriptPromise = new Promise<void>((resolve) => {\n            this.loadScriptResolve = resolve;\n        });\n        importScripts(urlToLoad);\n        const dontWaitForeverTimeoutPromise = new Promise<void>((resolve) => setTimeout(() => resolve(), this.TIMEOUT));\n        await Promise.race([loadScriptPromise, dontWaitForeverTimeoutPromise]);\n        const complete = this.isParsed();\n        if (complete) {\n            const loadedState: PluginState = {\n                pluginStatus: 'loaded',\n                pluginURL: urlToLoad\n            };\n            this.setState(loadedState);\n            return loadedState;\n        }\n\n        // error case\n        this.setState({\n            pluginStatus: 'error',\n            pluginURL: ''\n        });\n        throw new Error(`RTL Text Plugin failed to import scripts from ${urlToLoad}`);\n    }\n}\n\nexport const rtlWorkerPlugin = new RTLWorkerPlugin();\n","import {ZoomHistory} from './zoom_history';\nimport {isStringInSupportedScript} from '../util/script_detection';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\n\nimport type {GlobalProperties, TransitionSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type CrossfadeParameters = {\n    fromScale: number;\n    toScale: number;\n    t: number;\n};\n\n/**\n * @internal\n * A parameter that can be evaluated to a value.\n * It's main purpose is a parameter to expression `evaluate` methods.\n */\nexport class EvaluationParameters implements GlobalProperties {\n    zoom: number;\n    now: number;\n    fadeDuration: number;\n    zoomHistory: ZoomHistory;\n    transition: TransitionSpecification;\n    // has to be an own property of an object to be used in expressions\n    // if defined as class method, it'll hidden from operations\n    // that iterate over own enumerable properties\n    // (i..e spread operator (...), Object.keys(), for...in statement, etc.)\n    isSupportedScript: (_: string) => boolean = isSupportedScript;\n\n    // \"options\" may also be another EvaluationParameters to copy, see CrossFadedProperty.possiblyEvaluate\n    constructor(zoom: number, options?: any) {\n        this.zoom = zoom;\n\n        if (options) {\n            this.now = options.now || 0;\n            this.fadeDuration = options.fadeDuration || 0;\n            this.zoomHistory = options.zoomHistory || new ZoomHistory();\n            this.transition = options.transition || {};\n        } else {\n            this.now = 0;\n            this.fadeDuration = 0;\n            this.zoomHistory = new ZoomHistory();\n            this.transition = {};\n        }\n    }\n\n    crossFadingFactor() {\n        if (this.fadeDuration === 0) {\n            return 1;\n        } else {\n            return Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1);\n        }\n    }\n\n    getCrossfadeParameters(): CrossfadeParameters {\n        const z = this.zoom;\n        const fraction = z - Math.floor(z);\n        const t = this.crossFadingFactor();\n\n        return z > this.zoomHistory.lastIntegerZoom ?\n            {fromScale: 2, toScale: 1, t: fraction + (1 - fraction) * t} :\n            {fromScale: 0.5, toScale: 1, t: 1 - (1 - t) * fraction};\n    }\n}\n\nfunction isSupportedScript(str: string): boolean {\n    return isStringInSupportedScript(str, rtlWorkerPlugin.getRTLTextPluginStatus() === 'loaded');\n}\n","import {clone, extend, easeCubicInOut} from '../util/util';\nimport {interpolates, type Color, type StylePropertySpecification, normalizePropertyExpression,\n    type Feature,\n    type FeatureState,\n    type StylePropertyExpression,\n    type SourceExpression,\n    type CompositeExpression, type TransitionSpecification,\n    type PropertyValueSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from './evaluation_parameters';\n\nimport {type CanonicalTileID} from '../tile/tile_id';\n\ntype TimePoint = number;\n\nexport const TRANSITION_SUFFIX = '-transition';\n\n/**\n * A from-to type\n */\nexport type CrossFaded<T> = {\n    to: T;\n    from: T;\n};\n\n/**\n * @internal\n *  Implementations of the `Property` interface:\n *\n *  * Hold metadata about a property that's independent of any specific value: stuff like the type of the value,\n *    the default value, etc. This comes from the style specification JSON.\n *  * Define behavior that needs to be polymorphic across different properties: \"possibly evaluating\"\n *    an input value (see below), and interpolating between two possibly-evaluted values.\n *\n *  The type `T` is the fully-evaluated value type (e.g. `number`, `string`, `Color`).\n *  The type `R` is the intermediate \"possibly evaluated\" value type. See below.\n *\n *  There are two main implementations of the interface -- one for properties that allow data-driven values,\n *  and one for properties that don't. There are a few \"special case\" implementations as well: one for properties\n *  which cross-fade between two values rather than interpolating, one for `heatmap-color` and `line-gradient`,\n *  and one for `light-position`.\n */\nexport interface Property<T, R> {\n    specification: StylePropertySpecification;\n    possiblyEvaluate(\n        value: PropertyValue<T, R>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): R;\n    interpolate(a: R, b: R, t: number): R;\n}\n\n/**\n * @internal\n *  `PropertyValue` represents the value part of a property key-value unit. It's used to represent both\n *  paint and layout property values, and regardless of whether or not their property supports data-driven\n *  expressions.\n *\n *  `PropertyValue` stores the raw input value as seen in a style or a runtime styling API call, i.e. one of the\n *  following:\n *\n *    * A constant value of the type appropriate for the property\n *    * A function which produces a value of that type (but functions are quasi-deprecated in favor of expressions)\n *    * An expression which produces a value of that type\n *    * \"undefined\"/\"not present\", in which case the property is assumed to take on its default value.\n *\n *  In addition to storing the original input value, `PropertyValue` also stores a normalized representation,\n *  effectively treating functions as if they are expressions, and constant or default values as if they are\n *  (constant) expressions.\n */\nexport class PropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValueSpecification<T> | void;\n    expression: StylePropertyExpression;\n\n    constructor(property: Property<T, R>, value: PropertyValueSpecification<T> | void, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = value;\n        this.expression = normalizePropertyExpression(value === undefined ? property.specification.default : value, property.specification, globalState);\n    }\n\n    isDataDriven(): boolean {\n        return this.expression.kind === 'source' || this.expression.kind === 'composite';\n    }\n\n    getGlobalStateRefs(): Set<string> {\n        return this.expression.globalStateRefs || new Set<string>();\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): R {\n        return this.property.possiblyEvaluate(this, parameters, canonical, availableImages);\n    }\n}\n\nexport type TransitionParameters = {\n    now: TimePoint;\n    transition: TransitionSpecification;\n};\n\n/**\n * @internal\n * Paint properties are _transitionable_: they can change in a fluid manner, interpolating or cross-fading between\n * old and new value. The duration of the transition, and the delay before it begins, is configurable.\n *\n * `TransitionablePropertyValue` is a compositional class that stores both the property value and that transition\n * configuration.\n *\n * A `TransitionablePropertyValue` can calculate the next step in the evaluation chain for paint property values:\n * `TransitioningPropertyValue`.\n */\nclass TransitionablePropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValue<T, R>;\n    transition: TransitionSpecification | void;\n\n    constructor(property: Property<T, R>, globalState: Record<string, any>) {\n        this.property = property;\n        this.value = new PropertyValue(property, undefined, globalState);\n    }\n\n    transitioned(parameters: TransitionParameters, prior: TransitioningPropertyValue<T, R>): TransitioningPropertyValue<T, R> {\n        return new TransitioningPropertyValue(this.property, this.value, prior,\n            extend({}, parameters.transition, this.transition), parameters.now);\n    }\n\n    untransitioned(): TransitioningPropertyValue<T, R> {\n        return new TransitioningPropertyValue(this.property, this.value, null, {}, 0);\n    }\n}\n\n/**\n * @internal\n * `Transitionable` stores a map of all (property name, `TransitionablePropertyValue`) pairs for paint properties of a\n * given layer type. It can calculate the `TransitioningPropertyValue`s for all of them at once, producing a\n * `Transitioning` instance for the same set of properties.\n */\nexport class Transitionable<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: TransitionablePropertyValue<any, unknown>};\n    private _globalState: Record<string, any>;\n\n    constructor(properties: Properties<Props>, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitionablePropertyValues) as any);\n        this._globalState = globalState;\n    }\n\n    getValue<S extends keyof Props, T>(name: S): PropertyValueSpecification<T> | void {\n        return clone(this._values[name].value.value);\n    }\n\n    setValue<S extends keyof Props, T>(name: S, value: PropertyValueSpecification<T> | void) {\n        if (!Object.prototype.hasOwnProperty.call(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._globalState);\n        }\n        // Note that we do not _remove_ an own property in the case where a value is being reset\n        // to the default: the transition might still be non-default.\n        this._values[name].value = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value), this._globalState);\n    }\n\n    getTransition<S extends keyof Props>(name: S): TransitionSpecification | void {\n        return clone(this._values[name].transition);\n    }\n\n    setTransition<S extends keyof Props>(name: S, value: TransitionSpecification | void) {\n        if (!Object.prototype.hasOwnProperty.call(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property, this._globalState);\n        }\n        this._values[name].transition = clone(value) || undefined;\n    }\n\n    serialize() {\n        const result: any = {};\n        for (const property of Object.keys(this._values)) {\n            const value = this.getValue(property as keyof Props);\n            if (value !== undefined) {\n                result[property] = value;\n            }\n\n            const transition = this.getTransition(property as keyof Props);\n            if (transition !== undefined) {\n                result[`${property}${TRANSITION_SUFFIX}`] = transition;\n            }\n        }\n        return result;\n    }\n\n    transitioned(parameters: TransitionParameters, prior: Transitioning<Props>): Transitioning<Props> {\n        const result = new Transitioning(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].transitioned(parameters, prior._values[property]);\n        }\n        return result;\n    }\n\n    untransitioned(): Transitioning<Props> {\n        const result = new Transitioning(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].untransitioned();\n        }\n        return result;\n    }\n}\n\n/**\n * @internal\n * `TransitioningPropertyValue` implements the first of two intermediate steps in the evaluation chain of a paint\n * property value. In this step, transitions between old and new values are handled: as long as the transition is in\n * progress, `TransitioningPropertyValue` maintains a reference to the prior value, and interpolates between it and\n * the new value based on the current time and the configured transition duration and delay. The product is the next\n * step in the evaluation chain: the \"possibly evaluated\" result type `R`. See below for more on this concept.\n */\nclass TransitioningPropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValue<T, R>;\n    prior: TransitioningPropertyValue<T, R>;\n    begin: TimePoint;\n    end: TimePoint;\n\n    constructor(property: Property<T, R>,\n        value: PropertyValue<T, R>,\n        prior: TransitioningPropertyValue<T, R>,\n        transition: TransitionSpecification,\n        now: TimePoint) {\n        this.property = property;\n        this.value = value;\n        this.begin = now + transition.delay || 0;\n        this.end = this.begin + transition.duration || 0;\n        if (property.specification.transition && (transition.delay || transition.duration)) {\n            this.prior = prior;\n        }\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical: CanonicalTileID,\n        availableImages: Array<string>\n    ): R {\n        const now = parameters.now || 0;\n        const finalValue = this.value.possiblyEvaluate(parameters, canonical, availableImages);\n        const prior = this.prior;\n        if (!prior) {\n            // No prior value.\n            return finalValue;\n        } else if (now > this.end) {\n            // Transition from prior value is now complete.\n            this.prior = null;\n            return finalValue;\n        } else if (this.value.isDataDriven()) {\n            // Transitions to data-driven properties are not supported.\n            // We snap immediately to the data-driven value so that, when we perform layout,\n            // we see the data-driven function and can use it to populate vertex buffers.\n            this.prior = null;\n            return finalValue;\n        } else if (now < this.begin) {\n            // Transition hasn't started yet.\n            return prior.possiblyEvaluate(parameters, canonical, availableImages);\n        } else {\n            // Interpolate between recursively-calculated prior value and final.\n            const t = (now - this.begin) / (this.end - this.begin);\n            return this.property.interpolate(prior.possiblyEvaluate(parameters, canonical, availableImages), finalValue, easeCubicInOut(t));\n        }\n    }\n}\n\n/**\n * @internal\n * `Transitioning` stores a map of all (property name, `TransitioningPropertyValue`) pairs for paint properties of a\n * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a\n * `PossiblyEvaluated` instance for the same set of properties.\n */\nexport class Transitioning<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>};\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitioningPropertyValues) as any);\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluated<Props, any> {\n        const result = new PossiblyEvaluated(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].possiblyEvaluate(parameters, canonical, availableImages);\n        }\n        return result;\n    }\n\n    hasTransition() {\n        for (const property of Object.keys(this._values)) {\n            if (this._values[property].prior) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n\n// ------- Layout -------\n\n/**\n * Because layout properties are not transitionable, they have a simpler representation and evaluation chain than\n * paint properties: `PropertyValue`s are possibly evaluated, producing possibly evaluated values, which are then\n * fully evaluated.\n *\n * `Layout` stores a map of all (property name, `PropertyValue`) pairs for layout properties of a\n * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a\n * `PossiblyEvaluated` instance for the same set of properties.\n */\nexport class Layout<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: PropertyValue<any, PossiblyEvaluatedPropertyValue<any>>};\n    private _globalState: Record<string, any>; // reference to global state\n\n    constructor(properties: Properties<Props>, globalState: Record<string, any>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultPropertyValues) as any);\n        this._globalState = globalState;\n    }\n\n    hasValue<S extends keyof Props>(name: S) {\n        return this._values[name].value !== undefined;\n    }\n\n    getValue<S extends keyof Props>(name: S) {\n        return clone(this._values[name].value);\n    }\n\n    setValue<S extends keyof Props>(name: S, value: any) {\n        this._values[name] = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value), this._globalState) as any;\n    }\n\n    serialize() {\n        const result: any = {};\n        for (const property of Object.keys(this._values)) {\n            const value = this.getValue(property as keyof Props);\n            if (value !== undefined) {\n                result[property] = value;\n            }\n        }\n        return result;\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluated<Props, any> {\n        const result = new PossiblyEvaluated(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].possiblyEvaluate(parameters, canonical, availableImages);\n        }\n        return result;\n    }\n}\n\n// ------- PossiblyEvaluated -------\n\n/**\n * \"Possibly evaluated value\" is an intermediate stage in the evaluation chain for both paint and layout property\n * values. The purpose of this stage is to optimize away unnecessary recalculations for data-driven properties. Code\n * which uses data-driven property values must assume that the value is dependent on feature data, and request that it\n * be evaluated for each feature. But when that property value is in fact a constant or camera function, the calculation\n * will not actually depend on the feature, and we can benefit from returning the prior result of having done the\n * evaluation once, ahead of time, in an intermediate step whose inputs are just the value and \"global\" parameters\n * such as current zoom level.\n *\n * `PossiblyEvaluatedValue` represents the three possible outcomes of this step: if the input value was a constant or\n * camera expression, then the \"possibly evaluated\" result is a constant value. Otherwise, the input value was either\n * a source or composite expression, and we must defer final evaluation until supplied a feature. We separate\n * the source and composite cases because they are handled differently when generating GL attributes, buffers, and\n * uniforms.\n *\n * Note that `PossiblyEvaluatedValue` (and `PossiblyEvaluatedPropertyValue`, below) are _not_ used for properties that\n * do not allow data-driven values. For such properties, we know that the \"possibly evaluated\" result is always a constant\n * scalar value. See below.\n */\ntype PossiblyEvaluatedValue<T> = {\n    kind: 'constant';\n    value: T;\n} | SourceExpression | CompositeExpression;\n\n/**\n * @internal\n * `PossiblyEvaluatedPropertyValue` is used for data-driven paint and layout property values. It holds a\n * `PossiblyEvaluatedValue` and the `GlobalProperties` that were used to generate it. You're not allowed to supply\n * a different set of `GlobalProperties` when performing the final evaluation because they would be ignored in the\n * case where the input value was a constant or camera function.\n */\nexport class PossiblyEvaluatedPropertyValue<T> {\n    property: DataDrivenProperty<T>;\n    value: PossiblyEvaluatedValue<T>;\n    parameters: EvaluationParameters;\n\n    constructor(property: DataDrivenProperty<T>, value: PossiblyEvaluatedValue<T>, parameters: EvaluationParameters) {\n        this.property = property;\n        this.value = value;\n        this.parameters = parameters;\n    }\n\n    isConstant(): boolean {\n        return this.value.kind === 'constant';\n    }\n\n    constantOr(value: T): T {\n        if (this.value.kind === 'constant') {\n            return this.value.value;\n        } else {\n            return value;\n        }\n    }\n\n    evaluate(\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): T {\n        return this.property.evaluate(this.value, this.parameters, feature, featureState, canonical, availableImages);\n    }\n}\n\n/**\n * @internal\n * `PossiblyEvaluated` stores a map of all (property name, `R`) pairs for paint or layout properties of a\n * given layer type.\n */\nexport class PossiblyEvaluated<Props, PossibleEvaluatedProps> {\n    _properties: Properties<Props>;\n    _values: PossibleEvaluatedProps;\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = Object.create(properties.defaultPossiblyEvaluatedValues);\n    }\n\n    get<S extends keyof PossibleEvaluatedProps>(name: S): PossibleEvaluatedProps[S] {\n        return this._values[name];\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for properties that do not permit data-driven (source or composite) expressions.\n * This restriction allows us to declare statically that the result of possibly evaluating this kind of property\n * is in fact always the scalar type `T`, and can be used without further evaluating the value on a per-feature basis.\n */\nexport class DataConstantProperty<T> implements Property<T, T> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(value: PropertyValue<T, T>, parameters: EvaluationParameters): T {\n        if (value.isDataDriven()) throw new Error('Value should not be data driven');\n        return value.expression.evaluate(parameters);\n    }\n\n    interpolate(a: T, b: T, t: number): T {\n        const interpolationType = this.specification.type as keyof typeof interpolates;\n        const interpolationFn = interpolates[interpolationType] as ((from: T, to: T, t: number) => T) | undefined;\n        if (interpolationFn) {\n            return interpolationFn(a, b, t);\n        } else {\n            return a;\n        }\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for properties that permit data-driven (source or composite) expressions.\n * The result of possibly evaluating this kind of property is `PossiblyEvaluatedPropertyValue<T>`; obtaining\n * a scalar value `T` requires further evaluation on a per-feature basis.\n */\nexport class DataDrivenProperty<T> implements Property<T, PossiblyEvaluatedPropertyValue<T>> {\n    specification: StylePropertySpecification;\n    overrides: any;\n\n    constructor(specification: StylePropertySpecification, overrides?: any) {\n        this.specification = specification;\n        this.overrides = overrides;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<T, PossiblyEvaluatedPropertyValue<T>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluatedPropertyValue<T> {\n        if (value.expression.kind === 'constant' || value.expression.kind === 'camera') {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: value.expression.evaluate(parameters, null, {}, canonical, availableImages)}, parameters);\n        } else {\n            return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);\n        }\n    }\n\n    interpolate(\n        a: PossiblyEvaluatedPropertyValue<T>,\n        b: PossiblyEvaluatedPropertyValue<T>,\n        t: number\n    ): PossiblyEvaluatedPropertyValue<T> {\n        // If either possibly-evaluated value is non-constant, give up: we aren't able to interpolate data-driven values.\n        if (a.value.kind !== 'constant' || b.value.kind !== 'constant') {\n            return a;\n        }\n\n        // Special case hack solely for fill-outline-color. The undefined value is subsequently handled in\n        // FillStyleLayer.recalculate, which sets fill-outline-color to the fill-color value if the former\n        // is a PossiblyEvaluatedPropertyValue containing a constant undefined value. In addition to the\n        // return value here, the other source of a PossiblyEvaluatedPropertyValue containing a constant\n        // undefined value is the \"default value\" for fill-outline-color held in\n        // `Properties.defaultPossiblyEvaluatedValues`, which serves as the prototype of\n        // `PossiblyEvaluated._values`.\n        if (a.value.value === undefined || b.value.value === undefined) {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: undefined}, a.parameters);\n        }\n\n        const interpolationType = this.specification.type as keyof typeof interpolates;\n        const interpolationFn = interpolates[interpolationType] as ((from: T, to: T, t: number) => T) | undefined;\n        if (interpolationFn) {\n            const interpolatedValue = interpolationFn(a.value.value, b.value.value, t);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: interpolatedValue}, a.parameters);\n        } else {\n            return a;\n        }\n    }\n\n    evaluate(\n        value: PossiblyEvaluatedValue<T>,\n        parameters: EvaluationParameters,\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): T {\n        if (value.kind === 'constant') {\n            return value.value;\n        } else {\n            return value.evaluate(parameters, feature, featureState, canonical, availableImages);\n        }\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for  data driven `line-pattern` which are transitioned by cross-fading\n * rather than interpolation.\n */\n\nexport class CrossFadedDataDrivenProperty<T> extends DataDrivenProperty<CrossFaded<T>> {\n\n    possiblyEvaluate(\n        value: PropertyValue<CrossFaded<T>, PossiblyEvaluatedPropertyValue<CrossFaded<T>>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluatedPropertyValue<CrossFaded<T>> {\n        if (value.value === undefined) {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: undefined}, parameters);\n        } else if (value.expression.kind === 'constant') {\n            const evaluatedValue = value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n            const isImageExpression = value.property.specification.type as any === 'resolvedImage';\n            const constantValue = isImageExpression && typeof evaluatedValue !== 'string' ? evaluatedValue.name : evaluatedValue;\n            const constant = this._calculate(constantValue, constantValue, constantValue, parameters);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: constant}, parameters);\n        } else if (value.expression.kind === 'camera') {\n            const cameraVal = this._calculate(\n                value.expression.evaluate({zoom: parameters.zoom - 1.0}),\n                value.expression.evaluate({zoom: parameters.zoom}),\n                value.expression.evaluate({zoom: parameters.zoom + 1.0}),\n                parameters);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: cameraVal}, parameters);\n        } else {\n            // source or composite expression\n            return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);\n        }\n    }\n\n    evaluate(\n        value: PossiblyEvaluatedValue<CrossFaded<T>>,\n        globals: EvaluationParameters,\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): CrossFaded<T> {\n        if (value.kind === 'source') {\n            const constant = value.evaluate(globals, feature, featureState, canonical, availableImages);\n            return this._calculate(constant, constant, constant, globals);\n        } else if (value.kind === 'composite') {\n            return this._calculate(\n                value.evaluate({zoom: Math.floor(globals.zoom) - 1.0}, feature, featureState),\n                value.evaluate({zoom: Math.floor(globals.zoom)}, feature, featureState),\n                value.evaluate({zoom: Math.floor(globals.zoom) + 1.0}, feature, featureState),\n                globals);\n        } else {\n            return value.value;\n        }\n    }\n\n    _calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T> {\n        const z = parameters.zoom;\n        return z > parameters.zoomHistory.lastIntegerZoom ? {from: min, to: mid} : {from: max, to: mid};\n    }\n\n    interpolate(a: PossiblyEvaluatedPropertyValue<CrossFaded<T>>): PossiblyEvaluatedPropertyValue<CrossFaded<T>> {\n        return a;\n    }\n}\n/**\n * @internal\n * An implementation of `Property` for `*-pattern` and `line-dasharray`, which are transitioned by cross-fading\n * rather than interpolation.\n */\nexport class CrossFadedProperty<T> implements Property<T, CrossFaded<T>> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<T, CrossFaded<T>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): CrossFaded<T> {\n        if (value.value === undefined) {\n            return undefined;\n        } else if (value.expression.kind === 'constant') {\n            const constant = value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n            return this._calculate(constant, constant, constant, parameters);\n        } else {\n            return this._calculate(\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom - 1.0), parameters)),\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom), parameters)),\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom + 1.0), parameters)),\n                parameters);\n        }\n    }\n\n    _calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T> {\n        const z = parameters.zoom;\n        return z > parameters.zoomHistory.lastIntegerZoom ? {from: min, to: mid} : {from: max, to: mid};\n    }\n\n    interpolate(a?: CrossFaded<T> | null): CrossFaded<T> {\n        return a;\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for `heatmap-color` and `line-gradient`. Interpolation is a no-op, and\n * evaluation returns a boolean value in order to indicate its presence, but the real\n * evaluation happens in StyleLayer classes.\n */\n\nexport class ColorRampProperty implements Property<Color, boolean> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<Color, boolean>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): boolean {\n        return !!value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n    }\n\n    interpolate(): boolean { return false; }\n}\n\n/**\n * @internal\n * `Properties` holds objects containing default values for the layout or paint property set of a given\n * layer type. These objects are immutable, and they are used as the prototypes for the `_values` members of\n * `Transitionable`, `Transitioning`, `Layout`, and `PossiblyEvaluated`. This allows these classes to avoid\n * doing work in the common case where a property has no explicit value set and should be considered to take\n * on the default value: using `for (const property of Object.keys(this._values))`, they can iterate over\n * only the _own_ properties of `_values`, skipping repeated calculation of transitions and possible/final\n * evaluations for defaults, the result of which will always be the same.\n */\nexport class Properties<Props> {\n    properties: Props;\n    defaultPropertyValues: {[K in keyof Props]: PropertyValue<unknown, any>};\n    defaultTransitionablePropertyValues: {[K in keyof Props]: TransitionablePropertyValue<unknown, unknown>};\n    defaultTransitioningPropertyValues: {[K in keyof Props]: TransitioningPropertyValue<unknown, unknown>};\n    defaultPossiblyEvaluatedValues: {[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>};\n    overridableProperties: Array<string>;\n\n    constructor(properties: Props) {\n        this.properties = properties;\n        this.defaultPropertyValues = ({} as any);\n        this.defaultTransitionablePropertyValues = ({} as any);\n        this.defaultTransitioningPropertyValues = ({} as any);\n        this.defaultPossiblyEvaluatedValues = ({} as any);\n        this.overridableProperties = ([] as any);\n\n        for (const property in properties) {\n            const prop = properties[property] as any;\n            if (prop.specification.overridable) {\n                this.overridableProperties.push(property);\n            }\n            const defaultPropertyValue = this.defaultPropertyValues[property] =\n                new PropertyValue(prop, undefined, undefined);\n            const defaultTransitionablePropertyValue = this.defaultTransitionablePropertyValues[property] =\n                new TransitionablePropertyValue(prop, undefined);\n            this.defaultTransitioningPropertyValues[property] =\n                defaultTransitionablePropertyValue.untransitioned();\n            this.defaultPossiblyEvaluatedValues[property] =\n                defaultPropertyValue.possiblyEvaluate({} as any);\n        }\n    }\n}\n\nregister('DataDrivenProperty', DataDrivenProperty);\nregister('DataConstantProperty', DataConstantProperty);\nregister('CrossFadedDataDrivenProperty', CrossFadedDataDrivenProperty);\nregister('CrossFadedProperty', CrossFadedProperty);\nregister('ColorRampProperty', ColorRampProperty);\n","import {filterObject} from '../util/util';\n\nimport {createVisibilityExpression, featureFilter, latest as styleSpec, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {\n    validateStyle,\n    validateLayoutProperty,\n    validatePaintProperty,\n    emitValidationErrors\n} from './validate_style';\nimport {Evented} from '../util/evented';\nimport {Layout, Transitionable, type Transitioning, type Properties, PossiblyEvaluated, PossiblyEvaluatedPropertyValue, TRANSITION_SUFFIX} from './properties';\n\nimport type {Bucket, BucketParameters} from '../data/bucket';\nimport type Point from '@mapbox/point-geometry';\nimport type {\n    FeatureFilter,\n    FeatureState,\n    LayerSpecification,\n    FilterSpecification,\n    VisibilitySpecification,\n    VisibilityExpression\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {TransitionParameters, PropertyValue} from './properties';\nimport {type EvaluationParameters} from './evaluation_parameters';\nimport type {CrossfadeParameters} from './evaluation_parameters';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer';\nimport type {Map} from '../ui/map';\nimport type {StyleSetterOptions} from './style';\nimport {type mat4} from 'gl-matrix';\nimport type {UnwrappedTileID} from '../tile/tile_id';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\nexport type QueryIntersectsFeatureParams = {\n    /**\n     * The geometry to check intersection with.\n     * This geometry is in tile coordinates.\n     */\n    queryGeometry: Array<Point>;\n    /**\n     * The feature to allow expression evaluation.\n     */\n    feature: VectorTileFeatureLike;\n    /**\n     * The feature state to allow expression evaluation.\n     */\n    featureState: FeatureState;\n    /**\n     * The geometry of the feature.\n     * This geometry is in tile coordinates.\n     */\n    geometry: Array<Array<Point>>;\n    /**\n     * The current zoom level.\n     */\n    zoom: number;\n    /**\n     * The transform to convert from tile coordinates to pixels.\n     */\n    transform: IReadonlyTransform;\n    /**\n     * The number of pixels per tile unit.\n     */\n    pixelsToTileUnits: number;\n    /**\n     * The matrix to convert from tile coordinates to pixel coordinates.\n     * The pixel coordinates are relative to the center of the screen.\n     */\n    pixelPosMatrix: mat4;\n    /**\n     * The unwrapped tile ID for the tile being queried.\n     */\n    unwrappedTileID: UnwrappedTileID;\n    /**\n     * A function to get the elevation of a point in tile coordinates.\n     */\n    getElevation: undefined | ((x: number, y: number) => number);\n};\n\n/**\n * A base class for style layers\n */\nexport abstract class StyleLayer extends Evented {\n    id: string;\n    metadata: unknown;\n    type: LayerSpecification['type'] | CustomLayerInterface['type'];\n    source: string;\n    sourceLayer: string;\n    minzoom: number;\n    maxzoom: number;\n    filter: FilterSpecification | void;\n    visibility: VisibilitySpecification;\n    private _evaluatedVisibility: 'visible' | 'none' | void;\n\n    _crossfadeParameters: CrossfadeParameters;\n\n    _unevaluatedLayout: Layout<any>;\n    readonly layout: unknown;\n\n    _transitionablePaint: Transitionable<any>;\n    _transitioningPaint: Transitioning<any>;\n    readonly paint: unknown;\n\n    _featureFilter: FeatureFilter;\n\n    _visibilityExpression: VisibilityExpression;\n\n    readonly onAdd: ((map: Map) => void);\n    readonly onRemove: ((map: Map) => void);\n\n    queryRadius?(bucket: Bucket): number;\n    queryIntersectsFeature?(params: QueryIntersectsFeatureParams): boolean | number;\n    createBucket?(parameters: BucketParameters<any>): Bucket;\n\n    private _globalState: Record<string, any>; // reference to global state\n\n    constructor(layer: LayerSpecification | CustomLayerInterface, properties: Readonly<{\n        layout?: Properties<any>;\n        paint?: Properties<any>;\n    }>, globalState: Record<string, any>) {\n        super();\n\n        this.id = layer.id;\n        this.type = layer.type;\n        this._globalState = globalState;\n        this._featureFilter = {filter: () => true, needGeometry: false, getGlobalStateRefs: () => new Set<string>()};\n        this._visibilityExpression = createVisibilityExpression(this.visibility, globalState);\n\n        if (layer.type === 'custom') return;\n\n        layer = (layer as any as LayerSpecification);\n\n        this.metadata = layer.metadata;\n        this.minzoom = layer.minzoom;\n        this.maxzoom = layer.maxzoom;\n\n        if (layer.type !== 'background') {\n            this.source = layer.source;\n            this.sourceLayer = layer['source-layer'];\n            this.filter = layer.filter;\n            this._featureFilter = featureFilter(layer.filter, globalState);\n        }\n\n        if (properties.layout) {\n            this._unevaluatedLayout = new Layout(properties.layout, globalState);\n        }\n\n        if (properties.paint) {\n            this._transitionablePaint = new Transitionable(properties.paint, globalState);\n\n            for (const property in layer.paint) {\n                this.setPaintProperty(property, layer.paint[property], {validate: false});\n            }\n            for (const property in layer.layout) {\n                this.setLayoutProperty(property, layer.layout[property], {validate: false});\n            }\n\n            this._transitioningPaint = this._transitionablePaint.untransitioned();\n            //$FlowFixMe\n            this.paint = new PossiblyEvaluated(properties.paint);\n        }\n    }\n\n    setFilter(filter: FilterSpecification | void) {\n        this.filter = filter;\n        this._featureFilter = featureFilter(filter, this._globalState);\n    }\n\n    getCrossfadeParameters() {\n        return this._crossfadeParameters;\n    }\n\n    getLayoutProperty(name: string) {\n        if (name === 'visibility') {\n            return this.visibility;\n        }\n\n        return this._unevaluatedLayout.getValue(name);\n    }\n\n    /**\n     * Get list of global state references that are used within layout or filter properties.\n     * This is used to determine if layer source need to be reloaded when global state property changes.\n     *\n     */\n    getLayoutAffectingGlobalStateRefs(): Set<string> {\n        const globalStateRefs = new Set<string>();\n\n        for (const globalStateRef of this._visibilityExpression.getGlobalStateRefs()) {\n            globalStateRefs.add(globalStateRef);\n        }\n\n        if (this._unevaluatedLayout) {\n            for (const propertyName in this._unevaluatedLayout._values) {\n                const value = this._unevaluatedLayout._values[propertyName];\n\n                for (const globalStateRef of value.getGlobalStateRefs()) {\n                    globalStateRefs.add(globalStateRef);\n                }\n            }\n        }\n\n        for (const globalStateRef of this._featureFilter.getGlobalStateRefs()) {\n            globalStateRefs.add(globalStateRef);\n        }\n\n        return globalStateRefs;\n    }\n\n    /**\n     * Get list of global state references that are used within paint properties.\n     * This is used to determine if layer needs to be repainted when global state property changes.\n     *\n     */\n    getPaintAffectingGlobalStateRefs(): globalThis.Map<string, Array<{name: string; value: any}>> {\n        const globalStateRefs = new globalThis.Map<string, Array<{name: string; value: any}>>();\n\n        if (this._transitionablePaint) {\n            for (const propertyName in this._transitionablePaint._values) {\n                const value = this._transitionablePaint._values[propertyName].value;\n\n                for (const globalStateRef of value.getGlobalStateRefs()) {\n                    const properties = globalStateRefs.get(globalStateRef) ?? [];\n                    properties.push({name: propertyName, value: value.value});\n                    globalStateRefs.set(globalStateRef, properties);\n                }\n            }\n        }\n\n        return globalStateRefs;\n    }\n\n    /**\n     * Get list of global state references that are used within visibility expression.\n     * This is used to determine if layer visibility needs to be updated when global state property changes.\n     */\n    getVisibilityAffectingGlobalStateRefs() {\n        return this._visibilityExpression.getGlobalStateRefs();\n    }\n\n    setLayoutProperty(name: string, value: any, options: StyleSetterOptions = {}) {\n        if (value !== null && value !== undefined) {\n            const key = `layers.${this.id}.layout.${name}`;\n            if (this._validate(validateLayoutProperty, key, name, value, options)) {\n                return;\n            }\n        }\n\n        if (name === 'visibility') {\n            this.visibility = value;\n            this._visibilityExpression.setValue(value);\n            this.recalculateVisibility();\n            return;\n        }\n\n        this._unevaluatedLayout.setValue(name, value);\n    }\n\n    getPaintProperty(name: string) {\n        if (name.endsWith(TRANSITION_SUFFIX)) {\n            return this._transitionablePaint.getTransition(name.slice(0, -TRANSITION_SUFFIX.length));\n        } else {\n            return this._transitionablePaint.getValue(name);\n        }\n    }\n\n    setPaintProperty(name: string, value: unknown, options: StyleSetterOptions = {}) {\n        if (value !== null && value !== undefined) {\n            const key = `layers.${this.id}.paint.${name}`;\n            if (this._validate(validatePaintProperty, key, name, value, options)) {\n                return false;\n            }\n        }\n\n        if (name.endsWith(TRANSITION_SUFFIX)) {\n            this._transitionablePaint.setTransition(name.slice(0, -TRANSITION_SUFFIX.length), (value as any) || undefined);\n            return false;\n        } else {\n            const transitionable = this._transitionablePaint._values[name];\n            const isCrossFadedProperty = transitionable.property.specification['property-type'] === 'cross-faded-data-driven';\n            const wasDataDriven = transitionable.value.isDataDriven();\n            const oldValue = transitionable.value;\n\n            this._transitionablePaint.setValue(name, value);\n            this._handleSpecialPaintPropertyUpdate(name);\n\n            const newValue = this._transitionablePaint._values[name].value;\n            const isDataDriven = newValue.isDataDriven();\n\n            // if a cross-faded value is changed, we need to make sure the new icons get added to each tile's iconAtlas\n            // so a call to _updateLayer is necessary, and we return true from this function so it gets called in\n            // Style.setPaintProperty\n            return isDataDriven || wasDataDriven || isCrossFadedProperty || this._handleOverridablePaintPropertyUpdate(name, oldValue, newValue);\n        }\n    }\n\n    _handleSpecialPaintPropertyUpdate(_: string) {\n        // No-op; can be overridden by derived classes.\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean {\n        // No-op; can be overridden by derived classes.\n        return false;\n    }\n\n    isHidden(zoom: number = this.minzoom, roundMinZoom: boolean = false) {\n        if (this.minzoom && zoom < (roundMinZoom ? Math.floor(this.minzoom) : this.minzoom)) return true;\n        if (this.maxzoom && zoom >= this.maxzoom) return true;\n        return this._evaluatedVisibility === 'none';\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioningPaint = this._transitionablePaint.transitioned(parameters, this._transitioningPaint);\n    }\n\n    hasTransition() {\n        return this._transitioningPaint.hasTransition();\n    }\n\n    recalculateVisibility() {\n        this._evaluatedVisibility = this._visibilityExpression.evaluate();\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        if (parameters.getCrossfadeParameters) {\n            this._crossfadeParameters = parameters.getCrossfadeParameters();\n        }\n\n        if (this._unevaluatedLayout) {\n            (this as any).layout = this._unevaluatedLayout.possiblyEvaluate(parameters, undefined, availableImages);\n        }\n\n        (this as any).paint = this._transitioningPaint.possiblyEvaluate(parameters, undefined, availableImages);\n    }\n\n    serialize(): LayerSpecification {\n        const output: LayerSpecification = {\n            'id': this.id,\n            'type': this.type as LayerSpecification['type'],\n            'source': this.source,\n            'source-layer': this.sourceLayer,\n            'metadata': this.metadata,\n            'minzoom': this.minzoom,\n            'maxzoom': this.maxzoom,\n            'filter': this.filter as FilterSpecification,\n            'layout': this._unevaluatedLayout && this._unevaluatedLayout.serialize(),\n            'paint': this._transitionablePaint && this._transitionablePaint.serialize()\n        };\n\n        if (this.visibility) {\n            output.layout = output.layout || {};\n            output.layout.visibility = this.visibility;\n        }\n\n        return filterObject(output, (value, key) => {\n            return value !== undefined &&\n                !(key === 'layout' && !Object.keys(value).length) &&\n                !(key === 'paint' && !Object.keys(value).length);\n        });\n    }\n\n    _validate(validate: Function, key: string, name: string, value: unknown, options: StyleSetterOptions = {}) {\n        if (options && options.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, {\n            key,\n            layerType: this.type,\n            objectKey: name,\n            value,\n            styleSpec,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true}\n        }));\n    }\n\n    is3D() {\n        return false;\n    }\n\n    isTileClipped() {\n        return false;\n    }\n\n    hasOffscreenPass() {\n        return false;\n    }\n\n    resize() {\n        // noop\n    }\n\n    isStateDependent() {\n        for (const property in (this as any).paint._values) {\n            const value = (this as any).paint.get(property);\n            if (!(value instanceof PossiblyEvaluatedPropertyValue) || !supportsPropertyExpression(value.property.specification)) {\n                continue;\n            }\n\n            if ((value.value.kind === 'source' || value.value.kind === 'composite') &&\n                value.value.isStateDependent) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n","// Note: all \"sizes\" are measured in bytes\n\n/**\n * @internal\n * A view type size\n */\nconst viewTypes = {\n    'Int8': Int8Array,\n    'Uint8': Uint8Array,\n    'Int16': Int16Array,\n    'Uint16': Uint16Array,\n    'Int32': Int32Array,\n    'Uint32': Uint32Array,\n    'Float32': Float32Array\n};\n\n/**\n * @internal\n * A view type size\n */\nexport type ViewType = keyof typeof viewTypes;\n\n/** @internal */\nclass Struct {\n    _pos1: number;\n    _pos2: number;\n    _pos4: number;\n    _pos8: number;\n    readonly _structArray: StructArray;\n\n    // The following properties are defined on the prototype of sub classes.\n    size: number;\n\n    /**\n     * @param structArray - The StructArray the struct is stored in\n     * @param index - The index of the struct in the StructArray.\n     */\n    constructor(structArray: StructArray, index: number) {\n        (this as any)._structArray = structArray;\n        this._pos1 = index * this.size;\n        this._pos2 = this._pos1 / 2;\n        this._pos4 = this._pos1 / 4;\n        this._pos8 = this._pos1 / 8;\n    }\n}\n\nconst DEFAULT_CAPACITY = 128;\nconst RESIZE_MULTIPLIER = 5;\n\n/**\n * @internal\n * A struct array member\n */\nexport type StructArrayMember = {\n    name: string;\n    type: ViewType;\n    components: number;\n    offset: number;\n};\n\nexport type StructArrayLayout = {\n    members: Array<StructArrayMember>;\n    size: number;\n    alignment: number;\n};\n\n/**\n * An array that can be deserialized\n */\nexport type SerializedStructArray = {\n    length: number;\n    arrayBuffer: ArrayBuffer;\n};\n\n/**\n * @internal\n * `StructArray` provides an abstraction over `ArrayBuffer` and `TypedArray`\n * making it behave like an array of typed structs.\n *\n * Conceptually, a StructArray is comprised of elements, i.e., instances of its\n * associated struct type. Each particular struct type, together with an\n * alignment size, determines the memory layout of a StructArray whose elements\n * are of that type.  Thus, for each such layout that we need, we have\n * a corresponding StructArrayLayout class, inheriting from StructArray and\n * implementing `emplaceBack()` and `_refreshViews()`.\n *\n * In some cases, where we need to access particular elements of a StructArray,\n * we implement a more specific subclass that inherits from one of the\n * StructArrayLayouts and adds a `get(i): T` accessor that returns a structured\n * object whose properties are proxies into the underlying memory space for the\n * i-th element.  This affords the convenience of working with (seemingly) plain\n * Javascript objects without the overhead of serializing/deserializing them\n * into ArrayBuffers for efficient web worker transfer.\n */\nabstract class StructArray {\n    capacity: number;\n    length: number;\n    isTransferred: boolean;\n    arrayBuffer: ArrayBuffer;\n    uint8: Uint8Array;\n\n    // The following properties are defined on the prototype.\n    members: Array<StructArrayMember>;\n    bytesPerElement: number;\n    abstract emplaceBack(...v: number[]);\n    abstract emplace(i: number, ...v: number[]);\n\n    constructor() {\n        this.isTransferred = false;\n        this.capacity = -1;\n        this.resize(0);\n    }\n\n    /**\n     * Serialize a StructArray instance.  Serializes both the raw data and the\n     * metadata needed to reconstruct the StructArray base class during\n     * deserialization.\n     */\n    static serialize(array: StructArray, transferables?: Array<Transferable>): SerializedStructArray {\n\n        array._trim();\n\n        if (transferables) {\n            array.isTransferred = true;\n            transferables.push(array.arrayBuffer);\n        }\n\n        return {\n            length: array.length,\n            arrayBuffer: array.arrayBuffer,\n        };\n    }\n\n    static deserialize(input: SerializedStructArray) {\n        const structArray = Object.create(this.prototype);\n        structArray.arrayBuffer = input.arrayBuffer;\n        structArray.length = input.length;\n        structArray.capacity = input.arrayBuffer.byteLength / structArray.bytesPerElement;\n        structArray._refreshViews();\n        return structArray;\n    }\n\n    /**\n     * Resize the array to discard unused capacity.\n     */\n    _trim() {\n        if (this.length !== this.capacity) {\n            this.capacity = this.length;\n            this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement);\n            this._refreshViews();\n        }\n    }\n\n    /**\n     * Resets the length of the array to 0 without de-allocating capacity.\n     */\n    clear() {\n        this.length = 0;\n    }\n\n    /**\n     * Resize the array.\n     * If `n` is greater than the current length then additional elements with undefined values are added.\n     * If `n` is less than the current length then the array will be reduced to the first `n` elements.\n     * @param n - The new size of the array.\n     */\n    resize(n: number) {\n        this.reserve(n);\n        this.length = n;\n    }\n\n    /**\n     * Indicate a planned increase in size, so that any necessary allocation may\n     * be done once, ahead of time.\n     * @param n - The expected size of the array.\n     */\n    reserve(n: number) {\n        if (n > this.capacity) {\n            this.capacity = Math.max(n, Math.floor(this.capacity * RESIZE_MULTIPLIER), DEFAULT_CAPACITY);\n            this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement);\n\n            const oldUint8Array = this.uint8;\n            this._refreshViews();\n            if (oldUint8Array) this.uint8.set(oldUint8Array);\n        }\n    }\n\n    /**\n     * Create TypedArray views for the current ArrayBuffer.\n     */\n    _refreshViews() {\n        throw new Error('_refreshViews() must be implemented by each concrete StructArray layout');\n    }\n}\n\n/**\n * Given a list of member fields, create a full StructArrayLayout, in\n * particular calculating the correct byte offset for each field.  This data\n * is used at build time to generate StructArrayLayout_*.emplaceBack() and\n * other accessors, and at runtime for binding vertex buffer attributes.\n */\nfunction createLayout(\n    members: Array<{\n        name: string;\n        type: ViewType;\n        readonly components?: number;\n    }>,\n    alignment: number = 1\n): StructArrayLayout {\n\n    let offset = 0;\n    let maxSize = 0;\n    const layoutMembers = members.map((member) => {\n        const typeSize = sizeOf(member.type);\n        const memberOffset = offset = align(offset, Math.max(alignment, typeSize));\n        const components = member.components || 1;\n\n        maxSize = Math.max(maxSize, typeSize);\n        offset += typeSize * components;\n\n        return {\n            name: member.name,\n            type: member.type,\n            components,\n            offset: memberOffset,\n        };\n    });\n\n    const size = align(offset, Math.max(maxSize, alignment));\n\n    return {\n        members: layoutMembers,\n        size,\n        alignment\n    };\n}\n\nfunction sizeOf(type: ViewType): number {\n    return viewTypes[type].BYTES_PER_ELEMENT;\n}\n\nfunction align(offset: number, size: number): number {\n    return Math.ceil(offset / size) * size;\n}\n\nexport {StructArray, Struct, viewTypes, createLayout};\n","// This file is generated. Edit build/generate-struct-arrays.ts, then run `npm run codegen`.\n\nimport {Struct, StructArray} from '../util/struct_array';\nimport {register} from '../util/web_worker_transfer';\nimport Point from '@mapbox/point-geometry';\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n *\n */\nclass StructArrayLayout2i4 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o2 = i * 2;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2i4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout2i4', StructArrayLayout2i4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[3]\n *\n */\nclass StructArrayLayout3i6 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 3;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3i6.prototype.bytesPerElement = 6;\nregister('StructArrayLayout3i6', StructArrayLayout3i6);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[4]\n *\n */\nclass StructArrayLayout4i8 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number) {\n        const o2 = i * 4;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        return i;\n    }\n}\n\nStructArrayLayout4i8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout4i8', StructArrayLayout4i8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Int16[4]\n *\n */\nclass StructArrayLayout2i4i12 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 6;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i4i12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout2i4i12', StructArrayLayout2i4i12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Uint8[4]\n *\n */\nclass StructArrayLayout2i4ub8 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 4;\n        const o1 = i * 8;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.uint8[o1 + 4] = v2;\n        this.uint8[o1 + 5] = v3;\n        this.uint8[o1 + 6] = v4;\n        this.uint8[o1 + 7] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i4ub8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout2i4ub8', StructArrayLayout2i4ub8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[2]\n *\n */\nclass StructArrayLayout2f8 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o4 = i * 2;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2f8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout2f8', StructArrayLayout2f8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[10]\n *\n */\nclass StructArrayLayout10ui20 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number) {\n        const o2 = i * 10;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        this.uint16[o2 + 3] = v3;\n        this.uint16[o2 + 4] = v4;\n        this.uint16[o2 + 5] = v5;\n        this.uint16[o2 + 6] = v6;\n        this.uint16[o2 + 7] = v7;\n        this.uint16[o2 + 8] = v8;\n        this.uint16[o2 + 9] = v9;\n        return i;\n    }\n}\n\nStructArrayLayout10ui20.prototype.bytesPerElement = 20;\nregister('StructArrayLayout10ui20', StructArrayLayout10ui20);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[8]\n *\n */\nclass StructArrayLayout8ui16 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number) {\n        const o2 = i * 8;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        this.uint16[o2 + 3] = v3;\n        this.uint16[o2 + 4] = v4;\n        this.uint16[o2 + 5] = v5;\n        this.uint16[o2 + 6] = v6;\n        this.uint16[o2 + 7] = v7;\n        return i;\n    }\n}\n\nStructArrayLayout8ui16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout8ui16', StructArrayLayout8ui16);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[4]\n * [8] - Uint16[4]\n * [16] - Int16[4]\n *\n */\nclass StructArrayLayout4i4ui4i24 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number) {\n        const o2 = i * 12;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.uint16[o2 + 4] = v4;\n        this.uint16[o2 + 5] = v5;\n        this.uint16[o2 + 6] = v6;\n        this.uint16[o2 + 7] = v7;\n        this.int16[o2 + 8] = v8;\n        this.int16[o2 + 9] = v9;\n        this.int16[o2 + 10] = v10;\n        this.int16[o2 + 11] = v11;\n        return i;\n    }\n}\n\nStructArrayLayout4i4ui4i24.prototype.bytesPerElement = 24;\nregister('StructArrayLayout4i4ui4i24', StructArrayLayout4i4ui4i24);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[3]\n *\n */\nclass StructArrayLayout3f12 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o4 = i * 3;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3f12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout3f12', StructArrayLayout3f12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint32[1]\n *\n */\nclass StructArrayLayout1ul4 extends StructArray {\n    uint8: Uint8Array;\n    uint32: Uint32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o4 = i * 1;\n        this.uint32[o4 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1ul4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout1ul4', StructArrayLayout1ul4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[6]\n * [12] - Uint32[1]\n * [16] - Uint16[2]\n *\n */\nclass StructArrayLayout6i1ul2ui20 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint32: Uint32Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number) {\n        const o2 = i * 10;\n        const o4 = i * 5;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        this.uint32[o4 + 3] = v6;\n        this.uint16[o2 + 8] = v7;\n        this.uint16[o2 + 9] = v8;\n        return i;\n    }\n}\n\nStructArrayLayout6i1ul2ui20.prototype.bytesPerElement = 20;\nregister('StructArrayLayout6i1ul2ui20', StructArrayLayout6i1ul2ui20);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Int16[2]\n * [8] - Int16[2]\n *\n */\nclass StructArrayLayout2i2i2i12 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 6;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i2i2i12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout2i2i2i12', StructArrayLayout2i2i2i12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[2]\n * [8] - Float32[1]\n * [12] - Int16[2]\n *\n */\nclass StructArrayLayout2f1f2i16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number) {\n        const o4 = i * 4;\n        const o2 = i * 8;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        this.int16[o2 + 6] = v3;\n        this.int16[o2 + 7] = v4;\n        return i;\n    }\n}\n\nStructArrayLayout2f1f2i16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout2f1f2i16', StructArrayLayout2f1f2i16);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint8[2]\n * [4] - Float32[2]\n * [12] - Int16[2]\n *\n */\nclass StructArrayLayout2ub2f2i16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o1 = i * 16;\n        const o4 = i * 4;\n        const o2 = i * 8;\n        this.uint8[o1 + 0] = v0;\n        this.uint8[o1 + 1] = v1;\n        this.float32[o4 + 1] = v2;\n        this.float32[o4 + 2] = v3;\n        this.int16[o2 + 6] = v4;\n        this.int16[o2 + 7] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2ub2f2i16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout2ub2f2i16', StructArrayLayout2ub2f2i16);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[3]\n *\n */\nclass StructArrayLayout3ui6 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 3;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3ui6.prototype.bytesPerElement = 6;\nregister('StructArrayLayout3ui6', StructArrayLayout3ui6);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Uint16[2]\n * [8] - Uint32[3]\n * [20] - Uint16[3]\n * [28] - Float32[2]\n * [36] - Uint8[3]\n * [40] - Uint32[1]\n * [44] - Int16[1]\n *\n */\nclass StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n    uint32: Uint32Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number) {\n        const o2 = i * 24;\n        const o4 = i * 12;\n        const o1 = i * 48;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        this.uint16[o2 + 3] = v3;\n        this.uint32[o4 + 2] = v4;\n        this.uint32[o4 + 3] = v5;\n        this.uint32[o4 + 4] = v6;\n        this.uint16[o2 + 10] = v7;\n        this.uint16[o2 + 11] = v8;\n        this.uint16[o2 + 12] = v9;\n        this.float32[o4 + 7] = v10;\n        this.float32[o4 + 8] = v11;\n        this.uint8[o1 + 36] = v12;\n        this.uint8[o1 + 37] = v13;\n        this.uint8[o1 + 38] = v14;\n        this.uint32[o4 + 10] = v15;\n        this.int16[o2 + 22] = v16;\n        return i;\n    }\n}\n\nStructArrayLayout2i2ui3ul3ui2f3ub1ul1i48.prototype.bytesPerElement = 48;\nregister('StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48', StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[8]\n * [16] - Uint16[15]\n * [48] - Uint32[1]\n * [52] - Float32[2]\n * [60] - Uint16[2]\n *\n */\nclass StructArrayLayout8i15ui1ul2f2ui64 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n    uint32: Uint32Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {\n        const o2 = i * 32;\n        const o4 = i * 16;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        this.int16[o2 + 6] = v6;\n        this.int16[o2 + 7] = v7;\n        this.uint16[o2 + 8] = v8;\n        this.uint16[o2 + 9] = v9;\n        this.uint16[o2 + 10] = v10;\n        this.uint16[o2 + 11] = v11;\n        this.uint16[o2 + 12] = v12;\n        this.uint16[o2 + 13] = v13;\n        this.uint16[o2 + 14] = v14;\n        this.uint16[o2 + 15] = v15;\n        this.uint16[o2 + 16] = v16;\n        this.uint16[o2 + 17] = v17;\n        this.uint16[o2 + 18] = v18;\n        this.uint16[o2 + 19] = v19;\n        this.uint16[o2 + 20] = v20;\n        this.uint16[o2 + 21] = v21;\n        this.uint16[o2 + 22] = v22;\n        this.uint32[o4 + 12] = v23;\n        this.float32[o4 + 13] = v24;\n        this.float32[o4 + 14] = v25;\n        this.uint16[o2 + 30] = v26;\n        this.uint16[o2 + 31] = v27;\n        return i;\n    }\n}\n\nStructArrayLayout8i15ui1ul2f2ui64.prototype.bytesPerElement = 64;\nregister('StructArrayLayout8i15ui1ul2f2ui64', StructArrayLayout8i15ui1ul2f2ui64);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[1]\n *\n */\nclass StructArrayLayout1f4 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o4 = i * 1;\n        this.float32[o4 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1f4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout1f4', StructArrayLayout1f4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[1]\n * [4] - Float32[2]\n *\n */\nclass StructArrayLayout1ui2f12 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 6;\n        const o4 = i * 3;\n        this.uint16[o2 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout1ui2f12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout1ui2f12', StructArrayLayout1ui2f12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint32[1]\n * [4] - Uint16[2]\n *\n */\nclass StructArrayLayout1ul2ui8 extends StructArray {\n    uint8: Uint8Array;\n    uint32: Uint32Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o4 = i * 2;\n        const o2 = i * 4;\n        this.uint32[o4 + 0] = v0;\n        this.uint16[o2 + 2] = v1;\n        this.uint16[o2 + 3] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout1ul2ui8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout1ul2ui8', StructArrayLayout1ul2ui8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[2]\n *\n */\nclass StructArrayLayout2ui4 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o2 = i * 2;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2ui4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout2ui4', StructArrayLayout2ui4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[1]\n *\n */\nclass StructArrayLayout1ui2 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o2 = i * 1;\n        this.uint16[o2 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1ui2.prototype.bytesPerElement = 2;\nregister('StructArrayLayout1ui2', StructArrayLayout1ui2);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[4]\n *\n */\nclass StructArrayLayout4f16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number) {\n        const o4 = i * 4;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        this.float32[o4 + 3] = v3;\n        return i;\n    }\n}\n\nStructArrayLayout4f16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout4f16', StructArrayLayout4f16);\n\n/** @internal */\nclass CollisionBoxStruct extends Struct {\n    _structArray: CollisionBoxArray;\n    get anchorPointX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorPointY() { return this._structArray.int16[this._pos2 + 1]; }\n    get x1() { return this._structArray.int16[this._pos2 + 2]; }\n    get y1() { return this._structArray.int16[this._pos2 + 3]; }\n    get x2() { return this._structArray.int16[this._pos2 + 4]; }\n    get y2() { return this._structArray.int16[this._pos2 + 5]; }\n    get featureIndex() { return this._structArray.uint32[this._pos4 + 3]; }\n    get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 8]; }\n    get bucketIndex() { return this._structArray.uint16[this._pos2 + 9]; }\n    get anchorPoint() { return new Point(this.anchorPointX, this.anchorPointY); }\n}\n\nCollisionBoxStruct.prototype.size = 20;\n\nexport type CollisionBox = CollisionBoxStruct;\n\n/** @internal */\nexport class CollisionBoxArray extends StructArrayLayout6i1ul2ui20 {\n    /**\n     * Return the CollisionBoxStruct at the given location in the array.\n     * @param index - The index of the element.\n     */\n    get(index: number): CollisionBoxStruct {\n        return new CollisionBoxStruct(this, index);\n    }\n}\n\nregister('CollisionBoxArray', CollisionBoxArray);\n\n/** @internal */\nclass PlacedSymbolStruct extends Struct {\n    _structArray: PlacedSymbolArray;\n    get anchorX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY() { return this._structArray.int16[this._pos2 + 1]; }\n    get glyphStartIndex() { return this._structArray.uint16[this._pos2 + 2]; }\n    get numGlyphs() { return this._structArray.uint16[this._pos2 + 3]; }\n    get vertexStartIndex() { return this._structArray.uint32[this._pos4 + 2]; }\n    get lineStartIndex() { return this._structArray.uint32[this._pos4 + 3]; }\n    get lineLength() { return this._structArray.uint32[this._pos4 + 4]; }\n    get segment() { return this._structArray.uint16[this._pos2 + 10]; }\n    get lowerSize() { return this._structArray.uint16[this._pos2 + 11]; }\n    get upperSize() { return this._structArray.uint16[this._pos2 + 12]; }\n    get lineOffsetX() { return this._structArray.float32[this._pos4 + 7]; }\n    get lineOffsetY() { return this._structArray.float32[this._pos4 + 8]; }\n    get writingMode() { return this._structArray.uint8[this._pos1 + 36]; }\n    get placedOrientation() { return this._structArray.uint8[this._pos1 + 37]; }\n    set placedOrientation(x: number) { this._structArray.uint8[this._pos1 + 37] = x; }\n    get hidden() { return this._structArray.uint8[this._pos1 + 38]; }\n    set hidden(x: number) { this._structArray.uint8[this._pos1 + 38] = x; }\n    get crossTileID() { return this._structArray.uint32[this._pos4 + 10]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 10] = x; }\n    get associatedIconIndex() { return this._structArray.int16[this._pos2 + 22]; }\n}\n\nPlacedSymbolStruct.prototype.size = 48;\n\nexport type PlacedSymbol = PlacedSymbolStruct;\n\n/** @internal */\nexport class PlacedSymbolArray extends StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 {\n    /**\n     * Return the PlacedSymbolStruct at the given location in the array.\n     * @param index - The index of the element.\n     */\n    get(index: number): PlacedSymbolStruct {\n        return new PlacedSymbolStruct(this, index);\n    }\n}\n\nregister('PlacedSymbolArray', PlacedSymbolArray);\n\n/** @internal */\nclass SymbolInstanceStruct extends Struct {\n    _structArray: SymbolInstanceArray;\n    get anchorX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY() { return this._structArray.int16[this._pos2 + 1]; }\n    get rightJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 2]; }\n    get centerJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 3]; }\n    get leftJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 4]; }\n    get verticalPlacedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 5]; }\n    get placedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 6]; }\n    get verticalPlacedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 7]; }\n    get key() { return this._structArray.uint16[this._pos2 + 8]; }\n    get textBoxStartIndex() { return this._structArray.uint16[this._pos2 + 9]; }\n    get textBoxEndIndex() { return this._structArray.uint16[this._pos2 + 10]; }\n    get verticalTextBoxStartIndex() { return this._structArray.uint16[this._pos2 + 11]; }\n    get verticalTextBoxEndIndex() { return this._structArray.uint16[this._pos2 + 12]; }\n    get iconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 13]; }\n    get iconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 14]; }\n    get verticalIconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 15]; }\n    get verticalIconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 16]; }\n    get featureIndex() { return this._structArray.uint16[this._pos2 + 17]; }\n    get numHorizontalGlyphVertices() { return this._structArray.uint16[this._pos2 + 18]; }\n    get numVerticalGlyphVertices() { return this._structArray.uint16[this._pos2 + 19]; }\n    get numIconVertices() { return this._structArray.uint16[this._pos2 + 20]; }\n    get numVerticalIconVertices() { return this._structArray.uint16[this._pos2 + 21]; }\n    get useRuntimeCollisionCircles() { return this._structArray.uint16[this._pos2 + 22]; }\n    get crossTileID() { return this._structArray.uint32[this._pos4 + 12]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 12] = x; }\n    get textBoxScale() { return this._structArray.float32[this._pos4 + 13]; }\n    get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 14]; }\n    get textAnchorOffsetStartIndex() { return this._structArray.uint16[this._pos2 + 30]; }\n    get textAnchorOffsetEndIndex() { return this._structArray.uint16[this._pos2 + 31]; }\n}\n\nSymbolInstanceStruct.prototype.size = 64;\n\nexport type SymbolInstance = SymbolInstanceStruct;\n\n/** @internal */\nexport class SymbolInstanceArray extends StructArrayLayout8i15ui1ul2f2ui64 {\n    /**\n     * Return the SymbolInstanceStruct at the given location in the array.\n     * @param index - The index of the element.\n     */\n    get(index: number): SymbolInstanceStruct {\n        return new SymbolInstanceStruct(this, index);\n    }\n}\n\nregister('SymbolInstanceArray', SymbolInstanceArray);\n\n/** @internal */\nexport class GlyphOffsetArray extends StructArrayLayout1f4 {\n    getoffsetX(index: number) { return this.float32[index * 1 + 0]; }\n}\n\nregister('GlyphOffsetArray', GlyphOffsetArray);\n\n/** @internal */\nexport class SymbolLineVertexArray extends StructArrayLayout3i6 {\n    getx(index: number) { return this.int16[index * 3 + 0]; }\n    gety(index: number) { return this.int16[index * 3 + 1]; }\n    gettileUnitDistanceFromAnchor(index: number) { return this.int16[index * 3 + 2]; }\n}\n\nregister('SymbolLineVertexArray', SymbolLineVertexArray);\n\n/** @internal */\nclass TextAnchorOffsetStruct extends Struct {\n    _structArray: TextAnchorOffsetArray;\n    get textAnchor() { return this._structArray.uint16[this._pos2 + 0]; }\n    get textOffset0() { return this._structArray.float32[this._pos4 + 1]; }\n    get textOffset1() { return this._structArray.float32[this._pos4 + 2]; }\n}\n\nTextAnchorOffsetStruct.prototype.size = 12;\n\nexport type TextAnchorOffset = TextAnchorOffsetStruct;\n\n/** @internal */\nexport class TextAnchorOffsetArray extends StructArrayLayout1ui2f12 {\n    /**\n     * Return the TextAnchorOffsetStruct at the given location in the array.\n     * @param index - The index of the element.\n     */\n    get(index: number): TextAnchorOffsetStruct {\n        return new TextAnchorOffsetStruct(this, index);\n    }\n}\n\nregister('TextAnchorOffsetArray', TextAnchorOffsetArray);\n\n/** @internal */\nclass FeatureIndexStruct extends Struct {\n    _structArray: FeatureIndexArray;\n    get featureIndex() { return this._structArray.uint32[this._pos4 + 0]; }\n    get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2]; }\n    get bucketIndex() { return this._structArray.uint16[this._pos2 + 3]; }\n}\n\nFeatureIndexStruct.prototype.size = 8;\n\nexport type FeatureIndex = FeatureIndexStruct;\n\n/** @internal */\nexport class FeatureIndexArray extends StructArrayLayout1ul2ui8 {\n    /**\n     * Return the FeatureIndexStruct at the given location in the array.\n     * @param index - The index of the element.\n     */\n    get(index: number): FeatureIndexStruct {\n        return new FeatureIndexStruct(this, index);\n    }\n}\n\nregister('FeatureIndexArray', FeatureIndexArray);\n\nexport class PosArray extends StructArrayLayout2i4 {}\nexport class Pos3dArray extends StructArrayLayout3i6 {}\nexport class RasterBoundsArray extends StructArrayLayout4i8 {}\nexport class CircleLayoutArray extends StructArrayLayout2i4 {}\nexport class FillLayoutArray extends StructArrayLayout2i4 {}\nexport class FillExtrusionLayoutArray extends StructArrayLayout2i4i12 {}\nexport class HeatmapLayoutArray extends StructArrayLayout2i4 {}\nexport class LineLayoutArray extends StructArrayLayout2i4ub8 {}\nexport class LineExtLayoutArray extends StructArrayLayout2f8 {}\nexport class PatternLayoutArray extends StructArrayLayout10ui20 {}\nexport class DashLayoutArray extends StructArrayLayout8ui16 {}\nexport class SymbolLayoutArray extends StructArrayLayout4i4ui4i24 {}\nexport class SymbolDynamicLayoutArray extends StructArrayLayout3f12 {}\nexport class SymbolOpacityArray extends StructArrayLayout1ul4 {}\nexport class CollisionBoxLayoutArray extends StructArrayLayout2i2i2i12 {}\nexport class CollisionCircleLayoutArray extends StructArrayLayout2f1f2i16 {}\nexport class CollisionVertexArray extends StructArrayLayout2ub2f2i16 {}\nexport class QuadTriangleArray extends StructArrayLayout3ui6 {}\nexport class TriangleIndexArray extends StructArrayLayout3ui6 {}\nexport class LineIndexArray extends StructArrayLayout2ui4 {}\nexport class LineStripIndexArray extends StructArrayLayout1ui2 {}\nexport {\n    StructArrayLayout2i4,\n    StructArrayLayout3i6,\n    StructArrayLayout4i8,\n    StructArrayLayout2i4i12,\n    StructArrayLayout2i4ub8,\n    StructArrayLayout2f8,\n    StructArrayLayout10ui20,\n    StructArrayLayout8ui16,\n    StructArrayLayout4i4ui4i24,\n    StructArrayLayout3f12,\n    StructArrayLayout1ul4,\n    StructArrayLayout6i1ul2ui20,\n    StructArrayLayout2i2i2i12,\n    StructArrayLayout2f1f2i16,\n    StructArrayLayout2ub2f2i16,\n    StructArrayLayout3ui6,\n    StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48,\n    StructArrayLayout8i15ui1ul2f2ui64,\n    StructArrayLayout1f4,\n    StructArrayLayout1ui2f12,\n    StructArrayLayout1ul2ui8,\n    StructArrayLayout2ui4,\n    StructArrayLayout1ui2,\n    StructArrayLayout4f16\n};\n","import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n","import {warnOnce} from '../util/util';\n\nimport {register} from '../util/web_worker_transfer';\n\nimport type {VertexArrayObject} from '../render/vertex_array_object';\nimport type {StructArray} from '../util/struct_array';\n\n/**\n * @internal\n * A single segment of a vector\n */\nexport type Segment = {\n    sortKey?: number;\n    vertexOffset: number;\n    primitiveOffset: number;\n    vertexLength: number;\n    primitiveLength: number;\n    vaos: {[_: string]: VertexArrayObject};\n};\n\n/**\n * @internal\n * Used for calculations on vector segments\n */\nexport class SegmentVector {\n    static MAX_VERTEX_ARRAY_LENGTH: number;\n    segments: Array<Segment>;\n    private _forceNewSegmentOnNextPrepare: boolean = false;\n\n    constructor(segments: Array<Segment> = []) {\n        this.segments = segments;\n    }\n\n    /**\n     * Returns the last segment if `numVertices` fits into it.\n     * If there are no segments yet or `numVertices` doesn't fit into the last one, creates a new empty segment and returns it.\n     */\n    prepareSegment(\n        numVertices: number,\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        const lastSegment: Segment = this.segments[this.segments.length - 1];\n\n        if (numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n            warnOnce(`Max vertices per segment is ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${numVertices}. Consider using the \\`fillLargeMeshArrays\\` function if you require meshes with more than ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH} vertices.`);\n        }\n\n        if (this._forceNewSegmentOnNextPrepare || !lastSegment || lastSegment.vertexLength + numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH || lastSegment.sortKey !== sortKey) {\n            return this.createNewSegment(layoutVertexArray, indexArray, sortKey);\n        } else {\n            return lastSegment;\n        }\n    }\n\n    /**\n     * Creates a new empty segment and returns it.\n     */\n    createNewSegment(\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        const segment: Segment = {\n            vertexOffset: layoutVertexArray.length,\n            primitiveOffset: indexArray.length,\n            vertexLength: 0,\n            primitiveLength: 0,\n            vaos: {}\n        };\n\n        if (sortKey !== undefined) {\n            segment.sortKey = sortKey;\n        }\n\n        // If this was set, we have no need to create a new segment on next prepareSegment call,\n        // since this function already created a new, empty segment.\n        this._forceNewSegmentOnNextPrepare = false;\n        this.segments.push(segment);\n        return segment;\n    }\n\n    /**\n     * Returns the last segment, or creates a new segments if there are no segments yet.\n     */\n    getOrCreateLatestSegment(\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        return this.prepareSegment(0, layoutVertexArray, indexArray, sortKey);\n    }\n\n    /**\n     * Causes the next call to {@link prepareSegment} to always return a new segment,\n     * not reusing the current segment even if the new geometry would fit it.\n     */\n    forceNewSegmentOnNextPrepare() {\n        this._forceNewSegmentOnNextPrepare = true;\n    }\n\n    get() {\n        return this.segments;\n    }\n\n    destroy() {\n        for (const segment of this.segments) {\n            for (const k in segment.vaos) {\n                segment.vaos[k].destroy();\n            }\n        }\n    }\n\n    static simpleSegment(\n        vertexOffset: number,\n        primitiveOffset: number,\n        vertexLength: number,\n        primitiveLength: number\n    ): SegmentVector {\n        return new SegmentVector([{\n            vertexOffset,\n            primitiveOffset,\n            vertexLength,\n            primitiveLength,\n            vaos: {},\n            sortKey: 0\n        }]);\n    }\n}\n\n/**\n * The maximum size of a vertex array. This limit is imposed by WebGL's 16 bit\n * addressing of vertex buffers.\n */\nSegmentVector.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1;\n\nregister('SegmentVector', SegmentVector);\n","import {clamp} from '../util/util';\n\n/**\n * Packs two numbers, interpreted as 8-bit unsigned integers, into a single\n * float.  Unpack them in the shader using the `unpack_float()` function,\n * defined in _prelude.vertex.glsl\n */\nexport function packUint8ToFloat(a: number, b: number) {\n    // coerce a and b to 8-bit ints\n    a = clamp(Math.floor(a), 0, 255);\n    b = clamp(Math.floor(b), 0, 255);\n    return 256 * a + b;\n}\n","import {createLayout} from '../../util/struct_array';\n\nexport const patternAttributes = createLayout([\n    // [tl.x, tl.y, br.x, br.y]\n    {name: 'a_pattern_from', components: 4, type: 'Uint16'},\n    {name: 'a_pattern_to', components: 4, type: 'Uint16'},\n    {name: 'a_pixel_ratio_from', components: 1, type: 'Uint16'},\n    {name: 'a_pixel_ratio_to', components: 1, type: 'Uint16'},\n]);\n","import {createLayout} from '../../util/struct_array';\n\nexport const dashAttributes = createLayout([\n    // [0, y, height, width]\n    {name: 'a_dasharray_from', components: 4, type: 'Uint16'},\n    {name: 'a_dasharray_to', components: 4, type: 'Uint16'},\n]);\n","var murmur3 = require(\"./murmurhash3_gc.js\")\nvar murmur2 = require(\"./murmurhash2_gc.js\")\n\nmodule.exports = murmur3\nmodule.exports.murmur3 = murmur3\nmodule.exports.murmur2 = murmur2\n","/**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash \n */\n\nfunction murmurhash3_32_gc(key, seed) {\n\tvar remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;\n\t\n\tremainder = key.length & 3; // key.length % 4\n\tbytes = key.length - remainder;\n\th1 = seed;\n\tc1 = 0xcc9e2d51;\n\tc2 = 0x1b873593;\n\ti = 0;\n\t\n\twhile (i < bytes) {\n\t  \tk1 = \n\t  \t  ((key.charCodeAt(i) & 0xff)) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 8) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 16) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 24);\n\t\t++i;\n\t\t\n\t\tk1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n\t\th1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n\t\th1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n\t\th1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n\t}\n\t\n\tk1 = 0;\n\t\n\tswitch (remainder) {\n\t\tcase 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n\t\tcase 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n\t\tcase 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\t\t\n\t\tk1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n\t\th1 ^= k1;\n\t}\n\t\n\th1 ^= key.length;\n\n\th1 ^= h1 >>> 16;\n\th1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n\th1 ^= h1 >>> 13;\n\th1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n\th1 ^= h1 >>> 16;\n\n\treturn h1 >>> 0;\n}\n\nif(typeof module !== \"undefined\") {\n  module.exports = murmurhash3_32_gc\n}","/**\n * JS Implementation of MurmurHash2\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} str ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\nfunction murmurhash2_32_gc(str, seed) {\n  var\n    l = str.length,\n    h = seed ^ l,\n    i = 0,\n    k;\n  \n  while (l >= 4) {\n  \tk = \n  \t  ((str.charCodeAt(i) & 0xff)) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 8) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 16) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 24);\n    \n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n    k ^= k >>> 24;\n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n\n\th = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;\n\n    l -= 4;\n    ++i;\n  }\n  \n  switch (l) {\n  case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n  case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n  case 1: h ^= (str.charCodeAt(i) & 0xff);\n          h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  }\n\n  h ^= h >>> 13;\n  h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  h ^= h >>> 15;\n\n  return h >>> 0;\n}\n\nif(typeof module !== undefined) {\n  module.exports = murmurhash2_32_gc\n}\n","import murmur3 from 'murmurhash-js';\nimport {register} from '../util/web_worker_transfer';\n\ntype SerializedFeaturePositionMap = {\n    ids: Float64Array;\n    positions: Uint32Array;\n};\n\ntype FeaturePosition = {\n    index: number;\n    start: number;\n    end: number;\n};\n\n// A transferable data structure that maps feature ids to their indices and buffer offsets\nexport class FeaturePositionMap {\n    ids: Array<number>;\n    positions: Array<number>;\n    indexed: boolean;\n\n    constructor() {\n        this.ids = [];\n        this.positions = [];\n        this.indexed = false;\n    }\n\n    add(id: unknown, index: number, start: number, end: number) {\n        this.ids.push(getNumericId(id));\n        this.positions.push(index, start, end);\n    }\n\n    getPositions(id: unknown): Array<FeaturePosition> {\n        if (!this.indexed) throw new Error('Trying to get index, but feature positions are not indexed');\n\n        const intId = getNumericId(id);\n\n        // binary search for the first occurrence of id in this.ids;\n        // relies on ids/positions being sorted by id, which happens in serialization\n        let i = 0;\n        let j = this.ids.length - 1;\n        while (i < j) {\n            const m = (i + j) >> 1;\n            if (this.ids[m] >= intId) {\n                j = m;\n            } else {\n                i = m + 1;\n            }\n        }\n        const positions = [];\n        while (this.ids[i] === intId) {\n            const index = this.positions[3 * i];\n            const start = this.positions[3 * i + 1];\n            const end = this.positions[3 * i + 2];\n            positions.push({index, start, end});\n            i++;\n        }\n        return positions;\n    }\n\n    static serialize(map: FeaturePositionMap, transferables: Array<ArrayBuffer>): SerializedFeaturePositionMap {\n        const ids = new Float64Array(map.ids);\n        const positions = new Uint32Array(map.positions);\n\n        sort(ids, positions, 0, ids.length - 1);\n\n        if (transferables) {\n            transferables.push(ids.buffer, positions.buffer);\n        }\n\n        return {ids, positions};\n    }\n\n    static deserialize(obj: SerializedFeaturePositionMap): FeaturePositionMap {\n        const map = new FeaturePositionMap();\n        // after transferring, we only use these arrays statically (no pushes),\n        // so TypedArray vs Array distinction that flow points out doesn't matter\n        map.ids = (obj.ids as any);\n        map.positions = (obj.positions as any);\n        map.indexed = true;\n        return map;\n    }\n}\n\nfunction getNumericId(value: unknown) {\n    const numValue = +value;\n    if (!isNaN(numValue) && numValue <= Number.MAX_SAFE_INTEGER) {\n        return numValue;\n    }\n    return murmur3(String(value));\n}\n\n// custom quicksort that sorts ids, indices and offsets together (by ids)\n// uses Hoare partitioning & manual tail call optimization to avoid worst case scenarios\nfunction sort(ids, positions, left, right) {\n    while (left < right) {\n        const pivot = ids[(left + right) >> 1];\n        let i = left - 1;\n        let j = right + 1;\n\n        while (true) {\n            do i++; while (ids[i] < pivot);\n            do j--; while (ids[j] > pivot);\n            if (i >= j) break;\n            swap(ids, i, j);\n            swap(positions, 3 * i, 3 * j);\n            swap(positions, 3 * i + 1, 3 * j + 1);\n            swap(positions, 3 * i + 2, 3 * j + 2);\n        }\n\n        if (j - left < right - j) {\n            sort(ids, positions, left, j);\n            left = j + 1;\n        } else {\n            sort(ids, positions, j + 1, right);\n            right = j;\n        }\n    }\n}\n\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\nregister('FeaturePositionMap', FeaturePositionMap);\n","import {Color} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Context} from '../gl/context';\nimport {type mat4, type vec2, type vec3, type vec4} from 'gl-matrix';\n\ntype $ObjMap<T extends {}, F extends (v: any) => any> = {\n    [K in keyof T]: F extends (v: T[K]) => infer R ? R : never;\n};\n\nexport type UniformValues<Us extends {}> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;\nexport type UniformLocations = {[_: string]: WebGLUniformLocation};\n\n/**\n * @internal\n * A base uniform abstract class\n */\nabstract class Uniform<T> {\n    gl: WebGLRenderingContext|WebGL2RenderingContext;\n    location: WebGLUniformLocation;\n    current: T;\n\n    constructor(context: Context, location: WebGLUniformLocation) {\n        this.gl = context.gl;\n        this.location = location;\n    }\n\n    abstract set(v: T): void;\n}\n\nclass Uniform1i extends Uniform<number> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = 0;\n    }\n\n    set(v: number): void {\n        if (this.current !== v) {\n            this.current = v;\n            this.gl.uniform1i(this.location, v);\n        }\n    }\n}\n\nclass Uniform1f extends Uniform<number> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = 0;\n    }\n\n    set(v: number): void {\n        if (this.current !== v) {\n            this.current = v;\n            this.gl.uniform1f(this.location, v);\n        }\n    }\n}\n\nclass Uniform2f extends Uniform<vec2> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0];\n    }\n\n    set(v: vec2): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1]) {\n            this.current = v;\n            this.gl.uniform2f(this.location, v[0], v[1]);\n        }\n    }\n}\n\nclass Uniform3f extends Uniform<vec3> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0, 0];\n    }\n\n    set(v: vec3): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1] || v[2] !== this.current[2]) {\n            this.current = v;\n            this.gl.uniform3f(this.location, v[0], v[1], v[2]);\n        }\n    }\n}\n\nclass Uniform4f extends Uniform<vec4> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0, 0, 0];\n    }\n\n    set(v: vec4): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1] ||\n            v[2] !== this.current[2] || v[3] !== this.current[3]) {\n            this.current = v;\n            this.gl.uniform4f(this.location, v[0], v[1], v[2], v[3]);\n        }\n    }\n}\n\nclass UniformColor extends Uniform<Color> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = Color.transparent;\n    }\n\n    set(v: Color): void {\n        if (v.r !== this.current.r || v.g !== this.current.g ||\n            v.b !== this.current.b || v.a !== this.current.a) {\n            this.current = v;\n            this.gl.uniform4f(this.location, v.r, v.g, v.b, v.a);\n        }\n    }\n}\n\nclass UniformColorArray extends Uniform<Array<Color>> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = new Array<Color>();\n    }\n\n    set(v: Array<Color>): void {\n        if (v != this.current) {\n            this.current = v;\n            const values = new Float32Array(v.length*4);\n            for( let i = 0; i < v.length; i++) {\n                values[4*i] = v[i].r;\n                values[4*i+1] = v[i].g;\n                values[4*i+2] = v[i].b;\n                values[4*i+3] = v[i].a;\n            }\n            this.gl.uniform4fv(this.location, values);\n        }\n    }\n}\n\nclass UniformFloatArray extends Uniform<Array<number>> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = new Array<number>();\n    }\n\n    set(v: Array<number>): void {\n        if (v != this.current) {\n            this.current = v;\n            const values = new Float32Array(v);\n            this.gl.uniform1fv(this.location, values);\n        }\n    }\n}\n\nconst emptyMat4 = new Float32Array(16) as mat4;\nclass UniformMatrix4f extends Uniform<mat4> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = emptyMat4;\n    }\n\n    set(v: mat4): void {\n        // The vast majority of matrix comparisons that will trip this set\n        // happen at i=12 or i=0, so we check those first to avoid lots of\n        // unnecessary iteration:\n        if (v[12] !== this.current[12] || v[0] !== this.current[0]) {\n            this.current = v;\n            this.gl.uniformMatrix4fv(this.location, false, v);\n            return;\n        }\n        for (let i = 1; i < 16; i++) {\n            if (v[i] !== this.current[i]) {\n                this.current = v;\n                this.gl.uniformMatrix4fv(this.location, false, v);\n                break;\n            }\n        }\n    }\n}\n\nexport {\n    Uniform,\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n    Uniform4f,\n    UniformColor,\n    UniformColorArray,\n    UniformFloatArray,\n    UniformMatrix4f\n};\n\n/**\n * @internal\n * A uniform bindings\n */\nexport type UniformBindings = {[_: string]: Uniform<any>};\n","import {packUint8ToFloat} from '../shaders/encode_attribute';\nimport {type Color, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer';\nimport {PossiblyEvaluatedPropertyValue} from '../style/properties';\nimport {StructArrayLayout1f4, StructArrayLayout2f8, StructArrayLayout4f16, PatternLayoutArray, DashLayoutArray} from './array_types.g';\nimport {clamp} from '../util/util';\nimport {patternAttributes} from './bucket/pattern_attributes';\nimport {dashAttributes} from './bucket/dash_attributes';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {FeaturePositionMap} from './feature_position_map';\nimport {type Uniform, Uniform1f, UniformColor, Uniform4f} from '../render/uniform_binding';\n\nimport type {UniformLocations} from '../render/uniform_binding';\n\nimport type {CanonicalTileID} from '../tile/tile_id';\nimport type {Context} from '../gl/context';\nimport type {TypedStyleLayer} from '../style/style_layer/typed_style_layer';\nimport type {CrossfadeParameters} from '../style/evaluation_parameters';\nimport type {StructArray, StructArrayMember} from '../util/struct_array';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {\n    Feature,\n    FeatureState,\n    GlobalProperties,\n    SourceExpression,\n    CompositeExpression,\n    FormattedSection\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {FeatureStates} from '../source/source_state';\nimport type {DashEntry} from '../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport type BinderUniform = {\n    name: string;\n    property: string;\n    binding: Uniform<any>;\n};\n\nfunction packColor(color: Color): [number, number] {\n    return [\n        packUint8ToFloat(255 * color.r, 255 * color.g),\n        packUint8ToFloat(255 * color.b, 255 * color.a)\n    ];\n}\n\ntype PaintOptions = {\n    imagePositions: {\n        [_: string]: ImagePosition;\n    };\n    dashPositions?: {\n        [_: string]: DashEntry;\n    };\n    canonical?: CanonicalTileID;\n    formattedSection?: FormattedSection;\n    globalState?: Record<string, any>;\n};\n\n/**\n *  `Binder` is the interface definition for the strategies for constructing,\n *  uploading, and binding paint property data as GLSL attributes. Most style-\n *  spec properties have a 1:1 relationship to shader attribute/uniforms, but\n *  some require multiple values per feature to be passed to the GPU, and in\n *  those cases we bind multiple attributes/uniforms.\n *\n *  It has three implementations, one for each of the three strategies we use:\n *\n *  * For _constant_ properties -- those whose value is a constant, or the constant\n *    result of evaluating a camera expression at a particular camera position -- we\n *    don't need a vertex attribute buffer, and instead use a uniform.\n *  * For data expressions, we use a vertex buffer with a single attribute value,\n *    the evaluated result of the source function for the given feature.\n *  * For composite expressions, we use a vertex buffer with two attributes: min and\n *    max values covering the range of zooms at which we expect the tile to be\n *    displayed. These values are calculated by evaluating the composite expression for\n *    the given feature at strategically chosen zoom levels. In addition to this\n *    attribute data, we also use a uniform value which the shader uses to interpolate\n *    between the min and max value at the final displayed zoom level. The use of a\n *    uniform allows us to cheaply update the value on every frame.\n *\n *  Note that the shader source varies depending on whether we're using a uniform or\n *  attribute. We dynamically compile shaders at runtime to accommodate this.\n */\ninterface AttributeBinder {\n    populatePaintArray(\n        length: number,\n        feature: Feature,\n        options: PaintOptions\n    ): void;\n    updatePaintArray(\n        start: number,\n        length: number,\n        feature: Feature,\n        featureState: FeatureState,\n        options: PaintOptions\n    ): void;\n    upload(a: Context): void;\n    destroy(): void;\n}\n\ninterface UniformBinder {\n    uniformNames: Array<string>;\n    setUniform(\n        uniform: Uniform<any>,\n        globals: GlobalProperties,\n        currentValue: PossiblyEvaluatedPropertyValue<any>,\n        uniformName: string\n    ): void;\n    getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>>;\n}\n\nclass ConstantBinder implements UniformBinder {\n    value: unknown;\n    type: string;\n    uniformNames: Array<string>;\n\n    constructor(value: unknown, names: Array<string>, type: string) {\n        this.value = value;\n        this.uniformNames = names.map(name => `u_${name}`);\n        this.type = type;\n    }\n\n    setUniform(\n        uniform: Uniform<any>,\n        globals: GlobalProperties,\n        currentValue: PossiblyEvaluatedPropertyValue<unknown>\n    ): void {\n        uniform.set(currentValue.constantOr(this.value));\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, _: string): Partial<Uniform<any>> {\n        return (this.type === 'color') ?\n            new UniformColor(context, location) :\n            new Uniform1f(context, location);\n    }\n}\n\nclass CrossFadedConstantBinder implements UniformBinder {\n    uniformNames: Array<string>;\n    patternFrom: Array<number>;\n    patternTo: Array<number>;\n    dashFrom: Array<number>;\n    dashTo: Array<number>;\n    pixelRatioFrom: number;\n    pixelRatioTo: number;\n\n    constructor(value: unknown, names: Array<string>) {\n        this.uniformNames = names.map(name => `u_${name}`);\n        this.patternFrom = null;\n        this.patternTo = null;\n        this.pixelRatioFrom = 1.0;\n        this.pixelRatioTo = 1.0;\n    }\n\n    setConstantPatternPositions(posTo: ImagePosition, posFrom: ImagePosition) {\n        this.pixelRatioFrom = posFrom.pixelRatio;\n        this.pixelRatioTo = posTo.pixelRatio;\n        this.patternFrom = posFrom.tlbr;\n        this.patternTo = posTo.tlbr;\n    }\n\n    setConstantDashPositions(dashTo: DashEntry, dashFrom: DashEntry) {\n        this.dashTo = [0, dashTo.y, dashTo.height, dashTo.width];\n        this.dashFrom = [0, dashFrom.y, dashFrom.height, dashFrom.width];\n    }\n\n    setUniform(uniform: Uniform<any>, globals: GlobalProperties, currentValue: PossiblyEvaluatedPropertyValue<unknown>, uniformName: string) {\n        let value = null;\n\n        if (uniformName === 'u_pattern_to') {\n            value = this.patternTo;\n        } else if (uniformName === 'u_pattern_from') {\n            value = this.patternFrom;\n        } else if (uniformName === 'u_dasharray_to') {\n            value = this.dashTo;\n        } else if (uniformName === 'u_dasharray_from') {\n            value = this.dashFrom;\n        } else if (uniformName === 'u_pixel_ratio_to') {\n            value = this.pixelRatioTo;\n        } else if (uniformName === 'u_pixel_ratio_from') {\n            value = this.pixelRatioFrom;\n        }\n\n        if (value !== null) {\n            uniform.set(value);\n        }\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>> {\n        return (name.substr(0, 9) === 'u_pattern' || name.substr(0, 12) === 'u_dasharray_') ?\n            new Uniform4f(context, location) :\n            new Uniform1f(context, location);\n    }\n}\n\nclass SourceExpressionBinder implements AttributeBinder {\n    expression: SourceExpression;\n    type: string;\n    maxValue: number;\n\n    paintVertexArray: StructArray;\n    paintVertexAttributes: Array<StructArrayMember>;\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: SourceExpression, names: Array<string>, type: string, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }) {\n        this.expression = expression;\n        this.type = type;\n        this.maxValue = 0;\n        this.paintVertexAttributes = names.map((name) => ({\n            name: `a_${name}`,\n            type: 'Float32',\n            components: type === 'color' ? 2 : 1,\n            offset: 0\n        }));\n        this.paintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(newLength: number, feature: Feature, options: PaintOptions) {\n        const start = this.paintVertexArray.length;\n        const value = this.expression.evaluate(new EvaluationParameters(0, options), feature, {}, options.canonical, [], options.formattedSection);\n        this.paintVertexArray.resize(newLength);\n        this._setPaintValue(start, newLength, value);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, options: PaintOptions) {\n        const value = this.expression.evaluate(new EvaluationParameters(0, options), feature, featureState);\n        this._setPaintValue(start, end, value);\n    }\n\n    _setPaintValue(start, end, value) {\n        if (this.type === 'color') {\n            const color = packColor(value);\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, color[0], color[1]);\n            }\n        } else {\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, value);\n            }\n            this.maxValue = Math.max(this.maxValue, Math.abs(value));\n        }\n    }\n\n    upload(context: Context) {\n        if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) {\n            if (this.paintVertexBuffer && this.paintVertexBuffer.buffer) {\n                this.paintVertexBuffer.updateData(this.paintVertexArray);\n            } else {\n                this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent);\n            }\n        }\n    }\n\n    destroy() {\n        if (this.paintVertexBuffer) {\n            this.paintVertexBuffer.destroy();\n        }\n    }\n}\n\nclass CompositeExpressionBinder implements AttributeBinder, UniformBinder {\n    expression: CompositeExpression;\n    uniformNames: Array<string>;\n    type: string;\n    useIntegerZoom: boolean;\n    zoom: number;\n    maxValue: number;\n\n    paintVertexArray: StructArray;\n    paintVertexAttributes: Array<StructArrayMember>;\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: CompositeExpression, names: Array<string>, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }) {\n        this.expression = expression;\n        this.uniformNames = names.map(name => `u_${name}_t`);\n        this.type = type;\n        this.useIntegerZoom = useIntegerZoom;\n        this.zoom = zoom;\n        this.maxValue = 0;\n        this.paintVertexAttributes = names.map((name) => ({\n            name: `a_${name}`,\n            type: 'Float32',\n            components: type === 'color' ? 4 : 2,\n            offset: 0\n        }));\n        this.paintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(newLength: number, feature: Feature, options: PaintOptions) {\n        const min = this.expression.evaluate(new EvaluationParameters(this.zoom, options), feature, {}, options.canonical, [], options.formattedSection);\n        const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1, options), feature, {}, options.canonical, [], options.formattedSection);\n        const start = this.paintVertexArray.length;\n        this.paintVertexArray.resize(newLength);\n        this._setPaintValue(start, newLength, min, max);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, options: PaintOptions) {\n        const min = this.expression.evaluate(new EvaluationParameters(this.zoom, options), feature, featureState);\n        const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1, options), feature, featureState);\n        this._setPaintValue(start, end, min, max);\n    }\n\n    _setPaintValue(start, end, min, max) {\n        if (this.type === 'color') {\n            const minColor = packColor(min);\n            const maxColor = packColor(max);\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, minColor[0], minColor[1], maxColor[0], maxColor[1]);\n            }\n        } else {\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, min, max);\n            }\n            this.maxValue = Math.max(this.maxValue, Math.abs(min), Math.abs(max));\n        }\n    }\n\n    upload(context: Context) {\n        if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) {\n            if (this.paintVertexBuffer && this.paintVertexBuffer.buffer) {\n                this.paintVertexBuffer.updateData(this.paintVertexArray);\n            } else {\n                this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent);\n            }\n        }\n    }\n\n    destroy() {\n        if (this.paintVertexBuffer) {\n            this.paintVertexBuffer.destroy();\n        }\n    }\n\n    setUniform(uniform: Uniform<any>, globals: GlobalProperties): void {\n        const currentZoom = this.useIntegerZoom ? Math.floor(globals.zoom) : globals.zoom;\n        const factor = clamp(this.expression.interpolationFactor(currentZoom, this.zoom, this.zoom + 1), 0, 1);\n        uniform.set(factor);\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, _: string): Uniform1f {\n        return new Uniform1f(context, location);\n    }\n}\n\nabstract class CrossFadedBinder<T> implements AttributeBinder {\n    expression: CompositeExpression;\n    type: string;\n    useIntegerZoom: boolean;\n    zoom: number;\n    layerId: string;\n\n    zoomInPaintVertexArray: StructArray;\n    zoomOutPaintVertexArray: StructArray;\n    zoomInPaintVertexBuffer: VertexBuffer;\n    zoomOutPaintVertexBuffer: VertexBuffer;\n    paintVertexAttributes: Array<StructArrayMember>;\n\n    constructor(expression: CompositeExpression, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }, layerId: string) {\n        this.expression = expression;\n        this.type = type;\n        this.useIntegerZoom = useIntegerZoom;\n        this.zoom = zoom;\n        this.layerId = layerId;\n\n        this.zoomInPaintVertexArray = new PaintVertexArray();\n        this.zoomOutPaintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(length: number, feature: Feature, options: PaintOptions) {\n        const start = this.zoomInPaintVertexArray.length;\n        this.zoomInPaintVertexArray.resize(length);\n        this.zoomOutPaintVertexArray.resize(length);\n        this._setPaintValues(start, length, this.getPositionIds(feature), options);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, options: PaintOptions) {\n        this._setPaintValues(start, end, this.getPositionIds(feature), options);\n    }\n\n    abstract getVertexAttributes(): Array<StructArrayMember>;\n\n    protected abstract getPositionIds(feature: Feature): {min: string; mid: string; max: string};\n    protected abstract getPositions(options: PaintOptions): {[_: string]: T};\n    protected abstract emplace(array: StructArray, index: number, midPos: T, minMaxPos: T): void;\n\n    protected _setPaintValues(start: number, end: number, positionIds: {min: string; mid: string; max: string}, options: PaintOptions) {\n        const positions = this.getPositions(options);\n        if (!positions || !positionIds) return;\n        const min = positions[positionIds.min];\n        const mid = positions[positionIds.mid];\n        const max = positions[positionIds.max];\n        if (!min || !mid || !max) return;\n\n        // We populate two paint arrays because, for cross-faded properties, we don't know which direction\n        // we're cross-fading to at layout time. In order to keep vertex attributes to a minimum and not pass\n        // unnecessary vertex data to the shaders, we determine which to upload at draw time.\n        for (let i = start; i < end; i++) {\n            this.emplace(this.zoomInPaintVertexArray, i, mid, min);\n            this.emplace(this.zoomOutPaintVertexArray, i, mid, max);\n        }\n    }\n\n    upload(context: Context) {\n        if (this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer) {\n            const attributes = this.getVertexAttributes();\n            this.zoomInPaintVertexBuffer = context.createVertexBuffer(this.zoomInPaintVertexArray, attributes, this.expression.isStateDependent);\n            this.zoomOutPaintVertexBuffer = context.createVertexBuffer(this.zoomOutPaintVertexArray, attributes, this.expression.isStateDependent);\n        }\n    }\n\n    destroy() {\n        if (this.zoomOutPaintVertexBuffer) this.zoomOutPaintVertexBuffer.destroy();\n        if (this.zoomInPaintVertexBuffer) this.zoomInPaintVertexBuffer.destroy();\n    }\n}\n\nclass CrossFadedPatternBinder extends CrossFadedBinder<ImagePosition> {\n    protected getPositions(options: PaintOptions): {[_: string]: ImagePosition} {\n        return options.imagePositions;\n    }\n\n    protected getPositionIds(feature: Feature) {\n        return feature.patterns && feature.patterns[this.layerId];\n    }\n\n    getVertexAttributes(): Array<StructArrayMember> {\n        return patternAttributes.members;\n    }\n\n    protected emplace(array: StructArray, index: number, midPos: ImagePosition, minMaxPos: ImagePosition): void {\n        array.emplace(index,\n            midPos.tlbr[0], midPos.tlbr[1], midPos.tlbr[2], midPos.tlbr[3],\n            minMaxPos.tlbr[0], minMaxPos.tlbr[1], minMaxPos.tlbr[2], minMaxPos.tlbr[3],\n            midPos.pixelRatio,\n            minMaxPos.pixelRatio,\n        );\n    }\n}\n\nclass CrossFadedDasharrayBinder extends CrossFadedBinder<DashEntry> {\n    protected getPositions(options: PaintOptions): {[_: string]: DashEntry} {\n        return options.dashPositions;\n    }\n\n    protected getPositionIds(feature: Feature) {\n        return feature.dashes && feature.dashes[this.layerId];\n    }\n\n    getVertexAttributes(): Array<StructArrayMember> {\n        return dashAttributes.members;\n    }\n\n    protected emplace(array: StructArray, index: number, midPos: DashEntry, minMaxPos: DashEntry): void {\n        array.emplace(index,\n            0, midPos.y, midPos.height, midPos.width,\n            0, minMaxPos.y, minMaxPos.height, minMaxPos.width,\n        );\n    }\n}\n\n/**\n * @internal\n * ProgramConfiguration contains the logic for binding style layer properties and tile\n * layer feature data into GL program uniforms and vertex attributes.\n *\n * Non-data-driven property values are bound to shader uniforms. Data-driven property\n * values are bound to vertex attributes. In order to support a uniform GLSL syntax over\n * both, [Mapbox GL Shaders](https://github.com/mapbox/mapbox-gl-shaders) defines a `#pragma`\n * abstraction, which ProgramConfiguration is responsible for implementing. At runtime,\n * it examines the attributes of a particular layer, combines this with fixed knowledge\n * about how layers of the particular type are implemented, and determines which uniforms\n * and vertex attributes will be required. It can then substitute the appropriate text\n * into the shader source code, create and link a program, and bind the uniforms and\n * vertex attributes in preparation for drawing.\n *\n * When a vector tile is parsed, this same configuration information is used to\n * populate the attribute buffers needed for data-driven styling using the zoom\n * level and feature property data.\n */\nexport class ProgramConfiguration {\n    binders: {[_: string]: AttributeBinder | UniformBinder};\n    cacheKey: string;\n\n    _buffers: Array<VertexBuffer>;\n\n    constructor(layer: TypedStyleLayer, zoom: number, filterProperties: (_: string) => boolean) {\n        this.binders = {};\n        this._buffers = [];\n\n        const keys = [];\n\n        for (const property in layer.paint._values) {\n            if (!filterProperties(property)) continue;\n            const value = (layer.paint as any).get(property);\n            if (!(value instanceof PossiblyEvaluatedPropertyValue) || !supportsPropertyExpression(value.property.specification)) {\n                continue;\n            }\n            const names = paintAttributeNames(property, layer.type);\n            const expression = value.value;\n            const type = value.property.specification.type;\n            const useIntegerZoom = (value.property as any).useIntegerZoom;\n            const propType = value.property.specification['property-type'];\n            const isCrossFaded = propType === 'cross-faded' || propType === 'cross-faded-data-driven';\n\n            if (expression.kind === 'constant') {\n                this.binders[property] = isCrossFaded ?\n                    new CrossFadedConstantBinder(expression.value, names) :\n                    new ConstantBinder(expression.value, names, type);\n                keys.push(`/u_${property}`);\n\n            } else if (expression.kind === 'source' || isCrossFaded) {\n                const StructArrayLayout = layoutType(property, type, 'source');\n                this.binders[property] = isCrossFaded ?\n                    property === 'line-dasharray' ?\n                        new CrossFadedDasharrayBinder(expression as CompositeExpression, type, useIntegerZoom, zoom, StructArrayLayout, layer.id) :\n                        new CrossFadedPatternBinder(expression as CompositeExpression, type, useIntegerZoom, zoom, StructArrayLayout, layer.id) :\n                    new SourceExpressionBinder(expression as SourceExpression, names, type, StructArrayLayout);\n                keys.push(`/a_${property}`);\n\n            } else {\n                const StructArrayLayout = layoutType(property, type, 'composite');\n                this.binders[property] = new CompositeExpressionBinder(expression, names, type, useIntegerZoom, zoom, StructArrayLayout);\n                keys.push(`/z_${property}`);\n            }\n        }\n\n        this.cacheKey = keys.sort().join('');\n    }\n\n    getMaxValue(property: string): number {\n        const binder = this.binders[property];\n        return binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder ? binder.maxValue : 0;\n    }\n\n    populatePaintArrays(newLength: number, feature: Feature, options: PaintOptions) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedBinder)\n                binder.populatePaintArray(newLength, feature, options);\n        }\n    }\n    setConstantPatternPositions(posTo: ImagePosition, posFrom: ImagePosition) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof CrossFadedConstantBinder)\n                binder.setConstantPatternPositions(posTo, posFrom);\n        }\n    }\n\n    setConstantDashPositions(dashTo: DashEntry, dashFrom: DashEntry) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof CrossFadedConstantBinder)\n                binder.setConstantDashPositions(dashTo, dashFrom);\n        }\n    }\n\n    updatePaintArrays(\n        featureStates: FeatureStates,\n        featureMap: FeaturePositionMap,\n        vtLayer: VectorTileLayerLike,\n        layer: TypedStyleLayer,\n        options: PaintOptions\n    ): boolean {\n        let dirty: boolean = false;\n        for (const id in featureStates) {\n            const positions = featureMap.getPositions(id);\n\n            for (const pos of positions) {\n                const feature = vtLayer.feature(pos.index);\n\n                for (const property in this.binders) {\n                    const binder = this.binders[property];\n                    if ((binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder ||\n                         binder instanceof CrossFadedBinder) && binder.expression.isStateDependent === true) {\n                        //AHM: Remove after https://github.com/mapbox/mapbox-gl-js/issues/6255\n                        const value = (layer.paint as any).get(property);\n                        binder.expression = value.value;\n                        binder.updatePaintArray(pos.start, pos.end, feature, featureStates[id], options);\n                        dirty = true;\n                    }\n                }\n            }\n        }\n        return dirty;\n    }\n\n    defines(): Array<string> {\n        const result = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder) {\n                result.push(...binder.uniformNames.map(name => `#define HAS_UNIFORM_${name}`));\n            }\n        }\n        return result;\n    }\n\n    getBinderAttributes(): Array<string> {\n        const result = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder) {\n                for (let i = 0; i < binder.paintVertexAttributes.length; i++) {\n                    result.push(binder.paintVertexAttributes[i].name);\n                }\n            } else if (binder instanceof CrossFadedBinder) {\n                const attributes = binder.getVertexAttributes();\n                for (const attribute of attributes) {\n                    result.push(attribute.name);\n                }\n            }\n        }\n        return result;\n    }\n\n    getBinderUniforms(): Array<string> {\n        const uniforms = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder || binder instanceof CompositeExpressionBinder) {\n                for (const uniformName of binder.uniformNames) {\n                    uniforms.push(uniformName);\n                }\n            }\n        }\n        return uniforms;\n    }\n\n    getPaintVertexBuffers(): Array<VertexBuffer> {\n        return this._buffers;\n    }\n\n    getUniforms(context: Context, locations: UniformLocations): Array<BinderUniform> {\n        const uniforms = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder || binder instanceof CompositeExpressionBinder) {\n                for (const name of binder.uniformNames) {\n                    if (locations[name]) {\n                        const binding = binder.getBinding(context, locations[name], name);\n                        uniforms.push({name, property, binding});\n                    }\n                }\n            }\n        }\n        return uniforms;\n    }\n\n    setUniforms(\n        context: Context,\n        binderUniforms: Array<BinderUniform>,\n        properties: any,\n        globals: GlobalProperties\n    ) {\n        // Uniform state bindings are owned by the Program, but we set them\n        // from within the ProgramConfiguration's binder members.\n        for (const {name, property, binding} of binderUniforms) {\n            (this.binders[property] as any).setUniform(binding, globals, properties.get(property), name);\n        }\n    }\n\n    updatePaintBuffers(crossfade?: CrossfadeParameters) {\n        this._buffers = [];\n\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (crossfade && binder instanceof CrossFadedBinder) {\n                const patternVertexBuffer = crossfade.fromScale === 2 ? binder.zoomInPaintVertexBuffer : binder.zoomOutPaintVertexBuffer;\n                if (patternVertexBuffer) this._buffers.push(patternVertexBuffer);\n\n            } else if ((binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder) && binder.paintVertexBuffer) {\n                this._buffers.push(binder.paintVertexBuffer);\n            }\n        }\n    }\n\n    upload(context: Context) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedBinder)\n                binder.upload(context);\n        }\n        this.updatePaintBuffers();\n    }\n\n    destroy() {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedBinder)\n                binder.destroy();\n        }\n    }\n}\n\nexport class ProgramConfigurationSet<Layer extends TypedStyleLayer> {\n    programConfigurations: {[_: string]: ProgramConfiguration};\n    needsUpload: boolean;\n    _featureMap: FeaturePositionMap;\n    _bufferOffset: number;\n\n    constructor(layers: ReadonlyArray<Layer>, zoom: number, filterProperties: (_: string) => boolean = () => true) {\n        this.programConfigurations = {};\n        for (const layer of layers) {\n            this.programConfigurations[layer.id] = new ProgramConfiguration(layer, zoom, filterProperties);\n        }\n        this.needsUpload = false;\n        this._featureMap = new FeaturePositionMap();\n        this._bufferOffset = 0;\n    }\n\n    populatePaintArrays(length: number, feature: Feature, index: number, options: PaintOptions) {\n        for (const key in this.programConfigurations) {\n            this.programConfigurations[key].populatePaintArrays(length, feature, options);\n        }\n\n        if (feature.id !== undefined) {\n            this._featureMap.add(feature.id, index, this._bufferOffset, length);\n        }\n        this._bufferOffset = length;\n\n        this.needsUpload = true;\n    }\n\n    updatePaintArrays(featureStates: FeatureStates, vtLayer: VectorTileLayerLike, layers: ReadonlyArray<TypedStyleLayer>, options: PaintOptions) {\n        for (const layer of layers) {\n            this.needsUpload = this.programConfigurations[layer.id].updatePaintArrays(featureStates, this._featureMap, vtLayer, layer, options) || this.needsUpload;\n        }\n    }\n\n    get(layerId: string) {\n        return this.programConfigurations[layerId];\n    }\n\n    upload(context: Context) {\n        if (!this.needsUpload) return;\n        for (const layerId in this.programConfigurations) {\n            this.programConfigurations[layerId].upload(context);\n        }\n        this.needsUpload = false;\n    }\n\n    destroy() {\n        for (const layerId in this.programConfigurations) {\n            this.programConfigurations[layerId].destroy();\n        }\n    }\n}\n\nfunction paintAttributeNames(property: string, type: string) {\n    const attributeNameExceptions = {\n        'text-opacity': ['opacity'],\n        'icon-opacity': ['opacity'],\n        'text-color': ['fill_color'],\n        'icon-color': ['fill_color'],\n        'text-halo-color': ['halo_color'],\n        'icon-halo-color': ['halo_color'],\n        'text-halo-blur': ['halo_blur'],\n        'icon-halo-blur': ['halo_blur'],\n        'text-halo-width': ['halo_width'],\n        'icon-halo-width': ['halo_width'],\n        'line-gap-width': ['gapwidth'],\n        'line-dasharray': ['dasharray_to', 'dasharray_from'],\n        'line-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n        'fill-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n        'fill-extrusion-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n    };\n\n    return attributeNameExceptions[property] || [property.replace(`${type}-`, '').replace(/-/g, '_')];\n}\n\nfunction getLayoutException(property: string) {\n    const propertyExceptions = {\n        'line-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        },\n        'fill-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        },\n        'fill-extrusion-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        },\n        'line-dasharray': {\n            'source': DashLayoutArray,\n            'composite': DashLayoutArray\n        },\n    };\n\n    return propertyExceptions[property];\n}\n\nfunction layoutType(property: string, type: string, binderType: string) {\n    const defaultLayouts = {\n        'color': {\n            'source': StructArrayLayout2f8,\n            'composite': StructArrayLayout4f16\n        },\n        'number': {\n            'source': StructArrayLayout1f4,\n            'composite': StructArrayLayout2f8\n        }\n    };\n\n    const layoutException = getLayoutException(property);\n    return  layoutException && layoutException[binderType] || defaultLayouts[type][binderType];\n}\n\nregister('ConstantBinder', ConstantBinder);\nregister('CrossFadedConstantBinder', CrossFadedConstantBinder);\nregister('SourceExpressionBinder', SourceExpressionBinder);\nregister('CrossFadedPatternBinder', CrossFadedPatternBinder);\nregister('CrossFadedDasharrayBinder', CrossFadedDasharrayBinder);\nregister('CompositeExpressionBinder', CompositeExpressionBinder);\nregister('ProgramConfiguration', ProgramConfiguration, {omit: ['_buffers']});\nregister('ProgramConfigurationSet', ProgramConfigurationSet);\n","import {warnOnce, clamp} from '../util/util';\n\nimport {EXTENT} from './extent';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\n// These bounds define the minimum and maximum supported coordinate values.\n// While visible coordinates are within [0, EXTENT], tiles may theoretically\n// contain coordinates within [-Infinity, Infinity]. Our range is limited by the\n// number of bits used to represent the coordinate.\nconst BITS = 15;\nconst MAX = Math.pow(2, BITS - 1) - 1;\nconst MIN = -MAX - 1;\n\n/**\n * Loads a geometry from a VectorTileFeatureLike and scales it to the common extent\n * used internally.\n * @param feature - the vector tile feature to load\n */\nexport function loadGeometry(feature: VectorTileFeatureLike): Array<Array<Point>> {\n    const scale = EXTENT / feature.extent;\n    const geometry = feature.loadGeometry();\n    for (let r = 0; r < geometry.length; r++) {\n        const ring = geometry[r];\n        for (let p = 0; p < ring.length; p++) {\n            const point = ring[p];\n            // round here because mapbox-gl-native uses integers to represent\n            // points and we need to do the same to avoid rendering differences.\n            const x = Math.round(point.x * scale);\n            const y = Math.round(point.y * scale);\n\n            point.x = clamp(x, MIN, MAX);\n            point.y = clamp(y, MIN, MAX);\n\n            if (x < point.x || x > point.x + 1 || y < point.y || y > point.y + 1) {\n                // warn when exceeding allowed extent except for the 1-px-off case\n                // https://github.com/mapbox/mapbox-gl-js/issues/8992\n                warnOnce('Geometry exceeds allowed extent, reduce your vector tile buffer size');\n            }\n        }\n    }\n    return geometry;\n}\n","import {loadGeometry} from './load_geometry';\nimport type Point from '@mapbox/point-geometry';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\ntype EvaluationFeature = Feature & { geometry: Array<Array<Point>> };\n/**\n * Construct a new feature based on a VectorTileFeatureLike for expression evaluation, the geometry of which\n * will be loaded based on necessity.\n * @param feature - the feature to evaluate\n * @param needGeometry - if set to true this will load the geometry\n */\nexport function toEvaluationFeature(feature: VectorTileFeatureLike, needGeometry: boolean): EvaluationFeature {\n    return {type: feature.type,\n        id: feature.id,\n        properties: feature.properties,\n        geometry: needGeometry ? loadGeometry(feature) : []};\n}\n","import {CircleLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './circle_attributes';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EXTENT} from '../extent';\nimport {register} from '../../util/web_worker_transfer';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {type CircleGranularity} from '../../render/subdivision_granularity_settings';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nconst VERTEX_MIN_VALUE = -32768; // -(2^15)\n\n// Extrude is in range 0..7, which will be mapped to -1..1 in the shader.\nfunction addCircleVertex(layoutVertexArray, x, y, extrudeX, extrudeY) {\n    // We pack circle position and extrude into range 0..65535, but vertices are stored as *signed* 16-bit integers, so we need to offset the number by 2^15.\n    layoutVertexArray.emplaceBack(\n        VERTEX_MIN_VALUE + (x * 8) + extrudeX,\n        VERTEX_MIN_VALUE + (y * 8) + extrudeY);\n}\n\n/**\n * @internal\n * Circles are represented by two triangles.\n *\n * Each corner has a pos that is the center of the circle and an extrusion\n * vector that is where it points.\n */\nexport class CircleBucket<Layer extends CircleStyleLayer | HeatmapStyleLayer> implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layerIds: Array<string>;\n    layers: Array<Layer>;\n    stateDependentLayers: Array<Layer>;\n    stateDependentLayerIds: Array<string>;\n\n    layoutVertexArray: CircleLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: boolean;\n    programConfigurations: ProgramConfigurationSet<Layer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<Layer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasDependencies = false;\n\n        this.layoutVertexArray = new CircleLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.segments = new SegmentVector();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        const styleLayer = this.layers[0];\n        const bucketFeatures: BucketFeature[] = [];\n        let circleSortKey = null;\n        let sortFeaturesByKey = false;\n\n        // Heatmap circles are usually large (and map-pitch-aligned), tessellate them to allow curvature along the globe.\n        let subdivide = styleLayer.type === 'heatmap';\n\n        // Heatmap layers are handled in this bucket and have no evaluated properties, so we check our access\n        if (styleLayer.type === 'circle') {\n            const circleStyle = (styleLayer as CircleStyleLayer);\n            circleSortKey = circleStyle.layout.get('circle-sort-key');\n            sortFeaturesByKey = !circleSortKey.isConstant();\n\n            // Circles that are \"printed\" onto the map surface should be tessellated to follow the globe's curvature.\n            subdivide = subdivide || circleStyle.paint.get('circle-pitch-alignment') === 'map';\n        }\n\n        const granularity = subdivide ? options.subdivisionGranularity.circle : 1;\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                circleSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => a.sortKey - b.sortKey);\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n            const feature = features[index].feature;\n\n            this.addFeature(bucketFeature, geometry, index, canonical, granularity);\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, granularity: CircleGranularity = 1) {\n        // Since we store the circle's center in each vertex, we only have 3 bits for actual vertex position in each axis.\n        // Thus the valid range of positions is 0..7.\n        // This gives us 4 possible granularity settings that are symmetrical.\n\n        // This array stores vertex positions that should by used by the tessellated quad.\n        let extrudes: Array<number>;\n\n        switch (granularity) {\n            case 1:\n                extrudes = [0, 7];\n                break;\n            case 3:\n                extrudes = [0, 2, 5, 7];\n                break;\n            case 5:\n                extrudes = [0, 1, 3, 4, 6, 7];\n                break;\n            case 7:\n                extrudes = [0, 1, 2, 3, 4, 5, 6, 7];\n                break;\n            default:\n                throw new Error(`Invalid circle bucket granularity: ${granularity}; valid values are 1, 3, 5, 7.`);\n        }\n\n        const verticesPerAxis = extrudes.length;\n\n        for (const ring of geometry) {\n            for (const point of ring) {\n                const vx = point.x;\n                const vy = point.y;\n\n                // Do not include points that are outside the tile boundaries.\n                if (vx < 0 || vx >= EXTENT || vy < 0 || vy >= EXTENT) {\n                    continue;\n                }\n\n                const segment = this.segments.prepareSegment(verticesPerAxis * verticesPerAxis, this.layoutVertexArray, this.indexArray, feature.sortKey);\n                const index = segment.vertexLength;\n\n                for (let y = 0; y < verticesPerAxis; y++) {\n                    for (let x = 0; x < verticesPerAxis; x++) {\n                        addCircleVertex(this.layoutVertexArray, vx, vy, extrudes[x], extrudes[y]);\n                    }\n                }\n\n                for (let y = 0; y < verticesPerAxis - 1; y++) {\n                    for (let x = 0; x < verticesPerAxis - 1; x++) {\n                        const lowerIndex = index + y * verticesPerAxis + x;\n                        const upperIndex = index + (y + 1) * verticesPerAxis + x;\n                        this.indexArray.emplaceBack(lowerIndex, upperIndex + 1, lowerIndex + 1);\n                        this.indexArray.emplaceBack(lowerIndex, upperIndex, upperIndex + 1);\n                    }\n                }\n\n                segment.vertexLength += verticesPerAxis * verticesPerAxis;\n                segment.primitiveLength += (verticesPerAxis - 1) * (verticesPerAxis - 1) * 2;\n            }\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions: {}, canonical});\n    }\n}\n\nregister('CircleBucket', CircleBucket, {omit: ['layers']});\n","import {isCounterClockwise} from './util';\n\nimport Point from '@mapbox/point-geometry';\n\nexport {polygonIntersectsBufferedPoint, polygonIntersectsMultiPolygon, polygonIntersectsBufferedMultiLine, polygonIntersectsPolygon, distToSegmentSquared, polygonIntersectsBox};\n\ntype Line = Array<Point>;\ntype MultiLine = Array<Line>;\ntype Ring = Array<Point>;\ntype Polygon = Array<Point>;\ntype MultiPolygon = Array<Polygon>;\n\nfunction polygonIntersectsPolygon(polygonA: Polygon, polygonB: Polygon) {\n    for (let i = 0; i < polygonA.length; i++) {\n        if (polygonContainsPoint(polygonB, polygonA[i])) return true;\n    }\n\n    for (let i = 0; i < polygonB.length; i++) {\n        if (polygonContainsPoint(polygonA, polygonB[i])) return true;\n    }\n\n    if (lineIntersectsLine(polygonA, polygonB)) return true;\n\n    return false;\n}\n\nfunction polygonIntersectsBufferedPoint(polygon: Polygon, point: Point, radius: number) {\n    if (polygonContainsPoint(polygon, point)) return true;\n    if (pointIntersectsBufferedLine(point, polygon, radius)) return true;\n    return false;\n}\n\nfunction polygonIntersectsMultiPolygon(polygon: Polygon, multiPolygon: MultiPolygon) {\n\n    if (polygon.length === 1) {\n        return multiPolygonContainsPoint(multiPolygon, polygon[0]);\n    }\n\n    for (let m = 0; m < multiPolygon.length; m++) {\n        const ring = multiPolygon[m];\n        for (let n = 0; n < ring.length; n++) {\n            if (polygonContainsPoint(polygon, ring[n])) return true;\n        }\n    }\n\n    for (let i = 0; i < polygon.length; i++) {\n        if (multiPolygonContainsPoint(multiPolygon, polygon[i])) return true;\n    }\n\n    for (let k = 0; k < multiPolygon.length; k++) {\n        if (lineIntersectsLine(polygon, multiPolygon[k])) return true;\n    }\n\n    return false;\n}\n\nfunction polygonIntersectsBufferedMultiLine(polygon: Polygon, multiLine: MultiLine, radius: number) {\n    for (let i = 0; i < multiLine.length; i++) {\n        const line = multiLine[i];\n\n        if (polygon.length >= 3) {\n            for (let k = 0; k < line.length; k++) {\n                if (polygonContainsPoint(polygon, line[k])) return true;\n            }\n        }\n\n        if (lineIntersectsBufferedLine(polygon, line, radius)) return true;\n    }\n    return false;\n}\n\nfunction lineIntersectsBufferedLine(lineA: Line, lineB: Line, radius: number) {\n\n    if (lineA.length > 1) {\n        if (lineIntersectsLine(lineA, lineB)) return true;\n\n        // Check whether any point in either line is within radius of the other line\n        for (let j = 0; j < lineB.length; j++) {\n            if (pointIntersectsBufferedLine(lineB[j], lineA, radius)) return true;\n        }\n    }\n\n    for (let k = 0; k < lineA.length; k++) {\n        if (pointIntersectsBufferedLine(lineA[k], lineB, radius)) return true;\n    }\n\n    return false;\n}\n\nfunction lineIntersectsLine(lineA: Line, lineB: Line) {\n    if (lineA.length === 0 || lineB.length === 0) return false;\n    for (let i = 0; i < lineA.length - 1; i++) {\n        const a0 = lineA[i];\n        const a1 = lineA[i + 1];\n        for (let j = 0; j < lineB.length - 1; j++) {\n            const b0 = lineB[j];\n            const b1 = lineB[j + 1];\n            if (lineSegmentIntersectsLineSegment(a0, a1, b0, b1)) return true;\n        }\n    }\n    return false;\n}\n\nfunction lineSegmentIntersectsLineSegment(a0: Point, a1: Point, b0: Point, b1: Point) {\n    return isCounterClockwise(a0, b0, b1) !== isCounterClockwise(a1, b0, b1) &&\n        isCounterClockwise(a0, a1, b0) !== isCounterClockwise(a0, a1, b1);\n}\n\nfunction pointIntersectsBufferedLine(p: Point, line: Line, radius: number) {\n    const radiusSquared = radius * radius;\n\n    if (line.length === 1) return p.distSqr(line[0]) < radiusSquared;\n\n    for (let i = 1; i < line.length; i++) {\n        // Find line segments that have a distance <= radius^2 to p\n        // In that case, we treat the line as \"containing point p\".\n        const v = line[i - 1], w = line[i];\n        if (distToSegmentSquared(p, v, w) < radiusSquared) return true;\n    }\n    return false;\n}\n\n// Code from https://stackoverflow.com/a/1501725/331379.\nfunction distToSegmentSquared(p: Point, v: Point, w: Point) {\n    const l2 = v.distSqr(w);\n    if (l2 === 0) return p.distSqr(v);\n    const t = ((p.x - v.x) * (w.x - v.x) + (p.y - v.y) * (w.y - v.y)) / l2;\n    if (t < 0) return p.distSqr(v);\n    if (t > 1) return p.distSqr(w);\n    return p.distSqr(w.sub(v)._mult(t)._add(v));\n}\n\n// point in polygon ray casting algorithm\nfunction multiPolygonContainsPoint(rings: Array<Ring>, p: Point) {\n    let c = false,\n        ring, p1, p2;\n\n    for (let k = 0; k < rings.length; k++) {\n        ring = rings[k];\n        for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n            p1 = ring[i];\n            p2 = ring[j];\n            if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n                c = !c;\n            }\n        }\n    }\n    return c;\n}\n\nfunction polygonContainsPoint(ring: Ring, p: Point) {\n    let c = false;\n    for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n        const p1 = ring[i];\n        const p2 = ring[j];\n        if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n            c = !c;\n        }\n    }\n    return c;\n}\n\nfunction polygonIntersectsBox(ring: Ring, boxX1: number, boxY1: number, boxX2: number, boxY2: number) {\n    for (const p of ring) {\n        if (boxX1 <= p.x &&\n            boxY1 <= p.y &&\n            boxX2 >= p.x &&\n            boxY2 >= p.y) return true;\n    }\n\n    const corners = [\n        new Point(boxX1, boxY1),\n        new Point(boxX1, boxY2),\n        new Point(boxX2, boxY2),\n        new Point(boxX2, boxY1)];\n\n    if (ring.length > 2) {\n        for (const corner of corners) {\n            if (polygonContainsPoint(ring, corner)) return true;\n        }\n    }\n\n    for (let i = 0; i < ring.length - 1; i++) {\n        const p1 = ring[i];\n        const p2 = ring[i + 1];\n        if (edgeIntersectsBox(p1, p2, corners)) return true;\n    }\n\n    return false;\n}\n\nfunction edgeIntersectsBox(e1: Point, e2: Point, corners: Array<Point>) {\n    const tl = corners[0];\n    const br = corners[2];\n    // the edge and box do not intersect in either the x or y dimensions\n    if (((e1.x < tl.x) && (e2.x < tl.x)) ||\n        ((e1.x > br.x) && (e2.x > br.x)) ||\n        ((e1.y < tl.y) && (e2.y < tl.y)) ||\n        ((e1.y > br.y) && (e2.y > br.y))) return false;\n\n    // check if all corners of the box are on the same side of the edge\n    const dir = isCounterClockwise(e1, e2, corners[0]);\n    return dir !== isCounterClockwise(e1, e2, corners[1]) ||\n        dir !== isCounterClockwise(e1, e2, corners[2]) ||\n        dir !== isCounterClockwise(e1, e2, corners[3]);\n}\n","import Point from '@mapbox/point-geometry';\n\nimport type {PossiblyEvaluatedPropertyValue} from './properties';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CircleBucket} from '../data/bucket/circle_bucket';\nimport type {LineBucket} from '../data/bucket/line_bucket';\nimport {polygonIntersectsBufferedPoint} from '../util/intersection_tests';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {UnwrappedTileID} from '../tile/tile_id';\n\nexport function getMaximumPaintValue(\n    property: string,\n    layer: StyleLayer,\n    bucket: CircleBucket<any> | LineBucket\n): number {\n    const value = ((layer.paint as any).get(property) as PossiblyEvaluatedPropertyValue<any>).value;\n    if (value.kind === 'constant') {\n        return value.value;\n    } else {\n        return bucket.programConfigurations.get(layer.id).getMaxValue(property);\n    }\n}\n\nexport function translateDistance(translate: [number, number]) {\n    return Math.sqrt(translate[0] * translate[0] + translate[1] * translate[1]);\n}\n\n/**\n * @internal\n * Translates a geometry by a certain pixels in tile coordinates\n * @param queryGeometry - The geometry to translate in tile coordinates\n * @param translate - The translation in pixels\n * @param translateAnchor - The anchor of the translation\n * @param bearing - The bearing of the map\n * @param pixelsToTileUnits - The scale factor from pixels to tile units\n * @returns the translated geometry in tile coordinates\n */\nexport function translate(queryGeometry: Array<Point>,\n    translate: [number, number],\n    translateAnchor: 'viewport' | 'map',\n    bearing: number,\n    pixelsToTileUnits: number): Point[] {\n    if (!translate[0] && !translate[1]) {\n        return queryGeometry;\n    }\n    const pt = Point.convert(translate)._mult(pixelsToTileUnits);\n\n    if (translateAnchor === 'viewport') {\n        pt._rotate(-bearing);\n    }\n\n    const translated: Point[] = [];\n    for (let i = 0; i < queryGeometry.length; i++) {\n        const point = queryGeometry[i];\n        translated.push(point.sub(pt));\n    }\n    return translated;\n}\n\n/**\n * Filter out consecutive duplicate points from a line\n */\nfunction _stripDuplicates(ring: Array<Point>): Array<Point> {\n    const filteredRing: Array<Point> = [];\n    for (let index = 0; index < ring.length; index++) {\n        const point = ring[index];\n        const prevPoint = filteredRing.at(-1);\n        if (index === 0 || (prevPoint && !(point.equals(prevPoint)))) {\n            filteredRing.push(point);\n        }\n    }\n    return filteredRing;\n}\n\nexport function offsetLine(rings: Array<Array<Point>>, offset: number) {\n    const newRings: Array<Array<Point>> = [];\n    for (let ringIndex = 0; ringIndex < rings.length; ringIndex++) {\n        const ring = _stripDuplicates(rings[ringIndex]);\n        const newRing: Array<Point> = [];\n        for (let index = 0; index < ring.length; index++) {\n            const point = ring[index];\n            const prevPoint = ring[index - 1];\n            const nextPoint = ring[index + 1];\n            // perpendicular unit vectors (outward unit normal vector):\n            // these indicate which direction the segments should be offset in\n            const unitNormalAB: Point = index === 0 ? new Point(0, 0) : point.sub(prevPoint)._unit()._perp();\n            const unitNormalBC: Point = index === ring.length - 1 ? new Point(0, 0) : nextPoint.sub(point)._unit()._perp();\n            // unit bisector direction\n            const bisectorDir = unitNormalAB._add(unitNormalBC)._unit();\n            const cosHalfAngle = bisectorDir.x * unitNormalBC.x + bisectorDir.y * unitNormalBC.y;\n            if (cosHalfAngle !== 0) {\n                bisectorDir._mult(1 / cosHalfAngle);\n            }\n            newRing.push(bisectorDir._mult(offset)._add(point));\n        }\n        newRings.push(newRing);\n    }\n    return newRings;\n}\n\ntype CircleIntersectionTestParams = {\n    queryGeometry: Array<Point>;\n    size: number;\n    transform: IReadonlyTransform;\n    unwrappedTileID: UnwrappedTileID;\n    getElevation: undefined | ((x: number, y: number) => number);\n    pitchAlignment?: 'map' | 'viewport';\n    pitchScale?: 'map' | 'viewport';\n};\n\nfunction intersectionTestMapMap({queryGeometry, size}: CircleIntersectionTestParams, point: Point): boolean {\n    return polygonIntersectsBufferedPoint(queryGeometry, point, size);\n}\n\nfunction intersectionTestMapViewport({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    const w = transform.projectTileCoordinates(point.x, point.y, unwrappedTileID, getElevation).signedDistanceFromCamera;\n    const adjustedSize = size * (w / transform.cameraToCenterDistance);\n    return polygonIntersectsBufferedPoint(queryGeometry, point, adjustedSize);\n}\n\nfunction intersectionTestViewportMap({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    const w = transform.projectTileCoordinates(point.x, point.y, unwrappedTileID, getElevation).signedDistanceFromCamera;\n    const adjustedSize = size * (transform.cameraToCenterDistance / w);\n    return polygonIntersectsBufferedPoint(queryGeometry, projectPoint(point, transform, unwrappedTileID, getElevation), adjustedSize);\n}\n\nfunction intersectionTestViewportViewport({queryGeometry, size, transform, unwrappedTileID, getElevation}: CircleIntersectionTestParams, point: Point): boolean {\n    return polygonIntersectsBufferedPoint(queryGeometry, projectPoint(point, transform, unwrappedTileID, getElevation), size);\n}\n\nexport function circleIntersection({\n    queryGeometry,\n    size,\n    transform,\n    unwrappedTileID,\n    getElevation,\n    pitchAlignment = 'map',\n    pitchScale = 'map'\n}: CircleIntersectionTestParams, geometry): boolean {\n    const intersectionTest = pitchAlignment === 'map'\n        ? (pitchScale === 'map' ? intersectionTestMapMap : intersectionTestMapViewport)\n        : (pitchScale === 'map' ? intersectionTestViewportMap : intersectionTestViewportViewport);\n\n    const param = {queryGeometry, size, transform, unwrappedTileID, getElevation} as CircleIntersectionTestParams;\n    for (const ring of geometry) {\n        for (const point of ring) {\n            if (intersectionTest(param, point)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nfunction projectPoint(tilePoint: Point, transform: IReadonlyTransform, unwrappedTileID: UnwrappedTileID, getElevation: undefined | ((x: number, y: number) => number)): Point {\n    // Convert `tilePoint` from tile coordinates to clip coordinates.\n    const clipPoint = transform.projectTileCoordinates(tilePoint.x, tilePoint.y, unwrappedTileID, getElevation).point;\n    // Convert `clipPoint` from clip coordinates into pixel/screen coordinates.\n    const pixelPoint = new Point(\n        (clipPoint.x * 0.5 + 0.5) * transform.width,\n        (-clipPoint.y * 0.5 + 0.5) * transform.height\n    );\n    return pixelPoint;\n}\n\nexport function projectQueryGeometry(queryGeometry: Array<Point>, transform: IReadonlyTransform, unwrappedTileID: UnwrappedTileID, getElevation: undefined | ((x: number, y: number) => number)) {\n    return queryGeometry.map((p) => {\n        return projectPoint(p, transform, unwrappedTileID, getElevation);\n    });\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type CircleLayoutProps = {\n    \"circle-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type CircleLayoutPropsPossiblyEvaluated = {\n    \"circle-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<CircleLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"circle-sort-key\": new DataDrivenProperty(styleSpec[\"layout_circle\"][\"circle-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type CirclePaintProps = {\n    \"circle-radius\": DataDrivenProperty<number>,\n    \"circle-color\": DataDrivenProperty<Color>,\n    \"circle-blur\": DataDrivenProperty<number>,\n    \"circle-opacity\": DataDrivenProperty<number>,\n    \"circle-translate\": DataConstantProperty<[number, number]>,\n    \"circle-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-pitch-scale\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-stroke-width\": DataDrivenProperty<number>,\n    \"circle-stroke-color\": DataDrivenProperty<Color>,\n    \"circle-stroke-opacity\": DataDrivenProperty<number>,\n};\n\nexport type CirclePaintPropsPossiblyEvaluated = {\n    \"circle-radius\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"circle-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-translate\": [number, number],\n    \"circle-translate-anchor\": \"map\" | \"viewport\",\n    \"circle-pitch-scale\": \"map\" | \"viewport\",\n    \"circle-pitch-alignment\": \"map\" | \"viewport\",\n    \"circle-stroke-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-stroke-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"circle-stroke-opacity\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet paint: Properties<CirclePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"circle-radius\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-radius\"] as any as StylePropertySpecification),\n    \"circle-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-color\"] as any as StylePropertySpecification),\n    \"circle-blur\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-blur\"] as any as StylePropertySpecification),\n    \"circle-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-opacity\"] as any as StylePropertySpecification),\n    \"circle-translate\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate\"] as any as StylePropertySpecification),\n    \"circle-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate-anchor\"] as any as StylePropertySpecification),\n    \"circle-pitch-scale\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-scale\"] as any as StylePropertySpecification),\n    \"circle-pitch-alignment\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-alignment\"] as any as StylePropertySpecification),\n    \"circle-stroke-width\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-width\"] as any as StylePropertySpecification),\n    \"circle-stroke-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-color\"] as any as StylePropertySpecification),\n    \"circle-stroke-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });","import type Point from '@mapbox/point-geometry';\nimport {StyleLayer, type QueryIntersectsFeatureParams} from '../style_layer';\n\nimport {CircleBucket} from '../../data/bucket/circle_bucket';\nimport {circleIntersection, getMaximumPaintValue, projectQueryGeometry, translateDistance, translate} from '../query_utils';\nimport properties, {type CircleLayoutPropsPossiblyEvaluated, type CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated} from '../properties';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g';\n\nexport const isCircleStyleLayer = (layer: StyleLayer): layer is CircleStyleLayer => layer.type === 'circle';\n\n/**\n * A style layer that defines a circle\n */\nexport class CircleStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<CircleLayoutProps>;\n    layout: PossiblyEvaluated<CircleLayoutProps, CircleLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<CirclePaintProps>;\n    _transitioningPaint: Transitioning<CirclePaintProps>;\n    paint: PossiblyEvaluated<CirclePaintProps, CirclePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new CircleBucket(parameters);\n    }\n\n    queryRadius(bucket: Bucket): number {\n        const circleBucket: CircleBucket<CircleStyleLayer> = (bucket as any);\n        return getMaximumPaintValue('circle-radius', this, circleBucket) +\n            getMaximumPaintValue('circle-stroke-width', this, circleBucket) +\n            translateDistance(this.paint.get('circle-translate'));\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        unwrappedTileID,\n        getElevation}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('circle-translate'),\n            this.paint.get('circle-translate-anchor'),\n            -transform.bearingInRadians, pixelsToTileUnits);\n        const radius = this.paint.get('circle-radius').evaluate(feature, featureState);\n        const stroke = this.paint.get('circle-stroke-width').evaluate(feature, featureState);\n        const size  = radius + stroke;\n\n        // For pitch-alignment: map, compare feature geometry to query geometry in the plane of the tile\n        // Otherwise, compare geometry in the plane of the viewport\n        // A circle with fixed scaling relative to the viewport gets larger in tile space as it moves into the distance\n        // A circle with fixed scaling relative to the map gets smaller in viewport space as it moves into the distance\n\n        const pitchScale = this.paint.get('circle-pitch-scale');\n        const pitchAlignment = this.paint.get('circle-pitch-alignment');\n\n        let transformedPolygon: Array<Point>;\n        let transformedSize: number;\n        if (pitchAlignment === 'map') {\n            transformedPolygon = translatedPolygon;\n            transformedSize = size * pixelsToTileUnits;\n        } else {\n            transformedPolygon = projectQueryGeometry(translatedPolygon, transform, unwrappedTileID, getElevation);\n            transformedSize = size;\n        }\n\n        return circleIntersection({\n            queryGeometry: transformedPolygon,\n            size: transformedSize,\n            transform,\n            unwrappedTileID,\n            getElevation,\n            pitchAlignment,\n            pitchScale\n        }, geometry);\n    }\n}\n\n","import {CircleBucket} from './circle_bucket';\nimport {register} from '../../util/web_worker_transfer';\n\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\n\nexport class HeatmapBucket extends CircleBucket<HeatmapStyleLayer> {\n    // Needed for flow to accept omit: ['layers'] below, due to\n    // https://github.com/facebook/flow/issues/4262\n    layers: Array<HeatmapStyleLayer>;\n}\n\nregister('HeatmapBucket', HeatmapBucket, {omit: ['layers']});\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type HeatmapPaintProps = {\n    \"heatmap-radius\": DataDrivenProperty<number>,\n    \"heatmap-weight\": DataDrivenProperty<number>,\n    \"heatmap-intensity\": DataConstantProperty<number>,\n    \"heatmap-color\": ColorRampProperty,\n    \"heatmap-opacity\": DataConstantProperty<number>,\n};\n\nexport type HeatmapPaintPropsPossiblyEvaluated = {\n    \"heatmap-radius\": PossiblyEvaluatedPropertyValue<number>,\n    \"heatmap-weight\": PossiblyEvaluatedPropertyValue<number>,\n    \"heatmap-intensity\": number,\n    \"heatmap-color\": ColorRampProperty,\n    \"heatmap-opacity\": number,\n};\n\nlet paint: Properties<HeatmapPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"heatmap-radius\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-radius\"] as any as StylePropertySpecification),\n    \"heatmap-weight\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-weight\"] as any as StylePropertySpecification),\n    \"heatmap-intensity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-intensity\"] as any as StylePropertySpecification),\n    \"heatmap-color\": new ColorRampProperty(styleSpec[\"paint_heatmap\"][\"heatmap-color\"] as any as StylePropertySpecification),\n    \"heatmap-opacity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","import {type Color} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from './web_worker_transfer';\n\nexport type Size = {\n    width: number;\n    height: number;\n};\n\ntype Point2D = {\n    x: number;\n    y: number;\n};\n\nfunction createImage(image: any, {\n    width,\n    height\n}: Size, channels: number, data?: Uint8Array | Uint8ClampedArray) {\n    if (!data) {\n        data = new Uint8Array(width * height * channels);\n    } else if (data instanceof Uint8ClampedArray) {\n        data = new Uint8Array(data.buffer);\n    } else if (data.length !== width * height * channels) {\n        throw new RangeError(`mismatched image size. expected: ${data.length} but got: ${width * height * channels}`);\n    }\n    image.width = width;\n    image.height = height;\n    image.data = data;\n    return image;\n}\n\nfunction resizeImage(image: any, {\n    width,\n    height\n}: Size, channels: number) {\n    if (width === image.width && height === image.height) {\n        return;\n    }\n\n    const newImage = createImage({}, {width, height}, channels);\n\n    copyImage(image, newImage, {x: 0, y: 0}, {x: 0, y: 0}, {\n        width: Math.min(image.width, width),\n        height: Math.min(image.height, height)\n    }, channels);\n\n    image.width = width;\n    image.height = height;\n    image.data = newImage.data;\n}\n\nfunction copyImage(srcImg: any, dstImg: any, srcPt: Point2D, dstPt: Point2D, size: Size, channels: number) {\n    if (size.width === 0 || size.height === 0) {\n        return dstImg;\n    }\n\n    if (size.width > srcImg.width ||\n        size.height > srcImg.height ||\n        srcPt.x > srcImg.width - size.width ||\n        srcPt.y > srcImg.height - size.height) {\n        throw new RangeError('out of range source coordinates for image copy');\n    }\n\n    if (size.width > dstImg.width ||\n        size.height > dstImg.height ||\n        dstPt.x > dstImg.width - size.width ||\n        dstPt.y > dstImg.height - size.height) {\n        throw new RangeError('out of range destination coordinates for image copy');\n    }\n\n    const srcData = srcImg.data;\n    const dstData = dstImg.data;\n\n    if (srcData === dstData) throw new Error('srcData equals dstData, so image is already copied');\n\n    for (let y = 0; y < size.height; y++) {\n        const srcOffset = ((srcPt.y + y) * srcImg.width + srcPt.x) * channels;\n        const dstOffset = ((dstPt.y + y) * dstImg.width + dstPt.x) * channels;\n        for (let i = 0; i < size.width * channels; i++) {\n            dstData[dstOffset + i] = srcData[srcOffset + i];\n        }\n    }\n    return dstImg;\n}\n\n/**\n * An image with alpha color value\n */\nexport class AlphaImage {\n    width: number;\n    height: number;\n    data: Uint8Array;\n\n    constructor(size: Size, data?: Uint8Array | Uint8ClampedArray) {\n        createImage(this, size, 1, data);\n    }\n\n    resize(size: Size) {\n        resizeImage(this, size, 1);\n    }\n\n    clone() {\n        return new AlphaImage({width: this.width, height: this.height}, new Uint8Array(this.data));\n    }\n\n    static copy(srcImg: AlphaImage, dstImg: AlphaImage, srcPt: Point2D, dstPt: Point2D, size: Size) {\n        copyImage(srcImg, dstImg, srcPt, dstPt, size, 1);\n    }\n}\n\n/**\n * An object to store image data not premultiplied, because ImageData is not premultiplied.\n * UNPACK_PREMULTIPLY_ALPHA_WEBGL must be used when uploading to a texture.\n */\nexport class RGBAImage {\n    width: number;\n    height: number;\n\n    /**\n     * data must be a Uint8Array instead of Uint8ClampedArray because texImage2D does not support Uint8ClampedArray in all browsers.\n     */\n    data: Uint8Array;\n\n    constructor(size: Size, data?: Uint8Array | Uint8ClampedArray) {\n        createImage(this, size, 4, data);\n    }\n\n    resize(size: Size) {\n        resizeImage(this, size, 4);\n    }\n\n    replace(data: Uint8Array | Uint8ClampedArray, copy?: boolean) {\n        if (copy) {\n            this.data.set(data);\n        } else if (data instanceof Uint8ClampedArray) {\n            this.data = new Uint8Array(data.buffer);\n        } else {\n            this.data = data;\n        }\n    }\n\n    clone() {\n        return new RGBAImage({width: this.width, height: this.height}, new Uint8Array(this.data));\n    }\n\n    static copy(srcImg: RGBAImage | ImageData, dstImg: RGBAImage, srcPt: Point2D, dstPt: Point2D, size: Size) {\n        copyImage(srcImg, dstImg, srcPt, dstPt, size, 4);\n    }\n\n    setPixel(row: number, col: number, value: Color) {\n        const rLocation = (row * this.width + col) * 4;\n        this.data[rLocation + 0] = Math.round(value.r * 255 / value.a);\n        this.data[rLocation + 1] = Math.round(value.g * 255 / value.a);\n        this.data[rLocation + 2] = Math.round(value.b * 255 / value.a);\n        this.data[rLocation + 3] = Math.round(value.a * 255);\n    }\n}\n\nregister('AlphaImage', AlphaImage);\nregister('RGBAImage', RGBAImage);\n","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\n\nimport {HeatmapBucket} from '../../data/bucket/heatmap_bucket';\nimport {type RGBAImage} from '../../util/image';\nimport properties, {type HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties.g';\nimport {renderColorRamp} from '../../util/color_ramp';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {Texture} from '../../render/texture';\nimport type {Framebuffer} from '../../gl/framebuffer';\nimport type {HeatmapPaintProps} from './heatmap_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nimport {circleIntersection, getMaximumPaintValue} from '../query_utils';\nimport type {Bucket} from '../../data/bucket';\n\nexport const HEATMAP_FULL_RENDER_FBO_KEY = 'big-fb';\n\nexport const isHeatmapStyleLayer = (layer: StyleLayer): layer is HeatmapStyleLayer => layer.type === 'heatmap';\n\n/**\n * A style layer that defines a heatmap\n */\nexport class HeatmapStyleLayer extends StyleLayer {\n\n    heatmapFbos: Map<string, Framebuffer>;\n    colorRamp: RGBAImage;\n    colorRampTexture: Texture;\n\n    _transitionablePaint: Transitionable<HeatmapPaintProps>;\n    _transitioningPaint: Transitioning<HeatmapPaintProps>;\n    paint: PossiblyEvaluated<HeatmapPaintProps, HeatmapPaintPropsPossiblyEvaluated>;\n\n    createBucket(options: any) {\n        return new HeatmapBucket(options);\n    }\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n\n        this.heatmapFbos = new Map();\n        // make sure color ramp texture is generated for default heatmap color too\n        this._updateColorRamp();\n    }\n\n    _handleSpecialPaintPropertyUpdate(name: string) {\n        if (name === 'heatmap-color') {\n            this._updateColorRamp();\n        }\n    }\n\n    _updateColorRamp() {\n        const expression = this._transitionablePaint._values['heatmap-color'].value.expression;\n        this.colorRamp = renderColorRamp({\n            expression,\n            evaluationKey: 'heatmapDensity',\n            image: this.colorRamp\n        });\n        this.colorRampTexture = null;\n    }\n\n    resize() {\n        if (this.heatmapFbos.has(HEATMAP_FULL_RENDER_FBO_KEY)) {\n            this.heatmapFbos.delete(HEATMAP_FULL_RENDER_FBO_KEY);\n        }\n    }\n\n    queryRadius(bucket: Bucket): number {\n        return getMaximumPaintValue('heatmap-radius', this, bucket as HeatmapBucket);\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        unwrappedTileID,\n        getElevation}: QueryIntersectsFeatureParams\n    ): boolean {\n        return circleIntersection({\n            queryGeometry,\n            size: this.paint.get('heatmap-radius').evaluate(feature, featureState) * pixelsToTileUnits,\n            transform,\n            unwrappedTileID,\n            getElevation\n        }, geometry);\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('heatmap-opacity') !== 0 && !this.isHidden();\n    }\n}\n","import {RGBAImage} from './image';\nimport {isPowerOfTwo} from './util';\n\nimport type {StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\n\nexport type ColorRampParams = {\n    expression: StylePropertyExpression;\n    evaluationKey: string;\n    resolution?: number;\n    image?: RGBAImage;\n    clips?: Array<any>;\n};\n\n/**\n * Given an expression that should evaluate to a color ramp,\n * return a RGBA image representing that ramp expression.\n */\nexport function renderColorRamp(params: ColorRampParams): RGBAImage {\n    const evaluationGlobals = {};\n    const width = params.resolution || 256;\n    const height = params.clips ? params.clips.length : 1;\n    const image = params.image || new RGBAImage({width, height});\n\n    if (!isPowerOfTwo(width)) throw new Error(`width is not a power of 2 - ${width}`);\n\n    const renderPixel = (stride, index, progress) => {\n        evaluationGlobals[params.evaluationKey] = progress;\n        const pxColor = params.expression.evaluate(evaluationGlobals as any);\n        image.setPixel(stride / 4 / width, index / 4, pxColor);\n    };\n\n    if (!params.clips) {\n        for (let i = 0, j = 0; i < width; i++, j += 4) {\n            const progress = i / (width - 1);\n\n            renderPixel(0, j, progress);\n        }\n    } else {\n        for (let clip = 0, stride = 0; clip < height; ++clip, stride += width * 4) {\n            for (let i = 0, j = 0; i < width; i++, j += 4) {\n                // Remap progress between clips\n                const progress = i / (width - 1);\n                const {start, end} = params.clips[clip];\n                const evaluationProgress = start * (1 - progress) + end * progress;\n                renderPixel(stride, j, evaluationProgress);\n            }\n        }\n    }\n\n    return image;\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type HillshadePaintProps = {\n    \"hillshade-illumination-direction\": DataConstantProperty<NumberArray>,\n    \"hillshade-illumination-altitude\": DataConstantProperty<NumberArray>,\n    \"hillshade-illumination-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"hillshade-exaggeration\": DataConstantProperty<number>,\n    \"hillshade-shadow-color\": DataConstantProperty<ColorArray>,\n    \"hillshade-highlight-color\": DataConstantProperty<ColorArray>,\n    \"hillshade-accent-color\": DataConstantProperty<Color>,\n    \"hillshade-method\": DataConstantProperty<\"standard\" | \"basic\" | \"combined\" | \"igor\" | \"multidirectional\">,\n};\n\nexport type HillshadePaintPropsPossiblyEvaluated = {\n    \"hillshade-illumination-direction\": NumberArray,\n    \"hillshade-illumination-altitude\": NumberArray,\n    \"hillshade-illumination-anchor\": \"map\" | \"viewport\",\n    \"hillshade-exaggeration\": number,\n    \"hillshade-shadow-color\": ColorArray,\n    \"hillshade-highlight-color\": ColorArray,\n    \"hillshade-accent-color\": Color,\n    \"hillshade-method\": \"standard\" | \"basic\" | \"combined\" | \"igor\" | \"multidirectional\",\n};\n\nlet paint: Properties<HillshadePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"hillshade-illumination-direction\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-direction\"] as any as StylePropertySpecification),\n    \"hillshade-illumination-altitude\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-altitude\"] as any as StylePropertySpecification),\n    \"hillshade-illumination-anchor\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-anchor\"] as any as StylePropertySpecification),\n    \"hillshade-exaggeration\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-exaggeration\"] as any as StylePropertySpecification),\n    \"hillshade-shadow-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-shadow-color\"] as any as StylePropertySpecification),\n    \"hillshade-highlight-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-highlight-color\"] as any as StylePropertySpecification),\n    \"hillshade-accent-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-accent-color\"] as any as StylePropertySpecification),\n    \"hillshade-method\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-method\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","import {StyleLayer} from '../style_layer';\n\nimport properties, {type HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {HillshadePaintProps} from './hillshade_style_layer_properties.g';\nimport type {Color, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {degreesToRadians} from '../../util/util';\nimport type {EvaluationParameters} from '../evaluation_parameters';\n\nexport const isHillshadeStyleLayer = (layer: StyleLayer): layer is HillshadeStyleLayer => layer.type === 'hillshade';\n\nexport class HillshadeStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<HillshadePaintProps>;\n    _transitioningPaint: Transitioning<HillshadePaintProps>;\n    paint: PossiblyEvaluated<HillshadePaintProps, HillshadePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n        this.recalculate({zoom: 0, zoomHistory: {}} as EvaluationParameters, undefined);\n    }\n\n    getIlluminationProperties(): {directionRadians: number[]; altitudeRadians: number[]; shadowColor: Color[]; highlightColor: Color[]} {\n        let direction = this.paint.get('hillshade-illumination-direction').values;\n        let altitude = this.paint.get('hillshade-illumination-altitude').values;\n        let highlightColor = this.paint.get('hillshade-highlight-color').values;\n        let shadowColor = this.paint.get('hillshade-shadow-color').values;\n\n        // ensure all illumination properties have the same length\n        const numIlluminationSources = Math.max(direction.length, altitude.length, highlightColor.length, shadowColor.length);\n        direction = direction.concat(Array(numIlluminationSources - direction.length).fill(direction.at(-1)));\n        altitude = altitude.concat(Array(numIlluminationSources - altitude.length).fill(altitude.at(-1)));\n        highlightColor = highlightColor.concat(Array(numIlluminationSources - highlightColor.length).fill(highlightColor.at(-1)));\n        shadowColor = shadowColor.concat(Array(numIlluminationSources - shadowColor.length).fill(shadowColor.at(-1)));\n\n        const altitudeRadians = altitude.map(degreesToRadians);\n        const directionRadians = direction.map(degreesToRadians);\n\n        return {directionRadians, altitudeRadians, shadowColor, highlightColor};\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('hillshade-exaggeration') !== 0 && !this.isHidden();\n    }\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type ColorReliefPaintProps = {\n    \"color-relief-opacity\": DataConstantProperty<number>,\n    \"color-relief-color\": ColorRampProperty,\n};\n\nexport type ColorReliefPaintPropsPossiblyEvaluated = {\n    \"color-relief-opacity\": number,\n    \"color-relief-color\": ColorRampProperty,\n};\n\nlet paint: Properties<ColorReliefPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"color-relief-opacity\": new DataConstantProperty(styleSpec[\"paint_color-relief\"][\"color-relief-opacity\"] as any as StylePropertySpecification),\n    \"color-relief-color\": new ColorRampProperty(styleSpec[\"paint_color-relief\"][\"color-relief-color\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","import type {Context} from '../gl/context';\nimport type {RGBAImage, AlphaImage} from '../util/image';\nimport {isImageBitmap} from '../util/util';\n\nexport type TextureFormat = WebGLRenderingContextBase['RGBA'] | WebGLRenderingContextBase['ALPHA'];\nexport type TextureFilter = WebGLRenderingContextBase['LINEAR'] | WebGLRenderingContextBase['LINEAR_MIPMAP_NEAREST'] | WebGLRenderingContextBase['NEAREST'];\nexport type TextureWrap = WebGLRenderingContextBase['REPEAT'] | WebGLRenderingContextBase['CLAMP_TO_EDGE'] | WebGLRenderingContextBase['MIRRORED_REPEAT'];\n\ntype EmptyImage = {\n    width: number;\n    height: number;\n    data: null;\n};\n\ntype DataTextureImage = RGBAImage | AlphaImage | EmptyImage;\nexport type TextureImage = TexImageSource | DataTextureImage;\n\n/**\n * @internal\n * A `Texture` GL related object\n */\nexport class Texture {\n    context: Context;\n    size: [number, number];\n    texture: WebGLTexture;\n    format: TextureFormat;\n    filter: TextureFilter;\n    wrap: TextureWrap;\n    useMipmap: boolean;\n\n    constructor(context: Context, image: TextureImage, format: TextureFormat, options?: {\n        premultiply?: boolean;\n        useMipmap?: boolean;\n    } | null) {\n        this.context = context;\n        this.format = format;\n        this.texture = context.gl.createTexture();\n        this.update(image, options);\n    }\n\n    update(image: TextureImage, options?: {\n        premultiply?: boolean;\n        useMipmap?: boolean;\n    } | null, position?: {\n        x: number;\n        y: number;\n    }) {\n        const {width, height} = image as {width: number; height: number};\n        const resize = (!this.size || this.size[0] !== width || this.size[1] !== height) && !position;\n        const {context} = this;\n        const {gl} = context;\n\n        this.useMipmap = Boolean(options && options.useMipmap);\n        gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n        context.pixelStoreUnpackFlipY.set(false);\n        context.pixelStoreUnpack.set(1);\n        context.pixelStoreUnpackPremultiplyAlpha.set(this.format === gl.RGBA && (!options || options.premultiply !== false));\n\n        if (resize) {\n            this.size = [width, height];\n\n            if (image instanceof HTMLImageElement || image instanceof HTMLCanvasElement || image instanceof HTMLVideoElement || image instanceof ImageData || isImageBitmap(image)) {\n                gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, gl.UNSIGNED_BYTE, image);\n            } else {\n                gl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, gl.UNSIGNED_BYTE, (image as DataTextureImage).data);\n            }\n\n        } else {\n            const {x, y} = position || {x: 0, y: 0};\n            if (image instanceof HTMLImageElement || image instanceof HTMLCanvasElement || image instanceof HTMLVideoElement || image instanceof ImageData || isImageBitmap(image)) {\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, gl.RGBA, gl.UNSIGNED_BYTE, image);\n            } else {\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, (image as DataTextureImage).data);\n            }\n        }\n\n        if (this.useMipmap && this.isSizePowerOfTwo()) {\n            gl.generateMipmap(gl.TEXTURE_2D);\n        }\n\n        context.pixelStoreUnpackFlipY.setDefault();\n        context.pixelStoreUnpack.setDefault();\n        context.pixelStoreUnpackPremultiplyAlpha.setDefault();\n    }\n\n    bind(filter: TextureFilter, wrap: TextureWrap, minFilter?: TextureFilter | null) {\n        const {context} = this;\n        const {gl} = context;\n        gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n        if (minFilter === gl.LINEAR_MIPMAP_NEAREST && !this.isSizePowerOfTwo()) {\n            minFilter = gl.LINEAR;\n        }\n\n        if (filter !== this.filter) {\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter || filter);\n            this.filter = filter;\n        }\n\n        if (wrap !== this.wrap) {\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrap);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrap);\n            this.wrap = wrap;\n        }\n    }\n\n    isSizePowerOfTwo() {\n        return this.size[0] === this.size[1] && (Math.log(this.size[0]) / Math.LN2) % 1 === 0;\n    }\n\n    destroy() {\n        const {gl} = this.context;\n        gl.deleteTexture(this.texture);\n        this.texture = null;\n    }\n}\n","import {RGBAImage} from '../util/image';\n\nimport {warnOnce} from '../util/util';\nimport {register} from '../util/web_worker_transfer';\n\n/**\n * The possible DEM encoding types\n */\nexport type DEMEncoding = 'mapbox' | 'terrarium' | 'custom';\n\n/**\n * DEMData is a data structure for decoding, backfilling, and storing elevation data for processing in the hillshade shaders\n * data can be populated either from a png raw image tile or from serialized data sent back from a worker. When data is initially\n * loaded from a image tile, we decode the pixel values using the appropriate decoding formula, but we store the\n * elevation data as an Int32 value. we add 65536 (2^16) to eliminate negative values and enable the use of\n * integer overflow when creating the texture used in the hillshadePrepare step.\n *\n * DEMData also handles the backfilling of data from a tile's neighboring tiles. This is necessary because we use a pixel's 8\n * surrounding pixel values to compute the slope at that pixel, and we cannot accurately calculate the slope at pixels on a\n * tile's edge without backfilling from neighboring tiles.\n */\nexport class DEMData {\n    uid: string | number;\n    data: Uint32Array;\n    stride: number;\n    dim: number;\n    min: number;\n    max: number;\n    redFactor: number;\n    greenFactor: number;\n    blueFactor: number;\n    baseShift: number;\n\n    /**\n     * Constructs a `DEMData` object\n     * @param uid - the tile's unique id\n     * @param data - RGBAImage data has uniform 1px padding on all sides: square tile edge size defines stride\n    // and dim is calculated as stride - 2.\n     * @param encoding - the encoding type of the data\n     * @param redFactor - the red channel factor used to unpack the data, used for `custom` encoding only\n     * @param greenFactor - the green channel factor used to unpack the data, used for `custom` encoding only\n     * @param blueFactor - the blue channel factor used to unpack the data, used for `custom` encoding only\n     * @param baseShift - the base shift used to unpack the data, used for `custom` encoding only\n     */\n    constructor(uid: string | number, data: RGBAImage | ImageData, encoding: DEMEncoding, redFactor = 1.0, greenFactor = 1.0, blueFactor = 1.0, baseShift = 0.0) {\n        this.uid = uid;\n        if (data.height !== data.width) throw new RangeError('DEM tiles must be square');\n        if (encoding && !['mapbox', 'terrarium', 'custom'].includes(encoding)) {\n            warnOnce(`\"${encoding}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);\n            return;\n        }\n        this.stride = data.height;\n        const dim = this.dim = data.height - 2;\n        this.data = new Uint32Array(data.data.buffer);\n        switch (encoding) {\n            case 'terrarium':\n                // unpacking formula for mapzen terrarium:\n                // https://aws.amazon.com/public-datasets/terrain/\n                this.redFactor = 256.0;\n                this.greenFactor = 1.0;\n                this.blueFactor = 1.0 / 256.0;\n                this.baseShift = 32768.0;\n                break;\n            case 'custom':\n                this.redFactor = redFactor;\n                this.greenFactor = greenFactor;\n                this.blueFactor = blueFactor;\n                this.baseShift = baseShift;\n                break;\n            case 'mapbox':\n            default:\n                // unpacking formula for mapbox.terrain-rgb:\n                // https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb\n                this.redFactor = 6553.6;\n                this.greenFactor = 25.6;\n                this.blueFactor = 0.1;\n                this.baseShift = 10000.0;\n                break;\n        }\n\n        // in order to avoid flashing seams between tiles, here we are initially populating a 1px border of pixels around the image\n        // with the data of the nearest pixel from the image. this data is eventually replaced when the tile's neighboring\n        // tiles are loaded and the accurate data can be backfilled using DEMData#backfillBorder\n        for (let x = 0; x < dim; x++) {\n            // left vertical border\n            this.data[this._idx(-1, x)] = this.data[this._idx(0, x)];\n            // right vertical border\n            this.data[this._idx(dim, x)] = this.data[this._idx(dim - 1, x)];\n            // left horizontal border\n            this.data[this._idx(x, -1)] = this.data[this._idx(x, 0)];\n            // right horizontal border\n            this.data[this._idx(x, dim)] = this.data[this._idx(x, dim - 1)];\n        }\n        // corners\n        this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)];\n        this.data[this._idx(dim, -1)] = this.data[this._idx(dim - 1, 0)];\n        this.data[this._idx(-1, dim)] = this.data[this._idx(0, dim - 1)];\n        this.data[this._idx(dim, dim)] = this.data[this._idx(dim - 1, dim - 1)];\n\n        // calculate min/max values\n        this.min = Number.MAX_SAFE_INTEGER;\n        this.max = Number.MIN_SAFE_INTEGER;\n        for (let x = 0; x < dim; x++) {\n            for (let y = 0; y < dim; y++) {\n                const ele = this.get(x, y);\n                if (ele > this.max) this.max = ele;\n                if (ele < this.min) this.min = ele;\n            }\n        }\n    }\n\n    get(x: number, y: number) {\n        const pixels = new Uint8Array(this.data.buffer);\n        const index = this._idx(x, y) * 4;\n        return this.unpack(pixels[index], pixels[index + 1], pixels[index + 2]);\n    }\n\n    getUnpackVector() {\n        return [this.redFactor, this.greenFactor, this.blueFactor, this.baseShift];\n    }\n\n    _idx(x: number, y: number) {\n        if (x < -1 || x >= this.dim + 1 ||  y < -1 || y >= this.dim + 1) throw new RangeError(`Out of range source coordinates for DEM data. x: ${x}, y: ${y}, dim: ${this.dim}`);\n        return (y + 1) * this.stride + (x + 1);\n    }\n\n    unpack(r: number, g: number, b: number) {\n        return (r * this.redFactor + g * this.greenFactor + b * this.blueFactor - this.baseShift);\n    }\n\n    pack(v: number): {r: number; g: number; b: number} {\n        return packDEMData(v, this.getUnpackVector());\n    }\n\n    getPixels() {\n        return new RGBAImage({width: this.stride, height: this.stride}, new Uint8Array(this.data.buffer));\n    }\n\n    backfillBorder(borderTile: DEMData, dx: number, dy: number) {\n        if (this.dim !== borderTile.dim) throw new Error('dem dimension mismatch');\n\n        let xMin = dx * this.dim,\n            xMax = dx * this.dim + this.dim,\n            yMin = dy * this.dim,\n            yMax = dy * this.dim + this.dim;\n\n        switch (dx) {\n            case -1:\n                xMin = xMax - 1;\n                break;\n            case 1:\n                xMax = xMin + 1;\n                break;\n        }\n\n        switch (dy) {\n            case -1:\n                yMin = yMax - 1;\n                break;\n            case 1:\n                yMax = yMin + 1;\n                break;\n        }\n\n        const ox = -dx * this.dim;\n        const oy = -dy * this.dim;\n        for (let y = yMin; y < yMax; y++) {\n            for (let x = xMin; x < xMax; x++) {\n                this.data[this._idx(x, y)] = borderTile.data[this._idx(x + ox, y + oy)];\n            }\n        }\n    }\n}\n\nexport function packDEMData(v: number, unpackVector: number[]): {r: number; g: number; b: number} {\n    const redFactor = unpackVector[0];\n    const greenFactor = unpackVector[1];\n    const blueFactor = unpackVector[2];\n    const baseShift = unpackVector[3];\n    const minScale = Math.min(redFactor, greenFactor, blueFactor);\n    const vScaled = Math.round((v + baseShift)/minScale);\n    return {\n        r: Math.floor(vScaled*minScale/redFactor) % 256,\n        g: Math.floor(vScaled*minScale/greenFactor) % 256,\n        b: Math.floor(vScaled*minScale/blueFactor) % 256\n    };\n}\n\nregister('DEMData', DEMData);\n","import {StyleLayer} from '../style_layer';\n\nimport properties, {type ColorReliefPaintPropsPossiblyEvaluated} from './color_relief_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {ColorReliefPaintProps} from './color_relief_style_layer_properties.g';\nimport {Color, Interpolate, ZoomConstantExpression, type LayerSpecification, type EvaluationContext, type StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {warnOnce} from '../../util/util';\nimport {Texture} from '../../render/texture';\nimport {RGBAImage} from '../../util/image';\nimport {type Context} from '../../gl/context';\nimport {packDEMData} from '../../data/dem_data';\n\nexport const isColorReliefStyleLayer = (layer: StyleLayer): layer is ColorReliefStyleLayer => layer.type === 'color-relief';\n\nexport type ColorRamp = {elevationStops: Array<number>; colorStops: Array<Color>};\nexport type ColorRampTextures = {elevationTexture: Texture; colorTexture: Texture};\n\nexport class ColorReliefStyleLayer extends StyleLayer {\n    colorRampExpression: StylePropertyExpression;\n    colorRampTextures: ColorRampTextures;\n    _transitionablePaint: Transitionable<ColorReliefPaintProps>;\n    _transitioningPaint: Transitioning<ColorReliefPaintProps>;\n    paint: PossiblyEvaluated<ColorReliefPaintProps, ColorReliefPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    /**\n     * Create the color ramp, enforcing a maximum length for the vectors. This modifies the internal color ramp,\n     * so that the remapping is only performed once.\n     *\n     * @param maxLength - the maximum number of stops in the color ramp\n     *\n     * @return a `ColorRamp` object with no more than `maxLength` stops.\n     *\n     */\n\n    _createColorRamp(maxLength: number) : ColorRamp {\n        const colorRamp: ColorRamp = {elevationStops: [], colorStops: []};\n        const expression = this._transitionablePaint._values['color-relief-color'].value.expression;\n        if (expression instanceof ZoomConstantExpression && expression._styleExpression.expression instanceof Interpolate) {\n            this.colorRampExpression = expression;\n            const interpolater = expression._styleExpression.expression;\n            colorRamp.elevationStops = interpolater.labels;\n            colorRamp.colorStops = [];\n            for (const label of colorRamp.elevationStops) {\n                colorRamp.colorStops.push(interpolater.evaluate({globals: {elevation: label}} as EvaluationContext));\n            }\n        }\n        if (colorRamp.elevationStops.length < 1)\n        {\n            colorRamp.elevationStops = [0];\n            colorRamp.colorStops = [Color.transparent];\n        }\n        if (colorRamp.elevationStops.length < 2)\n        {\n            colorRamp.elevationStops.push(colorRamp.elevationStops[0] + 1);\n            colorRamp.colorStops.push(colorRamp.colorStops[0]);\n        }\n        if (colorRamp.elevationStops.length <= maxLength) {\n            return colorRamp;\n        }\n\n        const remappedColorRamp: ColorRamp = {elevationStops: [], colorStops: []};\n        const remapStepSize = (colorRamp.elevationStops.length - 1)/(maxLength - 1);\n\n        for (let i = 0; i < colorRamp.elevationStops.length - 0.5; i += remapStepSize) {\n            remappedColorRamp.elevationStops.push(colorRamp.elevationStops[Math.round(i)]);\n            remappedColorRamp.colorStops.push(colorRamp.colorStops[Math.round(i)]);\n        }\n        warnOnce(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${maxLength}, provided: ${colorRamp.elevationStops.length}`);\n        return remappedColorRamp;\n    }\n\n    _colorRampChanged() : boolean {\n        return this.colorRampExpression != this._transitionablePaint._values['color-relief-color'].value.expression;\n    }\n\n    getColorRampTextures(context: Context, maxLength: number, unpackVector: number[]): ColorRampTextures {\n        if (this.colorRampTextures && !this._colorRampChanged()) {\n            return this.colorRampTextures;\n        }\n        const colorRamp = this._createColorRamp(maxLength);\n        const colorImage = new RGBAImage({width: colorRamp.colorStops.length, height: 1});\n        const elevationImage = new RGBAImage({width: colorRamp.colorStops.length, height: 1});\n        for (let i = 0; i < colorRamp.elevationStops.length; i++) {\n            const elevationPacked = packDEMData(colorRamp.elevationStops[i], unpackVector);\n            elevationImage.setPixel(0, i, new Color(elevationPacked.r/255, elevationPacked.g/255, elevationPacked.b/255, 1));\n            colorImage.setPixel(0, i, colorRamp.colorStops[i]);\n        }\n        this.colorRampTextures = {\n            elevationTexture: new Texture(context, elevationImage, context.gl.RGBA),\n            colorTexture: new Texture(context, colorImage, context.gl.RGBA)\n        };\n        return this.colorRampTextures;\n    }\n\n    hasOffscreenPass() {\n        return !this.isHidden() && !!this.colorRampTextures;\n    }\n}\n","import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n","import type {FillStyleLayer} from '../../style/style_layer/fill_style_layer';\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\n\nimport type {\n    BucketFeature,\n    PopulateParameters\n} from '../bucket';\nimport {type PossiblyEvaluated} from '../../style/properties';\n\ntype PatternStyleLayers = Array<LineStyleLayer> | Array<FillStyleLayer> | Array<FillExtrusionStyleLayer>;\n\nexport function hasPattern(type: string, layers: PatternStyleLayers, options: PopulateParameters) {\n    const patterns = options.patternDependencies;\n    let hasPattern = false;\n\n    for (const layer of layers) {\n        const patternProperty = (layer.paint as PossiblyEvaluated<any, any>).get(`${type}-pattern`);\n        if (!patternProperty.isConstant()) {\n            hasPattern = true;\n        }\n\n        const constantPattern = patternProperty.constantOr(null);\n        if (constantPattern) {\n            hasPattern = true;\n            patterns[constantPattern.to] =  true;\n            patterns[constantPattern.from] =  true;\n        }\n    }\n\n    return hasPattern;\n}\n\nexport function addPatternDependencies(type: string, layers: PatternStyleLayers, patternFeature: BucketFeature, parameters: { zoom: number }, options: PopulateParameters) {\n    const {zoom} = parameters;\n    const patterns = options.patternDependencies;\n    for (const layer of layers) {\n        const patternProperty = (layer.paint  as PossiblyEvaluated<any, any>).get(`${type}-pattern`);\n\n        const patternPropertyValue = patternProperty.value;\n        if (patternPropertyValue.kind !== 'constant') {\n            let min = patternPropertyValue.evaluate({zoom: zoom - 1}, patternFeature, {}, options.availableImages);\n            let mid = patternPropertyValue.evaluate({zoom}, patternFeature, {}, options.availableImages);\n            let max = patternPropertyValue.evaluate({zoom: zoom + 1}, patternFeature, {}, options.availableImages);\n            min = min && min.name ? min.name : min;\n            mid = mid && mid.name ? mid.name : mid;\n            max = max && max.name ? max.name : max;\n            // add to patternDependencies\n            patterns[min] = true;\n            patterns[mid] = true;\n            patterns[max] = true;\n\n            // save for layout\n            patternFeature.patterns[layer.id] = {min, mid, max};\n        }\n    }\n    return patternFeature;\n}\n","\nexport default function earcut(data, holeIndices, dim = 2) {\n\n    const hasHoles = holeIndices && holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n    let outerNode = linkedList(data, 0, outerLen, dim, true);\n    const triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    let minX, minY, invSize;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length > 80 * dim) {\n        minX = data[0];\n        minY = data[1];\n        let maxX = minX;\n        let maxY = minY;\n\n        for (let i = dim; i < outerLen; i += dim) {\n            const x = data[i];\n            const y = data[i + 1];\n            if (x < minX) minX = x;\n            if (y < minY) minY = y;\n            if (x > maxX) maxX = x;\n            if (y > maxY) maxY = y;\n        }\n\n        // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n        invSize = Math.max(maxX - minX, maxY - minY);\n        invSize = invSize !== 0 ? 32767 / invSize : 0;\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    let last;\n\n    if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n        for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    } else {\n        for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    }\n\n    if (last && equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    let p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) break;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n    let stop = ear;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        const prev = ear.prev;\n        const next = ear.next;\n\n        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n            triangles.push(prev.i, ear.i, next.i); // cut off the triangle\n\n            removeNode(ear);\n\n            // skipping the next vertex leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(filterPoints(ear), triangles);\n                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, invSize);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    let p = c.next;\n    while (p !== a) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    // z-order range for the current triangle bbox;\n    const minZ = zOrder(x0, y0, minX, minY, invSize),\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    let p = ear.prevZ,\n        n = ear.nextZ;\n\n    // look for points inside the triangle in both directions\n    while (p && p.z >= minZ && n && n.z <= maxZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    // look for remaining points in decreasing z-order\n    while (p && p.z >= minZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n\n    // look for remaining points in increasing z-order\n    while (n && n.z <= maxZ) {\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles) {\n    let p = start;\n    do {\n        const a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n            triangles.push(a.i, p.i, b.i);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n    // look for a valid diagonal that divides the polygon into two\n    let a = start;\n    do {\n        let b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                let c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    const queue = [];\n\n    for (let i = 0, len = holeIndices.length; i < len; i++) {\n        const start = holeIndices[i] * dim;\n        const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n        const list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareXYSlope);\n\n    // process holes from left to right\n    for (let i = 0; i < queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n\n    return outerNode;\n}\n\nfunction compareXYSlope(a, b) {\n    let result = a.x - b.x;\n    // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n    // the bridge to the outer shell is always the point that they meet at.\n    if (result === 0) {\n        result = a.y - b.y;\n        if (result === 0) {\n            const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n            const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n            result = aSlope - bSlope;\n        }\n    }\n    return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and link it\nfunction eliminateHole(hole, outerNode) {\n    const bridge = findHoleBridge(hole, outerNode);\n    if (!bridge) {\n        return outerNode;\n    }\n\n    const bridgeReverse = splitPolygon(bridge, hole);\n\n    // filter collinear points around the cuts\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    let p = outerNode;\n    const hx = hole.x;\n    const hy = hole.y;\n    let qx = -Infinity;\n    let m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    // unless they intersect at a vertex, then choose the vertex\n    if (equals(hole, p)) return p;\n    do {\n        if (equals(hole, p.next)) return p.next;\n        else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n            const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x <= hx && x > qx) {\n                qx = x;\n                m = p.x < p.next.x ? p : p.next;\n                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    const stop = m;\n    const mx = m.x;\n    const my = m.y;\n    let tanMin = Infinity;\n\n    p = m;\n\n    do {\n        if (hx >= p.x && p.x >= mx && hx !== p.x &&\n                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n            const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if (locallyInside(p, hole) &&\n                (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    } while (p !== stop);\n\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n    let p = start;\n    do {\n        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    let numMerges;\n    let inSize = 1;\n\n    do {\n        let p = list;\n        let e;\n        list = null;\n        let tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            let q = p;\n            let pSize = 0;\n            for (let i = 0; i < inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n            let qSize = inSize;\n\n            while (pSize > 0 || (qSize > 0 && q)) {\n\n                if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges > 1);\n\n    return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = (x - minX) * invSize | 0;\n    y = (y - minY) * invSize | 0;\n\n    x = (x | (x << 8)) & 0x00FF00FF;\n    x = (x | (x << 4)) & 0x0F0F0F0F;\n    x = (x | (x << 2)) & 0x33333333;\n    x = (x | (x << 1)) & 0x55555555;\n\n    y = (y | (y << 8)) & 0x00FF00FF;\n    y = (y | (y << 4)) & 0x0F0F0F0F;\n    y = (y | (y << 2)) & 0x33333333;\n    y = (y | (y << 1)) & 0x55555555;\n\n    return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    let p = start,\n        leftmost = start;\n    do {\n        if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n           (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n    return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // doesn't intersect other edges\n           (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n            equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    const o1 = sign(area(p1, q1, p2));\n    const o2 = sign(area(p1, q1, q2));\n    const o3 = sign(area(p2, q2, p1));\n    const o4 = sign(area(p2, q2, q1));\n\n    if (o1 !== o2 && o3 !== o4) return true; // general case\n\n    if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n    if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n    if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n    if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n    return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n    return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    let p = a;\n    do {\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) < 0 ?\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    let p = a;\n    let inside = false;\n    const px = (a.x + b.x) / 2;\n    const py = (a.y + b.y) / 2;\n    do {\n        if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n                (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    const a2 = createNode(a.i, a.x, a.y),\n        b2 = createNode(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    const p = createNode(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction createNode(i, x, y) {\n    return {\n        i, // vertex index in coordinates array\n        x, y, // vertex coordinates\n        prev: null, // previous and next vertex nodes in a polygon ring\n        next: null,\n        z: 0, // z-order curve value\n        prevZ: null, // previous and next nodes in z-order\n        nextZ: null,\n        steiner: false // indicates whether this is a steiner point\n    };\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nexport function deviation(data, holeIndices, dim, triangles) {\n    const hasHoles = holeIndices && holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n    let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n    if (hasHoles) {\n        for (let i = 0, len = holeIndices.length; i < len; i++) {\n            const start = holeIndices[i] * dim;\n            const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n            polygonArea -= Math.abs(signedArea(data, start, end, dim));\n        }\n    }\n\n    let trianglesArea = 0;\n    for (let i = 0; i < triangles.length; i += 3) {\n        const a = triangles[i] * dim;\n        const b = triangles[i + 1] * dim;\n        const c = triangles[i + 2] * dim;\n        trianglesArea += Math.abs(\n            (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n            (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n    }\n\n    return polygonArea === 0 && trianglesArea === 0 ? 0 :\n        Math.abs((trianglesArea - polygonArea) / polygonArea);\n}\n\nfunction signedArea(data, start, end, dim) {\n    let sum = 0;\n    for (let i = start, j = end - dim; i < end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nexport function flatten(data) {\n    const vertices = [];\n    const holes = [];\n    const dimensions = data[0][0].length;\n    let holeIndex = 0;\n    let prevLen = 0;\n\n    for (const ring of data) {\n        for (const p of ring) {\n            for (let d = 0; d < dimensions; d++) vertices.push(p[d]);\n        }\n        if (prevLen) {\n            holeIndex += prevLen;\n            holes.push(holeIndex);\n        }\n        prevLen = ring.length;\n    }\n    return {vertices, holes, dimensions};\n}\n","// Should match actual possible granularity settings from circle_bucket.ts\n\n/**\n * Defines the granularity of subdivision for circles with `circle-pitch-alignment: 'map'` and for heatmap kernels.\n * More subdivision will cause circles to more closely follow the planet's surface.\n *\n * Possible values: 1, 3, 5, 7.\n * Subdivision of 1 results in a simple quad.\n */\nexport type CircleGranularity = 1 | 3 | 5 | 7;\n\n/**\n * Controls how much subdivision happens for a given type of geometry at different zoom levels.\n */\nexport class SubdivisionGranularityExpression {\n    /**\n     * A tile of zoom level 0 will be subdivided to this granularity level.\n     * Each subsequent zoom level will have its granularity halved.\n     */\n    private readonly _baseZoomGranularity: number;\n\n    /**\n     * No tile will have granularity level smaller than this.\n     */\n    private readonly _minGranularity: number;\n\n    constructor(baseZoomGranularity: number, minGranularity: number) {\n        if (minGranularity > baseZoomGranularity) {\n            throw new Error('Min granularity must not be greater than base granularity.');\n        }\n\n        this._baseZoomGranularity = baseZoomGranularity;\n        this._minGranularity = minGranularity;\n    }\n\n    public getGranularityForZoomLevel(zoomLevel: number): number {\n        const divisor = 1 << zoomLevel;\n        return Math.max(Math.floor(this._baseZoomGranularity / divisor), this._minGranularity, 1);\n    }\n}\n\n/**\n * An object describing how much subdivision should be applied to different types of geometry at different zoom levels.\n */\nexport class SubdivisionGranularitySetting {\n    /**\n     * Granularity settings used for fill and fill-extrusion layers (for fill, both polygons and their anti-aliasing outlines).\n     */\n    public readonly fill: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for the line layer.\n     */\n    public readonly line: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for geometry covering the entire tile: raster tiles, etc.\n     */\n    public readonly tile: SubdivisionGranularityExpression;\n\n    /**\n     * Granularity used for stencil masks for tiles.\n     */\n    public readonly stencil: SubdivisionGranularityExpression;\n\n    /**\n     * Controls the granularity of `pitch-alignment: map` circles and heatmap kernels.\n     * More granular circles will more closely follow the map's surface.\n     */\n    public readonly circle: CircleGranularity;\n\n    constructor(options: {\n        /**\n         * Granularity settings used for fill and fill-extrusion layers (for fill, both polygons and their anti-aliasing outlines).\n         */\n        fill: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for the line layer.\n         */\n        line: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for geometry covering the entire tile: stencil masks, raster tiles, etc.\n         */\n        tile: SubdivisionGranularityExpression;\n        /**\n         * Granularity used for stencil masks for tiles.\n         */\n        stencil: SubdivisionGranularityExpression;\n        /**\n         * Controls the granularity of `pitch-alignment: map` circles and heatmap kernels.\n         * More granular circles will more closely follow the map's surface.\n         */\n        circle: CircleGranularity;\n    }) {\n        this.fill = options.fill;\n        this.line = options.line;\n        this.tile = options.tile;\n        this.stencil = options.stencil;\n        this.circle = options.circle;\n    }\n\n    /**\n     * Granularity settings that disable subdivision altogether.\n     */\n    public static readonly noSubdivision = new SubdivisionGranularitySetting({\n        fill: new SubdivisionGranularityExpression(0, 0),\n        line: new SubdivisionGranularityExpression(0, 0),\n        tile: new SubdivisionGranularityExpression(0, 0),\n        stencil: new SubdivisionGranularityExpression(0, 0),\n        circle: 1\n    });\n}\n","import Point from '@mapbox/point-geometry';\nimport {EXTENT} from '../data/extent';\nimport {type CanonicalTileID} from '../tile/tile_id';\nimport earcut from 'earcut';\nimport {SubdivisionGranularityExpression, SubdivisionGranularitySetting} from './subdivision_granularity_settings';\nimport {register} from '../util/web_worker_transfer';\n\nregister('SubdivisionGranularityExpression', SubdivisionGranularityExpression);\nregister('SubdivisionGranularitySetting', SubdivisionGranularitySetting);\n\ntype SubdivisionResult = {\n    verticesFlattened: Array<number>;\n    indicesTriangles: Array<number>;\n\n    /**\n     * An array of arrays of indices of subdivided lines for polygon outlines.\n     * Each array of lines corresponds to one ring of the original polygon.\n     */\n    indicesLineList: Array<Array<number>>;\n};\n\n// Special pole vertices have coordinates -32768,-32768 for the north pole and 32767,32767 for the south pole.\n// First, find any *non-pole* vertices at those coordinates and move them slightly elsewhere.\nexport const NORTH_POLE_Y = -32768;\nexport const SOUTH_POLE_Y = 32767;\n\nclass Subdivider {\n    /**\n     * Flattened vertex positions (xyxyxy).\n     */\n    private _vertexBuffer: Array<number> = [];\n\n    /**\n     * Map of \"vertex x and y coordinate\" to \"index of such vertex\".\n     */\n    private _vertexDictionary: Map<number, number> = new Map<number, number>();\n    private _used: boolean = false;\n\n    private readonly _canonical: CanonicalTileID;\n\n    private readonly _granularity;\n    private readonly _granularityCellSize;\n\n    constructor(granularity: number, canonical: CanonicalTileID) {\n        this._granularity = granularity;\n        this._granularityCellSize = EXTENT / granularity;\n        this._canonical = canonical;\n    }\n\n    private _getKey(x: number, y: number) {\n        // Assumes signed 16 bit positions.\n        x = x + 32768;\n        y = y + 32768;\n        return (x << 16) | (y << 0);\n    }\n\n    /**\n     * Returns an index into the internal vertex buffer for a vertex at the given coordinates.\n     * If the internal vertex buffer contains no such vertex, then it is added.\n     */\n    private _vertexToIndex(x: number, y: number): number {\n        if (x < -32768 || y < -32768 || x > 32767 || y > 32767) {\n            throw new Error('Vertex coordinates are out of signed 16 bit integer range.');\n        }\n        const xInt = Math.round(x) | 0;\n        const yInt = Math.round(y) | 0;\n        const key = this._getKey(xInt, yInt);\n        if (this._vertexDictionary.has(key)) {\n            return this._vertexDictionary.get(key);\n        }\n        const index = this._vertexBuffer.length / 2;\n        this._vertexDictionary.set(key, index);\n        this._vertexBuffer.push(xInt, yInt);\n        return index;\n    }\n\n    /**\n     * Subdivides a polygon by iterating over rows of granularity subdivision cells and splitting each row along vertical subdivision axes.\n     * @param inputIndices - Indices into the internal vertex buffer of the triangulated polygon (after running `earcut`).\n     * @returns Indices into the internal vertex buffer for triangles that are a subdivision of the input geometry.\n     */\n    private _subdivideTrianglesScanline(inputIndices: Array<number>): Array<number> {\n        // A granularity cell is the square space between axes that subdivide geometry.\n        // For granularity 8, cells would be 1024 by 1024 units.\n        // For each triangle, we iterate over all cell rows it intersects, and generate subdivided geometry\n        // only within one cell row at a time. This way, we implicitly subdivide along the X-parallel axes (cell row boundaries).\n        // For each cell row, we generate an ordered point ring that describes the subdivided geometry inside this row (an intersection of the triangle and a given cell row).\n        // Such ordered ring can be trivially triangulated.\n        // Each ring may consist of sections of triangle edges that lie inside the cell row, and cell boundaries that lie inside the triangle. Both must be further subdivided along Y-parallel axes.\n        // Most complexity of this function comes from generating correct vertex rings, and from placing the vertices into the ring in the correct order.\n\n        if (this._granularity < 2) {\n            // The actual subdivision code always produces triangles with the correct winding order.\n            // Also apply winding order correction when skipping subdivision altogether to maintain consistency.\n            return fixWindingOrder(this._vertexBuffer, inputIndices);\n        }\n\n        const finalIndices = [];\n\n        // Iterate over all input triangles\n        const numIndices = inputIndices.length;\n        for (let primitiveIndex = 0; primitiveIndex < numIndices; primitiveIndex += 3) {\n            const triangleIndices: [number, number, number] = [\n                inputIndices[primitiveIndex + 0], // v0\n                inputIndices[primitiveIndex + 1], // v1\n                inputIndices[primitiveIndex + 2], // v2\n            ];\n\n            const triangleVertices: [number, number, number, number, number, number] = [\n                this._vertexBuffer[inputIndices[primitiveIndex + 0] * 2 + 0], // v0.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 0] * 2 + 1], // v0.y\n                this._vertexBuffer[inputIndices[primitiveIndex + 1] * 2 + 0], // v1.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 1] * 2 + 1], // v1.y\n                this._vertexBuffer[inputIndices[primitiveIndex + 2] * 2 + 0], // v2.x\n                this._vertexBuffer[inputIndices[primitiveIndex + 2] * 2 + 1], // v2.y\n            ];\n\n            let minX = Infinity;\n            let minY = Infinity;\n            let maxX = -Infinity;\n            let maxY = -Infinity;\n\n            // Compute AABB\n            for (let i = 0; i < 3; i++) {\n                const vx = triangleVertices[i * 2];\n                const vy = triangleVertices[i * 2 + 1];\n                minX = Math.min(minX, vx);\n                maxX = Math.max(maxX, vx);\n                minY = Math.min(minY, vy);\n                maxY = Math.max(maxY, vy);\n            }\n\n            if (minX === maxX || minY === maxY) {\n                continue; // Skip degenerate linear axis-aligned triangles\n            }\n\n            const cellXmin = Math.floor(minX / this._granularityCellSize);\n            const cellXmax = Math.ceil(maxX / this._granularityCellSize);\n            const cellYmin = Math.floor(minY / this._granularityCellSize);\n            const cellYmax = Math.ceil(maxY / this._granularityCellSize);\n\n            // Skip subdividing triangles that do not span multiple cells - just add them \"as is\".\n            if (cellXmin === cellXmax && cellYmin === cellYmax) {\n                finalIndices.push(...triangleIndices);\n                continue;\n            }\n\n            // Iterate over cell rows that intersect this triangle\n            for (let cellRow = cellYmin; cellRow < cellYmax; cellRow++) {\n                const ring = this._scanlineGenerateVertexRingForCellRow(cellRow, triangleVertices, triangleIndices);\n                scanlineTriangulateVertexRing(this._vertexBuffer, ring, finalIndices);\n            }\n        }\n\n        return finalIndices;\n    }\n\n    /**\n     * Takes a triangle and a cell row index, returns a subdivided vertex ring of the intersection of the triangle and the cell row.\n     * @param cellRow - Index of the cell row. A cell row of index `i` covert range from `i * granularityCellSize` to `(i + 1) * granularityCellSize`.\n     * @param triangleVertices - An array of 6 elements, contains flattened positions of the triangle's vertices: `[v0x, v0y, v1x, v1y, v2x, v2y]`.\n     * @param triangleIndices - An array of 3 elements, contains the original indices of the triangle's vertices: `[index0, index1, index2]`.\n     * @returns The resulting ring of vertex indices and the index (to the returned ring array) of the leftmost vertex in the ring.\n     */\n    private _scanlineGenerateVertexRingForCellRow(\n        cellRow: number,\n        triangleVertices: [number, number, number, number, number, number],\n        triangleIndices: [number, number, number]\n    ) {\n        const cellRowYTop = cellRow * this._granularityCellSize;\n        const cellRowYBottom = cellRowYTop + this._granularityCellSize;\n        const ring = [];\n\n        // Generate the vertex ring\n        for (let edgeIndex = 0; edgeIndex < 3; edgeIndex++) {\n            // Current edge that will be subdivided: a --> b\n            // The remaining vertex of the triangle: c\n            const aX = triangleVertices[edgeIndex * 2];\n            const aY = triangleVertices[edgeIndex * 2 + 1];\n            const bX = triangleVertices[((edgeIndex + 1) * 2) % 6];\n            const bY = triangleVertices[((edgeIndex + 1) * 2 + 1) % 6];\n            const cX = triangleVertices[((edgeIndex + 2) * 2) % 6];\n            const cY = triangleVertices[((edgeIndex + 2) * 2 + 1) % 6];\n            // Edge direction\n            const dirX = bX - aX;\n            const dirY = bY - aY;\n\n            // Edges parallel with either axis will need special handling later.\n            const isParallelY = dirX === 0;\n            const isParallelX = dirY === 0;\n\n            // Distance along edge where it enters/exits current cell row,\n            // where distance 0 is the edge start point, 1 the endpoint, 0.5 the mid point, etc.\n            const tTop = (cellRowYTop - aY) / dirY;\n            const tBottom = (cellRowYBottom - aY) / dirY;\n            const tEnter = Math.min(tTop, tBottom);\n            const tExit = Math.max(tTop, tBottom);\n\n            // Determine if edge lies entirely outside this cell row.\n            // Check entry and exit points, or if edge is parallel with X, check its Y coordinate.\n            if ((!isParallelX && (tEnter >= 1 || tExit <= 0)) ||\n                (isParallelX && (aY < cellRowYTop || aY > cellRowYBottom))) {\n                // Skip this edge\n                // But make sure to add its endpoint vertex if needed.\n                if (bY >= cellRowYTop && bY <= cellRowYBottom) {\n                    // The edge endpoint is withing this row, add it to the ring\n                    ring.push(triangleIndices[(edgeIndex + 1) % 3]);\n                }\n                continue;\n            }\n\n            // Do not add original triangle vertices now, those are handled separately later\n\n            // Special case: edge vertex for entry into cell row\n            // If edge is parallel with X axis, there is no entry vertex\n            if (!isParallelX && tEnter > 0) {\n                const x = aX + dirX * tEnter;\n                const y = aY + dirY * tEnter;\n                ring.push(this._vertexToIndex(x, y));\n            }\n\n            // The X coordinates of the points where the edge enters/exits the current cell row,\n            // or the edge start/endpoint, if the entry/exit happens beyond the edge bounds.\n            const enterX = aX + dirX * Math.max(tEnter, 0);\n            const exitX = aX + dirX * Math.min(tExit, 1);\n\n            // Generate edge interior vertices\n            // No need to subdivide (along X) edges that are parallel with Y\n            if (!isParallelY) {\n                this._generateIntraEdgeVertices(ring, aX, aY, bX, bY, enterX, exitX);\n            }\n\n            // Special case: edge vertex for exit from cell row\n            if (!isParallelX && tExit < 1) {\n                const x = aX + dirX * tExit;\n                const y = aY + dirY * tExit;\n                ring.push(this._vertexToIndex(x, y));\n            }\n\n            // When to split inter-edge boundary segments?\n            // When the boundary doesn't intersect a vertex, its easy. But what if it does?\n\n            //      a\n            //     /|\n            //    / |\n            // --c--|--boundary\n            //    \\ |\n            //     \\|\n            //      b\n            //\n            // Inter-edge region should be generated when processing the a-b edge.\n            // This happens fine for the top row, for the bottom row,\n            //\n\n            //      x\n            //     /|\n            //    / |\n            // --x--x--boundary\n            //\n            // Edge that lies on boundary should be subdivided in its edge phase.\n            // The inter-edge phase will correctly skip it.\n\n            // Add endpoint vertex\n            if (isParallelX || (bY >= cellRowYTop && bY <= cellRowYBottom)) {\n                ring.push(triangleIndices[(edgeIndex + 1) % 3]);\n            }\n            // Any edge that has endpoint outside this row or on its boundary gets\n            // inter-edge vertices.\n            // No row boundary to split for edges parallel with X\n            if (!isParallelX && (bY <= cellRowYTop || bY >= cellRowYBottom)) {\n                this._generateInterEdgeVertices(ring, aX, aY, bX, bY, cX, cY,\n                    exitX, cellRowYTop, cellRowYBottom);\n            }\n        }\n\n        return ring;\n    }\n\n    /**\n     * Generates ring vertices along an edge A-\\>B, but only in the part that intersects a given cell row.\n     * Does not handle adding edge endpoint vertices or edge cell row enter/exit vertices.\n     * @param ring - Ordered array of vertex indices for the constructed ring. New indices are placed here.\n     * @param enterX - The X coordinate of the point where edge A-\\>B enters the current cell row.\n     * @param exitX - The X coordinate of the point where edge A-\\>B exits the current cell row.\n     */\n    private _generateIntraEdgeVertices(\n        ring: Array<number>,\n        aX: number,\n        aY: number,\n        bX: number,\n        bY: number,\n        enterX: number,\n        exitX: number\n    ): void {\n        const dirX = bX - aX;\n        const dirY = bY - aY;\n        const isParallelX = dirY === 0;\n\n        const leftX = isParallelX ? Math.min(aX, bX) : Math.min(enterX, exitX);\n        const rightX = isParallelX ? Math.max(aX, bX) : Math.max(enterX, exitX);\n\n        const edgeSubdivisionLeftCellX = Math.floor(leftX / this._granularityCellSize) + 1;\n        const edgeSubdivisionRightCellX = Math.ceil(rightX / this._granularityCellSize) - 1;\n\n        const isEdgeLeftToRight = isParallelX ? (aX < bX) : (enterX < exitX);\n        if (isEdgeLeftToRight) {\n            // Left to right\n            for (let cellX = edgeSubdivisionLeftCellX; cellX <= edgeSubdivisionRightCellX; cellX++) {\n                const x = cellX * this._granularityCellSize;\n                const y = aY + dirY * (x - aX) / dirX;\n                ring.push(this._vertexToIndex(x, y));\n            }\n        } else {\n            // Right to left\n            for (let cellX = edgeSubdivisionRightCellX; cellX >= edgeSubdivisionLeftCellX; cellX--) {\n                const x = cellX * this._granularityCellSize;\n                const y = aY + dirY * (x - aX) / dirX;\n                ring.push(this._vertexToIndex(x, y));\n            }\n        }\n    }\n\n    /**\n     * Generates ring vertices along cell border.\n     * Call when processing an edge A-\\>B that exits the current row (B lies outside the current row).\n     * Generates vertices along the cell edge between the exit point from cell row\n     * of edge A-\\>B and entry of edge B-\\>C, or entry of C-\\>A if both A and C lie outside the cell row.\n     * Does not handle adding edge endpoint vertices or edge cell row enter/exit vertices.\n     * @param ring - Ordered array of vertex indices for the constructed ring. New indices are placed here.\n     * @param exitX - The X coordinate of the point where edge A-\\>B exits the current cell row.\n     * @param cellRowYTop - The current cell row top Y coordinate.\n     * @param cellRowYBottom - The current cell row bottom Y coordinate.\n     */\n    private _generateInterEdgeVertices(\n        ring: Array<number>,\n        aX: number,\n        aY: number,\n        bX: number,\n        bY: number,\n        cX: number,\n        cY: number,\n        exitX: number,\n        cellRowYTop: number,\n        cellRowYBottom: number\n    ): void {\n        const dirY = bY - aY;\n\n        const dir2X = cX - bX;\n        const dir2Y = cY - bY;\n        const t2Top = (cellRowYTop - bY) / dir2Y;\n        const t2Bottom = (cellRowYBottom - bY) / dir2Y;\n        // The distance along edge B->C where it enters/exits the current cell row,\n        // where distance 0 is B, 1 is C, 0.5 is the edge midpoint, etc.\n        const t2Enter = Math.min(t2Top, t2Bottom);\n        const t2Exit = Math.max(t2Top, t2Bottom);\n        const enter2X = bX + dir2X * t2Enter;\n        let boundarySubdivisionLeftCellX = Math.floor(Math.min(enter2X, exitX) / this._granularityCellSize) + 1;\n        let boundarySubdivisionRightCellX = Math.ceil(Math.max(enter2X, exitX) / this._granularityCellSize) - 1;\n        let isBoundaryLeftToRight = exitX < enter2X;\n\n        const isParallelX2 = dir2Y === 0;\n\n        if (isParallelX2 && (cY === cellRowYTop || cY === cellRowYBottom)) {\n            // Special case when edge b->c that lies on the cell boundary.\n            // Do not generate any inter-edge vertices in this case,\n            // this b->c edge gets subdivided when it is itself processed.\n            return;\n        }\n\n        if (isParallelX2 || t2Enter >= 1 || t2Exit <= 0) {\n            // The next edge (b->c) lies entirely outside this cell row\n            // Find entry point for the edge after that instead (c->a)\n\n            // There may be at most 1 edge that is parallel to X in a triangle.\n            // The main \"a->b\" edge must not be parallel at this point in the code.\n            // We know that \"a->b\" crosses the current cell row boundary, such that point \"b\" is beyond the boundary.\n            // If \"b->c\" is parallel to X, then \"c->a\" must not be parallel and must cross the cell row boundary back:\n            //      a\n            //      |\\\n            // -----|-\\--cell row boundary----\n            //      |  \\\n            //      c---b\n            // If \"b->c\" is not parallel to X and doesn't cross the cell row boundary,\n            // then c->a must also not be parallel to X and must cross the cell boundary back,\n            // since points \"a\" and \"c\" lie on different sides of the boundary and on different Y coordinates.\n            //\n            // Thus there is no need for \"parallel with X\" checks inside this condition branch.\n\n            // Compute the X coordinate where edge C->A enters the current cell row\n            const dir3X = aX - cX;\n            const dir3Y = aY - cY;\n            const t3Top = (cellRowYTop - cY) / dir3Y;\n            const t3Bottom = (cellRowYBottom - cY) / dir3Y;\n            const t3Enter = Math.min(t3Top, t3Bottom);\n            const enter3X = cX + dir3X * t3Enter;\n\n            boundarySubdivisionLeftCellX = Math.floor(Math.min(enter3X, exitX) / this._granularityCellSize) + 1;\n            boundarySubdivisionRightCellX = Math.ceil(Math.max(enter3X, exitX) / this._granularityCellSize) - 1;\n            isBoundaryLeftToRight = exitX < enter3X;\n        }\n\n        const boundaryY = dirY > 0 ? cellRowYBottom : cellRowYTop;\n        if (isBoundaryLeftToRight) {\n            // Left to right\n            for (let cellX = boundarySubdivisionLeftCellX; cellX <= boundarySubdivisionRightCellX; cellX++) {\n                const x = cellX * this._granularityCellSize;\n                ring.push(this._vertexToIndex(x, boundaryY));\n            }\n        } else {\n            // Right to left\n            for (let cellX = boundarySubdivisionRightCellX; cellX >= boundarySubdivisionLeftCellX; cellX--) {\n                const x = cellX * this._granularityCellSize;\n                ring.push(this._vertexToIndex(x, boundaryY));\n            }\n        }\n    }\n\n    /**\n     * Generates an outline for a given polygon, returns a list of arrays of line indices.\n     */\n    private _generateOutline(polygon: Array<Array<Point>>): Array<Array<number>> {\n        const subdividedLines: Array<Array<number>> = [];\n        for (const ring of polygon) {\n            const line = subdivideVertexLine(ring, this._granularity, true);\n            const pathIndices = this._pointArrayToIndices(line);\n            // Points returned by subdivideVertexLine are \"path\" waypoints,\n            // for example with indices 0 1 2 3 0.\n            // We need list of individual line segments for rendering,\n            // for example 0, 1, 1, 2, 2, 3, 3, 0.\n            const lineIndices: Array<number> = [];\n            for (let i = 1; i < pathIndices.length; i++) {\n                lineIndices.push(pathIndices[i - 1]);\n                lineIndices.push(pathIndices[i]);\n            }\n            subdividedLines.push(lineIndices);\n        }\n        return subdividedLines;\n    }\n\n    /**\n     * Adds pole geometry if needed.\n     * @param subdividedTriangles - Array of generated triangle indices, new pole geometry is appended here.\n     */\n    private _handlePoles(subdividedTriangles: Array<number>) {\n        // Add pole vertices if the tile is at north/south mercator edge\n        let north = false;\n        let south = false;\n        if (this._canonical) {\n            if (this._canonical.y === 0) {\n                north = true;\n            }\n            if (this._canonical.y === (1 << this._canonical.z) - 1) {\n                south = true;\n            }\n        }\n        if (north || south) {\n            this._fillPoles(subdividedTriangles, north, south);\n        }\n    }\n\n    /**\n     * Checks the internal vertex buffer for all vertices that might lie on the special pole coordinates and shifts them by one unit.\n     * Use for removing unintended pole vertices that might have been created during subdivision. After calling this function, actual pole vertices can be safely generated.\n     */\n    private _ensureNoPoleVertices() {\n        const flattened = this._vertexBuffer;\n\n        for (let i = 0; i < flattened.length; i += 2) {\n            const vy = flattened[i + 1];\n            if (vy === NORTH_POLE_Y) {\n                // Move slightly down\n                flattened[i + 1] = NORTH_POLE_Y + 1;\n            }\n            if (vy === SOUTH_POLE_Y) {\n                // Move slightly down\n                flattened[i + 1] = SOUTH_POLE_Y - 1;\n            }\n        }\n    }\n\n    /**\n     * Generates a quad from an edge to a pole with the correct winding order.\n     * Helper function used inside {@link _fillPoles}.\n     * @param indices - Index array into which the geometry is generated.\n     * @param i0 - Index of the first edge vertex.\n     * @param i1 - Index of the second edge vertex.\n     * @param v0x - X coordinate of the first edge vertex.\n     * @param v1x - X coordinate of the second edge vertex.\n     * @param poleY - The Y coordinate of the desired pole (NORTH_POLE_Y or SOUTH_POLE_Y).\n     */\n    private _generatePoleQuad(indices, i0, i1, v0x, v1x, poleY): void {\n        const flip = (v0x > v1x) !== (poleY === NORTH_POLE_Y);\n\n        if (flip) {\n            indices.push(i0);\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v0x, poleY));\n\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v1x, poleY));\n            indices.push(this._vertexToIndex(v0x, poleY));\n        } else {\n            indices.push(i1);\n            indices.push(i0);\n            indices.push(this._vertexToIndex(v0x, poleY));\n\n            indices.push(this._vertexToIndex(v1x, poleY));\n            indices.push(i1);\n            indices.push(this._vertexToIndex(v0x, poleY));\n        }\n    }\n\n    /**\n     * Detects edges that border the north or south tile edge\n     * and adds triangles that extend those edges to the poles.\n     * Only run this function on tiles that border the poles.\n     * Assumes that supplied geometry is clipped to the inclusive range of 0..EXTENT.\n     * Mutates the supplies vertex and index arrays.\n     * @param indices - Triangle indices. This array is appended with new primitives.\n     * @param north - Whether to generate geometry for the north pole.\n     * @param south - Whether to generate geometry for the south pole.\n     */\n    private _fillPoles(indices: Array<number>, north: boolean, south: boolean): void {\n        const flattened = this._vertexBuffer;\n\n        const northEdge = 0;\n        const southEdge = EXTENT;\n\n        const numIndices = indices.length;\n        for (let primitiveIndex = 2; primitiveIndex < numIndices; primitiveIndex += 3) {\n            const i0 = indices[primitiveIndex - 2];\n            const i1 = indices[primitiveIndex - 1];\n            const i2 = indices[primitiveIndex];\n            const v0x = flattened[i0 * 2];\n            const v0y = flattened[i0 * 2 + 1];\n            const v1x = flattened[i1 * 2];\n            const v1y = flattened[i1 * 2 + 1];\n            const v2x = flattened[i2 * 2];\n            const v2y = flattened[i2 * 2 + 1];\n\n            if (north) {\n                if (v0y === northEdge && v1y === northEdge) {\n                    this._generatePoleQuad(indices, i0, i1, v0x, v1x, NORTH_POLE_Y);\n                }\n                if (v1y === northEdge && v2y === northEdge) {\n                    this._generatePoleQuad(indices, i1, i2, v1x, v2x, NORTH_POLE_Y);\n                }\n                if (v2y === northEdge && v0y === northEdge) {\n                    this._generatePoleQuad(indices, i2, i0, v2x, v0x, NORTH_POLE_Y);\n                }\n            }\n            if (south) {\n                if (v0y === southEdge && v1y === southEdge) {\n                    this._generatePoleQuad(indices, i0, i1, v0x, v1x, SOUTH_POLE_Y);\n                }\n                if (v1y === southEdge && v2y === southEdge) {\n                    this._generatePoleQuad(indices, i1, i2, v1x, v2x, SOUTH_POLE_Y);\n                }\n                if (v2y === southEdge && v0y === southEdge) {\n                    this._generatePoleQuad(indices, i2, i0, v2x, v0x, SOUTH_POLE_Y);\n                }\n            }\n        }\n    }\n\n    /**\n     * Adds all vertices in the supplied flattened vertex buffer into the internal vertex buffer.\n     */\n    private _initializeVertices(flattened: Array<number>) {\n        for (let i = 0; i < flattened.length; i += 2) {\n            this._vertexToIndex(flattened[i], flattened[i + 1]);\n        }\n    }\n\n    /**\n     * Subdivides an input mesh. Imagine a regular square grid with the target granularity overlaid over the mesh - this is the subdivision's result.\n     * Assumes a mesh of tile features - vertex coordinates are integers, visible range where subdivision happens is 0..8192.\n     * @param polygon - The input polygon, specified as a list of vertex rings.\n     * @param generateOutlineLines - When true, also generates line indices for outline of the supplied polygon.\n     * @returns Vertex and index buffers with subdivision applied.\n     */\n    public subdividePolygonInternal(polygon: Array<Array<Point>>, generateOutlineLines: boolean): SubdivisionResult {\n        if (this._used) {\n            throw new Error('Subdivision: multiple use not allowed.');\n        }\n        this._used = true;\n\n        // Initialize the vertex dictionary with input vertices since we will use all of them anyway\n        const {flattened, holeIndices} = flatten(polygon);\n        this._initializeVertices(flattened);\n\n        // Subdivide triangles\n        let subdividedTriangles: Array<number>;\n        try {\n            // At this point this._finalVertices is just flattened polygon points\n            const earcutResult = earcut(flattened, holeIndices);\n            const cut = this._convertIndices(flattened, earcutResult);\n            subdividedTriangles = this._subdivideTrianglesScanline(cut);\n        } catch (e) {\n            console.error(e);\n        }\n\n        // Subdivide lines\n        let subdividedLines: Array<Array<number>> = [];\n        if (generateOutlineLines) {\n            subdividedLines = this._generateOutline(polygon);\n        }\n\n        // Ensure no vertex has the special value used for pole vertices\n        this._ensureNoPoleVertices();\n\n        // Add pole geometry if needed\n        this._handlePoles(subdividedTriangles);\n\n        return {\n            verticesFlattened: this._vertexBuffer,\n            indicesTriangles: subdividedTriangles,\n            indicesLineList: subdividedLines,\n        };\n    }\n\n    /**\n     * Sometimes the supplies vertex and index array has duplicate vertices - same coordinates that are referenced by multiple different indices.\n     * That is not allowed for purposes of subdivision, duplicates are removed in `this.initializeVertices`.\n     * This function converts the original index array that indexes into the original vertex array with duplicates\n     * into an index array that indexes into `this._finalVertices`.\n     * @param vertices - Flattened vertex array used by the old indices. This may contain duplicate vertices.\n     * @param oldIndices - Indices into the old vertex array.\n     * @returns Indices transformed so that they are valid indices into `this._finalVertices` (with duplicates removed).\n     */\n    private _convertIndices(vertices: Array<number>, oldIndices: Array<number>): Array<number> {\n        const newIndices = [];\n        for (let i = 0; i < oldIndices.length; i++) {\n            const x = vertices[oldIndices[i] * 2];\n            const y = vertices[oldIndices[i] * 2 + 1];\n            newIndices.push(this._vertexToIndex(x, y));\n        }\n        return newIndices;\n    }\n\n    /**\n     * Converts an array of points into an array of indices into the internal vertex buffer (`_finalVertices`).\n     */\n    private _pointArrayToIndices(array: Array<Point>): Array<number> {\n        const indices = [];\n        for (let i = 0; i < array.length; i++) {\n            const p = array[i];\n            indices.push(this._vertexToIndex(p.x, p.y));\n        }\n        return indices;\n    }\n}\n\n/**\n * Subdivides a polygon to a given granularity. Intended for preprocessing geometry for the 'fill' and 'fill-extrusion' layer types.\n * All returned triangles have the counter-clockwise winding order.\n * @param polygon - An array of point rings that specify the polygon. The first ring is the polygon exterior, all subsequent rings form holes inside the first ring.\n * @param canonical - The canonical tile ID of the tile this polygon belongs to. Needed for generating special geometry for tiles that border the poles.\n * @param granularity - The subdivision granularity. If we assume tile EXTENT=8192, then a granularity of 2 will result in geometry being \"cut\" on each axis\n * divisible by 4096 (including outside the tile range, so -8192, -4096, or 12288...), granularity of 8 on axes divisible by 1024 and so on.\n * Granularity of 1 or lower results in *no* subdivision.\n * @param generateOutlineLines - When true, also generates index arrays for subdivided lines that form the outline of the supplied polygon. True by default.\n * @returns An object that contains the generated vertex array, triangle index array and, if specified, line index arrays.\n */\nexport function subdividePolygon(polygon: Array<Array<Point>>, canonical: CanonicalTileID, granularity: number, generateOutlineLines: boolean = true): SubdivisionResult {\n    const subdivider = new Subdivider(granularity, canonical);\n    return subdivider.subdividePolygonInternal(polygon, generateOutlineLines);\n}\n\n/**\n * Subdivides a line represented by an array of points. Mainly intended for preprocessing geometry for the 'line' layer type.\n * Assumes a line segment between each two consecutive points in the array.\n * Does not assume a line segment from last point to first point, unless `isRing` is set to `true`.\n * For example, an array of 4 points describes exactly 3 line segments.\n * @param linePoints - An array of points describing the line segments.\n * @param granularity - Subdivision granularity.\n * @param isRing - When true, an additional line segment is assumed to exist between the input array's last and first point.\n * @returns A new array of points of the subdivided line segments. The array may contain some of the original Point objects. If `isRing` is set to `true`, then this also includes the (subdivided) segment from the last point of the input array to the first point.\n *\n * @example\n * ```ts\n * const result = subdivideVertexLine([\n *   new Point(0, 0),\n *   new Point(8, 0),\n *   new Point(0, 8),\n * ], EXTENT / 4, false);\n * // Results in an array of points with these (x, y) coordinates:\n * //   0, 0\n * //   4, 0\n * //   8, 0\n * //   4, 4\n * //   0, 8\n * ```\n *\n * @example\n * ```ts\n * const result = subdivideVertexLine([\n *   new Point(0, 0),\n *   new Point(8, 0),\n *   new Point(0, 8),\n * ], EXTENT / 4, true);\n * // Results in an array of points with these (x, y) coordinates:\n * //   0, 0\n * //   4, 0\n * //   8, 0\n * //   4, 4\n * //   0, 8\n * //   0, 4\n * //   0, 0\n * ```\n */\nexport function subdivideVertexLine(linePoints: Array<Point>, granularity: number, isRing: boolean = false): Array<Point> {\n    if (!linePoints || linePoints.length < 1) {\n        return [];\n    }\n\n    if (linePoints.length < 2) {\n        return [];\n    }\n\n    // Generate an extra line segment between the input array's first and last points,\n    // but only if isRing=true AND the first and last points actually differ.\n    const first = linePoints[0];\n    const last = linePoints[linePoints.length - 1];\n    const addLastToFirstSegment = isRing && (first.x !== last.x || first.y !== last.y);\n\n    if (granularity < 2) {\n        if (addLastToFirstSegment) {\n            return [...linePoints, linePoints[0]];\n        } else {\n            return [...linePoints];\n        }\n    }\n\n    const cellSize = Math.floor(EXTENT / granularity);\n    const finalLineVertices: Array<Point> = [];\n\n    finalLineVertices.push(new Point(linePoints[0].x, linePoints[0].y));\n\n    // Iterate over all input lines\n    const totalPoints = linePoints.length;\n    const lastIndex = addLastToFirstSegment ? totalPoints : (totalPoints - 1);\n    for (let pointIndex = 0; pointIndex < lastIndex; pointIndex++) {\n        const linePoint0 = linePoints[pointIndex];\n        const linePoint1 = pointIndex < (totalPoints - 1) ? linePoints[pointIndex + 1] : linePoints[0];\n        const lineVertex0x = linePoint0.x;\n        const lineVertex0y = linePoint0.y;\n        const lineVertex1x = linePoint1.x;\n        const lineVertex1y = linePoint1.y;\n\n        const dirXnonZero = lineVertex0x !== lineVertex1x;\n        const dirYnonZero = lineVertex0y !== lineVertex1y;\n\n        if (!dirXnonZero && !dirYnonZero) {\n            continue;\n        }\n\n        const dirX = lineVertex1x - lineVertex0x;\n        const dirY = lineVertex1y - lineVertex0y;\n        const absDirX = Math.abs(dirX);\n        const absDirY = Math.abs(dirY);\n\n        let lastPointX = lineVertex0x;\n        let lastPointY = lineVertex0y;\n\n        // Walk along the line segment from start to end. In every step,\n        // find out the distance from start until the line intersects either the X-parallel or Y-parallel subdivision axis.\n        // Pick the closer intersection, add it to the final line points and consider that point the new start of the line.\n        // But also make sure the intersection point does not lie beyond the end of the line.\n        // If none of the intersection points is closer than line end, add the endpoint to the final line and break the loop.\n\n        while (true) {\n            const nextBoundaryX = dirX > 0 ?\n                ((Math.floor(lastPointX / cellSize) + 1) * cellSize) :\n                ((Math.ceil(lastPointX / cellSize) - 1) * cellSize);\n            const nextBoundaryY = dirY > 0 ?\n                ((Math.floor(lastPointY / cellSize) + 1) * cellSize) :\n                ((Math.ceil(lastPointY / cellSize) - 1) * cellSize);\n            const axisDistanceToBoundaryX = Math.abs(lastPointX - nextBoundaryX);\n            const axisDistanceToBoundaryY = Math.abs(lastPointY - nextBoundaryY);\n\n            const axisDistanceToEndX = Math.abs(lastPointX - lineVertex1x);\n            const axisDistanceToEndY = Math.abs(lastPointY - lineVertex1y);\n\n            const realDistanceToBoundaryX = dirXnonZero ? axisDistanceToBoundaryX / absDirX : Number.POSITIVE_INFINITY;\n            const realDistanceToBoundaryY = dirYnonZero ? axisDistanceToBoundaryY / absDirY : Number.POSITIVE_INFINITY;\n\n            if ((axisDistanceToEndX <= axisDistanceToBoundaryX || !dirXnonZero) &&\n            (axisDistanceToEndY <= axisDistanceToBoundaryY || !dirYnonZero)) {\n                break;\n            }\n\n            if ((realDistanceToBoundaryX < realDistanceToBoundaryY && dirXnonZero) || !dirYnonZero) {\n                // We hit the X cell boundary first\n                // Always consider the X cell hit if Y dir is zero\n                lastPointX = nextBoundaryX;\n                lastPointY = lastPointY + dirY * realDistanceToBoundaryX;\n                const next = new Point(lastPointX, Math.round(lastPointY));\n\n                // Do not add the next vertex if it is equal to the last added vertex\n                if (finalLineVertices[finalLineVertices.length - 1].x !== next.x ||\n                    finalLineVertices[finalLineVertices.length - 1].y !== next.y) {\n                    finalLineVertices.push(next);\n                }\n            } else {\n                lastPointX = lastPointX + dirX * realDistanceToBoundaryY;\n                lastPointY = nextBoundaryY;\n                const next = new Point(Math.round(lastPointX), lastPointY);\n\n                if (finalLineVertices[finalLineVertices.length - 1].x !== next.x ||\n                    finalLineVertices[finalLineVertices.length - 1].y !== next.y) {\n                    finalLineVertices.push(next);\n                }\n            }\n        }\n\n        const last = new Point(lineVertex1x, lineVertex1y);\n        if (finalLineVertices[finalLineVertices.length - 1].x !== last.x ||\n            finalLineVertices[finalLineVertices.length - 1].y !== last.y) {\n            finalLineVertices.push(last);\n        }\n    }\n\n    return finalLineVertices;\n}\n\n/**\n * Takes a polygon as an array of point rings, returns a flattened array of the X,Y coordinates of these points.\n * Also creates an array of hole indices. Both returned arrays are required for `earcut`.\n */\nfunction flatten(polygon: Array<Array<Point>>): {\n    flattened: Array<number>;\n    holeIndices: Array<number>;\n} {\n    const holeIndices = [];\n    const flattened = [];\n\n    for (const ring of polygon) {\n        if (ring.length === 0) {\n            continue;\n        }\n\n        if (ring !== polygon[0]) {\n            holeIndices.push(flattened.length / 2);\n        }\n\n        for (let i = 0; i < ring.length; i++) {\n            flattened.push(ring[i].x);\n            flattened.push(ring[i].y);\n        }\n    }\n\n    return {\n        flattened,\n        holeIndices\n    };\n}\n\n/**\n * Returns a new array of indices where all triangles have the counter-clockwise winding order.\n * @param flattened - Flattened vertex buffer.\n * @param indices - Triangle indices.\n */\nexport function fixWindingOrder(flattened: Array<number>, indices: Array<number>): Array<number> {\n    const corrected = [];\n\n    for (let i = 0; i < indices.length; i += 3) {\n        const i0 = indices[i];\n        const i1 = indices[i + 1];\n        const i2 = indices[i + 2];\n\n        const v0x = flattened[i0 * 2];\n        const v0y = flattened[i0 * 2 + 1];\n        const v1x = flattened[i1 * 2];\n        const v1y = flattened[i1 * 2 + 1];\n        const v2x = flattened[i2 * 2];\n        const v2y = flattened[i2 * 2 + 1];\n\n        const e0x = v1x - v0x;\n        const e0y = v1y - v0y;\n        const e1x = v2x - v0x;\n        const e1y = v2y - v0y;\n\n        const crossProduct = e0x * e1y - e0y * e1x;\n\n        if (crossProduct > 0) {\n            // Flip\n            corrected.push(i0);\n            corrected.push(i2);\n            corrected.push(i1);\n        } else {\n            // Don't flip\n            corrected.push(i0);\n            corrected.push(i1);\n            corrected.push(i2);\n        }\n    }\n\n    return corrected;\n}\n\n/**\n * Triangulates a ring of vertex indices. Appends to the supplied array of final triangle indices.\n * @param vertexBuffer - Flattened vertex coordinate array.\n * @param ring - Ordered ring of vertex indices to triangulate.\n * @param leftmostIndex - The index of the leftmost vertex in the supplied ring.\n * @param finalIndices - Array of final triangle indices, into where the resulting triangles are appended.\n */\nexport function scanlineTriangulateVertexRing(vertexBuffer: Array<number>, ring: Array<number>, finalIndices: Array<number>): void {\n    // Triangulate the ring\n    // It is guaranteed to be convex and ordered\n    if (ring.length === 0) {\n        throw new Error('Subdivision vertex ring is empty.');\n    }\n\n    // Find the leftmost vertex in the ring\n    let leftmostIndex = 0;\n    let leftmostX = vertexBuffer[ring[0] * 2];\n    for (let i = 1; i < ring.length; i++) {\n        const x = vertexBuffer[ring[i] * 2];\n        if (x < leftmostX) {\n            leftmostX = x;\n            leftmostIndex = i;\n        }\n    }\n\n    // Traverse the ring in both directions from the leftmost vertex\n    // Assume ring is in CCW order (to produce CCW triangles)\n    const ringVertexLength = ring.length;\n    let lastEdgeA = leftmostIndex;\n    let lastEdgeB = (lastEdgeA + 1) % ringVertexLength;\n\n    while (true) {\n        const candidateIndexA = (lastEdgeA - 1) >= 0 ? (lastEdgeA - 1) : (ringVertexLength - 1);\n        const candidateIndexB = (lastEdgeB + 1) % ringVertexLength;\n\n        // Pick candidate, move edge\n        const candidateAx = vertexBuffer[ring[candidateIndexA] * 2];\n        const candidateAy = vertexBuffer[ring[candidateIndexA] * 2 + 1];\n        const candidateBx = vertexBuffer[ring[candidateIndexB] * 2];\n        const candidateBy = vertexBuffer[ring[candidateIndexB] * 2 + 1];\n        const lastEdgeAx = vertexBuffer[ring[lastEdgeA] * 2];\n        const lastEdgeAy = vertexBuffer[ring[lastEdgeA] * 2 + 1];\n        const lastEdgeBx = vertexBuffer[ring[lastEdgeB] * 2];\n        const lastEdgeBy = vertexBuffer[ring[lastEdgeB] * 2 + 1];\n\n        let pickA = false;\n\n        if (candidateAx < candidateBx) {\n            pickA = true;\n        } else if (candidateAx > candidateBx) {\n            pickA = false;\n        } else {\n            // Pick the candidate that is more \"right\" of the last edge's line\n            const ex = lastEdgeBx - lastEdgeAx;\n            const ey = lastEdgeBy - lastEdgeAy;\n            const nx = ey;\n            const ny = -ex;\n            const sign = (lastEdgeAy < lastEdgeBy) ? 1 : -1;\n            // dot( (candidateA <-- lastEdgeA), normal )\n            const aRight = ((candidateAx - lastEdgeAx) * nx + (candidateAy - lastEdgeAy) * ny) * sign;\n            // dot( (candidateB <-- lastEdgeA), normal )\n            const bRight = ((candidateBx - lastEdgeAx) * nx + (candidateBy - lastEdgeAy) * ny) * sign;\n            if (aRight > bRight) {\n                pickA = true;\n            }\n        }\n\n        if (pickA) {\n            // Pick candidate A\n            const c = ring[candidateIndexA];\n            const a = ring[lastEdgeA];\n            const b = ring[lastEdgeB];\n            if (c !== a && c !== b && a !== b) {\n                finalIndices.push(b, a, c);\n            }\n            lastEdgeA--;\n            if (lastEdgeA < 0) {\n                lastEdgeA = ringVertexLength - 1;\n            }\n        } else {\n            // Pick candidate B\n            const c = ring[candidateIndexB];\n            const a = ring[lastEdgeA];\n            const b = ring[lastEdgeB];\n            if (c !== a && c !== b && a !== b) {\n                finalIndices.push(b, a, c);\n            }\n            lastEdgeB++;\n            if (lastEdgeB >= ringVertexLength) {\n                lastEdgeB = 0;\n            }\n        }\n\n        if (candidateIndexA === candidateIndexB) {\n            break; // We ran out of ring vertices\n        }\n    }\n}\n","import {type LineIndexArray, type TriangleIndexArray} from '../data/array_types.g';\nimport {type Segment, SegmentVector} from '../data/segment';\nimport {type StructArray} from '../util/struct_array';\n\n/**\n * This function will take any \"mesh\" and fill in into vertex buffers, breaking it up into multiple drawcalls as needed\n * if too many (\\>65535) vertices are used.\n * This function is mainly intended for use with subdivided geometry, since sometimes subdivision might generate\n * more vertices than what fits into 16 bit indices.\n *\n * Accepts a triangle mesh, optionally with a line list (for fill outlines) as well. The triangle and line segments are expected to share a single vertex buffer.\n *\n * Mutates the provided `segmentsTriangles` and `segmentsLines` SegmentVectors,\n * `vertexArray`, `triangleIndexArray` and optionally `lineIndexArray`.\n * Does not mutate the input `flattened` vertices, `triangleIndices` and `lineList`.\n * @param addVertex - A function for adding a new vertex into `vertexArray`. We might sometimes want to add more values per vertex than just X and Y coordinates, which can be handled in this function.\n * @param segmentsTriangles - The segment array for triangle draw calls. New segments will be placed here.\n * @param vertexArray - The vertex array into which new vertices are placed by the provided `addVertex` function.\n * @param triangleIndexArray - Index array for drawing triangles. New triangle indices are placed here.\n * @param flattened - The input flattened array or vertex coordinates.\n * @param triangleIndices - Triangle indices into `flattened`.\n * @param segmentsLines - Segment array for line draw calls. New segments will be placed here. Only needed if the mesh also contains lines.\n * @param lineIndexArray - Index array for drawing lines. New triangle indices are placed here. Only needed if the mesh also contains lines.\n * @param lineList - Line indices into `flattened`. Only needed if the mesh also contains lines.\n */\nexport function fillLargeMeshArrays(\n    addVertex: (x: number, y: number) => void,\n    segmentsTriangles: SegmentVector,\n    vertexArray: StructArray,\n    triangleIndexArray: TriangleIndexArray,\n    flattened: Array<number>,\n    triangleIndices: Array<number>,\n    segmentsLines?: SegmentVector,\n    lineIndexArray?: LineIndexArray,\n    lineList?: Array<Array<number>>) {\n\n    const numVertices = flattened.length / 2;\n    const hasLines = segmentsLines && lineIndexArray && lineList;\n\n    if (numVertices < SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n        // The fast path - no segmentation needed\n        const triangleSegment = segmentsTriangles.prepareSegment(numVertices, vertexArray, triangleIndexArray);\n        const triangleIndex = triangleSegment.vertexLength;\n\n        for (let i = 0; i < triangleIndices.length; i += 3) {\n            triangleIndexArray.emplaceBack(\n                triangleIndex + triangleIndices[i],\n                triangleIndex + triangleIndices[i + 1],\n                triangleIndex + triangleIndices[i + 2]);\n        }\n\n        triangleSegment.vertexLength += numVertices;\n        triangleSegment.primitiveLength += triangleIndices.length / 3;\n\n        let lineIndicesStart: number;\n        let lineSegment: Segment;\n\n        if (hasLines) {\n            // Note that segment creation must happen *before* we add vertices into the vertex buffer\n            lineSegment = segmentsLines.prepareSegment(numVertices, vertexArray, lineIndexArray);\n            lineIndicesStart = lineSegment.vertexLength;\n            lineSegment.vertexLength += numVertices;\n        }\n\n        // Add vertices into vertex buffer\n        for (let i = 0; i < flattened.length; i += 2) {\n            addVertex(flattened[i], flattened[i + 1]);\n        }\n\n        if (hasLines) {\n            for (let listIndex = 0; listIndex < lineList.length; listIndex++) {\n                const lineIndices = lineList[listIndex];\n\n                for (let i = 1; i < lineIndices.length; i += 2) {\n                    lineIndexArray.emplaceBack(\n                        lineIndicesStart + lineIndices[i - 1],\n                        lineIndicesStart + lineIndices[i]);\n                }\n\n                lineSegment.primitiveLength += lineIndices.length / 2;\n            }\n        }\n    } else {\n        // Assumption: the incoming triangle indices use vertices in roughly linear order,\n        // for example a grid of quads where both vertices and quads are created row by row would satisfy this.\n        // Some completely random arbitrary vertex/triangle order would not.\n        // Thus, if we encounter a vertex that doesn't fit into MAX_VERTEX_ARRAY_LENGTH,\n        // we can just stop appending into the old segment and start a new segment and only append to the new segment,\n        // copying vertices that are already present in the old segment into the new segment if needed,\n        // because there will not be too many of such vertices.\n\n        // Normally, (out)lines share the same vertex buffer as triangles, but since we need to somehow split it into several drawcalls,\n        // it is easier to just consider (out)lines separately and duplicate their vertices.\n\n        fillSegmentsTriangles(segmentsTriangles, vertexArray, triangleIndexArray, flattened, triangleIndices, addVertex);\n        if (hasLines) {\n            fillSegmentsLines(segmentsLines, vertexArray, lineIndexArray, flattened, lineList, addVertex);\n        }\n\n        // Triangles and lines share the same vertex buffer, and they usually also share the same vertices.\n        // But this method might create the vertices for triangles and for lines separately, and thus increasing the vertex count\n        // of the triangle and line segments by different amounts.\n\n        // The non-splitting fillLargeMeshArrays logic (and old fill-bucket logic) assumes the vertex counts to be the same,\n        // and forcing both SegmentVectors to return a new segment upon next prepare call satisfies this.\n        segmentsTriangles.forceNewSegmentOnNextPrepare();\n        segmentsLines?.forceNewSegmentOnNextPrepare();\n    }\n}\n\n/**\n * Determines the new index of a vertex given by its old index.\n * @param actualVertexIndices - Array that maps the old index of a given vertex to a new index in the final vertex buffer.\n * @param flattened - Old vertex buffer.\n * @param addVertex - Function for creating a new vertex in the final vertex buffer.\n * @param totalVerticesCreated - Reference to an int holding how many vertices were added to the final vertex buffer.\n * @param oldIndex - The old index of the desired vertex.\n * @param needsCopy - Whether to duplicate the desired vertex in the final vertex buffer.\n * @param segment - The current segment.\n * @returns Index of the vertex in the final vertex array.\n */\nfunction copyOrReuseVertex(\n    actualVertexIndices: Array<number>,\n    flattened: Array<number>,\n    addVertex: (x: number, y: number) => void,\n    totalVerticesCreated: {count: number},\n    oldIndex: number,\n    needsCopy: boolean,\n    segment: Segment\n): number {\n    if (needsCopy) {\n        const newIndex = totalVerticesCreated.count;\n        addVertex(flattened[oldIndex * 2], flattened[oldIndex * 2 + 1]);\n        actualVertexIndices[oldIndex] = totalVerticesCreated.count;\n        totalVerticesCreated.count++;\n        segment.vertexLength++;\n        return newIndex;\n    } else {\n        return actualVertexIndices[oldIndex];\n    }\n}\n\nfunction fillSegmentsTriangles(\n    segmentsTriangles: SegmentVector,\n    vertexArray: StructArray,\n    triangleIndexArray: TriangleIndexArray,\n    flattened: Array<number>,\n    triangleIndices: Array<number>,\n    addVertex: (x: number, y: number) => void\n) {\n    // Array, or rather a map of [vertex index in the original data] -> index of the latest copy of this vertex in the final vertex buffer.\n    const actualVertexIndices: Array<number> = [];\n    for (let i = 0; i < flattened.length / 2; i++) {\n        actualVertexIndices.push(-1);\n    }\n\n    const totalVerticesCreated = {count: 0};\n\n    let currentSegmentCutoff = 0;\n    let segment = segmentsTriangles.getOrCreateLatestSegment(vertexArray, triangleIndexArray);\n    let baseVertex = segment.vertexLength;\n\n    for (let primitiveEndIndex = 2; primitiveEndIndex < triangleIndices.length; primitiveEndIndex += 3) {\n        const i0 = triangleIndices[primitiveEndIndex - 2];\n        const i1 = triangleIndices[primitiveEndIndex - 1];\n        const i2 = triangleIndices[primitiveEndIndex];\n\n        let i0needsVertexCopy = actualVertexIndices[i0] < currentSegmentCutoff;\n        let i1needsVertexCopy = actualVertexIndices[i1] < currentSegmentCutoff;\n        let i2needsVertexCopy = actualVertexIndices[i2] < currentSegmentCutoff;\n\n        const vertexCopyCount = (i0needsVertexCopy ? 1 : 0) + (i1needsVertexCopy ? 1 : 0) + (i2needsVertexCopy ? 1 : 0);\n\n        // Will needed vertex copies fit into this segment?\n        if (segment.vertexLength + vertexCopyCount > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n            // Break up into a new segment if not.\n            segment = segmentsTriangles.createNewSegment(vertexArray, triangleIndexArray);\n            currentSegmentCutoff = totalVerticesCreated.count;\n            i0needsVertexCopy = true;\n            i1needsVertexCopy = true;\n            i2needsVertexCopy = true;\n            baseVertex = 0;\n        }\n\n        const actualIndex0 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i0, i0needsVertexCopy, segment);\n        const actualIndex1 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i1, i1needsVertexCopy, segment);\n        const actualIndex2 = copyOrReuseVertex(\n            actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n            i2, i2needsVertexCopy, segment);\n\n        triangleIndexArray.emplaceBack(\n            baseVertex + actualIndex0 - currentSegmentCutoff,\n            baseVertex + actualIndex1 - currentSegmentCutoff,\n            baseVertex + actualIndex2 - currentSegmentCutoff\n        );\n\n        segment.primitiveLength++;\n    }\n}\n\nfunction fillSegmentsLines(\n    segmentsLines: SegmentVector,\n    vertexArray: StructArray,\n    lineIndexArray: LineIndexArray,\n    flattened: Array<number>,\n    lineList: Array<Array<number>>,\n    addVertex: (x: number, y: number) => void\n) {\n    // Array, or rather a map of [vertex index in the original data] -> index of the latest copy of this vertex in the final vertex buffer.\n    const actualVertexIndices: Array<number> = [];\n    for (let i = 0; i < flattened.length / 2; i++) {\n        actualVertexIndices.push(-1);\n    }\n\n    const totalVerticesCreated = {count: 0};\n\n    let currentSegmentCutoff = 0;\n    let segment = segmentsLines.getOrCreateLatestSegment(vertexArray, lineIndexArray);\n    let baseVertex = segment.vertexLength;\n\n    for (let lineListIndex = 0; lineListIndex < lineList.length; lineListIndex++) {\n        const currentLine = lineList[lineListIndex];\n        for (let lineVertex = 1; lineVertex < lineList[lineListIndex].length; lineVertex += 2) {\n            const i0 = currentLine[lineVertex - 1];\n            const i1 = currentLine[lineVertex];\n\n            let i0needsVertexCopy = actualVertexIndices[i0] < currentSegmentCutoff;\n            let i1needsVertexCopy = actualVertexIndices[i1] < currentSegmentCutoff;\n\n            const vertexCopyCount = (i0needsVertexCopy ? 1 : 0) + (i1needsVertexCopy ? 1 : 0);\n\n            // Will needed vertex copies fit into this segment?\n            if (segment.vertexLength + vertexCopyCount > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                // Break up into a new segment if not.\n                segment = segmentsLines.createNewSegment(vertexArray, lineIndexArray);\n                currentSegmentCutoff = totalVerticesCreated.count;\n                i0needsVertexCopy = true;\n                i1needsVertexCopy = true;\n                baseVertex = 0;\n            }\n\n            const actualIndex0 = copyOrReuseVertex(\n                actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n                i0, i0needsVertexCopy, segment);\n            const actualIndex1 = copyOrReuseVertex(\n                actualVertexIndices, flattened, addVertex, totalVerticesCreated,\n                i1, i1needsVertexCopy, segment);\n\n            lineIndexArray.emplaceBack(\n                baseVertex + actualIndex0 - currentSegmentCutoff,\n                baseVertex + actualIndex1 - currentSegmentCutoff\n            );\n\n            segment.primitiveLength++;\n        }\n    }\n}\n","import {FillLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './fill_attributes';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {LineIndexArray, TriangleIndexArray} from '../index_array_type';\nimport {classifyRings} from '@maplibre/maplibre-gl-style-spec';\nconst EARCUT_MAX_RINGS = 500;\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {FillStyleLayer} from '../../style/style_layer/fill_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {subdividePolygon} from '../../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport class FillBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<FillStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<FillStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n    patternFeatures: Array<BucketFeature>;\n\n    layoutVertexArray: FillLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    indexArray2: LineIndexArray;\n    indexBuffer2: IndexBuffer;\n\n    hasDependencies: boolean;\n    programConfigurations: ProgramConfigurationSet<FillStyleLayer>;\n    segments: SegmentVector;\n    segments2: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<FillStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasDependencies = false;\n        this.patternFeatures = [];\n\n        this.layoutVertexArray = new FillLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.indexArray2 = new LineIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.segments2 = new SegmentVector();\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasDependencies = hasPattern('fill', this.layers, options);\n        const fillSortKey = this.layers[0].layout.get('fill-sort-key');\n        const sortFeaturesByKey = !fillSortKey.isConstant();\n        const bucketFeatures: BucketFeature[] = [];\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                fillSortKey.evaluate(evaluationFeature, {}, canonical, options.availableImages) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => a.sortKey - b.sortKey);\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n\n            if (this.hasDependencies) {\n                const patternFeature = addPatternDependencies('fill', this.layers, bucketFeature, {zoom: this.zoom}, options);\n                // pattern features are added only once the pattern is loaded into the image atlas\n                // so are stored during populate until later updated with positions by tile worker in addFeatures\n                this.patternFeatures.push(patternFeature);\n            } else {\n                this.addFeature(bucketFeature, geometry, index, canonical, {}, options.subdivisionGranularity);\n            }\n\n            const feature = features[index].feature;\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions, options.subdivisionGranularity);\n        }\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n            this.indexBuffer2 = context.createIndexBuffer(this.indexArray2);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.indexBuffer2.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.segments2.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {\n        [_: string]: ImagePosition;\n    }, subdivisionGranularity: SubdivisionGranularitySetting) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n            const subdivided = subdividePolygon(polygon, canonical, subdivisionGranularity.fill.getGranularityForZoomLevel(canonical.z));\n\n            const vertexArray = this.layoutVertexArray;\n\n            fillLargeMeshArrays(\n                (x, y) => {\n                    vertexArray.emplaceBack(x, y);\n                },\n                this.segments,\n                this.layoutVertexArray,\n                this.indexArray,\n                subdivided.verticesFlattened,\n                subdivided.indicesTriangles,\n                this.segments2,\n                this.indexArray2,\n                subdivided.indicesLineList,\n            );\n        }\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions, canonical});\n    }\n}\n\nregister('FillBucket', FillBucket, {omit: ['layers', 'patternFeatures']});\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type FillLayoutProps = {\n    \"fill-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type FillLayoutPropsPossiblyEvaluated = {\n    \"fill-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<FillLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"fill-sort-key\": new DataDrivenProperty(styleSpec[\"layout_fill\"][\"fill-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type FillPaintProps = {\n    \"fill-antialias\": DataConstantProperty<boolean>,\n    \"fill-opacity\": DataDrivenProperty<number>,\n    \"fill-color\": DataDrivenProperty<Color>,\n    \"fill-outline-color\": DataDrivenProperty<Color>,\n    \"fill-translate\": DataConstantProperty<[number, number]>,\n    \"fill-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"fill-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n};\n\nexport type FillPaintPropsPossiblyEvaluated = {\n    \"fill-antialias\": boolean,\n    \"fill-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-outline-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-translate\": [number, number],\n    \"fill-translate-anchor\": \"map\" | \"viewport\",\n    \"fill-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n};\n\nlet paint: Properties<FillPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"fill-antialias\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-antialias\"] as any as StylePropertySpecification),\n    \"fill-opacity\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-opacity\"] as any as StylePropertySpecification),\n    \"fill-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-color\"] as any as StylePropertySpecification),\n    \"fill-outline-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-outline-color\"] as any as StylePropertySpecification),\n    \"fill-translate\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate\"] as any as StylePropertySpecification),\n    \"fill-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate-anchor\"] as any as StylePropertySpecification),\n    \"fill-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-pattern\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\nimport {FillBucket} from '../../data/bucket/fill_bucket';\nimport {polygonIntersectsMultiPolygon} from '../../util/intersection_tests';\nimport {translateDistance, translate} from '../query_utils';\nimport properties, {type FillLayoutPropsPossiblyEvaluated, type FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties.g';\n\nimport type {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g';\nimport type {EvaluationParameters} from '../evaluation_parameters';\n\nexport const isFillStyleLayer = (layer: StyleLayer): layer is FillStyleLayer => layer.type === 'fill';\n\nexport class FillStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<FillLayoutProps>;\n    layout: PossiblyEvaluated<FillLayoutProps, FillLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<FillPaintProps>;\n    _transitioningPaint: Transitioning<FillPaintProps>;\n    paint: PossiblyEvaluated<FillPaintProps, FillPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n\n        const outlineColor = this.paint._values['fill-outline-color'];\n        if (outlineColor.value.kind === 'constant' && outlineColor.value.value === undefined) {\n            this.paint._values['fill-outline-color'] = this.paint._values['fill-color'];\n        }\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new FillBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return translateDistance(this.paint.get('fill-translate'));\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        geometry,\n        transform,\n        pixelsToTileUnits}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('fill-translate'),\n            this.paint.get('fill-translate-anchor'),\n            -transform.bearingInRadians, pixelsToTileUnits);\n        return polygonIntersectsMultiPolygon(translatedPolygon, geometry);\n    }\n\n    isTileClipped() {\n        return true;\n    }\n}\n","import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos',          components: 2, type: 'Int16'},\n    {name: 'a_normal_ed',    components: 4, type: 'Int16'},\n], 4);\n\nexport const centroidAttributes = createLayout([\n    {name: 'a_centroid', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n","\nimport Point from '@mapbox/point-geometry';\n\n/** @import Pbf from 'pbf' */\n/** @import {Feature} from 'geojson' */\n\nexport class VectorTileFeature {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} end\n     * @param {number} extent\n     * @param {string[]} keys\n     * @param {(number | string | boolean)[]} values\n     */\n    constructor(pbf, end, extent, keys, values) {\n        // Public\n\n        /** @type {Record<string, number | string | boolean>} */\n        this.properties = {};\n\n        this.extent = extent;\n        /** @type {0 | 1 | 2 | 3} */\n        this.type = 0;\n\n        /** @type {number | undefined} */\n        this.id = undefined;\n\n        /** @private */\n        this._pbf = pbf;\n        /** @private */\n        this._geometry = -1;\n        /** @private */\n        this._keys = keys;\n        /** @private */\n        this._values = values;\n\n        pbf.readFields(readFeature, this, end);\n    }\n\n    loadGeometry() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n\n        /** @type Point[][] */\n        const lines = [];\n\n        /** @type Point[] | undefined */\n        let line;\n\n        let cmd = 1;\n        let length = 0;\n        let x = 0;\n        let y = 0;\n\n        while (pbf.pos < end) {\n            if (length <= 0) {\n                const cmdLen = pbf.readVarint();\n                cmd = cmdLen & 0x7;\n                length = cmdLen >> 3;\n            }\n\n            length--;\n\n            if (cmd === 1 || cmd === 2) {\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\n\n                if (cmd === 1) { // moveTo\n                    if (line) lines.push(line);\n                    line = [];\n                }\n\n                if (line) line.push(new Point(x, y));\n\n            } else if (cmd === 7) {\n\n                // Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90\n                if (line) {\n                    line.push(line[0].clone()); // closePolygon\n                }\n\n            } else {\n                throw new Error(`unknown command ${cmd}`);\n            }\n        }\n\n        if (line) lines.push(line);\n\n        return lines;\n    }\n\n    bbox() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n        let cmd = 1,\n            length = 0,\n            x = 0,\n            y = 0,\n            x1 = Infinity,\n            x2 = -Infinity,\n            y1 = Infinity,\n            y2 = -Infinity;\n\n        while (pbf.pos < end) {\n            if (length <= 0) {\n                const cmdLen = pbf.readVarint();\n                cmd = cmdLen & 0x7;\n                length = cmdLen >> 3;\n            }\n\n            length--;\n\n            if (cmd === 1 || cmd === 2) {\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\n                if (x < x1) x1 = x;\n                if (x > x2) x2 = x;\n                if (y < y1) y1 = y;\n                if (y > y2) y2 = y;\n\n            } else if (cmd !== 7) {\n                throw new Error(`unknown command ${cmd}`);\n            }\n        }\n\n        return [x1, y1, x2, y2];\n    }\n\n    /**\n     * @param {number} x\n     * @param {number} y\n     * @param {number} z\n     * @return {Feature}\n     */\n    toGeoJSON(x, y, z) {\n        const size = this.extent * Math.pow(2, z),\n            x0 = this.extent * x,\n            y0 = this.extent * y,\n            vtCoords = this.loadGeometry();\n\n        /** @param {Point} p */\n        function projectPoint(p) {\n            return [\n                (p.x + x0) * 360 / size - 180,\n                360 / Math.PI * Math.atan(Math.exp((1 - (p.y + y0) * 2 / size) * Math.PI)) - 90\n            ];\n        }\n\n        /** @param {Point[]} line */\n        function projectLine(line) {\n            return line.map(projectPoint);\n        }\n\n        /** @type {Feature[\"geometry\"]} */\n        let geometry;\n\n        if (this.type === 1) {\n            const points = [];\n            for (const line of vtCoords) {\n                points.push(line[0]);\n            }\n            const coordinates = projectLine(points);\n            geometry = points.length === 1 ?\n                {type: 'Point', coordinates: coordinates[0]} :\n                {type: 'MultiPoint', coordinates};\n\n        } else if (this.type === 2) {\n\n            const coordinates = vtCoords.map(projectLine);\n            geometry = coordinates.length === 1 ?\n                {type: 'LineString', coordinates: coordinates[0]} :\n                {type: 'MultiLineString', coordinates};\n\n        } else if (this.type === 3) {\n            const polygons = classifyRings(vtCoords);\n            const coordinates = [];\n            for (const polygon of polygons) {\n                coordinates.push(polygon.map(projectLine));\n            }\n            geometry = coordinates.length === 1 ?\n                {type: 'Polygon', coordinates: coordinates[0]} :\n                {type: 'MultiPolygon', coordinates};\n        } else {\n\n            throw new Error('unknown feature type');\n        }\n\n        /** @type {Feature} */\n        const result = {\n            type: 'Feature',\n            geometry,\n            properties: this.properties\n        };\n\n        if (this.id != null) {\n            result.id = this.id;\n        }\n\n        return result;\n    }\n}\n\n/** @type {['Unknown', 'Point', 'LineString', 'Polygon']} */\nVectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\n/**\n * @param {number} tag\n * @param {VectorTileFeature} feature\n * @param {Pbf} pbf\n */\nfunction readFeature(tag, feature, pbf) {\n    if (tag === 1) feature.id = pbf.readVarint();\n    else if (tag === 2) readTag(pbf, feature);\n    else if (tag === 3) feature.type = /** @type {0 | 1 | 2 | 3} */ (pbf.readVarint());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) feature._geometry = pbf.pos;\n}\n\n/**\n * @param {Pbf} pbf\n * @param {VectorTileFeature} feature\n */\nfunction readTag(pbf, feature) {\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const key = feature._keys[pbf.readVarint()];\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const value = feature._values[pbf.readVarint()];\n        feature.properties[key] = value;\n    }\n}\n\n/** classifies an array of rings into polygons with outer rings and holes\n * @param {Point[][]} rings\n */\nexport function classifyRings(rings) {\n    const len = rings.length;\n\n    if (len <= 1) return [rings];\n\n    const polygons = [];\n    let polygon, ccw;\n\n    for (let i = 0; i < len; i++) {\n        const area = signedArea(rings[i]);\n        if (area === 0) continue;\n\n        if (ccw === undefined) ccw = area < 0;\n\n        if (ccw === area < 0) {\n            if (polygon) polygons.push(polygon);\n            polygon = [rings[i]];\n\n        } else if (polygon) {\n            polygon.push(rings[i]);\n        }\n    }\n    if (polygon) polygons.push(polygon);\n\n    return polygons;\n}\n\n/** @param {Point[]} ring */\nfunction signedArea(ring) {\n    let sum = 0;\n    for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n        p1 = ring[i];\n        p2 = ring[j];\n        sum += (p2.x - p1.x) * (p1.y + p2.y);\n    }\n    return sum;\n}\n\nexport class VectorTileLayer {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        // Public\n        this.version = 1;\n        this.name = '';\n        this.extent = 4096;\n        this.length = 0;\n\n        /** @private */\n        this._pbf = pbf;\n\n        /** @private\n         * @type {string[]} */\n        this._keys = [];\n\n        /** @private\n         * @type {(number | string | boolean)[]} */\n        this._values = [];\n\n        /** @private\n         * @type {number[]} */\n        this._features = [];\n\n        pbf.readFields(readLayer, this, end);\n\n        this.length = this._features.length;\n    }\n\n    /** return feature `i` from this layer as a `VectorTileFeature`\n     * @param {number} i\n     */\n    feature(i) {\n        if (i < 0 || i >= this._features.length) throw new Error('feature index out of bounds');\n\n        this._pbf.pos = this._features[i];\n\n        const end = this._pbf.readVarint() + this._pbf.pos;\n        return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {VectorTileLayer} layer\n * @param {Pbf} pbf\n */\nfunction readLayer(tag, layer, pbf) {\n    if (tag === 15) layer.version = pbf.readVarint();\n    else if (tag === 1) layer.name = pbf.readString();\n    else if (tag === 5) layer.extent = pbf.readVarint();\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 2) layer._features.push(pbf.pos);\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 3) layer._keys.push(pbf.readString());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) layer._values.push(readValueMessage(pbf));\n}\n\n/**\n * @param {Pbf} pbf\n */\nfunction readValueMessage(pbf) {\n    let value = null;\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        const tag = pbf.readVarint() >> 3;\n\n        value = tag === 1 ? pbf.readString() :\n            tag === 2 ? pbf.readFloat() :\n            tag === 3 ? pbf.readDouble() :\n            tag === 4 ? pbf.readVarint64() :\n            tag === 5 ? pbf.readVarint() :\n            tag === 6 ? pbf.readSVarint() :\n            tag === 7 ? pbf.readBoolean() : null;\n    }\n    if (value == null) {\n        throw new Error('unknown feature value');\n    }\n\n    return value;\n}\n\nexport class VectorTile {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        /** @type {Record<string, VectorTileLayer>} */\n        this.layers = pbf.readFields(readTile, {}, end);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {Record<string, VectorTileLayer>} layers\n * @param {Pbf} pbf\n */\nfunction readTile(tag, layers, pbf) {\n    if (tag === 3) {\n        const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);\n        if (layer.length) layers[layer.name] = layer;\n    }\n}\n","import {FillExtrusionLayoutArray, PosArray} from '../array_types.g';\n\nimport {members as layoutAttributes, centroidAttributes} from './fill_extrusion_attributes';\nimport {type Segment, SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {EXTENT} from '../extent';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\nimport {classifyRings} from '@maplibre/maplibre-gl-style-spec';\nconst EARCUT_MAX_RINGS = 500;\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\n\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {subdividePolygon, subdivideVertexLine} from '../../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {fillLargeMeshArrays} from '../../render/fill_large_mesh_arrays';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nconst FACTOR = Math.pow(2, 13);\n\nfunction addVertex(vertexArray, x, y, nx, ny, nz, t, e) {\n    vertexArray.emplaceBack(\n        // a_pos\n        x,\n        y,\n        // a_normal_ed: 3-component normal and 1-component edgedistance\n        Math.floor(nx * FACTOR) * 2 + t,\n        ny * FACTOR * 2,\n        nz * FACTOR * 2,\n        // edgedistance (used for wrapping patterns around extrusion sides)\n        Math.round(e)\n    );\n}\n\ntype CentroidAccumulator = {\n    x: number;\n    y: number;\n    sampleCount: number;\n};\n\nexport class FillExtrusionBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<FillExtrusionStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<FillExtrusionStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n\n    layoutVertexArray: FillExtrusionLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    centroidVertexArray: PosArray;\n    centroidVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: boolean;\n    programConfigurations: ProgramConfigurationSet<FillExtrusionStyleLayer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n    features: Array<BucketFeature>;\n\n    constructor(options: BucketParameters<FillExtrusionStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasDependencies = false;\n\n        this.layoutVertexArray = new FillExtrusionLayoutArray();\n        this.centroidVertexArray = new PosArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.features = [];\n        this.hasDependencies = hasPattern('fill-extrusion', this.layers, options);\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                properties: feature.properties,\n                type: feature.type,\n                patterns: {}\n            };\n\n            if (this.hasDependencies) {\n                this.features.push(addPatternDependencies('fill-extrusion', this.layers, bucketFeature, {zoom: this.zoom}, options));\n            } else {\n                this.addFeature(bucketFeature, bucketFeature.geometry, index, canonical, {}, options.subdivisionGranularity);\n            }\n\n            options.featureIndex.insert(feature, bucketFeature.geometry, index, sourceLayerIndex, this.index, true);\n        }\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {\n        for (const feature of this.features) {\n            const {geometry} = feature;\n            this.addFeature(feature, geometry, feature.index, canonical, imagePositions, options.subdivisionGranularity);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions\n        });\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0 && this.centroidVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.centroidVertexBuffer = context.createVertexBuffer(this.centroidVertexArray, centroidAttributes.members, true);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.centroidVertexBuffer.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, subdivisionGranularity: SubdivisionGranularitySetting) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n            // Compute polygon centroid to calculate elevation in GPU\n            const centroid: CentroidAccumulator = {x: 0, y: 0, sampleCount: 0};\n            const oldVertexCount = this.layoutVertexArray.length;\n            this.processPolygon(centroid, canonical, feature, polygon, subdivisionGranularity);\n\n            const addedVertices = this.layoutVertexArray.length - oldVertexCount;\n\n            const centroidX = Math.floor(centroid.x / centroid.sampleCount);\n            const centroidY = Math.floor(centroid.y / centroid.sampleCount);\n\n            for (let i = 0; i < addedVertices; i++) {\n                this.centroidVertexArray.emplaceBack(\n                    centroidX,\n                    centroidY\n                );\n            }\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions, canonical});\n    }\n\n    private processPolygon(\n        centroid: CentroidAccumulator,\n        canonical: CanonicalTileID,\n        feature: BucketFeature,\n        polygon: Array<Array<Point>>,\n        subdivisionGranularity: SubdivisionGranularitySetting\n    ): void {\n        if (polygon.length < 1) {\n            return;\n        }\n\n        if (isEntirelyOutside(polygon[0])) {\n            return;\n        }\n\n        // Only consider the un-subdivided polygon outer ring for centroid calculation\n        for (const ring of polygon) {\n            if (ring.length === 0) {\n                continue;\n            }\n\n            // Here we don't mind if a hole ring is entirely outside, unlike when generating geometry later.\n            accumulatePointsToCentroid(centroid, ring);\n        }\n\n        const segmentReference = {\n            segment: this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray)\n        };\n        const granularity = subdivisionGranularity.fill.getGranularityForZoomLevel(canonical.z);\n        const isPolygon = VectorTileFeature.types[feature.type] === 'Polygon';\n\n        for (const ring of polygon) {\n            if (ring.length === 0) {\n                continue;\n            }\n\n            if (isEntirelyOutside(ring)) {\n                continue;\n            }\n\n            const subdividedRing = subdivideVertexLine(ring, granularity, isPolygon);\n            this._generateSideFaces(subdividedRing, segmentReference);\n        }\n\n        // Only triangulate and draw the area of the feature if it is a polygon\n        // Other feature types (e.g. LineString) do not have area, so triangulation is pointless / undefined\n        if (!isPolygon)\n            return;\n\n        // Do not generate outlines, since outlines already got subdivided earlier.\n        const subdividedPolygon = subdividePolygon(polygon, canonical, granularity, false);\n        const vertexArray = this.layoutVertexArray;\n\n        fillLargeMeshArrays(\n            (x, y) => {\n                addVertex(vertexArray, x, y, 0, 0, 1, 1, 0);\n            },\n            this.segments,\n            this.layoutVertexArray,\n            this.indexArray,\n            subdividedPolygon.verticesFlattened,\n            subdividedPolygon.indicesTriangles\n        );\n    }\n\n    /**\n     * Generates side faces for the supplied geometry. Assumes `geometry` to be a line string, like the output of {@link subdivideVertexLine}.\n     * For rings, it is assumed that the first and last vertex of `geometry` are equal.\n     */\n    private _generateSideFaces(geometry: Array<Point>, segmentReference: {segment: Segment}) {\n        let edgeDistance = 0;\n\n        for (let p = 1; p < geometry.length; p++) {\n            const p1 = geometry[p];\n            const p2 = geometry[p - 1];\n\n            if (isBoundaryEdge(p1, p2)) {\n                continue;\n            }\n\n            if (segmentReference.segment.vertexLength + 4 > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                segmentReference.segment = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray);\n            }\n\n            const perp = p1.sub(p2)._perp()._unit();\n            const dist = p2.dist(p1);\n            if (edgeDistance + dist > 32768) edgeDistance = 0;\n\n            addVertex(this.layoutVertexArray, p1.x, p1.y, perp.x, perp.y, 0, 0, edgeDistance);\n            addVertex(this.layoutVertexArray, p1.x, p1.y, perp.x, perp.y, 0, 1, edgeDistance);\n\n            edgeDistance += dist;\n\n            addVertex(this.layoutVertexArray, p2.x, p2.y, perp.x, perp.y, 0, 0, edgeDistance);\n            addVertex(this.layoutVertexArray, p2.x, p2.y, perp.x, perp.y, 0, 1, edgeDistance);\n\n            const bottomRight = segmentReference.segment.vertexLength;\n\n            // ┌──────┐\n            // │ 0  1 │ Counter-clockwise winding order.\n            // │      │ Triangle 1: 0 => 2 => 1\n            // │ 2  3 │ Triangle 2: 1 => 2 => 3\n            // └──────┘\n            this.indexArray.emplaceBack(bottomRight, bottomRight + 2, bottomRight + 1);\n            this.indexArray.emplaceBack(bottomRight + 1, bottomRight + 2, bottomRight + 3);\n\n            segmentReference.segment.vertexLength += 4;\n            segmentReference.segment.primitiveLength += 2;\n        }\n    }\n}\n\n/**\n * Accumulates geometry to centroid. Geometry can be either a polygon ring, a line string or a closed line string.\n * In case of a polygon ring or line ring, the last vertex is ignored if it is the same as the first vertex.\n */\nfunction accumulatePointsToCentroid(centroid: CentroidAccumulator, geometry: Array<Point>): void {\n    for (let i = 0; i < geometry.length; i++) {\n        const p = geometry[i];\n\n        if (i === geometry.length - 1 && geometry[0].x === p.x && geometry[0].y === p.y) {\n            continue;\n        }\n\n        centroid.x += p.x;\n        centroid.y += p.y;\n        centroid.sampleCount++;\n    }\n}\n\nregister('FillExtrusionBucket', FillExtrusionBucket, {omit: ['layers', 'features']});\n\nfunction isBoundaryEdge(p1, p2) {\n    return (p1.x === p2.x && (p1.x < 0 || p1.x > EXTENT)) ||\n        (p1.y === p2.y && (p1.y < 0 || p1.y > EXTENT));\n}\n\nfunction isEntirelyOutside(ring) {\n    return ring.every(p => p.x < 0) ||\n        ring.every(p => p.x > EXTENT) ||\n        ring.every(p => p.y < 0) ||\n        ring.every(p => p.y > EXTENT);\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type FillExtrusionPaintProps = {\n    \"fill-extrusion-opacity\": DataConstantProperty<number>,\n    \"fill-extrusion-color\": DataDrivenProperty<Color>,\n    \"fill-extrusion-translate\": DataConstantProperty<[number, number]>,\n    \"fill-extrusion-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"fill-extrusion-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n    \"fill-extrusion-height\": DataDrivenProperty<number>,\n    \"fill-extrusion-base\": DataDrivenProperty<number>,\n    \"fill-extrusion-vertical-gradient\": DataConstantProperty<boolean>,\n};\n\nexport type FillExtrusionPaintPropsPossiblyEvaluated = {\n    \"fill-extrusion-opacity\": number,\n    \"fill-extrusion-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-extrusion-translate\": [number, number],\n    \"fill-extrusion-translate-anchor\": \"map\" | \"viewport\",\n    \"fill-extrusion-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n    \"fill-extrusion-height\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-extrusion-base\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-extrusion-vertical-gradient\": boolean,\n};\n\nlet paint: Properties<FillExtrusionPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"fill-extrusion-opacity\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"] as any as StylePropertySpecification),\n    \"fill-extrusion-color\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-color\"] as any as StylePropertySpecification),\n    \"fill-extrusion-translate\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"] as any as StylePropertySpecification),\n    \"fill-extrusion-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"] as any as StylePropertySpecification),\n    \"fill-extrusion-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"] as any as StylePropertySpecification),\n    \"fill-extrusion-height\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-height\"] as any as StylePropertySpecification),\n    \"fill-extrusion-base\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-base\"] as any as StylePropertySpecification),\n    \"fill-extrusion-vertical-gradient\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\n\nimport {FillExtrusionBucket} from '../../data/bucket/fill_extrusion_bucket';\nimport {polygonIntersectsPolygon, polygonIntersectsMultiPolygon} from '../../util/intersection_tests';\nimport {translateDistance, translate} from '../query_utils';\nimport properties, {type FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\nimport {type mat4, vec4} from 'gl-matrix';\nimport Point from '@mapbox/point-geometry';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g';\n\nexport class Point3D extends Point {\n    z: number;\n}\n\nexport const isFillExtrusionStyleLayer = (layer: StyleLayer): layer is FillExtrusionStyleLayer => layer.type === 'fill-extrusion';\n\nexport class FillExtrusionStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<FillExtrusionPaintProps>;\n    _transitioningPaint: Transitioning<FillExtrusionPaintProps>;\n    paint: PossiblyEvaluated<FillExtrusionPaintProps, FillExtrusionPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    createBucket(parameters: BucketParameters<FillExtrusionStyleLayer>) {\n        return new FillExtrusionBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return translateDistance(this.paint.get('fill-extrusion-translate'));\n    }\n\n    is3D(): boolean {\n        return true;\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits,\n        pixelPosMatrix}: QueryIntersectsFeatureParams\n    ): boolean | number {\n\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('fill-extrusion-translate'),\n            this.paint.get('fill-extrusion-translate-anchor'),\n            -transform.bearingInRadians, pixelsToTileUnits);\n\n        const height = this.paint.get('fill-extrusion-height').evaluate(feature, featureState);\n        const base = this.paint.get('fill-extrusion-base').evaluate(feature, featureState);\n\n        const projectedQueryGeometry = projectQueryGeometry(translatedPolygon, pixelPosMatrix, 0);\n\n        const projected = projectExtrusion(geometry, base, height, pixelPosMatrix);\n        const projectedBase = projected[0];\n        const projectedTop = projected[1];\n        return checkIntersection(projectedBase, projectedTop, projectedQueryGeometry);\n    }\n}\n\nfunction dot(a, b) {\n    return a.x * b.x + a.y * b.y;\n}\n\nexport function getIntersectionDistance(projectedQueryGeometry: Array<Point3D>, projectedFace: Array<Point3D>) {\n\n    if (projectedQueryGeometry.length === 1) {\n        // For point queries calculate the z at which the point intersects the face\n        // using barycentric coordinates.\n\n        // Find the barycentric coordinates of the projected point within the first\n        // triangle of the face, using only the xy plane. It doesn't matter if the\n        // point is outside the first triangle because all the triangles in the face\n        // are in the same plane.\n        //\n        // Check whether points are coincident and use other points if they are.\n        let i = 0;\n        const a = projectedFace[i++];\n        let b;\n        while (!b || a.equals(b)) {\n            b = projectedFace[i++];\n            if (!b) return Infinity;\n        }\n\n        // Loop until point `c` is not colinear with points `a` and `b`.\n        for (; i < projectedFace.length; i++) {\n            const c = projectedFace[i];\n\n            const p = projectedQueryGeometry[0];\n\n            const ab = b.sub(a);\n            const ac = c.sub(a);\n            const ap = p.sub(a);\n\n            const dotABAB = dot(ab, ab);\n            const dotABAC = dot(ab, ac);\n            const dotACAC = dot(ac, ac);\n            const dotAPAB = dot(ap, ab);\n            const dotAPAC = dot(ap, ac);\n            const denom = dotABAB * dotACAC - dotABAC * dotABAC;\n\n            const v = (dotACAC * dotAPAB - dotABAC * dotAPAC) / denom;\n            const w = (dotABAB * dotAPAC - dotABAC * dotAPAB) / denom;\n            const u = 1 - v - w;\n\n            // Use the barycentric weighting along with the original triangle z coordinates to get the point of intersection.\n            const distance = a.z * u + b.z * v + c.z * w;\n\n            if (isFinite(distance)) return distance;\n        }\n\n        return Infinity;\n\n    } else {\n        // The counts as closest is less clear when the query is a box. This\n        // returns the distance to the nearest point on the face, whether it is\n        // within the query or not. It could be more correct to return the\n        // distance to the closest point within the query box but this would be\n        // more complicated and expensive to calculate with little benefit.\n        let closestDistance = Infinity;\n        for (const p of projectedFace) {\n            closestDistance = Math.min(closestDistance, p.z);\n        }\n        return closestDistance;\n    }\n}\n\nfunction checkIntersection(projectedBase: Array<Array<Point3D>>, projectedTop: Array<Array<Point3D>>, projectedQueryGeometry: Array<Point3D>) {\n    let closestDistance = Infinity;\n\n    if (polygonIntersectsMultiPolygon(projectedQueryGeometry, projectedTop)) {\n        closestDistance = getIntersectionDistance(projectedQueryGeometry, projectedTop[0]);\n    }\n\n    for (let r = 0; r < projectedTop.length; r++) {\n        const ringTop = projectedTop[r];\n        const ringBase = projectedBase[r];\n        for (let p = 0; p < ringTop.length - 1; p++) {\n            const topA = ringTop[p];\n            const topB = ringTop[p + 1];\n            const baseA = ringBase[p];\n            const baseB = ringBase[p + 1];\n            const face = [topA, topB, baseB, baseA, topA];\n            if (polygonIntersectsPolygon(projectedQueryGeometry, face)) {\n                closestDistance = Math.min(closestDistance, getIntersectionDistance(projectedQueryGeometry, face));\n            }\n        }\n    }\n\n    return closestDistance === Infinity ? false : closestDistance;\n}\n\n/*\n * Project the geometry using matrix `m`. This is essentially doing\n * `vec4.transformMat4([], [p.x, p.y, z, 1], m)` but the multiplication\n * is inlined so that parts of the projection that are the same across\n * different points can only be done once. This produced a measurable\n * performance improvement.\n */\nfunction projectExtrusion(geometry: Array<Array<Point>>, zBase: number, zTop: number, m: mat4): [Array<Array<Point3D>>, Array<Array<Point3D>>] {\n    const projectedBase = [] as Array<Array<Point3D>>;\n    const projectedTop = [] as Array<Array<Point3D>>;\n    const baseXZ = m[8] * zBase;\n    const baseYZ = m[9] * zBase;\n    const baseZZ = m[10] * zBase;\n    const baseWZ = m[11] * zBase;\n    const topXZ = m[8] * zTop;\n    const topYZ = m[9] * zTop;\n    const topZZ = m[10] * zTop;\n    const topWZ = m[11] * zTop;\n\n    for (const r of geometry) {\n        const ringBase = [] as Array<Point3D>;\n        const ringTop = [] as Array<Point3D>;\n        for (const p of r) {\n            const x = p.x;\n            const y = p.y;\n\n            const sX = m[0] * x + m[4] * y + m[12];\n            const sY = m[1] * x + m[5] * y + m[13];\n            const sZ = m[2] * x + m[6] * y + m[14];\n            const sW = m[3] * x + m[7] * y + m[15];\n\n            const baseX = sX + baseXZ;\n            const baseY = sY + baseYZ;\n            const baseZ = sZ + baseZZ;\n            const baseW = sW + baseWZ;\n\n            const topX = sX + topXZ;\n            const topY = sY + topYZ;\n            const topZ = sZ + topZZ;\n            const topW = sW + topWZ;\n\n            const b = new Point(baseX / baseW, baseY / baseW) as Point3D;\n            b.z = baseZ / baseW;\n            ringBase.push(b);\n\n            const t = new Point(topX / topW, topY / topW) as Point3D;\n            t.z = topZ / topW;\n            ringTop.push(t);\n        }\n        projectedBase.push(ringBase);\n        projectedTop.push(ringTop);\n    }\n    return [projectedBase, projectedTop];\n}\n\nfunction projectQueryGeometry(queryGeometry: Array<Point>, pixelPosMatrix: mat4, z: number) {\n    const projectedQueryGeometry = [];\n    for (const p of queryGeometry) {\n        const v = [p.x, p.y, z, 1] as vec4;\n        vec4.transformMat4(v, v, pixelPosMatrix);\n        projectedQueryGeometry.push(new Point(v[0] / v[3], v[1] / v[3]));\n    }\n    return projectedQueryGeometry;\n}\n","import {createLayout} from '../../util/struct_array';\n\nexport const lineLayoutAttributes = createLayout([\n    {name: 'a_pos_normal', components: 2, type: 'Int16'},\n    {name: 'a_data', components: 4, type: 'Uint8'}\n], 4);\n\nexport const {members, size, alignment} = lineLayoutAttributes;\n","import {createLayout} from '../../util/struct_array';\n\nexport const lineLayoutAttributesExt = createLayout([\n    {name: 'a_uv_x', components: 1, type: 'Float32'},\n    {name: 'a_split_index', components: 1, type: 'Float32'},\n]);\n\nexport const {members, size, alignment} = lineLayoutAttributesExt;\n","import {LineLayoutArray, LineExtLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './line_attributes';\nimport {members as layoutAttributesExt} from './line_attributes_ext';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {EXTENT} from '../extent';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type Point from '@mapbox/point-geometry';\nimport type {Segment} from '../segment';\nimport {type RGBAImage} from '../../util/image';\nimport type {Context} from '../../gl/context';\nimport type {Texture} from '../../render/texture';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport {subdivideVertexLine} from '../../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {type DashEntry} from '../../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\n// NOTE ON EXTRUDE SCALE:\n// scale the extrusion vector so that the normal length is this value.\n// contains the \"texture\" normals (-1..1). this is distinct from the extrude\n// normals for line joins, because the x-value remains 0 for the texture\n// normal array, while the extrude normal actually moves the vertex to create\n// the acute/bevelled line join.\nconst EXTRUDE_SCALE = 63;\n\n/*\n * Sharp corners cause dashed lines to tilt because the distance along the line\n * is the same at both the inner and outer corners. To improve the appearance of\n * dashed lines we add extra points near sharp corners so that a smaller part\n * of the line is tilted.\n *\n * COS_HALF_SHARP_CORNER controls how sharp a corner has to be for us to add an\n * extra vertex. The default is 75 degrees.\n *\n * The newly created vertices are placed SHARP_CORNER_OFFSET pixels from the corner.\n */\nconst COS_HALF_SHARP_CORNER = Math.cos(75 / 2 * (Math.PI / 180));\nconst SHARP_CORNER_OFFSET = 15;\n\n// Angle per triangle for approximating round line joins.\nconst DEG_PER_TRIANGLE = 20;\n\n// The number of bits that is used to store the line distance in the buffer.\nconst LINE_DISTANCE_BUFFER_BITS = 15;\n\n// We don't have enough bits for the line distance as we'd like to have, so\n// use this value to scale the line distance (in tile units) down to a smaller\n// value. This lets us store longer distances while sacrificing precision.\nconst LINE_DISTANCE_SCALE = 1 / 2;\n\n// The maximum line distance, in tile units, that fits in the buffer.\nconst MAX_LINE_DISTANCE = Math.pow(2, LINE_DISTANCE_BUFFER_BITS - 1) / LINE_DISTANCE_SCALE;\n\ntype LineClips = {\n    start: number;\n    end: number;\n};\n\ntype GradientTexture = {\n    texture?: Texture;\n    gradient?: RGBAImage;\n    version?: number;\n};\n\n/**\n * @internal\n * Line bucket class\n */\nexport class LineBucket implements Bucket {\n    distance: number;\n    totalDistance: number;\n    maxLineLength: number;\n    scaledDistance: number;\n    lineClips?: LineClips;\n\n    e1: number;\n    e2: number;\n\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<LineStyleLayer>;\n    layerIds: Array<string>;\n    gradients: {[x: string]: GradientTexture};\n    stateDependentLayers: Array<any>;\n    stateDependentLayerIds: Array<string>;\n    patternFeatures: Array<BucketFeature>;\n    lineClipsArray: Array<LineClips>;\n\n    layoutVertexArray: LineLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n    layoutVertexArray2: LineExtLayoutArray;\n    layoutVertexBuffer2: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasDependencies: boolean;\n    programConfigurations: ProgramConfigurationSet<LineStyleLayer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<LineStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasDependencies = false;\n        this.patternFeatures = [];\n        this.lineClipsArray = [];\n        this.gradients = {};\n        this.layers.forEach(layer => {\n            this.gradients[layer.id] = {};\n        });\n\n        this.layoutVertexArray = new LineLayoutArray();\n        this.layoutVertexArray2 = new LineExtLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.maxLineLength = 0;\n\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasDependencies = hasPattern('line', this.layers, options) || this.hasLineDasharray(this.layers);\n        const lineSortKey = this.layers[0].layout.get('line-sort-key');\n        const sortFeaturesByKey = !lineSortKey.isConstant();\n        const bucketFeatures: BucketFeature[] = [];\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                lineSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                dashes: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => {\n                return (a.sortKey) - (b.sortKey);\n            });\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n\n            if (this.hasDependencies) {\n                if (hasPattern('line', this.layers, options)) {\n                    addPatternDependencies('line', this.layers, bucketFeature, {zoom: this.zoom}, options);\n                } else if (this.hasLineDasharray(this.layers)) {\n                    this.addLineDashDependencies(this.layers, bucketFeature, this.zoom, options);\n                }\n\n                // pattern features are added only once the pattern is loaded into the image atlas\n                // so are stored during populate until later updated with positions by tile worker in addFeatures\n                this.patternFeatures.push(bucketFeature);\n            } else {\n                this.addFeature(bucketFeature, geometry, index, canonical, {}, {}, options.subdivisionGranularity);\n            }\n\n            const feature = features[index].feature;\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}, dashPositions: {[_: string]: DashEntry}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {\n            imagePositions,\n            dashPositions\n        });\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, dashPositions?: {[_: string]: DashEntry}) {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions, dashPositions, options.subdivisionGranularity);\n        }\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            if (this.layoutVertexArray2.length !== 0) {\n                this.layoutVertexBuffer2 = context.createVertexBuffer(this.layoutVertexArray2, layoutAttributesExt);\n            }\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n    }\n\n    lineFeatureClips(feature: BucketFeature): LineClips | undefined {\n        if (!!feature.properties && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_start') && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_end')) {\n            const start = +feature.properties['mapbox_clip_start'];\n            const end = +feature.properties['mapbox_clip_end'];\n            return {start, end};\n        }\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}, dashPositions: Record<string, DashEntry>, subdivisionGranularity: SubdivisionGranularitySetting) {\n        const layout = this.layers[0].layout;\n        const join = layout.get('line-join').evaluate(feature, {});\n        const cap = layout.get('line-cap');\n        const miterLimit = layout.get('line-miter-limit');\n        const roundLimit = layout.get('line-round-limit');\n        this.lineClips = this.lineFeatureClips(feature);\n\n        for (const line of geometry) {\n            this.addLine(line, feature, join, cap, miterLimit, roundLimit, canonical, subdivisionGranularity);\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {imagePositions, dashPositions, canonical});\n    }\n\n    addLine(vertices: Array<Point>, feature: BucketFeature, join: string, cap: string, miterLimit: number, roundLimit: number, canonical: CanonicalTileID | undefined, subdivisionGranularity: SubdivisionGranularitySetting) {\n        this.distance = 0;\n        this.scaledDistance = 0;\n        this.totalDistance = 0;\n\n        // First, subdivide the line if needed (mostly for globe rendering)\n        const granularity = canonical ? subdivisionGranularity.line.getGranularityForZoomLevel(canonical.z) : 1;\n        vertices = subdivideVertexLine(vertices, granularity);\n\n        if (this.lineClips) {\n            this.lineClipsArray.push(this.lineClips);\n            // Calculate the total distance, in tile units, of this tiled line feature\n            for (let i = 0; i < vertices.length - 1; i++) {\n                this.totalDistance += vertices[i].dist(vertices[i + 1]);\n            }\n            this.updateScaledDistance();\n            this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance);\n        }\n\n        const isPolygon = VectorTileFeature.types[feature.type] === 'Polygon';\n\n        // If the line has duplicate vertices at the ends, adjust start/length to remove them.\n        let len = vertices.length;\n        while (len >= 2 && vertices[len - 1].equals(vertices[len - 2])) {\n            len--;\n        }\n        let first = 0;\n        while (first < len - 1 && vertices[first].equals(vertices[first + 1])) {\n            first++;\n        }\n\n        // Ignore invalid geometry.\n        if (len < (isPolygon ? 3 : 2)) return;\n\n        if (join === 'bevel') miterLimit = 1.05;\n\n        const sharpCornerOffset = this.overscaling <= 16 ?\n            SHARP_CORNER_OFFSET * EXTENT / (512 * this.overscaling) :\n            0;\n\n        // we could be more precise, but it would only save a negligible amount of space\n        const segment = this.segments.prepareSegment(len * 10, this.layoutVertexArray, this.indexArray);\n\n        let currentVertex: Point;\n        let prevVertex: Point;\n        let nextVertex: Point;\n        let prevNormal: Point;\n        let nextNormal: Point;\n\n        // the last two vertices added\n        this.e1 = this.e2 = -1;\n\n        if (isPolygon) {\n            currentVertex = vertices[len - 2];\n            nextNormal = vertices[first].sub(currentVertex)._unit()._perp();\n        }\n\n        for (let i = first; i < len; i++) {\n\n            nextVertex = i === len - 1 ?\n                (isPolygon ? vertices[first + 1] : undefined) : // if it's a polygon, treat the last vertex like the first\n                vertices[i + 1]; // just the next vertex\n\n            // if two consecutive vertices exist, skip the current one\n            if (nextVertex && vertices[i].equals(nextVertex)) continue;\n\n            if (nextNormal) prevNormal = nextNormal;\n            if (currentVertex) prevVertex = currentVertex;\n\n            currentVertex = vertices[i];\n\n            // Calculate the normal towards the next vertex in this line. In case\n            // there is no next vertex, pretend that the line is continuing straight,\n            // meaning that we are just using the previous normal.\n            nextNormal = nextVertex ? nextVertex.sub(currentVertex)._unit()._perp() : prevNormal;\n\n            // If we still don't have a previous normal, this is the beginning of a\n            // non-closed line, so we're doing a straight \"join\".\n            prevNormal = prevNormal || nextNormal;\n\n            // Determine the normal of the join extrusion. It is the angle bisector\n            // of the segments between the previous line and the next line.\n            // In the case of 180° angles, the prev and next normals cancel each other out:\n            // prevNormal + nextNormal = (0, 0), its magnitude is 0, so the unit vector would be\n            // undefined. In that case, we're keeping the joinNormal at (0, 0), so that the cosHalfAngle\n            // below will also become 0 and miterLength will become Infinity.\n            let joinNormal = prevNormal.add(nextNormal);\n            if (joinNormal.x !== 0 || joinNormal.y !== 0) {\n                joinNormal._unit();\n            }\n            /*  joinNormal     prevNormal\n             *             ↖      ↑\n             *                .________. prevVertex\n             *                |\n             * nextNormal  ←  |  currentVertex\n             *                |\n             *     nextVertex !\n             *\n             */\n\n            // calculate cosines of the angle (and its half) using dot product\n            const cosAngle = prevNormal.x * nextNormal.x + prevNormal.y * nextNormal.y;\n            const cosHalfAngle = joinNormal.x * nextNormal.x + joinNormal.y * nextNormal.y;\n\n            // Calculate the length of the miter (the ratio of the miter to the width)\n            // as the inverse of cosine of the angle between next and join normals\n            const miterLength = cosHalfAngle !== 0 ? 1 / cosHalfAngle : Infinity;\n\n            // approximate angle from cosine\n            const approxAngle = 2 * Math.sqrt(2 - 2 * cosHalfAngle);\n\n            const isSharpCorner = cosHalfAngle < COS_HALF_SHARP_CORNER && prevVertex && nextVertex;\n            const lineTurnsLeft = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0;\n\n            if (isSharpCorner && i > first) {\n                const prevSegmentLength = currentVertex.dist(prevVertex);\n                if (prevSegmentLength > 2 * sharpCornerOffset) {\n                    const newPrevVertex = currentVertex.sub(currentVertex.sub(prevVertex)._mult(sharpCornerOffset / prevSegmentLength)._round());\n                    this.updateDistance(prevVertex, newPrevVertex);\n                    this.addCurrentVertex(newPrevVertex, prevNormal, 0, 0, segment);\n                    prevVertex = newPrevVertex;\n                }\n            }\n\n            // The join if a middle vertex, otherwise the cap.\n            const middleVertex = prevVertex && nextVertex;\n            let currentJoin = middleVertex ? join : isPolygon ? 'butt' : cap;\n\n            if (middleVertex && currentJoin === 'round') {\n                if (miterLength < roundLimit) {\n                    currentJoin = 'miter';\n                } else if (miterLength <= 2) {\n                    currentJoin = 'fakeround';\n                }\n            }\n\n            if (currentJoin === 'miter' && miterLength > miterLimit) {\n                currentJoin = 'bevel';\n            }\n\n            if (currentJoin === 'bevel') {\n                // The maximum extrude length is 128 / 63 = 2 times the width of the line\n                // so if miterLength >= 2 we need to draw a different type of bevel here.\n                if (miterLength > 2) currentJoin = 'flipbevel';\n\n                // If the miterLength is really small and the line bevel wouldn't be visible,\n                // just draw a miter join to save a triangle.\n                if (miterLength < miterLimit) currentJoin = 'miter';\n            }\n\n            // Calculate how far along the line the currentVertex is\n            if (prevVertex) this.updateDistance(prevVertex, currentVertex);\n\n            if (currentJoin === 'miter') {\n\n                joinNormal._mult(miterLength);\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n\n            } else if (currentJoin === 'flipbevel') {\n                // miter is too big, flip the direction to make a beveled join\n\n                if (miterLength > 100) {\n                    // Almost parallel lines\n                    joinNormal = nextNormal.mult(-1);\n\n                } else {\n                    const bevelLength = miterLength * prevNormal.add(nextNormal).mag() / prevNormal.sub(nextNormal).mag();\n                    joinNormal._perp()._mult(bevelLength * (lineTurnsLeft ? -1 : 1));\n                }\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n                this.addCurrentVertex(currentVertex, joinNormal.mult(-1), 0, 0, segment);\n\n            } else if (currentJoin === 'bevel' || currentJoin === 'fakeround') {\n                const offset = -Math.sqrt(miterLength * miterLength - 1);\n                const offsetA = lineTurnsLeft ? offset : 0;\n                const offsetB = lineTurnsLeft ? 0 : offset;\n\n                // Close previous segment with a bevel\n                if (prevVertex) {\n                    this.addCurrentVertex(currentVertex, prevNormal, offsetA, offsetB, segment);\n                }\n\n                if (currentJoin === 'fakeround') {\n                    // The join angle is sharp enough that a round join would be visible.\n                    // Bevel joins fill the gap between segments with a single pie slice triangle.\n                    // Create a round join by adding multiple pie slices. The join isn't actually round, but\n                    // it looks like it is at the sizes we render lines at.\n\n                    // pick the number of triangles for approximating round join by based on the angle between normals\n                    const n = Math.round((approxAngle * 180 / Math.PI) / DEG_PER_TRIANGLE);\n\n                    for (let m = 1; m < n; m++) {\n                        let t = m / n;\n                        if (t !== 0.5) {\n                            // approximate spherical interpolation https://observablehq.com/@mourner/approximating-geometric-slerp\n                            const t2 = t - 0.5;\n                            const A = 1.0904 + cosAngle * (-3.2452 + cosAngle * (3.55645 - cosAngle * 1.43519));\n                            const B = 0.848013 + cosAngle * (-1.06021 + cosAngle * 0.215638);\n                            t = t + t * t2 * (t - 1) * (A * t2 * t2 + B);\n                        }\n                        const extrude = nextNormal.sub(prevNormal)._mult(t)._add(prevNormal)._unit()._mult(lineTurnsLeft ? -1 : 1);\n                        this.addHalfVertex(currentVertex, extrude.x, extrude.y, false, lineTurnsLeft, 0, segment);\n                    }\n                }\n\n                if (nextVertex) {\n                    // Start next segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -offsetA, -offsetB, segment);\n                }\n\n            } else if (currentJoin === 'butt') {\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment); // butt cap\n\n            } else if (currentJoin === 'square') {\n                const offset = prevVertex ? 1 : -1; // closing or starting square cap\n                this.addCurrentVertex(currentVertex, joinNormal, offset, offset, segment);\n\n            } else if (currentJoin === 'round') {\n\n                if (prevVertex) {\n                    // Close previous segment with butt\n                    this.addCurrentVertex(currentVertex, prevNormal, 0, 0, segment);\n\n                    // Add round cap or linejoin at end of segment\n                    this.addCurrentVertex(currentVertex, prevNormal, 1, 1, segment, true);\n                }\n                if (nextVertex) {\n                    // Add round cap before first segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -1, -1, segment, true);\n\n                    // Start next segment with a butt\n                    this.addCurrentVertex(currentVertex, nextNormal, 0, 0, segment);\n                }\n            }\n\n            if (isSharpCorner && i < len - 1) {\n                const nextSegmentLength = currentVertex.dist(nextVertex);\n                if (nextSegmentLength > 2 * sharpCornerOffset) {\n                    const newCurrentVertex = currentVertex.add(nextVertex.sub(currentVertex)._mult(sharpCornerOffset / nextSegmentLength)._round());\n                    this.updateDistance(currentVertex, newCurrentVertex);\n                    this.addCurrentVertex(newCurrentVertex, nextNormal, 0, 0, segment);\n                    currentVertex = newCurrentVertex;\n                }\n            }\n        }\n    }\n\n    /**\n     * Add two vertices to the buffers.\n     *\n     * @param p - the line vertex to add buffer vertices for\n     * @param normal - vertex normal\n     * @param endLeft - extrude to shift the left vertex along the line\n     * @param endRight - extrude to shift the left vertex along the line\n     * @param segment - the segment object to add the vertex to\n     * @param round - whether this is a round cap\n     */\n    addCurrentVertex(p: Point, normal: Point, endLeft: number, endRight: number, segment: Segment, round: boolean = false) {\n        // left and right extrude vectors, perpendicularly shifted by endLeft/endRight\n        const leftX = normal.x + normal.y * endLeft;\n        const leftY = normal.y - normal.x * endLeft;\n        const rightX = -normal.x + normal.y * endRight;\n        const rightY = -normal.y - normal.x * endRight;\n\n        this.addHalfVertex(p, leftX, leftY, round, false, endLeft, segment);\n        this.addHalfVertex(p, rightX, rightY, round, true, -endRight, segment);\n\n        // There is a maximum \"distance along the line\" that we can store in the buffers.\n        // When we get close to the distance, reset it to zero and add the vertex again with\n        // a distance of zero. The max distance is determined by the number of bits we allocate\n        // to `linesofar`.\n        if (this.distance > MAX_LINE_DISTANCE / 2 && this.totalDistance === 0) {\n            this.distance = 0;\n            this.updateScaledDistance();\n            this.addCurrentVertex(p, normal, endLeft, endRight, segment, round);\n        }\n    }\n\n    addHalfVertex({x, y}: Point, extrudeX: number, extrudeY: number, round: boolean, up: boolean, dir: number, segment: Segment) {\n        const totalDistance = this.lineClips ? this.scaledDistance * (MAX_LINE_DISTANCE - 1) : this.scaledDistance;\n        // scale down so that we can store longer distances while sacrificing precision.\n        const linesofarScaled = totalDistance * LINE_DISTANCE_SCALE;\n\n        this.layoutVertexArray.emplaceBack(\n            // a_pos_normal\n            // Encode round/up the least significant bits\n            (x << 1) + (round ? 1 : 0),\n            (y << 1) + (up ? 1 : 0),\n            // a_data\n            // add 128 to store a byte in an unsigned byte\n            Math.round(EXTRUDE_SCALE * extrudeX) + 128,\n            Math.round(EXTRUDE_SCALE * extrudeY) + 128,\n            // Encode the -1/0/1 direction value into the first two bits of .z of a_data.\n            // Combine it with the lower 6 bits of `linesofarScaled` (shifted by 2 bits to make\n            // room for the direction value). The upper 8 bits of `linesofarScaled` are placed in\n            // the `w` component.\n            ((dir === 0 ? 0 : (dir < 0 ? -1 : 1)) + 1) | ((linesofarScaled & 0x3F) << 2),\n            linesofarScaled >> 6);\n\n        // Constructs a second vertex buffer with higher precision line progress\n        if (this.lineClips) {\n            const progressRealigned = this.scaledDistance - this.lineClips.start;\n            const endClipRealigned = this.lineClips.end - this.lineClips.start;\n            const uvX = progressRealigned / endClipRealigned;\n            this.layoutVertexArray2.emplaceBack(uvX, this.lineClipsArray.length);\n        }\n\n        const e = segment.vertexLength++;\n        if (this.e1 >= 0 && this.e2 >= 0) {\n            this.indexArray.emplaceBack(this.e1, e, this.e2);\n            segment.primitiveLength++;\n        }\n        if (up) {\n            this.e2 = e;\n        } else {\n            this.e1 = e;\n        }\n    }\n\n    updateScaledDistance() {\n        // Knowing the ratio of the full linestring covered by this tiled feature, as well\n        // as the total distance (in tile units) of this tiled feature, and the distance\n        // (in tile units) of the current vertex, we can determine the relative distance\n        // of this vertex along the full linestring feature and scale it to [0, 2^15)\n        this.scaledDistance = this.lineClips ?\n            this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance :\n            this.distance;\n    }\n\n    updateDistance(prev: Point, next: Point) {\n        this.distance += prev.dist(next);\n        this.updateScaledDistance();\n    }\n\n    private hasLineDasharray(layers: Array<LineStyleLayer>): boolean {\n        for (const layer of layers) {\n            const dasharrayProperty = layer.paint.get('line-dasharray');\n            if (dasharrayProperty && !dasharrayProperty.isConstant()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private addLineDashDependencies(layers: Array<LineStyleLayer>, bucketFeature: BucketFeature, zoom: number, options: PopulateParameters) {\n        for (const layer of layers) {\n            const dasharrayProperty = layer.paint.get('line-dasharray');\n\n            if (!dasharrayProperty || dasharrayProperty.value.kind === 'constant') {\n                continue;\n            }\n\n            const round = layer.layout.get('line-cap') === 'round';\n\n            const min = {\n                dasharray: dasharrayProperty.value.evaluate({zoom: zoom - 1}, bucketFeature, {}),\n                round\n            };\n            const mid = {\n                dasharray: dasharrayProperty.value.evaluate({zoom}, bucketFeature, {}),\n                round\n            };\n            const max = {\n                dasharray: dasharrayProperty.value.evaluate({zoom: zoom + 1}, bucketFeature, {}),\n                round\n            };\n\n            const minKey = `${min.dasharray.join(',')},${min.round}`;\n            const midKey = `${mid.dasharray.join(',')},${mid.round}`;\n            const maxKey = `${max.dasharray.join(',')},${max.round}`;\n\n            options.dashDependencies[minKey] = min;\n            options.dashDependencies[midKey] = mid;\n            options.dashDependencies[maxKey] = max;\n\n            bucketFeature.dashes[layer.id] = {min: minKey, mid: midKey, max: maxKey};\n        }\n    }\n}\n\nregister('LineBucket', LineBucket, {omit: ['layers', 'patternFeatures']});\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LineLayoutProps = {\n    \"line-cap\": DataConstantProperty<\"butt\" | \"round\" | \"square\">,\n    \"line-join\": DataDrivenProperty<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": DataConstantProperty<number>,\n    \"line-round-limit\": DataConstantProperty<number>,\n    \"line-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type LineLayoutPropsPossiblyEvaluated = {\n    \"line-cap\": \"butt\" | \"round\" | \"square\",\n    \"line-join\": PossiblyEvaluatedPropertyValue<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": number,\n    \"line-round-limit\": number,\n    \"line-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<LineLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"line-cap\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-cap\"] as any as StylePropertySpecification),\n    \"line-join\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-join\"] as any as StylePropertySpecification),\n    \"line-miter-limit\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-miter-limit\"] as any as StylePropertySpecification),\n    \"line-round-limit\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-round-limit\"] as any as StylePropertySpecification),\n    \"line-sort-key\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type LinePaintProps = {\n    \"line-opacity\": DataDrivenProperty<number>,\n    \"line-color\": DataDrivenProperty<Color>,\n    \"line-translate\": DataConstantProperty<[number, number]>,\n    \"line-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"line-width\": DataDrivenProperty<number>,\n    \"line-gap-width\": DataDrivenProperty<number>,\n    \"line-offset\": DataDrivenProperty<number>,\n    \"line-blur\": DataDrivenProperty<number>,\n    \"line-dasharray\": CrossFadedDataDrivenProperty<Array<number>>,\n    \"line-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n    \"line-gradient\": ColorRampProperty,\n};\n\nexport type LinePaintPropsPossiblyEvaluated = {\n    \"line-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"line-translate\": [number, number],\n    \"line-translate-anchor\": \"map\" | \"viewport\",\n    \"line-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-gap-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-offset\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-dasharray\": PossiblyEvaluatedPropertyValue<CrossFaded<Array<number>>>,\n    \"line-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n    \"line-gradient\": ColorRampProperty,\n};\n\nlet paint: Properties<LinePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"line-opacity\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-opacity\"] as any as StylePropertySpecification),\n    \"line-color\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-color\"] as any as StylePropertySpecification),\n    \"line-translate\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate\"] as any as StylePropertySpecification),\n    \"line-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate-anchor\"] as any as StylePropertySpecification),\n    \"line-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-width\"] as any as StylePropertySpecification),\n    \"line-gap-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-gap-width\"] as any as StylePropertySpecification),\n    \"line-offset\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-offset\"] as any as StylePropertySpecification),\n    \"line-blur\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-blur\"] as any as StylePropertySpecification),\n    \"line-dasharray\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_line\"][\"line-dasharray\"] as any as StylePropertySpecification),\n    \"line-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_line\"][\"line-pattern\"] as any as StylePropertySpecification),\n    \"line-gradient\": new ColorRampProperty(styleSpec[\"paint_line\"][\"line-gradient\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });","import {type QueryIntersectsFeatureParams, StyleLayer} from '../style_layer';\nimport {LineBucket} from '../../data/bucket/line_bucket';\nimport {polygonIntersectsBufferedMultiLine} from '../../util/intersection_tests';\nimport {getMaximumPaintValue, translateDistance, translate, offsetLine} from '../query_utils';\nimport properties, {type LineLayoutPropsPossiblyEvaluated, type LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties.g';\nimport {extend} from '../../util/util';\nimport {EvaluationParameters} from '../evaluation_parameters';\nimport {type Transitionable, type Transitioning, type Layout, type PossiblyEvaluated, DataDrivenProperty} from '../properties';\n\nimport {isZoomExpression, Step} from '@maplibre/maplibre-gl-style-spec';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g';\n\nexport class LineFloorwidthProperty extends DataDrivenProperty<number> {\n    useIntegerZoom: true;\n\n    possiblyEvaluate(value, parameters) {\n        parameters = new EvaluationParameters(Math.floor(parameters.zoom), {\n            now: parameters.now,\n            fadeDuration: parameters.fadeDuration,\n            zoomHistory: parameters.zoomHistory,\n            transition: parameters.transition\n        });\n        return super.possiblyEvaluate(value, parameters);\n    }\n\n    evaluate(value, globals, feature, featureState) {\n        globals = extend({}, globals, {zoom: Math.floor(globals.zoom)});\n        return super.evaluate(value, globals, feature, featureState);\n    }\n}\n\nlet lineFloorwidthProperty: LineFloorwidthProperty;\n\nexport const isLineStyleLayer = (layer: StyleLayer): layer is LineStyleLayer => layer.type === 'line';\n\nexport class LineStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<LineLayoutProps>;\n    layout: PossiblyEvaluated<LineLayoutProps, LineLayoutPropsPossiblyEvaluated>;\n\n    gradientVersion: number;\n    stepInterpolant: boolean;\n\n    _transitionablePaint: Transitionable<LinePaintProps>;\n    _transitioningPaint: Transitioning<LinePaintProps>;\n    paint: PossiblyEvaluated<LinePaintProps, LinePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n        this.gradientVersion = 0;\n        if (!lineFloorwidthProperty) {\n            lineFloorwidthProperty =\n                new LineFloorwidthProperty(properties.paint.properties['line-width'].specification);\n            lineFloorwidthProperty.useIntegerZoom = true;\n        }\n    }\n\n    _handleSpecialPaintPropertyUpdate(name: string) {\n        if (name === 'line-gradient') {\n            const expression = this.gradientExpression();\n            if (isZoomExpression(expression)) {\n                this.stepInterpolant = expression._styleExpression.expression instanceof Step;\n            } else {\n                this.stepInterpolant = false;\n            }\n            this.gradientVersion = (this.gradientVersion + 1) % Number.MAX_SAFE_INTEGER;\n        }\n    }\n\n    gradientExpression() {\n        return this._transitionablePaint._values['line-gradient'].value.expression;\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n        (this.paint._values as any)['line-floorwidth'] =\n            lineFloorwidthProperty.possiblyEvaluate(this._transitioningPaint._values['line-width'].value, parameters);\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new LineBucket(parameters);\n    }\n\n    queryRadius(bucket: Bucket): number {\n        const lineBucket: LineBucket = (bucket as any);\n        const width = getLineWidth(\n            getMaximumPaintValue('line-width', this, lineBucket),\n            getMaximumPaintValue('line-gap-width', this, lineBucket));\n        const offset = getMaximumPaintValue('line-offset', this, lineBucket);\n        return width / 2 + Math.abs(offset) + translateDistance(this.paint.get('line-translate'));\n    }\n\n    queryIntersectsFeature({\n        queryGeometry,\n        feature,\n        featureState,\n        geometry,\n        transform,\n        pixelsToTileUnits}: QueryIntersectsFeatureParams\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('line-translate'),\n            this.paint.get('line-translate-anchor'),\n            -transform.bearingInRadians, pixelsToTileUnits);\n        const halfWidth = pixelsToTileUnits / 2 * getLineWidth(\n            this.paint.get('line-width').evaluate(feature, featureState),\n            this.paint.get('line-gap-width').evaluate(feature, featureState));\n        const lineOffset = this.paint.get('line-offset').evaluate(feature, featureState);\n        if (lineOffset) {\n            geometry = offsetLine(geometry, lineOffset * pixelsToTileUnits);\n        }\n\n        return polygonIntersectsBufferedMultiLine(translatedPolygon, geometry, halfWidth);\n    }\n\n    isTileClipped() {\n        return true;\n    }\n}\n\nfunction getLineWidth(lineWidth, lineGapWidth) {\n    if (lineGapWidth > 0) {\n        return lineGapWidth + 2 * lineWidth;\n    } else {\n        return lineWidth;\n    }\n}\n","import {createLayout} from '../../util/struct_array';\n\nexport const symbolLayoutAttributes = createLayout([\n    {name: 'a_pos_offset',  components: 4, type: 'Int16'},\n    {name: 'a_data',        components: 4, type: 'Uint16'},\n    {name: 'a_pixeloffset',        components: 4, type: 'Int16'}\n], 4);\n\nexport const dynamicLayoutAttributes = createLayout([\n    {name: 'a_projected_pos', components: 3, type: 'Float32'}\n], 4);\n\nexport const placementOpacityAttributes = createLayout([\n    {name: 'a_fade_opacity', components: 1, type: 'Uint32'}\n], 4);\n\nexport const collisionVertexAttributes = createLayout([\n    {name: 'a_placed', components: 2, type: 'Uint8'},\n    {name: 'a_shift', components: 2, type: 'Float32'},\n    {name: 'a_box_real', components: 2, type: 'Int16'},\n]);\n\nexport const collisionBox = createLayout([\n    // the box is centered around the anchor point\n    {type: 'Int16', name: 'anchorPointX'},\n    {type: 'Int16', name: 'anchorPointY'},\n\n    // distances to the edges from the anchor\n    {type: 'Int16', name: 'x1'},\n    {type: 'Int16', name: 'y1'},\n    {type: 'Int16', name: 'x2'},\n    {type: 'Int16', name: 'y2'},\n\n    // the index of the feature in the original vectortile\n    {type: 'Uint32', name: 'featureIndex'},\n    // the source layer the feature appears in\n    {type: 'Uint16', name: 'sourceLayerIndex'},\n    // the bucket the feature appears in\n    {type: 'Uint16', name: 'bucketIndex'},\n]);\n\nexport const collisionBoxLayout = createLayout([ // used to render collision boxes for debugging purposes\n    {name: 'a_pos',        components: 2, type: 'Int16'},\n    {name: 'a_anchor_pos', components: 2, type: 'Int16'},\n    {name: 'a_extrude',    components: 2, type: 'Int16'}\n], 4);\n\nexport const collisionCircleLayout = createLayout([ // used to render collision circles for debugging purposes\n    {name: 'a_pos',        components: 2, type: 'Float32'},\n    {name: 'a_radius',     components: 1, type: 'Float32'},\n    {name: 'a_flags',      components: 2, type: 'Int16'}\n], 4);\n\nexport const quadTriangle = createLayout([\n    {name: 'triangle', components: 3, type: 'Uint16'},\n]);\n\nexport const placement = createLayout([\n    {type: 'Int16', name: 'anchorX'},\n    {type: 'Int16', name: 'anchorY'},\n    {type: 'Uint16', name: 'glyphStartIndex'},\n    {type: 'Uint16', name: 'numGlyphs'},\n    {type: 'Uint32', name: 'vertexStartIndex'},\n    {type: 'Uint32', name: 'lineStartIndex'},\n    {type: 'Uint32', name: 'lineLength'},\n    {type: 'Uint16', name: 'segment'},\n    {type: 'Uint16', name: 'lowerSize'},\n    {type: 'Uint16', name: 'upperSize'},\n    {type: 'Float32', name: 'lineOffsetX'},\n    {type: 'Float32', name: 'lineOffsetY'},\n    {type: 'Uint8', name: 'writingMode'},\n    {type: 'Uint8', name: 'placedOrientation'},\n    {type: 'Uint8', name: 'hidden'},\n    {type: 'Uint32', name: 'crossTileID'},\n    {type: 'Int16', name: 'associatedIconIndex'}\n]);\n\nexport const symbolInstance = createLayout([\n    {type: 'Int16', name: 'anchorX'},\n    {type: 'Int16', name: 'anchorY'},\n    {type: 'Int16', name: 'rightJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'centerJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'leftJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'verticalPlacedTextSymbolIndex'},\n    {type: 'Int16', name: 'placedIconSymbolIndex'},\n    {type: 'Int16', name: 'verticalPlacedIconSymbolIndex'},\n    {type: 'Uint16', name: 'key'},\n    {type: 'Uint16', name: 'textBoxStartIndex'},\n    {type: 'Uint16', name: 'textBoxEndIndex'},\n    {type: 'Uint16', name: 'verticalTextBoxStartIndex'},\n    {type: 'Uint16', name: 'verticalTextBoxEndIndex'},\n    {type: 'Uint16', name: 'iconBoxStartIndex'},\n    {type: 'Uint16', name: 'iconBoxEndIndex'},\n    {type: 'Uint16', name: 'verticalIconBoxStartIndex'},\n    {type: 'Uint16', name: 'verticalIconBoxEndIndex'},\n    {type: 'Uint16', name: 'featureIndex'},\n    {type: 'Uint16', name: 'numHorizontalGlyphVertices'},\n    {type: 'Uint16', name: 'numVerticalGlyphVertices'},\n    {type: 'Uint16', name: 'numIconVertices'},\n    {type: 'Uint16', name: 'numVerticalIconVertices'},\n    {type: 'Uint16', name: 'useRuntimeCollisionCircles'},\n    {type: 'Uint32', name: 'crossTileID'},\n    {type: 'Float32', name: 'textBoxScale'},\n    {type: 'Float32', name: 'collisionCircleDiameter'},\n    {type: 'Uint16', name: 'textAnchorOffsetStartIndex'},\n    {type: 'Uint16', name: 'textAnchorOffsetEndIndex'}\n]);\n\nexport const glyphOffset = createLayout([\n    {type: 'Float32', name: 'offsetX'}\n]);\n\nexport const lineVertex = createLayout([\n    {type: 'Int16', name: 'x'},\n    {type: 'Int16', name: 'y'},\n    {type: 'Int16', name: 'tileUnitDistanceFromAnchor'}\n]);\n\nexport const textAnchorOffset = createLayout([\n    {type: 'Uint16', name: 'textAnchor'},\n    {type: 'Float32', components: 2, name: 'textOffset'}\n]);\n","import {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\n\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport {type Formatted} from '@maplibre/maplibre-gl-style-spec';\n\nfunction transformTextInternal(text: string, layer: SymbolStyleLayer, feature: Feature) {\n    const transform = layer.layout.get('text-transform').evaluate(feature, {});\n    if (transform === 'uppercase') {\n        text = text.toLocaleUpperCase();\n    } else if (transform === 'lowercase') {\n        text = text.toLocaleLowerCase();\n    }\n\n    if (rtlWorkerPlugin.applyArabicShaping) {\n        text = rtlWorkerPlugin.applyArabicShaping(text);\n    }\n\n    return text;\n}\n\nexport function transformText(text: Formatted, layer: SymbolStyleLayer, feature: Feature): Formatted {\n    text.sections.forEach(section => {\n        section.text = transformTextInternal(section.text, layer, feature);\n    });\n    return text;\n}\n","// ONE_EM constant used to go between \"em\" units used in style spec and \"points\" used internally for layout\n\nexport default 24;\n","import {charHasRotatedVerticalOrientation} from './script_detection';\n\nexport const verticalizedCharacterMap = {\n    '!': '︕',\n    '#': '＃',\n    '$': '＄',\n    '%': '％',\n    '&': '＆',\n    '(': '︵',\n    ')': '︶',\n    '*': '＊',\n    '+': '＋',\n    ',': '︐',\n    '-': '︲',\n    '.': '・',\n    '/': '／',\n    ':': '︓',\n    ';': '︔',\n    '<': '︿',\n    '=': '＝',\n    '>': '﹀',\n    '?': '︖',\n    '@': '＠',\n    '[': '﹇',\n    '\\\\': '＼',\n    ']': '﹈',\n    '^': '＾',\n    '_': '︳',\n    '`': '｀',\n    '{': '︷',\n    '|': '―',\n    '}': '︸',\n    '~': '～',\n    '¢': '￠',\n    '£': '￡',\n    '¥': '￥',\n    '¦': '￤',\n    '¬': '￢',\n    '¯': '￣',\n    '–': '︲',\n    '—': '︱',\n    '‘': '﹃',\n    '’': '﹄',\n    '“': '﹁',\n    '”': '﹂',\n    '…': '︙',\n    '⋯': '︙',\n    '‧': '・',\n    '₩': '￦',\n    '、': '︑',\n    '。': '︒',\n    '〈': '︿',\n    '〉': '﹀',\n    '《': '︽',\n    '》': '︾',\n    '「': '﹁',\n    '」': '﹂',\n    '『': '﹃',\n    '』': '﹄',\n    '【': '︻',\n    '】': '︼',\n    '〔': '︹',\n    '〕': '︺',\n    '〖': '︗',\n    '〗': '︘',\n    '！': '︕',\n    '（': '︵',\n    '）': '︶',\n    '，': '︐',\n    '－': '︲',\n    '．': '・',\n    '：': '︓',\n    '；': '︔',\n    '＜': '︿',\n    '＞': '﹀',\n    '？': '︖',\n    '［': '﹇',\n    '］': '﹈',\n    '＿': '︳',\n    '｛': '︷',\n    '｜': '―',\n    '｝': '︸',\n    '｟': '︵',\n    '｠': '︶',\n    '｡': '︒',\n    '｢': '﹁',\n    '｣': '﹂'\n};\n\nexport function verticalizePunctuation(input: string) {\n    let output = '';\n\n    let prevChar = {premature: true, value: undefined};\n    const chars = input[Symbol.iterator]();\n    let char = chars.next();\n    const nextChars = input[Symbol.iterator]();\n    nextChars.next();\n    let nextChar = nextChars.next();\n\n    while (!char.done) {\n        const canReplacePunctuation = (\n            (nextChar.done || !charHasRotatedVerticalOrientation(nextChar.value.codePointAt(0)) || verticalizedCharacterMap[nextChar.value]) &&\n            (prevChar.premature || !charHasRotatedVerticalOrientation(prevChar.value.codePointAt(0)) || verticalizedCharacterMap[prevChar.value])\n        );\n\n        if (canReplacePunctuation && verticalizedCharacterMap[char.value]) {\n            output += verticalizedCharacterMap[char.value];\n        } else {\n            output += char.value;\n        }\n\n        prevChar = {value: char.value, premature: false};\n        char = chars.next();\n        nextChar = nextChars.next();\n    }\n\n    return output;\n}\n\n","import type {Formatted, FormattedSection, VerticalAlign} from '@maplibre/maplibre-gl-style-spec';\n\nimport ONE_EM from './one_em';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {StyleGlyph} from '../style/style_glyph';\nimport {verticalizePunctuation} from '../util/verticalize_punctuation';\nimport {charIsWhitespace} from '../util/script_detection';\nimport {codePointAllowsIdeographicBreaking} from '../util/unicode_properties.g';\nimport {warnOnce} from '../util/util';\n\nexport type TextSectionOptions = {\n    scale: number;\n    verticalAlign: VerticalAlign;\n    fontStack: string;\n};\n\nexport type ImageSectionOptions = {\n    scale: number;\n    verticalAlign: VerticalAlign;\n    imageName: string;\n};\n\nexport type SectionOptions = TextSectionOptions | ImageSectionOptions;\n\n// Max number of images in label is 6401 U+E000–U+F8FF that covers\n// Basic Multilingual Plane Unicode Private Use Area (PUA).\nconst PUAbegin = 0xE000;\nconst PUAend = 0xF8FF;\n\ntype Break = {\n    index: number;\n    x: number;\n    priorBreak: Break;\n    badness: number;\n};\n\n// using computed properties due to https://github.com/facebook/flow/issues/380\n/* eslint no-useless-computed-key: 0 */\n\nconst breakable: {\n    [_: number]: boolean;\n} = {\n    [0x0a]: true, // newline\n    [0x20]: true, // space\n    [0x26]: true, // ampersand\n    [0x29]: true, // right parenthesis\n    [0x2b]: true, // plus sign\n    [0x2d]: true, // hyphen-minus\n    [0x2f]: true, // solidus\n    [0xad]: true, // soft hyphen\n    [0xb7]: true, // middle dot\n    [0x200b]: true, // zero-width space\n    [0x2010]: true, // hyphen\n    [0x2013]: true, // en dash\n    [0x2027]: true  // interpunct\n    // Many other characters may be reasonable breakpoints\n    // Consider \"neutral orientation\" characters in codePointHasNeutralVerticalOrientation in unicode_properties\n    // See https://github.com/mapbox/mapbox-gl-js/issues/3658\n};\n\n// Allow breaks depending on the following character\nconst breakableBefore: {\n    [_: number]: boolean;\n} = {\n    [0x28]: true, // left parenthesis\n};\n\nfunction getGlyphAdvance(\n    codePoint: number,\n    section: SectionOptions,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    spacing: number,\n    layoutTextSize: number\n): number {\n    if ('fontStack' in section) {\n        const positions = glyphMap[section.fontStack];\n        const glyph = positions && positions[codePoint];\n        if (!glyph) return 0;\n        return glyph.metrics.advance * section.scale + spacing;\n    } else {\n        const imagePosition = imagePositions[section.imageName];\n        if (!imagePosition) return 0;\n        return imagePosition.displaySize[0] * section.scale * ONE_EM / layoutTextSize + spacing;\n    }\n}\n\nfunction calculateBadness(lineWidth: number,\n    targetWidth: number,\n    penalty: number,\n    isLastBreak: boolean) {\n    const raggedness = Math.pow(lineWidth - targetWidth, 2);\n    if (isLastBreak) {\n        // Favor finals lines shorter than average over longer than average\n        if (lineWidth < targetWidth) {\n            return raggedness / 2;\n        } else {\n            return raggedness * 2;\n        }\n    }\n\n    return raggedness + Math.abs(penalty) * penalty;\n}\n\nfunction calculatePenalty(codePoint: number, nextCodePoint: number, penalizableIdeographicBreak: boolean) {\n    let penalty = 0;\n    // Force break on newline\n    if (codePoint === 0x0a) {\n        penalty -= 10000;\n    }\n    // Penalize breaks between characters that allow ideographic breaking because\n    // they are less preferable than breaks at spaces (or zero width spaces).\n    if (penalizableIdeographicBreak) {\n        penalty += 150;\n    }\n\n    // Penalize open parenthesis at end of line\n    if (codePoint === 0x28 || codePoint === 0xff08) {\n        penalty += 50;\n    }\n\n    // Penalize close parenthesis at beginning of line\n    if (nextCodePoint === 0x29 || nextCodePoint === 0xff09) {\n        penalty += 50;\n    }\n    return penalty;\n}\n\nfunction evaluateBreak(\n    breakIndex: number,\n    breakX: number,\n    targetWidth: number,\n    potentialBreaks: Array<Break>,\n    penalty: number,\n    isLastBreak: boolean\n): Break {\n    // We could skip evaluating breaks where the line length (breakX - priorBreak.x) > maxWidth\n    //  ...but in fact we allow lines longer than maxWidth (if there's no break points)\n    //  ...and when targetWidth and maxWidth are close, strictly enforcing maxWidth can give\n    //     more lopsided results.\n\n    let bestPriorBreak: Break = null;\n    let bestBreakBadness = calculateBadness(breakX, targetWidth, penalty, isLastBreak);\n\n    for (const potentialBreak of potentialBreaks) {\n        const lineWidth = breakX - potentialBreak.x;\n        const breakBadness =\n            calculateBadness(lineWidth, targetWidth, penalty, isLastBreak) + potentialBreak.badness;\n        if (breakBadness <= bestBreakBadness) {\n            bestPriorBreak = potentialBreak;\n            bestBreakBadness = breakBadness;\n        }\n    }\n\n    return {\n        index: breakIndex,\n        x: breakX,\n        priorBreak: bestPriorBreak,\n        badness: bestBreakBadness\n    };\n}\n\nfunction leastBadBreaks(lastLineBreak?: Break | null): Array<number> {\n    if (!lastLineBreak) {\n        return [];\n    }\n    return leastBadBreaks(lastLineBreak.priorBreak).concat(lastLineBreak.index);\n}\n\nexport class TaggedString {\n    text: string;\n    sections: Array<SectionOptions>;\n    /** Maps each character in `text` to its corresponding entry in `sections`. */\n    sectionIndex: Array<number>;\n    imageSectionID: number | null;\n\n    constructor(text: string = '', sections: Array<SectionOptions> = [], sectionIndex: Array<number> = []) {\n        this.text = text;\n        this.sections = sections;\n        this.sectionIndex = sectionIndex;\n        this.imageSectionID = null;\n    }\n\n    static fromFeature(text: Formatted, defaultFontStack: string) {\n        const result = new TaggedString();\n        for (let i = 0; i < text.sections.length; i++) {\n            const section = text.sections[i];\n            if (!section.image) {\n                result.addTextSection(section, defaultFontStack);\n            } else {\n                result.addImageSection(section);\n            }\n        }\n        return result;\n    }\n\n    length(): number {\n        return [...this.text].length;\n    }\n\n    getSection(index: number): SectionOptions {\n        return this.sections[this.sectionIndex[index]];\n    }\n\n    getSectionIndex(index: number): number {\n        return this.sectionIndex[index];\n    }\n\n    verticalizePunctuation() {\n        this.text = verticalizePunctuation(this.text);\n    }\n\n    /**\n     * Returns whether the text contains zero-width spaces.\n     *\n     * Some tilesets such as Mapbox Streets insert ZWSPs as hints for line\n     * breaking in CJK text.\n     */\n    hasZeroWidthSpaces(): boolean {\n        return this.text.includes('\\u200b');\n    }\n\n    trim() {\n        const leadingWhitespace = this.text.match(/^\\s*/);\n        const leadingLength = leadingWhitespace ? leadingWhitespace[0].length : 0;\n        // Require a preceding non-space character to avoid overlapping leading and trailing matches.\n        const trailingWhitespace = this.text.match(/\\S\\s*$/);\n        const trailingLength = trailingWhitespace ? trailingWhitespace[0].length - 1 : 0;\n        this.text = this.text.substring(leadingLength, this.text.length - trailingLength);\n        this.sectionIndex = this.sectionIndex.slice(leadingLength, this.sectionIndex.length - trailingLength);\n    }\n\n    substring(start: number, end: number): TaggedString {\n        const text = [...this.text].slice(start, end).join('');\n        const sectionIndex = this.sectionIndex.slice(start, end);\n        return new TaggedString(text, this.sections, sectionIndex);\n    }\n\n    /**\n     * Converts a UTF-16 character index to a UTF-16 code unit (JavaScript character index).\n     */\n    toCodeUnitIndex(unicodeIndex: number): number {\n        return [...this.text].slice(0, unicodeIndex).join('').length;\n    }\n\n    toString(): string {\n        return this.text;\n    }\n\n    getMaxScale() {\n        return this.sectionIndex.reduce((max, index) => Math.max(max, this.sections[index].scale), 0);\n    }\n\n    getMaxImageSize(imagePositions: {[_: string]: ImagePosition}): {\n        maxImageWidth: number;\n        maxImageHeight: number;\n    } {\n        let maxImageWidth = 0;\n        let maxImageHeight = 0;\n        for (let i = 0; i < this.length(); i++) {\n            const section = this.getSection(i);\n            if ('imageName' in section) {\n                const imagePosition = imagePositions[section.imageName];\n                if (!imagePosition) continue;\n                const size = imagePosition.displaySize;\n                maxImageWidth = Math.max(maxImageWidth, size[0]);\n                maxImageHeight = Math.max(maxImageHeight, size[1]);\n            }\n        }\n        return {maxImageWidth, maxImageHeight};\n    }\n\n    addTextSection(section: FormattedSection, defaultFontStack: string) {\n        this.text += section.text;\n        this.sections.push({\n            scale: section.scale || 1,\n            verticalAlign: section.verticalAlign || 'bottom',\n            fontStack: section.fontStack || defaultFontStack,\n        } as TextSectionOptions);\n        const index = this.sections.length - 1;\n        this.sectionIndex.push(...[...section.text].map(() => index));\n    }\n\n    addImageSection(section: FormattedSection) {\n        const imageName = section.image ? section.image.name : '';\n        if (imageName.length === 0) {\n            warnOnce('Can\\'t add FormattedSection with an empty image.');\n            return;\n        }\n\n        const nextImageSectionCharCode = this.getNextImageSectionCharCode();\n        if (!nextImageSectionCharCode) {\n            warnOnce(`Reached maximum number of images ${PUAend - PUAbegin + 2}`);\n            return;\n        }\n\n        this.text += String.fromCharCode(nextImageSectionCharCode);\n        this.sections.push({\n            scale: 1,\n            verticalAlign: section.verticalAlign || 'bottom',\n            imageName,\n        } as ImageSectionOptions);\n        this.sectionIndex.push(this.sections.length - 1);\n    }\n\n    getNextImageSectionCharCode(): number | null {\n        if (!this.imageSectionID) {\n            this.imageSectionID = PUAbegin;\n            return this.imageSectionID;\n        }\n\n        if (this.imageSectionID >= PUAend) return null;\n        return ++this.imageSectionID;\n    }\n\n    determineLineBreaks(\n        spacing: number,\n        maxWidth: number,\n        glyphMap: {\n            [_: string]: {\n                [_: number]: StyleGlyph;\n            };\n        },\n        imagePositions: {[_: string]: ImagePosition},\n        layoutTextSize: number\n    ): Array<number> {\n        const potentialLineBreaks = [];\n        const targetWidth = this.determineAverageLineWidth(spacing, maxWidth, glyphMap, imagePositions, layoutTextSize);\n\n        const hasZeroWidthSpaces = this.hasZeroWidthSpaces();\n\n        let currentX = 0;\n\n        let i = 0;\n        const chars = this.text[Symbol.iterator]();\n        let char = chars.next();\n        const nextChars = this.text[Symbol.iterator]();\n        nextChars.next();\n        let nextChar = nextChars.next();\n        const nextNextChars = this.text[Symbol.iterator]();\n        nextNextChars.next();\n        nextNextChars.next();\n        let nextNextChar = nextNextChars.next();\n\n        while (!char.done) {\n            const section = this.getSection(i);\n            const codePoint = char.value.codePointAt(0);\n            if (!charIsWhitespace(codePoint)) currentX += getGlyphAdvance(codePoint, section, glyphMap, imagePositions, spacing, layoutTextSize);\n\n            // Ideographic characters, spaces, and word-breaking punctuation that often appear without\n            // surrounding spaces.\n            if (!nextChar.done) {\n                const ideographicBreak = codePointAllowsIdeographicBreaking(codePoint);\n                const nextCodePoint = nextChar.value.codePointAt(0);\n                if (breakable[codePoint] || ideographicBreak || 'imageName' in section || (!nextNextChar.done && breakableBefore[nextCodePoint])) {\n\n                    potentialLineBreaks.push(\n                        evaluateBreak(\n                            i + 1,\n                            currentX,\n                            targetWidth,\n                            potentialLineBreaks,\n                            calculatePenalty(codePoint, nextCodePoint, ideographicBreak && hasZeroWidthSpaces),\n                            false));\n                }\n            }\n            i++;\n            char = chars.next();\n            nextChar = nextChars.next();\n            nextNextChar = nextNextChars.next();\n        }\n\n        return leastBadBreaks(\n            evaluateBreak(\n                this.length(),\n                currentX,\n                targetWidth,\n                potentialLineBreaks,\n                0,\n                true));\n    }\n\n    determineAverageLineWidth(\n        spacing: number,\n        maxWidth: number,\n        glyphMap: {\n            [_: string]: {\n                [_: number]: StyleGlyph;\n            };\n        },\n        imagePositions: {[_: string]: ImagePosition},\n        layoutTextSize: number) {\n        let totalWidth = 0;\n\n        let index = 0;\n        for (const char of this.text) {\n            const section = this.getSection(index);\n            totalWidth += getGlyphAdvance(char.codePointAt(0), section, glyphMap, imagePositions, spacing, layoutTextSize);\n            index++;\n        }\n\n        const lineCount = Math.max(1, Math.ceil(totalWidth / maxWidth));\n        return totalWidth / lineCount;\n    }\n}\n","\nconst SHIFT_LEFT_32 = (1 << 16) * (1 << 16);\nconst SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;\n\n// Threshold chosen based on both benchmarking and knowledge about browser string\n// data structures (which currently switch structure types at 12 bytes or more)\nconst TEXT_DECODER_MIN_LENGTH = 12;\nconst utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8');\n\nconst PBF_VARINT  = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nconst PBF_FIXED64 = 1; // 64-bit: double, fixed64, sfixed64\nconst PBF_BYTES   = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nconst PBF_FIXED32 = 5; // 32-bit: float, fixed32, sfixed32\n\nexport default class Pbf {\n    /**\n     * @param {Uint8Array | ArrayBuffer} [buf]\n     */\n    constructor(buf = new Uint8Array(16)) {\n        this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);\n        this.dataView = new DataView(this.buf.buffer);\n        this.pos = 0;\n        this.type = 0;\n        this.length = this.buf.length;\n    }\n\n    // === READING =================================================================\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     * @param {number} [end]\n     */\n    readFields(readField, result, end = this.length) {\n        while (this.pos < end) {\n            const val = this.readVarint(),\n                tag = val >> 3,\n                startPos = this.pos;\n\n            this.type = val & 0x7;\n            readField(tag, result, this);\n\n            if (this.pos === startPos) this.skip(val);\n        }\n        return result;\n    }\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     */\n    readMessage(readField, result) {\n        return this.readFields(readField, result, this.readVarint() + this.pos);\n    }\n\n    readFixed32() {\n        const val = this.dataView.getUint32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readSFixed32() {\n        const val = this.dataView.getInt32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)\n\n    readFixed64() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getUint32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readSFixed64() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getInt32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readFloat() {\n        const val = this.dataView.getFloat32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readDouble() {\n        const val = this.dataView.getFloat64(this.pos, true);\n        this.pos += 8;\n        return val;\n    }\n\n    /**\n     * @param {boolean} [isSigned]\n     */\n    readVarint(isSigned) {\n        const buf = this.buf;\n        let val, b;\n\n        b = buf[this.pos++]; val  =  b & 0x7f;        if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 7;  if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;\n        b = buf[this.pos];   val |= (b & 0x0f) << 28;\n\n        return readVarintRemainder(val, isSigned, this);\n    }\n\n    readVarint64() { // for compatibility with v2.0.1\n        return this.readVarint(true);\n    }\n\n    readSVarint() {\n        const num = this.readVarint();\n        return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n    }\n\n    readBoolean() {\n        return Boolean(this.readVarint());\n    }\n\n    readString() {\n        const end = this.readVarint() + this.pos;\n        const pos = this.pos;\n        this.pos = end;\n\n        if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {\n            // longer strings are fast with the built-in browser TextDecoder API\n            return utf8TextDecoder.decode(this.buf.subarray(pos, end));\n        }\n        // short strings are fast with our custom implementation\n        return readUtf8(this.buf, pos, end);\n    }\n\n    readBytes() {\n        const end = this.readVarint() + this.pos,\n            buffer = this.buf.subarray(this.pos, end);\n        this.pos = end;\n        return buffer;\n    }\n\n    // verbose for performance reasons; doesn't affect gzipped size\n\n    /**\n     * @param {number[]} [arr]\n     * @param {boolean} [isSigned]\n     */\n    readPackedVarint(arr = [], isSigned) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readVarint(isSigned));\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSVarint(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSVarint());\n        return arr;\n    }\n    /** @param {boolean[]} [arr] */\n    readPackedBoolean(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readBoolean());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFloat(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFloat());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedDouble(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readDouble());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed64());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed64());\n        return arr;\n    }\n    readPackedEnd() {\n        return this.type === PBF_BYTES ? this.readVarint() + this.pos : this.pos + 1;\n    }\n\n    /** @param {number} val */\n    skip(val) {\n        const type = val & 0x7;\n        if (type === PBF_VARINT) while (this.buf[this.pos++] > 0x7f) {}\n        else if (type === PBF_BYTES) this.pos = this.readVarint() + this.pos;\n        else if (type === PBF_FIXED32) this.pos += 4;\n        else if (type === PBF_FIXED64) this.pos += 8;\n        else throw new Error(`Unimplemented type: ${type}`);\n    }\n\n    // === WRITING =================================================================\n\n    /**\n     * @param {number} tag\n     * @param {number} type\n     */\n    writeTag(tag, type) {\n        this.writeVarint((tag << 3) | type);\n    }\n\n    /** @param {number} min */\n    realloc(min) {\n        let length = this.length || 16;\n\n        while (length < this.pos + min) length *= 2;\n\n        if (length !== this.length) {\n            const buf = new Uint8Array(length);\n            buf.set(this.buf);\n            this.buf = buf;\n            this.dataView = new DataView(buf.buffer);\n            this.length = length;\n        }\n    }\n\n    finish() {\n        this.length = this.pos;\n        this.pos = 0;\n        return this.buf.subarray(0, this.length);\n    }\n\n    /** @param {number} val */\n    writeFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeSFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeSFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeVarint(val) {\n        val = +val || 0;\n\n        if (val > 0xfffffff || val < 0) {\n            writeBigVarint(val, this);\n            return;\n        }\n\n        this.realloc(4);\n\n        this.buf[this.pos++] =           val & 0x7f  | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] =   (val >>> 7) & 0x7f;\n    }\n\n    /** @param {number} val */\n    writeSVarint(val) {\n        this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n    }\n\n    /** @param {boolean} val */\n    writeBoolean(val) {\n        this.writeVarint(+val);\n    }\n\n    /** @param {string} str */\n    writeString(str) {\n        str = String(str);\n        this.realloc(str.length * 4);\n\n        this.pos++; // reserve 1 byte for short string length\n\n        const startPos = this.pos;\n        // write the string directly to the buffer and see how much was written\n        this.pos = writeUtf8(this.buf, str, this.pos);\n        const len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    }\n\n    /** @param {number} val */\n    writeFloat(val) {\n        this.realloc(4);\n        this.dataView.setFloat32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeDouble(val) {\n        this.realloc(8);\n        this.dataView.setFloat64(this.pos, val, true);\n        this.pos += 8;\n    }\n\n    /** @param {Uint8Array} buffer */\n    writeBytes(buffer) {\n        const len = buffer.length;\n        this.writeVarint(len);\n        this.realloc(len);\n        for (let i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n    }\n\n    /**\n     * @template T\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeRawMessage(fn, obj) {\n        this.pos++; // reserve 1 byte for short message length\n\n        // write the message directly to the buffer and see how much was written\n        const startPos = this.pos;\n        fn(obj, this);\n        const len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    }\n\n    /**\n     * @template T\n     * @param {number} tag\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeMessage(tag, fn, obj) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeRawMessage(fn, obj);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean[]} arr\n     */\n    writePackedBoolean(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFloat(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFloat, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedDouble(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedDouble, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {Uint8Array} buffer\n     */\n    writeBytesField(tag, buffer) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeBytes(buffer);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeSFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeSFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeSVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {string} str\n     */\n    writeStringField(tag, str) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeString(str);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFloatField(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFloat(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeDoubleField(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeDouble(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean} val\n     */\n    writeBooleanField(tag, val) {\n        this.writeVarintField(tag, +val);\n    }\n};\n\n/**\n * @param {number} l\n * @param {boolean | undefined} s\n * @param {Pbf} p\n */\nfunction readVarintRemainder(l, s, p) {\n    const buf = p.buf;\n    let h, b;\n\n    b = buf[p.pos++]; h  = (b & 0x70) >> 4;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 3;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);\n\n    throw new Error('Expected varint not more than 10 bytes');\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {boolean} [isSigned]\n */\nfunction toNum(low, high, isSigned) {\n    return isSigned ? high * 0x100000000 + (low >>> 0) : ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\n/**\n * @param {number} val\n * @param {Pbf} pbf\n */\nfunction writeBigVarint(val, pbf) {\n    let low, high;\n\n    if (val >= 0) {\n        low  = (val % 0x100000000) | 0;\n        high = (val / 0x100000000) | 0;\n    } else {\n        low  = ~(-val % 0x100000000);\n        high = ~(-val / 0x100000000);\n\n        if (low ^ 0xffffffff) {\n            low = (low + 1) | 0;\n        } else {\n            low = 0;\n            high = (high + 1) | 0;\n        }\n    }\n\n    if (val >= 0x10000000000000000 || val < -0x10000000000000000) {\n        throw new Error('Given varint doesn\\'t fit into 10 bytes');\n    }\n\n    pbf.realloc(10);\n\n    writeBigVarintLow(low, high, pbf);\n    writeBigVarintHigh(high, pbf);\n}\n\n/**\n * @param {number} high\n * @param {number} low\n * @param {Pbf} pbf\n */\nfunction writeBigVarintLow(low, high, pbf) {\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos]   = low & 0x7f;\n}\n\n/**\n * @param {number} high\n * @param {Pbf} pbf\n */\nfunction writeBigVarintHigh(high, pbf) {\n    const lsb = (high & 0x07) << 4;\n\n    pbf.buf[pbf.pos++] |= lsb         | ((high >>>= 3) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f;\n}\n\n/**\n * @param {number} startPos\n * @param {number} len\n * @param {Pbf} pbf\n */\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n    const extraLen =\n        len <= 0x3fff ? 1 :\n        len <= 0x1fffff ? 2 :\n        len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));\n\n    // if 1 byte isn't enough for encoding message length, shift the data to the right\n    pbf.realloc(extraLen);\n    for (let i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFloat(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedDouble(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]);\n}\n/**\n * @param {boolean[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedBoolean(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]);\n}\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\n/**\n * @param {Uint8Array} buf\n * @param {number} pos\n * @param {number} end\n */\nfunction readUtf8(buf, pos, end) {\n    let str = '';\n    let i = pos;\n\n    while (i < end) {\n        const b0 = buf[i];\n        let c = null; // codepoint\n        let bytesPerSequence =\n            b0 > 0xEF ? 4 :\n            b0 > 0xDF ? 3 :\n            b0 > 0xBF ? 2 : 1;\n\n        if (i + bytesPerSequence > end) break;\n\n        let b1, b2, b3;\n\n        if (bytesPerSequence === 1) {\n            if (b0 < 0x80) {\n                c = b0;\n            }\n        } else if (bytesPerSequence === 2) {\n            b1 = buf[i + 1];\n            if ((b1 & 0xC0) === 0x80) {\n                c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);\n                if (c <= 0x7F) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 3) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);\n                if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 4) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            b3 = buf[i + 3];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);\n                if (c <= 0xFFFF || c >= 0x110000) {\n                    c = null;\n                }\n            }\n        }\n\n        if (c === null) {\n            c = 0xFFFD;\n            bytesPerSequence = 1;\n\n        } else if (c > 0xFFFF) {\n            c -= 0x10000;\n            str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);\n            c = 0xDC00 | c & 0x3FF;\n        }\n\n        str += String.fromCharCode(c);\n        i += bytesPerSequence;\n    }\n\n    return str;\n}\n\n/**\n * @param {Uint8Array} buf\n * @param {string} str\n * @param {number} pos\n */\nfunction writeUtf8(buf, str, pos) {\n    for (let i = 0, c, lead; i < str.length; i++) {\n        c = str.charCodeAt(i); // code point\n\n        if (c > 0xD7FF && c < 0xE000) {\n            if (lead) {\n                if (c < 0xDC00) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                    lead = c;\n                    continue;\n                } else {\n                    c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;\n                    lead = null;\n                }\n            } else {\n                if (c > 0xDBFF || (i + 1 === str.length)) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                } else {\n                    lead = c;\n                }\n                continue;\n            }\n        } else if (lead) {\n            buf[pos++] = 0xEF;\n            buf[pos++] = 0xBF;\n            buf[pos++] = 0xBD;\n            lead = null;\n        }\n\n        if (c < 0x80) {\n            buf[pos++] = c;\n        } else {\n            if (c < 0x800) {\n                buf[pos++] = c >> 0x6 | 0xC0;\n            } else {\n                if (c < 0x10000) {\n                    buf[pos++] = c >> 0xC | 0xE0;\n                } else {\n                    buf[pos++] = c >> 0x12 | 0xF0;\n                    buf[pos++] = c >> 0xC & 0x3F | 0x80;\n                }\n                buf[pos++] = c >> 0x6 & 0x3F | 0x80;\n            }\n            buf[pos++] = c & 0x3F | 0x80;\n        }\n    }\n    return pos;\n}\n","/**\n * @typedef {Object} PotpackBox\n * @property {number} w Box width.\n * @property {number} h Box height.\n * @property {number} [x] X coordinate in the resulting container.\n * @property {number} [y] Y coordinate in the resulting container.\n */\n\n/**\n * @typedef {Object} PotpackStats\n * @property {number} w Width of the resulting container.\n * @property {number} h Height of the resulting container.\n * @property {number} fill The space utilization value (0 to 1). Higher is better.\n */\n\n/**\n * Packs 2D rectangles into a near-square container.\n *\n * Mutates the {@link boxes} array: it's sorted (by height/width),\n * and box objects are augmented with `x`, `y` coordinates.\n *\n * @param {PotpackBox[]} boxes\n * @return {PotpackStats}\n */\nexport default function potpack(boxes) {\n\n    // calculate total box area and maximum box width\n    let area = 0;\n    let maxWidth = 0;\n\n    for (const box of boxes) {\n        area += box.w * box.h;\n        maxWidth = Math.max(maxWidth, box.w);\n    }\n\n    // sort the boxes for insertion by height, descending\n    boxes.sort((a, b) => b.h - a.h);\n\n    // aim for a squarish resulting container,\n    // slightly adjusted for sub-100% space utilization\n    const startWidth = Math.max(Math.ceil(Math.sqrt(area / 0.95)), maxWidth);\n\n    // start with a single empty space, unbounded at the bottom\n    const spaces = [{x: 0, y: 0, w: startWidth, h: Infinity}];\n\n    let width = 0;\n    let height = 0;\n\n    for (const box of boxes) {\n        // look through spaces backwards so that we check smaller spaces first\n        for (let i = spaces.length - 1; i >= 0; i--) {\n            const space = spaces[i];\n\n            // look for empty spaces that can accommodate the current box\n            if (box.w > space.w || box.h > space.h) continue;\n\n            // found the space; add the box to its top-left corner\n            // |-------|-------|\n            // |  box  |       |\n            // |_______|       |\n            // |         space |\n            // |_______________|\n            box.x = space.x;\n            box.y = space.y;\n\n            height = Math.max(height, box.y + box.h);\n            width = Math.max(width, box.x + box.w);\n\n            if (box.w === space.w && box.h === space.h) {\n                // space matches the box exactly; remove it\n                const last = spaces.pop();\n                if (last && i < spaces.length) spaces[i] = last;\n\n            } else if (box.h === space.h) {\n                // space matches the box height; update it accordingly\n                // |-------|---------------|\n                // |  box  | updated space |\n                // |_______|_______________|\n                space.x += box.w;\n                space.w -= box.w;\n\n            } else if (box.w === space.w) {\n                // space matches the box width; update it accordingly\n                // |---------------|\n                // |      box      |\n                // |_______________|\n                // | updated space |\n                // |_______________|\n                space.y += box.h;\n                space.h -= box.h;\n\n            } else {\n                // otherwise the box splits the space into two spaces\n                // |-------|-----------|\n                // |  box  | new space |\n                // |_______|___________|\n                // | updated space     |\n                // |___________________|\n                spaces.push({\n                    x: space.x + box.w,\n                    y: space.y,\n                    w: space.w - box.w,\n                    h: box.h\n                });\n                space.y += box.h;\n                space.h -= box.h;\n            }\n            break;\n        }\n    }\n\n    return {\n        w: width, // container width\n        h: height, // container height\n        fill: (area / (width * height)) || 0 // space utilization\n    };\n}\n","/* eslint-disable key-spacing */\nimport {RGBAImage} from '../util/image';\nimport {register} from '../util/web_worker_transfer';\nimport potpack from 'potpack';\n\nimport type {StyleImage} from '../style/style_image';\nimport {type TextFit} from '../style/style_image';\nimport type {ImageManager} from './image_manager';\nimport type {Texture} from './texture';\nimport type {Rect} from './glyph_atlas';\nimport type {GetImagesResponse} from '../util/actor_messages';\n\nconst IMAGE_PADDING: number = 1;\nexport {IMAGE_PADDING};\n\nexport class ImagePosition {\n    paddedRect: Rect;\n    pixelRatio: number;\n    version: number;\n    stretchY: Array<[number, number]>;\n    stretchX: Array<[number, number]>;\n    content: [number, number, number, number];\n    textFitWidth: TextFit;\n    textFitHeight: TextFit;\n\n    constructor(paddedRect: Rect, {\n        pixelRatio,\n        version,\n        stretchX,\n        stretchY,\n        content,\n        textFitWidth,\n        textFitHeight\n    }: StyleImage) {\n        this.paddedRect = paddedRect;\n        this.pixelRatio = pixelRatio;\n        this.stretchX = stretchX;\n        this.stretchY = stretchY;\n        this.content = content;\n        this.version = version;\n        this.textFitWidth = textFitWidth;\n        this.textFitHeight = textFitHeight;\n    }\n\n    get tl(): [number, number] {\n        return [\n            this.paddedRect.x + IMAGE_PADDING,\n            this.paddedRect.y + IMAGE_PADDING\n        ];\n    }\n\n    get br(): [number, number] {\n        return [\n            this.paddedRect.x + this.paddedRect.w - IMAGE_PADDING,\n            this.paddedRect.y + this.paddedRect.h - IMAGE_PADDING\n        ];\n    }\n\n    get tlbr(): Array<number> {\n        return this.tl.concat(this.br);\n    }\n\n    get displaySize(): [number, number] {\n        return [\n            (this.paddedRect.w - IMAGE_PADDING * 2) / this.pixelRatio,\n            (this.paddedRect.h - IMAGE_PADDING * 2) / this.pixelRatio\n        ];\n    }\n}\n\n/**\n * A class holding all the images\n */\nexport class ImageAtlas {\n    image: RGBAImage;\n    iconPositions: {[_: string]: ImagePosition};\n    patternPositions: {[_: string]: ImagePosition};\n    haveRenderCallbacks: Array<string>;\n    uploaded: boolean;\n\n    constructor(icons: GetImagesResponse, patterns: GetImagesResponse) {\n        const iconPositions = {}, patternPositions = {};\n        this.haveRenderCallbacks = [];\n\n        const bins = [];\n\n        this.addImages(icons, iconPositions, bins);\n        this.addImages(patterns, patternPositions, bins);\n\n        const {w, h} = potpack(bins);\n        const image = new RGBAImage({width: w || 1, height: h || 1});\n\n        for (const id in icons) {\n            const src = icons[id];\n            const bin = iconPositions[id].paddedRect;\n            RGBAImage.copy(src.data, image, {x: 0, y: 0}, {x: bin.x + IMAGE_PADDING, y: bin.y + IMAGE_PADDING}, src.data);\n        }\n\n        for (const id in patterns) {\n            const src = patterns[id];\n            const bin = patternPositions[id].paddedRect;\n            const x = bin.x + IMAGE_PADDING,\n                y = bin.y + IMAGE_PADDING,\n                w = src.data.width,\n                h = src.data.height;\n\n            RGBAImage.copy(src.data, image, {x: 0, y: 0}, {x, y}, src.data);\n            // Add 1 pixel wrapped padding on each side of the image.\n            RGBAImage.copy(src.data, image, {x: 0, y: h - 1}, {x, y: y - 1}, {width: w, height: 1}); // T\n            RGBAImage.copy(src.data, image, {x: 0, y:     0}, {x, y: y + h}, {width: w, height: 1}); // B\n            RGBAImage.copy(src.data, image, {x: w - 1, y: 0}, {x: x - 1, y}, {width: 1, height: h}); // L\n            RGBAImage.copy(src.data, image, {x: 0,     y: 0}, {x: x + w, y}, {width: 1, height: h}); // R\n        }\n\n        this.image = image;\n        this.iconPositions = iconPositions;\n        this.patternPositions = patternPositions;\n    }\n\n    addImages(images: {[_: string]: StyleImage}, positions: {[_: string]: ImagePosition}, bins: Array<Rect>) {\n        for (const id in images) {\n            const src = images[id];\n            const bin = {\n                x: 0,\n                y: 0,\n                w: src.data.width + 2 * IMAGE_PADDING,\n                h: src.data.height + 2 * IMAGE_PADDING,\n            };\n            bins.push(bin);\n            positions[id] = new ImagePosition(bin, src);\n\n            if (src.hasRenderCallback) {\n                this.haveRenderCallbacks.push(id);\n            }\n        }\n    }\n\n    patchUpdatedImages(imageManager: ImageManager, texture: Texture) {\n        imageManager.dispatchRenderCallbacks(this.haveRenderCallbacks);\n        for (const name in imageManager.updatedImages) {\n            this.patchUpdatedImage(this.iconPositions[name], imageManager.getImage(name), texture);\n            this.patchUpdatedImage(this.patternPositions[name], imageManager.getImage(name), texture);\n        }\n    }\n\n    patchUpdatedImage(position: ImagePosition, image: StyleImage, texture: Texture) {\n        if (!position || !image) return;\n\n        if (position.version === image.version) return;\n\n        position.version = image.version;\n        const [x, y] = position.tl;\n        texture.update(image.data, undefined, {x, y});\n    }\n\n}\n\nregister('ImagePosition', ImagePosition);\nregister('ImageAtlas', ImageAtlas);\n","import {\n    codePointHasUprightVerticalOrientation\n} from '../util/unicode_properties.g';\nimport {\n    charIsWhitespace,\n    charInComplexShapingScript\n} from '../util/script_detection';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\nimport ONE_EM from './one_em';\n\nimport {TaggedString, type TextSectionOptions, type ImageSectionOptions} from './tagged_string';\nimport type {StyleGlyph, GlyphMetrics} from '../style/style_glyph';\nimport {GLYPH_PBF_BORDER} from '../style/parse_glyph_pbf';\nimport {TextFit} from '../style/style_image';\nimport type {ImagePosition} from '../render/image_atlas';\nimport {IMAGE_PADDING} from '../render/image_atlas';\nimport type {Rect, GlyphPosition} from '../render/glyph_atlas';\nimport type {Formatted, VerticalAlign} from '@maplibre/maplibre-gl-style-spec';\n\nenum WritingMode {\n    none = 0,\n    horizontal = 1,\n    vertical = 2,\n    horizontalOnly = 3\n}\n\nconst SHAPING_DEFAULT_OFFSET = -17;\nexport {shapeText, shapeIcon, applyTextFit, fitIconToText, getAnchorAlignment, WritingMode, SHAPING_DEFAULT_OFFSET};\n\n// The position of a glyph relative to the text's anchor point.\nexport type PositionedGlyph = {\n    glyph: number;\n    imageName: string | null;\n    x: number;\n    y: number;\n    vertical: boolean;\n    scale: number;\n    fontStack: string;\n    sectionIndex: number;\n    metrics: GlyphMetrics;\n    rect: Rect | null;\n};\n\nexport type PositionedLine = {\n    positionedGlyphs: Array<PositionedGlyph>;\n    lineOffset: number;\n};\n\n// A collection of positioned glyphs and some metadata\nexport type Shaping = {\n    positionedLines: Array<PositionedLine>;\n    top: number;\n    bottom: number;\n    left: number;\n    right: number;\n    writingMode: WritingMode.horizontal | WritingMode.vertical;\n    text: string;\n    iconsInText: boolean;\n    verticalizable: boolean;\n};\n\ntype ShapingSectionAttributes = {\n    rect: Rect | null;\n    metrics: GlyphMetrics;\n    baselineOffset: number;\n    imageOffset?: number;\n};\n\ntype LineShapingSize = {\n    verticalLineContentWidth: number;\n    horizontalLineContentHeight: number;\n};\n\nfunction isEmpty(positionedLines: Array<PositionedLine>) {\n    for (const line of positionedLines) {\n        if (line.positionedGlyphs.length !== 0) {\n            return false;\n        }\n    }\n    return true;\n}\n\nexport type SymbolAnchor = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\nexport type TextJustify = 'left' | 'center' | 'right';\n\nfunction breakLines(input: TaggedString, lineBreakPoints: Array<number>): Array<TaggedString> {\n    const lines = [];\n    let start = 0;\n    for (const lineBreak of lineBreakPoints) {\n        lines.push(input.substring(start, lineBreak));\n        start = lineBreak;\n    }\n\n    if (start < input.length()) {\n        lines.push(input.substring(start, input.length()));\n    }\n    return lines;\n}\n\nfunction shapeText(\n    text: Formatted,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    defaultFontStack: string,\n    maxWidth: number,\n    lineHeight: number,\n    textAnchor: SymbolAnchor,\n    textJustify: TextJustify,\n    spacing: number,\n    translate: [number, number],\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    allowVerticalPlacement: boolean,\n    layoutTextSize: number,\n    layoutTextSizeThisZoom: number\n): Shaping | false {\n    const logicalInput = TaggedString.fromFeature(text, defaultFontStack);\n\n    if (writingMode === WritingMode.vertical) {\n        logicalInput.verticalizePunctuation();\n    }\n\n    let lines: Array<TaggedString>;\n\n    let lineBreaks = logicalInput.determineLineBreaks(spacing, maxWidth, glyphMap, imagePositions, layoutTextSize);\n    const {processBidirectionalText, processStyledBidirectionalText} = rtlWorkerPlugin;\n    if (processBidirectionalText && logicalInput.sections.length === 1) {\n        // Bidi doesn't have to be style-aware\n        lines = [];\n        // ICU operates on code units.\n        lineBreaks = lineBreaks.map(index => logicalInput.toCodeUnitIndex(index));\n        const untaggedLines =\n            processBidirectionalText(logicalInput.toString(), lineBreaks);\n        for (const line of untaggedLines) {\n            const sectionIndex = [...line].map(() => 0);\n            lines.push(new TaggedString(line, logicalInput.sections, sectionIndex));\n        }\n    } else if (processStyledBidirectionalText) {\n        // Need version of mapbox-gl-rtl-text with style support for combining RTL text\n        // with formatting\n        lines = [];\n        // ICU operates on code units.\n        lineBreaks = lineBreaks.map(index => logicalInput.toCodeUnitIndex(index));\n\n        // Convert character-based section index to be based on code units.\n        let i = 0;\n        const sectionIndex = [];\n        for (const char of logicalInput.text) {\n            sectionIndex.push(...Array(char.length).fill(logicalInput.sectionIndex[i]));\n            i++;\n        }\n\n        const processedLines =\n            processStyledBidirectionalText(logicalInput.text, sectionIndex, lineBreaks);\n        for (const line of processedLines) {\n            const sectionIndex = [];\n            let elapsedChars = '';\n            for (const char of line[0]) {\n                sectionIndex.push(line[1][elapsedChars.length]);\n                elapsedChars += char;\n            }\n            lines.push(new TaggedString(line[0], logicalInput.sections, sectionIndex));\n        }\n    } else {\n        lines = breakLines(logicalInput, lineBreaks);\n    }\n\n    const positionedLines = [];\n    const shaping = {\n        positionedLines,\n        text: logicalInput.toString(),\n        top: translate[1],\n        bottom: translate[1],\n        left: translate[0],\n        right: translate[0],\n        writingMode,\n        iconsInText: false,\n        verticalizable: false\n    };\n\n    shapeLines(shaping, glyphMap, glyphPositions, imagePositions, lines, lineHeight, textAnchor, textJustify, writingMode, spacing, allowVerticalPlacement, layoutTextSizeThisZoom);\n    if (isEmpty(positionedLines)) return false;\n\n    return shaping;\n}\n\nfunction getAnchorAlignment(anchor: SymbolAnchor) {\n    let horizontalAlign = 0.5, verticalAlign = 0.5;\n\n    switch (anchor) {\n        case 'right':\n        case 'top-right':\n        case 'bottom-right':\n            horizontalAlign = 1;\n            break;\n        case 'left':\n        case 'top-left':\n        case 'bottom-left':\n            horizontalAlign = 0;\n            break;\n    }\n\n    switch (anchor) {\n        case 'bottom':\n        case 'bottom-right':\n        case 'bottom-left':\n            verticalAlign = 1;\n            break;\n        case 'top':\n        case 'top-right':\n        case 'top-left':\n            verticalAlign = 0;\n            break;\n    }\n\n    return {horizontalAlign, verticalAlign};\n}\n\nfunction calculateLineContentSize(\n    imagePositions: {[_: string]: ImagePosition},\n    line: TaggedString,\n    layoutTextSizeFactor: number\n): LineShapingSize {\n    const maxGlyphSize = line.getMaxScale() * ONE_EM;\n    const {maxImageWidth, maxImageHeight} = line.getMaxImageSize(imagePositions);\n\n    const horizontalLineContentHeight = Math.max(maxGlyphSize, maxImageHeight * layoutTextSizeFactor);\n    const verticalLineContentWidth = Math.max(maxGlyphSize, maxImageWidth * layoutTextSizeFactor);\n\n    return {verticalLineContentWidth, horizontalLineContentHeight};\n}\n\nfunction getVerticalAlignFactor(\n    verticalAlign: VerticalAlign\n) {\n    switch (verticalAlign) {\n        case 'top':\n            return 0;\n        case 'center':\n            return 0.5;\n        default:\n            return 1;\n    }\n}\n\nfunction getRectAndMetrics(\n    glyphPosition: GlyphPosition,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    section: TextSectionOptions,\n    codePoint: number\n): GlyphPosition | null {\n    if (glyphPosition && glyphPosition.rect) {\n        return glyphPosition;\n    }\n\n    const glyphs = glyphMap[section.fontStack];\n    const glyph = glyphs && glyphs[codePoint];\n    if (!glyph) return null;\n\n    const metrics = glyph.metrics;\n    return {rect: null, metrics};\n}\n\nfunction isLineVertical(\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    allowVerticalPlacement: boolean,\n    codePoint: number\n): boolean {\n    return !(writingMode === WritingMode.horizontal ||\n        // Don't verticalize glyphs that have no upright orientation if vertical placement is disabled.\n        (!allowVerticalPlacement && !codePointHasUprightVerticalOrientation(codePoint)) ||\n        // If vertical placement is enabled, don't verticalize glyphs that\n        // are from complex text layout script, or whitespaces.\n        (allowVerticalPlacement && (charIsWhitespace(codePoint) || charInComplexShapingScript(codePoint))));\n}\n\nfunction shapeLines(shaping: Shaping,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    lines: Array<TaggedString>,\n    lineHeight: number,\n    textAnchor: SymbolAnchor,\n    textJustify: TextJustify,\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    spacing: number,\n    allowVerticalPlacement: boolean,\n    layoutTextSizeThisZoom: number) {\n\n    let x = 0;\n    let y = 0;\n\n    let maxLineLength = 0;\n    let maxLineHeight = 0;\n\n    const justify =\n        textJustify === 'right' ? 1 :\n            textJustify === 'left' ? 0 : 0.5;\n    const layoutTextSizeFactor = ONE_EM / layoutTextSizeThisZoom;\n\n    let lineIndex = 0;\n    for (const line of lines) {\n        line.trim();\n\n        const lineMaxScale = line.getMaxScale();\n        const positionedLine = {positionedGlyphs: [], lineOffset: 0};\n        shaping.positionedLines[lineIndex] = positionedLine;\n        const positionedGlyphs = positionedLine.positionedGlyphs;\n        let imageOffset = 0.0;\n\n        if (!line.length()) {\n            y += lineHeight; // Still need a line feed after empty line\n            ++lineIndex;\n            continue;\n        }\n\n        const lineShapingSize = calculateLineContentSize(imagePositions, line, layoutTextSizeFactor);\n\n        let i = 0;\n        for (const char of line.text) {\n            const section = line.getSection(i);\n            const codePoint = char.codePointAt(0);\n            const vertical = isLineVertical(writingMode, allowVerticalPlacement, codePoint);\n            const positionedGlyph: PositionedGlyph = {\n                glyph: codePoint,\n                imageName: null,\n                x,\n                y: y + SHAPING_DEFAULT_OFFSET,\n                vertical,\n                scale: 1,\n                fontStack: '',\n                sectionIndex: line.getSectionIndex(i),\n                metrics: null,\n                rect: null\n            };\n\n            let sectionAttributes: ShapingSectionAttributes;\n            if ('fontStack' in section) {\n                sectionAttributes = shapeTextSection(section, codePoint, vertical, lineShapingSize, glyphMap, glyphPositions);\n                if (!sectionAttributes) continue;\n                positionedGlyph.fontStack = section.fontStack;\n            } else {\n                shaping.iconsInText = true;\n                // If needed, allow to set scale factor for an image using\n                // alias \"image-scale\" that could be alias for \"font-scale\"\n                // when FormattedSection is an image section.\n                section.scale *= layoutTextSizeFactor;\n\n                sectionAttributes = shapeImageSection(section, vertical, lineMaxScale, lineShapingSize, imagePositions);\n                if (!sectionAttributes) continue;\n                imageOffset = Math.max(imageOffset, sectionAttributes.imageOffset);\n                positionedGlyph.imageName = section.imageName;\n            }\n\n            const {rect, metrics, baselineOffset} = sectionAttributes;\n            positionedGlyph.y += baselineOffset;\n            positionedGlyph.scale = section.scale;\n            positionedGlyph.metrics = metrics;\n            positionedGlyph.rect = rect;\n            positionedGlyphs.push(positionedGlyph);\n\n            if (!vertical) {\n                x += metrics.advance * section.scale + spacing;\n            } else {\n                shaping.verticalizable = true;\n                const verticalAdvance = 'imageName' in section ? metrics.advance : ONE_EM;\n                x += verticalAdvance * section.scale + spacing;\n            }\n\n            i++;\n        }\n\n        // Only justify if we placed at least one glyph\n        if (positionedGlyphs.length !== 0) {\n            const lineLength = x - spacing;\n            maxLineLength = Math.max(lineLength, maxLineLength);\n            justifyLine(positionedGlyphs, 0, positionedGlyphs.length - 1, justify);\n        }\n\n        x = 0;\n        const maxLineOffset = (lineMaxScale - 1) * ONE_EM;\n        positionedLine.lineOffset = Math.max(imageOffset, maxLineOffset);\n        const currentLineHeight = lineHeight * lineMaxScale + imageOffset;\n        y += currentLineHeight;\n        maxLineHeight = Math.max(currentLineHeight, maxLineHeight);\n        ++lineIndex;\n    }\n\n    // Calculate the bounding box and justify / align text block.\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(textAnchor);\n    align(shaping.positionedLines, justify, horizontalAlign, verticalAlign, maxLineLength, maxLineHeight, lineHeight, y, lines.length);\n\n    // Calculate the bounding box\n    // shaping.top & shaping.left already include text offset (text-radial-offset or text-offset)\n    shaping.top += -verticalAlign * y;\n    shaping.bottom = shaping.top + y;\n    shaping.left += -horizontalAlign * maxLineLength;\n    shaping.right = shaping.left + maxLineLength;\n}\n\nfunction shapeTextSection(\n    section: TextSectionOptions,\n    codePoint: number,\n    vertical: boolean,\n    lineShapingSize: LineShapingSize,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n): ShapingSectionAttributes | null {\n    const positions = glyphPositions[section.fontStack];\n    const glyphPosition = positions && positions[codePoint];\n\n    const rectAndMetrics = getRectAndMetrics(glyphPosition, glyphMap, section, codePoint);\n\n    if (rectAndMetrics === null) return null;\n\n    let baselineOffset: number;\n    if (vertical) {\n        baselineOffset = lineShapingSize.verticalLineContentWidth - section.scale * ONE_EM;\n    } else {\n        const verticalAlignFactor = getVerticalAlignFactor(section.verticalAlign);\n        baselineOffset = (lineShapingSize.horizontalLineContentHeight - section.scale * ONE_EM) * verticalAlignFactor;\n    }\n\n    return {\n        rect: rectAndMetrics.rect,\n        metrics: rectAndMetrics.metrics,\n        baselineOffset\n    };\n}\n\nfunction shapeImageSection(\n    section: ImageSectionOptions,\n    vertical: boolean,\n    lineMaxScale: number,\n    lineShapingSize: LineShapingSize,\n    imagePositions: {[_: string]: ImagePosition},\n): ShapingSectionAttributes | null {\n    const imagePosition = imagePositions[section.imageName];\n    if (!imagePosition) return null;\n    const rect = imagePosition.paddedRect;\n    const size = imagePosition.displaySize;\n\n    const metrics = {width: size[0],\n        height: size[1],\n        left: IMAGE_PADDING,\n        top: -GLYPH_PBF_BORDER,\n        advance: vertical ? size[1] : size[0]};\n\n    let baselineOffset: number;\n    if (vertical) {\n        baselineOffset = lineShapingSize.verticalLineContentWidth - size[1] * section.scale;\n    } else {\n        const verticalAlignFactor = getVerticalAlignFactor(section.verticalAlign);\n        baselineOffset = (lineShapingSize.horizontalLineContentHeight - size[1] * section.scale) * verticalAlignFactor;\n    }\n\n    // Difference between height of an image and one EM at max line scale.\n    // Pushes current line down if an image size is over 1 EM at max line scale.\n    const imageOffset = (vertical ? size[0] : size[1]) * section.scale - ONE_EM * lineMaxScale;\n    \n    return {rect, metrics, baselineOffset, imageOffset};\n}\n\n// justify right = 1, left = 0, center = 0.5\nfunction justifyLine(positionedGlyphs: Array<PositionedGlyph>,\n    start: number,\n    end: number,\n    justify: 1 | 0 | 0.5) {\n    if (justify === 0)\n        return;\n\n    const lastPositionedGlyph = positionedGlyphs[end];\n    const lastAdvance = lastPositionedGlyph.metrics.advance * lastPositionedGlyph.scale;\n    const lineIndent = (positionedGlyphs[end].x + lastAdvance) * justify;\n\n    for (let j = start; j <= end; j++) {\n        positionedGlyphs[j].x -= lineIndent;\n    }\n}\n\n/**\n * Aligns the lines based on horizontal and vertical alignment.\n */\nfunction align(positionedLines: Array<PositionedLine>,\n    justify: number,\n    horizontalAlign: number,\n    verticalAlign: number,\n    maxLineLength: number,\n    maxLineHeight: number,\n    lineHeight: number,\n    blockHeight: number,\n    lineCount: number) {\n    const shiftX = (justify - horizontalAlign) * maxLineLength;\n    let shiftY = 0;\n\n    if (maxLineHeight !== lineHeight) {\n        shiftY = -blockHeight * verticalAlign - SHAPING_DEFAULT_OFFSET;\n    } else {\n        shiftY = -verticalAlign * lineCount * lineHeight + 0.5 * lineHeight;\n    }\n\n    for (const line of positionedLines) {\n        for (const positionedGlyph of line.positionedGlyphs) {\n            positionedGlyph.x += shiftX;\n            positionedGlyph.y += shiftY;\n        }\n    }\n}\n\nexport type PositionedIcon = {\n    image: ImagePosition;\n    top: number;\n    bottom: number;\n    left: number;\n    right: number;\n    collisionPadding?: [number, number, number, number];\n};\n\nfunction shapeIcon(\n    image: ImagePosition,\n    iconOffset: [number, number],\n    iconAnchor: SymbolAnchor\n): PositionedIcon {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(iconAnchor);\n    const dx = iconOffset[0];\n    const dy = iconOffset[1];\n    const x1 = dx - image.displaySize[0] * horizontalAlign;\n    const x2 = x1 + image.displaySize[0];\n    const y1 = dy - image.displaySize[1] * verticalAlign;\n    const y2 = y1 + image.displaySize[1];\n    return {image, top: y1, bottom: y2, left: x1, right: x2};\n}\n\nexport interface Box {\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n}\n\n/**\n * Called after a PositionedIcon has already been run through fitIconToText,\n * but needs further adjustment to apply textFitWidth and textFitHeight.\n * @param shapedIcon - The icon that will be adjusted.\n * @returns Extents of the shapedIcon with text fit adjustments if necessary.\n */\nfunction applyTextFit(shapedIcon: PositionedIcon): Box {\n    // Assume shapedIcon.image is set or this wouldn't be called.\n    // Size of the icon after it was adjusted using stretchX and Y\n    let iconLeft = shapedIcon.left;\n    let iconTop = shapedIcon.top;\n    let iconWidth = shapedIcon.right - iconLeft;\n    let iconHeight = shapedIcon.bottom - iconTop;\n    // Size of the original content area\n    const contentWidth = shapedIcon.image.content[2] - shapedIcon.image.content[0];\n    const contentHeight = shapedIcon.image.content[3] - shapedIcon.image.content[1];\n    const textFitWidth = shapedIcon.image.textFitWidth ?? TextFit.stretchOrShrink;\n    const textFitHeight = shapedIcon.image.textFitHeight ?? TextFit.stretchOrShrink;\n    const contentAspectRatio = contentWidth / contentHeight;\n    // Scale to the proportional axis first note that height takes precedence if\n    // both axes are set to proportional.\n    if (textFitHeight === TextFit.proportional) {\n        if ((textFitWidth === TextFit.stretchOnly && iconWidth / iconHeight < contentAspectRatio) || textFitWidth === TextFit.proportional) {\n            // Push the width of the icon back out to match the content aspect ratio\n            const newIconWidth = Math.ceil(iconHeight * contentAspectRatio);\n            iconLeft *= newIconWidth / iconWidth;\n            iconWidth = newIconWidth;\n        }\n    } else if (textFitWidth === TextFit.proportional) {\n        if (textFitHeight === TextFit.stretchOnly && contentAspectRatio !== 0 && iconWidth / iconHeight > contentAspectRatio) {\n            // Push the height of the icon back out to match the content aspect ratio\n            const newIconHeight = Math.ceil(iconWidth / contentAspectRatio);\n            iconTop *= newIconHeight / iconHeight;\n            iconHeight = newIconHeight;\n        }\n    } else {\n        // If neither textFitHeight nor textFitWidth are proportional then\n        // there is no effect since the content rectangle should be precisely\n        // matched to the content\n    }\n    return {x1: iconLeft, y1: iconTop, x2: iconLeft + iconWidth, y2: iconTop + iconHeight};\n}\n\nfunction fitIconToText(\n    shapedIcon: PositionedIcon,\n    shapedText: Shaping,\n    textFit: string,\n    padding: [number, number, number, number],\n    iconOffset: [number, number],\n    fontScale: number\n): PositionedIcon {\n\n    const image = shapedIcon.image;\n\n    let collisionPadding;\n    if (image.content) {\n        const content = image.content;\n        const pixelRatio = image.pixelRatio || 1;\n        collisionPadding = [\n            content[0] / pixelRatio,\n            content[1] / pixelRatio,\n            image.displaySize[0] - content[2] / pixelRatio,\n            image.displaySize[1] - content[3] / pixelRatio\n        ];\n    }\n\n    // We don't respect the icon-anchor, because icon-text-fit is set. Instead,\n    // the icon will be centered on the text, then stretched in the given\n    // dimensions.\n\n    const textLeft = shapedText.left * fontScale;\n    const textRight = shapedText.right * fontScale;\n\n    let top, right, bottom, left;\n    if (textFit === 'width' || textFit === 'both') {\n        // Stretched horizontally to the text width\n        left = iconOffset[0] + textLeft - padding[3];\n        right = iconOffset[0] + textRight + padding[1];\n    } else {\n        // Centered on the text\n        left = iconOffset[0] + (textLeft + textRight - image.displaySize[0]) / 2;\n        right = left + image.displaySize[0];\n    }\n\n    const textTop = shapedText.top * fontScale;\n    const textBottom = shapedText.bottom * fontScale;\n    if (textFit === 'height' || textFit === 'both') {\n        // Stretched vertically to the text height\n        top = iconOffset[1] + textTop - padding[0];\n        bottom = iconOffset[1] + textBottom + padding[2];\n    } else {\n        // Centered on the text\n        top = iconOffset[1] + (textTop + textBottom - image.displaySize[1]) / 2;\n        bottom = top + image.displaySize[1];\n    }\n\n    return {image, top, right, bottom, left, collisionPadding};\n}\n","import {AlphaImage} from '../util/image';\n\nimport Protobuf from 'pbf';\nconst border = 3;\n\nimport type {StyleGlyph} from './style_glyph';\n\nfunction readFontstacks(tag: number, glyphs: Array<StyleGlyph>, pbf: Protobuf) {\n    if (tag === 1) {\n        pbf.readMessage(readFontstack, glyphs);\n    }\n}\n\nfunction readFontstack(tag: number, glyphs: Array<StyleGlyph>, pbf: Protobuf) {\n    if (tag === 3) {\n        const {id, bitmap, width, height, left, top, advance} = pbf.readMessage(readGlyph, {});\n        glyphs.push({\n            id,\n            bitmap: new AlphaImage({\n                width: width + 2 * border,\n                height: height + 2 * border\n            }, bitmap),\n            metrics: {width, height, left, top, advance}\n        });\n    }\n}\n\nfunction readGlyph(tag: number, glyph: any, pbf: Protobuf) {\n    if (tag === 1) glyph.id = pbf.readVarint();\n    else if (tag === 2) glyph.bitmap = pbf.readBytes();\n    else if (tag === 3) glyph.width = pbf.readVarint();\n    else if (tag === 4) glyph.height = pbf.readVarint();\n    else if (tag === 5) glyph.left = pbf.readSVarint();\n    else if (tag === 6) glyph.top = pbf.readSVarint();\n    else if (tag === 7) glyph.advance = pbf.readVarint();\n}\n\nexport function parseGlyphPbf(data: ArrayBuffer | Uint8Array): Array<StyleGlyph> {\n    return new Protobuf(data).readFields(readFontstacks, []);\n}\n\nexport const GLYPH_PBF_BORDER = border;\n","import {Interpolate, interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {clamp} from '../util/util';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\n\nimport type {PropertyValue, PossiblyEvaluatedPropertyValue} from '../style/properties';\nimport type {InterpolationType} from '@maplibre/maplibre-gl-style-spec';\n\nconst MAX_GLYPH_ICON_SIZE = 255;\nconst SIZE_PACK_FACTOR = 128;\nconst MAX_PACKED_SIZE = MAX_GLYPH_ICON_SIZE * SIZE_PACK_FACTOR;\n\nexport {getSizeData, evaluateSizeForFeature, evaluateSizeForZoom, SIZE_PACK_FACTOR, MAX_GLYPH_ICON_SIZE, MAX_PACKED_SIZE};\n\nexport type SizeData = {\n    kind: 'constant';\n    layoutSize: number;\n} | {\n    kind: 'source';\n} | {\n    kind: 'camera';\n    minZoom: number;\n    maxZoom: number;\n    minSize: number;\n    maxSize: number;\n    interpolationType: InterpolationType;\n} | {\n    kind: 'composite';\n    minZoom: number;\n    maxZoom: number;\n    interpolationType: InterpolationType;\n};\n\nexport type EvaluatedZoomSize = {uSizeT: number; uSize: number};\n\n// For {text,icon}-size, get the bucket-level data that will be needed by\n// the painter to set symbol-size-related uniforms\nfunction getSizeData(\n    tileZoom: number,\n    value: PropertyValue<number, PossiblyEvaluatedPropertyValue<number>>\n): SizeData {\n    const {expression} = value;\n\n    if (expression.kind === 'constant') {\n        const layoutSize = expression.evaluate(new EvaluationParameters(tileZoom + 1));\n        return {kind: 'constant', layoutSize};\n\n    } else if (expression.kind === 'source') {\n        return {kind: 'source'};\n\n    } else {\n        const {zoomStops, interpolationType} = expression;\n\n        // calculate covering zoom stops for zoom-dependent values\n        let lower = 0;\n        while (lower < zoomStops.length && zoomStops[lower] <= tileZoom) lower++;\n        lower = Math.max(0, lower - 1);\n        let upper = lower;\n        while (upper < zoomStops.length && zoomStops[upper] < tileZoom + 1) upper++;\n        upper = Math.min(zoomStops.length - 1, upper);\n\n        const minZoom = zoomStops[lower];\n        const maxZoom = zoomStops[upper];\n\n        // We'd like to be able to use CameraExpression or CompositeExpression in these\n        // return types rather than ExpressionSpecification, but the former are not\n        // transferrable across Web Worker boundaries.\n        if (expression.kind === 'composite') {\n            return {kind: 'composite', minZoom, maxZoom, interpolationType};\n        }\n\n        // for camera functions, also save off the function values\n        // evaluated at the covering zoom levels\n        const minSize = expression.evaluate(new EvaluationParameters(minZoom));\n        const maxSize = expression.evaluate(new EvaluationParameters(maxZoom));\n\n        return {kind: 'camera', minZoom, maxZoom, minSize, maxSize, interpolationType};\n    }\n}\n\nfunction evaluateSizeForFeature(sizeData: SizeData,\n    {\n        uSize,\n        uSizeT\n    }: {\n        uSize: number;\n        uSizeT: number;\n    },\n    {\n        lowerSize,\n        upperSize\n    }: {\n        lowerSize: number;\n        upperSize: number;\n    }): number {\n    if (sizeData.kind === 'source') {\n        return lowerSize / SIZE_PACK_FACTOR;\n    } else if (sizeData.kind === 'composite') {\n        return interpolates.number(lowerSize / SIZE_PACK_FACTOR, upperSize / SIZE_PACK_FACTOR, uSizeT);\n    }\n    return uSize;\n}\n\nfunction evaluateSizeForZoom(sizeData: SizeData, zoom: number): EvaluatedZoomSize {\n    let uSizeT = 0;\n    let uSize = 0;\n\n    if (sizeData.kind === 'constant') {\n        uSize = sizeData.layoutSize;\n\n    } else if (sizeData.kind !== 'source') {\n        const {interpolationType, minZoom, maxZoom} = sizeData;\n\n        // Even though we could get the exact value of the camera function\n        // at z = tr.zoom, we intentionally do not: instead, we interpolate\n        // between the camera function values at a pair of zoom stops covering\n        // [tileZoom, tileZoom + 1] in order to be consistent with this\n        // restriction on composite functions\n        const t = !interpolationType ? 0 : clamp(\n            Interpolate.interpolationFactor(interpolationType, zoom, minZoom, maxZoom), 0, 1);\n\n        if (sizeData.kind === 'camera') {\n            uSize = interpolates.number(sizeData.minSize, sizeData.maxSize, t);\n        } else {\n            uSizeT = t;\n        }\n    }\n\n    return {uSizeT, uSize};\n}\n","import {type SymbolLayoutPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\nimport type {SymbolLayoutProps} from './symbol_style_layer_properties.g';\nimport {type PossiblyEvaluated} from '../properties';\n\n/**\n * The overlap mode for properties like `icon-overlap`and `text-overlap`\n */\nexport type OverlapMode = 'never' | 'always' | 'cooperative';\n\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap', allowOverlapProp: 'icon-allow-overlap'): OverlapMode;\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'text-overlap', allowOverlapProp: 'text-allow-overlap'): OverlapMode;\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap' | 'text-overlap', allowOverlapProp: 'icon-allow-overlap' | 'text-allow-overlap'): OverlapMode {\n    let result: OverlapMode = 'never';\n    const overlap = layout.get(overlapProp);\n\n    if (overlap) {\n        // if -overlap is set, use it\n        result = overlap;\n    } else if (layout.get(allowOverlapProp)) {\n        // fall back to -allow-overlap, with false='never', true='always'\n        result = 'always';\n    }\n\n    return result;\n}\n","import {\n    symbolLayoutAttributes,\n    collisionVertexAttributes,\n    collisionBoxLayout,\n    dynamicLayoutAttributes,\n} from './symbol_attributes';\n\nimport {SymbolLayoutArray,\n    SymbolDynamicLayoutArray,\n    SymbolOpacityArray,\n    CollisionBoxLayoutArray,\n    CollisionVertexArray,\n    PlacedSymbolArray,\n    SymbolInstanceArray,\n    GlyphOffsetArray,\n    SymbolLineVertexArray,\n    TextAnchorOffsetArray\n} from '../array_types.g';\n\nimport Point from '@mapbox/point-geometry';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray, LineIndexArray} from '../index_array_type';\nimport {transformText} from '../../symbol/transform_text';\nimport {mergeLines} from '../../symbol/merge_lines';\nimport {allowsVerticalWritingMode, stringContainsRTLText} from '../../util/script_detection';\nimport {WritingMode} from '../../symbol/shaping';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {VectorTileFeature} from '@mapbox/vector-tile';\nimport {verticalizedCharacterMap} from '../../util/verticalize_punctuation';\nimport {type Anchor} from '../../symbol/anchor';\nimport {getSizeData, MAX_PACKED_SIZE} from '../../symbol/symbol_size';\n\nimport {register} from '../../util/web_worker_transfer';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\nimport {Formatted, ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport {rtlWorkerPlugin} from '../../source/rtl_text_plugin_worker';\nimport {getOverlapMode} from '../../style/style_layer/overlap_mode';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {CollisionBoxArray, CollisionBox, SymbolInstance} from '../array_types.g';\nimport type {StructArray, StructArrayMember, ViewType} from '../../util/struct_array';\nimport type {SymbolStyleLayer} from '../../style/style_layer/symbol_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type {SymbolQuad} from '../../symbol/quads';\nimport type {SizeData} from '../../symbol/symbol_size';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport type SingleCollisionBox = {\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n    anchorPointX: number;\n    anchorPointY: number;\n};\n\nexport type CollisionArrays = {\n    textBox?: SingleCollisionBox;\n    verticalTextBox?: SingleCollisionBox;\n    iconBox?: SingleCollisionBox;\n    verticalIconBox?: SingleCollisionBox;\n    textFeatureIndex?: number;\n    verticalTextFeatureIndex?: number;\n    iconFeatureIndex?: number;\n    verticalIconFeatureIndex?: number;\n};\n\nexport type SymbolFeature = {\n    sortKey: number | void;\n    text: Formatted | void;\n    icon: ResolvedImage;\n    index: number;\n    sourceLayerIndex: number;\n    geometry: Array<Array<Point>>;\n    properties: any;\n    type: 'Unknown' | 'Point' | 'LineString' | 'Polygon';\n    id?: any;\n};\n\nexport type SortKeyRange = {\n    sortKey: number;\n    symbolInstanceStart: number;\n    symbolInstanceEnd: number;\n};\n\n// Opacity arrays are frequently updated but don't contain a lot of information, so we pack them\n// tight. Each Uint32 is actually four duplicate Uint8s for the four corners of a glyph\n// 7 bits are for the current opacity, and the lowest bit is the target opacity\n\n// actually defined in symbol_attributes.js\n// const placementOpacityAttributes = [\n//     { name: 'a_fade_opacity', components: 1, type: 'Uint32' }\n// ];\nconst shaderOpacityAttributes = [\n    {name: 'a_fade_opacity', components: 1, type: 'Uint8' as ViewType, offset: 0}\n];\n\nfunction addVertex(\n    array: StructArray,\n    anchorX: number,\n    anchorY: number,\n    ox: number,\n    oy: number,\n    tx: number,\n    ty: number,\n    sizeVertex: number,\n    isSDF: boolean,\n    pixelOffsetX: number,\n    pixelOffsetY: number,\n    minFontScaleX: number,\n    minFontScaleY: number\n) {\n    const aSizeX = sizeVertex ? Math.min(MAX_PACKED_SIZE, Math.round(sizeVertex[0])) : 0;\n    const aSizeY = sizeVertex ? Math.min(MAX_PACKED_SIZE, Math.round(sizeVertex[1])) : 0;\n    array.emplaceBack(\n        // a_pos_offset\n        anchorX,\n        anchorY,\n        Math.round(ox * 32),\n        Math.round(oy * 32),\n\n        // a_data\n        tx, // x coordinate of symbol on glyph atlas texture\n        ty, // y coordinate of symbol on glyph atlas texture\n        (aSizeX << 1) + (isSDF ? 1 : 0),\n        aSizeY,\n        pixelOffsetX * 16,\n        pixelOffsetY * 16,\n        minFontScaleX * 256,\n        minFontScaleY * 256\n    );\n}\n\nfunction addDynamicAttributes(dynamicLayoutVertexArray: StructArray, p: Point, angle: number) {\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n}\n\nfunction containsRTLText(formattedText: Formatted): boolean {\n    for (const section of formattedText.sections) {\n        if (stringContainsRTLText(section.text)) {\n            return true;\n        }\n    }\n    return false;\n}\n\nexport class SymbolBuffers {\n    layoutVertexArray: SymbolLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>;\n    segments: SegmentVector;\n\n    dynamicLayoutVertexArray: SymbolDynamicLayoutArray;\n    dynamicLayoutVertexBuffer: VertexBuffer;\n\n    opacityVertexArray: SymbolOpacityArray;\n    opacityVertexBuffer: VertexBuffer;\n    hasVisibleVertices: boolean;\n\n    collisionVertexArray: CollisionVertexArray;\n    collisionVertexBuffer: VertexBuffer;\n\n    placedSymbolArray: PlacedSymbolArray;\n\n    constructor(programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>) {\n        this.layoutVertexArray = new SymbolLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = programConfigurations;\n        this.segments = new SegmentVector();\n        this.dynamicLayoutVertexArray = new SymbolDynamicLayoutArray();\n        this.opacityVertexArray = new SymbolOpacityArray();\n        this.hasVisibleVertices = false;\n        this.placedSymbolArray = new PlacedSymbolArray();\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0 &&\n            this.indexArray.length === 0 &&\n            this.dynamicLayoutVertexArray.length === 0 &&\n            this.opacityVertexArray.length === 0;\n    }\n\n    upload(context: Context, dynamicIndexBuffer: boolean, upload?: boolean, update?: boolean) {\n        if (this.isEmpty()) {\n            return;\n        }\n\n        if (upload) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, symbolLayoutAttributes.members);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray, dynamicIndexBuffer);\n            this.dynamicLayoutVertexBuffer = context.createVertexBuffer(this.dynamicLayoutVertexArray, dynamicLayoutAttributes.members, true);\n            this.opacityVertexBuffer = context.createVertexBuffer(this.opacityVertexArray, shaderOpacityAttributes, true);\n            // This is a performance hack so that we can write to opacityVertexArray with uint32s\n            // even though the shaders read uint8s\n            this.opacityVertexBuffer.itemSize = 1;\n        }\n        if (upload || update) {\n            this.programConfigurations.upload(context);\n        }\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.dynamicLayoutVertexBuffer.destroy();\n        this.opacityVertexBuffer.destroy();\n    }\n}\n\nregister('SymbolBuffers', SymbolBuffers);\n\nclass CollisionBuffers {\n    layoutVertexArray: StructArray;\n    layoutAttributes: Array<StructArrayMember>;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray | LineIndexArray;\n    indexBuffer: IndexBuffer;\n\n    segments: SegmentVector;\n\n    collisionVertexArray: CollisionVertexArray;\n    collisionVertexBuffer: VertexBuffer;\n\n    constructor(LayoutArray: {\n        new (...args: any): StructArray;\n    },\n    layoutAttributes: Array<StructArrayMember>,\n    IndexArray: {\n        new (...args: any): TriangleIndexArray | LineIndexArray;\n    }) {\n        this.layoutVertexArray = new LayoutArray();\n        this.layoutAttributes = layoutAttributes;\n        this.indexArray = new IndexArray();\n        this.segments = new SegmentVector();\n        this.collisionVertexArray = new CollisionVertexArray();\n    }\n\n    upload(context: Context) {\n        this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes);\n        this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        this.collisionVertexBuffer = context.createVertexBuffer(this.collisionVertexArray, collisionVertexAttributes.members, true);\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.segments.destroy();\n        this.collisionVertexBuffer.destroy();\n    }\n}\n\nregister('CollisionBuffers', CollisionBuffers);\n\n/**\n * @internal\n * Unlike other buckets, which simply implement `addFeature` with type-specific\n * logic for (essentially) triangulating feature geometries, SymbolBucket\n * requires specialized behavior:\n *\n * 1. WorkerTile.parse(), the logical owner of the bucket creation process,\n *    calls SymbolBucket.populate(), which resolves text and icon tokens on\n *    each feature, adds each glyphs and symbols needed to the passed-in\n *    collections options.glyphDependencies and options.iconDependencies, and\n *    stores the feature data for use in subsequent step (this.features).\n *\n * 2. WorkerTile asynchronously requests from the main thread all of the glyphs\n *    and icons needed (by this bucket and any others). When glyphs and icons\n *    have been received, the WorkerTile creates a CollisionIndex and invokes:\n *\n * 3. performSymbolLayout(bucket, stacks, icons) perform texts shaping and\n *    layout on a Symbol Bucket. This step populates:\n *      `this.symbolInstances`: metadata on generated symbols\n *      `this.collisionBoxArray`: collision data for use by foreground\n *      `this.text`: SymbolBuffers for text symbols\n *      `this.icons`: SymbolBuffers for icons\n *      `this.iconCollisionBox`: Debug SymbolBuffers for icon collision boxes\n *      `this.textCollisionBox`: Debug SymbolBuffers for text collision boxes\n *    The results are sent to the foreground for rendering\n *\n * 4. placement.ts is run on the foreground,\n *    and uses the CollisionIndex along with current camera settings to determine\n *    which symbols can actually show on the map. Collided symbols are hidden\n *    using a dynamic \"OpacityVertexArray\".\n */\nexport class SymbolBucket implements Bucket {\n    static MAX_GLYPHS: number;\n    static addDynamicAttributes: typeof addDynamicAttributes;\n\n    collisionBoxArray: CollisionBoxArray;\n    zoom: number;\n    overscaling: number;\n    layers: Array<SymbolStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<SymbolStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n\n    index: number;\n    sdfIcons: boolean;\n    iconsInText: boolean;\n    iconsNeedLinear: boolean;\n    bucketInstanceId: number;\n    justReloaded: boolean;\n    hasDependencies: boolean;\n\n    textSizeData: SizeData;\n    iconSizeData: SizeData;\n\n    glyphOffsetArray: GlyphOffsetArray;\n    lineVertexArray: SymbolLineVertexArray;\n    features: Array<SymbolFeature>;\n    symbolInstances: SymbolInstanceArray;\n    textAnchorOffsets: TextAnchorOffsetArray;\n    collisionArrays: Array<CollisionArrays>;\n    sortKeyRanges: Array<SortKeyRange>;\n    pixelRatio: number;\n    tilePixelRatio: number;\n    compareText: {[_: string]: Array<Point>};\n    fadeStartTime: number;\n    sortFeaturesByKey: boolean;\n    sortFeaturesByY: boolean;\n    canOverlap: boolean;\n    sortedAngle: number;\n    featureSortOrder: Array<number>;\n\n    collisionCircleArray: Array<number>;\n\n    text: SymbolBuffers;\n    icon: SymbolBuffers;\n    textCollisionBox: CollisionBuffers;\n    iconCollisionBox: CollisionBuffers;\n    uploaded: boolean;\n    sourceLayerIndex: number;\n    sourceID: string;\n    symbolInstanceIndexes: Array<number>;\n    writingModes: WritingMode[];\n    allowVerticalPlacement: boolean;\n    hasRTLText: boolean;\n\n    constructor(options: BucketParameters<SymbolStyleLayer>) {\n        this.collisionBoxArray = options.collisionBoxArray;\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.pixelRatio = options.pixelRatio;\n        this.sourceLayerIndex = options.sourceLayerIndex;\n        this.hasDependencies = false;\n        this.hasRTLText = false;\n        this.sortKeyRanges = [];\n\n        this.collisionCircleArray = [];\n\n        const layer = this.layers[0];\n        const unevaluatedLayoutValues = layer._unevaluatedLayout._values;\n\n        this.textSizeData = getSizeData(this.zoom, unevaluatedLayoutValues['text-size']);\n        this.iconSizeData = getSizeData(this.zoom, unevaluatedLayoutValues['icon-size']);\n\n        const layout = this.layers[0].layout;\n        const sortKey = layout.get('symbol-sort-key');\n        const zOrder = layout.get('symbol-z-order');\n        this.canOverlap =\n            getOverlapMode(layout, 'text-overlap', 'text-allow-overlap') !== 'never' ||\n            getOverlapMode(layout, 'icon-overlap', 'icon-allow-overlap') !== 'never' ||\n            layout.get('text-ignore-placement') ||\n            layout.get('icon-ignore-placement');\n        this.sortFeaturesByKey = zOrder !== 'viewport-y' && !sortKey.isConstant();\n        const zOrderByViewportY = zOrder === 'viewport-y' || (zOrder === 'auto' && !this.sortFeaturesByKey);\n        this.sortFeaturesByY = zOrderByViewportY && this.canOverlap;\n\n        if (layout.get('symbol-placement') === 'point') {\n            this.writingModes = layout.get('text-writing-mode').map(wm => WritingMode[wm]);\n        }\n\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n\n        this.sourceID = options.sourceID;\n    }\n\n    createArrays() {\n        this.text = new SymbolBuffers(new ProgramConfigurationSet(this.layers, this.zoom, property => /^text/.test(property)));\n        this.icon = new SymbolBuffers(new ProgramConfigurationSet(this.layers, this.zoom, property => /^icon/.test(property)));\n\n        this.glyphOffsetArray = new GlyphOffsetArray();\n        this.lineVertexArray = new SymbolLineVertexArray();\n        this.symbolInstances = new SymbolInstanceArray();\n        this.textAnchorOffsets = new TextAnchorOffsetArray();\n    }\n\n    private calculateGlyphDependencies(\n        text: string,\n        stack: {[_: number]: boolean},\n        textAlongLine: boolean,\n        allowVerticalPlacement: boolean,\n        doesAllowVerticalWritingMode: boolean) {\n\n        for (const char of text) {\n            stack[char.codePointAt(0)] = true;\n            if ((textAlongLine || allowVerticalPlacement) && doesAllowVerticalWritingMode) {\n                const verticalChar = verticalizedCharacterMap[char];\n                if (verticalChar) {\n                    stack[verticalChar.codePointAt(0)] = true;\n                }\n            }\n        }\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        const layer = this.layers[0];\n        const layout = layer.layout;\n\n        const textFont = layout.get('text-font');\n        const textField = layout.get('text-field');\n        const iconImage = layout.get('icon-image');\n        const hasText =\n            (textField.value.kind !== 'constant' ||\n                (textField.value.value instanceof Formatted && !textField.value.value.isEmpty()) ||\n                textField.value.value.toString().length > 0) &&\n            (textFont.value.kind !== 'constant' || textFont.value.value.length > 0);\n        // we should always resolve the icon-image value if the property was defined in the style\n        // this allows us to fire the styleimagemissing event if image evaluation returns null\n        // the only way to distinguish between null returned from a coalesce statement with no valid images\n        // and null returned because icon-image wasn't defined is to check whether or not iconImage.parameters is an empty object\n        const hasIcon = iconImage.value.kind !== 'constant' || !!iconImage.value.value || Object.keys(iconImage.parameters).length > 0;\n        const symbolSortKey = layout.get('symbol-sort-key');\n\n        this.features = [];\n\n        if (!hasText && !hasIcon) {\n            return;\n        }\n\n        const icons = options.iconDependencies;\n        const stacks = options.glyphDependencies;\n        const availableImages = options.availableImages;\n        const globalProperties = new EvaluationParameters(this.zoom);\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n\n            const needGeometry = layer._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n            if (!layer._featureFilter.filter(globalProperties, evaluationFeature, canonical)) {\n                continue;\n            }\n\n            if (!needGeometry)  evaluationFeature.geometry = loadGeometry(feature);\n\n            let text: Formatted | void;\n            if (hasText) {\n                // Expression evaluation will automatically coerce to Formatted\n                // but plain string token evaluation skips that pathway so do the\n                // conversion here.\n                const resolvedTokens = layer.getValueAndResolveTokens('text-field', evaluationFeature, canonical, availableImages);\n                const formattedText = Formatted.factory(resolvedTokens);\n\n                // on this instance: if hasRTLText is already true, all future calls to containsRTLText can be skipped.\n                const bucketHasRTLText = this.hasRTLText = (this.hasRTLText || containsRTLText(formattedText));\n                if (\n                    !bucketHasRTLText || // non-rtl text so can proceed safely\n                    rtlWorkerPlugin.getRTLTextPluginStatus() === 'unavailable' || // We don't intend to lazy-load the rtl text plugin, so proceed with incorrect shaping\n                    bucketHasRTLText && rtlWorkerPlugin.isParsed() // Use the rtlText plugin to shape text\n                ) {\n                    text = transformText(formattedText, layer, evaluationFeature);\n                }\n            }\n\n            let icon: ResolvedImage;\n            if (hasIcon) {\n                // Expression evaluation will automatically coerce to Image\n                // but plain string token evaluation skips that pathway so do the\n                // conversion here.\n                const resolvedTokens = layer.getValueAndResolveTokens('icon-image', evaluationFeature, canonical, availableImages);\n                if (resolvedTokens instanceof ResolvedImage) {\n                    icon = resolvedTokens;\n                } else {\n                    icon = ResolvedImage.fromString(resolvedTokens);\n                }\n            }\n\n            if (!text && !icon) {\n                continue;\n            }\n            const sortKey = this.sortFeaturesByKey ?\n                symbolSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const symbolFeature: SymbolFeature = {\n                id,\n                text,\n                icon,\n                index,\n                sourceLayerIndex,\n                geometry: evaluationFeature.geometry,\n                properties: feature.properties,\n                type: VectorTileFeature.types[feature.type],\n                sortKey\n            };\n            this.features.push(symbolFeature);\n\n            if (icon) {\n                icons[icon.name] = true;\n            }\n\n            if (text) {\n                const fontStack = textFont.evaluate(evaluationFeature, {}, canonical).join(',');\n                const textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point';\n                this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(WritingMode.vertical) >= 0;\n                for (const section of text.sections) {\n                    if (!section.image) {\n                        const doesAllowVerticalWritingMode = allowsVerticalWritingMode(text.toString());\n                        const sectionFont = section.fontStack || fontStack;\n                        const sectionStack = stacks[sectionFont] = stacks[sectionFont] || {};\n                        this.calculateGlyphDependencies(section.text, sectionStack, textAlongLine, this.allowVerticalPlacement, doesAllowVerticalWritingMode);\n                    } else {\n                        // Add section image to the list of dependencies.\n                        icons[section.image.name] = true;\n                    }\n                }\n            }\n        }\n\n        if (layout.get('symbol-placement') === 'line') {\n            // Merge adjacent lines with the same text to improve labelling.\n            // It's better to place labels on one long line than on many short segments.\n            this.features = mergeLines(this.features);\n        }\n\n        if (this.sortFeaturesByKey) {\n            this.features.sort((a, b) => {\n                // a.sortKey is always a number when sortFeaturesByKey is true\n                return (a.sortKey as number) - (b.sortKey as number);\n            });\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.text.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, {\n            imagePositions\n        });\n        this.icon.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, {\n            imagePositions\n        });\n    }\n\n    isEmpty() {\n        // When the bucket encounters only rtl-text but the plugin isn't loaded, no symbol instances will be created.\n        // In order for the bucket to be serialized, and not discarded as an empty bucket both checks are necessary.\n        return this.symbolInstances.length === 0 && !this.hasRTLText;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded && this.hasDebugData()) {\n            this.textCollisionBox.upload(context);\n            this.iconCollisionBox.upload(context);\n        }\n        this.text.upload(context, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload);\n        this.icon.upload(context, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload);\n        this.uploaded = true;\n    }\n\n    destroyDebugData() {\n        this.textCollisionBox.destroy();\n        this.iconCollisionBox.destroy();\n    }\n\n    destroy() {\n        this.text.destroy();\n        this.icon.destroy();\n\n        if (this.hasDebugData()) {\n            this.destroyDebugData();\n        }\n    }\n\n    addToLineVertexArray(anchor: Anchor, line: Array<Point>) {\n        const lineStartIndex = this.lineVertexArray.length;\n        if (anchor.segment !== undefined) {\n            let sumForwardLength = anchor.dist(line[anchor.segment + 1]);\n            let sumBackwardLength = anchor.dist(line[anchor.segment]);\n            const vertices = {};\n            for (let i = anchor.segment + 1; i < line.length; i++) {\n                vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumForwardLength};\n                if (i < line.length - 1) {\n                    sumForwardLength += line[i + 1].dist(line[i]);\n                }\n            }\n            for (let i = anchor.segment || 0; i >= 0; i--) {\n                vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumBackwardLength};\n                if (i > 0) {\n                    sumBackwardLength += line[i - 1].dist(line[i]);\n                }\n            }\n            for (let i = 0; i < line.length; i++) {\n                const vertex = vertices[i];\n                this.lineVertexArray.emplaceBack(vertex.x, vertex.y, vertex.tileUnitDistanceFromAnchor);\n            }\n        }\n        return {\n            lineStartIndex,\n            lineLength: this.lineVertexArray.length - lineStartIndex\n        };\n    }\n\n    addSymbols(arrays: SymbolBuffers,\n        quads: Array<SymbolQuad>,\n        sizeVertex: any,\n        lineOffset: [number, number],\n        alongLine: boolean,\n        feature: SymbolFeature,\n        writingMode: WritingMode,\n        labelAnchor: Anchor,\n        lineStartIndex: number,\n        lineLength: number,\n        associatedIconIndex: number,\n        canonical: CanonicalTileID) {\n        const indexArray = arrays.indexArray;\n        const layoutVertexArray = arrays.layoutVertexArray;\n\n        const segment = arrays.segments.prepareSegment(4 * quads.length, layoutVertexArray, indexArray, this.canOverlap ? feature.sortKey as number : undefined);\n        const glyphOffsetArrayStart = this.glyphOffsetArray.length;\n        const vertexStartIndex = segment.vertexLength;\n\n        const angle = (this.allowVerticalPlacement && writingMode === WritingMode.vertical) ? Math.PI / 2 : 0;\n\n        const sections = feature.text && feature.text.sections;\n\n        for (let i = 0; i < quads.length; i++) {\n            const {tl, tr, bl, br, tex, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY, glyphOffset, isSDF, sectionIndex} = quads[i];\n            const index = segment.vertexLength;\n\n            const y = glyphOffset[1];\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, tl.x, y + tl.y, tex.x, tex.y, sizeVertex, isSDF, pixelOffsetTL.x, pixelOffsetTL.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, tr.x, y + tr.y, tex.x + tex.w, tex.y, sizeVertex, isSDF, pixelOffsetBR.x, pixelOffsetTL.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, bl.x, y + bl.y, tex.x, tex.y + tex.h, sizeVertex, isSDF, pixelOffsetTL.x, pixelOffsetBR.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, br.x, y + br.y, tex.x + tex.w, tex.y + tex.h, sizeVertex, isSDF, pixelOffsetBR.x, pixelOffsetBR.y, minFontScaleX, minFontScaleY);\n\n            addDynamicAttributes(arrays.dynamicLayoutVertexArray, labelAnchor, angle);\n\n            indexArray.emplaceBack(index, index + 2, index + 1);\n            indexArray.emplaceBack(index + 1, index + 2, index + 3);\n\n            segment.vertexLength += 4;\n            segment.primitiveLength += 2;\n\n            this.glyphOffsetArray.emplaceBack(glyphOffset[0]);\n\n            if (i === quads.length - 1 || sectionIndex !== quads[i + 1].sectionIndex) {\n                arrays.programConfigurations.populatePaintArrays(layoutVertexArray.length, feature, feature.index, {imagePositions: {}, canonical, formattedSection: sections && sections[sectionIndex]});\n            }\n        }\n\n        arrays.placedSymbolArray.emplaceBack(\n            labelAnchor.x, labelAnchor.y,\n            glyphOffsetArrayStart,\n            this.glyphOffsetArray.length - glyphOffsetArrayStart,\n            vertexStartIndex,\n            lineStartIndex,\n            lineLength,\n            labelAnchor.segment,\n            sizeVertex ? sizeVertex[0] : 0,\n            sizeVertex ? sizeVertex[1] : 0,\n            lineOffset[0], lineOffset[1],\n            writingMode,\n            // placedOrientation is null initially; will be updated to horizontal(1)/vertical(2) if placed\n            0,\n            false as unknown as number,\n            // The crossTileID is only filled/used on the foreground for dynamic text anchors\n            0,\n            associatedIconIndex\n        );\n    }\n\n    _addCollisionDebugVertex(layoutVertexArray: StructArray, collisionVertexArray: StructArray, point: Point, anchorX: number, anchorY: number, extrude: Point) {\n        collisionVertexArray.emplaceBack(0, 0);\n        return layoutVertexArray.emplaceBack(\n            // pos\n            point.x,\n            point.y,\n            // a_anchor_pos\n            anchorX,\n            anchorY,\n            // extrude\n            Math.round(extrude.x),\n            Math.round(extrude.y));\n    }\n\n    addCollisionDebugVertices(x1: number, y1: number, x2: number, y2: number, arrays: CollisionBuffers, boxAnchorPoint: Point, symbolInstance: SymbolInstance) {\n        const segment = arrays.segments.prepareSegment(4, arrays.layoutVertexArray, arrays.indexArray);\n        const index = segment.vertexLength;\n\n        const layoutVertexArray = arrays.layoutVertexArray;\n        const collisionVertexArray = arrays.collisionVertexArray;\n\n        const anchorX = symbolInstance.anchorX;\n        const anchorY = symbolInstance.anchorY;\n\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x1, y1));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x2, y1));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x2, y2));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x1, y2));\n\n        segment.vertexLength += 4;\n\n        const indexArray = arrays.indexArray as LineIndexArray;\n        indexArray.emplaceBack(index, index + 1);\n        indexArray.emplaceBack(index + 1, index + 2);\n        indexArray.emplaceBack(index + 2, index + 3);\n        indexArray.emplaceBack(index + 3, index);\n\n        segment.primitiveLength += 4;\n    }\n\n    addDebugCollisionBoxes(startIndex: number, endIndex: number, symbolInstance: SymbolInstance, isText: boolean) {\n        for (let b = startIndex; b < endIndex; b++) {\n            const box: CollisionBox = this.collisionBoxArray.get(b);\n            const x1 = box.x1;\n            const y1 = box.y1;\n            const x2 = box.x2;\n            const y2 = box.y2;\n\n            this.addCollisionDebugVertices(x1, y1, x2, y2,\n                isText ? this.textCollisionBox : this.iconCollisionBox,\n                box.anchorPoint, symbolInstance);\n        }\n    }\n\n    generateCollisionDebugBuffers() {\n        if (this.hasDebugData()) {\n            this.destroyDebugData();\n        }\n\n        this.textCollisionBox = new CollisionBuffers(CollisionBoxLayoutArray, collisionBoxLayout.members, LineIndexArray);\n        this.iconCollisionBox = new CollisionBuffers(CollisionBoxLayoutArray, collisionBoxLayout.members, LineIndexArray);\n\n        for (let i = 0; i < this.symbolInstances.length; i++) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.addDebugCollisionBoxes(symbolInstance.textBoxStartIndex, symbolInstance.textBoxEndIndex, symbolInstance, true);\n            this.addDebugCollisionBoxes(symbolInstance.verticalTextBoxStartIndex, symbolInstance.verticalTextBoxEndIndex, symbolInstance, true);\n            this.addDebugCollisionBoxes(symbolInstance.iconBoxStartIndex, symbolInstance.iconBoxEndIndex, symbolInstance, false);\n            this.addDebugCollisionBoxes(symbolInstance.verticalIconBoxStartIndex, symbolInstance.verticalIconBoxEndIndex, symbolInstance, false);\n        }\n    }\n\n    // These flat arrays are meant to be quicker to iterate over than the source\n    // CollisionBoxArray\n    _deserializeCollisionBoxesForSymbol(\n        collisionBoxArray: CollisionBoxArray,\n        textStartIndex: number,\n        textEndIndex: number,\n        verticalTextStartIndex: number,\n        verticalTextEndIndex: number,\n        iconStartIndex: number,\n        iconEndIndex: number,\n        verticalIconStartIndex: number,\n        verticalIconEndIndex: number\n    ): CollisionArrays {\n\n        const collisionArrays = {} as CollisionArrays;\n        for (let k = textStartIndex; k < textEndIndex; k++) {\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.textBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.textFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = verticalTextStartIndex; k < verticalTextEndIndex; k++) {\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.verticalTextBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.verticalTextFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = iconStartIndex; k < iconEndIndex; k++) {\n            // An icon can only have one box now, so this indexing is a bit vestigial...\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.iconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.iconFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = verticalIconStartIndex; k < verticalIconEndIndex; k++) {\n            // An icon can only have one box now, so this indexing is a bit vestigial...\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.verticalIconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.verticalIconFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        return collisionArrays;\n    }\n\n    deserializeCollisionBoxes(collisionBoxArray: CollisionBoxArray) {\n        this.collisionArrays = [];\n        for (let i = 0; i < this.symbolInstances.length; i++) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(\n                collisionBoxArray,\n                symbolInstance.textBoxStartIndex,\n                symbolInstance.textBoxEndIndex,\n                symbolInstance.verticalTextBoxStartIndex,\n                symbolInstance.verticalTextBoxEndIndex,\n                symbolInstance.iconBoxStartIndex,\n                symbolInstance.iconBoxEndIndex,\n                symbolInstance.verticalIconBoxStartIndex,\n                symbolInstance.verticalIconBoxEndIndex\n            ));\n        }\n    }\n\n    hasTextData() {\n        return this.text.segments.get().length > 0;\n    }\n\n    hasIconData() {\n        return this.icon.segments.get().length > 0;\n    }\n\n    hasDebugData() {\n        return this.textCollisionBox && this.iconCollisionBox;\n    }\n\n    hasTextCollisionBoxData() {\n        return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0;\n    }\n\n    hasIconCollisionBoxData() {\n        return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0;\n    }\n\n    addIndicesForPlacedSymbol(iconOrText: SymbolBuffers, placedSymbolIndex: number) {\n        const placedSymbol = iconOrText.placedSymbolArray.get(placedSymbolIndex);\n\n        const endIndex = placedSymbol.vertexStartIndex + placedSymbol.numGlyphs * 4;\n        for (let vertexIndex = placedSymbol.vertexStartIndex; vertexIndex < endIndex; vertexIndex += 4) {\n            iconOrText.indexArray.emplaceBack(vertexIndex, vertexIndex + 2, vertexIndex + 1);\n            iconOrText.indexArray.emplaceBack(vertexIndex + 1, vertexIndex + 2, vertexIndex + 3);\n        }\n    }\n\n    getSortedSymbolIndexes(angle: number) {\n        if (this.sortedAngle === angle && this.symbolInstanceIndexes !== undefined) {\n            return this.symbolInstanceIndexes;\n        }\n        const sin = Math.sin(angle);\n        const cos = Math.cos(angle);\n        const rotatedYs = [];\n        const featureIndexes = [];\n        const result = [];\n\n        for (let i = 0; i < this.symbolInstances.length; ++i) {\n            result.push(i);\n            const symbolInstance = this.symbolInstances.get(i);\n            rotatedYs.push(Math.round(sin * symbolInstance.anchorX + cos * symbolInstance.anchorY) | 0);\n            featureIndexes.push(symbolInstance.featureIndex);\n        }\n\n        result.sort((aIndex, bIndex) => {\n            return (rotatedYs[aIndex] - rotatedYs[bIndex]) ||\n                   (featureIndexes[bIndex] - featureIndexes[aIndex]);\n        });\n\n        return result;\n    }\n\n    addToSortKeyRanges(symbolInstanceIndex: number, sortKey: number) {\n        const last = this.sortKeyRanges[this.sortKeyRanges.length - 1];\n        if (last && last.sortKey === sortKey) {\n            last.symbolInstanceEnd = symbolInstanceIndex + 1;\n        } else {\n            this.sortKeyRanges.push({\n                sortKey,\n                symbolInstanceStart: symbolInstanceIndex,\n                symbolInstanceEnd: symbolInstanceIndex + 1\n            });\n        }\n    }\n\n    sortFeatures(angle: number) {\n        if (!this.sortFeaturesByY) return;\n        if (this.sortedAngle === angle) return;\n\n        // The current approach to sorting doesn't sort across segments so don't try.\n        // Sorting within segments separately seemed not to be worth the complexity.\n        if (this.text.segments.get().length > 1 || this.icon.segments.get().length > 1) return;\n\n        // If the symbols are allowed to overlap sort them by their vertical screen position.\n        // The index array buffer is rewritten to reference the (unchanged) vertices in the\n        // sorted order.\n\n        // To avoid sorting the actual symbolInstance array we sort an array of indexes.\n        this.symbolInstanceIndexes = this.getSortedSymbolIndexes(angle);\n        this.sortedAngle = angle;\n\n        this.text.indexArray.clear();\n        this.icon.indexArray.clear();\n\n        this.featureSortOrder = [];\n\n        for (const i of this.symbolInstanceIndexes) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.featureSortOrder.push(symbolInstance.featureIndex);\n\n            [\n                symbolInstance.rightJustifiedTextSymbolIndex,\n                symbolInstance.centerJustifiedTextSymbolIndex,\n                symbolInstance.leftJustifiedTextSymbolIndex\n            ].forEach((index, i, array) => {\n                // Only add a given index the first time it shows up,\n                // to avoid duplicate opacity entries when multiple justifications\n                // share the same glyphs.\n                if (index >= 0 && array.indexOf(index) === i) {\n                    this.addIndicesForPlacedSymbol(this.text, index);\n                }\n            });\n\n            if (symbolInstance.verticalPlacedTextSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.text, symbolInstance.verticalPlacedTextSymbolIndex);\n            }\n\n            if (symbolInstance.placedIconSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.icon, symbolInstance.placedIconSymbolIndex);\n            }\n\n            if (symbolInstance.verticalPlacedIconSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.icon, symbolInstance.verticalPlacedIconSymbolIndex);\n            }\n        }\n\n        if (this.text.indexBuffer) this.text.indexBuffer.updateData(this.text.indexArray);\n        if (this.icon.indexBuffer) this.icon.indexBuffer.updateData(this.icon.indexArray);\n    }\n}\n\nregister('SymbolBucket', SymbolBucket, {\n    omit: ['layers', 'collisionBoxArray', 'features', 'compareText']\n});\n\n// this constant is based on the size of StructArray indexes used in a symbol\n// bucket--namely, glyphOffsetArrayStart\n// eg the max valid UInt16 is 65,535\n// See https://github.com/mapbox/mapbox-gl-js/issues/2907 for motivation\n// lineStartIndex and textBoxStartIndex could potentially be concerns\n// but we expect there to be many fewer boxes/lines than glyphs\nSymbolBucket.MAX_GLYPHS = 65535;\n\nSymbolBucket.addDynamicAttributes = addDynamicAttributes;\n\nexport {addDynamicAttributes};\n","import type {SymbolFeature} from '../data/bucket/symbol_bucket';\n\nexport function mergeLines(features: Array<SymbolFeature>): Array<SymbolFeature> {\n    const leftIndex: {[_: string]: number} = {};\n    const rightIndex: {[_: string]: number} = {};\n    const mergedFeatures = [];\n    let mergedIndex = 0;\n\n    function add(k) {\n        mergedFeatures.push(features[k]);\n        mergedIndex++;\n    }\n\n    function mergeFromRight(leftKey: string, rightKey: string, geom) {\n        const i = rightIndex[leftKey];\n        delete rightIndex[leftKey];\n        rightIndex[rightKey] = i;\n\n        mergedFeatures[i].geometry[0].pop();\n        mergedFeatures[i].geometry[0] = mergedFeatures[i].geometry[0].concat(geom[0]);\n        return i;\n    }\n\n    function mergeFromLeft(leftKey: string, rightKey: string, geom) {\n        const i = leftIndex[rightKey];\n        delete leftIndex[rightKey];\n        leftIndex[leftKey] = i;\n\n        mergedFeatures[i].geometry[0].shift();\n        mergedFeatures[i].geometry[0] = geom[0].concat(mergedFeatures[i].geometry[0]);\n        return i;\n    }\n\n    function getKey(text, geom, onRight?) {\n        const point = onRight ? geom[0][geom[0].length - 1] : geom[0][0];\n        return `${text}:${point.x}:${point.y}`;\n    }\n\n    for (let k = 0; k < features.length; k++) {\n        const feature = features[k];\n        const geom = feature.geometry;\n        const text = feature.text ? feature.text.toString() : null;\n\n        if (!text) {\n            add(k);\n            continue;\n        }\n\n        const leftKey = getKey(text, geom),\n            rightKey = getKey(text, geom, true);\n\n        if ((leftKey in rightIndex) && (rightKey in leftIndex) && (rightIndex[leftKey] !== leftIndex[rightKey])) {\n            // found lines with the same text adjacent to both ends of the current line, merge all three\n            const j = mergeFromLeft(leftKey, rightKey, geom);\n            const i = mergeFromRight(leftKey, rightKey, mergedFeatures[j].geometry);\n\n            delete leftIndex[leftKey];\n            delete rightIndex[rightKey];\n\n            rightIndex[getKey(text, mergedFeatures[i].geometry, true)] = i;\n            mergedFeatures[j].geometry = null;\n\n        } else if (leftKey in rightIndex) {\n            // found mergeable line adjacent to the start of the current line, merge\n            mergeFromRight(leftKey, rightKey, geom);\n\n        } else if (rightKey in leftIndex) {\n            // found mergeable line adjacent to the end of the current line, merge\n            mergeFromLeft(leftKey, rightKey, geom);\n\n        } else {\n            // no adjacent lines, add as a new item\n            add(k);\n            leftIndex[leftKey] = mergedIndex - 1;\n            rightIndex[rightKey] = mergedIndex - 1;\n        }\n    }\n\n    return mergedFeatures.filter((f) => f.geometry);\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n            ColorType\n        } from '@maplibre/maplibre-gl-style-spec';\n        \nexport type SymbolLayoutProps = {\n    \"symbol-placement\": DataConstantProperty<\"point\" | \"line\" | \"line-center\">,\n    \"symbol-spacing\": DataConstantProperty<number>,\n    \"symbol-avoid-edges\": DataConstantProperty<boolean>,\n    \"symbol-sort-key\": DataDrivenProperty<number>,\n    \"symbol-z-order\": DataConstantProperty<\"auto\" | \"viewport-y\" | \"source\">,\n    \"icon-allow-overlap\": DataConstantProperty<boolean>,\n    \"icon-overlap\": DataConstantProperty<\"never\" | \"always\" | \"cooperative\">,\n    \"icon-ignore-placement\": DataConstantProperty<boolean>,\n    \"icon-optional\": DataConstantProperty<boolean>,\n    \"icon-rotation-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"icon-size\": DataDrivenProperty<number>,\n    \"icon-text-fit\": DataConstantProperty<\"none\" | \"width\" | \"height\" | \"both\">,\n    \"icon-text-fit-padding\": DataConstantProperty<[number, number, number, number]>,\n    \"icon-image\": DataDrivenProperty<ResolvedImage>,\n    \"icon-rotate\": DataDrivenProperty<number>,\n    \"icon-padding\": DataDrivenProperty<Padding>,\n    \"icon-keep-upright\": DataConstantProperty<boolean>,\n    \"icon-offset\": DataDrivenProperty<[number, number]>,\n    \"icon-anchor\": DataDrivenProperty<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"icon-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"text-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"text-rotation-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"viewport-glyph\" | \"auto\">,\n    \"text-field\": DataDrivenProperty<Formatted>,\n    \"text-font\": DataDrivenProperty<Array<string>>,\n    \"text-size\": DataDrivenProperty<number>,\n    \"text-max-width\": DataDrivenProperty<number>,\n    \"text-line-height\": DataConstantProperty<number>,\n    \"text-letter-spacing\": DataDrivenProperty<number>,\n    \"text-justify\": DataDrivenProperty<\"auto\" | \"left\" | \"center\" | \"right\">,\n    \"text-radial-offset\": DataDrivenProperty<number>,\n    \"text-variable-anchor\": DataConstantProperty<Array<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">>,\n    \"text-variable-anchor-offset\": DataDrivenProperty<VariableAnchorOffsetCollection>,\n    \"text-anchor\": DataDrivenProperty<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-max-angle\": DataConstantProperty<number>,\n    \"text-writing-mode\": DataConstantProperty<Array<\"horizontal\" | \"vertical\">>,\n    \"text-rotate\": DataDrivenProperty<number>,\n    \"text-padding\": DataConstantProperty<number>,\n    \"text-keep-upright\": DataConstantProperty<boolean>,\n    \"text-transform\": DataDrivenProperty<\"none\" | \"uppercase\" | \"lowercase\">,\n    \"text-offset\": DataDrivenProperty<[number, number]>,\n    \"text-allow-overlap\": DataConstantProperty<boolean>,\n    \"text-overlap\": DataConstantProperty<\"never\" | \"always\" | \"cooperative\">,\n    \"text-ignore-placement\": DataConstantProperty<boolean>,\n    \"text-optional\": DataConstantProperty<boolean>,\n};\n\nexport type SymbolLayoutPropsPossiblyEvaluated = {\n    \"symbol-placement\": \"point\" | \"line\" | \"line-center\",\n    \"symbol-spacing\": number,\n    \"symbol-avoid-edges\": boolean,\n    \"symbol-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n    \"symbol-z-order\": \"auto\" | \"viewport-y\" | \"source\",\n    \"icon-allow-overlap\": boolean,\n    \"icon-overlap\": \"never\" | \"always\" | \"cooperative\",\n    \"icon-ignore-placement\": boolean,\n    \"icon-optional\": boolean,\n    \"icon-rotation-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"icon-size\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-text-fit\": \"none\" | \"width\" | \"height\" | \"both\",\n    \"icon-text-fit-padding\": [number, number, number, number],\n    \"icon-image\": PossiblyEvaluatedPropertyValue<ResolvedImage>,\n    \"icon-rotate\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-padding\": PossiblyEvaluatedPropertyValue<Padding>,\n    \"icon-keep-upright\": boolean,\n    \"icon-offset\": PossiblyEvaluatedPropertyValue<[number, number]>,\n    \"icon-anchor\": PossiblyEvaluatedPropertyValue<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"icon-pitch-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"text-pitch-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"text-rotation-alignment\": \"map\" | \"viewport\" | \"viewport-glyph\" | \"auto\",\n    \"text-field\": PossiblyEvaluatedPropertyValue<Formatted>,\n    \"text-font\": PossiblyEvaluatedPropertyValue<Array<string>>,\n    \"text-size\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-max-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-line-height\": number,\n    \"text-letter-spacing\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-justify\": PossiblyEvaluatedPropertyValue<\"auto\" | \"left\" | \"center\" | \"right\">,\n    \"text-radial-offset\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-variable-anchor\": Array<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-variable-anchor-offset\": PossiblyEvaluatedPropertyValue<VariableAnchorOffsetCollection>,\n    \"text-anchor\": PossiblyEvaluatedPropertyValue<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-max-angle\": number,\n    \"text-writing-mode\": Array<\"horizontal\" | \"vertical\">,\n    \"text-rotate\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-padding\": number,\n    \"text-keep-upright\": boolean,\n    \"text-transform\": PossiblyEvaluatedPropertyValue<\"none\" | \"uppercase\" | \"lowercase\">,\n    \"text-offset\": PossiblyEvaluatedPropertyValue<[number, number]>,\n    \"text-allow-overlap\": boolean,\n    \"text-overlap\": \"never\" | \"always\" | \"cooperative\",\n    \"text-ignore-placement\": boolean,\n    \"text-optional\": boolean,\n};\n\nlet layout: Properties<SymbolLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"symbol-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-placement\"] as any as StylePropertySpecification),\n    \"symbol-spacing\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-spacing\"] as any as StylePropertySpecification),\n    \"symbol-avoid-edges\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-avoid-edges\"] as any as StylePropertySpecification),\n    \"symbol-sort-key\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"symbol-sort-key\"] as any as StylePropertySpecification),\n    \"symbol-z-order\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-z-order\"] as any as StylePropertySpecification),\n    \"icon-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-allow-overlap\"] as any as StylePropertySpecification),\n    \"icon-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-overlap\"] as any as StylePropertySpecification),\n    \"icon-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-ignore-placement\"] as any as StylePropertySpecification),\n    \"icon-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-optional\"] as any as StylePropertySpecification),\n    \"icon-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-rotation-alignment\"] as any as StylePropertySpecification),\n    \"icon-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-size\"] as any as StylePropertySpecification),\n    \"icon-text-fit\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit\"] as any as StylePropertySpecification),\n    \"icon-text-fit-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit-padding\"] as any as StylePropertySpecification),\n    \"icon-image\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-image\"] as any as StylePropertySpecification),\n    \"icon-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-rotate\"] as any as StylePropertySpecification),\n    \"icon-padding\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-padding\"] as any as StylePropertySpecification),\n    \"icon-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-keep-upright\"] as any as StylePropertySpecification),\n    \"icon-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-offset\"] as any as StylePropertySpecification),\n    \"icon-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-anchor\"] as any as StylePropertySpecification),\n    \"icon-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-pitch-alignment\"] as any as StylePropertySpecification),\n    \"text-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-pitch-alignment\"] as any as StylePropertySpecification),\n    \"text-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-rotation-alignment\"] as any as StylePropertySpecification),\n    \"text-field\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-field\"] as any as StylePropertySpecification),\n    \"text-font\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-font\"] as any as StylePropertySpecification),\n    \"text-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-size\"] as any as StylePropertySpecification),\n    \"text-max-width\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-max-width\"] as any as StylePropertySpecification),\n    \"text-line-height\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-line-height\"] as any as StylePropertySpecification),\n    \"text-letter-spacing\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-letter-spacing\"] as any as StylePropertySpecification),\n    \"text-justify\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-justify\"] as any as StylePropertySpecification),\n    \"text-radial-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-radial-offset\"] as any as StylePropertySpecification),\n    \"text-variable-anchor\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor\"] as any as StylePropertySpecification),\n    \"text-variable-anchor-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor-offset\"] as any as StylePropertySpecification),\n    \"text-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-anchor\"] as any as StylePropertySpecification),\n    \"text-max-angle\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-max-angle\"] as any as StylePropertySpecification),\n    \"text-writing-mode\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-writing-mode\"] as any as StylePropertySpecification),\n    \"text-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-rotate\"] as any as StylePropertySpecification),\n    \"text-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-padding\"] as any as StylePropertySpecification),\n    \"text-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-keep-upright\"] as any as StylePropertySpecification),\n    \"text-transform\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-transform\"] as any as StylePropertySpecification),\n    \"text-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-offset\"] as any as StylePropertySpecification),\n    \"text-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-allow-overlap\"] as any as StylePropertySpecification),\n    \"text-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-overlap\"] as any as StylePropertySpecification),\n    \"text-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-ignore-placement\"] as any as StylePropertySpecification),\n    \"text-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-optional\"] as any as StylePropertySpecification),\n});\n\nexport type SymbolPaintProps = {\n    \"icon-opacity\": DataDrivenProperty<number>,\n    \"icon-color\": DataDrivenProperty<Color>,\n    \"icon-halo-color\": DataDrivenProperty<Color>,\n    \"icon-halo-width\": DataDrivenProperty<number>,\n    \"icon-halo-blur\": DataDrivenProperty<number>,\n    \"icon-translate\": DataConstantProperty<[number, number]>,\n    \"icon-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"text-opacity\": DataDrivenProperty<number>,\n    \"text-color\": DataDrivenProperty<Color>,\n    \"text-halo-color\": DataDrivenProperty<Color>,\n    \"text-halo-width\": DataDrivenProperty<number>,\n    \"text-halo-blur\": DataDrivenProperty<number>,\n    \"text-translate\": DataConstantProperty<[number, number]>,\n    \"text-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n};\n\nexport type SymbolPaintPropsPossiblyEvaluated = {\n    \"icon-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"icon-halo-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"icon-halo-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-halo-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-translate\": [number, number],\n    \"icon-translate-anchor\": \"map\" | \"viewport\",\n    \"text-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"text-halo-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"text-halo-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-halo-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-translate\": [number, number],\n    \"text-translate-anchor\": \"map\" | \"viewport\",\n};\n\nlet paint: Properties<SymbolPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"icon-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-opacity\"] as any as StylePropertySpecification),\n    \"icon-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-color\"] as any as StylePropertySpecification),\n    \"icon-halo-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-color\"] as any as StylePropertySpecification),\n    \"icon-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-width\"] as any as StylePropertySpecification),\n    \"icon-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-blur\"] as any as StylePropertySpecification),\n    \"icon-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate\"] as any as StylePropertySpecification),\n    \"icon-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate-anchor\"] as any as StylePropertySpecification),\n    \"text-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-opacity\"] as any as StylePropertySpecification),\n    \"text-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-color\"] as any as StylePropertySpecification, { runtimeType: ColorType, getOverride: (o) => o.textColor, hasOverride: (o) => !!o.textColor }),\n    \"text-halo-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-color\"] as any as StylePropertySpecification),\n    \"text-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-width\"] as any as StylePropertySpecification),\n    \"text-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-blur\"] as any as StylePropertySpecification),\n    \"text-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate\"] as any as StylePropertySpecification),\n    \"text-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate-anchor\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });","import type {Expression, EvaluationContext, Type, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {NullType} from '@maplibre/maplibre-gl-style-spec';\nimport {type PossiblyEvaluatedPropertyValue} from './properties';\nimport {register} from '../util/web_worker_transfer';\n\n// This is an internal expression class. It is only used in GL JS and\n// has GL JS dependencies which can break the standalone style-spec module\nexport class FormatSectionOverride<T> implements Expression {\n    type: Type;\n    defaultValue: PossiblyEvaluatedPropertyValue<T>;\n\n    constructor(defaultValue: PossiblyEvaluatedPropertyValue<T>) {\n        if (defaultValue.property.overrides === undefined) throw new Error('overrides must be provided to instantiate FormatSectionOverride class');\n        this.type = defaultValue.property.overrides ? defaultValue.property.overrides.runtimeType : NullType;\n        this.defaultValue = defaultValue;\n    }\n\n    evaluate(ctx: EvaluationContext) {\n        if (ctx.formattedSection) {\n            const overrides = this.defaultValue.property.overrides;\n            if (overrides && overrides.hasOverride(ctx.formattedSection)) {\n                return overrides.getOverride(ctx.formattedSection);\n            }\n        }\n\n        if (ctx.feature && ctx.featureState) {\n            return this.defaultValue.evaluate(ctx.feature, ctx.featureState);\n        }\n\n        return this.defaultValue.property.specification.default;\n    }\n\n    eachChild(fn: (_: Expression) => void) {\n        if (!this.defaultValue.isConstant()) {\n            const expr: ZoomConstantExpression<'source'> = (this.defaultValue.value as any);\n            fn(expr._styleExpression.expression);\n        }\n    }\n\n    // Cannot be statically evaluated, as the output depends on the evaluation context.\n    outputDefined() {\n        return false;\n    }\n\n    serialize() {\n        return null;\n    }\n}\n\nregister('FormatSectionOverride', FormatSectionOverride, {omit: ['defaultValue']});\n","import {StyleLayer} from '../style_layer';\n\nimport {SymbolBucket, type SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {resolveTokens} from '../../util/resolve_tokens';\nimport properties, {type SymbolLayoutPropsPossiblyEvaluated, type SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\n\nimport {\n    type Transitionable,\n    type Transitioning,\n    type Layout,\n    type PossiblyEvaluated,\n    PossiblyEvaluatedPropertyValue,\n    type PropertyValue\n} from '../properties';\n\nimport {\n    isExpression,\n    StyleExpression,\n    ZoomConstantExpression,\n    ZoomDependentExpression,\n    FormattedType,\n    typeOf,\n    Formatted,\n    FormatExpression,\n    Literal} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {BucketParameters} from '../../data/bucket';\nimport type {SymbolLayoutProps, SymbolPaintProps} from './symbol_style_layer_properties.g';\nimport type {EvaluationParameters} from '../evaluation_parameters';\nimport type {Expression, Feature, SourceExpression, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport {FormatSectionOverride} from '../format_section_override';\n\nexport const isSymbolStyleLayer = (layer: StyleLayer): layer is SymbolStyleLayer => layer.type === 'symbol';\n\nexport class SymbolStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<SymbolLayoutProps>;\n    layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<SymbolPaintProps>;\n    _transitioningPaint: Transitioning<SymbolPaintProps>;\n    paint: PossiblyEvaluated<SymbolPaintProps, SymbolPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n\n        if (this.layout.get('icon-rotation-alignment') === 'auto') {\n            if (this.layout.get('symbol-placement') !== 'point') {\n                this.layout._values['icon-rotation-alignment'] = 'map';\n            } else {\n                this.layout._values['icon-rotation-alignment'] = 'viewport';\n            }\n        }\n\n        if (this.layout.get('text-rotation-alignment') === 'auto') {\n            if (this.layout.get('symbol-placement') !== 'point') {\n                this.layout._values['text-rotation-alignment'] = 'map';\n            } else {\n                this.layout._values['text-rotation-alignment'] = 'viewport';\n            }\n        }\n\n        // If unspecified, `*-pitch-alignment` inherits `*-rotation-alignment`\n        if (this.layout.get('text-pitch-alignment') === 'auto') {\n            this.layout._values['text-pitch-alignment'] = this.layout.get('text-rotation-alignment') === 'map' ? 'map' : 'viewport';\n        }\n        if (this.layout.get('icon-pitch-alignment') === 'auto') {\n            this.layout._values['icon-pitch-alignment'] = this.layout.get('icon-rotation-alignment');\n        }\n\n        if (this.layout.get('symbol-placement') === 'point') {\n            const writingModes = this.layout.get('text-writing-mode');\n            if (writingModes) {\n                // remove duplicates, preserving order\n                const deduped = [];\n                for (const m of writingModes) {\n                    if (deduped.indexOf(m) < 0) deduped.push(m);\n                }\n                this.layout._values['text-writing-mode'] = deduped;\n            } else {\n                this.layout._values['text-writing-mode'] = ['horizontal'];\n            }\n        }\n\n        this._setPaintOverrides();\n    }\n\n    getValueAndResolveTokens(name: any, feature: Feature, canonical: CanonicalTileID, availableImages: Array<string>) {\n        const value = this.layout.get(name).evaluate(feature, {}, canonical, availableImages);\n        const unevaluated = this._unevaluatedLayout._values[name];\n        if (!unevaluated.isDataDriven() && !isExpression(unevaluated.value) && value) {\n            return resolveTokens(feature.properties, value);\n        }\n\n        return value;\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new SymbolBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return 0;\n    }\n\n    queryIntersectsFeature(): boolean {\n        throw new Error('Should take a different path in FeatureIndex');\n    }\n\n    _setPaintOverrides() {\n        for (const overridable of properties.paint.overridableProperties) {\n            if (!SymbolStyleLayer.hasPaintOverride(this.layout, overridable)) {\n                continue;\n            }\n            const overridden = this.paint.get(overridable as keyof SymbolPaintPropsPossiblyEvaluated) as PossiblyEvaluatedPropertyValue<number>;\n            const override = new FormatSectionOverride(overridden);\n            const styleExpression = new StyleExpression(override, overridden.property.specification);\n            let expression = null;\n            if (overridden.value.kind === 'constant' || overridden.value.kind === 'source') {\n                expression = new ZoomConstantExpression('source', styleExpression) as SourceExpression;\n            } else {\n                expression = new ZoomDependentExpression('composite',\n                    styleExpression,\n                    overridden.value.zoomStops);\n            }\n            this.paint._values[overridable] = new PossiblyEvaluatedPropertyValue(overridden.property,\n                expression,\n                overridden.parameters);\n        }\n    }\n\n    _handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean {\n        if (!this.layout || oldValue.isDataDriven() || newValue.isDataDriven()) {\n            return false;\n        }\n        return SymbolStyleLayer.hasPaintOverride(this.layout, name);\n    }\n\n    static hasPaintOverride(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, propertyName: string): boolean {\n        const textField = layout.get('text-field');\n        const property = properties.paint.properties[propertyName];\n        let hasOverrides = false;\n\n        const checkSections = (sections) => {\n            for (const section of sections) {\n                if (property.overrides && property.overrides.hasOverride(section)) {\n                    hasOverrides = true;\n                    return;\n                }\n            }\n        };\n\n        if (textField.value.kind === 'constant' && textField.value.value instanceof Formatted) {\n            checkSections(textField.value.value.sections);\n        } else if (textField.value.kind === 'source' || textField.value.kind === 'composite') {\n\n            const checkExpression = (expression: Expression) => {\n                if (hasOverrides) return;\n\n                if (expression instanceof Literal && typeOf(expression.value) === FormattedType) {\n                    const formatted: Formatted = (expression.value as any);\n                    checkSections(formatted.sections);\n                } else if (expression instanceof FormatExpression) {\n                    checkSections(expression.sections);\n                } else {\n                    expression.eachChild(checkExpression);\n                }\n            };\n\n            const expr: ZoomConstantExpression<'source'> = (textField.value as any);\n            if (expr._styleExpression) {\n                checkExpression(expr._styleExpression.expression);\n            }\n        }\n\n        return hasOverrides;\n    }\n}\n\nexport type SymbolPadding = [number, number, number, number];\n\nexport function getIconPadding(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, feature: SymbolFeature, canonical: CanonicalTileID, pixelRatio = 1): SymbolPadding {\n    // Support text-padding in addition to icon-padding? Unclear how to apply asymmetric text-padding to the radius for collision circles.\n    const result = layout.get('icon-padding').evaluate(feature, {}, canonical);\n    const values = result && result.values;\n\n    return [\n        values[0] * pixelRatio,\n        values[1] * pixelRatio,\n        values[2] * pixelRatio,\n        values[3] * pixelRatio,\n    ];\n}\n","/**\n * Replace tokens in a string template with values in an object\n *\n * @param properties - a key/value relationship between tokens and replacements\n * @param text - the template string\n * @returns the template with tokens replaced\n */\nexport function resolveTokens(\n    properties: {\n        readonly [x: string]: unknown;\n    } | null,\n    text: string\n): string {\n    return text.replace(/{([^{}]+)}/g, (match, key: string) => {\n        return properties && key in properties ? String(properties[key]) : '';\n    });\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type BackgroundPaintProps = {\n    \"background-color\": DataConstantProperty<Color>,\n    \"background-pattern\": CrossFadedProperty<ResolvedImage>,\n    \"background-opacity\": DataConstantProperty<number>,\n};\n\nexport type BackgroundPaintPropsPossiblyEvaluated = {\n    \"background-color\": Color,\n    \"background-pattern\": CrossFaded<ResolvedImage>,\n    \"background-opacity\": number,\n};\n\nlet paint: Properties<BackgroundPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"background-color\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-color\"] as any as StylePropertySpecification),\n    \"background-pattern\": new CrossFadedProperty(styleSpec[\"paint_background\"][\"background-pattern\"] as any as StylePropertySpecification),\n    \"background-opacity\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","import {StyleLayer} from '../style_layer';\n\nimport properties, {type BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {BackgroundPaintProps} from './background_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport const isBackgroundStyleLayer = (layer: StyleLayer): layer is BackgroundStyleLayer => layer.type === 'background';\n\nexport class BackgroundStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<BackgroundPaintProps>;\n    _transitioningPaint: Transitioning<BackgroundPaintProps>;\n    paint: PossiblyEvaluated<BackgroundPaintProps, BackgroundPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n}\n","// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, NumberArray, ColorArray, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type RasterPaintProps = {\n    \"raster-opacity\": DataConstantProperty<number>,\n    \"raster-hue-rotate\": DataConstantProperty<number>,\n    \"raster-brightness-min\": DataConstantProperty<number>,\n    \"raster-brightness-max\": DataConstantProperty<number>,\n    \"raster-saturation\": DataConstantProperty<number>,\n    \"raster-contrast\": DataConstantProperty<number>,\n    \"raster-resampling\": DataConstantProperty<\"linear\" | \"nearest\">,\n    \"raster-fade-duration\": DataConstantProperty<number>,\n};\n\nexport type RasterPaintPropsPossiblyEvaluated = {\n    \"raster-opacity\": number,\n    \"raster-hue-rotate\": number,\n    \"raster-brightness-min\": number,\n    \"raster-brightness-max\": number,\n    \"raster-saturation\": number,\n    \"raster-contrast\": number,\n    \"raster-resampling\": \"linear\" | \"nearest\",\n    \"raster-fade-duration\": number,\n};\n\nlet paint: Properties<RasterPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"raster-opacity\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-opacity\"] as any as StylePropertySpecification),\n    \"raster-hue-rotate\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-hue-rotate\"] as any as StylePropertySpecification),\n    \"raster-brightness-min\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-min\"] as any as StylePropertySpecification),\n    \"raster-brightness-max\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-max\"] as any as StylePropertySpecification),\n    \"raster-saturation\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-saturation\"] as any as StylePropertySpecification),\n    \"raster-contrast\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-contrast\"] as any as StylePropertySpecification),\n    \"raster-resampling\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-resampling\"] as any as StylePropertySpecification),\n    \"raster-fade-duration\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-fade-duration\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });","export var LogicalLevelTechnique;\n(function (LogicalLevelTechnique) {\n    LogicalLevelTechnique[\"NONE\"] = \"NONE\";\n    LogicalLevelTechnique[\"DELTA\"] = \"DELTA\";\n    LogicalLevelTechnique[\"COMPONENTWISE_DELTA\"] = \"COMPONENTWISE_DELTA\";\n    LogicalLevelTechnique[\"RLE\"] = \"RLE\";\n    LogicalLevelTechnique[\"MORTON\"] = \"MORTON\";\n    // Pseudodecimal Encoding of floats -> only for the exponent integer part an additional logical level technique is used.\n    // Both exponent and significant parts are encoded with the same physical level technique\n    LogicalLevelTechnique[\"PDE\"] = \"PDE\";\n})(LogicalLevelTechnique || (LogicalLevelTechnique = {}));\n//# sourceMappingURL=logicalLevelTechnique.js.map","export var PhysicalLevelTechnique;\n(function (PhysicalLevelTechnique) {\n    PhysicalLevelTechnique[\"NONE\"] = \"NONE\";\n    /**\n     * Preferred option, tends to produce the best compression ratio and decoding performance.\n     * But currently only limited to 32 bit integer.\n     */\n    PhysicalLevelTechnique[\"FAST_PFOR\"] = \"FAST_PFOR\";\n    /**\n     * Can produce better results in combination with a heavyweight compression scheme like Gzip.\n     * Simple compression scheme where the decoder are easier to implement compared to FastPfor.\n     */\n    PhysicalLevelTechnique[\"VARINT\"] = \"VARINT\";\n    /**\n     * Adaptive Lossless floating-Point Compression\n     */\n    PhysicalLevelTechnique[\"ALP\"] = \"ALP\";\n})(PhysicalLevelTechnique || (PhysicalLevelTechnique = {}));\n//# sourceMappingURL=physicalLevelTechnique.js.map","export var PhysicalStreamType;\n(function (PhysicalStreamType) {\n    PhysicalStreamType[\"PRESENT\"] = \"PRESENT\";\n    PhysicalStreamType[\"DATA\"] = \"DATA\";\n    PhysicalStreamType[\"OFFSET\"] = \"OFFSET\";\n    PhysicalStreamType[\"LENGTH\"] = \"LENGTH\";\n})(PhysicalStreamType || (PhysicalStreamType = {}));\n//# sourceMappingURL=physicalStreamType.js.map","export var DictionaryType;\n(function (DictionaryType) {\n    DictionaryType[\"NONE\"] = \"NONE\";\n    DictionaryType[\"SINGLE\"] = \"SINGLE\";\n    DictionaryType[\"SHARED\"] = \"SHARED\";\n    DictionaryType[\"VERTEX\"] = \"VERTEX\";\n    DictionaryType[\"MORTON\"] = \"MORTON\";\n    DictionaryType[\"FSST\"] = \"FSST\";\n})(DictionaryType || (DictionaryType = {}));\n//# sourceMappingURL=dictionaryType.js.map","export var OffsetType;\n(function (OffsetType) {\n    OffsetType[\"VERTEX\"] = \"VERTEX\";\n    OffsetType[\"INDEX\"] = \"INDEX\";\n    OffsetType[\"STRING\"] = \"STRING\";\n    OffsetType[\"KEY\"] = \"KEY\";\n})(OffsetType || (OffsetType = {}));\n//# sourceMappingURL=offsetType.js.map","export var LengthType;\n(function (LengthType) {\n    LengthType[\"VAR_BINARY\"] = \"VAR_BINARY\";\n    LengthType[\"GEOMETRIES\"] = \"GEOMETRIES\";\n    LengthType[\"PARTS\"] = \"PARTS\";\n    LengthType[\"RINGS\"] = \"RINGS\";\n    LengthType[\"TRIANGLES\"] = \"TRIANGLES\";\n    LengthType[\"SYMBOL\"] = \"SYMBOL\";\n    LengthType[\"DICTIONARY\"] = \"DICTIONARY\";\n})(LengthType || (LengthType = {}));\n//# sourceMappingURL=lengthType.js.map","export var VectorType;\n(function (VectorType) {\n    VectorType[VectorType[\"FLAT\"] = 0] = \"FLAT\";\n    VectorType[VectorType[\"CONST\"] = 1] = \"CONST\";\n    VectorType[VectorType[\"SEQUENCE\"] = 2] = \"SEQUENCE\";\n    VectorType[VectorType[\"DICTIONARY\"] = 3] = \"DICTIONARY\";\n    VectorType[VectorType[\"FSST_DICTIONARY\"] = 4] = \"FSST_DICTIONARY\";\n})(VectorType || (VectorType = {}));\n//# sourceMappingURL=vectorType.js.map","export var GEOMETRY_TYPE;\n(function (GEOMETRY_TYPE) {\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"POINT\"] = 0] = \"POINT\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"LINESTRING\"] = 1] = \"LINESTRING\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"POLYGON\"] = 2] = \"POLYGON\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTIPOINT\"] = 3] = \"MULTIPOINT\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTILINESTRING\"] = 4] = \"MULTILINESTRING\";\n    GEOMETRY_TYPE[GEOMETRY_TYPE[\"MULTIPOLYGON\"] = 5] = \"MULTIPOLYGON\";\n})(GEOMETRY_TYPE || (GEOMETRY_TYPE = {}));\nexport var SINGLE_PART_GEOMETRY_TYPE;\n(function (SINGLE_PART_GEOMETRY_TYPE) {\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"POINT\"] = 0] = \"POINT\";\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"LINESTRING\"] = 1] = \"LINESTRING\";\n    SINGLE_PART_GEOMETRY_TYPE[SINGLE_PART_GEOMETRY_TYPE[\"POLYGON\"] = 2] = \"POLYGON\";\n})(SINGLE_PART_GEOMETRY_TYPE || (SINGLE_PART_GEOMETRY_TYPE = {}));\n//# sourceMappingURL=geometryType.js.map","export var VertexBufferType;\n(function (VertexBufferType) {\n    VertexBufferType[VertexBufferType[\"MORTON\"] = 0] = \"MORTON\";\n    VertexBufferType[VertexBufferType[\"VEC_2\"] = 1] = \"VEC_2\";\n    VertexBufferType[VertexBufferType[\"VEC_3\"] = 2] = \"VEC_3\";\n})(VertexBufferType || (VertexBufferType = {}));\n//# sourceMappingURL=vertexBufferType.js.map","import {StyleLayer} from '../style_layer';\n\nimport properties, {type RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g';\nimport {type Transitionable, type Transitioning, type PossiblyEvaluated} from '../properties';\n\nimport type {RasterPaintProps} from './raster_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport const isRasterStyleLayer = (layer: StyleLayer): layer is RasterStyleLayer => layer.type === 'raster';\n\nexport class RasterStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<RasterPaintProps>;\n    _transitioningPaint: Transitioning<RasterPaintProps>;\n    paint: PossiblyEvaluated<RasterPaintProps, RasterPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification, globalState: Record<string, any>) {\n        super(layer, properties, globalState);\n    }\n}\n","import {StyleLayer} from '../style_layer';\nimport type {Map} from '../../ui/map';\nimport {type mat4} from 'gl-matrix';\nimport {type LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {ProjectionData} from '../../geo/projection/projection_data';\n\n/**\n* Input arguments exposed by custom render function.\n*/\nexport type CustomRenderMethodInput = {\n    /**\n     * This value represents the distance from the camera to the far clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * farZ should be larger than nearZ.\n     */\n    farZ: number;\n    /**\n     * This value represents the distance from the camera to the near clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * nearZ should be smaller than farZ.\n     */\n    nearZ: number;\n    /**\n     * Vertical field of view in radians.\n     */\n    fov: number;\n    /**\n    * model view projection matrix\n    * represents the matrix converting from world space to clip space\n    * https://learnopengl.com/Getting-started/Coordinate-Systems\n    * **/\n    modelViewProjectionMatrix: mat4;\n    /**\n    * projection matrix\n    * represents the matrix converting from view space to clip space\n    * https://learnopengl.com/Getting-started/Coordinate-Systems\n    */\n    projectionMatrix: mat4;\n    /**\n     * Data required for picking and compiling a custom shader for the current projection.\n     */\n    shaderData: {\n        /**\n         * Name of the shader variant that should be used.\n         * Depends on current projection.\n         * Whenever the other shader properties change, this string changes as well,\n         * and can be used as a key with which to cache compiled shaders.\n         */\n        variantName: string;\n        /**\n         * The prelude code to add to the vertex shader to access MapLibre's `projectTile` projection function.\n         * Depends on current projection.\n         * @example\n         * ```\n         * const vertexSource = `#version 300 es\n         * ${shaderData.vertexShaderPrelude}\n         * ${shaderData.define}\n         * in vec2 a_pos;\n         * void main() {\n         *     gl_Position = projectTile(a_pos);\n         * }`;\n         * ```\n         */\n        vertexShaderPrelude: string;\n        /**\n         * Defines to add to the shader code.\n         * Depends on current projection.\n         * @example\n         * ```\n         * const vertexSource = `#version 300 es\n         * ${shaderData.vertexShaderPrelude}\n         * ${shaderData.define}\n         * in vec2 a_pos;\n         * void main() {\n         *     gl_Position = projectTile(a_pos);\n         *     #ifdef GLOBE\n         *     // Do globe-specific things\n         *     #endif\n         * }`;\n         * ```\n         */\n        define: string;\n    };\n    /**\n     * Uniforms that should be passed to the vertex shader, if MapLibre's projection code is used.\n     * For more details of this object's internals, see its doc comments in `src/geo/projection/projection_data.ts`.\n     *\n     * These uniforms are set so that `projectTile` in shader accepts a vec2 in range 0..1 in web mercator coordinates.\n     * Use `map.transform.getProjectionData({overscaledTileID: tileID})` to get uniforms for a given tile and pass vec2 in tile-local range 0..EXTENT instead.\n     *\n     * For projection 3D features, use `projectTileFor3D` in the shader.\n     *\n     * If you just need a projection matrix, use `defaultProjectionData.projectionMatrix`.\n     * A projection matrix is sufficient for simple custom layers that also only support mercator projection.\n     *\n     * Under mercator projection, when these uniforms are used, the shader's `projectTile` function projects spherical mercator\n     * coordinates to gl clip space coordinates. The spherical mercator coordinate `[0, 0]` represents the\n     * top left corner of the mercator world and `[1, 1]` represents the bottom right corner. When\n     * the `renderingMode` is `\"3d\"`, the z coordinate is conformal. A box with identical x, y, and z\n     * lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate.fromLngLat}\n     * can be used to project a `LngLat` to a mercator coordinate.\n     *\n     * Under globe projection, when these uniforms are used, the `elevation` parameter\n     * passed to `projectTileFor3D` in the shader is elevation in meters above \"sea level\",\n     * or more accurately for globe, elevation above the surface of the perfect sphere used to render the planet.\n     */\n    defaultProjectionData: ProjectionData;\n};\n\n/**\n * @param gl - The map's gl context.\n * @param options - Argument object with render inputs like camera properties.\n */\nexport type CustomRenderMethod = (gl: WebGLRenderingContext|WebGL2RenderingContext, options: CustomRenderMethodInput) => void;\n\n/**\n * Interface for custom style layers. This is a specification for\n * implementers to model: it is not an exported method or class.\n *\n * Custom layers allow a user to render directly into the map's GL context using the map's camera.\n * These layers can be added between any regular layers using {@link Map.addLayer}.\n *\n * Custom layers must have a unique `id` and must have the `type` of `\"custom\"`.\n * They must implement `render` and may implement `prerender`, `onAdd` and `onRemove`.\n * They can trigger rendering using {@link Map.triggerRepaint}\n * and they should appropriately handle {@link MapContextEvent} with `webglcontextlost` and `webglcontextrestored`.\n *\n * The `renderingMode` property controls whether the layer is treated as a `\"2d\"` or `\"3d\"` map layer. Use:\n *\n * - `\"renderingMode\": \"3d\"` to use the depth buffer and share it with other layers\n * - `\"renderingMode\": \"2d\"` to add a layer with no depth. If you need to use the depth buffer for a `\"2d\"` layer you must use an offscreen\n *   framebuffer and {@link CustomLayerInterface.prerender}\n *\n * @example\n * Custom layer implemented as ES6 class\n * ```ts\n * class NullIslandLayer {\n *     constructor() {\n *         this.id = 'null-island';\n *         this.type = 'custom';\n *         this.renderingMode = '2d';\n *     }\n *\n *      onAdd(map: maplibregl.Map, gl: WebGLRenderingContext | WebGL2RenderingContext) {\n *         const vertexSource = `\n *         uniform mat4 u_matrix;\n *         void main() {\n *             gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);\n *             gl_PointSize = 20.0;\n *         }`;\n *\n *         const fragmentSource = `\n *         void main() {\n *             fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n *         }`;\n *\n *         const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n *         gl.shaderSource(vertexShader, vertexSource);\n *         gl.compileShader(vertexShader);\n *         const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n *         gl.shaderSource(fragmentShader, fragmentSource);\n *         gl.compileShader(fragmentShader);\n *\n *         this.program = gl.createProgram();\n *         gl.attachShader(this.program, vertexShader);\n *         gl.attachShader(this.program, fragmentShader);\n *         gl.linkProgram(this.program);\n *     }\n *\n *     render({\n *      gl,\n *      modelViewProjectionMatrix: matrix\n *      }: {\n *      gl: WebGLRenderingContext | WebGL2RenderingContext;\n *      modelViewProjectionMatrix: Float32Array;\n *      }) {\n *         gl.useProgram(this.program);\n *         gl.uniformMatrix4fv(gl.getUniformLocation(this.program, \"u_matrix\"), false, matrix);\n *         gl.drawArrays(gl.POINTS, 0, 1);\n *     }\n * }\n *\n * map.on('load', () => {\n *     map.addLayer(new NullIslandLayer());\n * });\n * ```\n */\nexport interface CustomLayerInterface {\n    /**\n     * A unique layer id.\n     */\n    id: string;\n    /**\n     * The layer's type. Must be `\"custom\"`.\n     */\n    type: 'custom';\n    /**\n     * Either `\"2d\"` or `\"3d\"`. Defaults to `\"2d\"`.\n     */\n    renderingMode?: '2d' | '3d';\n    /**\n     * Called during a render frame allowing the layer to draw into the GL context.\n     *\n     * The layer can assume blending and depth state is set to allow the layer to properly\n     * blend and clip other layers. The layer cannot make any other assumptions about the\n     * current GL state.\n     *\n     * If the layer needs to render to a texture, it should implement the `prerender` method\n     * to do this and only use the `render` method for drawing directly into the main framebuffer.\n     *\n     * The blend function is set to `gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`. This expects\n     * colors to be provided in premultiplied alpha form where the `r`, `g` and `b` values are already\n     * multiplied by the `a` value. If you are unable to provide colors in premultiplied form you\n     * may want to change the blend function to\n     * `gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`.\n     */\n    render: CustomRenderMethod;\n    /**\n     * Optional method called during a render frame to allow a layer to prepare resources or render into a texture.\n     *\n     * The layer cannot make any assumptions about the current GL state and must bind a framebuffer before rendering.\n     */\n    prerender?: CustomRenderMethod;\n    /**\n     * Optional method called when the layer has been added to the Map with {@link Map.addLayer}. This\n     * gives the layer a chance to initialize gl resources and register event listeners.\n     *\n     * @param map - The Map this custom layer was just added to.\n     * @param gl - The gl context for the map.\n     */\n    onAdd?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;\n    /**\n     * Optional method called when the layer has been removed from the Map with {@link Map.removeLayer}. This\n     * gives the layer a chance to clean up gl resources and event listeners.\n     *\n     * @param map - The Map this custom layer was just added to.\n     * @param gl - The gl context for the map.\n     */\n    onRemove?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;\n}\n\nexport function validateCustomStyleLayer(layerObject: CustomLayerInterface) {\n    const errors = [];\n    const id = layerObject.id;\n\n    if (id === undefined) {\n        errors.push({\n            message: `layers.${id}: missing required property \"id\"`\n        });\n    }\n\n    if (layerObject.render === undefined) {\n        errors.push({\n            message: `layers.${id}: missing required method \"render\"`\n        });\n    }\n\n    if (layerObject.renderingMode &&\n        layerObject.renderingMode !== '2d' &&\n        layerObject.renderingMode !== '3d') {\n        errors.push({\n            message: `layers.${id}: property \"renderingMode\" must be either \"2d\" or \"3d\"`\n        });\n    }\n\n    return errors;\n}\n\nexport const isCustomStyleLayer = (layer: StyleLayer): layer is CustomStyleLayer => layer.type === 'custom';\n\nexport class CustomStyleLayer extends StyleLayer {\n\n    implementation: CustomLayerInterface;\n\n    constructor(implementation: CustomLayerInterface, globalState: Record<string, any>) {\n        super(implementation, {}, globalState);\n        this.implementation = implementation;\n    }\n\n    is3D() {\n        return this.implementation.renderingMode === '3d';\n    }\n\n    hasOffscreenPass() {\n        return this.implementation.prerender !== undefined;\n    }\n\n    recalculate() {}\n    updateTransitions() {}\n    hasTransition() { return false; }\n\n    serialize(): LayerSpecification {\n        throw new Error('Custom layers cannot be serialized');\n    }\n\n    onAdd = (map: Map) => {\n        if (this.implementation.onAdd) {\n            this.implementation.onAdd(map, map.painter.context.gl);\n        }\n    };\n\n    onRemove = (map: Map) => {\n        if (this.implementation.onRemove) {\n            this.implementation.onRemove(map, map.painter.context.gl);\n        }\n    };\n}\n","import {CircleStyleLayer} from './style_layer/circle_style_layer';\nimport {HeatmapStyleLayer} from './style_layer/heatmap_style_layer';\nimport {HillshadeStyleLayer} from './style_layer/hillshade_style_layer';\nimport {ColorReliefStyleLayer} from './style_layer/color_relief_style_layer';\nimport {FillStyleLayer} from './style_layer/fill_style_layer';\nimport {FillExtrusionStyleLayer} from './style_layer/fill_extrusion_style_layer';\nimport {LineStyleLayer} from './style_layer/line_style_layer';\nimport {SymbolStyleLayer} from './style_layer/symbol_style_layer';\nimport {BackgroundStyleLayer} from './style_layer/background_style_layer';\nimport {RasterStyleLayer} from './style_layer/raster_style_layer';\nimport {CustomStyleLayer, type CustomLayerInterface} from './style_layer/custom_style_layer';\n\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport function createStyleLayer(layer: LayerSpecification | CustomLayerInterface, globalState: Record<string, any>) {\n    if (layer.type === 'custom') {\n        return new CustomStyleLayer(layer, globalState);\n    }\n    switch (layer.type) {\n        case 'background':\n            return new BackgroundStyleLayer(layer, globalState);\n        case 'circle':\n            return new CircleStyleLayer(layer, globalState);\n        case 'color-relief':\n            return new ColorReliefStyleLayer(layer, globalState);\n        case 'fill':\n            return new FillStyleLayer(layer, globalState);\n        case 'fill-extrusion':\n            return new FillExtrusionStyleLayer(layer, globalState);\n        case 'heatmap':\n            return new HeatmapStyleLayer(layer, globalState);\n        case 'hillshade':\n            return new HillshadeStyleLayer(layer, globalState);\n        case 'line':\n            return new LineStyleLayer(layer, globalState);\n        case 'raster':\n            return new RasterStyleLayer(layer, globalState);\n        case 'symbol':\n            return new SymbolStyleLayer(layer, globalState);\n    }\n}\n\n","export class DictionaryCoder {\n    _stringToNumber: {[_: string]: number};\n    _numberToString: Array<string>;\n\n    constructor(strings: Array<string>) {\n        this._stringToNumber = {};\n        this._numberToString = [];\n        for (let i = 0; i < strings.length; i++) {\n            const string = strings[i];\n            this._stringToNumber[string] = i;\n            this._numberToString[i] = string;\n        }\n    }\n\n    encode(string: string) {\n        return this._stringToNumber[string];\n    }\n\n    decode(n: number) {\n        if (n >= this._numberToString.length) throw new Error(`Out of bounds. Index requested n=${n} can't be >= this._numberToString.length ${this._numberToString.length}`);\n        return this._numberToString[n];\n    }\n}\n","import type Point from '@mapbox/point-geometry';\nimport {classifyRings} from '@mapbox/vector-tile';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike} from '@maplibre/vt-pbf';\n\n/**\n * A helper for type to omit a property from a type\n */\nexport type DistributiveKeys<T> = T extends T ? keyof T : never;\n/**\n * A helper for type to omit a property from a type\n */\nexport type DistributiveOmit<T, K extends DistributiveKeys<T>> = T extends unknown\n    ? Omit<T, K>\n    : never;\n\n/**\n * An extended geojson feature used by the events to return data to the listener\n */\nexport type MapGeoJSONFeature = GeoJSONFeature & {\n    layer: DistributiveOmit<LayerSpecification, 'source'> & {source: string};\n    source: string;\n    sourceLayer?: string;\n    state: { [key: string]: any };\n};\n\n/**\n * A geojson feature\n */\nexport class GeoJSONFeature {\n    type: 'Feature';\n    _geometry: GeoJSON.Geometry;\n    properties: { [name: string]: any };\n    id: number | string | undefined;\n    _x: number;\n    _y: number;\n    _z: number;\n\n    _vectorTileFeature: VectorTileFeatureLike;\n\n    constructor(vectorTileFeature: VectorTileFeatureLike, z: number, x: number, y: number, id: string | number | undefined) {\n        this.type = 'Feature';\n        this._vectorTileFeature = vectorTileFeature;\n        this._x = x;\n        this._y = y;\n        this._z = z;\n\n        this.properties = vectorTileFeature.properties;\n        this.id = id;\n    }\n\n    private projectPoint(p: Point, x0: number, y0: number, size: number): [number, number] {\n        return [\n            (p.x + x0) * 360 / size - 180,\n            360 / Math.PI * Math.atan(Math.exp((1 - (p.y + y0) * 2 / size) * Math.PI)) - 90\n        ];\n    }\n\n    private projectLine(line: Point[], x0: number, y0: number, size: number) {\n        return line.map(p => this.projectPoint(p, x0, y0, size));\n    }\n\n    get geometry(): GeoJSON.Geometry {\n        if (this._geometry) return this._geometry;\n\n        const feature = this._vectorTileFeature;\n\n        // Copied from https://github.com/mapbox/vector-tile-js/blob/f1457ee47d0a261e6246d68c959fbd12bf56aeeb/index.js\n        const size = feature.extent * Math.pow(2, this._z);\n        const x0 = feature.extent * this._x;\n        const y0 = feature.extent * this._y;\n        const vtCoords = feature.loadGeometry();\n\n        switch (feature.type) {\n            case 1: {\n                const points = [];\n                for (const line of vtCoords) {\n                    points.push(line[0]);\n                }\n                const coordinates = this.projectLine(points, x0, y0, size);\n                this._geometry = points.length === 1 ?\n                    {type: 'Point', coordinates: coordinates[0]} :\n                    {type: 'MultiPoint', coordinates};\n                break;\n            }\n            case 2: {\n                const coordinates = vtCoords.map(coord => this.projectLine(coord, x0, y0, size));\n                this._geometry = coordinates.length === 1 ?\n                    {type: 'LineString', coordinates: coordinates[0]} :\n                    {type: 'MultiLineString', coordinates};\n                break;\n            }\n            case 3: {\n                const polygons = classifyRings(vtCoords);\n                const coordinates = [];\n                for (const polygon of polygons) {\n                    coordinates.push(polygon.map(coord => this.projectLine(coord, x0, y0, size)));\n                }\n                this._geometry = coordinates.length === 1 ?\n                    {type: 'Polygon', coordinates: coordinates[0]} :\n                    {type: 'MultiPolygon', coordinates};\n                break;\n            }\n            default:\n                throw new Error(`unknown feature type: ${feature.type}`);\n        }\n\n        return this._geometry;\n    }\n\n    set geometry(g: GeoJSON.Geometry) {\n        this._geometry = g;\n    }\n\n    toJSON() {\n        const json: any = {\n            geometry: this.geometry\n        };\n        for (const i in this) {\n            if (i === '_geometry' || i === '_vectorTileFeature' || i === '_x' || i === '_y' || i === '_z') continue;\n            json[i] = (this)[i];\n        }\n        return json;\n    }\n}\n","export default class Vector {\n    _name;\n    dataBuffer;\n    nullabilityBuffer;\n    _size;\n    constructor(_name, dataBuffer, sizeOrNullabilityBuffer) {\n        this._name = _name;\n        this.dataBuffer = dataBuffer;\n        if (typeof sizeOrNullabilityBuffer === \"number\") {\n            this._size = sizeOrNullabilityBuffer;\n        }\n        else {\n            this.nullabilityBuffer = sizeOrNullabilityBuffer;\n            this._size = sizeOrNullabilityBuffer.size();\n        }\n    }\n    getValue(index) {\n        return this.nullabilityBuffer && !this.nullabilityBuffer.get(index) ? null : this.getValueFromBuffer(index);\n    }\n    has(index) {\n        return (this.nullabilityBuffer && this.nullabilityBuffer.get(index)) || !this.nullabilityBuffer;\n    }\n    get name() {\n        return this._name;\n    }\n    get size() {\n        return this._size;\n    }\n}\n//# sourceMappingURL=vector.js.map","import Vector from \"./vector\";\nexport class FixedSizeVector extends Vector {\n}\n//# sourceMappingURL=fixedSizeVector.js.map","import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class IntFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=intFlatVector.js.map","import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class DoubleFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=doubleFlatVector.js.map","import Vector from \"../vector\";\nexport class SequenceVector extends Vector {\n    delta;\n    constructor(name, baseValueBuffer, delta, size) {\n        super(name, baseValueBuffer, size);\n        this.delta = delta;\n    }\n}\n//# sourceMappingURL=sequenceVector.js.map","import { SequenceVector } from \"./sequenceVector\";\nexport class IntSequenceVector extends SequenceVector {\n    constructor(name, baseValue, delta, size) {\n        super(name, Int32Array.of(baseValue), delta, size);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0] + index * this.delta;\n    }\n}\n//# sourceMappingURL=intSequenceVector.js.map","import Vector from \"../vector\";\nexport class IntConstVector extends Vector {\n    constructor(name, value, sizeOrNullabilityBuffer) {\n        super(name, Int32Array.of(value), sizeOrNullabilityBuffer);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0];\n    }\n}\n//# sourceMappingURL=intConstVector.js.map","import { IntFlatVector } from \"./flat/intFlatVector\";\nimport { DoubleFlatVector } from \"./flat/doubleFlatVector\";\nimport { IntSequenceVector } from \"./sequence/intSequenceVector\";\nimport { IntConstVector } from \"./constant/intConstVector\";\nexport default class FeatureTable {\n    _name;\n    _geometryVector;\n    _idVector;\n    _propertyVectors;\n    _extent;\n    propertyVectorsMap;\n    constructor(_name, _geometryVector, _idVector, _propertyVectors, _extent = 4096) {\n        this._name = _name;\n        this._geometryVector = _geometryVector;\n        this._idVector = _idVector;\n        this._propertyVectors = _propertyVectors;\n        this._extent = _extent;\n    }\n    get name() {\n        return this._name;\n    }\n    get idVector() {\n        return this._idVector;\n    }\n    get geometryVector() {\n        return this._geometryVector;\n    }\n    get propertyVectors() {\n        return this._propertyVectors;\n    }\n    getPropertyVector(name) {\n        if (!this.propertyVectorsMap) {\n            this.propertyVectorsMap = new Map(this._propertyVectors.map((vector) => [vector.name, vector]));\n        }\n        return this.propertyVectorsMap.get(name);\n    }\n    *[Symbol.iterator]() {\n        const geometryIterator = this.geometryVector[Symbol.iterator]();\n        let index = 0;\n        while (index < this.numFeatures) {\n            let id;\n            if (this.idVector) {\n                id = this.containsMaxSaveIntegerValues(this.idVector)\n                    ? Number(this.idVector.getValue(index))\n                    : this.idVector.getValue(index);\n            }\n            const geometry = geometryIterator?.next().value;\n            const properties = {};\n            for (const propertyColumn of this.propertyVectors) {\n                if (!propertyColumn) {\n                    continue;\n                }\n                const columnName = propertyColumn.name;\n                const propertyValue = propertyColumn.getValue(index);\n                if (propertyValue !== null) {\n                    properties[columnName] = propertyValue;\n                }\n            }\n            index++;\n            yield { id, geometry, properties };\n        }\n    }\n    get numFeatures() {\n        return this.geometryVector.numGeometries;\n    }\n    get extent() {\n        return this._extent;\n    }\n    /**\n     * Returns all features as an array\n     */\n    getFeatures() {\n        const features = [];\n        const geometries = this.geometryVector.getGeometries();\n        for (let i = 0; i < this.numFeatures; i++) {\n            let id;\n            if (this.idVector) {\n                id = this.containsMaxSaveIntegerValues(this.idVector)\n                    ? Number(this.idVector.getValue(i))\n                    : this.idVector.getValue(i);\n            }\n            const geometry = {\n                coordinates: geometries[i],\n                type: this.geometryVector.geometryType(i),\n            };\n            const properties = {};\n            for (const propertyColumn of this.propertyVectors) {\n                if (!propertyColumn)\n                    continue;\n                const columnName = propertyColumn.name;\n                const propertyValue = propertyColumn.getValue(i);\n                if (propertyValue !== null) {\n                    properties[columnName] = propertyValue;\n                }\n            }\n            features.push({ id, geometry, properties });\n        }\n        return features;\n    }\n    containsMaxSaveIntegerValues(intVector) {\n        return (intVector instanceof IntFlatVector ||\n            (intVector instanceof IntConstVector && intVector instanceof IntSequenceVector) ||\n            intVector instanceof DoubleFlatVector);\n    }\n}\n//# sourceMappingURL=featureTable.js.map","// Ported from https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/IntWrapper.java\nexport default class IntWrapper {\n    value;\n    constructor(value) {\n        this.value = value;\n    }\n    get() {\n        return this.value;\n    }\n    set(v) {\n        this.value = v;\n    }\n    increment() {\n        return this.value++;\n    }\n    add(v) {\n        this.value += v;\n    }\n}\n//# sourceMappingURL=intWrapper.js.map","/* Null suppression (physical level) techniques ------------------------------------------------------------------*/\n//based on https://github.com/mapbox/pbf/blob/main/index.js\nexport function decodeVarintInt32(buf, bufferOffset, numValues) {\n    const dst = new Int32Array(numValues);\n    let dstOffset = 0;\n    let offset = bufferOffset.get();\n    for (let i = 0; i < dst.length; i++) {\n        let b = buf[offset++];\n        let val = b & 0x7f;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 7;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 14;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x7f) << 21;\n        if (b < 0x80) {\n            dst[dstOffset++] = val;\n            continue;\n        }\n        b = buf[offset++];\n        val |= (b & 0x0f) << 28;\n        dst[dstOffset++] = val;\n    }\n    bufferOffset.set(offset);\n    return dst;\n}\nexport function decodeVarintInt64(src, offset, numValues) {\n    const dst = new BigInt64Array(numValues);\n    for (let i = 0; i < dst.length; i++) {\n        dst[i] = decodeSingleVarintInt64(src, offset);\n    }\n    return dst;\n}\n/* Since decoding Int64 values to BigInt is more than an order of magnitude slower in the tests\n *  then using a Float64, this decoding method limits the max size of a Long value to 53 bits   */\nexport function decodeVarintFloat64(src, numValues, offset) {\n    const dst = new Float64Array(numValues);\n    for (let i = 0; i < numValues; i++) {\n        dst[i] = decodeSingleVarintFloat64(src, offset);\n    }\n    return dst;\n}\n//based on https://github.com/mapbox/pbf/blob/main/index.js\nfunction decodeSingleVarintFloat64(buf, offset) {\n    let val, b;\n    b = buf[offset.get()];\n    offset.increment();\n    val = b & 0x7f;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 7;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 14;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    offset.increment();\n    val |= (b & 0x7f) << 21;\n    if (b < 0x80)\n        return val;\n    b = buf[offset.get()];\n    val |= (b & 0x0f) << 28;\n    return decodeVarintRemainder(val, buf, offset);\n}\nfunction decodeVarintRemainder(l, buf, offset) {\n    let h, b;\n    b = buf[offset.get()];\n    offset.increment();\n    h = (b & 0x70) >> 4;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 3;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 10;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 17;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x7f) << 24;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    b = buf[offset.get()];\n    offset.increment();\n    h |= (b & 0x01) << 31;\n    if (b < 0x80)\n        return h * 0x100000000 + (l >>> 0);\n    throw new Error(\"Expected varint not more than 10 bytes\");\n}\nexport function decodeFastPfor(data, numValues, byteLength, offset) {\n    throw new Error(\"FastPFor is not implemented yet.\");\n}\nexport function decodeZigZag(encodedData) {\n    for (let i = 0; i < encodedData.length; i++) {\n        const encoded = encodedData[i];\n        encodedData[i] = (encoded >>> 1) ^ -(encoded & 1);\n    }\n}\nexport function decodeZigZagInt64(encodedData) {\n    for (let i = 0; i < encodedData.length; i++) {\n        const encoded = encodedData[i];\n        encodedData[i] = (encoded >> 1n) ^ -(encoded & 1n);\n    }\n}\nexport function decodeZigZagFloat64(encodedData) {\n    for (let i = 0; i < encodedData.length; i++) {\n        const encoded = encodedData[i];\n        //Get rid of branch? -> var v = encoded % 2 && 1; encodedData[i] = (encoded + v) / (v * 2 - 1) * 2;\n        encodedData[i] = encoded % 2 === 1 ? (encoded + 1) / -2 : encoded / 2;\n    }\n}\nexport function decodeZigZagValue(encoded) {\n    return (encoded >>> 1) ^ -(encoded & 1);\n}\nexport function decodeZigZagValueInt64(encoded) {\n    return (encoded >> 1n) ^ -(encoded & 1n);\n}\n// Source: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/util/VarInt.java\nfunction decodeSingleVarintInt64(bytes, pos) {\n    let value = 0n;\n    let shift = 0;\n    let index = pos.get();\n    while (index < bytes.length) {\n        const b = bytes[index++];\n        value |= BigInt(b & 0x7f) << BigInt(shift);\n        if ((b & 0x80) === 0) {\n            break;\n        }\n        shift += 7;\n        if (shift >= 64) {\n            throw new Error(\"Varint too long\");\n        }\n    }\n    pos.set(index);\n    return value;\n}\n/* Logical Level Techniques Flat Vectors ------------------------------------------------------------------ */\nexport function decodeRle(data, streamMetadata, isSigned) {\n    return isSigned\n        ? decodeZigZagRle(data, streamMetadata.runs, streamMetadata.numRleValues)\n        : decodeUnsignedRle(data, streamMetadata.runs, streamMetadata.numRleValues);\n}\nexport function decodeRleInt64(data, streamMetadata, isSigned) {\n    return isSigned\n        ? decodeZigZagRleInt64(data, streamMetadata.runs, streamMetadata.numRleValues)\n        : decodeUnsignedRleInt64(data, streamMetadata.runs, streamMetadata.numRleValues);\n}\nexport function decodeRleFloat64(data, streamMetadata, isSigned) {\n    return isSigned\n        ? decodeZigZagRleFloat64(data, streamMetadata.runs, streamMetadata.numRleValues)\n        : decodeUnsignedRleFloat64(data, streamMetadata.runs, streamMetadata.numRleValues);\n}\nexport function decodeUnsignedRle(encodedData, numRuns, numTotalValues) {\n    const decodedValues = new Int32Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = encodedData[i];\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedRleInt64(encodedData, numRuns, numTotalValues) {\n    const decodedValues = new BigInt64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(encodedData[i]);\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeUnsignedRleFloat64(encodedData, numRuns, numTotalValues) {\n    const decodedValues = new Float64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = encodedData[i];\n        const value = encodedData[i + numRuns];\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\n/*\n * In place decoding of the zigzag encoded delta values.\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function decodeZigZagDelta(data) {\n    data[0] = (data[0] >>> 1) ^ -(data[0] & 1);\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            data[i] = ((data1 >>> 1) ^ -(data1 & 1)) + data[i - 1];\n            data[i + 1] = ((data2 >>> 1) ^ -(data2 & 1)) + data[i];\n            data[i + 2] = ((data3 >>> 1) ^ -(data3 & 1)) + data[i + 1];\n            data[i + 3] = ((data4 >>> 1) ^ -(data4 & 1)) + data[i + 2];\n        }\n    }\n    for (; i != data.length; ++i) {\n        data[i] = ((data[i] >>> 1) ^ -(data[i] & 1)) + data[i - 1];\n    }\n}\nexport function decodeZigZagDeltaInt64(data) {\n    data[0] = (data[0] >> 1n) ^ -(data[0] & 1n);\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            data[i] = ((data1 >> 1n) ^ -(data1 & 1n)) + data[i - 1];\n            data[i + 1] = ((data2 >> 1n) ^ -(data2 & 1n)) + data[i];\n            data[i + 2] = ((data3 >> 1n) ^ -(data3 & 1n)) + data[i + 1];\n            data[i + 3] = ((data4 >> 1n) ^ -(data4 & 1n)) + data[i + 2];\n        }\n    }\n    for (; i != data.length; ++i) {\n        data[i] = ((data[i] >> 1n) ^ -(data[i] & 1n)) + data[i - 1];\n    }\n}\nexport function decodeZigZagDeltaFloat64(data) {\n    data[0] = data[0] % 2 === 1 ? (data[0] + 1) / -2 : data[0] / 2;\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const data1 = data[i];\n            const data2 = data[i + 1];\n            const data3 = data[i + 2];\n            const data4 = data[i + 3];\n            data[i] = (data1 % 2 === 1 ? (data1 + 1) / -2 : data1 / 2) + data[i - 1];\n            data[i + 1] = (data2 % 2 === 1 ? (data2 + 1) / -2 : data2 / 2) + data[i];\n            data[i + 2] = (data3 % 2 === 1 ? (data3 + 1) / -2 : data3 / 2) + data[i + 1];\n            data[i + 3] = (data4 % 2 === 1 ? (data4 + 1) / -2 : data4 / 2) + data[i + 2];\n        }\n    }\n    for (; i != data.length; ++i) {\n        data[i] = (data[i] % 2 === 1 ? (data[i] + 1) / -2 : data[i] / 2) + data[i - 1];\n    }\n}\nexport function decodeZigZagRle(data, numRuns, numTotalValues) {\n    const decodedValues = new Int32Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = (value >>> 1) ^ -(value & 1);\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeZigZagRleInt64(data, numRuns, numTotalValues) {\n    const decodedValues = new BigInt64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        let value = data[i + numRuns];\n        value = (value >> 1n) ^ -(value & 1n);\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function decodeZigZagRleFloat64(data, numRuns, numTotalValues) {\n    const decodedValues = new Float64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        //TODO: get rid of branch? -> var v = value % 2 && 1; a = (value + v) / (v * 2 - 1) * 2;\n        value = value % 2 === 1 ? (value + 1) / -2 : value / 2;\n        decodedValues.fill(value, offset, offset + runLength);\n        offset += runLength;\n    }\n    return decodedValues;\n}\n/*\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function fastInverseDelta(data) {\n    const sz0 = (data.length / 4) * 4;\n    let i = 1;\n    if (sz0 >= 4) {\n        for (let a = data[0]; i < sz0 - 4; i += 4) {\n            a = data[i] += a;\n            a = data[i + 1] += a;\n            a = data[i + 2] += a;\n            a = data[i + 3] += a;\n        }\n    }\n    while (i != data.length) {\n        data[i] += data[i - 1];\n        ++i;\n    }\n}\nexport function inverseDelta(data) {\n    let prevValue = 0;\n    for (let i = 0; i < data.length; i++) {\n        data[i] += prevValue;\n        prevValue = data[i];\n    }\n}\n/*\n * In place decoding of the zigzag delta encoded Vec2.\n * Inspired by https://github.com/lemire/JavaFastPFOR/blob/master/src/main/java/me/lemire/integercompression/differential/Delta.java\n */\nexport function decodeComponentwiseDeltaVec2(data) {\n    data[0] = (data[0] >>> 1) ^ -(data[0] & 1);\n    data[1] = (data[1] >>> 1) ^ -(data[1] & 1);\n    const sz0 = (data.length / 4) * 4;\n    let i = 2;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const x1 = data[i];\n            const y1 = data[i + 1];\n            const x2 = data[i + 2];\n            const y2 = data[i + 3];\n            data[i] = ((x1 >>> 1) ^ -(x1 & 1)) + data[i - 2];\n            data[i + 1] = ((y1 >>> 1) ^ -(y1 & 1)) + data[i - 1];\n            data[i + 2] = ((x2 >>> 1) ^ -(x2 & 1)) + data[i];\n            data[i + 3] = ((y2 >>> 1) ^ -(y2 & 1)) + data[i + 1];\n        }\n    }\n    for (; i != data.length; i += 2) {\n        data[i] = ((data[i] >>> 1) ^ -(data[i] & 1)) + data[i - 2];\n        data[i + 1] = ((data[i + 1] >>> 1) ^ -(data[i + 1] & 1)) + data[i - 1];\n    }\n}\nexport function decodeComponentwiseDeltaVec2Scaled(data, scale, min, max) {\n    let previousVertexX = (data[0] >>> 1) ^ -(data[0] & 1);\n    let previousVertexY = (data[1] >>> 1) ^ -(data[1] & 1);\n    data[0] = clamp(Math.round(previousVertexX * scale), min, max);\n    data[1] = clamp(Math.round(previousVertexY * scale), min, max);\n    const sz0 = data.length / 16;\n    let i = 2;\n    if (sz0 >= 4) {\n        for (; i < sz0 - 4; i += 4) {\n            const x1 = data[i];\n            const y1 = data[i + 1];\n            const currentVertexX = ((x1 >>> 1) ^ -(x1 & 1)) + previousVertexX;\n            const currentVertexY = ((y1 >>> 1) ^ -(y1 & 1)) + previousVertexY;\n            data[i] = clamp(Math.round(currentVertexX * scale), min, max);\n            data[i + 1] = clamp(Math.round(currentVertexY * scale), min, max);\n            const x2 = data[i + 2];\n            const y2 = data[i + 3];\n            previousVertexX = ((x2 >>> 1) ^ -(x2 & 1)) + currentVertexX;\n            previousVertexY = ((y2 >>> 1) ^ -(y2 & 1)) + currentVertexY;\n            data[i + 2] = clamp(Math.round(previousVertexX * scale), min, max);\n            data[i + 3] = clamp(Math.round(previousVertexY * scale), min, max);\n        }\n    }\n    for (; i != data.length; i += 2) {\n        previousVertexX += (data[i] >>> 1) ^ -(data[i] & 1);\n        previousVertexY += (data[i + 1] >>> 1) ^ -(data[i + 1] & 1);\n        data[i] = clamp(Math.round(previousVertexX * scale), min, max);\n        data[i + 1] = clamp(Math.round(previousVertexY * scale), min, max);\n    }\n}\nfunction clamp(n, min, max) {\n    return Math.min(max, Math.max(min, n));\n}\nexport function decodeNullableZigZagDelta(bitVector, data) {\n    const decodedData = new Int32Array(bitVector.size());\n    let dataCounter = 0;\n    if (bitVector.get(0)) {\n        decodedData[0] = bitVector.get(0) ? (data[0] >>> 1) ^ -(data[0] & 1) : 0;\n        dataCounter = 1;\n    }\n    else {\n        decodedData[0] = 0;\n    }\n    let i = 1;\n    for (; i != decodedData.length; ++i) {\n        decodedData[i] = bitVector.get(i)\n            ? decodedData[i - 1] + ((data[dataCounter] >>> 1) ^ -(data[dataCounter++] & 1))\n            : decodedData[i - 1];\n    }\n    return decodedData;\n}\nexport function decodeNullableZigZagDeltaInt64(bitVector, data) {\n    const decodedData = new BigInt64Array(bitVector.size());\n    let dataCounter = 0;\n    if (bitVector.get(0)) {\n        decodedData[0] = bitVector.get(0) ? (data[0] >> 1n) ^ -(data[0] & 1n) : 0n;\n        dataCounter = 1;\n    }\n    else {\n        decodedData[0] = 0n;\n    }\n    let i = 1;\n    for (; i != decodedData.length; ++i) {\n        decodedData[i] = bitVector.get(i)\n            ? decodedData[i - 1] + ((data[dataCounter] >> 1n) ^ -(data[dataCounter++] & 1n))\n            : decodedData[i - 1];\n    }\n    return decodedData;\n}\n/* Transform data to allow util access ------------------------------------------------------------------------ */\nexport function zigZagDeltaOfDeltaDecoding(data) {\n    const decodedData = new Int32Array(data.length + 1);\n    decodedData[0] = 0;\n    decodedData[1] = decodeZigZagValue(data[0]);\n    let deltaSum = decodedData[1];\n    let i = 2;\n    for (; i != decodedData.length; ++i) {\n        const zigZagValue = data[i - 1];\n        const delta = (zigZagValue >>> 1) ^ -(zigZagValue & 1);\n        deltaSum += delta;\n        decodedData[i] = decodedData[i - 1] + deltaSum;\n    }\n    return decodedData;\n}\nexport function zigZagRleDeltaDecoding(data, numRuns, numTotalValues) {\n    const decodedValues = new Int32Array(numTotalValues + 1);\n    decodedValues[0] = 0;\n    let offset = 1;\n    let previousValue = decodedValues[0];\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = (value >>> 1) ^ -(value & 1);\n        for (let j = offset; j < offset + runLength; j++) {\n            decodedValues[j] = value + previousValue;\n            previousValue = decodedValues[j];\n        }\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function rleDeltaDecoding(data, numRuns, numTotalValues) {\n    const decodedValues = new Int32Array(numTotalValues + 1);\n    decodedValues[0] = 0;\n    let offset = 1;\n    let previousValue = decodedValues[0];\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        const value = data[i + numRuns];\n        for (let j = offset; j < offset + runLength; j++) {\n            decodedValues[j] = value + previousValue;\n            previousValue = decodedValues[j];\n        }\n        offset += runLength;\n    }\n    return decodedValues;\n}\nexport function padWithZeros(bitVector, data) {\n    const decodedData = new Int32Array(bitVector.size());\n    let dataCounter = 0;\n    let i = 0;\n    for (; i != decodedData.length; ++i) {\n        decodedData[i] = bitVector.get(i) ? data[dataCounter++] : 0;\n    }\n    return decodedData;\n}\nexport function padZigZagWithZeros(bitVector, data) {\n    const decodedData = new Int32Array(bitVector.size());\n    let dataCounter = 0;\n    let i = 0;\n    for (; i != decodedData.length; ++i) {\n        if (bitVector.get(i)) {\n            const value = data[dataCounter++];\n            decodedData[i] = (value >>> 1) ^ -(value & 1);\n        }\n        else {\n            decodedData[i] = 0;\n        }\n    }\n    return decodedData;\n}\nexport function padWithZerosInt64(bitVector, data) {\n    const decodedData = new BigInt64Array(bitVector.size());\n    let dataCounter = 0;\n    let i = 0;\n    for (; i != decodedData.length; ++i) {\n        decodedData[i] = bitVector.get(i) ? data[dataCounter++] : 0n;\n    }\n    return decodedData;\n}\nexport function padZigZagWithZerosInt64(bitVector, data) {\n    const decodedData = new BigInt64Array(bitVector.size());\n    let dataCounter = 0;\n    let i = 0;\n    for (; i != decodedData.length; ++i) {\n        if (bitVector.get(i)) {\n            const value = data[dataCounter++];\n            decodedData[i] = (value >> 1n) ^ -(value & 1n);\n        }\n        else {\n            decodedData[i] = 0n;\n        }\n    }\n    return decodedData;\n}\nexport function decodeNullableRle(data, streamMetadata, isSigned, bitVector) {\n    const rleMetadata = streamMetadata;\n    return isSigned\n        ? decodeNullableZigZagRle(bitVector, data, rleMetadata.runs)\n        : decodeNullableUnsignedRle(bitVector, data, rleMetadata.runs);\n}\nfunction decodeNullableUnsignedRle(bitVector, data, numRuns) {\n    const values = new Int32Array(bitVector.size());\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        const value = data[i + numRuns];\n        for (let j = offset; j < offset + runLength; j++) {\n            /* There can be null values in a run */\n            if (bitVector.get(j)) {\n                values[j] = value;\n            }\n            else {\n                values[j] = 0;\n                offset++;\n            }\n        }\n        offset += runLength;\n    }\n    return values;\n}\nfunction decodeNullableZigZagRle(bitVector, data, numRuns) {\n    const values = new Int32Array(bitVector.size());\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        let value = data[i + numRuns];\n        value = (value >>> 1) ^ -(value & 1);\n        for (let j = offset; j < offset + runLength; j++) {\n            /* There can be null values in a run */\n            if (bitVector.get(j)) {\n                values[j] = value;\n            }\n            else {\n                values[j] = 0;\n                offset++;\n            }\n        }\n        offset += runLength;\n    }\n    return values;\n}\nexport function decodeNullableRleInt64(data, streamMetadata, isSigned, bitVector) {\n    const rleMetadata = streamMetadata;\n    return isSigned\n        ? decodeNullableZigZagRleInt64(bitVector, data, rleMetadata.runs)\n        : decodeNullableUnsignedRleInt64(bitVector, data, rleMetadata.runs);\n}\nfunction decodeNullableUnsignedRleInt64(bitVector, data, numRuns) {\n    const values = new BigInt64Array(bitVector.size());\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        const value = data[i + numRuns];\n        for (let j = offset; j < offset + runLength; j++) {\n            /* There can be null values in a run */\n            if (bitVector.get(j)) {\n                values[j] = value;\n            }\n            else {\n                values[j] = 0n;\n                offset++;\n            }\n        }\n        offset += runLength;\n    }\n    return values;\n}\nfunction decodeNullableZigZagRleInt64(bitVector, data, numRuns) {\n    const values = new BigInt64Array(bitVector.size());\n    let offset = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        let value = data[i + numRuns];\n        value = (value >> 1n) ^ -(value & 1n);\n        for (let j = offset; j < offset + runLength; j++) {\n            /* There can be null values in a run */\n            if (bitVector.get(j)) {\n                values[j] = value;\n            }\n            else {\n                values[j] = 0n;\n                offset++;\n            }\n        }\n        offset += runLength;\n    }\n    return values;\n}\n/* Logical Level Techniques Const and Sequence Vectors ------------------------------------------------------------- */\n/**\n * Decode Delta-RLE with multiple runs by fully reconstructing values.\n *\n * @param data RLE encoded data: [run1, run2, ..., value1, value2, ...]\n * @param numRuns Number of runs in the RLE encoding\n * @param numValues Total number of values to reconstruct\n * @returns Reconstructed values with deltas applied\n */\nexport function decodeDeltaRle(data, numRuns, numValues) {\n    const result = new Int32Array(numValues);\n    let outPos = 0;\n    let previousValue = 0;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = data[i];\n        const zigZagDelta = data[i + numRuns];\n        const delta = decodeZigZagValue(zigZagDelta);\n        for (let j = 0; j < runLength; j++) {\n            previousValue += delta;\n            result[outPos++] = previousValue;\n        }\n    }\n    return result;\n}\n/**\n * Decode Delta-RLE with multiple runs for 64-bit integers.\n */\nexport function decodeDeltaRleInt64(data, numRuns, numValues) {\n    const result = new BigInt64Array(numValues);\n    let outPos = 0;\n    let previousValue = 0n;\n    for (let i = 0; i < numRuns; i++) {\n        const runLength = Number(data[i]);\n        const zigZagDelta = data[i + numRuns];\n        const delta = decodeZigZagValueInt64(zigZagDelta);\n        for (let j = 0; j < runLength; j++) {\n            previousValue += delta;\n            result[outPos++] = previousValue;\n        }\n    }\n    return result;\n}\nexport function decodeUnsignedConstRle(data) {\n    return data[1];\n}\nexport function decodeZigZagConstRle(data) {\n    return decodeZigZagValue(data[1]);\n}\nexport function decodeZigZagSequenceRle(data) {\n    /* base value and delta value are equal */\n    if (data.length == 2) {\n        const value = decodeZigZagValue(data[1]);\n        return [value, value];\n    }\n    /* base value and delta value are not equal -> 2 runs and 2 values*/\n    const base = decodeZigZagValue(data[2]);\n    const delta = decodeZigZagValue(data[3]);\n    return [base, delta];\n}\nexport function decodeUnsignedConstRleInt64(data) {\n    return data[1];\n}\nexport function decodeZigZagConstRleInt64(data) {\n    return decodeZigZagValueInt64(data[1]);\n}\nexport function decodeZigZagSequenceRleInt64(data) {\n    /* base value and delta value are equal */\n    if (data.length == 2) {\n        const value = decodeZigZagValueInt64(data[1]);\n        return [value, value];\n    }\n    /* base value and delta value are not equal -> 2 runs and 2 values*/\n    const base = decodeZigZagValueInt64(data[2]);\n    const delta = decodeZigZagValueInt64(data[3]);\n    return [base, delta];\n}\n//# sourceMappingURL=integerDecodingUtils.js.map","export class LogicalStreamType {\n    _dictionaryType;\n    _offsetType;\n    _lengthType;\n    constructor(_dictionaryType, _offsetType, _lengthType) {\n        this._dictionaryType = _dictionaryType;\n        this._offsetType = _offsetType;\n        this._lengthType = _lengthType;\n    }\n    get dictionaryType() {\n        return this._dictionaryType;\n    }\n    get offsetType() {\n        return this._offsetType;\n    }\n    get lengthType() {\n        return this._lengthType;\n    }\n}\n//# sourceMappingURL=logicalStreamType.js.map","import { LogicalLevelTechnique } from \"./logicalLevelTechnique\";\nimport { PhysicalLevelTechnique } from \"./physicalLevelTechnique\";\nimport { decodeVarintInt32 } from \"../../decoding/integerDecodingUtils\";\nimport { PhysicalStreamType } from \"./physicalStreamType\";\nimport { LogicalStreamType } from \"./logicalStreamType\";\nimport { DictionaryType } from \"./dictionaryType\";\nimport { OffsetType } from \"./offsetType\";\nimport { LengthType } from \"./lengthType\";\nexport function decodeStreamMetadata(tile, offset) {\n    const streamMetadata = decodeStreamMetadataInternal(tile, offset);\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.MORTON) {\n        return decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset);\n    }\n    if ((LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique1 ||\n        LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique2) &&\n        PhysicalLevelTechnique.NONE !== streamMetadata.physicalLevelTechnique) {\n        return decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset);\n    }\n    return streamMetadata;\n}\nfunction decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset) {\n    const mortonInfo = decodeVarintInt32(tile, offset, 2);\n    return {\n        physicalStreamType: streamMetadata.physicalStreamType,\n        logicalStreamType: streamMetadata.logicalStreamType,\n        logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,\n        logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,\n        physicalLevelTechnique: streamMetadata.physicalLevelTechnique,\n        numValues: streamMetadata.numValues,\n        byteLength: streamMetadata.byteLength,\n        decompressedCount: streamMetadata.decompressedCount,\n        numBits: mortonInfo[0],\n        coordinateShift: mortonInfo[1],\n    };\n}\nfunction decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset) {\n    const rleInfo = decodeVarintInt32(tile, offset, 2);\n    return {\n        physicalStreamType: streamMetadata.physicalStreamType,\n        logicalStreamType: streamMetadata.logicalStreamType,\n        logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,\n        logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,\n        physicalLevelTechnique: streamMetadata.physicalLevelTechnique,\n        numValues: streamMetadata.numValues,\n        byteLength: streamMetadata.byteLength,\n        decompressedCount: rleInfo[1],\n        runs: rleInfo[0],\n        numRleValues: rleInfo[1],\n    };\n}\nfunction decodeStreamMetadataInternal(tile, offset) {\n    const stream_type = tile[offset.get()];\n    const physicalStreamType = Object.values(PhysicalStreamType)[stream_type >> 4];\n    let logicalStreamType = null;\n    switch (physicalStreamType) {\n        case PhysicalStreamType.DATA:\n            logicalStreamType = new LogicalStreamType(Object.values(DictionaryType)[stream_type & 0xf]);\n            break;\n        case PhysicalStreamType.OFFSET:\n            logicalStreamType = new LogicalStreamType(null, Object.values(OffsetType)[stream_type & 0xf]);\n            break;\n        case PhysicalStreamType.LENGTH:\n            logicalStreamType = new LogicalStreamType(null, null, Object.values(LengthType)[stream_type & 0xf]);\n            break;\n    }\n    offset.increment();\n    const encodings_header = tile[offset.get()];\n    const llt1 = Object.values(LogicalLevelTechnique)[encodings_header >> 5];\n    const llt2 = Object.values(LogicalLevelTechnique)[(encodings_header >> 2) & 0x7];\n    const plt = Object.values(PhysicalLevelTechnique)[encodings_header & 0x3];\n    offset.increment();\n    const sizeInfo = decodeVarintInt32(tile, offset, 2);\n    const numValues = sizeInfo[0];\n    const byteLength = sizeInfo[1];\n    return {\n        physicalStreamType,\n        logicalStreamType,\n        logicalLevelTechnique1: llt1,\n        logicalLevelTechnique2: llt2,\n        physicalLevelTechnique: plt,\n        numValues,\n        byteLength,\n        decompressedCount: numValues,\n    };\n}\n//# sourceMappingURL=streamMetadataDecoder.js.map","export default class BitVector {\n    values;\n    _size;\n    /**\n     * @param values The byte buffer containing the bit values in least-significant bit (LSB)\n     *     numbering\n     */\n    constructor(values, size) {\n        this.values = values;\n        this._size = size;\n    }\n    get(index) {\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        const b = this.values[byteIndex];\n        return ((b >> bitIndex) & 1) === 1;\n    }\n    set(index, value) {\n        //TODO: refactor -> improve quick and dirty solution\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        this.values[byteIndex] = this.values[byteIndex] | ((value ? 1 : 0) << bitIndex);\n    }\n    getInt(index) {\n        const byteIndex = Math.floor(index / 8);\n        const bitIndex = index % 8;\n        const b = this.values[byteIndex];\n        return (b >> bitIndex) & 1;\n    }\n    size() {\n        return this._size;\n    }\n    getBuffer() {\n        return this.values;\n    }\n}\n//# sourceMappingURL=bitVector.js.map","import { PhysicalLevelTechnique } from \"../metadata/tile/physicalLevelTechnique\";\nimport { decodeComponentwiseDeltaVec2, decodeComponentwiseDeltaVec2Scaled, decodeDeltaRle, decodeDeltaRleInt64, decodeFastPfor, decodeNullableRle, decodeNullableRleInt64, decodeNullableZigZagDelta, decodeNullableZigZagDeltaInt64, decodeRle, decodeRleFloat64, decodeRleInt64, decodeUnsignedConstRle, decodeUnsignedConstRleInt64, decodeUnsignedRle, decodeUnsignedRleFloat64, decodeUnsignedRleInt64, decodeVarintInt32, decodeVarintInt64, decodeVarintFloat64, decodeZigZag, decodeZigZagConstRle, decodeZigZagConstRleInt64, decodeZigZagDelta, decodeZigZagDeltaFloat64, decodeZigZagDeltaInt64, decodeZigZagFloat64, decodeZigZagInt64, decodeZigZagSequenceRle, decodeZigZagSequenceRleInt64, decodeZigZagValue, decodeZigZagValueInt64, fastInverseDelta, inverseDelta, padWithZeros, padWithZerosInt64, padZigZagWithZeros, padZigZagWithZerosInt64, rleDeltaDecoding, zigZagDeltaOfDeltaDecoding, zigZagRleDeltaDecoding, } from \"./integerDecodingUtils\";\nimport { LogicalLevelTechnique } from \"../metadata/tile/logicalLevelTechnique\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { VectorType } from \"../vector/vectorType\";\nexport function decodeIntStream(data, offset, streamMetadata, isSigned, scalingData) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeIntBuffer(values, streamMetadata, isSigned, scalingData);\n}\nexport function decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeLengthToOffsetBuffer(values, streamMetadata);\n}\nfunction decodePhysicalLevelTechnique(data, offset, streamMetadata) {\n    const physicalLevelTechnique = streamMetadata.physicalLevelTechnique;\n    if (physicalLevelTechnique === PhysicalLevelTechnique.FAST_PFOR) {\n        return decodeFastPfor(data, streamMetadata.numValues, streamMetadata.byteLength, offset);\n    }\n    if (physicalLevelTechnique === PhysicalLevelTechnique.VARINT) {\n        return decodeVarintInt32(data, offset, streamMetadata.numValues);\n    }\n    if (physicalLevelTechnique === PhysicalLevelTechnique.NONE) {\n        const dataOffset = offset.get();\n        const byteLength = streamMetadata.byteLength;\n        offset.add(byteLength);\n        //TODO: use Byte Rle for geometry type encoding\n        const slice = data.subarray(dataOffset, offset.get());\n        return new Int32Array(slice);\n    }\n    throw new Error(\"Specified physicalLevelTechnique is not supported (yet).\");\n}\nexport function decodeConstIntStream(data, offset, streamMetadata, isSigned) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    if (values.length === 1) {\n        const value = values[0];\n        return isSigned ? decodeZigZagValue(value) : value;\n    }\n    return isSigned ? decodeZigZagConstRle(values) : decodeUnsignedConstRle(values);\n}\nexport function decodeSequenceIntStream(data, offset, streamMetadata) {\n    const values = decodePhysicalLevelTechnique(data, offset, streamMetadata);\n    return decodeZigZagSequenceRle(values);\n}\nexport function decodeSequenceLongStream(data, offset, streamMetadata) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeZigZagSequenceRleInt64(values);\n}\nexport function decodeLongStream(data, offset, streamMetadata, isSigned) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeLongBuffer(values, streamMetadata, isSigned);\n}\nexport function decodeLongFloat64Stream(data, offset, streamMetadata, isSigned) {\n    const values = decodeVarintFloat64(data, streamMetadata.numValues, offset);\n    return decodeFloat64Buffer(values, streamMetadata, isSigned);\n}\nexport function decodeConstLongStream(data, offset, streamMetadata, isSigned) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    if (values.length === 1) {\n        const value = values[0];\n        return isSigned ? decodeZigZagValueInt64(value) : value;\n    }\n    return isSigned ? decodeZigZagConstRleInt64(values) : decodeUnsignedConstRleInt64(values);\n}\nfunction decodeIntBuffer(values, streamMetadata, isSigned, scalingData) {\n    /*\n     * Currently the encoder uses only fixed combinations of encodings.\n     * For performance reasons it is also used a fixed combination of the encodings on the decoding side.\n     * The following encodings and combinations are used:\n     *   - Morton Delta -> always sorted so not ZigZag encoding needed\n     *   - Delta -> currently always in combination with ZigZag encoding\n     *   - Rle -> in combination with ZigZag encoding if data type is signed\n     *   - Delta Rle\n     *   - Componentwise Delta -> always ZigZag encoding is used\n     * */\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                return decodeDeltaRle(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            decodeZigZagDelta(values);\n            return values;\n        case LogicalLevelTechnique.RLE:\n            return decodeRle(values, streamMetadata, isSigned);\n        case LogicalLevelTechnique.MORTON:\n            fastInverseDelta(values);\n            return values;\n        case LogicalLevelTechnique.COMPONENTWISE_DELTA:\n            if (scalingData) {\n                decodeComponentwiseDeltaVec2Scaled(values, scalingData.scale, scalingData.min, scalingData.max);\n                return values;\n            }\n            decodeComponentwiseDeltaVec2(values);\n            return values;\n        case LogicalLevelTechnique.NONE:\n            if (isSigned) {\n                decodeZigZag(values);\n            }\n            return values;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n}\nfunction decodeLongBuffer(values, streamMetadata, isSigned) {\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                return decodeDeltaRleInt64(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            decodeZigZagDeltaInt64(values);\n            return values;\n        case LogicalLevelTechnique.RLE:\n            return decodeRleInt64(values, streamMetadata, isSigned);\n        case LogicalLevelTechnique.NONE:\n            if (isSigned) {\n                decodeZigZagInt64(values);\n            }\n            return values;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n}\nexport function decodeFloat64Buffer(values, streamMetadata, isSigned) {\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                values = decodeUnsignedRleFloat64(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            decodeZigZagDeltaFloat64(values);\n            return values;\n        case LogicalLevelTechnique.RLE:\n            return decodeRleFloat64(values, streamMetadata, isSigned);\n        case LogicalLevelTechnique.NONE:\n            if (isSigned) {\n                decodeZigZagFloat64(values);\n            }\n            return values;\n        default:\n            throw new Error(`The specified Logical level technique is not supported: ${streamMetadata.logicalLevelTechnique1}`);\n    }\n}\nfunction decodeLengthToOffsetBuffer(values, streamMetadata) {\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        const decodedValues = zigZagDeltaOfDeltaDecoding(values);\n        return decodedValues;\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.RLE &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        const rleMetadata = streamMetadata;\n        const decodedValues = rleDeltaDecoding(values, rleMetadata.runs, rleMetadata.numRleValues);\n        return decodedValues;\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.NONE &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.NONE) {\n        //TODO: use fastInverseDelta again and check what are the performance problems in zoom 14\n        //fastInverseDelta(values);\n        inverseDelta(values);\n        const offsets = new Int32Array(streamMetadata.numValues + 1);\n        offsets[0] = 0;\n        offsets.set(values, 1);\n        return offsets;\n    }\n    if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.DELTA &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n        const rleMetadata = streamMetadata;\n        const decodedValues = zigZagRleDeltaDecoding(values, rleMetadata.runs, rleMetadata.numRleValues);\n        fastInverseDelta(decodedValues);\n        return decodedValues;\n    }\n    throw new Error(\"Only delta encoding is supported for transforming length to offset streams yet.\");\n}\nexport function decodeNullableIntStream(data, offset, streamMetadata, isSigned, bitVector) {\n    const values = streamMetadata.physicalLevelTechnique === PhysicalLevelTechnique.FAST_PFOR\n        ? decodeFastPfor(data, streamMetadata.numValues, streamMetadata.byteLength, offset)\n        : decodeVarintInt32(data, offset, streamMetadata.numValues);\n    return decodeNullableIntBuffer(values, streamMetadata, isSigned, bitVector);\n}\nexport function decodeNullableLongStream(data, offset, streamMetadata, isSigned, bitVector) {\n    const values = decodeVarintInt64(data, offset, streamMetadata.numValues);\n    return decodeNullableLongBuffer(values, streamMetadata, isSigned, bitVector);\n}\nfunction decodeNullableIntBuffer(values, streamMetadata, isSigned, bitVector) {\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                values = decodeUnsignedRle(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            return decodeNullableZigZagDelta(bitVector, values);\n        case LogicalLevelTechnique.RLE:\n            return decodeNullableRle(values, streamMetadata, isSigned, bitVector);\n        case LogicalLevelTechnique.MORTON:\n            fastInverseDelta(values);\n            return values;\n        case LogicalLevelTechnique.COMPONENTWISE_DELTA:\n            decodeComponentwiseDeltaVec2(values);\n            return values;\n        case LogicalLevelTechnique.NONE:\n            values = isSigned ? padZigZagWithZeros(bitVector, values) : padWithZeros(bitVector, values);\n            return values;\n        default:\n            throw new Error(\"The specified Logical level technique is not supported\");\n    }\n}\nfunction decodeNullableLongBuffer(values, streamMetadata, isSigned, bitVector) {\n    switch (streamMetadata.logicalLevelTechnique1) {\n        case LogicalLevelTechnique.DELTA:\n            if (streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n                const rleMetadata = streamMetadata;\n                values = decodeUnsignedRleInt64(values, rleMetadata.runs, rleMetadata.numRleValues);\n            }\n            return decodeNullableZigZagDeltaInt64(bitVector, values);\n        case LogicalLevelTechnique.RLE:\n            return decodeNullableRleInt64(values, streamMetadata, isSigned, bitVector);\n        case LogicalLevelTechnique.NONE:\n            values = isSigned ? padZigZagWithZerosInt64(bitVector, values) : padWithZerosInt64(bitVector, values);\n            return values;\n        default:\n            throw new Error(\"The specified Logical level technique is not supported\");\n    }\n}\nexport function getVectorType(streamMetadata, sizeOrNullabilityBuffer, data, offset) {\n    const logicalLevelTechnique1 = streamMetadata.logicalLevelTechnique1;\n    if (logicalLevelTechnique1 === LogicalLevelTechnique.RLE) {\n        return streamMetadata.runs === 1 ? VectorType.CONST : VectorType.FLAT;\n    }\n    const numFeatures = sizeOrNullabilityBuffer instanceof BitVector ? sizeOrNullabilityBuffer.size() : sizeOrNullabilityBuffer;\n    if (logicalLevelTechnique1 === LogicalLevelTechnique.DELTA &&\n        streamMetadata.logicalLevelTechnique2 === LogicalLevelTechnique.RLE) {\n        const rleMetadata = streamMetadata;\n        const runs = rleMetadata.runs;\n        const zigZagOne = 2;\n        if (rleMetadata.numRleValues !== numFeatures) {\n            return VectorType.FLAT;\n        }\n        // Single run is always a sequence\n        if (runs === 1) {\n            return VectorType.SEQUENCE;\n        }\n        // Two runs can be a sequence if both deltas are equal to 1\n        if (runs === 2) {\n            const savedOffset = offset.get();\n            let values;\n            if (streamMetadata.physicalLevelTechnique === PhysicalLevelTechnique.VARINT) {\n                values = decodeVarintInt32(data, offset, 4);\n            }\n            else {\n                const byteOffset = offset.get();\n                values = new Int32Array(data.buffer, data.byteOffset + byteOffset, 4);\n            }\n            offset.set(savedOffset);\n            // Check if both deltas are encoded 1\n            if (values[2] === zigZagOne && values[3] === zigZagOne) {\n                return VectorType.SEQUENCE;\n            }\n        }\n    }\n    return streamMetadata.numValues === 1 ? VectorType.CONST : VectorType.FLAT;\n}\n//# sourceMappingURL=integerStreamDecoder.js.map","import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class LongFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=longFlatVector.js.map","import { SequenceVector } from \"./sequenceVector\";\nexport class LongSequenceVector extends SequenceVector {\n    constructor(name, baseValue, delta, size) {\n        super(name, BigInt64Array.of(baseValue), delta, size);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0] + BigInt(index) * this.delta;\n    }\n}\n//# sourceMappingURL=longSequenceVector.js.map","export default class TopologyVector {\n    _geometryOffsets;\n    _partOffsets;\n    _ringOffsets;\n    //TODO: refactor to use unsigned integers\n    constructor(_geometryOffsets, _partOffsets, _ringOffsets) {\n        this._geometryOffsets = _geometryOffsets;\n        this._partOffsets = _partOffsets;\n        this._ringOffsets = _ringOffsets;\n    }\n    get geometryOffsets() {\n        return this._geometryOffsets;\n    }\n    get partOffsets() {\n        return this._partOffsets;\n    }\n    get ringOffsets() {\n        return this._ringOffsets;\n    }\n}\n//# sourceMappingURL=topologyVector.js.map","export function decodeZOrderCurve(mortonCode, numBits, coordinateShift) {\n    const x = decodeMorton(mortonCode, numBits) - coordinateShift;\n    const y = decodeMorton(mortonCode >> 1, numBits) - coordinateShift;\n    return { x, y };\n}\nfunction decodeMorton(code, numBits) {\n    let coordinate = 0;\n    for (let i = 0; i < numBits; i++) {\n        coordinate |= (code & (1 << (2 * i))) >> i;\n    }\n    return coordinate;\n}\n//# sourceMappingURL=zOrderCurve.js.map","import { decodeZOrderCurve } from \"./zOrderCurve\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nimport Point from \"@mapbox/point-geometry\";\nclass MvtGeometryFactory {\n    createPoint(coordinate) {\n        return [[coordinate]];\n    }\n    createMultiPoint(points) {\n        return points.map((point) => [point]);\n    }\n    createLineString(vertices) {\n        return [vertices];\n    }\n    createMultiLineString(lineStrings) {\n        return lineStrings;\n    }\n    createPolygon(shell, rings) {\n        return [shell].concat(rings);\n    }\n    createMultiPolygon(polygons) {\n        //TODO: check winding order of shell and holes\n        return polygons.flat();\n    }\n}\nexport function convertGeometryVector(geometryVector) {\n    const geometries = new Array(geometryVector.numGeometries);\n    let partOffsetCounter = 1;\n    let ringOffsetsCounter = 1;\n    let geometryOffsetsCounter = 1;\n    let geometryCounter = 0;\n    const geometryFactory = new MvtGeometryFactory();\n    let vertexBufferOffset = 0;\n    let vertexOffsetsOffset = 0;\n    const mortonSettings = geometryVector.mortonSettings;\n    const topologyVector = geometryVector.topologyVector;\n    const geometryOffsets = topologyVector.geometryOffsets;\n    const partOffsets = topologyVector.partOffsets;\n    const ringOffsets = topologyVector.ringOffsets;\n    const vertexOffsets = geometryVector.vertexOffsets;\n    const containsPolygon = geometryVector.containsPolygonGeometry();\n    const vertexBuffer = geometryVector.vertexBuffer;\n    for (let i = 0; i < geometryVector.numGeometries; i++) {\n        const geometryType = geometryVector.geometryType(i);\n        if (geometryType === GEOMETRY_TYPE.POINT) {\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                const x = vertexBuffer[vertexBufferOffset++];\n                const y = vertexBuffer[vertexBufferOffset++];\n                const coordinate = new Point(x, y);\n                geometries[geometryCounter++] = geometryFactory.createPoint(coordinate);\n            }\n            else if (geometryVector.vertexBufferType === VertexBufferType.VEC_2) {\n                const offset = vertexOffsets[vertexOffsetsOffset++] * 2;\n                const x = vertexBuffer[offset];\n                const y = vertexBuffer[offset + 1];\n                const coordinate = new Point(x, y);\n                geometries[geometryCounter++] = geometryFactory.createPoint(coordinate);\n            }\n            else {\n                const offset = vertexOffsets[vertexOffsetsOffset++];\n                const mortonCode = vertexBuffer[offset];\n                const vertex = decodeZOrderCurve(mortonCode, mortonSettings.numBits, mortonSettings.coordinateShift);\n                const coordinate = new Point(vertex.x, vertex.y);\n                geometries[geometryCounter++] = geometryFactory.createPoint(coordinate);\n            }\n            if (geometryOffsets)\n                geometryOffsetsCounter++;\n            if (partOffsets)\n                partOffsetCounter++;\n            if (ringOffsets)\n                ringOffsetsCounter++;\n        }\n        else if (geometryType === GEOMETRY_TYPE.MULTIPOINT) {\n            const numPoints = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n            geometryOffsetsCounter++;\n            const points = new Array(numPoints);\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                for (let j = 0; j < numPoints; j++) {\n                    const x = vertexBuffer[vertexBufferOffset++];\n                    const y = vertexBuffer[vertexBufferOffset++];\n                    points[j] = new Point(x, y);\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiPoint(points);\n            }\n            else {\n                for (let j = 0; j < numPoints; j++) {\n                    const offset = vertexOffsets[vertexOffsetsOffset++] * 2;\n                    const x = vertexBuffer[offset];\n                    const y = vertexBuffer[offset + 1];\n                    points[j] = new Point(x, y);\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiPoint(points);\n            }\n        }\n        else if (geometryType === GEOMETRY_TYPE.LINESTRING) {\n            let numVertices = 0;\n            if (containsPolygon) {\n                numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                ringOffsetsCounter++;\n            }\n            else {\n                numVertices = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n            }\n            partOffsetCounter++;\n            let vertices;\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                vertices = getLineString(vertexBuffer, vertexBufferOffset, numVertices, false);\n                vertexBufferOffset += numVertices * 2;\n            }\n            else {\n                vertices =\n                    geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                        ? decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false)\n                        : decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false, mortonSettings);\n                vertexOffsetsOffset += numVertices;\n            }\n            geometries[geometryCounter++] = geometryFactory.createLineString(vertices);\n            if (geometryOffsets)\n                geometryOffsetsCounter++;\n        }\n        else if (geometryType === GEOMETRY_TYPE.POLYGON) {\n            const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n            partOffsetCounter++;\n            const rings = new Array(numRings - 1);\n            let numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n            ringOffsetsCounter++;\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                const shell = getLinearRing(vertexBuffer, vertexBufferOffset, numVertices);\n                vertexBufferOffset += numVertices * 2;\n                for (let j = 0; j < rings.length; j++) {\n                    numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                    ringOffsetsCounter++;\n                    rings[j] = getLinearRing(vertexBuffer, vertexBufferOffset, numVertices);\n                    vertexBufferOffset += numVertices * 2;\n                }\n                geometries[geometryCounter++] = geometryFactory.createPolygon(shell, rings);\n            }\n            else {\n                const shell = geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                    ? decodeDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices)\n                    : decodeMortonDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, geometryFactory, mortonSettings);\n                vertexOffsetsOffset += numVertices;\n                for (let j = 0; j < rings.length; j++) {\n                    numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                    ringOffsetsCounter++;\n                    rings[j] =\n                        geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                            ? decodeDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices)\n                            : decodeMortonDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, geometryFactory, mortonSettings);\n                    vertexOffsetsOffset += numVertices;\n                }\n                geometries[geometryCounter++] = geometryFactory.createPolygon(shell, rings);\n            }\n            if (geometryOffsets)\n                geometryOffsetsCounter++;\n        }\n        else if (geometryType === GEOMETRY_TYPE.MULTILINESTRING) {\n            const numLineStrings = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n            geometryOffsetsCounter++;\n            const lineStrings = new Array(numLineStrings);\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                for (let j = 0; j < numLineStrings; j++) {\n                    let numVertices = 0;\n                    if (containsPolygon) {\n                        numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                    }\n                    else {\n                        numVertices = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    }\n                    partOffsetCounter++;\n                    lineStrings[j] = getLineString(vertexBuffer, vertexBufferOffset, numVertices, false);\n                    vertexBufferOffset += numVertices * 2;\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiLineString(lineStrings);\n            }\n            else {\n                for (let j = 0; j < numLineStrings; j++) {\n                    let numVertices = 0;\n                    if (containsPolygon) {\n                        numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                    }\n                    else {\n                        numVertices = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    }\n                    partOffsetCounter++;\n                    const vertices = geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                        ? decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false)\n                        : decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, false, mortonSettings);\n                    lineStrings[j] = vertices;\n                    vertexOffsetsOffset += numVertices;\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiLineString(lineStrings);\n            }\n        }\n        else if (geometryType === GEOMETRY_TYPE.MULTIPOLYGON) {\n            const numPolygons = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n            geometryOffsetsCounter++;\n            const polygons = new Array(numPolygons);\n            let numVertices = 0;\n            if (!vertexOffsets || vertexOffsets.length === 0) {\n                for (let j = 0; j < numPolygons; j++) {\n                    const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    partOffsetCounter++;\n                    const rings = new Array(numRings - 1);\n                    numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                    ringOffsetsCounter++;\n                    const shell = getLinearRing(vertexBuffer, vertexBufferOffset, numVertices);\n                    vertexBufferOffset += numVertices * 2;\n                    for (let k = 0; k < rings.length; k++) {\n                        const numRingVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                        rings[k] = getLinearRing(vertexBuffer, vertexBufferOffset, numRingVertices);\n                        vertexBufferOffset += numRingVertices * 2;\n                    }\n                    polygons[j] = geometryFactory.createPolygon(shell, rings);\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiPolygon(polygons);\n            }\n            else {\n                for (let j = 0; j < numPolygons; j++) {\n                    const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                    partOffsetCounter++;\n                    const rings = new Array(numRings - 1);\n                    numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                    ringOffsetsCounter++;\n                    const shell = geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                        ? decodeDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices)\n                        : decodeMortonDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, geometryFactory, mortonSettings);\n                    vertexOffsetsOffset += numVertices;\n                    for (let k = 0; k < rings.length; k++) {\n                        numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                        ringOffsetsCounter++;\n                        rings[k] =\n                            geometryVector.vertexBufferType === VertexBufferType.VEC_2\n                                ? decodeDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices)\n                                : decodeMortonDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffsetsOffset, numVertices, geometryFactory, mortonSettings);\n                        vertexOffsetsOffset += numVertices;\n                    }\n                    polygons[j] = geometryFactory.createPolygon(shell, rings);\n                }\n                geometries[geometryCounter++] = geometryFactory.createMultiPolygon(polygons);\n            }\n        }\n        else {\n            throw new Error(\"The specified geometry type is currently not supported.\");\n        }\n    }\n    return geometries;\n}\nfunction getLinearRing(vertexBuffer, startIndex, numVertices) {\n    return getLineString(vertexBuffer, startIndex, numVertices, true);\n}\nfunction decodeDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffset, numVertices) {\n    return decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, true);\n}\nfunction decodeMortonDictionaryEncodedLinearRing(vertexBuffer, vertexOffsets, vertexOffset, numVertices, geometryFactory, mortonSettings) {\n    return decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, true, mortonSettings);\n}\nfunction getLineString(vertexBuffer, startIndex, numVertices, closeLineString) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices * 2; i += 2) {\n        const x = vertexBuffer[startIndex + i];\n        const y = vertexBuffer[startIndex + i + 1];\n        vertices[i / 2] = new Point(x, y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\nfunction decodeDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices * 2; i += 2) {\n        const offset = vertexOffsets[vertexOffset + i / 2] * 2;\n        const x = vertexBuffer[offset];\n        const y = vertexBuffer[offset + 1];\n        vertices[i / 2] = new Point(x, y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\nfunction decodeMortonDictionaryEncodedLineString(vertexBuffer, vertexOffsets, vertexOffset, numVertices, closeLineString, mortonSettings) {\n    const vertices = new Array(closeLineString ? numVertices + 1 : numVertices);\n    for (let i = 0; i < numVertices; i++) {\n        const offset = vertexOffsets[vertexOffset + i];\n        const mortonEncodedVertex = vertexBuffer[offset];\n        const vertex = decodeZOrderCurve(mortonEncodedVertex, mortonSettings.numBits, mortonSettings.coordinateShift);\n        vertices[i] = new Point(vertex.x, vertex.y);\n    }\n    if (closeLineString) {\n        vertices[vertices.length - 1] = vertices[0];\n    }\n    return vertices;\n}\n//# sourceMappingURL=geometryVectorConverter.js.map","import { convertGeometryVector } from \"./geometryVectorConverter\";\nimport { decodeZOrderCurve } from \"./zOrderCurve\";\nexport class GeometryVector {\n    _vertexBufferType;\n    _topologyVector;\n    _vertexOffsets;\n    _vertexBuffer;\n    _mortonSettings;\n    constructor(_vertexBufferType, _topologyVector, _vertexOffsets, _vertexBuffer, _mortonSettings) {\n        this._vertexBufferType = _vertexBufferType;\n        this._topologyVector = _topologyVector;\n        this._vertexOffsets = _vertexOffsets;\n        this._vertexBuffer = _vertexBuffer;\n        this._mortonSettings = _mortonSettings;\n    }\n    get vertexBufferType() {\n        return this._vertexBufferType;\n    }\n    get topologyVector() {\n        return this._topologyVector;\n    }\n    get vertexOffsets() {\n        return this._vertexOffsets;\n    }\n    get vertexBuffer() {\n        return this._vertexBuffer;\n    }\n    *[Symbol.iterator]() {\n        const geometries = convertGeometryVector(this);\n        let index = 0;\n        while (index < this.numGeometries) {\n            yield { coordinates: geometries[index], type: this.geometryType(index) };\n            index++;\n        }\n    }\n    /* Allows faster access to the vertices since morton encoding is currently not used in the POC. Morton encoding\n       will be used after adapting the shader to decode the morton codes on the GPU. */\n    getSimpleEncodedVertex(index) {\n        const offset = this.vertexOffsets ? this.vertexOffsets[index] * 2 : index * 2;\n        const x = this.vertexBuffer[offset];\n        const y = this.vertexBuffer[offset + 1];\n        return [x, y];\n    }\n    //TODO: add scaling information to the constructor\n    getVertex(index) {\n        if (this.vertexOffsets && this.mortonSettings) {\n            //TODO: move decoding of the morton codes on the GPU in the vertex shader\n            const vertexOffset = this.vertexOffsets[index];\n            const mortonEncodedVertex = this.vertexBuffer[vertexOffset];\n            //TODO: improve performance -> inline calculation and move to decoding of VertexBuffer\n            const vertex = decodeZOrderCurve(mortonEncodedVertex, this.mortonSettings.numBits, this.mortonSettings.coordinateShift);\n            return [vertex.x, vertex.y];\n        }\n        const offset = this.vertexOffsets ? this.vertexOffsets[index] * 2 : index * 2;\n        const x = this.vertexBuffer[offset];\n        const y = this.vertexBuffer[offset + 1];\n        return [x, y];\n    }\n    getGeometries() {\n        return convertGeometryVector(this);\n    }\n    get mortonSettings() {\n        return this._mortonSettings;\n    }\n}\n//# sourceMappingURL=geometryVector.js.map","import { GeometryVector } from \"./geometryVector\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nexport function createConstGeometryVector(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer) {\n    return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.VEC_2, topologyVector, vertexOffsets, vertexBuffer);\n}\nexport function createMortonEncodedConstGeometryVector(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer, mortonInfo) {\n    return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.MORTON, topologyVector, vertexOffsets, vertexBuffer, mortonInfo);\n}\nexport class ConstGeometryVector extends GeometryVector {\n    _numGeometries;\n    _geometryType;\n    constructor(_numGeometries, _geometryType, vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings) {\n        super(vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings);\n        this._numGeometries = _numGeometries;\n        this._geometryType = _geometryType;\n    }\n    geometryType(index) {\n        return this._geometryType;\n    }\n    get numGeometries() {\n        return this._numGeometries;\n    }\n    containsPolygonGeometry() {\n        return this._geometryType === GEOMETRY_TYPE.POLYGON || this._geometryType === GEOMETRY_TYPE.MULTIPOLYGON;\n    }\n    containsSingleGeometryType() {\n        return true;\n    }\n}\n//# sourceMappingURL=constGeometryVector.js.map","import { GeometryVector } from \"./geometryVector\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nimport { VertexBufferType } from \"./vertexBufferType\";\nexport function createFlatGeometryVector(geometryTypes, topologyVector, vertexOffsets, vertexBuffer) {\n    return new FlatGeometryVector(VertexBufferType.VEC_2, geometryTypes, topologyVector, vertexOffsets, vertexBuffer);\n}\nexport function createFlatGeometryVectorMortonEncoded(geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonInfo) {\n    //TODO: refactor to use unsigned integers\n    return new FlatGeometryVector(VertexBufferType.MORTON, geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonInfo);\n}\nexport class FlatGeometryVector extends GeometryVector {\n    _geometryTypes;\n    constructor(vertexBufferType, \n    //TODO: refactor -> use UInt8Array\n    _geometryTypes, topologyVector, vertexOffsets, vertexBuffer, mortonSettings) {\n        super(vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings);\n        this._geometryTypes = _geometryTypes;\n    }\n    geometryType(index) {\n        return this._geometryTypes[index];\n    }\n    get numGeometries() {\n        return this._geometryTypes.length;\n    }\n    containsPolygonGeometry() {\n        for (let i = 0; i < this.numGeometries; i++) {\n            if (this.geometryType(i) === GEOMETRY_TYPE.POLYGON || this.geometryType(i) === GEOMETRY_TYPE.MULTIPOLYGON) {\n                return true;\n            }\n        }\n        return false;\n    }\n    containsSingleGeometryType() {\n        return false;\n    }\n}\n//# sourceMappingURL=flatGeometryVector.js.map","import Point from \"@mapbox/point-geometry\";\nimport { GEOMETRY_TYPE } from \"./geometryType\";\nexport class GpuVector {\n    _triangleOffsets;\n    _indexBuffer;\n    _vertexBuffer;\n    _topologyVector;\n    constructor(_triangleOffsets, _indexBuffer, _vertexBuffer, _topologyVector) {\n        this._triangleOffsets = _triangleOffsets;\n        this._indexBuffer = _indexBuffer;\n        this._vertexBuffer = _vertexBuffer;\n        this._topologyVector = _topologyVector;\n    }\n    get triangleOffsets() {\n        return this._triangleOffsets;\n    }\n    get indexBuffer() {\n        return this._indexBuffer;\n    }\n    get vertexBuffer() {\n        return this._vertexBuffer;\n    }\n    get topologyVector() {\n        return this._topologyVector;\n    }\n    /**\n     * Returns geometries as coordinate arrays by extracting polygon outlines from topology.\n     * The vertexBuffer contains the outline vertices, separate from the tessellated triangles.\n     */\n    getGeometries() {\n        if (!this._topologyVector) {\n            throw new Error(\"Cannot convert GpuVector to coordinates without topology information\");\n        }\n        const geometries = new Array(this.numGeometries);\n        const topology = this._topologyVector;\n        const partOffsets = topology.partOffsets;\n        const ringOffsets = topology.ringOffsets;\n        const geometryOffsets = topology.geometryOffsets;\n        // Use counters to track position in offset arrays (like Java implementation)\n        let vertexBufferOffset = 0;\n        let partOffsetCounter = 1;\n        let ringOffsetsCounter = 1;\n        let geometryOffsetsCounter = 1;\n        for (let i = 0; i < this.numGeometries; i++) {\n            const geometryType = this.geometryType(i);\n            switch (geometryType) {\n                case GEOMETRY_TYPE.POLYGON:\n                    {\n                        // Get number of rings for this polygon\n                        const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                        partOffsetCounter++;\n                        const rings = [];\n                        for (let j = 0; j < numRings; j++) {\n                            // Get number of vertices in this ring\n                            const numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                            ringOffsetsCounter++;\n                            const ring = [];\n                            for (let k = 0; k < numVertices; k++) {\n                                const x = this._vertexBuffer[vertexBufferOffset++];\n                                const y = this._vertexBuffer[vertexBufferOffset++];\n                                ring.push(new Point(x, y));\n                            }\n                            // Close the ring by duplicating the first vertex (MVT format requirement)\n                            if (ring.length > 0) {\n                                ring.push(ring[0]);\n                            }\n                            rings.push(ring);\n                        }\n                        geometries[i] = rings;\n                        if (geometryOffsets)\n                            geometryOffsetsCounter++;\n                    }\n                    break;\n                case GEOMETRY_TYPE.MULTIPOLYGON:\n                    {\n                        // Get number of polygons in this multipolygon\n                        const numPolygons = geometryOffsets[geometryOffsetsCounter] - geometryOffsets[geometryOffsetsCounter - 1];\n                        geometryOffsetsCounter++;\n                        const allRings = [];\n                        for (let p = 0; p < numPolygons; p++) {\n                            // Get number of rings in this polygon\n                            const numRings = partOffsets[partOffsetCounter] - partOffsets[partOffsetCounter - 1];\n                            partOffsetCounter++;\n                            for (let j = 0; j < numRings; j++) {\n                                // Get number of vertices in this ring\n                                const numVertices = ringOffsets[ringOffsetsCounter] - ringOffsets[ringOffsetsCounter - 1];\n                                ringOffsetsCounter++;\n                                const ring = [];\n                                for (let k = 0; k < numVertices; k++) {\n                                    const x = this._vertexBuffer[vertexBufferOffset++];\n                                    const y = this._vertexBuffer[vertexBufferOffset++];\n                                    ring.push(new Point(x, y));\n                                }\n                                // Close the ring by duplicating the first vertex (MVT format requirement)\n                                if (ring.length > 0) {\n                                    ring.push(ring[0]);\n                                }\n                                allRings.push(ring);\n                            }\n                        }\n                        geometries[i] = allRings;\n                    }\n                    break;\n            }\n        }\n        return geometries;\n    }\n    [Symbol.iterator]() {\n        /*for(let i = 1; i < this.triangleOffsets.length; i++) {\n           const numTriangles = this.triangleOffsets[i] - this.triangleOffsets[i-1];\n           const startIndex = this.triangleOffsets[i-1] * 3;\n           const endIndex = this.triangleOffsets[i] * 3;\n       }\n\n        while (index < this.numGeometries) {\n            yield geometries[index++];\n        }*/\n        //throw new Error(\"Iterator on a GpuVector is not implemented yet.\");\n        return null;\n    }\n}\n//# sourceMappingURL=gpuVector.js.map","import { GpuVector } from \"./gpuVector\";\nexport function createConstGpuVector(numGeometries, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n    return new ConstGpuVector(numGeometries, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n}\n//TODO: extend from GeometryVector -> make topology vector optional\nexport class ConstGpuVector extends GpuVector {\n    _numGeometries;\n    _geometryType;\n    constructor(_numGeometries, _geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n        super(triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n        this._numGeometries = _numGeometries;\n        this._geometryType = _geometryType;\n    }\n    geometryType(index) {\n        return this._geometryType;\n    }\n    get numGeometries() {\n        return this._numGeometries;\n    }\n    containsSingleGeometryType() {\n        return true;\n    }\n}\n//# sourceMappingURL=constGpuVector.js.map","import { GpuVector } from \"./gpuVector\";\nexport function createFlatGpuVector(geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n    return new FlatGpuVector(geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n}\n//TODO: extend from GeometryVector -> make topology vector optional\nexport class FlatGpuVector extends GpuVector {\n    _geometryTypes;\n    constructor(_geometryTypes, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {\n        super(triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n        this._geometryTypes = _geometryTypes;\n    }\n    geometryType(index) {\n        return this._geometryTypes[index];\n    }\n    get numGeometries() {\n        return this._geometryTypes.length;\n    }\n    containsSingleGeometryType() {\n        return false;\n    }\n}\n//# sourceMappingURL=flatGpuVector.js.map","import { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { decodeConstIntStream, decodeIntStream, decodeLengthStreamToOffsetBuffer, getVectorType, } from \"./integerStreamDecoder\";\nimport { VectorType } from \"../vector/vectorType\";\nimport { PhysicalStreamType } from \"../metadata/tile/physicalStreamType\";\nimport { LengthType } from \"../metadata/tile/lengthType\";\nimport { DictionaryType } from \"../metadata/tile/dictionaryType\";\nimport TopologyVector from \"../vector/geometry/topologyVector\";\nimport { createConstGeometryVector, createMortonEncodedConstGeometryVector, } from \"../vector/geometry/constGeometryVector\";\nimport { createFlatGeometryVector, createFlatGeometryVectorMortonEncoded, } from \"../vector/geometry/flatGeometryVector\";\nimport { OffsetType } from \"../metadata/tile/offsetType\";\nimport { createConstGpuVector } from \"../vector/geometry/constGpuVector\";\nimport { createFlatGpuVector } from \"../vector/geometry/flatGpuVector\";\n// TODO: get rid of numFeatures parameter\nexport function decodeGeometryColumn(tile, numStreams, offset, numFeatures, scalingData) {\n    const geometryTypeMetadata = decodeStreamMetadata(tile, offset);\n    const geometryTypesVectorType = getVectorType(geometryTypeMetadata, numFeatures, tile, offset);\n    let geometryOffsets = null;\n    let partOffsets = null;\n    let ringOffsets = null;\n    let vertexOffsets = null;\n    let vertexBuffer = null;\n    let mortonSettings = null;\n    //TODO: use geometryOffsets for that? -> but then tessellated polygons can't be used with normal polygons\n    // in one FeatureTable?\n    let triangleOffsets = null;\n    let indexBuffer = null;\n    if (geometryTypesVectorType === VectorType.CONST) {\n        /* All geometries in the colum have the same geometry type */\n        const geometryType = decodeConstIntStream(tile, offset, geometryTypeMetadata, false);\n        for (let i = 0; i < numStreams - 1; i++) {\n            const geometryStreamMetadata = decodeStreamMetadata(tile, offset);\n            switch (geometryStreamMetadata.physicalStreamType) {\n                case PhysicalStreamType.LENGTH:\n                    switch (geometryStreamMetadata.logicalStreamType.lengthType) {\n                        case LengthType.GEOMETRIES:\n                            geometryOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.PARTS:\n                            partOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.RINGS:\n                            ringOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                            break;\n                        case LengthType.TRIANGLES:\n                            triangleOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                    }\n                    break;\n                case PhysicalStreamType.OFFSET: {\n                    switch (geometryStreamMetadata.logicalStreamType.offsetType) {\n                        case OffsetType.VERTEX:\n                            vertexOffsets = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                            break;\n                        case OffsetType.INDEX:\n                            indexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                            break;\n                    }\n                    break;\n                }\n                case PhysicalStreamType.DATA: {\n                    if (DictionaryType.VERTEX === geometryStreamMetadata.logicalStreamType.dictionaryType) {\n                        vertexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, true, scalingData);\n                    }\n                    else {\n                        const mortonMetadata = geometryStreamMetadata;\n                        mortonSettings = {\n                            numBits: mortonMetadata.numBits,\n                            coordinateShift: mortonMetadata.coordinateShift,\n                        };\n                        vertexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, false, scalingData);\n                    }\n                    break;\n                }\n            }\n        }\n        if (indexBuffer !== null) {\n            if (geometryOffsets != null || partOffsets != null) {\n                /* Case when the indices of a Polygon outline are encoded in the tile */\n                const topologyVector = new TopologyVector(geometryOffsets, partOffsets, ringOffsets);\n                return createConstGpuVector(numFeatures, geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector);\n            }\n            /* Case when the no Polygon outlines are encoded in the tile */\n            return createConstGpuVector(numFeatures, geometryType, triangleOffsets, indexBuffer, vertexBuffer);\n        }\n        return mortonSettings === null\n            ? /* Currently only 2D coordinates (Vec2) are implemented in the encoder  */\n                createConstGeometryVector(numFeatures, geometryType, new TopologyVector(geometryOffsets, partOffsets, ringOffsets), vertexOffsets, vertexBuffer)\n            : createMortonEncodedConstGeometryVector(numFeatures, geometryType, new TopologyVector(geometryOffsets, partOffsets, ringOffsets), vertexOffsets, vertexBuffer, mortonSettings);\n    }\n    /* Different geometry types are mixed in the geometry column */\n    const geometryTypeVector = decodeIntStream(tile, offset, geometryTypeMetadata, false);\n    for (let i = 0; i < numStreams - 1; i++) {\n        const geometryStreamMetadata = decodeStreamMetadata(tile, offset);\n        switch (geometryStreamMetadata.physicalStreamType) {\n            case PhysicalStreamType.LENGTH:\n                switch (geometryStreamMetadata.logicalStreamType.lengthType) {\n                    case LengthType.GEOMETRIES:\n                        geometryOffsets = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                        break;\n                    case LengthType.PARTS:\n                        partOffsets = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                        break;\n                    case LengthType.RINGS:\n                        ringOffsets = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                        break;\n                    case LengthType.TRIANGLES:\n                        triangleOffsets = decodeLengthStreamToOffsetBuffer(tile, offset, geometryStreamMetadata);\n                }\n                break;\n            case PhysicalStreamType.OFFSET:\n                switch (geometryStreamMetadata.logicalStreamType.offsetType) {\n                    case OffsetType.VERTEX:\n                        vertexOffsets = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                        break;\n                    case OffsetType.INDEX:\n                        indexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, false);\n                        break;\n                }\n                break;\n            case PhysicalStreamType.DATA:\n                if (DictionaryType.VERTEX === geometryStreamMetadata.logicalStreamType.dictionaryType) {\n                    vertexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, true, scalingData);\n                }\n                else {\n                    const mortonMetadata = geometryStreamMetadata;\n                    mortonSettings = {\n                        numBits: mortonMetadata.numBits,\n                        coordinateShift: mortonMetadata.coordinateShift,\n                    };\n                    vertexBuffer = decodeIntStream(tile, offset, geometryStreamMetadata, false, scalingData);\n                }\n                break;\n        }\n    }\n    if (indexBuffer !== null && partOffsets === null) {\n        /* Case when the indices of a Polygon outline are not encoded in the data so no\n         *  topology data are present in the tile */\n        return createFlatGpuVector(geometryTypeVector, triangleOffsets, indexBuffer, vertexBuffer);\n    }\n    // TODO: refactor the following instructions -> decode in one pass for performance reasons\n    /* Calculate the offsets from the length buffer for util access */\n    if (geometryOffsets !== null) {\n        geometryOffsets = decodeRootLengthStream(geometryTypeVector, geometryOffsets, 2);\n        if (partOffsets !== null && ringOffsets !== null) {\n            partOffsets = decodeLevel1LengthStream(geometryTypeVector, geometryOffsets, partOffsets, false);\n            ringOffsets = decodeLevel2LengthStream(geometryTypeVector, geometryOffsets, partOffsets, ringOffsets);\n        }\n        else if (partOffsets !== null) {\n            partOffsets = decodeLevel1WithoutRingBufferLengthStream(geometryTypeVector, geometryOffsets, partOffsets);\n        }\n    }\n    else if (partOffsets !== null && ringOffsets !== null) {\n        partOffsets = decodeRootLengthStream(geometryTypeVector, partOffsets, 1);\n        ringOffsets = decodeLevel1LengthStream(geometryTypeVector, partOffsets, ringOffsets, true);\n    }\n    else if (partOffsets !== null) {\n        partOffsets = decodeRootLengthStream(geometryTypeVector, partOffsets, 0);\n    }\n    if (indexBuffer !== null) {\n        /* Case when the indices of a Polygon outline are encoded in the tile */\n        return createFlatGpuVector(geometryTypeVector, triangleOffsets, indexBuffer, vertexBuffer, new TopologyVector(geometryOffsets, partOffsets, ringOffsets));\n    }\n    return mortonSettings === null /* Currently only 2D coordinates (Vec2) are implemented in the encoder  */\n        ? createFlatGeometryVector(geometryTypeVector, new TopologyVector(geometryOffsets, partOffsets, ringOffsets), vertexOffsets, vertexBuffer)\n        : createFlatGeometryVectorMortonEncoded(geometryTypeVector, new TopologyVector(geometryOffsets, partOffsets, ringOffsets), vertexOffsets, vertexBuffer, mortonSettings);\n}\n/*\n * Handle the parsing of the different topology length buffers separate not generic to reduce the\n * branching and improve the performance\n */\nfunction decodeRootLengthStream(geometryTypes, rootLengthStream, bufferId) {\n    const rootBufferOffsets = new Int32Array(geometryTypes.length + 1);\n    let previousOffset = 0;\n    rootBufferOffsets[0] = previousOffset;\n    let rootLengthCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        /* Test if the geometry has and entry in the root buffer\n         * BufferId: 2 GeometryOffsets -> MultiPolygon, MultiLineString, MultiPoint\n         * BufferId: 1 PartOffsets -> Polygon\n         * BufferId: 0 PartOffsets, RingOffsets -> LineString\n         * */\n        previousOffset = rootBufferOffsets[i + 1] =\n            previousOffset + (geometryTypes[i] > bufferId ? rootLengthStream[rootLengthCounter++] : 1);\n    }\n    return rootBufferOffsets;\n}\nfunction decodeLevel1LengthStream(geometryTypes, rootOffsetBuffer, level1LengthBuffer, isLineStringPresent) {\n    const level1BufferOffsets = new Int32Array(rootOffsetBuffer[rootOffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level1BufferOffsets[0] = previousOffset;\n    let level1BufferCounter = 1;\n    let level1LengthBufferCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType === 5 ||\n            geometryType === 2 ||\n            (isLineStringPresent && (geometryType === 4 || geometryType === 1))) {\n            /* For MultiPolygon, Polygon and in some cases for MultiLineString and LineString\n             * a value in the level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                previousOffset = level1BufferOffsets[level1BufferCounter++] =\n                    previousOffset + level1LengthBuffer[level1LengthBufferCounter++];\n            }\n        }\n        else {\n            /* For MultiPoint and Point and in some cases for MultiLineString and LineString no value in the\n             * level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level1BufferOffsets[level1BufferCounter++] = ++previousOffset;\n            }\n        }\n    }\n    return level1BufferOffsets;\n}\n/*\n * Case where no ring buffer exists so no MultiPolygon or Polygon geometry is part of the buffer\n */\nfunction decodeLevel1WithoutRingBufferLengthStream(geometryTypes, rootOffsetBuffer, level1LengthBuffer) {\n    const level1BufferOffsets = new Int32Array(rootOffsetBuffer[rootOffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level1BufferOffsets[0] = previousOffset;\n    let level1OffsetBufferCounter = 1;\n    let level1LengthCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType === 4 || geometryType === 1) {\n            /* For MultiLineString and LineString a value in the level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                previousOffset = level1BufferOffsets[level1OffsetBufferCounter++] =\n                    previousOffset + level1LengthBuffer[level1LengthCounter++];\n            }\n        }\n        else {\n            /* For MultiPoint and Point no value in level1LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level1BufferOffsets[level1OffsetBufferCounter++] = ++previousOffset;\n            }\n        }\n    }\n    return level1BufferOffsets;\n}\nfunction decodeLevel2LengthStream(geometryTypes, rootOffsetBuffer, level1OffsetBuffer, level2LengthBuffer) {\n    const level2BufferOffsets = new Int32Array(level1OffsetBuffer[level1OffsetBuffer.length - 1] + 1);\n    let previousOffset = 0;\n    level2BufferOffsets[0] = previousOffset;\n    let level1OffsetBufferCounter = 1;\n    let level2OffsetBufferCounter = 1;\n    let level2LengthBufferCounter = 0;\n    for (let i = 0; i < geometryTypes.length; i++) {\n        const geometryType = geometryTypes[i];\n        const numGeometries = rootOffsetBuffer[i + 1] - rootOffsetBuffer[i];\n        if (geometryType !== 0 && geometryType !== 3) {\n            /* For MultiPolygon, MultiLineString, Polygon and LineString a value in level2LengthBuffer\n             * exists */\n            for (let j = 0; j < numGeometries; j++) {\n                const numParts = level1OffsetBuffer[level1OffsetBufferCounter] - level1OffsetBuffer[level1OffsetBufferCounter - 1];\n                level1OffsetBufferCounter++;\n                for (let k = 0; k < numParts; k++) {\n                    previousOffset = level2BufferOffsets[level2OffsetBufferCounter++] =\n                        previousOffset + level2LengthBuffer[level2LengthBufferCounter++];\n                }\n            }\n        }\n        else {\n            /* For MultiPoint and Point no value in level2LengthBuffer exists */\n            for (let j = 0; j < numGeometries; j++) {\n                level2BufferOffsets[level2OffsetBufferCounter++] = ++previousOffset;\n                level1OffsetBufferCounter++;\n            }\n        }\n    }\n    return level2BufferOffsets;\n}\n//# sourceMappingURL=geometryDecoder.js.map","import Vector from \"../vector\";\nexport class BooleanFlatVector extends Vector {\n    dataVector;\n    constructor(name, dataVector, sizeOrNullabilityBuffer) {\n        super(name, dataVector.getBuffer(), sizeOrNullabilityBuffer);\n        this.dataVector = dataVector;\n    }\n    getValueFromBuffer(index) {\n        return this.dataVector.get(index);\n    }\n}\n//# sourceMappingURL=booleanFlatVector.js.map","import { FixedSizeVector } from \"../fixedSizeVector\";\nexport class FloatFlatVector extends FixedSizeVector {\n    getValueFromBuffer(index) {\n        return this.dataBuffer[index];\n    }\n}\n//# sourceMappingURL=floatFlatVector.js.map","import Vector from \"../vector\";\nexport class LongConstVector extends Vector {\n    constructor(name, value, sizeOrNullabilityBuffer) {\n        super(name, BigInt64Array.of(value), sizeOrNullabilityBuffer);\n    }\n    getValueFromBuffer(index) {\n        return this.dataBuffer[0];\n    }\n}\n//# sourceMappingURL=longConstVector.js.map","import { VectorType } from \"../vector/vectorType\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nexport function skipColumn(numStreams, tile, offset) {\n    //TODO: add size of column in Mlt for fast skipping\n    for (let i = 0; i < numStreams; i++) {\n        const streamMetadata = decodeStreamMetadata(tile, offset);\n        offset.add(streamMetadata.byteLength);\n    }\n}\nexport function decodeBooleanRle(buffer, numBooleans, pos) {\n    const numBytes = Math.ceil(numBooleans / 8.0);\n    return decodeByteRle(buffer, numBytes, pos);\n}\nexport function decodeNullableBooleanRle(buffer, numBooleans, pos, nullabilityBuffer) {\n    // TODO: refactor quick and dirty solution -> use solution in one pass\n    const numBytes = Math.ceil(numBooleans / 8);\n    const values = decodeByteRle(buffer, numBytes, pos);\n    const bitVector = new BitVector(values, numBooleans);\n    const size = nullabilityBuffer.size();\n    const nullableBitvector = new BitVector(new Uint8Array(size), size);\n    let valueCounter = 0;\n    for (let i = 0; i < nullabilityBuffer.size(); i++) {\n        const value = nullabilityBuffer.get(i) ? bitVector.get(valueCounter++) : false;\n        nullableBitvector.set(i, value);\n    }\n    return nullableBitvector.getBuffer();\n}\nexport function decodeByteRle(buffer, numBytes, pos) {\n    const values = new Uint8Array(numBytes);\n    let valueOffset = 0;\n    while (valueOffset < numBytes) {\n        const header = buffer[pos.increment()];\n        /* Runs */\n        if (header <= 0x7f) {\n            const numRuns = header + 3;\n            const value = buffer[pos.increment()];\n            const endValueOffset = valueOffset + numRuns;\n            values.fill(value, valueOffset, endValueOffset);\n            valueOffset = endValueOffset;\n        }\n        else {\n            /* Literals */\n            const numLiterals = 256 - header;\n            for (let i = 0; i < numLiterals; i++) {\n                values[valueOffset++] = buffer[pos.increment()];\n            }\n        }\n    }\n    return values;\n}\nexport function decodeFloatsLE(encodedValues, pos, numValues) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float32Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float32Array(newBuf);\n    pos.set(newOffset);\n    return fb;\n}\nexport function decodeDoublesLE(encodedValues, pos, numValues) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float64Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float64Array(newBuf);\n    pos.set(newOffset);\n    return fb;\n}\nexport function decodeNullableFloatsLE(encodedValues, pos, nullabilityBuffer, numValues) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float32Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float32Array(newBuf);\n    pos.set(newOffset);\n    const numTotalValues = nullabilityBuffer.size();\n    const nullableFloatsBuffer = new Float32Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numTotalValues; i++) {\n        nullableFloatsBuffer[i] = nullabilityBuffer.get(i) ? fb[offset++] : 0;\n    }\n    return nullableFloatsBuffer;\n}\nexport function decodeNullableDoublesLE(encodedValues, pos, nullabilityBuffer, numValues) {\n    const currentPos = pos.get();\n    const newOffset = currentPos + numValues * Float64Array.BYTES_PER_ELEMENT;\n    const newBuf = new Uint8Array(encodedValues.subarray(currentPos, newOffset)).buffer;\n    const fb = new Float64Array(newBuf);\n    pos.set(newOffset);\n    const numTotalValues = nullabilityBuffer.size();\n    const nullableDoubleBuffer = new Float64Array(numTotalValues);\n    let offset = 0;\n    for (let i = 0; i < numTotalValues; i++) {\n        nullableDoubleBuffer[i] = nullabilityBuffer.get(i) ? fb[offset++] : 0;\n    }\n    return nullableDoubleBuffer;\n}\nconst TEXT_DECODER_MIN_LENGTH = 12;\nconst utf8TextDecoder = new TextDecoder();\n// Source: https://github.com/mapbox/pbf/issues/106\nexport function decodeString(buf, pos, end) {\n    if (end - pos >= TEXT_DECODER_MIN_LENGTH) {\n        // longer strings are fast with the built-in browser TextDecoder API\n        return utf8TextDecoder.decode(buf.subarray(pos, end));\n    }\n    // short strings are fast with custom implementation\n    return readUtf8(buf, pos, end);\n}\nfunction readUtf8(buf, pos, end) {\n    let str = \"\";\n    let i = pos;\n    while (i < end) {\n        const b0 = buf[i];\n        let c = null; // codepoint\n        let bytesPerSequence = b0 > 0xef ? 4 : b0 > 0xdf ? 3 : b0 > 0xbf ? 2 : 1;\n        if (i + bytesPerSequence > end)\n            break;\n        let b1, b2, b3;\n        if (bytesPerSequence === 1) {\n            if (b0 < 0x80) {\n                c = b0;\n            }\n        }\n        else if (bytesPerSequence === 2) {\n            b1 = buf[i + 1];\n            if ((b1 & 0xc0) === 0x80) {\n                c = ((b0 & 0x1f) << 0x6) | (b1 & 0x3f);\n                if (c <= 0x7f) {\n                    c = null;\n                }\n            }\n        }\n        else if (bytesPerSequence === 3) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            if ((b1 & 0xc0) === 0x80 && (b2 & 0xc0) === 0x80) {\n                c = ((b0 & 0xf) << 0xc) | ((b1 & 0x3f) << 0x6) | (b2 & 0x3f);\n                if (c <= 0x7ff || (c >= 0xd800 && c <= 0xdfff)) {\n                    c = null;\n                }\n            }\n        }\n        else if (bytesPerSequence === 4) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            b3 = buf[i + 3];\n            if ((b1 & 0xc0) === 0x80 && (b2 & 0xc0) === 0x80 && (b3 & 0xc0) === 0x80) {\n                c = ((b0 & 0xf) << 0x12) | ((b1 & 0x3f) << 0xc) | ((b2 & 0x3f) << 0x6) | (b3 & 0x3f);\n                if (c <= 0xffff || c >= 0x110000) {\n                    c = null;\n                }\n            }\n        }\n        if (c === null) {\n            c = 0xfffd;\n            bytesPerSequence = 1;\n        }\n        else if (c > 0xffff) {\n            c -= 0x10000;\n            str += String.fromCharCode(((c >>> 10) & 0x3ff) | 0xd800);\n            c = 0xdc00 | (c & 0x3ff);\n        }\n        str += String.fromCharCode(c);\n        i += bytesPerSequence;\n    }\n    return str;\n}\nexport function getVectorTypeBooleanStream(numFeatures, byteLength, data, offset) {\n    const valuesPerRun = 0x83;\n    // TODO: use VectorType metadata field for to test which VectorType is used\n    return Math.ceil(numFeatures / valuesPerRun) * 2 == byteLength &&\n        /* Test the first value byte if all bits are set to true */\n        (data[offset.get() + 1] & 0xff) === (bitCount(numFeatures) << 2) - 1\n        ? VectorType.CONST\n        : VectorType.FLAT;\n}\nfunction bitCount(number) {\n    //TODO: refactor to get rid of special case handling\n    return number === 0 ? 1 : Math.floor(Math.log2(number) + 1);\n}\n//# sourceMappingURL=decodingUtils.js.map","import Vector from \"./vector\";\nexport class VariableSizeVector extends Vector {\n    offsetBuffer;\n    //TODO: switch to Uint32Array by changing the decodings\n    constructor(name, offsetBuffer, dataBuffer, sizeOrNullabilityBuffer) {\n        super(name, dataBuffer, sizeOrNullabilityBuffer);\n        this.offsetBuffer = offsetBuffer;\n    }\n}\n//# sourceMappingURL=variableSizeVector.js.map","import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringFlatVector extends VariableSizeVector {\n    textEncoder;\n    constructor(name, offsetBuffer, dataBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dataBuffer, nullabilityBuffer ?? offsetBuffer.length - 1);\n        this.textEncoder = new TextEncoder();\n    }\n    getValueFromBuffer(index) {\n        const start = this.offsetBuffer[index];\n        const end = this.offsetBuffer[index + 1];\n        return decodeString(this.dataBuffer, start, end);\n    }\n}\n//# sourceMappingURL=stringFlatVector.js.map","import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringDictionaryVector extends VariableSizeVector {\n    indexBuffer;\n    textEncoder;\n    constructor(name, indexBuffer, offsetBuffer, dictionaryBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dictionaryBuffer, nullabilityBuffer ?? indexBuffer.length);\n        this.indexBuffer = indexBuffer;\n        this.indexBuffer = indexBuffer;\n        this.textEncoder = new TextEncoder();\n    }\n    getValueFromBuffer(index) {\n        const offset = this.indexBuffer[index];\n        const start = this.offsetBuffer[offset];\n        const end = this.offsetBuffer[offset + 1];\n        return decodeString(this.dataBuffer, start, end);\n    }\n}\n//# sourceMappingURL=stringDictionaryVector.js.map","import { VariableSizeVector } from \"../variableSizeVector\";\nimport { decodeFsst } from \"../../decoding/fsstDecoder\";\nimport { decodeString } from \"../../decoding/decodingUtils\";\nexport class StringFsstDictionaryVector extends VariableSizeVector {\n    indexBuffer;\n    symbolOffsetBuffer;\n    symbolTableBuffer;\n    textEncoder;\n    // TODO: extend from StringVector\n    symbolLengthBuffer;\n    lengthBuffer;\n    decodedDictionary;\n    constructor(name, indexBuffer, offsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, nullabilityBuffer) {\n        super(name, offsetBuffer, dictionaryBuffer, nullabilityBuffer);\n        this.indexBuffer = indexBuffer;\n        this.symbolOffsetBuffer = symbolOffsetBuffer;\n        this.symbolTableBuffer = symbolTableBuffer;\n        this.textEncoder = new TextEncoder();\n    }\n    getValueFromBuffer(index) {\n        //if (this.decodedValues == null) {\n        /*if (this.decodedDictionary == null) {\n            if (this.symbolLengthBuffer == null) {\n                // TODO: change FsstEncoder to take offsets instead of length to get rid of this conversion\n                this.symbolLengthBuffer = this.offsetToLengthBuffer(this.symbolOffsetBuffer);\n                this.lengthBuffer = this.offsetToLengthBuffer(this.offsetBuffer);\n            }\n\n            const dictionaryBuffer = decodeFsst(this.symbolTableBuffer, this.symbolLengthBuffer,\n                this.dataBuffer);\n\n            this.decodedDictionary = new Array<string>(this.lengthBuffer.length);\n            let i = 0;\n            let strStart = 0;\n            for (const strLength of this.lengthBuffer) {\n                this.decodedDictionary[i++] = decodeString(dictionaryBuffer, strStart, strStart + strLength);\n                strStart += strLength;\n            }\n\n            /!*this.decodedValues = new Array(this.indexBuffer.length);\n            i = 0;\n            for (const index of this.indexBuffer) {\n                const value = decodedDictionary[index];\n                this.decodedValues[i++] = value;\n            }*!/\n        }*/\n        /*this.decodedValues = new Array(this.indexBuffer.length);\n            i = 0;\n            for (const index of this.indexBuffer) {\n                const value = decodedDictionary[index];\n                this.decodedValues[i++] = value;\n            }*/\n        if (this.decodedDictionary == null) {\n            if (this.symbolLengthBuffer == null) {\n                // TODO: change FsstEncoder to take offsets instead of length to get rid of this conversion\n                this.symbolLengthBuffer = this.offsetToLengthBuffer(this.symbolOffsetBuffer);\n                this.lengthBuffer = this.offsetToLengthBuffer(this.offsetBuffer);\n            }\n            this.decodedDictionary = decodeFsst(this.symbolTableBuffer, this.symbolLengthBuffer, this.dataBuffer);\n        }\n        const offset = this.indexBuffer[index];\n        const start = this.offsetBuffer[offset];\n        const end = this.offsetBuffer[offset + 1];\n        return decodeString(this.decodedDictionary, start, end);\n    }\n    // TODO: get rid of that conversion\n    offsetToLengthBuffer(offsetBuffer) {\n        const lengthBuffer = new Uint32Array(offsetBuffer.length - 1);\n        let previousOffset = offsetBuffer[0];\n        for (let i = 1; i < offsetBuffer.length; i++) {\n            const offset = offsetBuffer[i];\n            lengthBuffer[i - 1] = offset - previousOffset;\n            previousOffset = offset;\n        }\n        return lengthBuffer;\n    }\n}\n//# sourceMappingURL=stringFsstDictionaryVector.js.map","/**\n * Decode FSST compressed data\n *\n * @param symbols           Array of symbols, where each symbol can be between 1 and 8 bytes\n * @param symbolLengths     Array of symbol lengths, length of each symbol in symbols array\n * @param compressedData    FSST Compressed data, where each entry is an index to the symbols array\n * @returns                 Decoded data as Uint8Array\n */\n//TODO: improve -> quick and dirty implementation\nexport function decodeFsst(symbols, symbolLengths, compressedData) {\n    //TODO: use typed array directly\n    const decodedData = [];\n    const symbolOffsets = new Array(symbolLengths.length).fill(0);\n    for (let i = 1; i < symbolLengths.length; i++) {\n        symbolOffsets[i] = symbolOffsets[i - 1] + symbolLengths[i - 1];\n    }\n    for (let i = 0; i < compressedData.length; i++) {\n        if (compressedData[i] === 255) {\n            decodedData.push(compressedData[++i]);\n        }\n        else {\n            const symbolLength = symbolLengths[compressedData[i]];\n            const symbolOffset = symbolOffsets[compressedData[i]];\n            for (let j = 0; j < symbolLength; j++) {\n                decodedData.push(symbols[symbolOffset + j]);\n            }\n        }\n    }\n    return new Uint8Array(decodedData);\n}\n//# sourceMappingURL=fsstDecoder.js.map","import { ScalarType } from \"../metadata/tileset/tilesetMetadata\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { VectorType } from \"../vector/vectorType\";\nimport { BooleanFlatVector } from \"../vector/flat/booleanFlatVector\";\nimport { DoubleFlatVector } from \"../vector/flat/doubleFlatVector\";\nimport { FloatFlatVector } from \"../vector/flat/floatFlatVector\";\nimport { LongConstVector } from \"../vector/constant/longConstVector\";\nimport { LongFlatVector } from \"../vector/flat/longFlatVector\";\nimport { IntFlatVector } from \"../vector/flat/intFlatVector\";\nimport { IntConstVector } from \"../vector/constant/intConstVector\";\nimport { decodeBooleanRle, decodeDoublesLE, decodeFloatsLE, decodeNullableBooleanRle, decodeNullableDoublesLE, decodeNullableFloatsLE, skipColumn, } from \"./decodingUtils\";\nimport { decodeConstIntStream, decodeConstLongStream, decodeIntStream, decodeLongStream, decodeNullableIntStream, decodeNullableLongStream, decodeSequenceIntStream, decodeSequenceLongStream, getVectorType, } from \"./integerStreamDecoder\";\nimport { IntSequenceVector } from \"../vector/sequence/intSequenceVector\";\nimport { LongSequenceVector } from \"../vector/sequence/longSequenceVector\";\nimport { decodeSharedDictionary, decodeString } from \"./stringDecoder\";\nexport function decodePropertyColumn(data, offset, columnMetadata, numStreams, numFeatures, propertyColumnNames) {\n    if (columnMetadata.type === \"scalarType\") {\n        if (propertyColumnNames && !propertyColumnNames.has(columnMetadata.name)) {\n            skipColumn(numStreams, data, offset);\n            return null;\n        }\n        return decodeScalarPropertyColumn(numStreams, data, offset, numFeatures, columnMetadata.scalarType, columnMetadata);\n    }\n    if (numStreams != 1) {\n        return null;\n    }\n    return decodeSharedDictionary(data, offset, columnMetadata, numFeatures, propertyColumnNames);\n}\nfunction decodeScalarPropertyColumn(numStreams, data, offset, numFeatures, column, columnMetadata) {\n    let nullabilityBuffer = null;\n    let numValues = 0;\n    if (numStreams === 0) {\n        /* Skip since this column has no values */\n        return null;\n    }\n    // Read nullability stream if column is nullable\n    if (columnMetadata.nullable) {\n        const presentStreamMetadata = decodeStreamMetadata(data, offset);\n        numValues = presentStreamMetadata.numValues;\n        const streamDataStart = offset.get();\n        // Decode the RLE boolean data\n        const presentVector = decodeBooleanRle(data, numValues, offset);\n        // FIX: decodeBooleanRle doesn't consume all bytes!\n        // We must advance to the end of the stream using byteLength from metadata\n        offset.set(streamDataStart + presentStreamMetadata.byteLength);\n        nullabilityBuffer = new BitVector(presentVector, presentStreamMetadata.numValues);\n    }\n    const sizeOrNullabilityBuffer = nullabilityBuffer ?? numFeatures;\n    const scalarType = column.physicalType;\n    switch (scalarType) {\n        case ScalarType.UINT_32:\n        case ScalarType.INT_32:\n            return decodeIntColumn(data, offset, columnMetadata, column, sizeOrNullabilityBuffer);\n        case ScalarType.STRING:\n            // In embedded format: numStreams includes nullability stream if column is nullable\n            const stringDataStreams = columnMetadata.nullable ? numStreams - 1 : numStreams;\n            return decodeString(columnMetadata.name, data, offset, stringDataStreams, nullabilityBuffer);\n        case ScalarType.BOOLEAN:\n            return decodeBooleanColumn(data, offset, columnMetadata, numFeatures, sizeOrNullabilityBuffer);\n        case ScalarType.UINT_64:\n        case ScalarType.INT_64:\n            return decodeLongColumn(data, offset, columnMetadata, sizeOrNullabilityBuffer, column);\n        case ScalarType.FLOAT:\n            return decodeFloatColumn(data, offset, columnMetadata, sizeOrNullabilityBuffer);\n        case ScalarType.DOUBLE:\n            return decodeDoubleColumn(data, offset, columnMetadata, sizeOrNullabilityBuffer);\n        default:\n            throw new Error(`The specified data type for the field is currently not supported: ${column}`);\n    }\n}\nfunction decodeBooleanColumn(data, offset, column, numFeatures, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const numValues = dataStreamMetadata.numValues;\n    const streamDataStart = offset.get();\n    const dataStream = isNullabilityBuffer(sizeOrNullabilityBuffer)\n        ? decodeNullableBooleanRle(data, numValues, offset, sizeOrNullabilityBuffer)\n        : decodeBooleanRle(data, numValues, offset);\n    // TODO: refactor decodeNullableBooleanRle\n    // Fix offset: RLE decoders don't consume all compressed bytes\n    offset.set(streamDataStart + dataStreamMetadata.byteLength);\n    const dataVector = new BitVector(dataStream, numValues);\n    return new BooleanFlatVector(column.name, dataVector, sizeOrNullabilityBuffer);\n}\nfunction decodeFloatColumn(data, offset, column, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const dataStream = isNullabilityBuffer(sizeOrNullabilityBuffer)\n        ? decodeNullableFloatsLE(data, offset, sizeOrNullabilityBuffer, dataStreamMetadata.numValues)\n        : decodeFloatsLE(data, offset, dataStreamMetadata.numValues);\n    return new FloatFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n}\nfunction decodeDoubleColumn(data, offset, column, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const dataStream = isNullabilityBuffer(sizeOrNullabilityBuffer)\n        ? decodeNullableDoublesLE(data, offset, sizeOrNullabilityBuffer, dataStreamMetadata.numValues)\n        : decodeDoublesLE(data, offset, dataStreamMetadata.numValues);\n    return new DoubleFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n}\nfunction decodeLongColumn(data, offset, column, sizeOrNullabilityBuffer, scalarColumn) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const vectorType = getVectorType(dataStreamMetadata, sizeOrNullabilityBuffer, data, offset);\n    const isSigned = scalarColumn.physicalType === ScalarType.INT_64;\n    if (vectorType === VectorType.FLAT) {\n        const dataStream = isNullabilityBuffer(sizeOrNullabilityBuffer)\n            ? decodeNullableLongStream(data, offset, dataStreamMetadata, isSigned, sizeOrNullabilityBuffer)\n            : decodeLongStream(data, offset, dataStreamMetadata, isSigned);\n        return new LongFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n    }\n    else if (vectorType === VectorType.SEQUENCE) {\n        const id = decodeSequenceLongStream(data, offset, dataStreamMetadata);\n        return new LongSequenceVector(column.name, id[0], id[1], dataStreamMetadata.numRleValues);\n    }\n    else {\n        const constValue = decodeConstLongStream(data, offset, dataStreamMetadata, isSigned);\n        return new LongConstVector(column.name, constValue, sizeOrNullabilityBuffer);\n    }\n}\nfunction decodeIntColumn(data, offset, column, scalarColumn, sizeOrNullabilityBuffer) {\n    const dataStreamMetadata = decodeStreamMetadata(data, offset);\n    const vectorType = getVectorType(dataStreamMetadata, sizeOrNullabilityBuffer, data, offset);\n    const isSigned = scalarColumn.physicalType === ScalarType.INT_32;\n    if (vectorType === VectorType.FLAT) {\n        const dataStream = isNullabilityBuffer(sizeOrNullabilityBuffer)\n            ? decodeNullableIntStream(data, offset, dataStreamMetadata, isSigned, sizeOrNullabilityBuffer)\n            : decodeIntStream(data, offset, dataStreamMetadata, isSigned);\n        return new IntFlatVector(column.name, dataStream, sizeOrNullabilityBuffer);\n    }\n    else if (vectorType === VectorType.SEQUENCE) {\n        const id = decodeSequenceIntStream(data, offset, dataStreamMetadata);\n        return new IntSequenceVector(column.name, id[0], id[1], dataStreamMetadata.numRleValues);\n    }\n    else {\n        const constValue = decodeConstIntStream(data, offset, dataStreamMetadata, isSigned);\n        return new IntConstVector(column.name, constValue, sizeOrNullabilityBuffer);\n    }\n}\nfunction isNullabilityBuffer(sizeOrNullabilityBuffer) {\n    return sizeOrNullabilityBuffer instanceof BitVector;\n}\n//# sourceMappingURL=propertyDecoder.js.map","// based on ../spec/schema/mlt_tileset_metadata.proto\nexport const ColumnScope = {\n    FEATURE: 0,\n    VERTEX: 1,\n};\nexport const ScalarType = {\n    BOOLEAN: 0,\n    INT_8: 1,\n    UINT_8: 2,\n    INT_32: 3,\n    UINT_32: 4,\n    INT_64: 5,\n    UINT_64: 6,\n    FLOAT: 7,\n    DOUBLE: 8,\n    STRING: 9,\n};\nexport const ComplexType = {\n    GEOMETRY: 0,\n    STRUCT: 1,\n};\nexport const LogicalScalarType = {\n    ID: 0,\n};\nexport const LogicalComplexType = {\n    BINARY: 0,\n    RANGE_MAP: 1,\n};\n//# sourceMappingURL=tilesetMetadata.js.map","import { decodeStreamMetadata } from \"../metadata/tile/streamMetadataDecoder\";\nimport { StringFlatVector } from \"../vector/flat/stringFlatVector\";\nimport { StringDictionaryVector } from \"../vector/dictionary/stringDictionaryVector\";\nimport BitVector from \"../vector/flat/bitVector\";\nimport { PhysicalStreamType } from \"../metadata/tile/physicalStreamType\";\nimport { DictionaryType } from \"../metadata/tile/dictionaryType\";\nimport { LengthType } from \"../metadata/tile/lengthType\";\nimport { decodeIntStream, decodeLengthStreamToOffsetBuffer, decodeNullableIntStream } from \"./integerStreamDecoder\";\nimport { ScalarType } from \"../metadata/tileset/tilesetMetadata\";\nimport { decodeVarintInt32 } from \"./integerDecodingUtils\";\nimport { decodeBooleanRle, skipColumn } from \"./decodingUtils\";\nimport { StringFsstDictionaryVector } from \"../vector/fsst-dictionary/stringFsstDictionaryVector\";\nconst ROOT_COLUMN_NAME = \"default\";\nconst NESTED_COLUMN_SEPARATOR = \":\";\nexport function decodeString(name, data, offset, numStreams, bitVector) {\n    let dictionaryLengthStream = null;\n    let offsetStream = null;\n    let dictionaryStream = null;\n    let symbolLengthStream = null;\n    let symbolTableStream = null;\n    let presentStream = null;\n    let plainLengthStream = null;\n    let plainDataStream = null;\n    for (let i = 0; i < numStreams; i++) {\n        const streamMetadata = decodeStreamMetadata(data, offset);\n        if (streamMetadata.byteLength === 0) {\n            continue;\n        }\n        switch (streamMetadata.physicalStreamType) {\n            case PhysicalStreamType.PRESENT: {\n                const presentData = decodeBooleanRle(data, streamMetadata.numValues, offset);\n                presentStream = new BitVector(presentData, streamMetadata.numValues);\n                break;\n            }\n            case PhysicalStreamType.OFFSET: {\n                const isNullable = bitVector != null || presentStream != null;\n                const nullabilityBuffer = bitVector ?? presentStream;\n                offsetStream = isNullable\n                    ? decodeNullableIntStream(data, offset, streamMetadata, false, nullabilityBuffer)\n                    : decodeIntStream(data, offset, streamMetadata, false);\n                break;\n            }\n            case PhysicalStreamType.LENGTH: {\n                const ls = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                if (LengthType.DICTIONARY === streamMetadata.logicalStreamType.lengthType) {\n                    dictionaryLengthStream = ls;\n                }\n                else if (LengthType.SYMBOL === streamMetadata.logicalStreamType.lengthType) {\n                    symbolLengthStream = ls;\n                }\n                else {\n                    // Plain string encoding uses VAR_BINARY length type\n                    plainLengthStream = ls;\n                }\n                break;\n            }\n            case PhysicalStreamType.DATA: {\n                const ds = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                offset.add(streamMetadata.byteLength);\n                const dictType = streamMetadata.logicalStreamType.dictionaryType;\n                if (DictionaryType.FSST === dictType) {\n                    symbolTableStream = ds;\n                }\n                else if (DictionaryType.SINGLE === dictType || DictionaryType.SHARED === dictType) {\n                    dictionaryStream = ds;\n                }\n                else if (DictionaryType.NONE === dictType) {\n                    plainDataStream = ds;\n                }\n                break;\n            }\n        }\n    }\n    return (decodeFsstDictionaryVector(name, symbolTableStream, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, bitVector ?? presentStream) ??\n        decodeDictionaryVector(name, dictionaryStream, offsetStream, dictionaryLengthStream, bitVector ?? presentStream) ??\n        decodePlainStringVector(name, plainLengthStream, plainDataStream, offsetStream, bitVector ?? presentStream));\n}\nfunction decodeFsstDictionaryVector(name, symbolTableStream, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, nullabilityBuffer) {\n    if (!symbolTableStream) {\n        return null;\n    }\n    return new StringFsstDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream, symbolLengthStream, symbolTableStream, nullabilityBuffer);\n}\nfunction decodeDictionaryVector(name, dictionaryStream, offsetStream, dictionaryLengthStream, nullabilityBuffer) {\n    if (!dictionaryStream) {\n        return null;\n    }\n    return nullabilityBuffer\n        ? new StringDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream, nullabilityBuffer)\n        : new StringDictionaryVector(name, offsetStream, dictionaryLengthStream, dictionaryStream);\n}\nfunction decodePlainStringVector(name, plainLengthStream, plainDataStream, offsetStream, nullabilityBuffer) {\n    if (!plainLengthStream || !plainDataStream) {\n        return null;\n    }\n    if (offsetStream) {\n        return nullabilityBuffer\n            ? new StringDictionaryVector(name, offsetStream, plainLengthStream, plainDataStream, nullabilityBuffer)\n            : new StringDictionaryVector(name, offsetStream, plainLengthStream, plainDataStream);\n    }\n    if (nullabilityBuffer && nullabilityBuffer.size() !== plainLengthStream.length - 1) {\n        const sparseOffsetStream = new Int32Array(nullabilityBuffer.size());\n        let valueIndex = 0;\n        for (let i = 0; i < nullabilityBuffer.size(); i++) {\n            if (nullabilityBuffer.get(i)) {\n                sparseOffsetStream[i] = valueIndex++;\n            }\n            else {\n                sparseOffsetStream[i] = 0;\n            }\n        }\n        return new StringDictionaryVector(name, sparseOffsetStream, plainLengthStream, plainDataStream, nullabilityBuffer);\n    }\n    return nullabilityBuffer\n        ? new StringFlatVector(name, plainLengthStream, plainDataStream, nullabilityBuffer)\n        : new StringFlatVector(name, plainLengthStream, plainDataStream);\n}\nexport function decodeSharedDictionary(data, offset, column, numFeatures, propertyColumnNames) {\n    let dictionaryOffsetBuffer = null;\n    let dictionaryBuffer = null;\n    let symbolOffsetBuffer = null;\n    let symbolTableBuffer = null;\n    let dictionaryStreamDecoded = false;\n    while (!dictionaryStreamDecoded) {\n        const streamMetadata = decodeStreamMetadata(data, offset);\n        switch (streamMetadata.physicalStreamType) {\n            case PhysicalStreamType.LENGTH:\n                if (LengthType.DICTIONARY === streamMetadata.logicalStreamType.lengthType) {\n                    dictionaryOffsetBuffer = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                }\n                else {\n                    symbolOffsetBuffer = decodeLengthStreamToOffsetBuffer(data, offset, streamMetadata);\n                }\n                break;\n            case PhysicalStreamType.DATA:\n                if (DictionaryType.SINGLE === streamMetadata.logicalStreamType.dictionaryType ||\n                    DictionaryType.SHARED === streamMetadata.logicalStreamType.dictionaryType) {\n                    dictionaryBuffer = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                    dictionaryStreamDecoded = true;\n                }\n                else {\n                    symbolTableBuffer = data.subarray(offset.get(), offset.get() + streamMetadata.byteLength);\n                }\n                offset.add(streamMetadata.byteLength);\n                break;\n        }\n    }\n    const childFields = column.complexType.children;\n    const stringDictionaryVectors = [];\n    let i = 0;\n    for (const childField of childFields) {\n        const numStreams = decodeVarintInt32(data, offset, 1)[0];\n        if (numStreams == 0) {\n            /* Column is not present in the tile */\n            continue;\n        }\n        const columnName = `${column.name}${childField.name === ROOT_COLUMN_NAME ? \"\" : NESTED_COLUMN_SEPARATOR + childField.name}`;\n        if (propertyColumnNames) {\n            if (!propertyColumnNames.has(columnName)) {\n                //TODO: add size of sub column to Mlt for faster skipping\n                skipColumn(numStreams, data, offset);\n                continue;\n            }\n        }\n        if (numStreams !== 2 ||\n            childField.type !== \"scalarField\" ||\n            childField.scalarField.physicalType !== ScalarType.STRING) {\n            throw new Error(\"Currently only optional string fields are implemented for a struct.\");\n        }\n        const presentStreamMetadata = decodeStreamMetadata(data, offset);\n        const presentStream = decodeBooleanRle(data, presentStreamMetadata.numValues, offset);\n        const offsetStreamMetadata = decodeStreamMetadata(data, offset);\n        const offsetCount = offsetStreamMetadata.decompressedCount;\n        const isNullable = offsetCount !== numFeatures;\n        const offsetStream = isNullable\n            ? decodeNullableIntStream(data, offset, offsetStreamMetadata, false, new BitVector(presentStream, presentStreamMetadata.numValues))\n            : decodeIntStream(data, offset, offsetStreamMetadata, false);\n        stringDictionaryVectors[i++] = symbolTableBuffer\n            ? new StringFsstDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, new BitVector(presentStream, presentStreamMetadata.numValues))\n            : new StringDictionaryVector(columnName, offsetStream, dictionaryOffsetBuffer, dictionaryBuffer, new BitVector(presentStream, presentStreamMetadata.numValues));\n    }\n    return stringDictionaryVectors;\n}\n//# sourceMappingURL=stringDecoder.js.map","import { ColumnScope, ComplexType, ScalarType, } from \"./tilesetMetadata\";\n/**\n * The type code is a single varint32 that encodes:\n * - Physical or logical type\n * - Nullable flag\n * - Whether the column has a name (typeCode >= 10)\n * - Whether the column has children (typeCode == 30 for STRUCT)\n * - For ID types: whether it uses long (64-bit) IDs\n */\n/**\n * Decodes a type code into a Column structure.\n * ID columns (0-3) are represented as physical UINT_32 or UINT_64 types in TypeScript\n */\nexport function decodeColumnType(typeCode) {\n    switch (typeCode) {\n        case 0:\n        case 1:\n        case 2:\n        case 3: {\n            // ID columns: 0=uint32, 1=uint64, 2=nullable uint32, 3=nullable uint64\n            const column = {};\n            column.nullable = (typeCode & 1) !== 0; // Bit 0 = nullable;\n            column.columnScope = ColumnScope.FEATURE;\n            const scalarCol = {};\n            // Map to physical type since TS schema doesn't have LogicalScalarType.ID\n            const physicalType = typeCode > 1 ? ScalarType.UINT_64 : ScalarType.UINT_32; // Bit 1 = longID\n            scalarCol.physicalType = physicalType;\n            scalarCol.type = \"physicalType\";\n            column.scalarType = scalarCol;\n            column.type = \"scalarType\";\n            return column;\n        }\n        case 4: {\n            // GEOMETRY (non-nullable, no children)\n            const column = {};\n            column.nullable = false;\n            column.columnScope = ColumnScope.FEATURE;\n            const complexCol = {};\n            complexCol.type = \"physicalType\";\n            complexCol.physicalType = ComplexType.GEOMETRY;\n            column.type = \"complexType\";\n            column.complexType = complexCol;\n            return column;\n        }\n        case 30: {\n            // STRUCT (non-nullable with children)\n            const column = {};\n            column.nullable = false;\n            column.columnScope = ColumnScope.FEATURE;\n            const complexCol = {};\n            complexCol.type = \"physicalType\";\n            complexCol.physicalType = ComplexType.STRUCT;\n            column.type = \"complexType\";\n            column.complexType = complexCol;\n            return column;\n        }\n        default:\n            return mapScalarType(typeCode);\n    }\n}\n/**\n * Returns true if this type code requires a name to be stored.\n * ID (0-3) and GEOMETRY (4) columns have implicit names.\n * All other types (>= 10) require explicit names.\n */\nexport function columnTypeHasName(typeCode) {\n    return typeCode >= 10;\n}\n/**\n * Returns true if this type code has child fields.\n * Only STRUCT (typeCode 30) has children.\n */\nexport function columnTypeHasChildren(typeCode) {\n    return typeCode === 30;\n}\n/**\n * Determines if a stream count needs to be read for this column.\n * Mirrors the logic in cpp/include/mlt/metadata/type_map.hpp lines 81-118\n */\nexport function hasStreamCount(column) {\n    // ID columns don't have stream count (identified by name)\n    if (column.name === \"id\") {\n        return false;\n    }\n    if (column.type === \"scalarType\") {\n        const scalarCol = column.scalarType;\n        if (scalarCol.type === \"physicalType\") {\n            const physicalType = scalarCol.physicalType;\n            switch (physicalType) {\n                case ScalarType.BOOLEAN:\n                case ScalarType.INT_8:\n                case ScalarType.UINT_8:\n                case ScalarType.INT_32:\n                case ScalarType.UINT_32:\n                case ScalarType.INT_64:\n                case ScalarType.UINT_64:\n                case ScalarType.FLOAT:\n                case ScalarType.DOUBLE:\n                    return false;\n                case ScalarType.STRING:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n        else if (scalarCol.type === \"logicalType\") {\n            return false;\n        }\n    }\n    else if (column.type === \"complexType\") {\n        const complexCol = column.complexType;\n        if (complexCol.type === \"physicalType\") {\n            const physicalType = complexCol.physicalType;\n            switch (physicalType) {\n                case ComplexType.GEOMETRY:\n                case ComplexType.STRUCT:\n                    return true;\n                default:\n                    return false;\n            }\n        }\n    }\n    console.warn(\"Unexpected column type in hasStreamCount\", column);\n    return false;\n}\n/**\n * Maps a scalar type code to a Column with ScalarType.\n * Type codes 10-29 encode scalar types with nullable flag.\n * Even codes are non-nullable, odd codes are nullable.\n */\nfunction mapScalarType(typeCode) {\n    let scalarType = null;\n    switch (typeCode) {\n        case 10:\n        case 11:\n            scalarType = ScalarType.BOOLEAN;\n            break;\n        case 12:\n        case 13:\n            scalarType = ScalarType.INT_8;\n            break;\n        case 14:\n        case 15:\n            scalarType = ScalarType.UINT_8;\n            break;\n        case 16:\n        case 17:\n            scalarType = ScalarType.INT_32;\n            break;\n        case 18:\n        case 19:\n            scalarType = ScalarType.UINT_32;\n            break;\n        case 20:\n        case 21:\n            scalarType = ScalarType.INT_64;\n            break;\n        case 22:\n        case 23:\n            scalarType = ScalarType.UINT_64;\n            break;\n        case 24:\n        case 25:\n            scalarType = ScalarType.FLOAT;\n            break;\n        case 26:\n        case 27:\n            scalarType = ScalarType.DOUBLE;\n            break;\n        case 28:\n        case 29:\n            scalarType = ScalarType.STRING;\n            break;\n        default:\n            return null;\n    }\n    const column = {};\n    column.nullable = (typeCode & 1) !== 0;\n    column.columnScope = ColumnScope.FEATURE;\n    const scalarCol = {};\n    scalarCol.type = \"physicalType\";\n    scalarCol.physicalType = scalarType;\n    column.type = \"scalarType\";\n    column.scalarType = scalarCol;\n    return column;\n}\n//# sourceMappingURL=typeMap.js.map","import { decodeVarintInt32 } from \"../../decoding/integerDecodingUtils\";\nimport { columnTypeHasChildren, columnTypeHasName, decodeColumnType } from \"./typeMap\";\nconst textDecoder = new TextDecoder();\n/**\n * Decodes a length-prefixed UTF-8 string.\n * Layout: [len: varint32][bytes: len]\n */\nfunction decodeString(src, offset) {\n    const length = decodeVarintInt32(src, offset, 1)[0];\n    if (length === 0) {\n        return \"\";\n    }\n    const start = offset.get();\n    const end = start + length;\n    const view = src.subarray(start, end);\n    offset.add(length);\n    return textDecoder.decode(view);\n}\n/**\n * Decodes a Field used as part of complex types (STRUCT children).\n * Unlike Column, Field still uses the fieldOptions bitfield for flexibility.\n */\nfunction decodeField(src, offset) {\n    const fieldOptions = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n    const isLogical = (fieldOptions & 4 /* FieldOptions.logicalType */) !== 0;\n    const isComplex = (fieldOptions & 2 /* FieldOptions.complexType */) !== 0;\n    const typeValue = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n    const field = {};\n    if ((fieldOptions & 1 /* FieldOptions.nullable */) !== 0) {\n        field.nullable = true;\n    }\n    if (isComplex) {\n        const complex = {};\n        if (isLogical) {\n            complex.type = \"logicalType\";\n            complex.logicalType = typeValue;\n        }\n        else {\n            complex.type = \"physicalType\";\n            complex.physicalType = typeValue;\n        }\n        if ((fieldOptions & 8 /* FieldOptions.hasChildren */) !== 0) {\n            const childCount = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n            complex.children = new Array(childCount);\n            for (let i = 0; i < childCount; i++) {\n                complex.children[i] = decodeField(src, offset);\n            }\n        }\n        field.type = \"complexField\";\n        field.complexField = complex;\n    }\n    else {\n        const scalar = {};\n        if (isLogical) {\n            scalar.type = \"logicalType\";\n            scalar.logicalType = typeValue;\n        }\n        else {\n            scalar.type = \"physicalType\";\n            scalar.physicalType = typeValue;\n        }\n        field.type = \"scalarField\";\n        field.scalarField = scalar;\n    }\n    return field;\n}\n/**\n * The typeCode encodes the column type, nullable flag, and whether it has name/children.\n */\nfunction decodeColumn(src, offset) {\n    const typeCode = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n    const column = decodeColumnType(typeCode);\n    if (!column) {\n        throw new Error(`Unsupported column type code: ${typeCode}`);\n    }\n    if (columnTypeHasName(typeCode)) {\n        column.name = decodeString(src, offset);\n    }\n    else {\n        // ID and GEOMETRY columns have implicit names\n        if (typeCode >= 0 && typeCode <= 3) {\n            column.name = \"id\";\n        }\n        else if (typeCode === 4) {\n            column.name = \"geometry\";\n        }\n    }\n    if (columnTypeHasChildren(typeCode)) {\n        // Only STRUCT (typeCode 30) has children\n        const childCount = decodeVarintInt32(src, offset, 1)[0] >>> 0;\n        const complexCol = column.complexType;\n        complexCol.children = new Array(childCount);\n        for (let i = 0; i < childCount; i++) {\n            complexCol.children[i] = decodeField(src, offset);\n        }\n    }\n    return column;\n}\n/**\n * Top-level decoder for embedded tileset metadata.\n * Reads exactly ONE FeatureTableSchema from the stream.\n *\n * @param bytes The byte array containing the metadata\n * @param offset The current offset in the byte array (will be advanced)\n */\nexport function decodeEmbeddedTileSetMetadata(bytes, offset) {\n    const meta = {};\n    meta.featureTables = [];\n    const table = {};\n    table.name = decodeString(bytes, offset);\n    const extent = decodeVarintInt32(bytes, offset, 1)[0] >>> 0;\n    const columnCount = decodeVarintInt32(bytes, offset, 1)[0] >>> 0;\n    table.columns = new Array(columnCount);\n    for (let j = 0; j < columnCount; j++) {\n        table.columns[j] = decodeColumn(bytes, offset);\n    }\n    meta.featureTables.push(table);\n    return [meta, extent];\n}\n//# sourceMappingURL=embeddedTilesetMetadataDecoder.js.map","import FeatureTable from \"./vector/featureTable\";\nimport { ScalarType } from \"./metadata/tileset/tilesetMetadata\";\nimport IntWrapper from \"./decoding/intWrapper\";\nimport { decodeStreamMetadata } from \"./metadata/tile/streamMetadataDecoder\";\nimport { VectorType } from \"./vector/vectorType\";\nimport { IntFlatVector } from \"./vector/flat/intFlatVector\";\nimport BitVector from \"./vector/flat/bitVector\";\nimport { decodeConstIntStream, decodeConstLongStream, decodeIntStream, decodeLongFloat64Stream, decodeLongStream, decodeSequenceIntStream, decodeSequenceLongStream, getVectorType, } from \"./decoding/integerStreamDecoder\";\nimport { IntSequenceVector } from \"./vector/sequence/intSequenceVector\";\nimport { LongFlatVector } from \"./vector/flat/longFlatVector\";\nimport { LongSequenceVector } from \"./vector/sequence/longSequenceVector\";\nimport { decodeVarintInt32 } from \"./decoding/integerDecodingUtils\";\nimport { decodeGeometryColumn } from \"./decoding/geometryDecoder\";\nimport { decodePropertyColumn } from \"./decoding/propertyDecoder\";\nimport { IntConstVector } from \"./vector/constant/intConstVector\";\nimport { LongConstVector } from \"./vector/constant/longConstVector\";\nimport { decodeBooleanRle } from \"./decoding/decodingUtils\";\nimport { DoubleFlatVector } from \"./vector/flat/doubleFlatVector\";\nimport { decodeEmbeddedTileSetMetadata } from \"./metadata/tileset/embeddedTilesetMetadataDecoder\";\nimport { hasStreamCount } from \"./metadata/tileset/typeMap\";\nconst ID_COLUMN_NAME = \"id\";\nconst GEOMETRY_COLUMN_NAME = \"geometry\";\n/**\n * Decodes a tile with embedded metadata (Tag 0x01 format).\n * This is the primary decoder function for MLT tiles.\n *\n * @param tile The tile data to decode (will be decompressed if gzip-compressed)\n * @param geometryScaling Optional geometry scaling parameters\n * @param idWithinMaxSafeInteger If true, limits ID values to JavaScript safe integer range (53 bits)\n */\nexport default function decodeTile(tile, geometryScaling, idWithinMaxSafeInteger = true) {\n    const offset = new IntWrapper(0);\n    const featureTables = [];\n    while (offset.get() < tile.length) {\n        const blockLength = decodeVarintInt32(tile, offset, 1)[0] >>> 0;\n        const blockStart = offset.get();\n        const blockEnd = blockStart + blockLength;\n        if (blockEnd > tile.length) {\n            throw new Error(`Block overruns tile: ${blockEnd} > ${tile.length}`);\n        }\n        const tag = decodeVarintInt32(tile, offset, 1)[0] >>> 0;\n        if (tag !== 1) {\n            // Skip unknown block types\n            offset.set(blockEnd);\n            continue;\n        }\n        // Decode embedded metadata and extent (one of each per block)\n        const decode = decodeEmbeddedTileSetMetadata(tile, offset);\n        const metadata = decode[0];\n        const extent = decode[1];\n        const featureTableMetadata = metadata.featureTables[0];\n        // Decode columns from streams\n        let idVector = null;\n        let geometryVector = null;\n        const propertyVectors = [];\n        let numFeatures = 0;\n        for (const columnMetadata of featureTableMetadata.columns) {\n            const columnName = columnMetadata.name;\n            if (columnName === ID_COLUMN_NAME) {\n                let nullabilityBuffer = null;\n                // Check column metadata nullable flag, not numStreams (ID columns don't have stream count)\n                if (columnMetadata.nullable) {\n                    const presentStreamMetadata = decodeStreamMetadata(tile, offset);\n                    const streamDataStart = offset.get();\n                    const values = decodeBooleanRle(tile, presentStreamMetadata.numValues, offset);\n                    // Fix offset: decodeBooleanRle doesn't consume all compressed bytes\n                    offset.set(streamDataStart + presentStreamMetadata.byteLength);\n                    nullabilityBuffer = new BitVector(values, presentStreamMetadata.numValues);\n                }\n                const idDataStreamMetadata = decodeStreamMetadata(tile, offset);\n                numFeatures = idDataStreamMetadata.decompressedCount;\n                idVector = decodeIdColumn(tile, columnMetadata, offset, columnName, idDataStreamMetadata, nullabilityBuffer ?? numFeatures, idWithinMaxSafeInteger);\n            }\n            else if (columnName === GEOMETRY_COLUMN_NAME) {\n                const numStreams = decodeVarintInt32(tile, offset, 1)[0];\n                // If no ID column, get numFeatures from geometry type stream metadata\n                if (numFeatures === 0) {\n                    const savedOffset = offset.get();\n                    const geometryTypeMetadata = decodeStreamMetadata(tile, offset);\n                    numFeatures = geometryTypeMetadata.decompressedCount;\n                    offset.set(savedOffset); // Reset to re-read in decodeGeometryColumn\n                }\n                if (geometryScaling) {\n                    geometryScaling.scale = geometryScaling.extent / extent;\n                }\n                geometryVector = decodeGeometryColumn(tile, numStreams, offset, numFeatures, geometryScaling);\n            }\n            else {\n                // Property columns: STRING and STRUCT have stream count, others don't\n                const hasStreamCnt = hasStreamCount(columnMetadata);\n                const numStreams = hasStreamCnt ? decodeVarintInt32(tile, offset, 1)[0] : 1;\n                if (numStreams === 0 && columnMetadata.type === \"scalarType\") {\n                    continue;\n                }\n                const propertyVector = decodePropertyColumn(tile, offset, columnMetadata, numStreams, numFeatures, undefined);\n                if (propertyVector) {\n                    if (Array.isArray(propertyVector)) {\n                        for (const property of propertyVector) {\n                            propertyVectors.push(property);\n                        }\n                    }\n                    else {\n                        propertyVectors.push(propertyVector);\n                    }\n                }\n            }\n        }\n        const featureTable = new FeatureTable(featureTableMetadata.name, geometryVector, idVector, propertyVectors, extent);\n        featureTables.push(featureTable);\n        offset.set(blockEnd);\n    }\n    return featureTables;\n}\nfunction decodeIdColumn(tile, columnMetadata, offset, columnName, idDataStreamMetadata, sizeOrNullabilityBuffer, idWithinMaxSafeInteger = false) {\n    const idDataType = columnMetadata.scalarType.physicalType;\n    const vectorType = getVectorType(idDataStreamMetadata, sizeOrNullabilityBuffer, tile, offset);\n    if (idDataType === ScalarType.UINT_32) {\n        switch (vectorType) {\n            case VectorType.FLAT: {\n                const id = decodeIntStream(tile, offset, idDataStreamMetadata, false);\n                return new IntFlatVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n            case VectorType.SEQUENCE: {\n                const id = decodeSequenceIntStream(tile, offset, idDataStreamMetadata);\n                return new IntSequenceVector(columnName, id[0], id[1], idDataStreamMetadata.numRleValues);\n            }\n            case VectorType.CONST: {\n                const id = decodeConstIntStream(tile, offset, idDataStreamMetadata, false);\n                return new IntConstVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n        }\n    }\n    else {\n        switch (vectorType) {\n            case VectorType.FLAT: {\n                if (idWithinMaxSafeInteger) {\n                    const id = decodeLongFloat64Stream(tile, offset, idDataStreamMetadata, false);\n                    return new DoubleFlatVector(columnName, id, sizeOrNullabilityBuffer);\n                }\n                const id = decodeLongStream(tile, offset, idDataStreamMetadata, false);\n                return new LongFlatVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n            case VectorType.SEQUENCE: {\n                const id = decodeSequenceLongStream(tile, offset, idDataStreamMetadata);\n                return new LongSequenceVector(columnName, id[0], id[1], idDataStreamMetadata.numRleValues);\n            }\n            case VectorType.CONST: {\n                const id = decodeConstLongStream(tile, offset, idDataStreamMetadata, false);\n                return new LongConstVector(columnName, id, sizeOrNullabilityBuffer);\n            }\n        }\n    }\n    throw new Error(\"Vector type not supported for id column.\");\n}\n//# sourceMappingURL=mltDecoder.js.map","import Point from '@mapbox/point-geometry';\nimport {type FeatureTable, decodeTile, type Feature as MLTFeature, GEOMETRY_TYPE} from '@maplibre/mlt';\nimport type {VectorTileFeatureLike, VectorTileLayerLike, VectorTileLike} from '@maplibre/vt-pbf';\n\nclass MLTVectorTileFeature implements VectorTileFeatureLike {\n    _featureData: MLTFeature;\n    properties: {[_: string]: any};\n    type: VectorTileFeatureLike['type'];\n    extent: VectorTileFeatureLike['extent'];\n    id: VectorTileFeatureLike['id'];\n\n    constructor(feature: MLTFeature, extent: number) {\n        this._featureData = feature;\n        this.properties = this._featureData.properties || {};\n        switch (this._featureData.geometry?.type) {\n            case GEOMETRY_TYPE.POINT:\n            case GEOMETRY_TYPE.MULTIPOINT:\n                this.type = 1;\n                break;\n            case GEOMETRY_TYPE.LINESTRING:\n            case GEOMETRY_TYPE.MULTILINESTRING:\n                this.type = 2;\n                break;\n            case GEOMETRY_TYPE.POLYGON:\n            case GEOMETRY_TYPE.MULTIPOLYGON:\n                this.type = 3;\n                break;\n            default:\n                this.type = 0;\n        };\n        this.extent = extent;\n        this.id = Number(this._featureData.id);\n    }\n\n    loadGeometry(): Point[][] {\n        const points: Point[][] = [];\n        for (const ring of this._featureData.geometry.coordinates) {\n            const pointRing: Point[] = [];\n            for (const coord of ring) {\n                pointRing.push(new Point(coord.x, coord.y));\n            }\n            points.push(pointRing);\n        }\n        return points;\n    }\n}\n\nclass MLTVectorTileLayer implements VectorTileLayerLike {\n    featureTable: FeatureTable;\n    name: string;\n    length: number;\n    version: number;\n    extent: number;\n    features: MLTFeature[] = [];\n    \n    constructor(featureTable: FeatureTable) {\n        this.featureTable = featureTable;\n        this.name = featureTable.name;\n        this.extent = featureTable.extent;\n        this.version = 2;\n        this.features = featureTable.getFeatures();\n        this.length = this.features.length;\n    }\n\n    feature(i: number): VectorTileFeatureLike {\n        return new MLTVectorTileFeature(this.features[i], this.extent);\n    }\n}\n\nexport class MLTVectorTile implements VectorTileLike {\n    layers: Record<string, VectorTileLayerLike> = {};\n\n    constructor(buffer: ArrayBuffer) {\n        const features = decodeTile(new Uint8Array(buffer));\n        this.layers = features.reduce((acc, f) => ({...acc, [f.name]: new MLTVectorTileLayer(f)}), {});\n    }\n}\n","import Point from '@mapbox/point-geometry';\nimport {type Point2D} from '@maplibre/maplibre-gl-style-spec';\n\nexport interface ReadOnlyBounds {\n    readonly minX: number;\n    readonly maxX: number;\n    readonly minY: number;\n    readonly maxY: number;\n\n    /**\n     * Returns whether this bounding box contains a point\n     * \n     * @param point - The point to check\n     * @returns True if this bounding box contains point, false otherwise.\n     */\n    contains(point: Point2D): boolean;\n\n    /**\n     * Returns true if this bounding box contains no points\n     * \n     * @returns True if this bounding box contains no points.\n     */\n    empty(): boolean;\n\n    /**\n     * Returns the width of this bounding box.\n     * \n     * @returns `maxX - minX`.\n     */\n    width(): number;\n\n    /**\n     * Returns the height of this bounding box.\n     * \n     * @returns `maxY - minY`.\n     */\n    height(): number;\n\n    /**\n     * Returns true if this bounding box completely covers `other`.\n     * \n     * @param other - The other bounding box\n     * @returns True if this bounding box completely encloses `other`\n     */\n    covers(other: ReadOnlyBounds): boolean;\n\n    /**\n     * Returns true if this bounding box touches any part of `other`.\n     * \n     * @param other - The other bounding box\n     * @returns True if this bounding box touches any part of `other`.\n     */\n    intersects(other: ReadOnlyBounds): boolean;\n}\n\n/** A 2-d bounding box covering an X and Y range. */\nexport class Bounds implements ReadOnlyBounds {\n    minX: number = Infinity;\n    maxX: number = -Infinity;\n    minY: number = Infinity;\n    maxY: number = -Infinity;\n\n    /**\n     * Expands this bounding box to include point.\n     * \n     * @param point - The point to include in this bounding box\n     * @returns This mutated bounding box\n     */\n    extend(point: Point2D): this {\n        this.minX = Math.min(this.minX, point.x);\n        this.minY = Math.min(this.minY, point.y);\n        this.maxX = Math.max(this.maxX, point.x);\n        this.maxY = Math.max(this.maxY, point.y);\n        return this;\n    }\n\n    /**\n     * Expands this bounding box by a fixed amount in each direction.\n     * \n     * @param amount - The amount to expand the box by, or contract if negative\n     * @returns This mutated bounding box\n     */\n    expandBy(amount: number): this {\n        this.minX -= amount;\n        this.minY -= amount;\n        this.maxX += amount;\n        this.maxY += amount;\n        // check if bounds collapsed in either dimension\n        if (this.minX > this.maxX || this.minY > this.maxY) {\n            this.minX = Infinity;\n            this.maxX = -Infinity;\n            this.minY = Infinity;\n            this.maxY = -Infinity;\n        }\n        return this;\n    }\n\n    /**\n     * Shrinks this bounding box by a fixed amount in each direction.\n     * \n     * @param amount - The amount to shrink the box by\n     * @returns This mutated bounding box\n     */\n    shrinkBy(amount: number): this {\n        return this.expandBy(-amount);\n    }\n\n    /**\n     * Returns a new bounding box that contains all of the corners of this bounding\n     * box with a transform applied. Does not modify this bounding box.\n     * \n     * @param fn - The function to apply to each corner\n     * @returns A new bounding box containing all of the mapped points.\n     */\n    map(fn: (point: Point2D) => Point2D) {\n        const result = new Bounds();\n        result.extend(fn(new Point(this.minX, this.minY)));\n        result.extend(fn(new Point(this.maxX, this.minY)));\n        result.extend(fn(new Point(this.minX, this.maxY)));\n        result.extend(fn(new Point(this.maxX, this.maxY)));\n        return result;\n    }\n\n    /**\n     * Creates a new bounding box that includes all points provided.\n     * \n     * @param points - The points to include inside the bounding box\n     * @returns The new bounding box\n     */\n    static fromPoints(points: Point2D[]): Bounds {\n        const result = new Bounds();\n        for (const p of points) {\n            result.extend(p);\n        }\n        return result;\n    }\n\n    contains(point: Point2D): boolean {\n        return point.x >= this.minX && point.x <= this.maxX && point.y >= this.minY && point.y <= this.maxY;\n    }\n\n    empty(): boolean {\n        return this.minX > this.maxX;\n    }\n\n    width(): number {\n        return this.maxX - this.minX;\n    }\n\n    height(): number {\n        return this.maxY - this.minY;\n    }\n\n    covers(other: ReadOnlyBounds) {\n        return !this.empty() && !other.empty() &&\n            other.minX >= this.minX &&\n            other.maxX <= this.maxX &&\n            other.minY >= this.minY &&\n            other.maxY <= this.maxY;\n    }\n\n    intersects(other: ReadOnlyBounds) {\n        return !this.empty() && !other.empty() &&\n            other.minX <= this.maxX &&\n            other.maxX >= this.minX &&\n            other.minY <= this.maxY &&\n            other.maxY >= this.minY;\n    }\n}\n","import Pbf from 'pbf';\nimport Point from '@mapbox/point-geometry';\n\nclass FeatureWrapper {\n    constructor(feature, extent) {\n        this.feature = feature;\n        this.type = feature.type;\n        this.properties = feature.tags ? feature.tags : {};\n        this.extent = extent;\n        // If the feature has a top-level `id` property, copy it over, but only\n        // if it can be coerced to an integer, because this wrapper is used for\n        // serializing geojson feature data into vector tile PBF data, and the\n        // vector tile spec only supports integer values for feature ids --\n        // allowing non-integer values here results in a non-compliant PBF\n        // that causes an exception when it is parsed with vector-tile-js\n        if ('id' in feature) {\n            if (typeof feature.id === 'string') {\n                this.id = parseInt(feature.id, 10);\n            }\n            else if (typeof feature.id === 'number' && !isNaN(feature.id)) {\n                this.id = feature.id;\n            }\n        }\n    }\n    loadGeometry() {\n        const geometry = [];\n        const rawGeo = this.feature.type === 1 ? [this.feature.geometry] : this.feature.geometry;\n        for (const ring of rawGeo) {\n            const newRing = [];\n            for (const point of ring) {\n                newRing.push(new Point(point[0], point[1]));\n            }\n            geometry.push(newRing);\n        }\n        return geometry;\n    }\n}\nconst GEOJSON_TILE_LAYER_NAME = \"_geojsonTileLayer\";\nclass GeoJSONWrapper {\n    constructor(features, options) {\n        this.layers = { [GEOJSON_TILE_LAYER_NAME]: this };\n        this.name = GEOJSON_TILE_LAYER_NAME;\n        this.version = options ? options.version : 1;\n        this.extent = options ? options.extent : 4096;\n        this.length = features.length;\n        this.features = features;\n    }\n    feature(i) {\n        return new FeatureWrapper(this.features[i], this.extent);\n    }\n}\n\n/**\n * Serialize a vector-tile-js-created tile to pbf\n *\n * @param tile\n * @return uncompressed, pbf-serialized tile data\n */\nfunction fromVectorTileJs(tile) {\n    const out = new Pbf();\n    writeTile(tile, out);\n    return out.finish();\n}\n/**\n * Serialized a geojson-vt-created tile to pbf.\n *\n * @param layers - An object mapping layer names to geojson-vt-created vector tile objects\n * @param options - An object specifying the vector-tile specification version and extent that were used to create `layers`.\n * @return uncompressed, pbf-serialized tile data\n */\nfunction fromGeojsonVt(layers, options) {\n    const l = {};\n    // eslint-disable-next-line @typescript-eslint/no-for-in-array\n    for (const k in layers) {\n        l[k] = new GeoJSONWrapper(layers[k].features, options);\n        l[k].name = k;\n        l[k].version = options ? options.version : 1;\n        l[k].extent = options ? options.extent : 4096;\n    }\n    return fromVectorTileJs({ layers: l });\n}\nfunction writeTile(tile, pbf) {\n    for (const key in tile.layers) {\n        pbf.writeMessage(3, writeLayer, tile.layers[key]);\n    }\n}\nfunction writeLayer(layer, pbf) {\n    pbf.writeVarintField(15, layer.version || 1);\n    pbf.writeStringField(1, layer.name || '');\n    pbf.writeVarintField(5, layer.extent || 4096);\n    const context = {\n        keys: [],\n        values: [],\n        keycache: {},\n        valuecache: {}\n    };\n    for (let i = 0; i < layer.length; i++) {\n        context.feature = layer.feature(i);\n        pbf.writeMessage(2, writeFeature, context);\n    }\n    const keys = context.keys;\n    for (const key of keys) {\n        pbf.writeStringField(3, key);\n    }\n    const values = context.values;\n    for (const value of values) {\n        pbf.writeMessage(4, writeValue, value);\n    }\n}\nfunction writeFeature(context, pbf) {\n    if (!context.feature) {\n        return;\n    }\n    const feature = context.feature;\n    if (feature.id !== undefined) {\n        pbf.writeVarintField(1, feature.id);\n    }\n    pbf.writeMessage(2, writeProperties, context);\n    pbf.writeVarintField(3, feature.type);\n    pbf.writeMessage(4, writeGeometry, feature);\n}\nfunction writeProperties(context, pbf) {\n    for (const key in context.feature?.properties) {\n        let value = context.feature.properties[key];\n        let keyIndex = context.keycache[key];\n        if (value == null)\n            continue; // don't encode null/undefined value properties\n        if (typeof keyIndex === 'undefined') {\n            context.keys.push(key);\n            keyIndex = context.keys.length - 1;\n            context.keycache[key] = keyIndex;\n        }\n        pbf.writeVarint(keyIndex);\n        if (typeof value !== 'string' && typeof value !== 'boolean' && typeof value !== 'number') {\n            value = JSON.stringify(value);\n        }\n        const valueKey = typeof value + ':' + value;\n        let valueIndex = context.valuecache[valueKey];\n        if (typeof valueIndex === 'undefined') {\n            context.values.push(value);\n            valueIndex = context.values.length - 1;\n            context.valuecache[valueKey] = valueIndex;\n        }\n        pbf.writeVarint(valueIndex);\n    }\n}\nfunction command(cmd, length) {\n    return (length << 3) + (cmd & 0x7);\n}\nfunction zigzag(num) {\n    return (num << 1) ^ (num >> 31);\n}\nfunction writeGeometry(feature, pbf) {\n    const geometry = feature.loadGeometry();\n    const type = feature.type;\n    let x = 0;\n    let y = 0;\n    for (const ring of geometry) {\n        let count = 1;\n        if (type === 1) {\n            count = ring.length;\n        }\n        pbf.writeVarint(command(1, count)); // moveto\n        // do not write polygon closing path as lineto\n        const lineCount = type === 3 ? ring.length - 1 : ring.length;\n        for (let i = 0; i < lineCount; i++) {\n            if (i === 1 && type !== 1) {\n                pbf.writeVarint(command(2, lineCount - 1)); // lineto\n            }\n            const dx = ring[i].x - x;\n            const dy = ring[i].y - y;\n            pbf.writeVarint(zigzag(dx));\n            pbf.writeVarint(zigzag(dy));\n            x += dx;\n            y += dy;\n        }\n        if (feature.type === 3) {\n            pbf.writeVarint(command(7, 1)); // closepath\n        }\n    }\n}\nfunction writeValue(value, pbf) {\n    const type = typeof value;\n    if (type === 'string') {\n        pbf.writeStringField(1, value);\n    }\n    else if (type === 'boolean') {\n        pbf.writeBooleanField(7, value);\n    }\n    else if (type === 'number') {\n        if (value % 1 !== 0) {\n            pbf.writeDoubleField(3, value);\n        }\n        else if (value < 0) {\n            pbf.writeSVarintField(6, value);\n        }\n        else {\n            pbf.writeVarintField(5, value);\n        }\n    }\n}\n\nexport { GEOJSON_TILE_LAYER_NAME, GeoJSONWrapper, fromGeojsonVt, fromVectorTileJs };\n//# sourceMappingURL=index.es.js.map\n","import type Point from '@mapbox/point-geometry';\nimport {loadGeometry} from './load_geometry';\nimport {toEvaluationFeature} from './evaluation_feature';\nimport {EXTENT} from './extent';\nimport {featureFilter} from '@maplibre/maplibre-gl-style-spec';\nimport {TransferableGridIndex} from '../util/transferable_grid_index';\nimport {DictionaryCoder} from '../util/dictionary_coder';\nimport Protobuf from 'pbf';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson';\nimport {mapObject, extend} from '../util/util';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {polygonIntersectsBox} from '../util/intersection_tests';\nimport {PossiblyEvaluated} from '../style/properties';\nimport {FeatureIndexArray} from './array_types.g';\n\nimport {MLTVectorTile} from '../source/vector_tile_mlt';\nimport {Bounds} from '../geo/bounds';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {SourceFeatureState} from '../source/source_state';\nimport type {mat4} from 'gl-matrix';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {FeatureFilter, FeatureState, FilterSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport {type VectorTileFeatureLike, type VectorTileLayerLike, GEOJSON_TILE_LAYER_NAME} from '@maplibre/vt-pbf';\nimport {VectorTile} from '@mapbox/vector-tile';\n\nexport {GEOJSON_TILE_LAYER_NAME};\n\ntype QueryParameters = {\n    scale: number;\n    pixelPosMatrix: mat4;\n    transform: IReadonlyTransform;\n    tileSize: number;\n    queryGeometry: Array<Point>;\n    cameraQueryGeometry: Array<Point>;\n    queryPadding: number;\n    getElevation: undefined | ((x: number, y: number) => number);\n    params: {\n        filter?: FilterSpecification;\n        layers?: Set<string> | null;\n        availableImages?: Array<string>;\n        globalState?: Record<string, any>;\n    };\n};\n\nexport type QueryResults = {\n    [_: string]: QueryResultsItem[];\n};\n\nexport type QueryResultsItem = {\n    featureIndex: number;\n    feature: GeoJSONFeature;\n    intersectionZ?: boolean | number;\n};\n\n/**\n * An in memory index class to allow fast interaction with features\n */\nexport class FeatureIndex {\n    tileID: OverscaledTileID;\n    x: number;\n    y: number;\n    z: number;\n    grid: TransferableGridIndex;\n    grid3D: TransferableGridIndex;\n    featureIndexArray: FeatureIndexArray;\n    promoteId?: PromoteIdSpecification;\n    encoding: string;\n    rawTileData: ArrayBuffer;\n    bucketLayerIDs: Array<Array<string>>;\n\n    vtLayers: {[_: string]: VectorTileLayerLike};\n    sourceLayerCoder: DictionaryCoder;\n\n    constructor(tileID: OverscaledTileID, promoteId?: PromoteIdSpecification | null) {\n        this.tileID = tileID;\n        this.x = tileID.canonical.x;\n        this.y = tileID.canonical.y;\n        this.z = tileID.canonical.z;\n        this.grid = new TransferableGridIndex(EXTENT, 16, 0);\n        this.grid3D = new TransferableGridIndex(EXTENT, 16, 0);\n        this.featureIndexArray = new FeatureIndexArray();\n        this.promoteId = promoteId;\n    }\n\n    insert(feature: VectorTileFeatureLike, geometry: Array<Array<Point>>, featureIndex: number, sourceLayerIndex: number, bucketIndex: number, is3D?: boolean) {\n        const key = this.featureIndexArray.length;\n        this.featureIndexArray.emplaceBack(featureIndex, sourceLayerIndex, bucketIndex);\n\n        const grid = is3D ? this.grid3D : this.grid;\n\n        for (let r = 0; r < geometry.length; r++) {\n            const ring = geometry[r];\n\n            const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n            for (let i = 0; i < ring.length; i++) {\n                const p = ring[i];\n                bbox[0] = Math.min(bbox[0], p.x);\n                bbox[1] = Math.min(bbox[1], p.y);\n                bbox[2] = Math.max(bbox[2], p.x);\n                bbox[3] = Math.max(bbox[3], p.y);\n            }\n\n            if (bbox[0] < EXTENT &&\n                bbox[1] < EXTENT &&\n                bbox[2] >= 0 &&\n                bbox[3] >= 0) {\n                grid.insert(key, bbox[0], bbox[1], bbox[2], bbox[3]);\n            }\n        }\n    }\n\n    loadVTLayers(): {[_: string]: VectorTileLayerLike} {\n        if (!this.vtLayers) {\n            this.vtLayers = this.encoding !== 'mlt' \n                ? new VectorTile(new Protobuf(this.rawTileData)).layers\n                : new MLTVectorTile(this.rawTileData).layers;\n            this.sourceLayerCoder = new DictionaryCoder(this.vtLayers ? Object.keys(this.vtLayers).sort() : [GEOJSON_TILE_LAYER_NAME]);\n        }\n        return this.vtLayers;\n    }\n\n    // Finds non-symbol features in this tile at a particular position.\n    query(\n        args: QueryParameters,\n        styleLayers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState: SourceFeatureState\n    ): QueryResults {\n        this.loadVTLayers();\n\n        const params = args.params;\n        const pixelsToTileUnits = EXTENT / args.tileSize / args.scale;\n        const filter = featureFilter(params.filter, params.globalState);\n\n        const queryGeometry = args.queryGeometry;\n        const queryPadding = args.queryPadding * pixelsToTileUnits;\n\n        const bounds = Bounds.fromPoints(queryGeometry);\n        const matching = this.grid.query(bounds.minX - queryPadding, bounds.minY - queryPadding, bounds.maxX + queryPadding, bounds.maxY + queryPadding);\n\n        const cameraBounds = Bounds.fromPoints(args.cameraQueryGeometry).expandBy(queryPadding);\n        const matching3D = this.grid3D.query(\n            cameraBounds.minX, cameraBounds.minY, cameraBounds.maxX, cameraBounds.maxY,\n            (bx1, by1, bx2, by2) => {\n                return polygonIntersectsBox(args.cameraQueryGeometry, bx1 - queryPadding, by1 - queryPadding, bx2 + queryPadding, by2 + queryPadding);\n            });\n\n        for (const key of matching3D) {\n            matching.push(key);\n        }\n\n        matching.sort(topDownFeatureComparator);\n\n        const result: QueryResults = {};\n        let previousIndex;\n        for (let k = 0; k < matching.length; k++) {\n            const index = matching[k];\n\n            // don't check the same feature more than once\n            if (index === previousIndex) continue;\n            previousIndex = index;\n\n            const match = this.featureIndexArray.get(index);\n            let featureGeometry = null;\n            this.loadMatchingFeature(\n                result,\n                match.bucketIndex,\n                match.sourceLayerIndex,\n                match.featureIndex,\n                filter,\n                params.layers,\n                params.availableImages,\n                styleLayers,\n                serializedLayers,\n                sourceFeatureState,\n                (feature: VectorTileFeatureLike, styleLayer: StyleLayer, featureState: FeatureState) => {\n                    if (!featureGeometry) {\n                        featureGeometry = loadGeometry(feature);\n                    }\n\n                    return styleLayer.queryIntersectsFeature({\n                        queryGeometry,\n                        feature,\n                        featureState,\n                        geometry: featureGeometry,\n                        zoom: this.z,\n                        transform: args.transform,\n                        pixelsToTileUnits,\n                        pixelPosMatrix: args.pixelPosMatrix,\n                        unwrappedTileID: this.tileID.toUnwrapped(),\n                        getElevation: args.getElevation\n                    });\n                }\n            );\n        }\n\n        return result;\n    }\n\n    loadMatchingFeature(\n        result: QueryResults,\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        featureIndex: number,\n        filter: FeatureFilter,\n        filterLayerIDs: Set<string> | undefined,\n        availableImages: Array<string>,\n        styleLayers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState?: SourceFeatureState,\n        intersectionTest?: (\n            feature: VectorTileFeatureLike,\n            styleLayer: StyleLayer,\n            featureState: any,\n            id: string | number | void\n        ) => boolean | number) {\n\n        const layerIDs = this.bucketLayerIDs[bucketIndex];\n        if (filterLayerIDs && !layerIDs.some(id => filterLayerIDs.has(id)))\n            return;\n\n        const sourceLayerName = this.sourceLayerCoder.decode(sourceLayerIndex);\n        const sourceLayer = this.vtLayers[sourceLayerName];\n        const feature = sourceLayer.feature(featureIndex);\n\n        if (filter.needGeometry) {\n            const evaluationFeature = toEvaluationFeature(feature, true);\n            if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), evaluationFeature, this.tileID.canonical)) {\n                return;\n            }\n        } else if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), feature)) {\n            return;\n        }\n\n        const id = this.getId(feature, sourceLayerName);\n\n        for (let l = 0; l < layerIDs.length; l++) {\n            const layerID = layerIDs[l];\n\n            if (filterLayerIDs && !filterLayerIDs.has(layerID)) {\n                continue;\n            }\n\n            const styleLayer = styleLayers[layerID];\n\n            if (!styleLayer) continue;\n\n            let featureState = {};\n            if (id && sourceFeatureState) {\n                // `feature-state` expression evaluation requires feature state to be available\n                featureState = sourceFeatureState.getState(styleLayer.sourceLayer || GEOJSON_TILE_LAYER_NAME, id);\n            }\n\n            const serializedLayer = extend({}, serializedLayers[layerID]);\n\n            serializedLayer.paint = evaluateProperties(serializedLayer.paint, styleLayer.paint, feature, featureState, availableImages);\n            serializedLayer.layout = evaluateProperties(serializedLayer.layout, styleLayer.layout, feature, featureState, availableImages);\n\n            const intersectionZ = !intersectionTest || intersectionTest(feature, styleLayer, featureState);\n            if (!intersectionZ) {\n                // Only applied for non-symbol features\n                continue;\n            }\n\n            const geojsonFeature = new GeoJSONFeature(feature, this.z, this.x, this.y, id) as MapGeoJSONFeature;\n            geojsonFeature.layer = serializedLayer;\n            let layerResult = result[layerID];\n            if (layerResult === undefined) {\n                layerResult = result[layerID] = [];\n            }\n            layerResult.push({featureIndex, feature: geojsonFeature, intersectionZ});\n        }\n    }\n\n    // Given a set of symbol indexes that have already been looked up,\n    // return a matching set of GeoJSONFeatures\n    lookupSymbolFeatures(symbolFeatureIndexes: Array<number>,\n        serializedLayers: {[_: string]: StyleLayer},\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        filterParams: {\n            filterSpec: FilterSpecification;\n            globalState: Record<string, any>;\n        },\n        filterLayerIDs: Set<string> | null,\n        availableImages: Array<string>,\n        styleLayers: {[_: string]: StyleLayer}): QueryResults {\n        const result: QueryResults = {};\n        this.loadVTLayers();\n\n        const filter = featureFilter(filterParams.filterSpec, filterParams.globalState);\n\n        for (const symbolFeatureIndex of symbolFeatureIndexes) {\n            this.loadMatchingFeature(\n                result,\n                bucketIndex,\n                sourceLayerIndex,\n                symbolFeatureIndex,\n                filter,\n                filterLayerIDs,\n                availableImages,\n                styleLayers,\n                serializedLayers\n            );\n\n        }\n        return result;\n    }\n\n    hasLayer(id: string) {\n        for (const layerIDs of this.bucketLayerIDs) {\n            for (const layerID of layerIDs) {\n                if (id === layerID) return true;\n            }\n        }\n\n        return false;\n    }\n\n    getId(feature: VectorTileFeatureLike, sourceLayerId: string): string | number {\n        let id: string | number = feature.id;\n        if (this.promoteId) {\n            const propName = typeof this.promoteId === 'string' ? this.promoteId : this.promoteId[sourceLayerId];\n            id = feature.properties[propName] as string | number;\n            if (typeof id === 'boolean') id = Number(id);\n\n            // When cluster is true, the id is the cluster_id even though promoteId is set\n            if (id === undefined && feature.properties?.cluster && this.promoteId) {\n                id = Number(feature.properties.cluster_id);\n            }\n        }\n        return id;\n    }\n}\n\nregister(\n    'FeatureIndex',\n    FeatureIndex,\n    {omit: ['rawTileData', 'sourceLayerCoder']}\n);\n\nfunction evaluateProperties(serializedProperties, styleLayerProperties, feature, featureState, availableImages) {\n    return mapObject(serializedProperties, (property, key) => {\n        const prop = styleLayerProperties instanceof PossiblyEvaluated ? styleLayerProperties.get(key) : null;\n        return prop && prop.evaluate ? prop.evaluate(feature, featureState, availableImages) : prop;\n    });\n}\n\nfunction topDownFeatureComparator(a, b) {\n    return b - a;\n}\n","import {createStyleLayer} from './create_style_layer';\nimport {featureFilter, groupByLayout} from '@maplibre/maplibre-gl-style-spec';\nimport {GEOJSON_TILE_LAYER_NAME} from '../data/feature_index';\nimport type {StyleLayer} from './style_layer';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LayerConfigs = {[_: string]: LayerSpecification};\n\nexport class StyleLayerIndex {\n    familiesBySource: {\n        [source: string]: {\n            [sourceLayer: string]: Array<Array<StyleLayer>>;\n        };\n    };\n    keyCache: {[source: string]: string};\n\n    _layerConfigs: LayerConfigs;\n    _layers: {[_: string]: StyleLayer};\n\n    constructor(layerConfigs?: Array<LayerSpecification> | null, globalState?: Record<string, any>) {\n        this.keyCache = {};\n        if (layerConfigs) {\n            this.replace(layerConfigs, globalState);\n        }\n    }\n\n    replace(layerConfigs: Array<LayerSpecification>, globalState?: Record<string, any>) {\n        this._layerConfigs = {};\n        this._layers = {};\n        this.update(layerConfigs, [], globalState);\n    }\n\n    update(layerConfigs: Array<LayerSpecification>, removedIds: Array<string>, globalState?: Record<string, any>) {\n        for (const layerConfig of layerConfigs) {\n            this._layerConfigs[layerConfig.id] = layerConfig;\n\n            const layer = this._layers[layerConfig.id] = createStyleLayer(layerConfig, globalState);\n            layer._featureFilter = featureFilter(layer.filter, globalState);\n            if (this.keyCache[layerConfig.id])\n                delete this.keyCache[layerConfig.id];\n        }\n        for (const id of removedIds) {\n            delete this.keyCache[id];\n            delete this._layerConfigs[id];\n            delete this._layers[id];\n        }\n\n        this.familiesBySource = {};\n\n        const groups = groupByLayout(Object.values(this._layerConfigs), this.keyCache);\n\n        for (const layerConfigs of groups) {\n            const layers = layerConfigs.map((layerConfig) => this._layers[layerConfig.id]);\n\n            const layer = layers[0];\n            if (layer.isHidden()) {\n                continue;\n            }\n\n            const sourceId = layer.source || '';\n            let sourceGroup = this.familiesBySource[sourceId];\n            if (!sourceGroup) {\n                sourceGroup = this.familiesBySource[sourceId] = {};\n            }\n\n            const sourceLayerId = layer.sourceLayer || GEOJSON_TILE_LAYER_NAME;\n            let sourceLayerFamilies = sourceGroup[sourceLayerId];\n            if (!sourceLayerFamilies) {\n                sourceLayerFamilies = sourceGroup[sourceLayerId] = [];\n            }\n\n            sourceLayerFamilies.push(layers);\n        }\n    }\n}\n","import Point from '@mapbox/point-geometry';\n\nimport {register} from '../util/web_worker_transfer';\n\nexport class Anchor extends Point {\n    angle: any;\n    segment?: number;\n\n    constructor(x: number, y: number, angle: number, segment?: number) {\n        super(x, y);\n        this.angle = angle;\n        if (segment !== undefined) {\n            this.segment = segment;\n        }\n    }\n\n    clone() {\n        return new Anchor(this.x, this.y, this.angle, this.segment);\n    }\n}\n\nregister('Anchor', Anchor);\n","import type Point from '@mapbox/point-geometry';\nimport type {Anchor} from './anchor';\n\n/**\n * Labels placed around really sharp angles aren't readable. Check if any\n * part of the potential label has a combined angle that is too big.\n *\n * @param line - The line to check\n * @param anchor - The point on the line around which the label is anchored.\n * @param labelLength - The length of the label in geometry units.\n * @param windowSize - The check fails if the combined angles within a part of the line that is `windowSize` long is too big.\n * @param maxAngle - The maximum combined angle that any window along the label is allowed to have.\n *\n * @returns whether the label should be placed\n */\nexport function checkMaxAngle(line: Array<Point>, anchor: Anchor, labelLength: number, windowSize: number, maxAngle: number) {\n\n    // horizontal labels and labels with length 0 always pass\n    if (anchor.segment === undefined || labelLength === 0) return true;\n\n    let p = anchor;\n    let index = anchor.segment + 1;\n    let anchorDistance = 0;\n\n    // move backwards along the line to the first segment the label appears on\n    while (anchorDistance > -labelLength / 2) {\n        index--;\n\n        // there isn't enough room for the label after the beginning of the line\n        if (index < 0) return false;\n\n        anchorDistance -= line[index].dist(p);\n        p = line[index];\n    }\n\n    anchorDistance += line[index].dist(line[index + 1]);\n    index++;\n\n    // store recent corners and their total angle difference\n    const recentCorners = [];\n    let recentAngleDelta = 0;\n\n    // move forwards by the length of the label and check angles along the way\n    while (anchorDistance < labelLength / 2) {\n        const prev = line[index - 1];\n        const current = line[index];\n        const next = line[index + 1];\n\n        // there isn't enough room for the label before the end of the line\n        if (!next) return false;\n\n        let angleDelta = prev.angleTo(current) - current.angleTo(next);\n        // restrict angle to -pi..pi range\n        angleDelta = Math.abs(((angleDelta + 3 * Math.PI) % (Math.PI * 2)) - Math.PI);\n\n        recentCorners.push({\n            distance: anchorDistance,\n            angleDelta\n        });\n        recentAngleDelta += angleDelta;\n\n        // remove corners that are far enough away from the list of recent anchors\n        while (anchorDistance - recentCorners[0].distance > windowSize) {\n            recentAngleDelta -= recentCorners.shift().angleDelta;\n        }\n\n        // the sum of angles within the window area exceeds the maximum allowed value. check fails.\n        if (recentAngleDelta > maxAngle) return false;\n\n        index++;\n        anchorDistance += current.dist(next);\n    }\n\n    // no part of the line had an angle greater than the maximum allowed. check passes.\n    return true;\n}\n","import {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport {Anchor} from '../symbol/anchor';\nimport {checkMaxAngle} from './check_max_angle';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {Shaping, PositionedIcon} from './shaping';\n\nexport {getAnchors, getCenterAnchor};\n\nfunction getLineLength(line: Array<Point>): number {\n    let lineLength = 0;\n    for (let k = 0; k < line.length - 1; k++) {\n        lineLength += line[k].dist(line[k + 1]);\n    }\n    return lineLength;\n}\n\nfunction getAngleWindowSize(\n    shapedText: Shaping,\n    glyphSize: number,\n    boxScale: number\n): number {\n    return shapedText ?\n        3 / 5 * glyphSize * boxScale :\n        0;\n}\n\nfunction getShapedLabelLength(shapedText?: Shaping | null, shapedIcon?: PositionedIcon | null): number {\n    return Math.max(\n        shapedText ? shapedText.right - shapedText.left : 0,\n        shapedIcon ? shapedIcon.right - shapedIcon.left : 0);\n}\n\nfunction getCenterAnchor(line: Array<Point>,\n    maxAngle: number,\n    shapedText: Shaping,\n    shapedIcon: PositionedIcon,\n    glyphSize: number,\n    boxScale: number) {\n    const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);\n    const labelLength = getShapedLabelLength(shapedText, shapedIcon) * boxScale;\n\n    let prevDistance = 0;\n    const centerDistance = getLineLength(line) / 2;\n\n    for (let i = 0; i < line.length - 1; i++) {\n\n        const a = line[i],\n            b = line[i + 1];\n\n        const segmentDistance = a.dist(b);\n\n        if (prevDistance + segmentDistance > centerDistance) {\n            // The center is on this segment\n            const t = (centerDistance - prevDistance) / segmentDistance,\n                x = interpolates.number(a.x, b.x, t),\n                y = interpolates.number(a.y, b.y, t);\n\n            const anchor = new Anchor(x, y, b.angleTo(a), i);\n            anchor._round();\n            if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {\n                return anchor;\n            } else {\n                return;\n            }\n        }\n\n        prevDistance += segmentDistance;\n    }\n}\n\nfunction getAnchors(line: Array<Point>,\n    spacing: number,\n    maxAngle: number,\n    shapedText: Shaping,\n    shapedIcon: PositionedIcon,\n    glyphSize: number,\n    boxScale: number,\n    overscaling: number,\n    tileExtent: number): Anchor[] {\n\n    // Resample a line to get anchor points for labels and check that each\n    // potential label passes text-max-angle check and has enough room to fit\n    // on the line.\n\n    const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);\n    const shapedLabelLength = getShapedLabelLength(shapedText, shapedIcon);\n    const labelLength = shapedLabelLength * boxScale;\n\n    // Is the line continued from outside the tile boundary?\n    const isLineContinued = line[0].x === 0 || line[0].x === tileExtent || line[0].y === 0 || line[0].y === tileExtent;\n\n    // Is the label long, relative to the spacing?\n    // If so, adjust the spacing so there is always a minimum space of `spacing / 4` between label edges.\n    if (spacing - labelLength < spacing / 4) {\n        spacing = labelLength + spacing / 4;\n    }\n\n    // Offset the first anchor by:\n    // Either half the label length plus a fixed extra offset if the line is not continued\n    // Or half the spacing if the line is continued.\n\n    // For non-continued lines, add a bit of fixed extra offset to avoid collisions at T intersections.\n    const fixedExtraOffset = glyphSize * 2;\n\n    const offset = !isLineContinued ?\n        ((shapedLabelLength / 2 + fixedExtraOffset) * boxScale * overscaling) % spacing :\n        (spacing / 2 * overscaling) % spacing;\n\n    return resample(line, offset, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, false, tileExtent);\n}\n\nfunction resample(line: Point[], offset: number, spacing: number, angleWindowSize: number, maxAngle: number, labelLength: number, isLineContinued: boolean, placeAtMiddle: boolean, tileExtent: number): Anchor[] {\n\n    const halfLabelLength = labelLength / 2;\n    const lineLength = getLineLength(line);\n\n    let distance = 0;\n    let markedDistance = offset - spacing;\n\n    let anchors: Anchor[] = [];\n\n    for (let i = 0; i < line.length - 1; i++) {\n\n        const a = line[i],\n            b = line[i + 1];\n\n        const segmentDist = a.dist(b),\n            angle = b.angleTo(a);\n\n        while (markedDistance + spacing < distance + segmentDist) {\n            markedDistance += spacing;\n\n            const t = (markedDistance - distance) / segmentDist,\n                x = interpolates.number(a.x, b.x, t),\n                y = interpolates.number(a.y, b.y, t);\n\n            // Check that the point is within the tile boundaries and that\n            // the label would fit before the beginning and end of the line\n            // if placed at this point.\n            if (x >= 0 && x < tileExtent && y >= 0 && y < tileExtent &&\n                    markedDistance - halfLabelLength >= 0 &&\n                    markedDistance + halfLabelLength <= lineLength) {\n                const anchor = new Anchor(x, y, angle, i);\n                anchor._round();\n\n                if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {\n                    anchors.push(anchor);\n                }\n            }\n        }\n\n        distance += segmentDist;\n    }\n\n    if (!placeAtMiddle && !anchors.length && !isLineContinued) {\n        // The first attempt at finding anchors at which labels can be placed failed.\n        // Try again, but this time just try placing one anchor at the middle of the line.\n        // This has the most effect for short lines in overscaled tiles, since the\n        // initial offset used in overscaled tiles is calculated to align labels with positions in\n        // parent tiles instead of placing the label as close to the beginning as possible.\n        anchors = resample(line, distance / 2, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, true, tileExtent);\n    }\n\n    return anchors;\n}\n","import Point from '@mapbox/point-geometry';\n\n/**\n * Returns the part of a multiline that intersects with the provided rectangular box.\n *\n * @param lines - the lines to check\n * @param x1 - the left edge of the box\n * @param y1 - the top edge of the box\n * @param x2 - the right edge of the box\n * @param y2 - the bottom edge of the box\n * @returns lines\n */\nexport function clipLine(lines: Array<Array<Point>>, x1: number, y1: number, x2: number, y2: number): Array<Array<Point>> {\n    const clippedLines: Array<Array<Point>> = [];\n\n    for (let l = 0; l < lines.length; l++) {\n        const line = lines[l];\n        let clippedLine: Point[] | undefined;\n\n        for (let i = 0; i < line.length - 1; i++) {\n            let p0 = line[i];\n            let p1 = line[i + 1];\n\n            if (p0.x < x1 && p1.x < x1) {\n                continue;\n            } else if (p0.x < x1) {\n                p0 = new Point(x1, p0.y + (p1.y - p0.y) * ((x1 - p0.x) / (p1.x - p0.x)))._round();\n            } else if (p1.x < x1) {\n                p1 = new Point(x1, p0.y + (p1.y - p0.y) * ((x1 - p0.x) / (p1.x - p0.x)))._round();\n            }\n\n            if (p0.y < y1 && p1.y < y1) {\n                continue;\n            } else if (p0.y < y1) {\n                p0 = new Point(p0.x + (p1.x - p0.x) * ((y1 - p0.y) / (p1.y - p0.y)), y1)._round();\n            } else if (p1.y < y1) {\n                p1 = new Point(p0.x + (p1.x - p0.x) * ((y1 - p0.y) / (p1.y - p0.y)), y1)._round();\n            }\n\n            if (p0.x >= x2 && p1.x >= x2) {\n                continue;\n            } else if (p0.x >= x2) {\n                p0 = new Point(x2, p0.y + (p1.y - p0.y) * ((x2 - p0.x) / (p1.x - p0.x)))._round();\n            } else if (p1.x >= x2) {\n                p1 = new Point(x2, p0.y + (p1.y - p0.y) * ((x2 - p0.x) / (p1.x - p0.x)))._round();\n            }\n\n            if (p0.y >= y2 && p1.y >= y2) {\n                continue;\n            } else if (p0.y >= y2) {\n                p0 = new Point(p0.x + (p1.x - p0.x) * ((y2 - p0.y) / (p1.y - p0.y)), y2)._round();\n            } else if (p1.y >= y2) {\n                p1 = new Point(p0.x + (p1.x - p0.x) * ((y2 - p0.y) / (p1.y - p0.y)), y2)._round();\n            }\n\n            if (!clippedLine || !p0.equals(clippedLine[clippedLine.length - 1])) {\n                clippedLine = [p0];\n                clippedLines.push(clippedLine);\n            }\n\n            clippedLine.push(p1);\n        }\n    }\n\n    return clippedLines;\n}\n\n/**\n * Clips the geometry to the given bounds.\n * @param geometry - the geometry to clip\n * @param type - the geometry type (1=POINT, 2=LINESTRING, 3=POLYGON)\n * @param x1 - the left edge of the clipping box\n * @param y1 - the top edge of the clipping box\n * @param x2 - the right edge of the clipping box\n * @param y2 - the bottom edge of the clipping box\n * @returns the clipped geometry\n */\nexport function clipGeometry(geometry: Point[][], type: 0 | 1 | 2 | 3, x1: number, y1: number, x2: number, y2: number): Point[][] {\n    let clippedGeometry = clipGeometryOnAxis(geometry, type, x1, x2, AxisType.X);\n    clippedGeometry = clipGeometryOnAxis(clippedGeometry, type, y1, y2, AxisType.Y);\n    return clippedGeometry;\n}\n\n/**\n * On which axis to clip\n */\nconst enum AxisType {\n    X = 0,\n    Y = 1\n}\n\n/**\n * Clip features between two vertical or horizontal axis-parallel lines:\n * ```\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *```\n * @param geometry - the geometry to clip\n * @param type - the geometry type (1=POINT, 2=LINESTRING, 3=POLYGON)\n * @param start - the start line coordinate (x or y) to clip against\n * @param end - the end line coordinate (x or y) to clip against\n * @param axis - the axis to clip on (X or Y)\n * @returns the clipped geometry\n */\nfunction clipGeometryOnAxis(geometry: Point[][], type: 0 | 1 | 2 | 3, start: number, end: number, axis: AxisType): Point[][] {\n    switch (type) {\n        case 1: // POINT\n            return clipPoints(geometry, start, end, axis);\n        case 2: // LINESTRING\n            return clipLines(geometry, start, end, axis, false);\n        case 3: // POLYGON\n            return clipLines(geometry, start, end, axis, true);\n    }\n\n    return [];\n}\n\nfunction clipPoints(geometry: Point[][], start: number, end: number, axis: AxisType): Point[][] {\n    const newGeometry: Point[][] = [];\n    for (const ring of geometry) {\n        for (const point of ring) {\n            const a = axis === AxisType.X ? point.x : point.y;\n            if (a >= start && a <= end) {\n                newGeometry.push([point]);\n            }\n        }\n    }\n    return newGeometry;\n}\n\n/**\n * Clips a line to the given start and end coordinates.\n * @param line - the line to clip\n * @param start - the start line coordinate (x or y) to clip against\n * @param end - the end line coordinate (x or y) to clip against\n * @param axis - the axis to clip on (X or Y)\n * @param isPolygon - whether the line is part of a polygon\n * @returns the clipped line(s)\n */\nfunction clipLineInternal(line: Point[], start: number, end: number, axis: AxisType, isPolygon: boolean): Point[][] {\n    const intersectionPoint = axis === AxisType.X ? intersectionPointX : intersectionPointY;\n\n    let slice: Point[] = [];\n    const newLine: Point[][] = [];\n    for (let i = 0; i < line.length - 1; i++) {\n        const p1 = line[i];\n        const p2 = line[i + 1];\n        const pos1 = axis === AxisType.X ? p1.x : p1.y;\n        const pos2 = axis === AxisType.X ? p2.x : p2.y;\n        let exited = false;\n\n        if (pos1 < start) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (pos2 > start) {\n                slice.push(intersectionPoint(p1, p2, start));\n            }\n        } else if (pos1 > end) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (pos2 < end) {\n                slice.push(intersectionPoint(p1, p2, end));\n            }\n        } else {\n            slice.push(p1);\n        }\n        if (pos2 < start && pos1 >= start) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            slice.push(intersectionPoint(p1, p2, start));\n            exited = true;\n        }\n        if (pos2 > end && pos1 <= end) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            slice.push(intersectionPoint(p1, p2, end));\n            exited = true;\n        }\n\n        if (!isPolygon && exited) {\n            newLine.push(slice);\n            slice = [];\n        }\n    }\n\n    // add the last point\n    const last = line.length - 1;\n    const lastPos = axis === AxisType.X ? line[last].x : line[last].y;\n    if (lastPos >= start && lastPos <= end) {\n        slice.push(line[last]);\n    }\n\n    // close the polygon if its endpoints are not the same after clipping\n    if (isPolygon && slice.length > 0 && !slice[0].equals(slice[slice.length - 1])) {\n        slice.push(new Point(slice[0].x, slice[0].y));\n    }\n    if (slice.length > 0) {\n        newLine.push(slice);\n    }\n    return newLine;\n}\n\nfunction clipLines(geometry: Point[][], start: number, end: number, axis: AxisType, isPolygon: boolean): Point[][] {\n    const newGeometry: Point[][] = [];\n    for (const line of geometry) {\n        const clippedLines = clipLineInternal(line, start, end, axis, isPolygon);\n        if (clippedLines.length > 0) {\n            newGeometry.push(...clippedLines);\n        }\n    }\n    return newGeometry;\n}\n\nfunction intersectionPointX(p1: Point, p2: Point, x: number): Point {\n    const t = (x - p1.x) / (p2.x - p1.x);\n    return new Point(x, p1.y + (p2.y - p1.y) * t);\n}\n\nfunction intersectionPointY(p1: Point, p2: Point, y: number): Point {\n    const t = (y - p1.y) / (p2.y - p1.y);\n    return new Point(p1.x + (p2.x - p1.x) * t, y);\n}\n","import Point from '@mapbox/point-geometry';\n\nimport {GLYPH_PBF_BORDER} from '../style/parse_glyph_pbf';\n\nimport type {Anchor} from './anchor';\nimport type {Box, PositionedIcon, Shaping} from './shaping';\nimport {SHAPING_DEFAULT_OFFSET, applyTextFit} from './shaping';\nimport {IMAGE_PADDING} from '../render/image_atlas';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport type {StyleImage} from '../style/style_image';\nimport ONE_EM from './one_em';\nimport {type Rect} from '../render/glyph_atlas';\n\n/**\n * A textured quad for rendering a single icon or glyph.\n *\n * The zoom range the glyph can be shown is defined by minScale and maxScale.\n *\n * @param tl - The offset of the top left corner from the anchor.\n * @param tr - The offset of the top right corner from the anchor.\n * @param bl - The offset of the bottom left corner from the anchor.\n * @param br - The offset of the bottom right corner from the anchor.\n * @param tex - The texture coordinates.\n */\nexport type SymbolQuad = {\n    tl: Point;\n    tr: Point;\n    bl: Point;\n    br: Point;\n    tex: {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n    };\n    pixelOffsetTL: Point;\n    pixelOffsetBR: Point;\n    writingMode: any | void;\n    glyphOffset: [number, number];\n    sectionIndex: number;\n    isSDF: boolean;\n    minFontScaleX: number;\n    minFontScaleY: number;\n};\n\n// If you have a 10px icon that isn't perfectly aligned to the pixel grid it will cover 11 actual\n// pixels. The quad needs to be padded to account for this, otherwise they'll look slightly clipped\n// on one edge in some cases.\nconst border = IMAGE_PADDING;\n\n/**\n * Create the quads used for rendering an icon.\n */\nexport function getIconQuads(\n    shapedIcon: PositionedIcon,\n    iconRotate: number,\n    isSDFIcon: boolean,\n    hasIconTextFit: boolean\n): Array<SymbolQuad> {\n    const quads = [];\n\n    const image = shapedIcon.image;\n    const pixelRatio = image.pixelRatio;\n    const imageWidth = image.paddedRect.w - 2 * border;\n    const imageHeight = image.paddedRect.h - 2 * border;\n\n    let icon: Box = {\n        x1: shapedIcon.left,\n        y1: shapedIcon.top,\n        x2: shapedIcon.right,\n        y2: shapedIcon.bottom\n    };\n\n    const stretchX = image.stretchX || [[0, imageWidth]];\n    const stretchY = image.stretchY || [[0, imageHeight]];\n\n    const reduceRanges = (sum, range) => sum + range[1] - range[0];\n    const stretchWidth = stretchX.reduce(reduceRanges, 0);\n    const stretchHeight = stretchY.reduce(reduceRanges, 0);\n    const fixedWidth = imageWidth - stretchWidth;\n    const fixedHeight = imageHeight - stretchHeight;\n\n    let stretchOffsetX = 0;\n    let stretchContentWidth = stretchWidth;\n    let stretchOffsetY = 0;\n    let stretchContentHeight = stretchHeight;\n    let fixedOffsetX = 0;\n    let fixedContentWidth = fixedWidth;\n    let fixedOffsetY = 0;\n    let fixedContentHeight = fixedHeight;\n\n    if (image.content && hasIconTextFit) {\n        const content = image.content;\n        const contentWidth = content[2] - content[0];\n        const contentHeight = content[3] - content[1];\n        // Constrict content area to fit target aspect ratio\n        if (image.textFitWidth || image.textFitHeight) {\n            icon = applyTextFit(shapedIcon);\n        }\n        stretchOffsetX = sumWithinRange(stretchX, 0, content[0]);\n        stretchOffsetY = sumWithinRange(stretchY, 0, content[1]);\n        stretchContentWidth = sumWithinRange(stretchX, content[0], content[2]);\n        stretchContentHeight = sumWithinRange(stretchY, content[1], content[3]);\n        fixedOffsetX = content[0] - stretchOffsetX;\n        fixedOffsetY = content[1] - stretchOffsetY;\n        fixedContentWidth = contentWidth - stretchContentWidth;\n        fixedContentHeight = contentHeight - stretchContentHeight;\n    }\n\n    const iconLeft = icon.x1;\n    const iconTop = icon.y1;\n    const iconWidth = icon.x2 - iconLeft;\n    const iconHeight = icon.y2 - iconTop;\n\n    const makeBox = (left, top, right, bottom) => {\n\n        const leftEm = getEmOffset(left.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);\n        const leftPx = getPxOffset(left.fixed - fixedOffsetX, fixedContentWidth, left.stretch, stretchWidth);\n\n        const topEm = getEmOffset(top.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);\n        const topPx = getPxOffset(top.fixed - fixedOffsetY, fixedContentHeight, top.stretch, stretchHeight);\n\n        const rightEm = getEmOffset(right.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);\n        const rightPx = getPxOffset(right.fixed - fixedOffsetX, fixedContentWidth, right.stretch, stretchWidth);\n\n        const bottomEm = getEmOffset(bottom.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);\n        const bottomPx = getPxOffset(bottom.fixed - fixedOffsetY, fixedContentHeight, bottom.stretch, stretchHeight);\n\n        const tl = new Point(leftEm, topEm);\n        const tr = new Point(rightEm, topEm);\n        const br = new Point(rightEm, bottomEm);\n        const bl = new Point(leftEm, bottomEm);\n        const pixelOffsetTL = new Point(leftPx / pixelRatio, topPx / pixelRatio);\n        const pixelOffsetBR = new Point(rightPx / pixelRatio, bottomPx / pixelRatio);\n\n        const angle = iconRotate * Math.PI / 180;\n\n        if (angle) {\n            const sin = Math.sin(angle),\n                cos = Math.cos(angle),\n                matrix = [cos, -sin, sin, cos] as [number, number, number, number];\n\n            tl._matMult(matrix);\n            tr._matMult(matrix);\n            bl._matMult(matrix);\n            br._matMult(matrix);\n        }\n\n        const x1 = left.stretch + left.fixed;\n        const x2 = right.stretch + right.fixed;\n        const y1 = top.stretch + top.fixed;\n        const y2 = bottom.stretch + bottom.fixed;\n\n        const subRect = {\n            x: image.paddedRect.x + border + x1,\n            y: image.paddedRect.y + border + y1,\n            w: x2 - x1,\n            h: y2 - y1\n        };\n\n        const minFontScaleX = fixedContentWidth / pixelRatio / iconWidth;\n        const minFontScaleY = fixedContentHeight / pixelRatio / iconHeight;\n\n        // Icon quad is padded, so texture coordinates also need to be padded.\n        return {tl, tr, bl, br, tex: subRect, writingMode: undefined, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY, isSDF: isSDFIcon};\n    };\n\n    if (!hasIconTextFit || (!image.stretchX && !image.stretchY)) {\n        quads.push(makeBox(\n            {fixed: 0, stretch: -1},\n            {fixed: 0, stretch: -1},\n            {fixed: 0, stretch: imageWidth + 1},\n            {fixed: 0, stretch: imageHeight + 1}));\n    } else {\n        const xCuts = stretchZonesToCuts(stretchX, fixedWidth, stretchWidth);\n        const yCuts = stretchZonesToCuts(stretchY, fixedHeight, stretchHeight);\n\n        for (let xi = 0; xi < xCuts.length - 1; xi++) {\n            const x1 = xCuts[xi];\n            const x2 = xCuts[xi + 1];\n            for (let yi = 0; yi < yCuts.length - 1; yi++) {\n                const y1 = yCuts[yi];\n                const y2 = yCuts[yi + 1];\n                quads.push(makeBox(x1, y1, x2, y2));\n            }\n        }\n    }\n\n    return quads;\n}\n\nfunction sumWithinRange(ranges, min, max) {\n    let sum = 0;\n    for (const range of ranges) {\n        sum += Math.max(min, Math.min(max, range[1])) - Math.max(min, Math.min(max, range[0]));\n    }\n    return sum;\n}\n\nfunction stretchZonesToCuts(stretchZones, fixedSize, stretchSize) {\n    const cuts = [{fixed: -border, stretch: 0}];\n\n    for (const [c1, c2] of stretchZones) {\n        const last = cuts[cuts.length - 1];\n        cuts.push({\n            fixed: c1 - last.stretch,\n            stretch: last.stretch\n        });\n        cuts.push({\n            fixed: c1 - last.stretch,\n            stretch: last.stretch + (c2 - c1)\n        });\n    }\n    cuts.push({\n        fixed: fixedSize + border,\n        stretch: stretchSize\n    });\n    return cuts;\n}\n\nfunction getEmOffset(stretchOffset, stretchSize, iconSize, iconOffset) {\n    return stretchOffset / stretchSize * iconSize + iconOffset;\n}\n\nfunction getPxOffset(fixedOffset, fixedSize, stretchOffset, stretchSize) {\n    return fixedOffset - fixedSize * stretchOffset / stretchSize;\n}\n\n/**\n * Create the quads used for rendering a text label.\n */\nexport function getGlyphQuads(\n    anchor: Anchor,\n    shaping: Shaping,\n    textOffset: [number, number],\n    layer: SymbolStyleLayer,\n    alongLine: boolean,\n    feature: Feature,\n    imageMap: {[_: string]: StyleImage},\n    allowVerticalPlacement: boolean\n): Array<SymbolQuad> {\n\n    const textRotate = layer.layout.get('text-rotate').evaluate(feature, {}) * Math.PI / 180;\n    const quads = [];\n\n    for (const line of shaping.positionedLines) {\n        for (const positionedGlyph of line.positionedGlyphs) {\n            if (!positionedGlyph.rect) continue;\n            const textureRect: Rect = positionedGlyph.rect || {} as Rect;\n\n            // The rects have an additional buffer that is not included in their size.\n            const glyphPadding = 1.0;\n            let rectBuffer = GLYPH_PBF_BORDER + glyphPadding;\n            let isSDF = true;\n            let pixelRatio = 1.0;\n            let lineOffset = 0.0;\n\n            const rotateVerticalGlyph = (alongLine || allowVerticalPlacement) && positionedGlyph.vertical;\n            const halfAdvance = positionedGlyph.metrics.advance * positionedGlyph.scale / 2;\n\n            // Align images and scaled glyphs in the middle of a vertical line.\n            if (allowVerticalPlacement && shaping.verticalizable) {\n                const scaledGlyphOffset = (positionedGlyph.scale - 1) * ONE_EM;\n                const imageOffset = (ONE_EM - positionedGlyph.metrics.width * positionedGlyph.scale) / 2;\n                lineOffset = line.lineOffset / 2 - (positionedGlyph.imageName ? -imageOffset : scaledGlyphOffset);\n            }\n\n            if (positionedGlyph.imageName) {\n                const image = imageMap[positionedGlyph.imageName];\n                isSDF = image.sdf;\n                pixelRatio = image.pixelRatio;\n                rectBuffer = IMAGE_PADDING / pixelRatio;\n            }\n\n            const glyphOffset = alongLine ?\n                [positionedGlyph.x + halfAdvance, positionedGlyph.y] :\n                [0, 0];\n\n            let builtInOffset: [number, number] = alongLine ?\n                [0, 0] :\n                [positionedGlyph.x + halfAdvance + textOffset[0], positionedGlyph.y + textOffset[1] - lineOffset];\n\n            let verticalizedLabelOffset = [0, 0] as [number, number];\n            if (rotateVerticalGlyph) {\n                // Vertical POI labels that are rotated 90deg CW and whose glyphs must preserve upright orientation\n                // need to be rotated 90deg CCW. After a quad is rotated, it is translated to the original built-in offset.\n                verticalizedLabelOffset = builtInOffset;\n                builtInOffset = [0, 0];\n            }\n\n            const textureScale = positionedGlyph.metrics.isDoubleResolution ? 2 : 1;\n\n            const x1 = (positionedGlyph.metrics.left - rectBuffer) * positionedGlyph.scale - halfAdvance + builtInOffset[0];\n            const y1 = (-positionedGlyph.metrics.top - rectBuffer) * positionedGlyph.scale + builtInOffset[1];\n            const x2 = x1 + textureRect.w / textureScale * positionedGlyph.scale / pixelRatio;\n            const y2 = y1 + textureRect.h / textureScale * positionedGlyph.scale / pixelRatio;\n\n            const tl = new Point(x1, y1);\n            const tr = new Point(x2, y1);\n            const bl = new Point(x1, y2);\n            const br = new Point(x2, y2);\n\n            if (rotateVerticalGlyph) {\n                // Vertical-supporting glyphs are laid out in 24x24 point boxes (1 square em)\n                // In horizontal orientation, the y values for glyphs are below the midline\n                // and we use a \"yOffset\" of -17 to pull them up to the middle.\n                // By rotating counter-clockwise around the point at the center of the left\n                // edge of a 24x24 layout box centered below the midline, we align the center\n                // of the glyphs with the horizontal midline, so the yOffset is no longer\n                // necessary, but we also pull the glyph to the left along the x axis.\n                // The y coordinate includes baseline yOffset, thus needs to be accounted\n                // for when glyph is rotated and translated.\n                const center = new Point(-halfAdvance, halfAdvance - SHAPING_DEFAULT_OFFSET);\n                const verticalRotation = -Math.PI / 2;\n\n                // xHalfWidthOffsetCorrection is a difference between full-width and half-width\n                // advance, should be 0 for full-width glyphs and will pull up half-width glyphs.\n                const xHalfWidthOffsetCorrection = ONE_EM / 2 - halfAdvance;\n                const yImageOffsetCorrection = positionedGlyph.imageName ? xHalfWidthOffsetCorrection : 0.0;\n                const halfWidthOffsetCorrection = new Point(5 - SHAPING_DEFAULT_OFFSET - xHalfWidthOffsetCorrection, -yImageOffsetCorrection);\n                const verticalOffsetCorrection = new Point(...verticalizedLabelOffset);\n                tl._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                tr._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                bl._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                br._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n            }\n\n            if (textRotate) {\n                const sin = Math.sin(textRotate),\n                    cos = Math.cos(textRotate),\n                    matrix = [cos, -sin, sin, cos] as [number, number, number, number];\n\n                tl._matMult(matrix);\n                tr._matMult(matrix);\n                bl._matMult(matrix);\n                br._matMult(matrix);\n            }\n\n            const pixelOffsetTL = new Point(0, 0);\n            const pixelOffsetBR = new Point(0, 0);\n            const minFontScaleX = 0;\n            const minFontScaleY = 0;\n            quads.push({tl, tr, bl, br, tex: textureRect, writingMode: shaping.writingMode, glyphOffset, sectionIndex: positionedGlyph.sectionIndex, isSDF, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY});\n        }\n    }\n\n    return quads;\n}\n","import type {CollisionBoxArray} from '../data/array_types.g';\nimport Point from '@mapbox/point-geometry';\nimport type {Anchor} from './anchor';\nimport {type SymbolPadding} from '../style/style_layer/symbol_style_layer';\nimport {applyTextFit} from './shaping';\n\n/**\n * A CollisionFeature represents the area of the tile covered by a single label.\n * It is used with CollisionIndex to check if the label overlaps with any\n * previous labels. A CollisionFeature is mostly just a set of CollisionBox\n * objects.\n */\nexport class CollisionFeature {\n    boxStartIndex: number;\n    boxEndIndex: number;\n    circleDiameter: number;\n\n    /**\n     * Create a CollisionFeature, adding its collision box data to the given collisionBoxArray in the process.\n     * For line aligned labels a collision circle diameter is computed instead.\n     *\n     * @param anchor - The point along the line around which the label is anchored.\n     * @param shaped - The text or icon shaping results.\n     * @param boxScale - A magic number used to convert from glyph metrics units to geometry units.\n     * @param padding - The amount of padding to add around the label edges.\n     * @param alignLine - Whether the label is aligned with the line or the viewport.\n     */\n    constructor(collisionBoxArray: CollisionBoxArray,\n        anchor: Anchor,\n        featureIndex: number,\n        sourceLayerIndex: number,\n        bucketIndex: number,\n        shaped: any,\n        boxScale: number,\n        padding: SymbolPadding,\n        alignLine: boolean,\n        rotate: number) {\n\n        this.boxStartIndex = collisionBoxArray.length;\n\n        if (alignLine) {\n            // Compute height of the shape in glyph metrics and apply collision padding.\n            // Note that the pixel based 'text-padding' is applied at runtime\n            let top = shaped.top;\n            let bottom = shaped.bottom;\n            const collisionPadding = shaped.collisionPadding;\n\n            if (collisionPadding) {\n                top -= collisionPadding[1];\n                bottom += collisionPadding[3];\n            }\n\n            let height = bottom - top;\n\n            if (height > 0) {\n                // set minimum box height to avoid very many small labels\n                height = Math.max(10, height);\n                this.circleDiameter = height;\n            }\n        } else {\n            const icon = shaped.image?.content && (shaped.image.textFitWidth || shaped.image.textFitHeight) ?\n                applyTextFit(shaped) :\n                {\n                    x1: shaped.left,\n                    y1: shaped.top,\n                    x2: shaped.right,\n                    y2: shaped.bottom\n                };\n\n            // margin is in CSS order: [top, right, bottom, left]\n            icon.y1 = icon.y1 * boxScale - padding[0];\n            icon.y2 = icon.y2 * boxScale + padding[2];\n            icon.x1 = icon.x1 * boxScale - padding[3];\n            icon.x2 = icon.x2 * boxScale + padding[1];\n\n            const collisionPadding = shaped.collisionPadding;\n            if (collisionPadding) {\n                icon.x1 -= collisionPadding[0] * boxScale;\n                icon.y1 -= collisionPadding[1] * boxScale;\n                icon.x2 += collisionPadding[2] * boxScale;\n                icon.y2 += collisionPadding[3] * boxScale;\n            }\n\n            if (rotate) {\n                // Account for *-rotate in point collision boxes\n                // See https://github.com/mapbox/mapbox-gl-js/issues/6075\n                // Doesn't account for icon-text-fit\n\n                const tl = new Point(icon.x1, icon.y1);\n                const tr = new Point(icon.x2, icon.y1);\n                const bl = new Point(icon.x1, icon.y2);\n                const br = new Point(icon.x2, icon.y2);\n\n                const rotateRadians = rotate * Math.PI / 180;\n\n                tl._rotate(rotateRadians);\n                tr._rotate(rotateRadians);\n                bl._rotate(rotateRadians);\n                br._rotate(rotateRadians);\n\n                // Collision features require an \"on-axis\" geometry,\n                // so take the envelope of the rotated geometry\n                // (may be quite large for wide labels rotated 45 degrees)\n                icon.x1 = Math.min(tl.x, tr.x, bl.x, br.x);\n                icon.x2 = Math.max(tl.x, tr.x, bl.x, br.x);\n                icon.y1 = Math.min(tl.y, tr.y, bl.y, br.y);\n                icon.y2 = Math.max(tl.y, tr.y, bl.y, br.y);\n            }\n            collisionBoxArray.emplaceBack(anchor.x, anchor.y, icon.x1, icon.y1, icon.x2, icon.y2, featureIndex, sourceLayerIndex, bucketIndex);\n        }\n\n        this.boxEndIndex = collisionBoxArray.length;\n    }\n}\n","\nexport default class TinyQueue {\n    constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n        this.data = data;\n        this.length = this.data.length;\n        this.compare = compare;\n\n        if (this.length > 0) {\n            for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n        }\n    }\n\n    push(item) {\n        this.data.push(item);\n        this._up(this.length++);\n    }\n\n    pop() {\n        if (this.length === 0) return undefined;\n\n        const top = this.data[0];\n        const bottom = this.data.pop();\n\n        if (--this.length > 0) {\n            this.data[0] = bottom;\n            this._down(0);\n        }\n\n        return top;\n    }\n\n    peek() {\n        return this.data[0];\n    }\n\n    _up(pos) {\n        const {data, compare} = this;\n        const item = data[pos];\n\n        while (pos > 0) {\n            const parent = (pos - 1) >> 1;\n            const current = data[parent];\n            if (compare(item, current) >= 0) break;\n            data[pos] = current;\n            pos = parent;\n        }\n\n        data[pos] = item;\n    }\n\n    _down(pos) {\n        const {data, compare} = this;\n        const halfLength = this.length >> 1;\n        const item = data[pos];\n\n        while (pos < halfLength) {\n            let bestChild = (pos << 1) + 1; // initially it is the left child\n            const right = bestChild + 1;\n\n            if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n                bestChild = right;\n            }\n            if (compare(data[bestChild], item) >= 0) break;\n\n            data[pos] = data[bestChild];\n            pos = bestChild;\n        }\n\n        data[pos] = item;\n    }\n}\n","import Queue from 'tinyqueue';\n\nimport Point from '@mapbox/point-geometry';\nimport {distToSegmentSquared} from './intersection_tests';\nimport {Bounds} from '../geo/bounds';\n\n/**\n * Finds an approximation of a polygon's Pole Of Inaccessibility https://en.wikipedia.org/wiki/Pole_of_inaccessibility\n * This is a copy of https://github.com/mapbox/polylabel adapted to use Points\n *\n * @param polygonRings - first item in array is the outer ring followed optionally by the list of holes, should be an element of the result of util/classify_rings\n * @param precision - Specified in input coordinate units. If 0 returns after first run, if `> 0` repeatedly narrows the search space until the radius of the area searched for the best pole is less than precision\n * @param debug - Print some statistics to the console during execution\n * @returns Pole of Inaccessibility.\n */\nexport function findPoleOfInaccessibility(\n    polygonRings: Array<Array<Point>>,\n    precision: number = 1,\n    debug: boolean = false\n): Point {\n    const bounds = Bounds.fromPoints(polygonRings[0]);\n\n    const cellSize = Math.min(bounds.width(), bounds.height());\n    let h = cellSize / 2;\n\n    // a priority queue of cells in order of their \"potential\" (max distance to polygon)\n    const cellQueue = new Queue([], compareMax);\n\n    const {minX, minY, maxX, maxY} = bounds;\n    if (cellSize === 0) return new Point(minX, minY);\n\n    // cover polygon with initial cells\n    for (let x = minX; x < maxX; x += cellSize) {\n        for (let y = minY; y < maxY; y += cellSize) {\n            cellQueue.push(new Cell(x + h, y + h, h, polygonRings));\n        }\n    }\n\n    // take centroid as the first best guess\n    let bestCell = getCentroidCell(polygonRings);\n    let numProbes = cellQueue.length;\n\n    while (cellQueue.length) {\n        // pick the most promising cell from the queue\n        const cell = cellQueue.pop();\n\n        // update the best cell if we found a better one\n        if (cell.d > bestCell.d || !bestCell.d) {\n            bestCell = cell;\n            if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);\n        }\n\n        // do not drill down further if there's no chance of a better solution\n        if (cell.max - bestCell.d <= precision) continue;\n\n        // split the cell into four cells\n        h = cell.h / 2;\n        cellQueue.push(new Cell(cell.p.x - h, cell.p.y - h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x + h, cell.p.y - h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x - h, cell.p.y + h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x + h, cell.p.y + h, h, polygonRings));\n        numProbes += 4;\n    }\n\n    if (debug) {\n        console.log(`num probes: ${numProbes}`);\n        console.log(`best distance: ${bestCell.d}`);\n    }\n\n    return bestCell.p;\n}\n\nfunction compareMax(a, b) {\n    return b.max - a.max;\n}\n\nfunction Cell(x, y, h, polygon) {\n    this.p = new Point(x, y);\n    this.h = h; // half the cell size\n    this.d = pointToPolygonDist(this.p, polygon); // distance from cell center to polygon\n    this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell\n}\n\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(p, polygon) {\n    let inside = false;\n    let minDistSq = Infinity;\n\n    for (let k = 0; k < polygon.length; k++) {\n        const ring = polygon[k];\n\n        for (let i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n            const a = ring[i];\n            const b = ring[j];\n\n            if ((a.y > p.y !== b.y > p.y) &&\n                (p.x < (b.x - a.x) * (p.y - a.y) / (b.y - a.y) + a.x)) inside = !inside;\n\n            minDistSq = Math.min(minDistSq, distToSegmentSquared(p, a, b));\n        }\n    }\n\n    return (inside ? 1 : -1) * Math.sqrt(minDistSq);\n}\n\n// get polygon centroid\nfunction getCentroidCell(polygon) {\n    let area = 0;\n    let x = 0;\n    let y = 0;\n    const points = polygon[0];\n    for (let i = 0, len = points.length, j = len - 1; i < len; j = i++) {\n        const a = points[i];\n        const b = points[j];\n        const f = a.x * b.y - b.x * a.y;\n        x += (a.x + b.x) * f;\n        y += (a.y + b.y) * f;\n        area += f * 3;\n    }\n    return new Cell(x / area, y / area, 0, polygon);\n}\n","import {VariableAnchorOffsetCollection, type VariableAnchorOffsetCollectionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {type SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {type CanonicalTileID} from '../../tile/tile_id';\nimport ONE_EM from '../../symbol/one_em';\nimport {type SymbolStyleLayer} from './symbol_style_layer';\n\nexport enum TextAnchorEnum {\n    'center' = 1,\n    'left' = 2,\n    'right' = 3,\n    'top' = 4,\n    'bottom' = 5,\n    'top-left' = 6,\n    'top-right' = 7,\n    'bottom-left' = 8,\n    'bottom-right' = 9\n}\n\nexport type TextAnchor = keyof typeof TextAnchorEnum;\n\n// The radial offset is to the edge of the text box\n// In the horizontal direction, the edge of the text box is where glyphs start\n// But in the vertical direction, the glyphs appear to \"start\" at the baseline\n// We don't actually load baseline data, but we assume an offset of ONE_EM - 17\n// (see \"yOffset\" in shaping.js)\nconst baselineOffset = 7;\nexport const INVALID_TEXT_OFFSET = Number.POSITIVE_INFINITY;\n\nexport function evaluateVariableOffset(anchor: TextAnchor, offset: [number, number]): [number, number] {\n\n    function fromRadialOffset(anchor: TextAnchor, radialOffset: number): [number, number] {\n        let x = 0, y = 0;\n        if (radialOffset < 0) radialOffset = 0; // Ignore negative offset.\n        // solve for r where r^2 + r^2 = radialOffset^2\n        const hypotenuse = radialOffset / Math.SQRT2;\n        switch (anchor) {\n            case 'top-right':\n            case 'top-left':\n                y = hypotenuse - baselineOffset;\n                break;\n            case 'bottom-right':\n            case 'bottom-left':\n                y = -hypotenuse + baselineOffset;\n                break;\n            case 'bottom':\n                y = -radialOffset + baselineOffset;\n                break;\n            case 'top':\n                y = radialOffset - baselineOffset;\n                break;\n        }\n\n        switch (anchor) {\n            case 'top-right':\n            case 'bottom-right':\n                x = -hypotenuse;\n                break;\n            case 'top-left':\n            case 'bottom-left':\n                x = hypotenuse;\n                break;\n            case 'left':\n                x = radialOffset;\n                break;\n            case 'right':\n                x = -radialOffset;\n                break;\n        }\n\n        return [x, y];\n    }\n\n    function fromTextOffset(anchor: TextAnchor, offsetX: number, offsetY: number): [number, number] {\n        let x = 0, y = 0;\n        // Use absolute offset values.\n        offsetX = Math.abs(offsetX);\n        offsetY = Math.abs(offsetY);\n\n        switch (anchor) {\n            case 'top-right':\n            case 'top-left':\n            case 'top':\n                y = offsetY - baselineOffset;\n                break;\n            case 'bottom-right':\n            case 'bottom-left':\n            case 'bottom':\n                y = -offsetY + baselineOffset;\n                break;\n        }\n\n        switch (anchor) {\n            case 'top-right':\n            case 'bottom-right':\n            case 'right':\n                x = -offsetX;\n                break;\n            case 'top-left':\n            case 'bottom-left':\n            case 'left':\n                x = offsetX;\n                break;\n        }\n\n        return [x, y];\n    }\n\n    return (offset[1] !== INVALID_TEXT_OFFSET) ? fromTextOffset(anchor, offset[0], offset[1]) : fromRadialOffset(anchor, offset[0]);\n}\n\n// Helper to support both text-variable-anchor and text-variable-anchor-offset. Offset values converted from EMs to PXs\nexport function getTextVariableAnchorOffset(layer: SymbolStyleLayer, feature: SymbolFeature, canonical: CanonicalTileID): VariableAnchorOffsetCollection | null {\n    const layout = layer.layout;\n    // If style specifies text-variable-anchor-offset, just return it\n    const variableAnchorOffset = layout.get('text-variable-anchor-offset')?.evaluate(feature, {}, canonical);\n\n    if (variableAnchorOffset) {\n        const sourceValues = variableAnchorOffset.values;\n        const destValues: VariableAnchorOffsetCollectionSpecification = [];\n\n        // Convert offsets from EM to PX, and apply baseline shift\n        for (let i = 0; i < sourceValues.length; i += 2) {\n            const anchor = destValues[i] = sourceValues[i] as TextAnchor;\n            const offset = (sourceValues[i + 1] as [number, number]).map(t => t * ONE_EM) as [number, number];\n\n            if (anchor.startsWith('top')) {\n                offset[1] -= baselineOffset;\n            } else if (anchor.startsWith('bottom')) {\n                offset[1] += baselineOffset;\n            }\n\n            destValues[i + 1] = offset;\n        }\n\n        return new VariableAnchorOffsetCollection(destValues);\n    }\n\n    // If style specifies text-variable-anchor, convert to the new format\n    const variableAnchor = layout.get('text-variable-anchor');\n\n    if (variableAnchor) {\n        let textOffset: [number, number];\n        const unevaluatedLayout = layer._unevaluatedLayout;\n\n        // The style spec says don't use `text-offset` and `text-radial-offset` together\n        // but doesn't actually specify what happens if you use both. We go with the radial offset.\n        if (unevaluatedLayout.getValue('text-radial-offset') !== undefined) {\n            textOffset = [layout.get('text-radial-offset').evaluate(feature, {}, canonical) * ONE_EM, INVALID_TEXT_OFFSET];\n        } else {\n            textOffset = layout.get('text-offset').evaluate(feature, {}, canonical).map(t => t * ONE_EM) as [number, number];\n        }\n\n        const anchorOffsets: VariableAnchorOffsetCollectionSpecification = [];\n\n        for (const anchor of variableAnchor) {\n            anchorOffsets.push(anchor, evaluateVariableOffset(anchor, textOffset));\n        }\n\n        return new VariableAnchorOffsetCollection(anchorOffsets);\n    }\n\n    return null;\n}\n","import {Anchor} from './anchor';\n\nimport {getAnchors, getCenterAnchor} from './get_anchors';\nimport {clipLine} from './clip_line';\nimport {shapeText, shapeIcon, WritingMode, fitIconToText} from './shaping';\nimport {getGlyphQuads, getIconQuads} from './quads';\nimport {CollisionFeature} from './collision_feature';\nimport {warnOnce} from '../util/util';\nimport {\n    allowsVerticalWritingMode,\n    allowsLetterSpacing\n} from '../util/script_detection';\nimport {findPoleOfInaccessibility} from '../util/find_pole_of_inaccessibility';\nimport {EXTENT} from '../data/extent';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {SIZE_PACK_FACTOR, MAX_PACKED_SIZE, MAX_GLYPH_ICON_SIZE} from './symbol_size';\nimport ONE_EM from './one_em';\nimport type {CanonicalTileID} from '../tile/tile_id';\nimport type {Shaping, PositionedIcon, TextJustify} from './shaping';\nimport type {CollisionBoxArray, TextAnchorOffsetArray} from '../data/array_types.g';\nimport type {SymbolFeature} from '../data/bucket/symbol_bucket';\nimport type {StyleImage} from '../style/style_image';\nimport type {StyleGlyph} from '../style/style_glyph';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {GlyphPosition} from '../render/glyph_atlas';\nimport type {PossiblyEvaluatedPropertyValue} from '../style/properties';\n\nimport type Point from '@mapbox/point-geometry';\nimport murmur3 from 'murmurhash-js';\nimport {getIconPadding, type SymbolPadding} from '../style/style_layer/symbol_style_layer';\nimport {type VariableAnchorOffsetCollection, classifyRings} from '@maplibre/maplibre-gl-style-spec';\nimport {getTextVariableAnchorOffset, evaluateVariableOffset, INVALID_TEXT_OFFSET, type TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\nimport {subdivideVertexLine} from '../render/subdivision';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\n\n// The symbol layout process needs `text-size` evaluated at up to five different zoom levels, and\n// `icon-size` at up to three:\n//\n//   1. `text-size` at the zoom level of the bucket. Used to calculate a per-feature size for source `text-size`\n//       expressions, and to calculate the box dimensions for icon-text-fit.\n//   2. `icon-size` at the zoom level of the bucket. Used to calculate a per-feature size for source `icon-size`\n//       expressions.\n//   3. `text-size` and `icon-size` at the zoom level of the bucket, plus one. Used to calculate collision boxes.\n//   4. `text-size` at zoom level 18. Used for something line-symbol-placement-related.\n//   5.  For composite `*-size` expressions: two zoom levels of curve stops that \"cover\" the zoom level of the\n//       bucket. These go into a vertex buffer and are used by the shader to interpolate the size at render time.\n//\n// (1) and (2) are stored in `bucket.layers[0].layout`. The remainder are below.\n//\ntype Sizes = {\n    layoutTextSize: PossiblyEvaluatedPropertyValue<number>; // (3),\n    layoutIconSize: PossiblyEvaluatedPropertyValue<number>; // (3),\n    textMaxSize: PossiblyEvaluatedPropertyValue<number>;    // (4),\n    compositeTextSizes: [PossiblyEvaluatedPropertyValue<number>, PossiblyEvaluatedPropertyValue<number>]; // (5),\n    compositeIconSizes: [PossiblyEvaluatedPropertyValue<number>, PossiblyEvaluatedPropertyValue<number>]; // (5)\n};\n\ntype ShapedTextOrientations = {\n    vertical: Shaping | false;\n    horizontal: Record<TextJustify, Shaping>;\n};\n\nexport function performSymbolLayout(args: {\n    bucket: SymbolBucket;\n    glyphMap: {\n        [_: string]: {\n            [x: number]: StyleGlyph;\n        };\n    };\n    glyphPositions: {\n        [_: string]: {\n            [x: number]: GlyphPosition;\n        };\n    };\n    imageMap: {[_: string]: StyleImage};\n    imagePositions: {[_: string]: ImagePosition};\n    showCollisionBoxes: boolean;\n    canonical: CanonicalTileID;\n    subdivisionGranularity: SubdivisionGranularitySetting;\n}) {\n    args.bucket.createArrays();\n\n    const tileSize = 512 * args.bucket.overscaling;\n    args.bucket.tilePixelRatio = EXTENT / tileSize;\n    args.bucket.compareText = {};\n    args.bucket.iconsNeedLinear = false;\n\n    const layer = args.bucket.layers[0];\n    const layout = layer.layout;\n    const unevaluatedLayoutValues = layer._unevaluatedLayout._values;\n\n    const sizes: Sizes = {\n        // Filled in below, if *SizeData.kind is 'composite'\n        // compositeIconSizes: undefined,\n        // compositeTextSizes: undefined,\n        layoutIconSize: unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(args.bucket.zoom + 1), args.canonical),\n        layoutTextSize: unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(args.bucket.zoom + 1), args.canonical),\n        textMaxSize: unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(18))\n    } as Sizes;\n\n    if (args.bucket.textSizeData.kind === 'composite') {\n        const {minZoom, maxZoom} = args.bucket.textSizeData;\n        sizes.compositeTextSizes = [\n            unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(minZoom), args.canonical),\n            unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(maxZoom), args.canonical)\n        ];\n    }\n\n    if (args.bucket.iconSizeData.kind === 'composite') {\n        const {minZoom, maxZoom} = args.bucket.iconSizeData;\n        sizes.compositeIconSizes = [\n            unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(minZoom), args.canonical),\n            unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(maxZoom), args.canonical)\n        ];\n    }\n\n    const lineHeight = layout.get('text-line-height') * ONE_EM;\n    const textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point';\n    const keepUpright = layout.get('text-keep-upright');\n    const textSize = layout.get('text-size');\n\n    for (const feature of args.bucket.features) {\n        const fontstack = layout.get('text-font').evaluate(feature, {}, args.canonical).join(',');\n        const layoutTextSizeThisZoom = textSize.evaluate(feature, {}, args.canonical);\n        const layoutTextSize = sizes.layoutTextSize.evaluate(feature, {}, args.canonical);\n        const layoutIconSize = sizes.layoutIconSize.evaluate(feature, {}, args.canonical);\n\n        const shapedTextOrientations: ShapedTextOrientations = {\n            horizontal: {} as Record<TextJustify, Shaping>,\n            vertical: undefined\n        };\n        const text = feature.text;\n        let textOffset: [number, number] = [0, 0];\n        if (text) {\n            const unformattedText = text.toString();\n            const spacing = layout.get('text-letter-spacing').evaluate(feature, {}, args.canonical) * ONE_EM;\n            const spacingIfAllowed = allowsLetterSpacing(unformattedText) ? spacing : 0;\n\n            const textAnchor = layout.get('text-anchor').evaluate(feature, {}, args.canonical);\n            const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, args.canonical);\n\n            if (!variableAnchorOffset) {\n                const radialOffset = layout.get('text-radial-offset').evaluate(feature, {}, args.canonical);\n                // Layers with variable anchors use the `text-radial-offset` property and the [x, y] offset vector\n                // is calculated at placement time instead of layout time\n                if (radialOffset) {\n                    // The style spec says don't use `text-offset` and `text-radial-offset` together\n                    // but doesn't actually specify what happens if you use both. We go with the radial offset.\n                    textOffset = evaluateVariableOffset(textAnchor, [radialOffset * ONE_EM, INVALID_TEXT_OFFSET]);\n                } else {\n                    textOffset = (layout.get('text-offset').evaluate(feature, {}, args.canonical).map(t => t * ONE_EM) as [number, number]);\n                }\n            }\n\n            let textJustify = textAlongLine ?\n                'center' :\n                layout.get('text-justify').evaluate(feature, {}, args.canonical);\n\n            const symbolPlacement = layout.get('symbol-placement');\n            const maxWidth = symbolPlacement === 'point' ?\n                layout.get('text-max-width').evaluate(feature, {}, args.canonical) * ONE_EM :\n                Infinity;\n\n            const addVerticalShapingForPointLabelIfNeeded = () => {\n                if (args.bucket.allowVerticalPlacement && allowsVerticalWritingMode(unformattedText)) {\n                    // Vertical POI label placement is meant to be used for scripts that support vertical\n                    // writing mode, thus, default left justification is used. If Latin\n                    // scripts would need to be supported, this should take into account other justifications.\n                    shapedTextOrientations.vertical = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor,\n                        'left', spacingIfAllowed, textOffset, WritingMode.vertical, true, layoutTextSize, layoutTextSizeThisZoom);\n                }\n            };\n\n            // If this layer uses text-variable-anchor, generate shapings for all justification possibilities.\n            if (!textAlongLine && variableAnchorOffset) {\n                const justifications = new Set<TextJustify>();\n\n                if (textJustify === 'auto') {\n                    for (let i = 0; i < variableAnchorOffset.values.length; i += 2) {\n                        justifications.add(getAnchorJustification(variableAnchorOffset.values[i] as TextAnchor));\n                    }\n                } else {\n                    justifications.add(textJustify);\n                }\n\n                let singleLine = false;\n                for (const justification of justifications) {\n                    if (shapedTextOrientations.horizontal[justification]) continue;\n                    if (singleLine) {\n                        // If the shaping for the first justification was only a single line, we\n                        // can re-use it for the other justifications\n                        shapedTextOrientations.horizontal[justification] = shapedTextOrientations.horizontal[0];\n                    } else {\n                        // If using text-variable-anchor for the layer, we use a center anchor for all shapings and apply\n                        // the offsets for the anchor in the placement step.\n                        const shaping = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, 'center',\n                            justification, spacingIfAllowed, textOffset, WritingMode.horizontal, false, layoutTextSize, layoutTextSizeThisZoom);\n                        if (shaping) {\n                            shapedTextOrientations.horizontal[justification] = shaping;\n                            singleLine = shaping.positionedLines.length === 1;\n                        }\n                    }\n                }\n\n                addVerticalShapingForPointLabelIfNeeded();\n            } else {\n                if (textJustify === 'auto') {\n                    textJustify = getAnchorJustification(textAnchor);\n                }\n\n                // Horizontal point or line label.\n                const shaping = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor, textJustify, spacingIfAllowed,\n                    textOffset, WritingMode.horizontal, false, layoutTextSize, layoutTextSizeThisZoom);\n                if (shaping) shapedTextOrientations.horizontal[textJustify] = shaping;\n\n                // Vertical point label (if allowVerticalPlacement is enabled).\n                addVerticalShapingForPointLabelIfNeeded();\n\n                // Verticalized line label.\n                if (allowsVerticalWritingMode(unformattedText) && textAlongLine && keepUpright) {\n                    shapedTextOrientations.vertical = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor, textJustify,\n                        spacingIfAllowed, textOffset, WritingMode.vertical, false, layoutTextSize, layoutTextSizeThisZoom);\n                }\n            }\n        }\n\n        let shapedIcon;\n        let isSDFIcon = false;\n        if (feature.icon && feature.icon.name) {\n            const image = args.imageMap[feature.icon.name];\n            if (image) {\n                shapedIcon = shapeIcon(\n                    args.imagePositions[feature.icon.name],\n                    layout.get('icon-offset').evaluate(feature, {}, args.canonical),\n                    layout.get('icon-anchor').evaluate(feature, {}, args.canonical));\n                // null/undefined SDF property treated same as default (false)\n                isSDFIcon = !!image.sdf;\n                if (args.bucket.sdfIcons === undefined) {\n                    args.bucket.sdfIcons = isSDFIcon;\n                } else if (args.bucket.sdfIcons !== isSDFIcon) {\n                    warnOnce('Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer');\n                }\n                if (image.pixelRatio !== args.bucket.pixelRatio) {\n                    args.bucket.iconsNeedLinear = true;\n                } else if (layout.get('icon-rotate').constantOr(1) !== 0) {\n                    args.bucket.iconsNeedLinear = true;\n                }\n            }\n        }\n\n        const shapedText = getDefaultHorizontalShaping(shapedTextOrientations.horizontal) || shapedTextOrientations.vertical;\n        args.bucket.iconsInText ||= shapedText ? shapedText.iconsInText : false;\n        if (shapedText || shapedIcon) {\n            addFeature(args.bucket, feature, shapedTextOrientations, shapedIcon, args.imageMap, sizes, layoutTextSize, layoutIconSize, textOffset, isSDFIcon, args.canonical, args.subdivisionGranularity);\n        }\n    }\n\n    if (args.showCollisionBoxes) {\n        args.bucket.generateCollisionDebugBuffers();\n    }\n}\n\n// Choose the justification that matches the direction of the TextAnchor\nexport function getAnchorJustification(anchor: TextAnchor): TextJustify {\n    switch (anchor) {\n        case 'right':\n        case 'top-right':\n        case 'bottom-right':\n            return 'right';\n        case 'left':\n        case 'top-left':\n        case 'bottom-left':\n            return 'left';\n    }\n    return 'center';\n}\n\n/**\n * Given a feature and its shaped text and icon data, add a 'symbol\n * instance' for each _possible_ placement of the symbol feature.\n * (At render it selects which of these instances to\n * show or hide based on collisions with symbols in other layers.)\n */\nfunction addFeature(bucket: SymbolBucket,\n    feature: SymbolFeature,\n    shapedTextOrientations: ShapedTextOrientations,\n    shapedIcon: PositionedIcon,\n    imageMap: {[_: string]: StyleImage},\n    sizes: Sizes,\n    layoutTextSize: number,\n    layoutIconSize: number,\n    textOffset: [number, number],\n    isSDFIcon: boolean,\n    canonical: CanonicalTileID,\n    subdivisionGranularity: SubdivisionGranularitySetting) {\n    // To reduce the number of labels that jump around when zooming we need\n    // to use a text-size value that is the same for all zoom levels.\n    // bucket calculates text-size at a high zoom level so that all tiles can\n    // use the same value when calculating anchor positions.\n    let textMaxSize = sizes.textMaxSize.evaluate(feature, {});\n    if (textMaxSize === undefined) {\n        textMaxSize = layoutTextSize;\n    }\n    const layout = bucket.layers[0].layout;\n    const iconOffset = layout.get('icon-offset').evaluate(feature, {}, canonical);\n    const defaultHorizontalShaping = getDefaultHorizontalShaping(shapedTextOrientations.horizontal);\n    const glyphSize = 24,\n        fontScale = layoutTextSize / glyphSize,\n        textBoxScale = bucket.tilePixelRatio * fontScale,\n        textMaxBoxScale = bucket.tilePixelRatio * textMaxSize / glyphSize,\n        iconBoxScale = bucket.tilePixelRatio * layoutIconSize,\n        symbolMinDistance = bucket.tilePixelRatio * layout.get('symbol-spacing'),\n        textPadding = layout.get('text-padding') * bucket.tilePixelRatio,\n        iconPadding = getIconPadding(layout, feature, canonical, bucket.tilePixelRatio),\n        textMaxAngle = layout.get('text-max-angle') / 180 * Math.PI,\n        textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point',\n        iconAlongLine = layout.get('icon-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point',\n        symbolPlacement = layout.get('symbol-placement'),\n        textRepeatDistance = symbolMinDistance / 2;\n\n    const iconTextFit = layout.get('icon-text-fit');\n    let verticallyShapedIcon: PositionedIcon | undefined;\n    // Adjust shaped icon size when icon-text-fit is used.\n    if (shapedIcon && iconTextFit !== 'none') {\n        if (bucket.allowVerticalPlacement && shapedTextOrientations.vertical) {\n            verticallyShapedIcon = fitIconToText(shapedIcon, shapedTextOrientations.vertical, iconTextFit,\n                layout.get('icon-text-fit-padding'), iconOffset, fontScale);\n        }\n        if (defaultHorizontalShaping) {\n            shapedIcon = fitIconToText(shapedIcon, defaultHorizontalShaping, iconTextFit,\n                layout.get('icon-text-fit-padding'), iconOffset, fontScale);\n        }\n    }\n\n    const granularity = (canonical) ? subdivisionGranularity.line.getGranularityForZoomLevel(canonical.z) : 1;\n\n    const addSymbolAtAnchor = (line, anchor) => {\n        if (anchor.x < 0 || anchor.x >= EXTENT || anchor.y < 0 || anchor.y >= EXTENT) {\n            // Symbol layers are drawn across tile boundaries, We filter out symbols\n            // outside our tile boundaries (which may be included in vector tile buffers)\n            // to prevent double-drawing symbols.\n            return;\n        }\n        addSymbol(bucket, anchor, line, shapedTextOrientations, shapedIcon, imageMap, verticallyShapedIcon, bucket.layers[0],\n            bucket.collisionBoxArray, feature.index, feature.sourceLayerIndex, bucket.index,\n            textBoxScale, [textPadding, textPadding, textPadding, textPadding], textAlongLine, textOffset,\n            iconBoxScale, iconPadding, iconAlongLine, iconOffset,\n            feature, sizes, isSDFIcon, canonical, layoutTextSize);\n    };\n\n    if (symbolPlacement === 'line') {\n        for (const line of clipLine(feature.geometry, 0, 0, EXTENT, EXTENT)) {\n            const subdividedLine = subdivideVertexLine(line, granularity);\n            const anchors = getAnchors(\n                subdividedLine,\n                symbolMinDistance,\n                textMaxAngle,\n                shapedTextOrientations.vertical || defaultHorizontalShaping,\n                shapedIcon,\n                glyphSize,\n                textMaxBoxScale,\n                bucket.overscaling,\n                EXTENT\n            );\n            for (const anchor of anchors) {\n                const shapedText = defaultHorizontalShaping;\n                if (!shapedText || !anchorIsTooClose(bucket, shapedText.text, textRepeatDistance, anchor)) {\n                    addSymbolAtAnchor(subdividedLine, anchor);\n                }\n            }\n        }\n    } else if (symbolPlacement === 'line-center') {\n        // No clipping, multiple lines per feature are allowed\n        // \"lines\" with only one point are ignored as in clipLines\n        for (const line of feature.geometry) {\n            if (line.length > 1) {\n                const subdividedLine = subdivideVertexLine(line, granularity);\n                const anchor = getCenterAnchor(\n                    subdividedLine,\n                    textMaxAngle,\n                    shapedTextOrientations.vertical || defaultHorizontalShaping,\n                    shapedIcon,\n                    glyphSize,\n                    textMaxBoxScale);\n                if (anchor) {\n                    addSymbolAtAnchor(subdividedLine, anchor);\n                }\n            }\n        }\n    } else if (feature.type === 'Polygon') {\n        for (const polygon of classifyRings(feature.geometry, 0)) {\n            // 16 here represents 2 pixels\n            const poi = findPoleOfInaccessibility(polygon, 16);\n            const subdividedLine = subdivideVertexLine(polygon[0], granularity, true);\n            addSymbolAtAnchor(subdividedLine, new Anchor(poi.x, poi.y, 0));\n        }\n    } else if (feature.type === 'LineString') {\n        // https://github.com/mapbox/mapbox-gl-js/issues/3808\n        for (const line of feature.geometry) {\n            const subdividedLine = subdivideVertexLine(line, granularity);\n            addSymbolAtAnchor(subdividedLine, new Anchor(subdividedLine[0].x, subdividedLine[0].y, 0));\n        }\n    } else if (feature.type === 'Point') {\n        for (const points of feature.geometry) {\n            for (const point of points) {\n                addSymbolAtAnchor([point], new Anchor(point.x, point.y, 0));\n            }\n        }\n    }\n}\n\nfunction addTextVariableAnchorOffsets(textAnchorOffsets: TextAnchorOffsetArray, variableAnchorOffset: VariableAnchorOffsetCollection): [number, number] {\n    const startIndex = textAnchorOffsets.length;\n    const values = variableAnchorOffset?.values;\n\n    if (values?.length > 0) {\n        for (let i = 0; i < values.length; i += 2) {\n            const anchor = TextAnchorEnum[values[i] as TextAnchor];\n            const offset = values[i + 1] as [number, number];\n\n            textAnchorOffsets.emplaceBack(anchor, offset[0], offset[1]);\n        }\n    }\n\n    return [startIndex, textAnchorOffsets.length];\n}\n\nfunction addTextVertices(bucket: SymbolBucket,\n    anchor: Point,\n    shapedText: Shaping,\n    imageMap: {[_: string]: StyleImage},\n    layer: SymbolStyleLayer,\n    textAlongLine: boolean,\n    feature: SymbolFeature,\n    textOffset: [number, number],\n    lineArray: {\n        lineStartIndex: number;\n        lineLength: number;\n    },\n    writingMode: WritingMode,\n    placementTypes: Array<'vertical' | 'center' | 'left' | 'right'>,\n    placedTextSymbolIndices: {[_: string]: number},\n    placedIconIndex: number,\n    sizes: Sizes,\n    canonical: CanonicalTileID) {\n    const glyphQuads = getGlyphQuads(anchor, shapedText, textOffset,\n        layer, textAlongLine, feature, imageMap, bucket.allowVerticalPlacement);\n\n    const sizeData = bucket.textSizeData;\n    let textSizeData = null;\n\n    if (sizeData.kind === 'source') {\n        textSizeData = [\n            SIZE_PACK_FACTOR * layer.layout.get('text-size').evaluate(feature, {})\n        ];\n        if (textSizeData[0] > MAX_PACKED_SIZE) {\n            warnOnce(`${bucket.layerIds[0]}: Value for \"text-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"text-size\".`);\n        }\n    } else if (sizeData.kind === 'composite') {\n        textSizeData = [\n            SIZE_PACK_FACTOR * sizes.compositeTextSizes[0].evaluate(feature, {}, canonical),\n            SIZE_PACK_FACTOR * sizes.compositeTextSizes[1].evaluate(feature, {}, canonical)\n        ];\n        if (textSizeData[0] > MAX_PACKED_SIZE || textSizeData[1] > MAX_PACKED_SIZE) {\n            warnOnce(`${bucket.layerIds[0]}: Value for \"text-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"text-size\".`);\n        }\n    }\n\n    bucket.addSymbols(\n        bucket.text,\n        glyphQuads,\n        textSizeData,\n        textOffset,\n        textAlongLine,\n        feature,\n        writingMode,\n        anchor,\n        lineArray.lineStartIndex,\n        lineArray.lineLength,\n        placedIconIndex,\n        canonical);\n\n    // The placedSymbolArray is used at render time in drawTileSymbols\n    // These indices allow access to the array at collision detection time\n    for (const placementType of placementTypes) {\n        placedTextSymbolIndices[placementType] = bucket.text.placedSymbolArray.length - 1;\n    }\n\n    return glyphQuads.length * 4;\n}\n\nfunction getDefaultHorizontalShaping(\n    horizontalShaping: Record<TextJustify, Shaping>\n): Shaping | null {\n    // We don't care which shaping we get because this is used for collision purposes\n    // and all the justifications have the same collision box\n    for (const justification in horizontalShaping) {\n        return horizontalShaping[justification];\n    }\n    return null;\n}\n\n/**\n * Add a single label & icon placement.\n */\nfunction addSymbol(bucket: SymbolBucket,\n    anchor: Anchor,\n    line: Array<Point>,\n    shapedTextOrientations: ShapedTextOrientations,\n    shapedIcon: PositionedIcon | undefined,\n    imageMap: {[_: string]: StyleImage},\n    verticallyShapedIcon: PositionedIcon | undefined,\n    layer: SymbolStyleLayer,\n    collisionBoxArray: CollisionBoxArray,\n    featureIndex: number,\n    sourceLayerIndex: number,\n    bucketIndex: number,\n    textBoxScale: number,\n    textPadding: SymbolPadding,\n    textAlongLine: boolean,\n    textOffset: [number, number],\n    iconBoxScale: number,\n    iconPadding: SymbolPadding,\n    iconAlongLine: boolean,\n    iconOffset: [number, number],\n    feature: SymbolFeature,\n    sizes: Sizes,\n    isSDFIcon: boolean,\n    canonical: CanonicalTileID,\n    layoutTextSize: number) {\n\n    const lineArray = bucket.addToLineVertexArray(anchor, line);\n\n    let textCollisionFeature, iconCollisionFeature, verticalTextCollisionFeature, verticalIconCollisionFeature;\n\n    let numIconVertices = 0;\n    let numVerticalIconVertices = 0;\n    let numHorizontalGlyphVertices = 0;\n    let numVerticalGlyphVertices = 0;\n    let placedIconSymbolIndex = -1;\n    let verticalPlacedIconSymbolIndex = -1;\n    const placedTextSymbolIndices: {[k: string]: number} = {};\n    let key = murmur3('');\n\n    if (bucket.allowVerticalPlacement && shapedTextOrientations.vertical) {\n        const textRotation = layer.layout.get('text-rotate').evaluate(feature, {}, canonical);\n        const verticalTextRotation = textRotation + 90.0;\n        const verticalShaping = shapedTextOrientations.vertical;\n        verticalTextCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, verticalShaping, textBoxScale, textPadding, textAlongLine, verticalTextRotation);\n\n        if (verticallyShapedIcon) {\n            verticalIconCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, verticallyShapedIcon, iconBoxScale, iconPadding, textAlongLine, verticalTextRotation);\n        }\n    }\n\n    //Place icon first, so text can have a reference to its index in the placed symbol array.\n    //Text symbols can lazily shift at render-time because of variable anchor placement.\n    //If the style specifies an `icon-text-fit` then the icon would have to shift along with it.\n    // For more info check `updateVariableAnchors` in `draw_symbol.js` .\n    if (shapedIcon) {\n        const iconRotate = layer.layout.get('icon-rotate').evaluate(feature, {});\n        const hasIconTextFit = layer.layout.get('icon-text-fit') !== 'none';\n        const iconQuads = getIconQuads(shapedIcon, iconRotate, isSDFIcon, hasIconTextFit);\n        const verticalIconQuads = verticallyShapedIcon ? getIconQuads(verticallyShapedIcon, iconRotate, isSDFIcon, hasIconTextFit) : undefined;\n        iconCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, shapedIcon, iconBoxScale, iconPadding, /*align boxes to line*/false, iconRotate);\n\n        numIconVertices = iconQuads.length * 4;\n\n        const sizeData = bucket.iconSizeData;\n        let iconSizeData = null;\n\n        if (sizeData.kind === 'source') {\n            iconSizeData = [\n                SIZE_PACK_FACTOR * layer.layout.get('icon-size').evaluate(feature, {})\n            ];\n            if (iconSizeData[0] > MAX_PACKED_SIZE) {\n                warnOnce(`${bucket.layerIds[0]}: Value for \"icon-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"icon-size\".`);\n            }\n        } else if (sizeData.kind === 'composite') {\n            iconSizeData = [\n                SIZE_PACK_FACTOR * sizes.compositeIconSizes[0].evaluate(feature, {}, canonical),\n                SIZE_PACK_FACTOR * sizes.compositeIconSizes[1].evaluate(feature, {}, canonical)\n            ];\n            if (iconSizeData[0] > MAX_PACKED_SIZE || iconSizeData[1] > MAX_PACKED_SIZE) {\n                warnOnce(`${bucket.layerIds[0]}: Value for \"icon-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"icon-size\".`);\n            }\n        }\n\n        bucket.addSymbols(\n            bucket.icon,\n            iconQuads,\n            iconSizeData,\n            iconOffset,\n            iconAlongLine,\n            feature,\n            WritingMode.none,\n            anchor,\n            lineArray.lineStartIndex,\n            lineArray.lineLength,\n            // The icon itself does not have an associated symbol since the text isn't placed yet\n            -1, canonical);\n\n        placedIconSymbolIndex = bucket.icon.placedSymbolArray.length - 1;\n\n        if (verticalIconQuads) {\n            numVerticalIconVertices = verticalIconQuads.length * 4;\n\n            bucket.addSymbols(\n                bucket.icon,\n                verticalIconQuads,\n                iconSizeData,\n                iconOffset,\n                iconAlongLine,\n                feature,\n                WritingMode.vertical,\n                anchor,\n                lineArray.lineStartIndex,\n                lineArray.lineLength,\n                // The icon itself does not have an associated symbol since the text isn't placed yet\n                -1, canonical);\n\n            verticalPlacedIconSymbolIndex = bucket.icon.placedSymbolArray.length - 1;\n        }\n    }\n\n    const justifications = Object.keys(shapedTextOrientations.horizontal) as TextJustify[];\n    for (const justification of justifications) {\n        const shaping = shapedTextOrientations.horizontal[justification];\n\n        if (!textCollisionFeature) {\n            key = murmur3(shaping.text);\n            const textRotate = layer.layout.get('text-rotate').evaluate(feature, {}, canonical);\n            // As a collision approximation, we can use either the vertical or any of the horizontal versions of the feature\n            // We're counting on all versions having similar dimensions\n            textCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, shaping, textBoxScale, textPadding, textAlongLine, textRotate);\n        }\n\n        const singleLine = shaping.positionedLines.length === 1;\n        numHorizontalGlyphVertices += addTextVertices(\n            bucket, anchor, shaping, imageMap, layer, textAlongLine, feature, textOffset, lineArray,\n            shapedTextOrientations.vertical ? WritingMode.horizontal : WritingMode.horizontalOnly,\n            singleLine ? justifications : [justification],\n            placedTextSymbolIndices, placedIconSymbolIndex, sizes, canonical);\n\n        if (singleLine) {\n            break;\n        }\n    }\n\n    if (shapedTextOrientations.vertical) {\n        numVerticalGlyphVertices += addTextVertices(\n            bucket, anchor, shapedTextOrientations.vertical, imageMap, layer, textAlongLine, feature,\n            textOffset, lineArray, WritingMode.vertical, ['vertical'], placedTextSymbolIndices, verticalPlacedIconSymbolIndex, sizes, canonical);\n    }\n\n    const textBoxStartIndex = textCollisionFeature ? textCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const textBoxEndIndex = textCollisionFeature ? textCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const verticalTextBoxStartIndex = verticalTextCollisionFeature ? verticalTextCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const verticalTextBoxEndIndex = verticalTextCollisionFeature ? verticalTextCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const iconBoxStartIndex = iconCollisionFeature ? iconCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const iconBoxEndIndex = iconCollisionFeature ? iconCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const verticalIconBoxStartIndex = verticalIconCollisionFeature ? verticalIconCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const verticalIconBoxEndIndex = verticalIconCollisionFeature ? verticalIconCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    // Check if runtime collision circles should be used for any of the collision features.\n    // It is enough to choose the tallest feature shape as circles are always placed on a line.\n    // All measurements are in glyph metrics and later converted into pixels using proper font size \"layoutTextSize\"\n    let collisionCircleDiameter = -1;\n\n    const getCollisionCircleHeight = (feature: CollisionFeature, prevHeight: number): number => {\n        if (feature && feature.circleDiameter)\n            return Math.max(feature.circleDiameter, prevHeight);\n        return prevHeight;\n    };\n\n    collisionCircleDiameter = getCollisionCircleHeight(textCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(verticalTextCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(iconCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(verticalIconCollisionFeature, collisionCircleDiameter);\n    const useRuntimeCollisionCircles = (collisionCircleDiameter > -1) ? 1 : 0;\n\n    // Convert circle collision height into pixels\n    if (useRuntimeCollisionCircles)\n        collisionCircleDiameter *= layoutTextSize / ONE_EM;\n\n    if (bucket.glyphOffsetArray.length >= SymbolBucket.MAX_GLYPHS) warnOnce(\n        'Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907'\n    );\n\n    if (feature.sortKey !== undefined) {\n        bucket.addToSortKeyRanges(bucket.symbolInstances.length, feature.sortKey as number);\n    }\n\n    const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, canonical);\n    const [textAnchorOffsetStartIndex, textAnchorOffsetEndIndex] = addTextVariableAnchorOffsets(bucket.textAnchorOffsets, variableAnchorOffset);\n\n    bucket.symbolInstances.emplaceBack(\n        anchor.x,\n        anchor.y,\n        placedTextSymbolIndices.right >= 0 ? placedTextSymbolIndices.right : -1,\n        placedTextSymbolIndices.center >= 0 ? placedTextSymbolIndices.center : -1,\n        placedTextSymbolIndices.left >= 0 ? placedTextSymbolIndices.left : -1,\n        placedTextSymbolIndices.vertical || -1,\n        placedIconSymbolIndex,\n        verticalPlacedIconSymbolIndex,\n        key,\n        textBoxStartIndex,\n        textBoxEndIndex,\n        verticalTextBoxStartIndex,\n        verticalTextBoxEndIndex,\n        iconBoxStartIndex,\n        iconBoxEndIndex,\n        verticalIconBoxStartIndex,\n        verticalIconBoxEndIndex,\n        featureIndex,\n        numHorizontalGlyphVertices,\n        numVerticalGlyphVertices,\n        numIconVertices,\n        numVerticalIconVertices,\n        useRuntimeCollisionCircles,\n        0,\n        textBoxScale,\n        collisionCircleDiameter,\n        textAnchorOffsetStartIndex,\n        textAnchorOffsetEndIndex);\n}\n\nfunction anchorIsTooClose(bucket: SymbolBucket, text: string, repeatDistance: number, anchor: Point) {\n    const compareText = bucket.compareText;\n    if (!(text in compareText)) {\n        compareText[text] = [];\n    } else {\n        const otherAnchors = compareText[text];\n        for (let k = otherAnchors.length - 1; k >= 0; k--) {\n            if (anchor.dist(otherAnchors[k]) < repeatDistance) {\n                // If it's within repeatDistance of one anchor, stop looking\n                return true;\n            }\n        }\n    }\n    // If anchor is not within repeatDistance of any other anchor, add to array\n    compareText[text].push(anchor);\n    return false;\n}\n","import {AlphaImage} from '../util/image';\nimport {register} from '../util/web_worker_transfer';\nimport potpack from 'potpack';\n\nimport type {GlyphMetrics} from '../style/style_glyph';\nimport type {GetGlyphsResponse} from '../util/actor_messages';\n\nconst padding = 1;\n\n/**\n * A rectangle type with postion, width and height.\n */\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\n\n/**\n * The glyph's position\n */\nexport type GlyphPosition = {\n    rect: Rect;\n    metrics: GlyphMetrics;\n};\n\n/**\n * The glyphs' positions\n */\nexport type GlyphPositions = {\n    [_: string]: {\n        [_: number]: GlyphPosition;\n    };\n};\n\nexport class GlyphAtlas {\n    image: AlphaImage;\n    positions: GlyphPositions;\n\n    constructor(stacks: GetGlyphsResponse) {\n        const positions = {};\n        const bins = [];\n\n        for (const stack in stacks) {\n            const glyphs = stacks[stack];\n            const stackPositions = positions[stack] = {};\n\n            for (const id in glyphs) {\n                const src = glyphs[+id];\n                if (!src || src.bitmap.width === 0 || src.bitmap.height === 0) continue;\n\n                const bin = {\n                    x: 0,\n                    y: 0,\n                    w: src.bitmap.width + 2 * padding,\n                    h: src.bitmap.height + 2 * padding\n                };\n                bins.push(bin);\n                stackPositions[id] = {rect: bin, metrics: src.metrics};\n            }\n        }\n\n        const {w, h} = potpack(bins);\n        const image = new AlphaImage({width: w || 1, height: h || 1});\n\n        for (const stack in stacks) {\n            const glyphs = stacks[stack];\n\n            for (const id in glyphs) {\n                const src = glyphs[+id];\n                if (!src || src.bitmap.width === 0 || src.bitmap.height === 0) continue;\n                const bin = positions[stack][id].rect;\n                AlphaImage.copy(src.bitmap, image, {x: 0, y: 0}, {x: bin.x + padding, y: bin.y + padding}, src.bitmap);\n            }\n        }\n\n        this.image = image;\n        this.positions = positions;\n    }\n}\n\nregister('GlyphAtlas', GlyphAtlas);\n","export { getURL, getTileBBox, getMercCoords };\n\n\n/**\n * getURL\n *\n * @param    {String}  baseUrl  Base url of the WMS server\n * @param    {String}  layer    Layer name\n * @param    {Number}  x        Tile coordinate x\n * @param    {Number}  y        Tile coordinate y\n * @param    {Number}  z        Tile zoom\n * @param    {Object}  [options]\n * @param    {String}  [options.format='image/png']\n * @param    {String}  [options.service='WMS']\n * @param    {String}  [options.version='1.1.1']\n * @param    {String}  [options.request='GetMap']\n * @param    {String}  [options.srs='EPSG:3857']\n * @param    {Number}  [options.width='256']\n * @param    {Number}  [options.height='256']\n * @returns  {String}  url\n * @example\n * var baseUrl = 'http://geodata.state.nj.us/imagerywms/Natural2015';\n * var layer = 'Natural2015';\n * var url = whoots.getURL(baseUrl, layer, 154308, 197167, 19);\n */\nfunction getURL(baseUrl, layer, x, y, z, options) {\n    options = options || {};\n\n    var url = baseUrl + '?' + [\n        'bbox='    + getTileBBox(x, y, z),\n        'format='  + (options.format || 'image/png'),\n        'service=' + (options.service || 'WMS'),\n        'version=' + (options.version || '1.1.1'),\n        'request=' + (options.request || 'GetMap'),\n        'srs='     + (options.srs || 'EPSG:3857'),\n        'width='   + (options.width || 256),\n        'height='  + (options.height || 256),\n        'layers='  + layer\n    ].join('&');\n\n    return url;\n}\n\n\n/**\n * getTileBBox\n *\n * @param    {Number}  x  Tile coordinate x\n * @param    {Number}  y  Tile coordinate y\n * @param    {Number}  z  Tile zoom\n * @returns  {String}  String of the bounding box\n */\nfunction getTileBBox(x, y, z) {\n    // for Google/OSM tile scheme we need to alter the y\n    y = (Math.pow(2, z) - y - 1);\n\n    var min = getMercCoords(x * 256, y * 256, z),\n        max = getMercCoords((x + 1) * 256, (y + 1) * 256, z);\n\n    return min[0] + ',' + min[1] + ',' + max[0] + ',' + max[1];\n}\n\n\n/**\n * getMercCoords\n *\n * @param    {Number}  x  Pixel coordinate x\n * @param    {Number}  y  Pixel coordinate y\n * @param    {Number}  z  Tile zoom\n * @returns  {Array}   [x, y]\n */\nfunction getMercCoords(x, y, z) {\n    var resolution = (2 * Math.PI * 6378137 / 256) / Math.pow(2, z),\n        merc_x = (x * resolution - 2 * Math.PI  * 6378137 / 2.0),\n        merc_y = (y * resolution - 2 * Math.PI  * 6378137 / 2.0);\n\n    return [merc_x, merc_y];\n}\n","import {wrap} from '../util/util';\n\n/*\n* Approximate radius of the earth in meters.\n* Uses the WGS-84 approximation. The radius at the equator is ~6378137 and at the poles is ~6356752. https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84\n* 6371008.8 is one published \"average radius\" see https://en.wikipedia.org/wiki/Earth_radius#Mean_radius, or ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf p.4\n*/\nexport const earthRadius = 6371008.8;\n\n/**\n * A {@link LngLat} object, an array of two numbers representing longitude and latitude,\n * or an object with `lng` and `lat` or `lon` and `lat` properties.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let v1 = new LngLat(-122.420679, 37.772537);\n * let v2 = [-122.420679, 37.772537];\n * let v3 = {lon: -122.420679, lat: 37.772537};\n * ```\n */\nexport type LngLatLike = LngLat | {\n    lng: number;\n    lat: number;\n} | {\n    lon: number;\n    lat: number;\n} | [number, number];\n\n/**\n * A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.\n * These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).\n *\n * MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the\n * [GeoJSON specification](https://tools.ietf.org/html/rfc7946).\n *\n * Note that any MapLibre GL JS method that accepts a `LngLat` object as an argument or option\n * can also accept an `Array` of two numbers and will perform an implicit conversion.\n * This flexible type is documented as {@link LngLatLike}.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let ll = new LngLat(-123.9749, 40.7736);\n * ll.lng; // = -123.9749\n * ```\n * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)\n * @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js/docs/examples/timeline-animation/)\n */\nexport class LngLat {\n    /**\n     * Longitude, measured in degrees.\n     */\n    lng: number;\n\n    /**\n     * Latitude, measured in degrees.\n     */\n    lat: number;\n\n    /**\n     * @param lng - Longitude, measured in degrees.\n     * @param lat - Latitude, measured in degrees.\n     */\n    constructor(lng: number, lat: number) {\n        if (isNaN(lng) || isNaN(lat)) {\n            throw new Error(`Invalid LngLat object: (${lng}, ${lat})`);\n        }\n        this.lng = +lng;\n        this.lat = +lat;\n        if (this.lat > 90 || this.lat < -90) {\n            throw new Error('Invalid LngLat latitude value: must be between -90 and 90');\n        }\n    }\n\n    /**\n     * Returns a new `LngLat` object whose longitude is wrapped to the range (-180, 180).\n     *\n     * @returns The wrapped `LngLat` object.\n     * @example\n     * ```ts\n     * let ll = new LngLat(286.0251, 40.7736);\n     * let wrapped = ll.wrap();\n     * wrapped.lng; // = -73.9749\n     * ```\n     */\n    wrap() {\n        return new LngLat(wrap(this.lng, -180, 180), this.lat);\n    }\n\n    /**\n     * Returns the coordinates represented as an array of two numbers.\n     *\n     * @returns The coordinates represented as an array of longitude and latitude.\n     * @example\n     * ```ts\n     * let ll = new LngLat(-73.9749, 40.7736);\n     * ll.toArray(); // = [-73.9749, 40.7736]\n     * ```\n     */\n    toArray(): [number, number] {\n        return [this.lng, this.lat];\n    }\n\n    /**\n     * Returns the coordinates represent as a string.\n     *\n     * @returns The coordinates represented as a string of the format `'LngLat(lng, lat)'`.\n     * @example\n     * ```ts\n     * let ll = new LngLat(-73.9749, 40.7736);\n     * ll.toString(); // = \"LngLat(-73.9749, 40.7736)\"\n     * ```\n     */\n    toString(): string {\n        return `LngLat(${this.lng}, ${this.lat})`;\n    }\n\n    /**\n     * Returns the approximate distance between a pair of coordinates in meters\n     * Uses the Haversine Formula (from R.W. Sinnott, \"Virtues of the Haversine\", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)\n     *\n     * @param lngLat - coordinates to compute the distance to\n     * @returns Distance in meters between the two coordinates.\n     * @example\n     * ```ts\n     * let new_york = new LngLat(-74.0060, 40.7128);\n     * let los_angeles = new LngLat(-118.2437, 34.0522);\n     * new_york.distanceTo(los_angeles); // = 3935751.690893987, \"true distance\" using a non-spherical approximation is ~3966km\n     * ```\n     */\n    distanceTo(lngLat: LngLat): number {\n        const rad = Math.PI / 180;\n        const lat1 = this.lat * rad;\n        const lat2 = lngLat.lat * rad;\n        const a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((lngLat.lng - this.lng) * rad);\n\n        const maxMeters = earthRadius * Math.acos(Math.min(a, 1));\n        return maxMeters;\n    }\n\n    /**\n     * Converts an array of two numbers or an object with `lng` and `lat` or `lon` and `lat` properties\n     * to a `LngLat` object.\n     *\n     * If a `LngLat` object is passed in, the function returns it unchanged.\n     *\n     * @param input - An array of two numbers or object to convert, or a `LngLat` object to return.\n     * @returns A new `LngLat` object, if a conversion occurred, or the original `LngLat` object.\n     * @example\n     * ```ts\n     * let arr = [-73.9749, 40.7736];\n     * let ll = LngLat.convert(arr);\n     * ll;   // = LngLat {lng: -73.9749, lat: 40.7736}\n     * ```\n     */\n    static convert(input: LngLatLike): LngLat {\n        if (input instanceof LngLat) {\n            return input;\n        }\n        if (Array.isArray(input) && (input.length === 2 || input.length === 3)) {\n            return new LngLat(Number(input[0]), Number(input[1]));\n        }\n        if (!Array.isArray(input) && typeof input === 'object' && input !== null) {\n            return new LngLat(\n                // flow can't refine this to have one of lng or lat, so we have to cast to any\n                Number('lng' in input ? (input as any).lng : (input as any).lon),\n                Number(input.lat)\n            );\n        }\n        throw new Error('`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]');\n    }\n}\n","import {LngLat, earthRadius} from '../geo/lng_lat';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport {type IMercatorCoordinate} from '@maplibre/maplibre-gl-style-spec';\n\n/*\n * The average circumference of the world in meters.\n */\nconst earthCircumference = 2 * Math.PI * earthRadius; // meters\n\n/*\n * The circumference at a line of latitude in meters.\n */\nfunction circumferenceAtLatitude(latitude: number) {\n    return earthCircumference * Math.cos(latitude * Math.PI / 180);\n}\n\nexport function mercatorXfromLng(lng: number) {\n    return (180 + lng) / 360;\n}\n\nexport function mercatorYfromLat(lat: number) {\n    return (180 - (180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360)))) / 360;\n}\n\nexport function mercatorZfromAltitude(altitude: number, lat: number) {\n    return altitude / circumferenceAtLatitude(lat);\n}\n\nexport function lngFromMercatorX(x: number) {\n    return x * 360 - 180;\n}\n\nexport function latFromMercatorY(y: number) {\n    const y2 = 180 - y * 360;\n    return 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90;\n}\n\nexport function altitudeFromMercatorZ(z: number, y: number) {\n    return z * circumferenceAtLatitude(latFromMercatorY(y));\n}\n\n/**\n * Determine the Mercator scale factor for a given latitude, see\n * https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor\n *\n * At the equator the scale factor will be 1, which increases at higher latitudes.\n *\n * @param lat - Latitude\n * @returns scale factor\n */\nexport function mercatorScale(lat: number) {\n    return 1 / Math.cos(lat * Math.PI / 180);\n}\n\n/**\n * A `MercatorCoordinate` object represents a projected three dimensional position.\n *\n * `MercatorCoordinate` uses the web mercator projection ([EPSG:3857](https://epsg.io/3857)) with slightly different units:\n *\n * - the size of 1 unit is the width of the projected world instead of the \"mercator meter\"\n * - the origin of the coordinate space is at the north-west corner instead of the middle\n *\n * For example, `MercatorCoordinate(0, 0, 0)` is the north-west corner of the mercator world and\n * `MercatorCoordinate(1, 1, 0)` is the south-east corner. If you are familiar with\n * [vector tiles](https://github.com/mapbox/vector-tile-spec) it may be helpful to think\n * of the coordinate space as the `0/0/0` tile with an extent of `1`.\n *\n * The `z` dimension of `MercatorCoordinate` is conformal. A cube in the mercator coordinate space would be rendered as a cube.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let nullIsland = new MercatorCoordinate(0.5, 0.5, 0);\n * ```\n * @see [Add a custom style layer](https://maplibre.org/maplibre-gl-js/docs/examples/custom-style-layer/)\n */\nexport class MercatorCoordinate implements IMercatorCoordinate {\n    x: number;\n    y: number;\n    z: number;\n\n    /**\n     * @param x - The x component of the position.\n     * @param y - The y component of the position.\n     * @param z - The z component of the position.\n     */\n    constructor(x: number, y: number, z: number = 0) {\n        this.x = +x;\n        this.y = +y;\n        this.z = +z;\n    }\n\n    /**\n     * Project a `LngLat` to a `MercatorCoordinate`.\n     *\n     * @param lngLatLike - The location to project.\n     * @param altitude - The altitude in meters of the position.\n     * @returns The projected mercator coordinate.\n     * @example\n     * ```ts\n     * let coord = MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);\n     * coord; // MercatorCoordinate(0.5, 0.5, 0)\n     * ```\n     */\n    static fromLngLat(lngLatLike: LngLatLike, altitude: number = 0): MercatorCoordinate {\n        const lngLat = LngLat.convert(lngLatLike);\n\n        return new MercatorCoordinate(\n            mercatorXfromLng(lngLat.lng),\n            mercatorYfromLat(lngLat.lat),\n            mercatorZfromAltitude(altitude, lngLat.lat));\n    }\n\n    /**\n     * Returns the `LngLat` for the coordinate.\n     *\n     * @returns The `LngLat` object.\n     * @example\n     * ```ts\n     * let coord = new MercatorCoordinate(0.5, 0.5, 0);\n     * let lngLat = coord.toLngLat(); // LngLat(0, 0)\n     * ```\n     */\n    toLngLat() {\n        return new LngLat(\n            lngFromMercatorX(this.x),\n            latFromMercatorY(this.y));\n    }\n\n    /**\n     * Returns the altitude in meters of the coordinate.\n     *\n     * @returns The altitude in meters.\n     * @example\n     * ```ts\n     * let coord = new MercatorCoordinate(0, 0, 0.02);\n     * coord.toAltitude(); // 6914.281956295339\n     * ```\n     */\n    toAltitude(): number {\n        return altitudeFromMercatorZ(this.z, this.y);\n    }\n\n    /**\n     * Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.\n     *\n     * For coordinates in real world units using meters, this naturally provides the scale\n     * to transform into `MercatorCoordinate`s.\n     *\n     * @returns Distance of 1 meter in `MercatorCoordinate` units.\n     */\n    meterInMercatorCoordinateUnits(): number {\n        // 1 meter / circumference at equator in meters * Mercator projection scale factor at this latitude\n        return 1 / earthCircumference * mercatorScale(latFromMercatorY(this.y));\n    }\n}\n","import {getTileBBox} from '@mapbox/whoots-js';\nimport {EXTENT} from '../data/extent';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {register} from '../util/web_worker_transfer';\nimport {type mat4} from 'gl-matrix';\nimport {type ICanonicalTileID, type IMercatorCoordinate} from '@maplibre/maplibre-gl-style-spec';\nimport {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from '../util/util';\nimport {isInBoundsForTileZoomXY} from '../util/world_bounds';\n\n/**\n * A canonical way to define a tile ID\n */\nexport class CanonicalTileID implements ICanonicalTileID {\n    z: number;\n    x: number;\n    y: number;\n    key: string;\n\n    constructor(z: number, x: number, y: number) {\n\n        if (!isInBoundsForTileZoomXY(z, x, y)) {\n            throw new Error(`x=${x}, y=${y}, z=${z} outside of bounds. 0<=x<${Math.pow(2, z)}, 0<=y<${Math.pow(2, z)} ${MIN_TILE_ZOOM}<=z<=${MAX_TILE_ZOOM} `);\n        }\n\n        this.z = z;\n        this.x = x;\n        this.y = y;\n        this.key = calculateTileKey(0, z, z, x, y);\n    }\n\n    equals(id: ICanonicalTileID) {\n        return this.z === id.z && this.x === id.x && this.y === id.y;\n    }\n\n    /**\n     * given a list of urls, choose a url template and return a tile URL\n     */\n    url(urls: Array<string>, pixelRatio: number, scheme?: string | null) {\n        const bbox = getTileBBox(this.x, this.y, this.z);\n        const quadkey = getQuadkey(this.z, this.x, this.y);\n\n        return urls[(this.x + this.y) % urls.length]\n            .replace(/{prefix}/g, (this.x % 16).toString(16) + (this.y % 16).toString(16))\n            .replace(/{z}/g, String(this.z))\n            .replace(/{x}/g, String(this.x))\n            .replace(/{y}/g, String(scheme === 'tms' ? (Math.pow(2, this.z) - this.y - 1) : this.y))\n            .replace(/{ratio}/g, pixelRatio > 1 ? '@2x' : '')\n            .replace(/{quadkey}/g, quadkey)\n            .replace(/{bbox-epsg-3857}/g, bbox);\n    }\n\n    isChildOf(parent: ICanonicalTileID) {\n        const dz = this.z - parent.z;\n        return  dz > 0 && parent.x === (this.x >> dz) && parent.y === (this.y >> dz);\n    }\n\n    getTilePoint(coord: IMercatorCoordinate) {\n        const tilesAtZoom = Math.pow(2, this.z);\n        return new Point(\n            (coord.x * tilesAtZoom - this.x) * EXTENT,\n            (coord.y * tilesAtZoom - this.y) * EXTENT);\n    }\n\n    toString() {\n        return `${this.z}/${this.x}/${this.y}`;\n    }\n}\n\n/**\n * @internal\n * An unwrapped tile identifier\n */\nexport class UnwrappedTileID {\n    wrap: number;\n    canonical: CanonicalTileID;\n    key: string;\n\n    constructor(wrap: number, canonical: CanonicalTileID) {\n        this.wrap = wrap;\n        this.canonical = canonical;\n        this.key = calculateTileKey(wrap, canonical.z, canonical.z, canonical.x, canonical.y);\n    }\n}\n\n/**\n * An overscaled tile identifier\n */\nexport class OverscaledTileID {\n    overscaledZ: number;\n    wrap: number;\n    canonical: CanonicalTileID;\n    key: string;\n    /**\n     * This matrix is used during terrain's render-to-texture stage only.\n     * If the render-to-texture stage is active, this matrix will be present\n     * and should be used, otherwise this matrix will be null.\n     * The matrix should be float32 in order to avoid slow WebGL calls in Chrome.\n     */\n    terrainRttPosMatrix32f: mat4 | null = null;\n\n    constructor(overscaledZ: number, wrap: number, z: number, x: number, y: number) {\n        if (overscaledZ < z) throw new Error(`overscaledZ should be >= z; overscaledZ = ${overscaledZ}; z = ${z}`);\n        this.overscaledZ = overscaledZ;\n        this.wrap = wrap;\n        this.canonical = new CanonicalTileID(z, +x, +y);\n        this.key = calculateTileKey(wrap, overscaledZ, z, x, y);\n    }\n\n    clone() {\n        return new OverscaledTileID(this.overscaledZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    equals(id: OverscaledTileID) {\n        return this.overscaledZ === id.overscaledZ && this.wrap === id.wrap && this.canonical.equals(id.canonical);\n    }\n\n    /**\n     * Returns a new `OverscaledTileID` representing the tile at the target zoom level.\n     * When targetZ is greater than the current canonical z, the canonical coordinates are unchanged.\n     * When targetZ is less than the current canonical z, the canonical coordinates are updated.\n     * @param targetZ - the zoom level to scale to. Must be less than or equal to this.overscaledZ\n     * @returns a new OverscaledTileID representing the tile at the target zoom level\n     * @throws if targetZ is greater than this.overscaledZ\n     */\n    scaledTo(targetZ: number) {\n        if (targetZ > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${targetZ}; overscaledZ = ${this.overscaledZ}`);\n        const zDifference = this.canonical.z - targetZ;\n        if (targetZ > this.canonical.z) {\n            return new OverscaledTileID(targetZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n        } else {\n            return new OverscaledTileID(targetZ, this.wrap, targetZ, this.canonical.x >> zDifference, this.canonical.y >> zDifference);\n        }\n    }\n\n    isOverscaled() {\n        return (this.overscaledZ > this.canonical.z);\n    }\n\n    /*\n     * calculateScaledKey is an optimization:\n     * when withWrap == true, implements the same as this.scaledTo(z).key,\n     * when withWrap == false, implements the same as this.scaledTo(z).wrapped().key.\n     */\n    calculateScaledKey(targetZ: number, withWrap: boolean): string {\n        if (targetZ > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${targetZ}; overscaledZ = ${this.overscaledZ}`);\n        const zDifference = this.canonical.z - targetZ;\n        if (targetZ > this.canonical.z) {\n            return calculateTileKey(this.wrap * +withWrap, targetZ, this.canonical.z, this.canonical.x, this.canonical.y);\n        } else {\n            return calculateTileKey(this.wrap * +withWrap, targetZ, targetZ, this.canonical.x >> zDifference, this.canonical.y >> zDifference);\n        }\n    }\n\n    isChildOf(parent: OverscaledTileID): boolean {\n        if (parent.wrap !== this.wrap) return false; // different world copy\n\n        const zDifference = this.overscaledZ - parent.overscaledZ;\n        if (zDifference <= 0) return false; // must be deeper zoom\n\n        //special case for root tile (bitwise math doesn't work for root)\n        if (parent.overscaledZ === 0) return this.overscaledZ > 0;\n\n        const dz = this.canonical.z - parent.canonical.z;\n        if (dz < 0) return false; // parent can't be deeper canonically\n\n        return (\n            parent.canonical.x === (this.canonical.x >> dz) &&\n            parent.canonical.y === (this.canonical.y >> dz)\n        );\n    }\n\n    children(sourceMaxZoom: number) {\n        if (this.overscaledZ >= sourceMaxZoom) {\n            // return a single tile coord representing a an overscaled tile\n            return [new OverscaledTileID(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)];\n        }\n\n        const z = this.canonical.z + 1;\n        const x = this.canonical.x * 2;\n        const y = this.canonical.y * 2;\n        return [\n            new OverscaledTileID(z, this.wrap, z, x, y),\n            new OverscaledTileID(z, this.wrap, z, x + 1, y),\n            new OverscaledTileID(z, this.wrap, z, x, y + 1),\n            new OverscaledTileID(z, this.wrap, z, x + 1, y + 1)\n        ];\n    }\n\n    isLessThan(rhs: OverscaledTileID) {\n        if (this.wrap < rhs.wrap) return true;\n        if (this.wrap > rhs.wrap) return false;\n\n        if (this.overscaledZ < rhs.overscaledZ) return true;\n        if (this.overscaledZ > rhs.overscaledZ) return false;\n\n        if (this.canonical.x < rhs.canonical.x) return true;\n        if (this.canonical.x > rhs.canonical.x) return false;\n\n        if (this.canonical.y < rhs.canonical.y) return true;\n        return false;\n    }\n\n    wrapped() {\n        return new OverscaledTileID(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    unwrapTo(wrap: number) {\n        return new OverscaledTileID(this.overscaledZ, wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    overscaleFactor() {\n        return Math.pow(2, this.overscaledZ - this.canonical.z);\n    }\n\n    toUnwrapped() {\n        return new UnwrappedTileID(this.wrap, this.canonical);\n    }\n\n    toString() {\n        return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`;\n    }\n\n    getTilePoint(coord: MercatorCoordinate) {\n        return this.canonical.getTilePoint(new MercatorCoordinate(coord.x - this.wrap, coord.y));\n    }\n}\n\nexport function calculateTileKey(wrap: number, overscaledZ: number, z: number, x: number, y: number): string {\n    wrap *= 2;\n    if (wrap < 0) wrap = wrap * -1 - 1;\n    const dim = 1 << z;\n    return (dim * dim * wrap + dim * y + x).toString(36) + z.toString(36) + overscaledZ.toString(36);\n}\n\nfunction getQuadkey(z, x, y) {\n    let quadkey = '', mask;\n    for (let i = z; i > 0; i--) {\n        mask = 1 << (i - 1);\n        quadkey += ((x & mask ? 1 : 0) + (y & mask ? 2 : 0));\n    }\n    return quadkey;\n}\n\nexport function compareTileId(a: OverscaledTileID, b: OverscaledTileID): number {\n    // Different copies of the world are sorted based on their distance to the center.\n    // Wrap values are converted to unsigned distances by reserving odd number for copies\n    // with negative wrap and even numbers for copies with positive wrap.\n    const aWrap = Math.abs(a.wrap * 2) - +(a.wrap < 0);\n    const bWrap = Math.abs(b.wrap * 2) - +(b.wrap < 0);\n    return a.overscaledZ - b.overscaledZ || bWrap - aWrap || b.canonical.y - a.canonical.y || b.canonical.x - a.canonical.x;\n}\n\nregister('CanonicalTileID', CanonicalTileID);\nregister('OverscaledTileID', OverscaledTileID, {omit: ['terrainRttPosMatrix32f']});\n","import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from './util';\nimport {type LngLat} from '../geo/lng_lat';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\n/**\n * Returns true if a given tile zoom (Z), X, and Y are in the bounds of the world.\n * Zoom bounds are the minimum zoom (inclusive) through the maximum zoom (inclusive).\n * X and Y bounds are 0 (inclusive) to their respective zoom-dependent maxima (exclusive).\n *\n * @param zoom - the tile zoom (Z)\n * @param x - the tile X\n * @param y - the tile Y\n * @returns `true` if a given tile zoom, X, and Y are in the bounds of the world.\n */\nexport function isInBoundsForTileZoomXY(zoom: number, x: number, y: number): boolean {\n    return !(\n        zoom < MIN_TILE_ZOOM ||\n        zoom > MAX_TILE_ZOOM ||\n        y < 0 ||\n        y >= Math.pow(2, zoom) ||\n        x < 0 ||\n        x >= Math.pow(2, zoom)\n    );\n}\n\n/**\n * Returns true if a given zoom and `LngLat` are in the bounds of the world.\n * Does not wrap `LngLat` when checking if in bounds.\n * Zoom bounds are the minimum zoom (inclusive) through the maximum zoom (inclusive).\n * `LngLat` bounds are the mercator world's north-west corner (inclusive) to its south-east corner (exclusive).\n *\n * @param zoom - the tile zoom (Z)\n * @param LngLat - the `LngLat` object containing the longitude and latitude\n * @returns `true` if a given zoom and `LngLat` are in the bounds of the world.\n */\nexport function isInBoundsForZoomLngLat(zoom: number, lnglat: LngLat): boolean {\n    const {x, y} = MercatorCoordinate.fromLngLat(lnglat);\n    return !(\n        zoom < MIN_TILE_ZOOM ||\n        zoom > MAX_TILE_ZOOM ||\n        y < 0 ||\n        y >= 1 ||\n        x < 0 ||\n        x >= 1\n    );\n}\n","import {FeatureIndex} from '../data/feature_index';\nimport {performSymbolLayout} from '../symbol/symbol_layout';\nimport {CollisionBoxArray} from '../data/array_types.g';\nimport {DictionaryCoder} from '../util/dictionary_coder';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {LineBucket} from '../data/bucket/line_bucket';\nimport {FillBucket} from '../data/bucket/fill_bucket';\nimport {FillExtrusionBucket} from '../data/bucket/fill_extrusion_bucket';\nimport {warnOnce, mapObject} from '../util/util';\nimport {ImageAtlas} from '../render/image_atlas';\nimport {GlyphAtlas} from '../render/glyph_atlas';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {OverscaledTileID} from '../tile/tile_id';\n\nimport type {Bucket} from '../data/bucket';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\nimport type {\n    WorkerTileParameters,\n    WorkerTileResult,\n} from '../source/worker_source';\nimport type {PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileLike} from '@maplibre/vt-pbf';\nimport {type GetDashesResponse, MessageType, type GetGlyphsResponse, type GetImagesResponse} from '../util/actor_messages';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\nexport class WorkerTile {\n    tileID: OverscaledTileID;\n    uid: string | number;\n    zoom: number;\n    pixelRatio: number;\n    tileSize: number;\n    source: string;\n    promoteId: PromoteIdSpecification;\n    overscaling: number;\n    showCollisionBoxes: boolean;\n    collectResourceTiming: boolean;\n    returnDependencies: boolean;\n\n    status: 'parsing' | 'done';\n    data: VectorTileLike;\n    collisionBoxArray: CollisionBoxArray;\n\n    abort: AbortController;\n    vectorTile: VectorTileLike;\n    inFlightDependencies: AbortController[];\n\n    constructor(params: WorkerTileParameters) {\n        this.tileID = new OverscaledTileID(params.tileID.overscaledZ, params.tileID.wrap, params.tileID.canonical.z, params.tileID.canonical.x, params.tileID.canonical.y);\n        this.uid = params.uid;\n        this.zoom = params.zoom;\n        this.pixelRatio = params.pixelRatio;\n        this.tileSize = params.tileSize;\n        this.source = params.source;\n        this.overscaling = this.tileID.overscaleFactor();\n        this.showCollisionBoxes = params.showCollisionBoxes;\n        this.collectResourceTiming = !!params.collectResourceTiming;\n        this.returnDependencies = !!params.returnDependencies;\n        this.promoteId = params.promoteId;\n        this.inFlightDependencies = [];\n    }\n\n    async parse(data: VectorTileLike, layerIndex: StyleLayerIndex, availableImages: Array<string>, actor: IActor, subdivisionGranularity: SubdivisionGranularitySetting): Promise<WorkerTileResult> {\n        this.status = 'parsing';\n        this.data = data;\n\n        this.collisionBoxArray = new CollisionBoxArray();\n        const sourceLayerCoder = new DictionaryCoder(Object.keys(data.layers).sort());\n\n        const featureIndex = new FeatureIndex(this.tileID, this.promoteId);\n        featureIndex.bucketLayerIDs = [];\n\n        const buckets: {[_: string]: Bucket} = {};\n\n        const options = {\n            featureIndex,\n            iconDependencies: {},\n            patternDependencies: {},\n            glyphDependencies: {},\n            dashDependencies: {},\n            availableImages,\n            subdivisionGranularity\n        };\n\n        const layerFamilies = layerIndex.familiesBySource[this.source];\n        for (const sourceLayerId in layerFamilies) {\n            const sourceLayer = data.layers[sourceLayerId];\n            if (!sourceLayer) {\n                continue;\n            }\n\n            if (sourceLayer.version === 1) {\n                warnOnce(`Vector tile source \"${this.source}\" layer \"${sourceLayerId}\" ` +\n                    'does not use vector tile spec v2 and therefore may have some rendering errors.');\n            }\n\n            const sourceLayerIndex = sourceLayerCoder.encode(sourceLayerId);\n            const features = [];\n            for (let index = 0; index < sourceLayer.length; index++) {\n                const feature = sourceLayer.feature(index);\n                const id = featureIndex.getId(feature, sourceLayerId);\n                features.push({feature, id, index, sourceLayerIndex});\n            }\n\n            for (const family of layerFamilies[sourceLayerId]) {\n                const layer = family[0];\n\n                if (layer.source !== this.source) {\n                    warnOnce(`layer.source = ${layer.source} does not equal this.source = ${this.source}`);\n                }\n                if (layer.isHidden(this.zoom, true)) continue;\n                recalculateLayers(family, this.zoom, availableImages);\n\n                const bucket = buckets[layer.id] = layer.createBucket({\n                    index: featureIndex.bucketLayerIDs.length,\n                    layers: family,\n                    zoom: this.zoom,\n                    pixelRatio: this.pixelRatio,\n                    overscaling: this.overscaling,\n                    collisionBoxArray: this.collisionBoxArray,\n                    sourceLayerIndex,\n                    sourceID: this.source\n                });\n\n                bucket.populate(features, options, this.tileID.canonical);\n                featureIndex.bucketLayerIDs.push(family.map((l) => l.id));\n            }\n        }\n\n        // options.glyphDependencies looks like: {\"SomeFontName\":{\"10\":true,\"32\":true}}\n        // this line makes an object like: {\"SomeFontName\":[10,32]}\n        const stacks: {[_: string]: Array<number>} = mapObject(options.glyphDependencies, (glyphs) => Object.keys(glyphs).map(Number));\n\n        this.inFlightDependencies.forEach((request) => request?.abort());\n        this.inFlightDependencies = [];\n\n        let getGlyphsPromise = Promise.resolve<GetGlyphsResponse>({});\n        if (Object.keys(stacks).length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getGlyphsPromise = actor.sendAsync({type: MessageType.getGlyphs, data: {stacks, source: this.source, tileID: this.tileID, type: 'glyphs'}}, abortController);\n        }\n\n        const icons = Object.keys(options.iconDependencies);\n        let getIconsPromise = Promise.resolve<GetImagesResponse>({});\n        if (icons.length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getIconsPromise = actor.sendAsync({type: MessageType.getImages, data: {icons, source: this.source, tileID: this.tileID, type: 'icons'}}, abortController);\n        }\n\n        const patterns = Object.keys(options.patternDependencies);\n        let getPatternsPromise = Promise.resolve<GetImagesResponse>({});\n        if (patterns.length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getPatternsPromise = actor.sendAsync({type: MessageType.getImages, data: {icons: patterns, source: this.source, tileID: this.tileID, type: 'patterns'}}, abortController);\n        }\n\n        const dashes = options.dashDependencies;\n        let getDashesPromise = Promise.resolve<GetDashesResponse>({} as GetDashesResponse);\n        if (Object.keys(dashes).length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getDashesPromise = actor.sendAsync({type: MessageType.getDashes, data: {dashes}}, abortController);\n        }\n\n        const [glyphMap, iconMap, patternMap, dashPositions] = await Promise.all([getGlyphsPromise, getIconsPromise, getPatternsPromise, getDashesPromise]);\n\n        const glyphAtlas = new GlyphAtlas(glyphMap);\n        const imageAtlas = new ImageAtlas(iconMap, patternMap);\n\n        for (const key in buckets) {\n            const bucket = buckets[key];\n            if (bucket instanceof SymbolBucket) {\n                recalculateLayers(bucket.layers, this.zoom, availableImages);\n                performSymbolLayout({\n                    bucket,\n                    glyphMap,\n                    glyphPositions: glyphAtlas.positions,\n                    imageMap: iconMap,\n                    imagePositions: imageAtlas.iconPositions,\n                    showCollisionBoxes: this.showCollisionBoxes,\n                    canonical: this.tileID.canonical,\n                    subdivisionGranularity: options.subdivisionGranularity\n                });\n            } else if (bucket.hasDependencies && (bucket instanceof FillBucket || bucket instanceof FillExtrusionBucket || bucket instanceof LineBucket)) {\n                recalculateLayers(bucket.layers, this.zoom, availableImages);\n                bucket.addFeatures(options, this.tileID.canonical, imageAtlas.patternPositions, dashPositions);\n            }\n        }\n\n        this.status = 'done';\n        return {\n            buckets: Object.values(buckets).filter(b => !b.isEmpty()),\n            featureIndex,\n            collisionBoxArray: this.collisionBoxArray,\n            glyphAtlasImage: glyphAtlas.image,\n            imageAtlas,\n            dashPositions,\n            // Only used for benchmarking:\n            glyphMap: this.returnDependencies ? glyphMap : null,\n            iconMap: this.returnDependencies ? iconMap : null,\n            glyphPositions: this.returnDependencies ? glyphAtlas.positions : null\n        };\n    }\n}\n\nfunction recalculateLayers(layers: ReadonlyArray<StyleLayer>, zoom: number, availableImages: Array<string>) {\n    // Layers are shared and may have been used by a WorkerTile with a different zoom.\n    const parameters = new EvaluationParameters(zoom);\n    for (const layer of layers) {\n        layer.recalculate(parameters, availableImages);\n    }\n}\n","import {type OverscaledTileID} from './tile_id';\nimport type {Tile} from './tile';\n\n/**\n * @internal\n * A [least-recently-used cache](https://en.wikipedia.org/wiki/Cache_algorithms)\n * with hash lookup made possible by keeping a list of keys in parallel to\n * an array of dictionary of values\n *\n * TileManager offloads currently unused tiles to this cache, and when a tile gets used again,\n * it is also removed from this cache. Thus addition is the only operation that counts as \"usage\"\n * for the purposes of LRU behaviour.\n */\nexport class TileCache {\n    max: number;\n    data: {\n        [key: string]: Array<{\n            value: Tile;\n            timeout: ReturnType<typeof setTimeout>;\n        }>;\n    };\n    order: Array<string>;\n    onRemove: (element: Tile) => void;\n    /**\n     * @param max - number of permitted values\n     * @param onRemove - callback called with items when they expire\n     */\n    constructor(max: number, onRemove: (element: Tile) => void) {\n        this.max = max;\n        this.onRemove = onRemove;\n        this.reset();\n    }\n\n    /**\n     * Clear the cache\n     *\n     * @returns this cache\n     */\n    reset() {\n        for (const key in this.data) {\n            for (const removedData of this.data[key]) {\n                if (removedData.timeout) clearTimeout(removedData.timeout);\n                this.onRemove(removedData.value);\n            }\n        }\n\n        this.data = {};\n        this.order = [];\n\n        return this;\n    }\n\n    /**\n     * Add a key, value combination to the cache, trimming its size if this pushes\n     * it over max length.\n     *\n     * @param tileID - lookup key for the item\n     * @param data - tile data\n     *\n     * @returns this cache\n     */\n    add(tileID: OverscaledTileID, data: Tile, expiryTimeout: number | void) {\n        const key = tileID.wrapped().key;\n        if (this.data[key] === undefined) {\n            this.data[key] = [];\n        }\n\n        const dataWrapper = {\n            value: data,\n            timeout: undefined\n        };\n\n        if (expiryTimeout !== undefined) {\n            dataWrapper.timeout = setTimeout(() => {\n                this.remove(tileID, dataWrapper);\n            }, expiryTimeout as number);\n        }\n\n        this.data[key].push(dataWrapper);\n        this.order.push(key);\n\n        if (this.order.length > this.max) {\n            const removedData = this._getAndRemoveByKey(this.order[0]);\n            if (removedData) this.onRemove(removedData);\n        }\n\n        return this;\n    }\n\n    /**\n     * Determine whether the value attached to `key` is present\n     *\n     * @param tileID - the key to be looked-up\n     * @returns whether the cache has this value\n     */\n    has(tileID: OverscaledTileID): boolean {\n        return tileID.wrapped().key in this.data;\n    }\n\n    /**\n     * Get the value attached to a specific key and remove data from cache.\n     * If the key is not found, returns `null`\n     *\n     * @param tileID - the key to look up\n     * @returns the tile data, or null if it isn't found\n     */\n    getAndRemove(tileID: OverscaledTileID): Tile {\n        if (!this.has(tileID)) { return null; }\n        return this._getAndRemoveByKey(tileID.wrapped().key);\n    }\n\n    /*\n     * Get and remove the value with the specified key.\n     */\n    _getAndRemoveByKey(key: string): Tile {\n        const data = this.data[key].shift();\n        if (data.timeout) clearTimeout(data.timeout);\n\n        if (this.data[key].length === 0) {\n            delete this.data[key];\n        }\n        this.order.splice(this.order.indexOf(key), 1);\n\n        return data.value;\n    }\n\n    /*\n     * Get the value with the specified (wrapped tile) key.\n     */\n    getByKey(key: string): Tile {\n        const data = this.data[key];\n        return data ? data[0].value : null;\n    }\n\n    /**\n     * Get the value attached to a specific key without removing data\n     * from the cache. If the key is not found, returns `null`\n     *\n     * @param tileID - the key to look up\n     * @returns the tile data, or null if it isn't found\n     */\n    get(tileID: OverscaledTileID): Tile {\n        if (!this.has(tileID)) { return null; }\n\n        const data = this.data[tileID.wrapped().key][0];\n        return data.value;\n    }\n\n    /**\n     * Remove a key/value combination from the cache.\n     *\n     * @param tileID - the key for the pair to delete\n     * @param value - If a value is provided, remove that exact version of the value.\n     * @returns this cache\n     */\n    remove(tileID: OverscaledTileID, value?: {\n        value: Tile;\n        timeout: ReturnType<typeof setTimeout>;\n    }) {\n        if (!this.has(tileID)) { return this; }\n        const key = tileID.wrapped().key;\n\n        const dataIndex = value === undefined ? 0 : this.data[key].indexOf(value);\n        const data = this.data[key][dataIndex];\n        this.data[key].splice(dataIndex, 1);\n        if (data.timeout) clearTimeout(data.timeout);\n        if (this.data[key].length === 0) {\n            delete this.data[key];\n        }\n        this.onRemove(data.value);\n        this.order.splice(this.order.indexOf(key), 1);\n\n        return this;\n    }\n\n    /**\n     * Change the max size of the cache.\n     *\n     * @param max - the max size of the cache\n     * @returns this cache\n     */\n    setMaxSize(max: number): TileCache {\n        this.max = max;\n\n        while (this.order.length > this.max) {\n            const removedData = this._getAndRemoveByKey(this.order[0]);\n            if (removedData) this.onRemove(removedData);\n        }\n\n        return this;\n    }\n\n    /**\n     * Remove entries that do not pass a filter function. Used for removing\n     * stale tiles from the cache.\n     *\n     * @param filterFn - Determines whether the tile is filtered. If the supplied function returns false, the tile will be filtered out.\n     */\n    filter(filterFn: (tile: Tile) => boolean) {\n        const removed = [];\n        for (const key in this.data) {\n            for (const entry of this.data[key]) {\n                if (!filterFn(entry.value)) {\n                    removed.push(entry);\n                }\n            }\n        }\n        for (const r of removed) {\n            this.remove(r.value.tileID, r);\n        }\n    }\n}\n\nexport class BoundedLRUCache<K, V> {\n    private maxEntries: number;\n    private map: Map<K, V>;\n\n    constructor(maxEntries: number) {\n        this.maxEntries = maxEntries;\n        this.map = new Map();\n    }\n\n    get(key: K): V | undefined {\n        const value = this.map.get(key);\n        if (value !== undefined) {\n            // Move key to end (most recently used)\n            this.map.delete(key);\n            this.map.set(key, value);\n        }\n        return value;\n    }\n\n    set(key: K, value: V): void {\n        if (this.map.has(key)) {\n            this.map.delete(key);\n        } else if (this.map.size >= this.maxEntries) {\n            // Delete oldest\n            const oldestKey = this.map.keys().next().value;\n            this.map.delete(oldestKey);\n        }\n        this.map.set(key, value);\n    }\n\n    clear(): void {\n        this.map.clear();\n    }\n}\n","import type {RequestParameters} from '../util/ajax';\n\nexport type PerformanceMetrics = {\n    loadTime: number;\n    fullLoadTime: number;\n    fps: number;\n    percentDroppedFrames: number;\n    totalFrames: number;\n};\n\nexport enum PerformanceMarkers {\n    create = 'create',\n    load = 'load',\n    fullLoad = 'fullLoad'\n}\n\nlet lastFrameTime = null;\nlet frameTimes = [];\n\nconst minFramerateTarget = 60;\nconst frameTimeTarget = 1000 / minFramerateTarget;\n\nconst loadTimeKey = 'loadTime';\nconst fullLoadTimeKey = 'fullLoadTime';\n\nexport const PerformanceUtils = {\n    mark(marker: PerformanceMarkers) {\n        performance.mark(marker);\n    },\n    frame(timestamp: number) {\n        const currTimestamp = timestamp;\n        if (lastFrameTime != null) {\n            const frameTime = currTimestamp - lastFrameTime;\n            frameTimes.push(frameTime);\n        }\n        lastFrameTime = currTimestamp;\n    },\n    clearMetrics() {\n        lastFrameTime = null;\n        frameTimes = [];\n        performance.clearMeasures(loadTimeKey);\n        performance.clearMeasures(fullLoadTimeKey);\n\n        for (const marker in PerformanceMarkers) {\n            performance.clearMarks(PerformanceMarkers[marker]);\n        }\n    },\n\n    getPerformanceMetrics(): PerformanceMetrics {\n        performance.measure(loadTimeKey, PerformanceMarkers.create, PerformanceMarkers.load);\n        performance.measure(fullLoadTimeKey, PerformanceMarkers.create, PerformanceMarkers.fullLoad);\n        const loadTime = performance.getEntriesByName(loadTimeKey)[0].duration;\n        const fullLoadTime = performance.getEntriesByName(fullLoadTimeKey)[0].duration;\n        const totalFrames = frameTimes.length;\n\n        const avgFrameTime = frameTimes.reduce((prev, curr) => prev + curr, 0) / totalFrames / 1000;\n        const fps = 1 / avgFrameTime;\n\n        // count frames that missed our framerate target\n        const droppedFrames = frameTimes\n            .filter((frameTime) => frameTime > frameTimeTarget)\n            .reduce((acc, curr) => {\n                return acc + (curr -  frameTimeTarget) / frameTimeTarget;\n            }, 0);\n        const percentDroppedFrames = (droppedFrames / (totalFrames + droppedFrames)) * 100;\n\n        return {\n            loadTime,\n            fullLoadTime,\n            fps,\n            percentDroppedFrames,\n            totalFrames\n        };\n    }\n};\n\n/**\n * @internal\n * Safe wrapper for the performance resource timing API in web workers with graceful degradation\n */\nexport class RequestPerformance {\n    _marks: {\n        start: string;\n        end: string;\n        measure: string;\n    };\n\n    constructor (request: RequestParameters) {\n        this._marks = {\n            start: [request.url, 'start'].join('#'),\n            end: [request.url, 'end'].join('#'),\n            measure: request.url.toString()\n        };\n\n        performance.mark(this._marks.start);\n    }\n\n    finish() {\n        performance.mark(this._marks.end);\n        let resourceTimingData = performance.getEntriesByName(this._marks.measure);\n\n        // fallback if web worker implementation of perf.getEntriesByName returns empty\n        if (resourceTimingData.length === 0) {\n            performance.measure(this._marks.measure, this._marks.start, this._marks.end);\n            resourceTimingData = performance.getEntriesByName(this._marks.measure);\n\n            // cleanup\n            performance.clearMarks(this._marks.start);\n            performance.clearMarks(this._marks.end);\n            performance.clearMeasures(this._marks.measure);\n        }\n\n        return resourceTimingData;\n    }\n}\n\nexport default performance;\n","import Point from '@mapbox/point-geometry';\nimport {type VectorTileFeatureLike, type VectorTileLayerLike, type VectorTileLike, fromVectorTileJs} from '@maplibre/vt-pbf';\nimport {clipGeometry} from '../symbol/clip_line';\nimport type {LoadVectorTileResult} from './vector_tile_worker_source';\nimport type {CanonicalTileID} from '../tile/tile_id';\n\nclass VectorTileFeatureOverzoomed implements VectorTileFeatureLike {\n    pointsArray: Point[][];\n    type: VectorTileFeatureLike['type'];\n    properties: VectorTileFeatureLike['properties'];\n    id: VectorTileFeatureLike['id'];\n    extent: VectorTileFeatureLike['extent'];\n\n    constructor(\n        type: VectorTileFeatureLike['type'],\n        geometry: Point[][],\n        properties: VectorTileFeatureLike['properties'],\n        id: VectorTileFeatureLike['id'],\n        extent: VectorTileFeatureLike['extent']\n    ) {\n        this.type = type;\n        this.properties = properties ? properties : {};\n        this.extent = extent;\n        this.pointsArray = geometry;\n        this.id = id;\n    }\n\n    loadGeometry() {\n        // Clone the geometry and ensure all points are Point instances\n        return this.pointsArray.map(ring => \n            ring.map(point => new Point(point.x, point.y))\n        );\n    }\n}\n\nclass VectorTileLayerOverzoomed implements VectorTileLayerLike {\n    private _myFeatures: VectorTileFeatureOverzoomed[];\n    name: string;\n    extent: number;\n    version: number = 2;\n    length: number;\n\n    constructor(features: VectorTileFeatureOverzoomed[], layerName: string, extent: number) {\n        this._myFeatures = features;\n        this.name = layerName;\n        this.length = features.length;\n        this.extent = extent;\n    }\n\n    feature(i: number): VectorTileFeatureLike {\n        return this._myFeatures[i];\n    }\n}\n\nexport class VectorTileOverzoomed implements VectorTileLike {\n    layers: Record<string, VectorTileLayerLike> = {};\n\n    addLayer(layer: VectorTileLayerOverzoomed) {\n        this.layers[layer.name] = layer;\n    }\n}\n\n/**\n * Encodes the virtual tile into binary vector tile form.\n * This is a convenience that allows `FeatureIndex` to operate the same way across `VectorTileSource` and `GeoJSONSource` data.\n * @param virtualVectorTile - a syntetically created vector tile, this tile should have the relevant layer and features already added to it.\n * @returns - the encoded vector tile along with the original virtual tile binary data.\n */\nexport function toVirtualVectorTile(virtualVectorTile: VectorTileLike): LoadVectorTileResult {\n    let pbf: Uint8Array = fromVectorTileJs(virtualVectorTile);\n    if (pbf.byteOffset !== 0 || pbf.byteLength !== pbf.buffer.byteLength) {\n        pbf = new Uint8Array(pbf);  // Compatibility with node Buffer (https://github.com/mapbox/pbf/issues/35)\n    }\n    return {\n        vectorTile: virtualVectorTile,\n        rawData: pbf.buffer\n    };\n}\n\n/**\n * This function slices a source tile layer into an overzoomed tile layer for a target tile ID.\n * @param sourceLayer - the source tile layer to slice\n * @param maxZoomTileID - the maximum zoom tile ID\n * @param targetTileID - the target tile ID\n * @returns - the overzoomed tile layer\n */\nexport function sliceVectorTileLayer(sourceLayer: VectorTileLayerLike, maxZoomTileID: CanonicalTileID, targetTileID: CanonicalTileID): VectorTileLayerOverzoomed {\n    const {extent} = sourceLayer;\n    const dz = targetTileID.z - maxZoomTileID.z;\n    const scale = Math.pow(2, dz);\n    \n    // Calculate the target tile's position within the source tile in target coordinate space\n    // This ensures all tiles share the same coordinate system\n    const offsetX = (targetTileID.x - maxZoomTileID.x * scale) * extent;\n    const offsetY = (targetTileID.y - maxZoomTileID.y * scale) * extent;\n\n    const featureWrappers: VectorTileFeatureOverzoomed[] = [];\n    for (let index = 0; index < sourceLayer.length; index++) {\n        const feature: VectorTileFeatureLike = sourceLayer.feature(index);\n        let geometry = feature.loadGeometry();\n        \n        // Transform all coordinates to target tile space\n        for (const ring of geometry) {\n            for (const point of ring) {\n                point.x = point.x * scale - offsetX;\n                point.y = point.y * scale - offsetY;\n            }\n        }\n        \n        const buffer = 128;\n        geometry = clipGeometry(geometry, feature.type, -buffer, -buffer, extent + buffer, extent + buffer);\n        if (geometry.length === 0) {\n            continue;\n        }\n        \n        featureWrappers.push(new VectorTileFeatureOverzoomed(\n            feature.type,\n            geometry,\n            feature.properties,\n            feature.id,\n            extent\n        ));\n    }\n    return new VectorTileLayerOverzoomed(featureWrappers, sourceLayer.name, extent);\n}","import Protobuf from 'pbf';\nimport {VectorTile} from '@mapbox/vector-tile';\nimport {type ExpiryData, getArrayBuffer} from '../util/ajax';\nimport {WorkerTile} from './worker_tile';\nimport {BoundedLRUCache} from '../tile/tile_cache';\nimport {extend} from '../util/util';\nimport {RequestPerformance} from '../util/performance';\nimport {VectorTileOverzoomed, sliceVectorTileLayer, toVirtualVectorTile} from './vector_tile_overzoomed';\nimport {MLTVectorTile} from './vector_tile_mlt';\nimport type {\n    WorkerSource,\n    WorkerTileParameters,\n    TileParameters,\n    WorkerTileResult\n} from '../source/worker_source';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\nimport type {VectorTileLayerLike, VectorTileLike} from '@maplibre/vt-pbf';\n\nexport type LoadVectorTileResult = {\n    vectorTile: VectorTileLike;\n    rawData: ArrayBufferLike;\n    resourceTiming?: Array<PerformanceResourceTiming>;\n} & ExpiryData;\n\ntype FetchingState = {\n    rawTileData: ArrayBufferLike;\n    cacheControl: ExpiryData;\n    resourceTiming: any;\n};\n\nexport type AbortVectorData = () => void;\nexport type LoadVectorData = (params: WorkerTileParameters, abortController: AbortController) => Promise<LoadVectorTileResult | null>;\n\n/**\n * The {@link WorkerSource} implementation that supports {@link VectorTileSource}.\n * This class is designed to be easily reused to support custom source types\n * for data formats that can be parsed/converted into an in-memory VectorTile\n * representation. To do so, override its `loadVectorTile` method.\n */\nexport class VectorTileWorkerSource implements WorkerSource {\n    actor: IActor;\n    layerIndex: StyleLayerIndex;\n    availableImages: Array<string>;\n    fetching: {[_: string]: FetchingState };\n    loading: {[_: string]: WorkerTile};\n    loaded: {[_: string]: WorkerTile};\n    overzoomedTileResultCache: BoundedLRUCache<string, LoadVectorTileResult>;\n\n    /**\n     * @param loadVectorData - Optional method for custom loading of a VectorTile\n     * object based on parameters passed from the main-thread Source. See\n     * {@link VectorTileWorkerSource.loadTile}. The default implementation simply\n     * loads the pbf at `params.url`.\n     */\n    constructor(actor: IActor, layerIndex: StyleLayerIndex, availableImages: Array<string>) {\n        this.actor = actor;\n        this.layerIndex = layerIndex;\n        this.availableImages = availableImages;\n        this.fetching = {};\n        this.loading = {};\n        this.loaded = {};\n        this.overzoomedTileResultCache = new BoundedLRUCache<string, LoadVectorTileResult>(1000);\n    }\n\n    /**\n     * Loads a vector tile\n     */\n    async loadVectorTile(params: WorkerTileParameters, abortController: AbortController): Promise<LoadVectorTileResult> {\n        const response = await getArrayBuffer(params.request, abortController);\n        try {\n            const vectorTile = params.encoding !== 'mlt' \n                ? new VectorTile(new Protobuf(response.data)) \n                : new MLTVectorTile(response.data);\n            return {\n                vectorTile,\n                rawData: response.data,\n                cacheControl: response.cacheControl,\n                expires: response.expires\n            };\n        } catch (ex) {\n            const bytes = new Uint8Array(response.data);\n            const isGzipped = bytes[0] === 0x1f && bytes[1] === 0x8b;\n            let errorMessage = `Unable to parse the tile at ${params.request.url}, `;\n            if (isGzipped) {\n                errorMessage += 'please make sure the data is not gzipped and that you have configured the relevant header in the server';\n            } else {\n                errorMessage += `got error: ${ex.message}`;\n            }\n            throw new Error(errorMessage);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource.loadTile}. Delegates to\n     * {@link VectorTileWorkerSource.loadVectorData} (which by default expects\n     * a `params.url` property) for fetching and producing a VectorTile object.\n     */\n    async loadTile(params: WorkerTileParameters): Promise<WorkerTileResult | null> {\n        const {uid: tileUid, overzoomParameters} = params;\n\n        if (overzoomParameters) {\n            params.request = overzoomParameters.overzoomRequest;\n        }\n\n        const perf = (params && params.request && params.request.collectResourceTiming) ?\n            new RequestPerformance(params.request) : false;\n\n        const workerTile = new WorkerTile(params);\n        this.loading[tileUid] = workerTile;\n\n        const abortController = new AbortController();\n        workerTile.abort = abortController;\n        try {\n            const response = await this.loadVectorTile(params, abortController);\n            delete this.loading[tileUid];\n            if (!response) {\n                return null;\n            }\n\n            if (overzoomParameters) {\n                const overzoomTile = this._getOverzoomTile(params, response.vectorTile);\n                response.rawData = overzoomTile.rawData;\n                response.vectorTile = overzoomTile.vectorTile;\n            }\n\n            const rawTileData = response.rawData;\n            const cacheControl = {} as ExpiryData;\n            if (response.expires) cacheControl.expires = response.expires;\n            if (response.cacheControl) cacheControl.cacheControl = response.cacheControl;\n\n            const resourceTiming = {} as {resourceTiming: any};\n            if (perf) {\n                const resourceTimingData = perf.finish();\n                // it's necessary to eval the result of getEntriesByName() here via parse/stringify\n                // late evaluation in the main thread causes TypeError: illegal invocation\n                if (resourceTimingData)\n                    resourceTiming.resourceTiming = JSON.parse(JSON.stringify(resourceTimingData));\n            }\n\n            workerTile.vectorTile = response.vectorTile;\n            const parsePromise = workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor, params.subdivisionGranularity);\n            this.loaded[tileUid] = workerTile;\n            // keep the original fetching state so that reload tile can pick it up if the original parse is cancelled by reloads' parse\n            this.fetching[tileUid] = {rawTileData, cacheControl, resourceTiming};\n\n            try {\n                const result = await parsePromise;\n                // Transferring a copy of rawTileData because the worker needs to retain its copy.\n                return extend({rawTileData: rawTileData.slice(0), encoding: params.encoding}, result, cacheControl, resourceTiming);\n            } finally {\n                delete this.fetching[tileUid];\n            }\n        } catch (err) {\n            delete this.loading[tileUid];\n            workerTile.status = 'done';\n            this.loaded[tileUid] = workerTile;\n            throw err;\n        }\n    }\n\n    /**\n     * If we are seeking a tile deeper than the source's max available canonical tile, get the overzoomed tile\n     * @param params - the worker tile parameters\n     * @param maxZoomVectorTile - the original vector tile at the source's max available canonical zoom\n     * @returns the overzoomed tile and its raw data\n     */\n    private _getOverzoomTile(params: WorkerTileParameters, maxZoomVectorTile: VectorTileLike): LoadVectorTileResult {\n        const {tileID, source, overzoomParameters} = params;\n        const {maxZoomTileID} = overzoomParameters;\n\n        const cacheKey = `${maxZoomTileID.key}_${tileID.key}`;\n        const cachedOverzoomTile = this.overzoomedTileResultCache.get(cacheKey);\n        \n        if (cachedOverzoomTile) {\n            return cachedOverzoomTile;\n        }\n\n        const overzoomedVectorTile = new VectorTileOverzoomed();\n        const layerFamilies: Record<string, StyleLayer[][]> = this.layerIndex.familiesBySource[source];\n\n        for (const sourceLayerId in layerFamilies) {\n            const sourceLayer: VectorTileLayerLike = maxZoomVectorTile.layers[sourceLayerId];\n            if (!sourceLayer) {\n                continue;\n            }\n\n            const slicedTileLayer = sliceVectorTileLayer(sourceLayer, maxZoomTileID, tileID.canonical);\n            if (slicedTileLayer.length > 0) {\n                overzoomedVectorTile.addLayer(slicedTileLayer);\n            }\n        }\n        const overzoomedVectorTileResult = toVirtualVectorTile(overzoomedVectorTile);\n        this.overzoomedTileResultCache.set(cacheKey, overzoomedVectorTileResult);\n\n        return overzoomedVectorTileResult;\n    }\n\n    /**\n     * Implements {@link WorkerSource.reloadTile}.\n     */\n    async reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const uid = params.uid;\n        if (!this.loaded || !this.loaded[uid]) {\n            throw new Error('Should not be trying to reload a tile that was never loaded or has been removed');\n        }\n        const workerTile = this.loaded[uid];\n        workerTile.showCollisionBoxes = params.showCollisionBoxes;\n        if (workerTile.status === 'parsing') {\n            const result = await workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, params.subdivisionGranularity);\n            // if we have cancelled the original parse, make sure to pass the rawTileData from the original fetch\n            let parseResult: WorkerTileResult;\n            if (this.fetching[uid]) {\n                const {rawTileData, cacheControl, resourceTiming} = this.fetching[uid];\n                delete this.fetching[uid];\n                parseResult = extend({rawTileData: rawTileData.slice(0), encoding: params.encoding}, result, cacheControl, resourceTiming);\n            } else {\n                parseResult = result;\n            }\n            return parseResult;\n\n        }\n        // if there was no vector tile data on the initial load, don't try and re-parse tile\n        if (workerTile.status === 'done' && workerTile.vectorTile) {\n            // this seems like a missing case where cache control is lost? see #3309\n            return workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor, params.subdivisionGranularity);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource.abortTile}.\n     */\n    async abortTile(params: TileParameters): Promise<void> {\n        const loading = this.loading;\n        const uid = params.uid;\n        if (loading && loading[uid] && loading[uid].abort) {\n            loading[uid].abort.abort();\n            delete loading[uid];\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource.removeTile}.\n     */\n    async removeTile(params: TileParameters): Promise<void> {\n        if (this.loaded && this.loaded[params.uid]) {\n            delete this.loaded[params.uid];\n        }\n    }\n}\n","import {DEMData} from '../data/dem_data';\nimport {RGBAImage} from '../util/image';\nimport type {Actor} from '../util/actor';\nimport type {\n    WorkerDEMTileParameters,\n    TileParameters\n} from './worker_source';\nimport {getImageData, isImageBitmap} from '../util/util';\n\nexport class RasterDEMTileWorkerSource {\n    actor: Actor;\n    loaded: {[_: string]: DEMData};\n\n    constructor() {\n        this.loaded = {};\n    }\n\n    async loadTile(params: WorkerDEMTileParameters): Promise<DEMData | null> {\n        const {uid, encoding, rawImageData, redFactor, greenFactor, blueFactor, baseShift} = params;\n        const width = rawImageData.width + 2;\n        const height = rawImageData.height + 2;\n        const imagePixels: RGBAImage | ImageData = isImageBitmap(rawImageData) ?\n            new RGBAImage({width, height}, await getImageData(rawImageData, -1, -1, width, height)) :\n            rawImageData;\n        const dem = new DEMData(uid, imagePixels, encoding, redFactor, greenFactor, blueFactor, baseShift);\n        this.loaded = this.loaded || {};\n        this.loaded[uid] = dem;\n        return dem;\n    }\n\n    removeTile(params: TileParameters) {\n        const loaded = this.loaded,\n            uid = params.uid;\n        if (loaded && loaded[uid]) {\n            delete loaded[uid];\n        }\n    }\n}\n","\nmodule.exports = rewind;\n\nfunction rewind(gj, outer) {\n    var type = gj && gj.type, i;\n\n    if (type === 'FeatureCollection') {\n        for (i = 0; i < gj.features.length; i++) rewind(gj.features[i], outer);\n\n    } else if (type === 'GeometryCollection') {\n        for (i = 0; i < gj.geometries.length; i++) rewind(gj.geometries[i], outer);\n\n    } else if (type === 'Feature') {\n        rewind(gj.geometry, outer);\n\n    } else if (type === 'Polygon') {\n        rewindRings(gj.coordinates, outer);\n\n    } else if (type === 'MultiPolygon') {\n        for (i = 0; i < gj.coordinates.length; i++) rewindRings(gj.coordinates[i], outer);\n    }\n\n    return gj;\n}\n\nfunction rewindRings(rings, outer) {\n    if (rings.length === 0) return;\n\n    rewindRing(rings[0], outer);\n    for (var i = 1; i < rings.length; i++) {\n        rewindRing(rings[i], !outer);\n    }\n}\n\nfunction rewindRing(ring, dir) {\n    var area = 0, err = 0;\n    for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n        var k = (ring[i][0] - ring[j][0]) * (ring[j][1] + ring[i][1]);\n        var m = area + k;\n        err += Math.abs(area) >= Math.abs(k) ? area - m + k : k - m + area;\n        area = m;\n    }\n    if (area + err >= 0 !== !!dir) ring.reverse();\n}\n","\nconst ARRAY_TYPES = [\n    Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array,\n    Int32Array, Uint32Array, Float32Array, Float64Array\n];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nconst VERSION = 1; // serialized format version\nconst HEADER_SIZE = 8;\n\nexport default class KDBush {\n\n    /**\n     * Creates an index from raw `ArrayBuffer` data.\n     * @param {ArrayBuffer} data\n     */\n    static from(data) {\n        if (!(data instanceof ArrayBuffer)) {\n            throw new Error('Data must be an instance of ArrayBuffer.');\n        }\n        const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n        if (magic !== 0xdb) {\n            throw new Error('Data does not appear to be in a KDBush format.');\n        }\n        const version = versionAndType >> 4;\n        if (version !== VERSION) {\n            throw new Error(`Got v${version} data when expected v${VERSION}.`);\n        }\n        const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n        if (!ArrayType) {\n            throw new Error('Unrecognized array type.');\n        }\n        const [nodeSize] = new Uint16Array(data, 2, 1);\n        const [numItems] = new Uint32Array(data, 4, 1);\n\n        return new KDBush(numItems, nodeSize, ArrayType, data);\n    }\n\n    /**\n     * Creates an index that will hold a given number of items.\n     * @param {number} numItems\n     * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n     * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n     * @param {ArrayBuffer} [data] (For internal use only)\n     */\n    constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {\n        if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n        this.numItems = +numItems;\n        this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n        this.ArrayType = ArrayType;\n        this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\n        const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n        const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n        const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n        const padCoords = (8 - idsByteSize % 8) % 8;\n\n        if (arrayTypeIndex < 0) {\n            throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n        }\n\n        if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer\n            this.data = data;\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = numItems * 2;\n            this._finished = true;\n        } else { // initialize a new index\n            this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = 0;\n            this._finished = false;\n\n            // set header\n            new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n            new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n            new Uint32Array(this.data, 4, 1)[0] = numItems;\n        }\n    }\n\n    /**\n     * Add a point to the index.\n     * @param {number} x\n     * @param {number} y\n     * @returns {number} An incremental index associated with the added item (starting from `0`).\n     */\n    add(x, y) {\n        const index = this._pos >> 1;\n        this.ids[index] = index;\n        this.coords[this._pos++] = x;\n        this.coords[this._pos++] = y;\n        return index;\n    }\n\n    /**\n     * Perform indexing of the added points.\n     */\n    finish() {\n        const numAdded = this._pos >> 1;\n        if (numAdded !== this.numItems) {\n            throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n        }\n        // kd-sort both arrays for efficient search\n        sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\n        this._finished = true;\n        return this;\n    }\n\n    /**\n     * Search the index for items within a given bounding box.\n     * @param {number} minX\n     * @param {number} minY\n     * @param {number} maxX\n     * @param {number} maxY\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    range(minX, minY, maxX, maxY) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n\n        // recursively search for items in range in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    const x = coords[2 * i];\n                    const y = coords[2 * i + 1];\n                    if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? minX <= x : minY <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? maxX >= x : maxY >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * Search the index for items within a given radius.\n     * @param {number} qx\n     * @param {number} qy\n     * @param {number} r Query radius.\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    within(qx, qy, r) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n        const r2 = r * r;\n\n        // recursively search for items within radius in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? qx - r <= x : qy - r <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? qx + r >= x : qy + r >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n    if (right - left <= nodeSize) return;\n\n    const m = (left + right) >> 1; // middle index\n\n    // sort ids and coords around the middle index so that the halves lie\n    // either left/right or top/bottom correspondingly (taking turns)\n    select(ids, coords, m, left, right, axis);\n\n    // recursively kd-sort first half and second half on the opposite axis\n    sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n    sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            const n = right - left + 1;\n            const m = k - left + 1;\n            const z = Math.log(n);\n            const s = 0.5 * Math.exp(2 * z / 3);\n            const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            select(ids, coords, k, newLeft, newRight, axis);\n        }\n\n        const t = coords[2 * k + axis];\n        let i = left;\n        let j = right;\n\n        swapItem(ids, coords, left, k);\n        if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\n        while (i < j) {\n            swapItem(ids, coords, i, j);\n            i++;\n            j--;\n            while (coords[2 * i + axis] < t) i++;\n            while (coords[2 * j + axis] > t) j--;\n        }\n\n        if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n        else {\n            j++;\n            swapItem(ids, coords, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n    swap(ids, i, j);\n    swap(coords, 2 * i, 2 * j);\n    swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType<TypedArrayConstructor>} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n    const dx = ax - bx;\n    const dy = ay - by;\n    return dx * dx + dy * dy;\n}\n","\nimport KDBush from 'kdbush';\n\nconst defaultOptions = {\n    minZoom: 0,   // min zoom to generate clusters on\n    maxZoom: 16,  // max zoom level to cluster the points on\n    minPoints: 2, // minimum points to form a cluster\n    radius: 40,   // cluster radius in pixels\n    extent: 512,  // tile extent (radius is calculated relative to it)\n    nodeSize: 64, // size of the KD-tree leaf node, affects performance\n    log: false,   // whether to log timing info\n\n    // whether to generate numeric ids for input features (in vector tiles)\n    generateId: false,\n\n    // a reduce function for calculating custom cluster properties\n    reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }\n\n    // properties to use for individual points when running the reducer\n    map: props => props // props => ({sum: props.my_value})\n};\n\nconst fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1));\n\nconst OFFSET_ZOOM = 2;\nconst OFFSET_ID = 3;\nconst OFFSET_PARENT = 4;\nconst OFFSET_NUM = 5;\nconst OFFSET_PROP = 6;\n\nexport default class Supercluster {\n    constructor(options) {\n        this.options = Object.assign(Object.create(defaultOptions), options);\n        this.trees = new Array(this.options.maxZoom + 1);\n        this.stride = this.options.reduce ? 7 : 6;\n        this.clusterProps = [];\n    }\n\n    load(points) {\n        const {log, minZoom, maxZoom} = this.options;\n\n        if (log) console.time('total time');\n\n        const timerId = `prepare ${  points.length  } points`;\n        if (log) console.time(timerId);\n\n        this.points = points;\n\n        // generate a cluster object for each point and index input points into a KD-tree\n        const data = [];\n\n        for (let i = 0; i < points.length; i++) {\n            const p = points[i];\n            if (!p.geometry) continue;\n\n            const [lng, lat] = p.geometry.coordinates;\n            const x = fround(lngX(lng));\n            const y = fround(latY(lat));\n            // store internal point/cluster data in flat numeric arrays for performance\n            data.push(\n                x, y, // projected point coordinates\n                Infinity, // the last zoom the point was processed at\n                i, // index of the source feature in the original input array\n                -1, // parent cluster id\n                1 // number of points in a cluster\n            );\n            if (this.options.reduce) data.push(0); // noop\n        }\n        let tree = this.trees[maxZoom + 1] = this._createTree(data);\n\n        if (log) console.timeEnd(timerId);\n\n        // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n        // results in a cluster hierarchy across zoom levels\n        for (let z = maxZoom; z >= minZoom; z--) {\n            const now = +Date.now();\n\n            // create a new set of clusters for the zoom and index them with a KD-tree\n            tree = this.trees[z] = this._createTree(this._cluster(tree, z));\n\n            if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now);\n        }\n\n        if (log) console.timeEnd('total time');\n\n        return this;\n    }\n\n    getClusters(bbox, zoom) {\n        let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n        const minLat = Math.max(-90, Math.min(90, bbox[1]));\n        let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n        const maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n        if (bbox[2] - bbox[0] >= 360) {\n            minLng = -180;\n            maxLng = 180;\n        } else if (minLng > maxLng) {\n            const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n            const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n            return easternHem.concat(westernHem);\n        }\n\n        const tree = this.trees[this._limitZoom(zoom)];\n        const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n        const data = tree.data;\n        const clusters = [];\n        for (const id of ids) {\n            const k = this.stride * id;\n            clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n        }\n        return clusters;\n    }\n\n    getChildren(clusterId) {\n        const originId = this._getOriginId(clusterId);\n        const originZoom = this._getOriginZoom(clusterId);\n        const errorMsg = 'No cluster with the specified id.';\n\n        const tree = this.trees[originZoom];\n        if (!tree) throw new Error(errorMsg);\n\n        const data = tree.data;\n        if (originId * this.stride >= data.length) throw new Error(errorMsg);\n\n        const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n        const x = data[originId * this.stride];\n        const y = data[originId * this.stride + 1];\n        const ids = tree.within(x, y, r);\n        const children = [];\n        for (const id of ids) {\n            const k = id * this.stride;\n            if (data[k + OFFSET_PARENT] === clusterId) {\n                children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n            }\n        }\n\n        if (children.length === 0) throw new Error(errorMsg);\n\n        return children;\n    }\n\n    getLeaves(clusterId, limit, offset) {\n        limit = limit || 10;\n        offset = offset || 0;\n\n        const leaves = [];\n        this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n        return leaves;\n    }\n\n    getTile(z, x, y) {\n        const tree = this.trees[this._limitZoom(z)];\n        const z2 = Math.pow(2, z);\n        const {extent, radius} = this.options;\n        const p = radius / extent;\n        const top = (y - p) / z2;\n        const bottom = (y + 1 + p) / z2;\n\n        const tile = {\n            features: []\n        };\n\n        this._addTileFeatures(\n            tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),\n            tree.data, x, y, z2, tile);\n\n        if (x === 0) {\n            this._addTileFeatures(\n                tree.range(1 - p / z2, top, 1, bottom),\n                tree.data, z2, y, z2, tile);\n        }\n        if (x === z2 - 1) {\n            this._addTileFeatures(\n                tree.range(0, top, p / z2, bottom),\n                tree.data, -1, y, z2, tile);\n        }\n\n        return tile.features.length ? tile : null;\n    }\n\n    getClusterExpansionZoom(clusterId) {\n        let expansionZoom = this._getOriginZoom(clusterId) - 1;\n        while (expansionZoom <= this.options.maxZoom) {\n            const children = this.getChildren(clusterId);\n            expansionZoom++;\n            if (children.length !== 1) break;\n            clusterId = children[0].properties.cluster_id;\n        }\n        return expansionZoom;\n    }\n\n    _appendLeaves(result, clusterId, limit, offset, skipped) {\n        const children = this.getChildren(clusterId);\n\n        for (const child of children) {\n            const props = child.properties;\n\n            if (props && props.cluster) {\n                if (skipped + props.point_count <= offset) {\n                    // skip the whole cluster\n                    skipped += props.point_count;\n                } else {\n                    // enter the cluster\n                    skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n                    // exit the cluster\n                }\n            } else if (skipped < offset) {\n                // skip a single point\n                skipped++;\n            } else {\n                // add a single point\n                result.push(child);\n            }\n            if (result.length === limit) break;\n        }\n\n        return skipped;\n    }\n\n    _createTree(data) {\n        const tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n        for (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n        tree.finish();\n        tree.data = data;\n        return tree;\n    }\n\n    _addTileFeatures(ids, data, x, y, z2, tile) {\n        for (const i of ids) {\n            const k = i * this.stride;\n            const isCluster = data[k + OFFSET_NUM] > 1;\n\n            let tags, px, py;\n            if (isCluster) {\n                tags = getClusterProperties(data, k, this.clusterProps);\n                px = data[k];\n                py = data[k + 1];\n            } else {\n                const p = this.points[data[k + OFFSET_ID]];\n                tags = p.properties;\n                const [lng, lat] = p.geometry.coordinates;\n                px = lngX(lng);\n                py = latY(lat);\n            }\n\n            const f = {\n                type: 1,\n                geometry: [[\n                    Math.round(this.options.extent * (px * z2 - x)),\n                    Math.round(this.options.extent * (py * z2 - y))\n                ]],\n                tags\n            };\n\n            // assign id\n            let id;\n            if (isCluster || this.options.generateId) {\n                // optionally generate id for points\n                id = data[k + OFFSET_ID];\n            } else {\n                // keep id if already assigned\n                id = this.points[data[k + OFFSET_ID]].id;\n            }\n\n            if (id !== undefined) f.id = id;\n\n            tile.features.push(f);\n        }\n    }\n\n    _limitZoom(z) {\n        return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n    }\n\n    _cluster(tree, zoom) {\n        const {radius, extent, reduce, minPoints} = this.options;\n        const r = radius / (extent * Math.pow(2, zoom));\n        const data = tree.data;\n        const nextData = [];\n        const stride = this.stride;\n\n        // loop through each point\n        for (let i = 0; i < data.length; i += stride) {\n            // if we've already visited the point at this zoom level, skip it\n            if (data[i + OFFSET_ZOOM] <= zoom) continue;\n            data[i + OFFSET_ZOOM] = zoom;\n\n            // find all nearby points\n            const x = data[i];\n            const y = data[i + 1];\n            const neighborIds = tree.within(data[i], data[i + 1], r);\n\n            const numPointsOrigin = data[i + OFFSET_NUM];\n            let numPoints = numPointsOrigin;\n\n            // count the number of points in a potential cluster\n            for (const neighborId of neighborIds) {\n                const k = neighborId * stride;\n                // filter out neighbors that are already processed\n                if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n            }\n\n            // if there were neighbors to merge, and there are enough points to form a cluster\n            if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n                let wx = x * numPointsOrigin;\n                let wy = y * numPointsOrigin;\n\n                let clusterProperties;\n                let clusterPropIndex = -1;\n\n                // encode both zoom and point index on which the cluster originated -- offset by total length of features\n                const id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n\n                for (const neighborId of neighborIds) {\n                    const k = neighborId * stride;\n\n                    if (data[k + OFFSET_ZOOM] <= zoom) continue;\n                    data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\n\n                    const numPoints2 = data[k + OFFSET_NUM];\n                    wx += data[k] * numPoints2; // accumulate coordinates for calculating weighted center\n                    wy += data[k + 1] * numPoints2;\n\n                    data[k + OFFSET_PARENT] = id;\n\n                    if (reduce) {\n                        if (!clusterProperties) {\n                            clusterProperties = this._map(data, i, true);\n                            clusterPropIndex = this.clusterProps.length;\n                            this.clusterProps.push(clusterProperties);\n                        }\n                        reduce(clusterProperties, this._map(data, k));\n                    }\n                }\n\n                data[i + OFFSET_PARENT] = id;\n                nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n                if (reduce) nextData.push(clusterPropIndex);\n\n            } else { // left points as unclustered\n                for (let j = 0; j < stride; j++) nextData.push(data[i + j]);\n\n                if (numPoints > 1) {\n                    for (const neighborId of neighborIds) {\n                        const k = neighborId * stride;\n                        if (data[k + OFFSET_ZOOM] <= zoom) continue;\n                        data[k + OFFSET_ZOOM] = zoom;\n                        for (let j = 0; j < stride; j++) nextData.push(data[k + j]);\n                    }\n                }\n            }\n        }\n\n        return nextData;\n    }\n\n    // get index of the point from which the cluster originated\n    _getOriginId(clusterId) {\n        return (clusterId - this.points.length) >> 5;\n    }\n\n    // get zoom of the point from which the cluster originated\n    _getOriginZoom(clusterId) {\n        return (clusterId - this.points.length) % 32;\n    }\n\n    _map(data, i, clone) {\n        if (data[i + OFFSET_NUM] > 1) {\n            const props = this.clusterProps[data[i + OFFSET_PROP]];\n            return clone ? Object.assign({}, props) : props;\n        }\n        const original = this.points[data[i + OFFSET_ID]].properties;\n        const result = this.options.map(original);\n        return clone && result === original ? Object.assign({}, result) : result;\n    }\n}\n\nfunction getClusterJSON(data, i, clusterProps) {\n    return {\n        type: 'Feature',\n        id: data[i + OFFSET_ID],\n        properties: getClusterProperties(data, i, clusterProps),\n        geometry: {\n            type: 'Point',\n            coordinates: [xLng(data[i]), yLat(data[i + 1])]\n        }\n    };\n}\n\nfunction getClusterProperties(data, i, clusterProps) {\n    const count = data[i + OFFSET_NUM];\n    const abbrev =\n        count >= 10000 ? `${Math.round(count / 1000)  }k` :\n        count >= 1000 ? `${Math.round(count / 100) / 10  }k` : count;\n    const propIndex = data[i + OFFSET_PROP];\n    const properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n    return Object.assign(properties, {\n        cluster: true,\n        cluster_id: data[i + OFFSET_ID],\n        point_count: count,\n        point_count_abbreviated: abbrev\n    });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n    return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n    const sin = Math.sin(lat * Math.PI / 180);\n    const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);\n    return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n    return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n    const y2 = (180 - y * 360) * Math.PI / 180;\n    return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n","/**\n * calculate simplification data using optimized Douglas-Peucker algorithm\n * @param coords - flat array of coordinates\n * @param first - index of the first coordinate in the segment\n * @param last - index of the last coordinate in the segment\n * @param sqTolerance - square tolerance value\n */\nfunction simplify(coords, first, last, sqTolerance) {\n    let maxSqDist = sqTolerance;\n    const mid = first + ((last - first) >> 1);\n    let minPosToMid = last - first;\n    let index;\n    const ax = coords[first];\n    const ay = coords[first + 1];\n    const bx = coords[last];\n    const by = coords[last + 1];\n    for (let i = first + 3; i < last; i += 3) {\n        const d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);\n        if (d > maxSqDist) {\n            index = i;\n            maxSqDist = d;\n            continue;\n        }\n        if (d === maxSqDist) {\n            // a workaround to ensure we choose a pivot close to the middle of the list,\n            // reducing recursion depth, for certain degenerate inputs\n            // https://github.com/mapbox/geojson-vt/issues/104\n            const posToMid = Math.abs(i - mid);\n            if (posToMid < minPosToMid) {\n                index = i;\n                minPosToMid = posToMid;\n            }\n        }\n    }\n    if (maxSqDist > sqTolerance) {\n        if (index - first > 3)\n            simplify(coords, first, index, sqTolerance);\n        coords[index + 2] = maxSqDist;\n        if (last - index > 3)\n            simplify(coords, index, last, sqTolerance);\n    }\n}\n/**\n * Claculates the square distance from a point to a segment\n * @param px - x coordinate of the point\n * @param py - y coordinate of the point\n * @param x - x coordinate of the first segment endpoint\n * @param y - y coordinate of the first segment endpoint\n * @param bx - x coordinate of the second segment endpoint\n * @param by - y coordinate of the second segment endpoint\n * @returns square distance from a point to a segment\n */\nfunction getSqSegDist(px, py, x, y, bx, by) {\n    let dx = bx - x;\n    let dy = by - y;\n    if (dx !== 0 || dy !== 0) {\n        const t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n        if (t > 1) {\n            x = bx;\n            y = by;\n        }\n        else if (t > 0) {\n            x += dx * t;\n            y += dy * t;\n        }\n    }\n    dx = px - x;\n    dy = py - y;\n    return dx * dx + dy * dy;\n}\n\n/**\n *\n * @param id - the feature's ID\n * @param type - the feature's type\n * @param geom - the feature's geometry\n * @param tags - the feature's properties\n * @returns the created feature\n */\nfunction createFeature(id, type, geom, tags) {\n    // This is mostly for TypeScript type narrowing\n    const data = { type, geom };\n    const feature = {\n        id: id == null ? null : id,\n        type: data.type,\n        geometry: data.geom,\n        tags,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n    switch (data.type) {\n        case 'Point':\n        case 'MultiPoint':\n        case 'LineString':\n            calcLineBBox(feature, data.geom);\n            break;\n        case 'Polygon':\n            // the outer ring (ie [0]) contains all inner rings\n            calcLineBBox(feature, data.geom[0]);\n            break;\n        case 'MultiLineString':\n            for (const line of data.geom) {\n                calcLineBBox(feature, line);\n            }\n            break;\n        case 'MultiPolygon':\n            for (const polygon of data.geom) {\n                // the outer ring (ie [0]) contains all inner rings\n                calcLineBBox(feature, polygon[0]);\n            }\n            break;\n    }\n    return feature;\n}\nfunction calcLineBBox(feature, geom) {\n    for (let i = 0; i < geom.length; i += 3) {\n        feature.minX = Math.min(feature.minX, geom[i]);\n        feature.minY = Math.min(feature.minY, geom[i + 1]);\n        feature.maxX = Math.max(feature.maxX, geom[i]);\n        feature.maxY = Math.max(feature.maxY, geom[i + 1]);\n    }\n}\n\n/**\n * converts GeoJSON feature into an intermediate projected JSON vector format with simplification data\n * @param data\n * @param options\n * @returns\n */\nfunction convert(data, options) {\n    const features = [];\n    switch (data.type) {\n        case 'FeatureCollection':\n            for (let i = 0; i < data.features.length; i++) {\n                convertFeature(features, data.features[i], options, i);\n            }\n            break;\n        case 'Feature':\n            convertFeature(features, data, options);\n            break;\n        default:\n            convertFeature(features, { geometry: data, properties: undefined }, options);\n    }\n    return features;\n}\nfunction convertFeature(features, geojson, options, index) {\n    if (!geojson.geometry)\n        return;\n    if (geojson.geometry.type === 'GeometryCollection') {\n        for (const singleGeometry of geojson.geometry.geometries) {\n            convertFeature(features, {\n                id: geojson.id,\n                geometry: singleGeometry,\n                properties: geojson.properties\n            }, options, index);\n        }\n        return;\n    }\n    const coords = geojson.geometry.coordinates;\n    if (!coords?.length)\n        return;\n    const tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);\n    let id = geojson.id;\n    if (options.promoteId) {\n        id = geojson.properties?.[options.promoteId];\n    }\n    else if (options.generateId) {\n        id = index || 0;\n    }\n    switch (geojson.geometry.type) {\n        case 'Point': {\n            const pointGeometry = [];\n            convertPoint(geojson.geometry.coordinates, pointGeometry);\n            features.push(createFeature(id, geojson.geometry.type, pointGeometry, geojson.properties));\n            return;\n        }\n        case 'MultiPoint': {\n            const multiPointGeometry = [];\n            for (const p of geojson.geometry.coordinates) {\n                convertPoint(p, multiPointGeometry);\n            }\n            features.push(createFeature(id, geojson.geometry.type, multiPointGeometry, geojson.properties));\n            return;\n        }\n        case 'LineString': {\n            const lineGeometry = [];\n            convertLine(geojson.geometry.coordinates, lineGeometry, tolerance, false);\n            features.push(createFeature(id, geojson.geometry.type, lineGeometry, geojson.properties));\n            return;\n        }\n        case 'MultiLineString': {\n            if (options.lineMetrics) {\n                // explode into linestrings in order to track metrics\n                for (const line of geojson.geometry.coordinates) {\n                    const lineGeometry = [];\n                    convertLine(line, lineGeometry, tolerance, false);\n                    features.push(createFeature(id, 'LineString', lineGeometry, geojson.properties));\n                }\n                return;\n            }\n            const multiLineGeometry = [];\n            convertLines(geojson.geometry.coordinates, multiLineGeometry, tolerance, false);\n            features.push(createFeature(id, geojson.geometry.type, multiLineGeometry, geojson.properties));\n            return;\n        }\n        case 'Polygon': {\n            const polygonGeometry = [];\n            convertLines(geojson.geometry.coordinates, polygonGeometry, tolerance, true);\n            features.push(createFeature(id, geojson.geometry.type, polygonGeometry, geojson.properties));\n            return;\n        }\n        case 'MultiPolygon': {\n            const multiPolygonGeometry = [];\n            for (const polygon of geojson.geometry.coordinates) {\n                const newPolygon = [];\n                convertLines(polygon, newPolygon, tolerance, true);\n                multiPolygonGeometry.push(newPolygon);\n            }\n            features.push(createFeature(id, geojson.geometry.type, multiPolygonGeometry, geojson.properties));\n            return;\n        }\n        default:\n            throw new Error('Input data is not a valid GeoJSON object.');\n    }\n}\nfunction convertPoint(coords, out) {\n    out.push(projectX(coords[0]), projectY(coords[1]), 0);\n}\nfunction convertLine(ring, out, tolerance, isPolygon) {\n    let x0, y0;\n    let size = 0;\n    for (let j = 0; j < ring.length; j++) {\n        const x = projectX(ring[j][0]);\n        const y = projectY(ring[j][1]);\n        out.push(x, y, 0);\n        if (j > 0) {\n            if (isPolygon) {\n                size += (x0 * y - x * y0) / 2; // area\n            }\n            else {\n                size += Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2)); // length\n            }\n        }\n        x0 = x;\n        y0 = y;\n    }\n    const last = out.length - 3;\n    out[2] = 1;\n    if (tolerance > 0)\n        simplify(out, 0, last, tolerance);\n    out[last + 2] = 1;\n    out.size = Math.abs(size);\n    out.start = 0;\n    out.end = out.size;\n}\nfunction convertLines(rings, out, tolerance, isPolygon) {\n    for (let i = 0; i < rings.length; i++) {\n        const geom = [];\n        convertLine(rings[i], geom, tolerance, isPolygon);\n        out.push(geom);\n    }\n}\nfunction projectX(x) {\n    return x / 360 + 0.5;\n}\nfunction projectY(y) {\n    const sin = Math.sin(y * Math.PI / 180);\n    const y2 = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n    return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;\n}\n\n/* clip features between two vertical or horizontal axis-parallel lines:\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *\n * k1 and k2 are the line coordinates\n * axis: 0 for x, 1 for y\n * minAll and maxAll: minimum and maximum coordinate value for all features\n */\nfunction clip(features, scale, k1, k2, axis, minAll, maxAll, options) {\n    k1 /= scale;\n    k2 /= scale;\n    if (minAll >= k1 && maxAll < k2) { // trivial accept\n        return features;\n    }\n    if (maxAll < k1 || minAll >= k2) { // trivial reject\n        return null;\n    }\n    const clipped = [];\n    for (const feature of features) {\n        const min = axis === 0 ? feature.minX : feature.minY;\n        const max = axis === 0 ? feature.maxX : feature.maxY;\n        if (min >= k1 && max < k2) { // trivial accept\n            clipped.push(feature);\n            continue;\n        }\n        if (max < k1 || min >= k2) { // trivial reject\n            continue;\n        }\n        switch (feature.type) {\n            case 'Point':\n            case 'MultiPoint': {\n                const pointGeometry = [];\n                clipPoints(feature.geometry, pointGeometry, k1, k2, axis);\n                if (!pointGeometry.length)\n                    continue;\n                const type = pointGeometry.length === 3 ? 'Point' : 'MultiPoint';\n                clipped.push(createFeature(feature.id, type, pointGeometry, feature.tags));\n                continue;\n            }\n            case 'LineString': {\n                const lineGeometry = [];\n                clipLine(feature.geometry, lineGeometry, k1, k2, axis, false, options.lineMetrics);\n                if (!lineGeometry.length)\n                    continue;\n                if (options.lineMetrics) {\n                    for (const line of lineGeometry) {\n                        clipped.push(createFeature(feature.id, feature.type, line, feature.tags));\n                    }\n                    continue;\n                }\n                if (lineGeometry.length > 1) {\n                    clipped.push(createFeature(feature.id, \"MultiLineString\", lineGeometry, feature.tags));\n                    continue;\n                }\n                clipped.push(createFeature(feature.id, feature.type, lineGeometry[0], feature.tags));\n                continue;\n            }\n            case 'MultiLineString': {\n                const multiLineGeometry = [];\n                clipLines(feature.geometry, multiLineGeometry, k1, k2, axis, false);\n                if (!multiLineGeometry.length)\n                    continue;\n                if (multiLineGeometry.length === 1) {\n                    clipped.push(createFeature(feature.id, \"LineString\", multiLineGeometry[0], feature.tags));\n                    continue;\n                }\n                clipped.push(createFeature(feature.id, feature.type, multiLineGeometry, feature.tags));\n                continue;\n            }\n            case 'Polygon': {\n                const polygonGeometry = [];\n                clipLines(feature.geometry, polygonGeometry, k1, k2, axis, true);\n                if (!polygonGeometry.length)\n                    continue;\n                clipped.push(createFeature(feature.id, feature.type, polygonGeometry, feature.tags));\n                continue;\n            }\n            case 'MultiPolygon': {\n                const multiPolygonGeometry = [];\n                for (const polygon of feature.geometry) {\n                    const newPolygon = [];\n                    clipLines(polygon, newPolygon, k1, k2, axis, true);\n                    if (newPolygon.length)\n                        multiPolygonGeometry.push(newPolygon);\n                }\n                if (!multiPolygonGeometry.length)\n                    continue;\n                clipped.push(createFeature(feature.id, feature.type, multiPolygonGeometry, feature.tags));\n                continue;\n            }\n        }\n    }\n    if (!clipped.length)\n        return null;\n    return clipped;\n}\nfunction clipPoints(geom, newGeom, k1, k2, axis) {\n    for (let i = 0; i < geom.length; i += 3) {\n        const a = geom[i + axis];\n        if (a >= k1 && a <= k2) {\n            addPoint(newGeom, geom[i], geom[i + 1], geom[i + 2]);\n        }\n    }\n}\nfunction clipLine(geom, newGeom, k1, k2, axis, isPolygon, trackMetrics) {\n    let slice = newSlice(geom);\n    const intersect = axis === 0 ? intersectX : intersectY;\n    let len = geom.start;\n    let segLen, t;\n    for (let i = 0; i < geom.length - 3; i += 3) {\n        const ax = geom[i];\n        const ay = geom[i + 1];\n        const az = geom[i + 2];\n        const bx = geom[i + 3];\n        const by = geom[i + 4];\n        const a = axis === 0 ? ax : ay;\n        const b = axis === 0 ? bx : by;\n        let exited = false;\n        if (trackMetrics)\n            segLen = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));\n        if (a < k1) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (b > k1) {\n                t = intersect(slice, ax, ay, bx, by, k1);\n                if (trackMetrics)\n                    slice.start = len + segLen * t;\n            }\n        }\n        else if (a > k2) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (b < k2) {\n                t = intersect(slice, ax, ay, bx, by, k2);\n                if (trackMetrics)\n                    slice.start = len + segLen * t;\n            }\n        }\n        else {\n            addPoint(slice, ax, ay, az);\n        }\n        if (b < k1 && a >= k1) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            t = intersect(slice, ax, ay, bx, by, k1);\n            exited = true;\n        }\n        if (b > k2 && a <= k2) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            t = intersect(slice, ax, ay, bx, by, k2);\n            exited = true;\n        }\n        if (!isPolygon && exited) {\n            if (trackMetrics)\n                slice.end = len + segLen * t;\n            newGeom.push(slice);\n            slice = newSlice(geom);\n        }\n        if (trackMetrics)\n            len += segLen;\n    }\n    // add the last point\n    let last = geom.length - 3;\n    const ax = geom[last];\n    const ay = geom[last + 1];\n    const az = geom[last + 2];\n    const a = axis === 0 ? ax : ay;\n    if (a >= k1 && a <= k2)\n        addPoint(slice, ax, ay, az);\n    // close the polygon if its endpoints are not the same after clipping\n    last = slice.length - 3;\n    if (isPolygon && last >= 3 && (slice[last] !== slice[0] || slice[last + 1] !== slice[1])) {\n        addPoint(slice, slice[0], slice[1], slice[2]);\n    }\n    // add the final slice\n    if (slice.length) {\n        newGeom.push(slice);\n    }\n}\nfunction newSlice(line) {\n    const slice = [];\n    slice.size = line.size;\n    slice.start = line.start;\n    slice.end = line.end;\n    return slice;\n}\nfunction clipLines(geom, newGeom, k1, k2, axis, isPolygon) {\n    for (const line of geom) {\n        clipLine(line, newGeom, k1, k2, axis, isPolygon, false);\n    }\n}\nfunction addPoint(out, x, y, z) {\n    out.push(x, y, z);\n}\nfunction intersectX(out, ax, ay, bx, by, x) {\n    const t = (x - ax) / (bx - ax);\n    addPoint(out, x, ay + (by - ay) * t, 1);\n    return t;\n}\nfunction intersectY(out, ax, ay, bx, by, y) {\n    const t = (y - ay) / (by - ay);\n    addPoint(out, ax + (bx - ax) * t, y, 1);\n    return t;\n}\n\nfunction wrap(features, options) {\n    const buffer = options.buffer / options.extent;\n    let merged = features;\n    const left = clip(features, 1, -1 - buffer, buffer, 0, -1, 2, options); // left world copy\n    const right = clip(features, 1, 1 - buffer, 2 + buffer, 0, -1, 2, options); // right world copy\n    if (!left && !right)\n        return merged;\n    merged = clip(features, 1, -buffer, 1 + buffer, 0, -1, 2, options) || []; // center world copy\n    if (left)\n        merged = shiftFeatureCoords(left, 1).concat(merged); // merge left into center\n    if (right)\n        merged = merged.concat(shiftFeatureCoords(right, -1)); // merge right into center\n    return merged;\n}\nfunction shiftFeatureCoords(features, offset) {\n    const newFeatures = [];\n    for (const feature of features) {\n        switch (feature.type) {\n            case 'Point':\n            case 'MultiPoint':\n            case 'LineString': {\n                const newGeometry = shiftCoords(feature.geometry, offset);\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n            case 'MultiLineString':\n            case 'Polygon': {\n                const newGeometry = [];\n                for (const line of feature.geometry) {\n                    newGeometry.push(shiftCoords(line, offset));\n                }\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n            case 'MultiPolygon': {\n                const newGeometry = [];\n                for (const polygon of feature.geometry) {\n                    const newPolygon = [];\n                    for (const line of polygon) {\n                        newPolygon.push(shiftCoords(line, offset));\n                    }\n                    newGeometry.push(newPolygon);\n                }\n                newFeatures.push(createFeature(feature.id, feature.type, newGeometry, feature.tags));\n                continue;\n            }\n        }\n    }\n    return newFeatures;\n}\nfunction shiftCoords(points, offset) {\n    const newPoints = [];\n    newPoints.size = points.size;\n    if (points.start !== undefined) {\n        newPoints.start = points.start;\n        newPoints.end = points.end;\n    }\n    for (let i = 0; i < points.length; i += 3) {\n        newPoints.push(points[i] + offset, points[i + 1], points[i + 2]);\n    }\n    return newPoints;\n}\n\n/**\n * Transforms the coordinates of each feature in the given tile from\n * mercator-projected space into (extent x extent) tile space.\n * @param tile - the tile to transform, this gets modified in place\n * @param extent - the tile extent (usually 4096)\n * @returns the transformed tile\n */\nfunction transformTile(tile, extent) {\n    if (tile.transformed) {\n        return tile;\n    }\n    const z2 = 1 << tile.z;\n    const tx = tile.x;\n    const ty = tile.y;\n    for (const feature of tile.features) {\n        if (feature.type === 1) {\n            const pointGeometry = [];\n            for (let j = 0; j < feature.geometry.length; j += 2) {\n                pointGeometry.push(transformPoint(feature.geometry[j], feature.geometry[j + 1], extent, z2, tx, ty));\n            }\n            feature.geometry = pointGeometry;\n            continue;\n        }\n        const geometry = [];\n        for (const singleGeom of feature.geometry) {\n            const ring = [];\n            for (let k = 0; k < singleGeom.length; k += 2) {\n                ring.push(transformPoint(singleGeom[k], singleGeom[k + 1], extent, z2, tx, ty));\n            }\n            geometry.push(ring);\n        }\n        feature.geometry = geometry;\n    }\n    tile.transformed = true;\n    return tile;\n}\nfunction transformPoint(x, y, extent, z2, tx, ty) {\n    return [\n        Math.round(extent * (x * z2 - tx)),\n        Math.round(extent * (y * z2 - ty))\n    ];\n}\n\n/**\n * Creates a tile object from the given features\n * @param features - the features to include in the tile\n * @param z\n * @param tx\n * @param ty\n * @param options - the options object\n * @returns the created tile\n */\nfunction createTile(features, z, tx, ty, options) {\n    const tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);\n    const tile = {\n        features: [],\n        numPoints: 0,\n        numSimplified: 0,\n        numFeatures: features.length,\n        source: null,\n        x: tx,\n        y: ty,\n        z,\n        transformed: false,\n        minX: 2,\n        minY: 1,\n        maxX: -1,\n        maxY: 0\n    };\n    for (const feature of features) {\n        addFeature(tile, feature, tolerance, options);\n    }\n    return tile;\n}\nfunction addFeature(tile, feature, tolerance, options) {\n    tile.minX = Math.min(tile.minX, feature.minX);\n    tile.minY = Math.min(tile.minY, feature.minY);\n    tile.maxX = Math.max(tile.maxX, feature.maxX);\n    tile.maxY = Math.max(tile.maxY, feature.maxY);\n    let tags = feature.tags || null;\n    let tileFeature;\n    switch (feature.type) {\n        case 'Point':\n        case 'MultiPoint': {\n            const geometry = [];\n            for (let i = 0; i < feature.geometry.length; i += 3) {\n                geometry.push(feature.geometry[i], feature.geometry[i + 1]);\n                tile.numPoints++;\n                tile.numSimplified++;\n            }\n            if (!geometry.length)\n                return;\n            tileFeature = {\n                type: 1,\n                tags: tags,\n                geometry: geometry\n            };\n            break;\n        }\n        case 'LineString': {\n            const geometry = [];\n            addLine(geometry, feature.geometry, tile, tolerance, false, false);\n            if (!geometry.length)\n                return;\n            if (options.lineMetrics) {\n                tags = {};\n                for (const key in feature.tags)\n                    tags[key] = feature.tags[key];\n                // HM TODO: replace with geojsonvt\n                tags['mapbox_clip_start'] = feature.geometry.start / feature.geometry.size;\n                tags['mapbox_clip_end'] = feature.geometry.end / feature.geometry.size;\n            }\n            tileFeature = {\n                type: 2,\n                tags: tags,\n                geometry: geometry\n            };\n            break;\n        }\n        case 'MultiLineString':\n        case 'Polygon': {\n            const geometry = [];\n            for (let i = 0; i < feature.geometry.length; i++) {\n                addLine(geometry, feature.geometry[i], tile, tolerance, feature.type === 'Polygon', i === 0);\n            }\n            if (!geometry.length)\n                return;\n            tileFeature = {\n                type: feature.type === 'Polygon' ? 3 : 2,\n                tags: tags,\n                geometry: geometry\n            };\n            break;\n        }\n        case 'MultiPolygon': {\n            const geometry = [];\n            for (let k = 0; k < feature.geometry.length; k++) {\n                const polygon = feature.geometry[k];\n                for (let i = 0; i < polygon.length; i++) {\n                    addLine(geometry, polygon[i], tile, tolerance, true, i === 0);\n                }\n            }\n            if (!geometry.length)\n                return;\n            tileFeature = {\n                type: 3,\n                tags: tags,\n                geometry: geometry\n            };\n            break;\n        }\n    }\n    if (feature.id !== null) {\n        tileFeature.id = feature.id;\n    }\n    tile.features.push(tileFeature);\n}\nfunction addLine(result, geom, tile, tolerance, isPolygon, isOuter) {\n    const sqTolerance = tolerance * tolerance;\n    if (tolerance > 0 && (geom.size < (isPolygon ? sqTolerance : tolerance))) {\n        tile.numPoints += geom.length / 3;\n        return;\n    }\n    const ring = [];\n    for (let i = 0; i < geom.length; i += 3) {\n        if (tolerance === 0 || geom[i + 2] > sqTolerance) {\n            tile.numSimplified++;\n            ring.push(geom[i], geom[i + 1]);\n        }\n        tile.numPoints++;\n    }\n    if (isPolygon)\n        rewind(ring, isOuter);\n    result.push(ring);\n}\nfunction rewind(ring, clockwise) {\n    let area = 0;\n    for (let i = 0, len = ring.length, j = len - 2; i < len; j = i, i += 2) {\n        area += (ring[i] - ring[j]) * (ring[i + 1] + ring[j + 1]);\n    }\n    if (area > 0 !== clockwise)\n        return;\n    for (let i = 0, len = ring.length; i < len / 2; i += 2) {\n        const x = ring[i];\n        const y = ring[i + 1];\n        ring[i] = ring[len - 2 - i];\n        ring[i + 1] = ring[len - 1 - i];\n        ring[len - 2 - i] = x;\n        ring[len - 1 - i] = y;\n    }\n}\n\n/**\n * Applies a GeoJSON Source Diff to an existing set of simplified features\n * @param source\n * @param dataDiff\n * @param options\n * @returns\n */\nfunction applySourceDiff(source, dataDiff, options) {\n    // convert diff to sets/maps for o(1) lookups\n    const diff = diffToHashed(dataDiff);\n    // collection for features that will be affected by this update\n    let affected = [];\n    // full removal - clear everything before applying diff\n    if (diff.removeAll) {\n        affected = source;\n        source = [];\n    }\n    // remove/add features and collect affected ones\n    if (diff.remove.size || diff.add.size) {\n        const removeFeatures = [];\n        // collect source features to be removed\n        for (const feature of source) {\n            const { id } = feature;\n            // explicit feature removal\n            if (diff.remove.has(id)) {\n                removeFeatures.push(feature);\n                // feature with duplicate id being added\n            }\n            else if (diff.add.has(id)) {\n                removeFeatures.push(feature);\n            }\n        }\n        // collect affected and remove from source\n        if (removeFeatures.length) {\n            affected.push(...removeFeatures);\n            const removeIds = new Set(removeFeatures.map(f => f.id));\n            source = source.filter(f => !removeIds.has(f.id));\n        }\n        // convert and add new features\n        if (diff.add.size) {\n            // projects and adds simplification info\n            let addFeatures = convert({ type: 'FeatureCollection', features: Array.from(diff.add.values()) }, options);\n            // wraps features (ie extreme west and extreme east)\n            addFeatures = wrap(addFeatures, options);\n            affected.push(...addFeatures);\n            source.push(...addFeatures);\n        }\n    }\n    if (diff.update.size) {\n        for (const [id, update] of diff.update) {\n            const featureIndex = source.findIndex(f => f.id === id);\n            if (featureIndex === -1)\n                continue;\n            const feature = source[featureIndex];\n            // get updated geojsonvt simplified feature\n            const updatedFeature = getUpdatedFeature(feature, update, options);\n            if (!updatedFeature)\n                continue;\n            // track both features for invalidation\n            affected.push(feature, updatedFeature);\n            // replace old feature with updated feature\n            source[featureIndex] = updatedFeature;\n        }\n    }\n    return { affected, source };\n}\n// return an updated geojsonvt simplified feature\nfunction getUpdatedFeature(vtFeature, update, options) {\n    const changeGeometry = !!update.newGeometry;\n    const changeProps = update.removeAllProperties ||\n        update.removeProperties?.length > 0 ||\n        update.addOrUpdateProperties?.length > 0;\n    // if geometry changed, need to create new geojson feature and convert to simplified format\n    if (changeGeometry) {\n        const geojsonFeature = {\n            type: 'Feature',\n            id: vtFeature.id,\n            geometry: update.newGeometry,\n            properties: changeProps ? applyPropertyUpdates(vtFeature.tags, update) : vtFeature.tags\n        };\n        // projects and adds simplification info\n        let features = convert({ type: 'FeatureCollection', features: [geojsonFeature] }, options);\n        // wraps features (ie extreme west and extreme east)\n        features = wrap(features, options);\n        return features[0];\n    }\n    // only properties changed - update tags directly\n    if (changeProps) {\n        const feature = { ...vtFeature };\n        feature.tags = applyPropertyUpdates(feature.tags, update);\n        return feature;\n    }\n    return null;\n}\n/**\n * helper to apply property updates from a diff update object to a properties object\n */\nfunction applyPropertyUpdates(tags, update) {\n    if (update.removeAllProperties) {\n        return {};\n    }\n    const properties = { ...tags || {} };\n    if (update.removeProperties) {\n        for (const key of update.removeProperties) {\n            delete properties[key];\n        }\n    }\n    if (update.addOrUpdateProperties) {\n        for (const { key, value } of update.addOrUpdateProperties) {\n            properties[key] = value;\n        }\n    }\n    return properties;\n}\n/**\n * Convert a GeoJSON Source Diff to an idempotent hashed representation using Sets and Maps\n */\nfunction diffToHashed(diff) {\n    if (!diff)\n        return {\n            remove: new Set(),\n            add: new Map(),\n            update: new Map()\n        };\n    const hashed = {\n        removeAll: diff.removeAll,\n        remove: new Set(diff.remove || []),\n        add: new Map(diff.add?.map(feature => [feature.id, feature])),\n        update: new Map(diff.update?.map(update => [update.id, update]))\n    };\n    return hashed;\n}\n\nconst defaultOptions = {\n    maxZoom: 14,\n    indexMaxZoom: 5,\n    indexMaxPoints: 100000,\n    tolerance: 3,\n    extent: 4096,\n    buffer: 64,\n    lineMetrics: false,\n    promoteId: null,\n    generateId: false,\n    updateable: false,\n    debug: 0\n};\n/**\n * Main class for creating and managing a vector tile index from GeoJSON data.\n */\nclass GeoJSONVT {\n    options;\n    /** @internal */\n    tiles;\n    tileCoords;\n    /** @internal */\n    stats = {};\n    /** @internal */\n    total = 0;\n    source;\n    constructor(data, options) {\n        options = this.options = Object.assign({}, defaultOptions, options);\n        const debug = options.debug;\n        if (debug)\n            console.time('preprocess data');\n        if (options.maxZoom < 0 || options.maxZoom > 24)\n            throw new Error('maxZoom should be in the 0-24 range');\n        if (options.promoteId && options.generateId)\n            throw new Error('promoteId and generateId cannot be used together.');\n        // projects and adds simplification info\n        let features = convert(data, options);\n        // tiles and tileCoords are part of the public API\n        this.tiles = {};\n        this.tileCoords = [];\n        if (debug) {\n            console.timeEnd('preprocess data');\n            console.log('index: maxZoom: %d, maxPoints: %d', options.indexMaxZoom, options.indexMaxPoints);\n            console.time('generate tiles');\n            this.stats = {};\n            this.total = 0;\n        }\n        // wraps features (ie extreme west and extreme east)\n        features = wrap(features, options);\n        // start slicing from the top tile down\n        if (features.length) {\n            this.splitTile(features, 0, 0, 0);\n        }\n        // for updateable indexes, store a copy of the original simplified features\n        if (options.updateable) {\n            this.source = features;\n        }\n        if (debug) {\n            if (features.length)\n                console.log('features: %d, points: %d', this.tiles[0].numFeatures, this.tiles[0].numPoints);\n            console.timeEnd('generate tiles');\n            console.log('tiles generated:', this.total, JSON.stringify(this.stats));\n        }\n    }\n    /**\n     * splits features from a parent tile to sub-tiles.\n     * z, x, and y are the coordinates of the parent tile\n     * cz, cx, and cy are the coordinates of the target tile\n     *\n     * If no target tile is specified, splitting stops when we reach the maximum\n     * zoom or the number of points is low as specified in the options.\n     * @internal\n     * @param features - features to split\n     * @param z - tile zoom level\n     * @param x - tile x coordinate\n     * @param y - tile y coordinate\n     * @param cz - target tile zoom level\n     * @param cx - target tile x coordinate\n     * @param cy - target tile y coordinate\n     */\n    splitTile(features, z, x, y, cz, cx, cy) {\n        const stack = [features, z, x, y];\n        const options = this.options;\n        const debug = options.debug;\n        // avoid recursion by using a processing queue\n        while (stack.length) {\n            y = stack.pop();\n            x = stack.pop();\n            z = stack.pop();\n            features = stack.pop();\n            const z2 = 1 << z;\n            const id = toID(z, x, y);\n            let tile = this.tiles[id];\n            if (!tile) {\n                if (debug > 1)\n                    console.time('creation');\n                tile = this.tiles[id] = createTile(features, z, x, y, options);\n                this.tileCoords.push({ z, x, y, id });\n                if (debug) {\n                    if (debug > 1) {\n                        console.log('tile z%d-%d-%d (features: %d, points: %d, simplified: %d)', z, x, y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n                        console.timeEnd('creation');\n                    }\n                    const key = `z${z}`;\n                    this.stats[key] = (this.stats[key] || 0) + 1;\n                    this.total++;\n                }\n            }\n            // save reference to original geometry in tile so that we can drill down later if we stop now\n            tile.source = features;\n            // if it's the first-pass tiling\n            if (cz == null) {\n                // stop tiling if we reached max zoom, or if the tile is too simple\n                if (z === options.indexMaxZoom || tile.numPoints <= options.indexMaxPoints)\n                    continue;\n                // if a drilldown to a specific tile\n            }\n            else if (z === options.maxZoom || z === cz) {\n                // stop tiling if we reached base zoom or our target tile zoom\n                continue;\n            }\n            else if (cz != null) {\n                // stop tiling if it's not an ancestor of the target tile\n                const zoomSteps = cz - z;\n                if (x !== cx >> zoomSteps || y !== cy >> zoomSteps)\n                    continue;\n            }\n            // if we slice further down, no need to keep source geometry\n            tile.source = null;\n            if (!features.length)\n                continue;\n            if (debug > 1)\n                console.time('clipping');\n            // values we'll use for clipping\n            const k1 = 0.5 * options.buffer / options.extent;\n            const k2 = 0.5 - k1;\n            const k3 = 0.5 + k1;\n            const k4 = 1 + k1;\n            let tl = null;\n            let bl = null;\n            let tr = null;\n            let br = null;\n            const left = clip(features, z2, x - k1, x + k3, 0, tile.minX, tile.maxX, options);\n            const right = clip(features, z2, x + k2, x + k4, 0, tile.minX, tile.maxX, options);\n            if (left) {\n                tl = clip(left, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                bl = clip(left, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n            }\n            if (right) {\n                tr = clip(right, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                br = clip(right, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n            }\n            if (debug > 1)\n                console.timeEnd('clipping');\n            stack.push(tl || [], z + 1, x * 2, y * 2);\n            stack.push(bl || [], z + 1, x * 2, y * 2 + 1);\n            stack.push(tr || [], z + 1, x * 2 + 1, y * 2);\n            stack.push(br || [], z + 1, x * 2 + 1, y * 2 + 1);\n        }\n    }\n    /**\n     * Given z, x, and y tile coordinates, returns the corresponding tile with geometries in tile coordinates, much like MVT data is stored.\n     * @param z - tile zoom level\n     * @param x - tile x coordinate\n     * @param y - tile y coordinate\n     * @returns the transformed tile or null if not found\n     */\n    getTile(z, x, y) {\n        z = +z;\n        x = +x;\n        y = +y;\n        const options = this.options;\n        const { extent, debug } = options;\n        if (z < 0 || z > 24)\n            return null;\n        const z2 = 1 << z;\n        x = (x + z2) & (z2 - 1); // wrap tile x coordinate\n        const id = toID(z, x, y);\n        if (this.tiles[id]) {\n            return transformTile(this.tiles[id], extent);\n        }\n        if (debug > 1)\n            console.log('drilling down to z%d-%d-%d', z, x, y);\n        let z0 = z;\n        let x0 = x;\n        let y0 = y;\n        let parent;\n        while (!parent && z0 > 0) {\n            z0--;\n            x0 = x0 >> 1;\n            y0 = y0 >> 1;\n            parent = this.tiles[toID(z0, x0, y0)];\n        }\n        if (!parent?.source)\n            return null;\n        // if we found a parent tile containing the original geometry, we can drill down from it\n        if (debug > 1) {\n            console.log('found parent tile z%d-%d-%d', z0, x0, y0);\n            console.time('drilling down');\n        }\n        this.splitTile(parent.source, z0, x0, y0, z, x, y);\n        if (debug > 1)\n            console.timeEnd('drilling down');\n        if (!this.tiles[id])\n            return null;\n        return transformTile(this.tiles[id], extent);\n    }\n    /**\n     * Invalidates (removes) tiles affected by the provided features\n     * @internal\n     * @param features\n     */\n    invalidateTiles(features) {\n        const options = this.options;\n        const { debug } = options;\n        // calculate bounding box of all features for trivial reject\n        let minX = Infinity;\n        let maxX = -Infinity;\n        let minY = Infinity;\n        let maxY = -Infinity;\n        for (const feature of features) {\n            minX = Math.min(minX, feature.minX);\n            maxX = Math.max(maxX, feature.maxX);\n            minY = Math.min(minY, feature.minY);\n            maxY = Math.max(maxY, feature.maxY);\n        }\n        // tile buffer clipping value - not halved as in splitTile above because checking against tile's own extent\n        const k1 = options.buffer / options.extent;\n        // track removed tile ids for o(1) lookup\n        const removedLookup = new Set();\n        // iterate through existing tiles and remove ones that are affected by features\n        for (const id in this.tiles) {\n            const tile = this.tiles[id];\n            // calculate tile bounds including buffer\n            const z2 = 1 << tile.z;\n            const tileMinX = (tile.x - k1) / z2;\n            const tileMaxX = (tile.x + 1 + k1) / z2;\n            const tileMinY = (tile.y - k1) / z2;\n            const tileMaxY = (tile.y + 1 + k1) / z2;\n            // trivial reject if feature bounds don't intersect tile\n            if (maxX < tileMinX || minX >= tileMaxX ||\n                maxY < tileMinY || minY >= tileMaxY) {\n                continue;\n            }\n            // check if any feature intersects with the tile\n            let intersects = false;\n            for (const feature of features) {\n                if (feature.maxX >= tileMinX && feature.minX < tileMaxX &&\n                    feature.maxY >= tileMinY && feature.minY < tileMaxY) {\n                    intersects = true;\n                    break;\n                }\n            }\n            if (!intersects)\n                continue;\n            if (debug) {\n                if (debug > 1) {\n                    console.log('invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)', tile.z, tile.x, tile.y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n                }\n                const key = `z${tile.z}`;\n                this.stats[key] = (this.stats[key] || 0) - 1;\n                this.total--;\n            }\n            delete this.tiles[id];\n            removedLookup.add(id);\n        }\n        // remove tile coords that are no longer in the index\n        if (removedLookup.size) {\n            this.tileCoords = this.tileCoords.filter(c => !removedLookup.has(c.id));\n        }\n    }\n    /**\n     * Updates the tile index by adding and/or removing geojson features\n     * invalidates tiles that are affected by the update for regeneration on next getTile call.\n     * @param diff - the source diff object\n     */\n    updateData(diff) {\n        const options = this.options;\n        const debug = options.debug;\n        if (!options.updateable)\n            throw new Error('to update tile geojson `updateable` option must be set to true');\n        // apply diff and collect affected features and updated source that will be used to invalidate tiles\n        const { affected, source } = applySourceDiff(this.source, diff, options);\n        // nothing has changed\n        if (!affected.length)\n            return;\n        // update source with new simplified feature set\n        this.source = source;\n        if (debug > 1) {\n            console.log('invalidating tiles');\n            console.time('invalidating');\n        }\n        this.invalidateTiles(affected);\n        if (debug > 1)\n            console.timeEnd('invalidating');\n        // re-generate root tile with updated feature set\n        const [z, x, y] = [0, 0, 0];\n        const rootTile = createTile(this.source, z, x, y, this.options);\n        rootTile.source = this.source;\n        // update tile index with new root tile - ready for getTile calls\n        const id = toID(z, x, y);\n        this.tiles[id] = rootTile;\n        this.tileCoords.push({ z, x, y, id });\n        if (debug) {\n            const key = `z${z}`;\n            this.stats[key] = (this.stats[key] || 0) + 1;\n            this.total++;\n        }\n    }\n}\nfunction toID(z, x, y) {\n    return (((1 << z) * y + x) * 32) + z;\n}\nfunction geojsonvt(data, options) {\n    return new GeoJSONVT(data, options);\n}\n\nexport { geojsonvt as default };\n//# sourceMappingURL=geojson-vt.mjs.map\n","/**\n * A way to identify a feature, either by string or by number\n */\nexport type GeoJSONFeatureId = number | string;\n\n/**\n * The geojson source diff object - processed in the following order: remove, add, update. Provides an efficient\n * way to update GeoJSON data in a map source without having to replace the entire dataset.\n */\nexport type GeoJSONSourceDiff = {\n    /**\n     * When set to `true` it will remove all features\n     */\n    removeAll?: boolean;\n    /**\n     * An array of features IDs to remove\n     */\n    remove?: Array<GeoJSONFeatureId>;\n    /**\n     * An array of features to add\n     */\n    add?: Array<GeoJSON.Feature>;\n    /**\n     * An array of update objects\n     */\n    update?: Array<GeoJSONFeatureDiff>;\n};\n\n/**\n * A geojson feature diff object - processed in the following order: new geometry, remove properties, add/update properties.\n * Provides an efficient way to update GeoJSON features in a map source without replacing the entire feature.\n */\nexport type GeoJSONFeatureDiff = {\n    /**\n     * The feature ID\n     */\n    id: GeoJSONFeatureId;\n    /**\n     * If it's a new geometry, place it here\n     */\n    newGeometry?: GeoJSON.Geometry;\n    /**\n     * Setting to `true` will remove all preperties\n     */\n    removeAllProperties?: boolean;\n    /**\n     * The properties keys to remove\n     */\n    removeProperties?: Array<string>;\n    /**\n     * The properties to add or update along side their values\n     */\n    addOrUpdateProperties?: Array<{key: string; value: any}>;\n};\n\nexport type UpdateableGeoJSON = GeoJSON.Feature | GeoJSON.FeatureCollection | undefined;\n\nfunction getFeatureId(feature: GeoJSON.Feature, promoteId?: string): GeoJSONFeatureId | undefined {\n    return promoteId ? feature.properties[promoteId] : feature.id;\n}\n\n/**\n * Converts a GeoJSON object into a map of feature IDs to GeoJSON features.\n * @param data - The GeoJSON object to convert.\n * @param promoteId - If set, the feature id will be set to the promoteId property value.\n * @returns A map of feature IDs to GeoJSON features, or `undefined` if the GeoJSON object is not a valid updateable object.\n *\n * Features must have unique identifiers to be updateable. IDs can come from:\n * - The feature's `id` property (standard GeoJSON)\n * - A promoted property specified by `promoteId` (e.g., a \"name\" property)\n */\nexport function toUpdateable(data: GeoJSON.GeoJSON | undefined, promoteId?: string): Map<GeoJSONFeatureId, GeoJSON.Feature> | undefined {\n    const updateable = new Map<GeoJSONFeatureId, GeoJSON.Feature>();\n\n    // null can be updated - empty updateable\n    if (data == null) {\n        return updateable;\n    }\n\n    // {} can be updated - empty updateable\n    if (data.type == null) {\n        return updateable;\n    }\n\n    // a single feature with an id can be updated, need to explicitly check against null because 0 is a valid feature id that is falsy\n    if (data.type === 'Feature') {\n        const id = getFeatureId(data, promoteId);\n        if (id == null) return undefined;\n\n        updateable.set(id, data);\n        return updateable;\n    }\n\n    // a feature collection can be updated if every feature has a unique id, which prevents the silent dropping of features\n    if (data.type === 'FeatureCollection') {\n        const seenIds = new Set<GeoJSONFeatureId>();\n\n        for (const feature of data.features) {\n            const id = getFeatureId(feature, promoteId);\n            if (id == null) return undefined;\n\n            if (seenIds.has(id)) return undefined;\n            seenIds.add(id);\n\n            updateable.set(id, feature);\n        }\n\n        return updateable;\n    }\n\n    return undefined;\n}\n\n/**\n * Mutates updateable and applies a {@link GeoJSONSourceDiff}. Operations are processed in a specific order to ensure predictable behavior:\n * 1. Remove operations (removeAll, remove)\n * 2. Add operations (add)\n * 3. Update operations (update)\n * @returns an array of geometries that were affected by the diff - with the exception of removeAll which does not track any affected geometries.\n */\nexport function applySourceDiff(updateable: Map<GeoJSONFeatureId, GeoJSON.Feature>, diff: GeoJSONSourceDiff, promoteId?: string): GeoJSON.Geometry[] {\n    const affectedGeometries: GeoJSON.Geometry[] = [];\n\n    if (diff.removeAll) {\n        updateable.clear();\n    }\n    else if (diff.remove) {\n        for (const id of diff.remove) {\n            const existing = updateable.get(id);\n            if (!existing) continue;\n\n            affectedGeometries.push(existing.geometry);\n            updateable.delete(id);\n        }\n    }\n\n    if (diff.add) {\n        for (const feature of diff.add) {\n            const id = getFeatureId(feature, promoteId);\n            if (id == null) continue;\n\n            const existing = updateable.get(id);\n            if (existing) affectedGeometries.push(existing.geometry);\n\n            affectedGeometries.push(feature.geometry);\n            updateable.set(id, feature);\n        }\n    }\n\n    if (diff.update) {\n        for (const update of diff.update) {\n            const existing = updateable.get(update.id);\n            if (!existing) continue;\n\n            const changeGeometry = !!update.newGeometry;\n\n            const changeProps =\n                update.removeAllProperties ||\n                update.removeProperties?.length > 0 ||\n                update.addOrUpdateProperties?.length > 0;\n\n            // nothing to do\n            if (!changeGeometry && !changeProps) continue;\n\n            // clone once since we'll mutate\n            affectedGeometries.push(existing.geometry);\n            const feature = {...existing};\n            updateable.set(update.id, feature);\n\n            if (changeGeometry) {\n                affectedGeometries.push(update.newGeometry);\n                feature.geometry = update.newGeometry;\n            }\n\n            if (changeProps) {\n                if (update.removeAllProperties) {\n                    feature.properties = {};\n                } else {\n                    feature.properties = {...feature.properties || {}};\n                }\n\n                if (update.removeProperties) {\n                    for (const key of update.removeProperties) {\n                        delete feature.properties[key];\n                    }\n                }\n\n                if (update.addOrUpdateProperties) {\n                    for (const {key, value} of update.addOrUpdateProperties) {\n                        feature.properties[key] = value;\n                    }\n                }\n            }\n        }\n    }\n\n    return affectedGeometries;\n}\n\n/**\n * Merge two GeoJSONSourceDiffs, considering the order of operations as specified above (remove, add, update).\n *\n * For `add` features that use promoteId, the feature id will be set to the promoteId value temporarily so that\n * the merge can be completed, then reverted to the original promoteId state after the merge.\n */\nexport function mergeSourceDiffs(\n    prevDiff: GeoJSONSourceDiff | undefined,\n    nextDiff: GeoJSONSourceDiff | undefined,\n    promoteId?: string\n): GeoJSONSourceDiff {\n    if (!prevDiff) return nextDiff || {};\n    if (!nextDiff) return prevDiff || {};\n\n    if (promoteId) {\n        // Temporarily normalize diff.add for features using promoteId\n        promoteFeatureIds(prevDiff.add, promoteId);\n        promoteFeatureIds(nextDiff.add, promoteId);\n    }\n\n    // Hash for o(1) lookups while creating a mutatable copy of the collections\n    const prev = diffToHashed(prevDiff);\n    const next = diffToHashed(nextDiff);\n\n    // Resolve merge conflicts\n    resolveMergeConflicts(prev, next);\n\n    // Simply merge the two diffs now that conflicts have been resolved\n    const merged: GeoJSONSourceDiffHashed = {};\n    if (prev.removeAll || next.removeAll) merged.removeAll = true;\n    merged.remove = new Set([...prev.remove , ...next.remove]);\n    merged.add    = new Map([...prev.add    , ...next.add]);\n    merged.update = new Map([...prev.update , ...next.update]);\n\n    // Squash the merge - removing then adding the same feature\n    if (merged.remove.size && merged.add.size) {\n        for (const id of merged.add.keys()) {\n            merged.remove.delete(id);\n        }\n    }\n\n    // Convert back to array-based representation\n    const mergedDiff = hashedToDiff(merged);\n\n    if (promoteId) {\n        // Revert diff.add for features using promoteId\n        demoteFeatureIds(mergedDiff.add, promoteId);\n    }\n\n    return mergedDiff;\n}\n\n/**\n * Resolve merge conflicts between two GeoJSONSourceDiffs considering the ordering above (remove/add/update).\n *\n * - If you `removeAll` and then `add` features in the same diff, the added features will be kept.\n * - Updates only apply to features that exist after removes and adds have been processed.\n */\nfunction resolveMergeConflicts(prev: GeoJSONSourceDiffHashed, next: GeoJSONSourceDiffHashed) {\n    // Removing all features with added or updated features in previous - and clear no-op removes\n    if (next.removeAll) {\n        prev.add.clear();\n        prev.update.clear();\n        prev.remove.clear();\n        next.remove.clear();\n    }\n\n    // Removing features that were added or updated in previous\n    for (const id of next.remove) {\n        prev.add.delete(id);\n        prev.update.delete(id);\n    }\n\n    // Updating features that were updated in previous\n    for (const [id, nextUpdate] of next.update) {\n        const prevUpdate = prev.update.get(id);\n        if (!prevUpdate) continue;\n\n        next.update.set(id, mergeFeatureDiffs(prevUpdate, nextUpdate));\n        prev.update.delete(id);\n    }\n}\n\n/**\n * Merge two feature diffs for the same feature id, considering the order of operations as specified above (remove, add/update).\n */\nfunction mergeFeatureDiffs(prev: GeoJSONFeatureDiff, next: GeoJSONFeatureDiff): GeoJSONFeatureDiff {\n    const merged: GeoJSONFeatureDiff = {id: prev.id};\n\n    // Removing all properties with added or updated properties in previous - and clear no-op removes\n    if (next.removeAllProperties) {\n        delete prev.removeProperties;\n        delete prev.addOrUpdateProperties;\n        delete next.removeProperties;\n    }\n    // Removing properties that were added or updated in previous\n    if (next.removeProperties) {\n        for (const key of next.removeProperties) {\n            const index = prev.addOrUpdateProperties.findIndex(prop => prop.key === key);\n            if (index > -1) prev.addOrUpdateProperties.splice(index, 1);\n        }\n    }\n\n    // Merge the two diffs\n    if (prev.removeAllProperties || next.removeAllProperties) {\n        merged.removeAllProperties = true;\n    }\n    if (prev.removeProperties || next.removeProperties) {\n        merged.removeProperties = [...prev.removeProperties || [], ...next.removeProperties || []];\n    }\n    if (prev.addOrUpdateProperties || next.addOrUpdateProperties) {\n        merged.addOrUpdateProperties = [...prev.addOrUpdateProperties || [], ...next.addOrUpdateProperties || []];\n    }\n    if (prev.newGeometry || next.newGeometry) {\n        merged.newGeometry = next.newGeometry || prev.newGeometry;\n    }\n\n    return merged;\n}\n\n/**\n * Mutates diff.add and applies a feature id using the promoteId property\n */\nfunction promoteFeatureIds(add: Array<GeoJSON.Feature>, promoteId: string) {\n    if (!add) return;\n\n    for (const feature of add) {\n        const id = getFeatureId(feature, promoteId);\n        if (id != null) feature.id = id;\n    }\n}\n\n/**\n * Mutates diff.add and removes the feature id if using the promoteId property\n */\nfunction demoteFeatureIds(add: Array<GeoJSON.Feature>, promoteId: string) {\n    if (!add) return;\n\n    for (const feature of add) {\n        const id = getFeatureId(feature, promoteId);\n        if (id != null) delete feature.id;\n    }\n}\n\n/**\n * @internal\n * Internal representation of GeoJSONSourceDiff using Sets and Maps for efficient operations\n */\ntype GeoJSONSourceDiffHashed = {\n    removeAll?: boolean;\n    remove?: Set<GeoJSONFeatureId>;\n    add?: Map<GeoJSONFeatureId, GeoJSON.Feature>;\n    update?: Map<GeoJSONFeatureId, GeoJSONFeatureDiff>;\n};\n\n/**\n * @internal\n * Convert a GeoJSONSourceDiff to an idempotent hashed representation using Sets and Maps\n */\nfunction diffToHashed(diff: GeoJSONSourceDiff | undefined): GeoJSONSourceDiffHashed {\n    if (!diff) return {};\n\n    const hashed: GeoJSONSourceDiffHashed = {};\n\n    hashed.removeAll = diff.removeAll;\n    hashed.remove = new Set(diff.remove || []);\n    hashed.add    = new Map(diff.add?.map(feature => [feature.id, feature]));\n    hashed.update = new Map(diff.update?.map(update => [update.id, update]));\n\n    return hashed;\n}\n\n/**\n * @internal\n * Convert a hashed GeoJSONSourceDiff back to the array-based representation\n */\nfunction hashedToDiff(hashed: GeoJSONSourceDiffHashed): GeoJSONSourceDiff {\n    const diff: GeoJSONSourceDiff = {};\n\n    if (hashed.removeAll) {\n        diff.removeAll = hashed.removeAll;\n    }\n    if (hashed.remove) {\n        diff.remove = Array.from(hashed.remove);\n    }\n    if (hashed.add) {\n        diff.add = Array.from(hashed.add.values());\n    }\n    if (hashed.update) {\n        diff.update = Array.from(hashed.update.values());\n    }\n\n    return diff;\n}\n","import {getJSON} from '../util/ajax';\nimport {RequestPerformance} from '../util/performance';\nimport rewind from '@mapbox/geojson-rewind';\nimport {GeoJSONWrapper} from '@maplibre/vt-pbf';\nimport {EXTENT} from '../data/extent';\nimport Supercluster, {type Options as SuperclusterOptions, type ClusterProperties} from 'supercluster';\nimport geojsonvt, {type GeoJSONVTOptions, type GeoJSONVT} from '@maplibre/geojson-vt';\nimport {VectorTileWorkerSource} from './vector_tile_worker_source';\nimport {createExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {isAbortError} from '../util/abort_error';\nimport {toVirtualVectorTile} from './vector_tile_overzoomed';\nimport {type GeoJSONSourceDiff, applySourceDiff, toUpdateable, type GeoJSONFeatureId} from './geojson_source_diff';\nimport type {WorkerTileParameters, WorkerTileResult} from './worker_source';\nimport type {LoadVectorTileResult} from './vector_tile_worker_source';\nimport type {RequestParameters} from '../util/ajax';\nimport type {ClusterIDAndSource, GeoJSONWorkerSourceLoadDataResult, RemoveSourceParams} from '../util/actor_messages';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\n\n/**\n * The geojson worker options that can be passed to the worker\n */\nexport type GeoJSONWorkerOptions = {\n    source?: string;\n    cluster?: boolean;\n    geojsonVtOptions?: GeoJSONVTOptions;\n    superclusterOptions?: SuperclusterOptions<any, any>;\n    clusterProperties?: ClusterProperties;\n    filter?: Array<unknown>;\n    promoteId?: string;\n    collectResourceTiming?: boolean;\n};\n\n/**\n * Parameters needed to load GeoJSON to the worker - must specify either a `request`, `data` or `dataDiff`.\n */\nexport type LoadGeoJSONParameters = GeoJSONWorkerOptions & {\n    type: 'geojson';\n    /**\n     * Request parameters including a URL to fetch GeoJSON data.\n     */\n    request?: RequestParameters;\n    /**\n     * GeoJSON data to set as the source's data.\n     */\n    data?: GeoJSON.GeoJSON;\n    /**\n     * GeoJSONSourceDiff to apply to the existing GeoJSON source data.\n     */\n    dataDiff?: GeoJSONSourceDiff;\n};\n\ntype GeoJSONIndex = GeoJSONVT | Supercluster;\n\n/**\n * The {@link WorkerSource} implementation that supports {@link GeoJSONSource}.\n * This class is designed to be easily reused to support custom source types\n * for data formats that can be parsed/converted into an in-memory GeoJSON\n * representation. To do so, create it with\n * `new GeoJSONWorkerSource(actor, layerIndex, customLoadGeoJSONFunction)`.\n * For a full example, see [mapbox-gl-topojson](https://github.com/developmentseed/mapbox-gl-topojson).\n */\nexport class GeoJSONWorkerSource extends VectorTileWorkerSource {\n    /**\n     * The actual GeoJSON takes some time to load (as there may be a need to parse a diff, or to apply filters, or the\n     * data may even need to be loaded via a URL). This promise resolves with a ready-to-be-consumed GeoJSON which is\n     * ready to be returned by the `getData` method.\n     */\n    _pendingData: Promise<GeoJSON.GeoJSON>;\n    _pendingRequest: AbortController;\n    _geoJSONIndex: GeoJSONIndex;\n    _dataUpdateable = new Map<GeoJSONFeatureId, GeoJSON.Feature>();\n    _createGeoJSONIndex: typeof createGeoJSONIndex;\n\n    constructor(actor: IActor, layerIndex: StyleLayerIndex, availableImages: Array<string>, createGeoJSONIndexFunc: typeof createGeoJSONIndex = createGeoJSONIndex) {\n        super(actor, layerIndex, availableImages);\n        this._createGeoJSONIndex = createGeoJSONIndexFunc;\n    }\n\n    /**\n     * Retrieves and sends loaded vector tiles to the main thread.\n     */\n    override async loadVectorTile(params: WorkerTileParameters, _abortController: AbortController): Promise<LoadVectorTileResult | null> {\n        const canonical = params.tileID.canonical;\n\n        if (!this._geoJSONIndex) {\n            throw new Error('Unable to parse the data into a cluster or geojson');\n        }\n\n        const geoJSONTile = this._geoJSONIndex.getTile(canonical.z, canonical.x, canonical.y);\n        if (!geoJSONTile) {\n            return null;\n        }\n\n        const geojsonWrapper = new GeoJSONWrapper(geoJSONTile.features, {version: 2, extent: EXTENT});\n\n        return toVirtualVectorTile(geojsonWrapper);\n    }\n\n    /**\n     * Fetches (if appropriate), parses and indexes geojson data into tiles. This\n     * preparatory method must be called before {@link GeoJSONWorkerSource.loadTile}\n     * can correctly serve up tiles. The first call to this method must contain a valid\n     * {@link params.data}, {@link params.request} or {@link params.dataDiff}. Subsequent\n     * calls may omit these parameters to reprocess the existing data (such as to update\n     * clustering options).\n     *\n     * Defers to {@link GeoJSONWorkerSource.loadAndProcessGeoJSON} for the pre-processing.\n     *\n     * When a `loadData` request comes in while a previous one is being processed,\n     * the previous one is aborted.\n     *\n     * @param params - the parameters\n     * @returns a promise that resolves when the data is loaded and parsed into a GeoJSON object\n     */\n    async loadData(params: LoadGeoJSONParameters): Promise<GeoJSONWorkerSourceLoadDataResult> {\n        this._pendingRequest?.abort();\n\n        const perf = this._startPerformance(params);\n        this._pendingRequest = new AbortController();\n        try {\n            // Load and process the GeoJSON data if it hasn't been loaded yet or if the data is changed.\n            if (!this._pendingData || params.request || params.data || params.dataDiff) {\n                this._pendingData = this.loadAndProcessGeoJSON(params, this._pendingRequest);\n            }\n\n            const data = await this._pendingData;\n            this._geoJSONIndex = this._createGeoJSONIndex(data, params);\n            this.loaded = {};\n\n            const result: GeoJSONWorkerSourceLoadDataResult = {};\n\n            // Sending a large GeoJSON payload from the worker thread to the main thread\n            // is SLOW so we only do it if absolutely nescessary.\n            // The main thread already has a copy of this data UNLESS it was loaded\n            // from a URL.\n            if (params.request) result.data = data;\n\n            this._finishPerformance(perf, params, result);\n            return result;\n        } catch (err) {\n            delete this._pendingRequest;\n            if (isAbortError(err)) return {abandoned: true};\n            throw err;\n        }\n    }\n\n    _startPerformance(params: LoadGeoJSONParameters): RequestPerformance | undefined {\n        if (!params?.request?.collectResourceTiming) return;\n        return new RequestPerformance(params.request);\n    }\n\n    _finishPerformance(perf: RequestPerformance, params: LoadGeoJSONParameters, result: GeoJSONWorkerSourceLoadDataResult): void {\n        if (!perf) return;\n        const resourceTimingData = perf.finish();\n        // it's necessary to eval the result of getEntriesByName() here via parse/stringify\n        // late evaluation in the main thread causes TypeError: illegal invocation\n        if (resourceTimingData) {\n            result.resourceTiming = {};\n            result.resourceTiming[params.source] = JSON.parse(JSON.stringify(resourceTimingData));\n        }\n    }\n\n    /**\n     * Get the source's full GeoJSON data source.\n     * @returns a promise which is resolved with the source's actual GeoJSON\n     */\n    async getData(): Promise<GeoJSON.GeoJSON> {\n        return this._pendingData;\n    }\n\n    /**\n    * Implements {@link WorkerSource.reloadTile}.\n    *\n    * If the tile is loaded, uses the implementation in VectorTileWorkerSource.\n    * Otherwise, such as after a setData() call, we load the tile fresh.\n    *\n    * @param params - the parameters\n    * @returns A promise that resolves when the tile is reloaded\n    */\n    reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const loaded = this.loaded;\n        const uid = params.uid;\n\n        if (loaded && loaded[uid]) {\n            return super.reloadTile(params);\n        } else {\n            return this.loadTile(params);\n        }\n    }\n\n    /**\n     * Fetch, parse and process GeoJSON according to the given parameters.\n     * Defers to {@link GeoJSONWorkerSource._loadGeoJSONFromString} for the fetching and parsing.\n     *\n     * @param params - the parameters\n     * @param abortController - the abort controller that allows aborting this operation\n     * @returns a promise that is resolved with the processes GeoJSON\n     */\n    async loadAndProcessGeoJSON(params: LoadGeoJSONParameters, abortController: AbortController): Promise<GeoJSON.GeoJSON> {\n        let data: GeoJSON.GeoJSON;\n\n        if (params.request) {\n            // Data is loaded from a fetchable URL\n            data = await this.loadGeoJSONFromUrl(params.request, params.promoteId, abortController);\n\n        } else if (params.data) {\n            // Data is loaded from a GeoJSON Object\n            data = this._loadGeoJSONFromObject(params.data, params.promoteId);\n\n        } else if (params.dataDiff) {\n            // Data is loaded from a GeoJSONSourceDiff\n            data = this._loadGeoJSONFromDiff(params.dataDiff, params.promoteId, params.source);\n        }\n\n        delete this._pendingRequest;\n\n        if (typeof data !== 'object') {\n            throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`);\n        }\n\n        // Generate winding-order compliant GeoJSON Polygon and MultiPolygon geometries\n        rewind(data, true);\n\n        if (params.filter) {\n            data = this._filterGeoJSON(data, params.filter);\n        }\n\n        return data;\n    }\n\n    /**\n     * Loads GeoJSON from a URL and sets the sources updateable GeoJSON object.\n     */\n    async loadGeoJSONFromUrl(request: RequestParameters, promoteId: string, abortController: AbortController): Promise<GeoJSON.GeoJSON> {\n        const response = await getJSON<GeoJSON.GeoJSON>(request, abortController);\n        this._dataUpdateable = toUpdateable(response.data, promoteId);\n        return response.data;\n    }\n\n    /**\n     * Loads GeoJSON from a string and sets the sources updateable GeoJSON object.\n     */\n    _loadGeoJSONFromObject(data: GeoJSON.GeoJSON, promoteId: string): GeoJSON.GeoJSON {\n        this._dataUpdateable = toUpdateable(data, promoteId);\n        return data;\n    }\n\n    /**\n     * Loads GeoJSON from a GeoJSONSourceDiff and applies it to the existing source updateable GeoJSON object.\n     */\n    _loadGeoJSONFromDiff(dataDiff: GeoJSONSourceDiff, promoteId: string, source: string): GeoJSON.FeatureCollection {\n        if (!this._dataUpdateable) {\n            throw new Error(`Cannot update existing geojson data in ${source}`);\n        }\n\n        // Incrementally apply the diff to existing source data\n        applySourceDiff(this._dataUpdateable, dataDiff, promoteId);\n\n        const features = Array.from(this._dataUpdateable.values());\n        return this._toFeatureCollection(features);\n    }\n\n    /**\n     * Applies a filter to a GeoJSON object.\n     */\n    _filterGeoJSON(data: GeoJSON.GeoJSON, filter: Array<unknown>): GeoJSON.FeatureCollection {\n        const compiled = createExpression(filter, {type: 'boolean', 'property-type': 'data-driven', overridable: false, transition: false} as any);\n\n        if (compiled.result === 'error') {\n            throw new Error(compiled.value.map(err => `${err.key}: ${err.message}`).join(', '));\n        }\n\n        const features = (data as any).features.filter(feature => compiled.value.evaluate({zoom: 0}, feature));\n        return this._toFeatureCollection(features);\n    }\n\n    /**\n     * Converts an array of GeoJSON features into a GeoJSON FeatureCollection.\n     */\n    _toFeatureCollection(features: Array<GeoJSON.Feature>): GeoJSON.FeatureCollection {\n        return {type: 'FeatureCollection', features};\n    }\n\n    async removeSource(_params: RemoveSourceParams): Promise<void> {\n        if (this._pendingRequest) {\n            this._pendingRequest.abort();\n        }\n    }\n\n    getClusterExpansionZoom(params: ClusterIDAndSource): number {\n        return (this._geoJSONIndex as Supercluster).getClusterExpansionZoom(params.clusterId);\n    }\n\n    getClusterChildren(params: ClusterIDAndSource): Array<GeoJSON.Feature> {\n        return (this._geoJSONIndex as Supercluster).getChildren(params.clusterId);\n    }\n\n    getClusterLeaves(params: {\n        clusterId: number;\n        limit: number;\n        offset: number;\n    }): Array<GeoJSON.Feature> {\n        return (this._geoJSONIndex as Supercluster).getLeaves(params.clusterId, params.limit, params.offset);\n    }\n}\n\nexport function createGeoJSONIndex(data: GeoJSON.GeoJSON, params: LoadGeoJSONParameters): GeoJSONIndex {\n    if (params.cluster) {\n        return new Supercluster(getSuperclusterOptions(params)).load((data as any).features);\n    }\n    return geojsonvt(data, params.geojsonVtOptions);\n}\n\nfunction getSuperclusterOptions({superclusterOptions, clusterProperties}: LoadGeoJSONParameters) {\n    if (!clusterProperties || !superclusterOptions) return superclusterOptions;\n\n    const mapExpressions = {};\n    const reduceExpressions = {};\n    const globals = {accumulated: null, zoom: 0};\n    const feature = {properties: null};\n    const propertyNames = Object.keys(clusterProperties);\n\n    for (const key of propertyNames) {\n        const [operator, mapExpression] = clusterProperties[key];\n\n        const mapExpressionParsed = createExpression(mapExpression);\n        const reduceExpressionParsed = createExpression(\n            typeof operator === 'string' ? [operator, ['accumulated'], ['get', key]] : operator);\n\n        mapExpressions[key] = mapExpressionParsed.value;\n        reduceExpressions[key] = reduceExpressionParsed.value;\n    }\n\n    superclusterOptions.map = (pointProperties) => {\n        feature.properties = pointProperties;\n        const properties = {};\n        for (const key of propertyNames) {\n            properties[key] = mapExpressions[key].evaluate(globals, feature);\n        }\n        return properties;\n    };\n    superclusterOptions.reduce = (accumulated, clusterProperties) => {\n        feature.properties = clusterProperties;\n        for (const key of propertyNames) {\n            globals.accumulated = accumulated[key];\n            accumulated[key] = reduceExpressions[key].evaluate(globals, feature);\n        }\n    };\n\n    return superclusterOptions;\n}\n","import {Actor, type ActorTarget, type IActor} from '../util/actor';\nimport {StyleLayerIndex} from '../style/style_layer_index';\nimport {VectorTileWorkerSource} from './vector_tile_worker_source';\nimport {RasterDEMTileWorkerSource} from './raster_dem_tile_worker_source';\nimport {rtlWorkerPlugin, type RTLTextPlugin} from './rtl_text_plugin_worker';\nimport {GeoJSONWorkerSource, type LoadGeoJSONParameters} from './geojson_worker_source';\nimport {isWorker} from '../util/util';\nimport {addProtocol, removeProtocol} from './protocol_crud';\nimport {type PluginState} from './rtl_text_plugin_status';\nimport type {\n    WorkerSource,\n    WorkerSourceConstructor,\n    WorkerTileParameters,\n    WorkerDEMTileParameters,\n    TileParameters\n} from '../source/worker_source';\n\nimport type {WorkerGlobalScopeInterface} from '../util/web_worker';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {\n    MessageType,\n    type ClusterIDAndSource,\n    type GetClusterLeavesParams,\n    type RemoveSourceParams,\n    type UpdateLayersParameters\n} from '../util/actor_messages';\n\n/**\n * The Worker class responsible for background thread related execution\n */\nexport default class Worker {\n    self: WorkerGlobalScopeInterface & ActorTarget;\n    actor: Actor;\n    layerIndexes: {[_: string]: StyleLayerIndex};\n    availableImages: {[_: string]: Array<string>};\n    externalWorkerSourceTypes: { [_: string]: WorkerSourceConstructor };\n    /**\n     * This holds a cache for the already created worker source instances.\n     * The cache is build with the following hierarchy:\n     * [mapId][sourceType][sourceName]: worker source instance\n     * sourceType can be 'vector' for example\n     */\n    workerSources: {\n        [_: string]: {\n            [_: string]: {\n                [_: string]: WorkerSource;\n            };\n        };\n    };\n    /**\n     * This holds a cache for the already created DEM worker source instances.\n     * The cache is build with the following hierarchy:\n     * [mapId][sourceType]: DEM worker source instance\n     * sourceType can be 'raster-dem' for example\n     */\n    demWorkerSources: {\n        [_: string]: {\n            [_: string]: RasterDEMTileWorkerSource;\n        };\n    };\n    referrer: string;\n    globalStates: Map<string, Record<string, any>>;\n\n    constructor(self: WorkerGlobalScopeInterface & ActorTarget) {\n        this.self = self;\n        this.actor = new Actor(self);\n\n        this.layerIndexes = {};\n        this.availableImages = {};\n\n        this.workerSources = {};\n        this.demWorkerSources = {};\n        this.externalWorkerSourceTypes = {};\n\n        this.globalStates = new Map<string, Record<string, any>>();\n\n        this.self.registerWorkerSource = (name: string, WorkerSource: WorkerSourceConstructor) => {\n            if (this.externalWorkerSourceTypes[name]) {\n                throw new Error(`Worker source with name \"${name}\" already registered.`);\n            }\n            this.externalWorkerSourceTypes[name] = WorkerSource;\n        };\n\n        this.self.addProtocol = addProtocol;\n        this.self.removeProtocol = removeProtocol;\n\n        // This is invoked by the RTL text plugin when the download via the `importScripts` call has finished, and the code has been parsed.\n        this.self.registerRTLTextPlugin = (rtlTextPlugin: RTLTextPlugin) => {\n\n            rtlWorkerPlugin.setMethods(rtlTextPlugin);\n        };\n\n        this.actor.registerMessageHandler(MessageType.loadDEMTile, (mapId: string, params: WorkerDEMTileParameters) => {\n            return this._getDEMWorkerSource(mapId, params.source).loadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeDEMTile, async (mapId: string, params: TileParameters) => {\n            this._getDEMWorkerSource(mapId, params.source).removeTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterExpansionZoom, async (mapId: string, params: ClusterIDAndSource) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterExpansionZoom(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterChildren, async (mapId: string, params: ClusterIDAndSource) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterChildren(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterLeaves, async (mapId: string, params: GetClusterLeavesParams) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterLeaves(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.loadData, (mapId: string, params: LoadGeoJSONParameters) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).loadData(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getData, (mapId: string, params: LoadGeoJSONParameters) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getData();\n        });\n\n        this.actor.registerMessageHandler(MessageType.loadTile, (mapId: string, params: WorkerTileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).loadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.reloadTile, (mapId: string, params: WorkerTileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).reloadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.abortTile, (mapId: string, params: TileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).abortTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeTile, (mapId: string, params: TileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).removeTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeSource, async (mapId: string, params: RemoveSourceParams) => {\n            if (!this.workerSources[mapId] ||\n                !this.workerSources[mapId][params.type] ||\n                !this.workerSources[mapId][params.type][params.source]) {\n                return;\n            }\n\n            const worker = this.workerSources[mapId][params.type][params.source];\n            delete this.workerSources[mapId][params.type][params.source];\n\n            if (worker.removeSource !== undefined) {\n                worker.removeSource(params);\n            }\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeMap, async (mapId: string) => {\n            delete this.layerIndexes[mapId];\n            delete this.availableImages[mapId];\n            delete this.workerSources[mapId];\n            delete this.demWorkerSources[mapId];\n            this.globalStates.delete(mapId);\n        });\n\n        this.actor.registerMessageHandler(MessageType.setReferrer, async (_mapId: string, params: string) => {\n            this.referrer = params;\n        });\n\n        this.actor.registerMessageHandler(MessageType.syncRTLPluginState, (mapId: string, params: PluginState) => {\n            return this._syncRTLPluginState(mapId, params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.importScript, async (_mapId: string, params: string) => {\n            this.self.importScripts(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.setImages, (mapId: string, params: string[]) => {\n            return this._setImages(mapId, params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.updateLayers, async (mapId: string, params: UpdateLayersParameters) => {\n            this._getLayerIndex(mapId).update(params.layers, params.removedIds, this._getGlobalState(mapId));\n        });\n\n        this.actor.registerMessageHandler(MessageType.updateGlobalState, async (mapId: string, params: Record<string, any>) => {\n            const globalState = this._getGlobalState(mapId);\n            for (const key in params) {\n                globalState[key] = params[key];\n            }\n        });\n\n        this.actor.registerMessageHandler(MessageType.setLayers, async (mapId: string, params: Array<LayerSpecification>) => {\n            this._getLayerIndex(mapId).replace(params, this._getGlobalState(mapId));\n        });\n    }\n\n    private _getGlobalState(mapId: string): Record<string, any> {\n        let state = this.globalStates.get(mapId);\n        if (!state) {\n            state = {};\n            this.globalStates.set(mapId, state);\n        }\n        return state;\n    }\n\n    private async _setImages(mapId: string, images: Array<string>): Promise<void> {\n        this.availableImages[mapId] = images;\n        for (const workerSource in this.workerSources[mapId]) {\n            const ws = this.workerSources[mapId][workerSource];\n            for (const source in ws) {\n                ws[source].availableImages = images;\n            }\n        }\n    }\n\n    private async _syncRTLPluginState(mapId: string, incomingState: PluginState): Promise<PluginState> {\n        const state = await rtlWorkerPlugin.syncState(incomingState, this.self.importScripts);\n        return state;\n    }\n\n    private _getAvailableImages(mapId: string) {\n        let availableImages = this.availableImages[mapId];\n\n        if (!availableImages) {\n            availableImages = [];\n        }\n\n        return availableImages;\n    }\n\n    private _getLayerIndex(mapId: string) {\n        let layerIndexes = this.layerIndexes[mapId];\n        if (!layerIndexes) {\n            layerIndexes = this.layerIndexes[mapId] = new StyleLayerIndex();\n        }\n        return layerIndexes;\n    }\n\n    /**\n     * This is basically a lazy initialization of a worker per mapId and sourceType and sourceName\n     * @param mapId - the mapId\n     * @param sourceType - the source type - 'vector' for example\n     * @param sourceName - the source name - 'osm' for example\n     * @returns a new instance or a cached one\n     */\n    private _getWorkerSource(mapId: string, sourceType: string, sourceName: string): WorkerSource {\n        if (!this.workerSources[mapId])\n            this.workerSources[mapId] = {};\n        if (!this.workerSources[mapId][sourceType])\n            this.workerSources[mapId][sourceType] = {};\n\n        if (!this.workerSources[mapId][sourceType][sourceName]) {\n            // use a wrapped actor so that we can attach a target mapId param\n            // to any messages invoked by the WorkerSource, this is very important when there are multiple maps\n            const actor: IActor = {\n                sendAsync: (message, abortController) => {\n                    message.targetMapId = mapId;\n                    return this.actor.sendAsync(message, abortController);\n                }\n            };\n            switch (sourceType) {\n                case 'vector':\n                    this.workerSources[mapId][sourceType][sourceName] = new VectorTileWorkerSource(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n                case 'geojson':\n                    this.workerSources[mapId][sourceType][sourceName] = new GeoJSONWorkerSource(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n                default:\n                    this.workerSources[mapId][sourceType][sourceName] = new (this.externalWorkerSourceTypes[sourceType])(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n            }\n        }\n\n        return this.workerSources[mapId][sourceType][sourceName];\n    }\n\n    /**\n     * This is basically a lazy initialization of a worker per mapId and source\n     * @param mapId - the mapId\n     * @param sourceType - the source type - 'raster-dem' for example\n     * @returns a new instance or a cached one\n     */\n    private _getDEMWorkerSource(mapId: string, sourceType: string) {\n        if (!this.demWorkerSources[mapId])\n            this.demWorkerSources[mapId] = {};\n\n        if (!this.demWorkerSources[mapId][sourceType]) {\n            this.demWorkerSources[mapId][sourceType] = new RasterDEMTileWorkerSource();\n        }\n\n        return this.demWorkerSources[mapId][sourceType];\n    }\n}\n\nif (isWorker(self)) {\n    self.worker = new Worker(self);\n}\n","import * as glMatrix from \"./common.js\";\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(9);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n  }\n  out[0] = 1;\n  out[4] = 1;\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a   the source 4x4 matrix\n * @returns {mat3} out\n */\nexport function fromMat4(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[4];\n  out[4] = a[5];\n  out[5] = a[6];\n  out[6] = a[8];\n  out[7] = a[9];\n  out[8] = a[10];\n  return out;\n}\n\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(9);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n  var out = new glMatrix.ARRAY_TYPE(9);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m10;\n  out[4] = m11;\n  out[5] = m12;\n  out[6] = m20;\n  out[7] = m21;\n  out[8] = m22;\n  return out;\n}\n\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m10;\n  out[4] = m11;\n  out[5] = m12;\n  out[6] = m20;\n  out[7] = m21;\n  out[8] = m22;\n  return out;\n}\n\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 1;\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache some values\n  if (out === a) {\n    var a01 = a[1],\n      a02 = a[2],\n      a12 = a[5];\n    out[1] = a[3];\n    out[2] = a[6];\n    out[3] = a01;\n    out[5] = a[7];\n    out[6] = a02;\n    out[7] = a12;\n  } else {\n    out[0] = a[0];\n    out[1] = a[3];\n    out[2] = a[6];\n    out[3] = a[1];\n    out[4] = a[4];\n    out[5] = a[7];\n    out[6] = a[2];\n    out[7] = a[5];\n    out[8] = a[8];\n  }\n  return out;\n}\n\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3 | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2];\n  var a10 = a[3],\n    a11 = a[4],\n    a12 = a[5];\n  var a20 = a[6],\n    a21 = a[7],\n    a22 = a[8];\n  var b01 = a22 * a11 - a12 * a21;\n  var b11 = -a22 * a10 + a12 * a20;\n  var b21 = a21 * a10 - a11 * a20;\n\n  // Calculate the determinant\n  var det = a00 * b01 + a01 * b11 + a02 * b21;\n  if (!det) {\n    return null;\n  }\n  det = 1.0 / det;\n  out[0] = b01 * det;\n  out[1] = (-a22 * a01 + a02 * a21) * det;\n  out[2] = (a12 * a01 - a02 * a11) * det;\n  out[3] = b11 * det;\n  out[4] = (a22 * a00 - a02 * a20) * det;\n  out[5] = (-a12 * a00 + a02 * a10) * det;\n  out[6] = b21 * det;\n  out[7] = (-a21 * a00 + a01 * a20) * det;\n  out[8] = (a11 * a00 - a01 * a10) * det;\n  return out;\n}\n\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\nexport function adjoint(out, a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2];\n  var a10 = a[3],\n    a11 = a[4],\n    a12 = a[5];\n  var a20 = a[6],\n    a21 = a[7],\n    a22 = a[8];\n  out[0] = a11 * a22 - a12 * a21;\n  out[1] = a02 * a21 - a01 * a22;\n  out[2] = a01 * a12 - a02 * a11;\n  out[3] = a12 * a20 - a10 * a22;\n  out[4] = a00 * a22 - a02 * a20;\n  out[5] = a02 * a10 - a00 * a12;\n  out[6] = a10 * a21 - a11 * a20;\n  out[7] = a01 * a20 - a00 * a21;\n  out[8] = a00 * a11 - a01 * a10;\n  return out;\n}\n\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2];\n  var a10 = a[3],\n    a11 = a[4],\n    a12 = a[5];\n  var a20 = a[6],\n    a21 = a[7],\n    a22 = a[8];\n  return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\nexport function multiply(out, a, b) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2];\n  var a10 = a[3],\n    a11 = a[4],\n    a12 = a[5];\n  var a20 = a[6],\n    a21 = a[7],\n    a22 = a[8];\n  var b00 = b[0],\n    b01 = b[1],\n    b02 = b[2];\n  var b10 = b[3],\n    b11 = b[4],\n    b12 = b[5];\n  var b20 = b[6],\n    b21 = b[7],\n    b22 = b[8];\n  out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n  out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n  out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n  out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n  out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n  out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n  out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n  out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n  out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n  return out;\n}\n\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\nexport function translate(out, a, v) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a10 = a[3],\n    a11 = a[4],\n    a12 = a[5],\n    a20 = a[6],\n    a21 = a[7],\n    a22 = a[8],\n    x = v[0],\n    y = v[1];\n  out[0] = a00;\n  out[1] = a01;\n  out[2] = a02;\n  out[3] = a10;\n  out[4] = a11;\n  out[5] = a12;\n  out[6] = x * a00 + y * a10 + a20;\n  out[7] = x * a01 + y * a11 + a21;\n  out[8] = x * a02 + y * a12 + a22;\n  return out;\n}\n\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nexport function rotate(out, a, rad) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a10 = a[3],\n    a11 = a[4],\n    a12 = a[5],\n    a20 = a[6],\n    a21 = a[7],\n    a22 = a[8],\n    s = Math.sin(rad),\n    c = Math.cos(rad);\n  out[0] = c * a00 + s * a10;\n  out[1] = c * a01 + s * a11;\n  out[2] = c * a02 + s * a12;\n  out[3] = c * a10 - s * a00;\n  out[4] = c * a11 - s * a01;\n  out[5] = c * a12 - s * a02;\n  out[6] = a20;\n  out[7] = a21;\n  out[8] = a22;\n  return out;\n}\n\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\nexport function scale(out, a, v) {\n  var x = v[0],\n    y = v[1];\n  out[0] = x * a[0];\n  out[1] = x * a[1];\n  out[2] = x * a[2];\n  out[3] = y * a[3];\n  out[4] = y * a[4];\n  out[5] = y * a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\nexport function fromTranslation(out, v) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 1;\n  out[5] = 0;\n  out[6] = v[0];\n  out[7] = v[1];\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\nexport function fromRotation(out, rad) {\n  var s = Math.sin(rad),\n    c = Math.cos(rad);\n  out[0] = c;\n  out[1] = s;\n  out[2] = 0;\n  out[3] = -s;\n  out[4] = c;\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = v[1];\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\nexport function fromMat2d(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = 0;\n  out[3] = a[2];\n  out[4] = a[3];\n  out[5] = 0;\n  out[6] = a[4];\n  out[7] = a[5];\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\nexport function fromQuat(out, q) {\n  var x = q[0],\n    y = q[1],\n    z = q[2],\n    w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var yx = y * x2;\n  var yy = y * y2;\n  var zx = z * x2;\n  var zy = z * y2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - yy - zz;\n  out[3] = yx - wz;\n  out[6] = zx + wy;\n  out[1] = yx + wz;\n  out[4] = 1 - xx - zz;\n  out[7] = zy - wx;\n  out[2] = zx - wy;\n  out[5] = zy + wx;\n  out[8] = 1 - xx - yy;\n  return out;\n}\n\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\nexport function normalFromMat4(out, a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a03 = a[3];\n  var a10 = a[4],\n    a11 = a[5],\n    a12 = a[6],\n    a13 = a[7];\n  var a20 = a[8],\n    a21 = a[9],\n    a22 = a[10],\n    a23 = a[11];\n  var a30 = a[12],\n    a31 = a[13],\n    a32 = a[14],\n    a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32;\n\n  // Calculate the determinant\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n  if (!det) {\n    return null;\n  }\n  det = 1.0 / det;\n  out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n  out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n  out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n  out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n  out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n  out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n  out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n  out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n  out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n  return out;\n}\n\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\nexport function projection(out, width, height) {\n  out[0] = 2 / width;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -2 / height;\n  out[5] = 0;\n  out[6] = -1;\n  out[7] = 1;\n  out[8] = 1;\n  return out;\n}\n\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n  return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8]);\n}\n\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  out[4] = a[4] + b[4];\n  out[5] = a[5] + b[5];\n  out[6] = a[6] + b[6];\n  out[7] = a[7] + b[7];\n  out[8] = a[8] + b[8];\n  return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  out[4] = a[4] - b[4];\n  out[5] = a[5] - b[5];\n  out[6] = a[6] - b[6];\n  out[7] = a[7] - b[7];\n  out[8] = a[8] - b[8];\n  return out;\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  out[4] = a[4] * b;\n  out[5] = a[5] * b;\n  out[6] = a[6] * b;\n  out[7] = a[7] * b;\n  out[8] = a[8] * b;\n  return out;\n}\n\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  out[4] = a[4] + b[4] * scale;\n  out[5] = a[5] + b[5] * scale;\n  out[6] = a[6] + b[6] * scale;\n  out[7] = a[7] + b[7] * scale;\n  out[8] = a[8] + b[8] * scale;\n  return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3],\n    a4 = a[4],\n    a5 = a[5],\n    a6 = a[6],\n    a7 = a[7],\n    a8 = a[8];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3],\n    b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7],\n    b8 = b[8];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n\n/**\n * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n  }\n  out[0] = 1;\n  out[5] = 1;\n  out[10] = 1;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache some values\n  if (out === a) {\n    var a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n    var a12 = a[6],\n      a13 = a[7];\n    var a23 = a[11];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a01;\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a02;\n    out[9] = a12;\n    out[11] = a[14];\n    out[12] = a03;\n    out[13] = a13;\n    out[14] = a23;\n  } else {\n    out[0] = a[0];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a[1];\n    out[5] = a[5];\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a[2];\n    out[9] = a[6];\n    out[10] = a[10];\n    out[11] = a[14];\n    out[12] = a[3];\n    out[13] = a[7];\n    out[14] = a[11];\n    out[15] = a[15];\n  }\n  return out;\n}\n\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4 | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a03 = a[3];\n  var a10 = a[4],\n    a11 = a[5],\n    a12 = a[6],\n    a13 = a[7];\n  var a20 = a[8],\n    a21 = a[9],\n    a22 = a[10],\n    a23 = a[11];\n  var a30 = a[12],\n    a31 = a[13],\n    a32 = a[14],\n    a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32;\n\n  // Calculate the determinant\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n  if (!det) {\n    return null;\n  }\n  det = 1.0 / det;\n  out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n  out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n  out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n  out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n  out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n  out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n  out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n  out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n  out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n  out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n  out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n  out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n  out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n  out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n  out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n  out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n  return out;\n}\n\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\nexport function adjoint(out, a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a03 = a[3];\n  var a10 = a[4],\n    a11 = a[5],\n    a12 = a[6],\n    a13 = a[7];\n  var a20 = a[8],\n    a21 = a[9],\n    a22 = a[10],\n    a23 = a[11];\n  var a30 = a[12],\n    a31 = a[13],\n    a32 = a[14],\n    a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32;\n  out[0] = a11 * b11 - a12 * b10 + a13 * b09;\n  out[1] = a02 * b10 - a01 * b11 - a03 * b09;\n  out[2] = a31 * b05 - a32 * b04 + a33 * b03;\n  out[3] = a22 * b04 - a21 * b05 - a23 * b03;\n  out[4] = a12 * b08 - a10 * b11 - a13 * b07;\n  out[5] = a00 * b11 - a02 * b08 + a03 * b07;\n  out[6] = a32 * b02 - a30 * b05 - a33 * b01;\n  out[7] = a20 * b05 - a22 * b02 + a23 * b01;\n  out[8] = a10 * b10 - a11 * b08 + a13 * b06;\n  out[9] = a01 * b08 - a00 * b10 - a03 * b06;\n  out[10] = a30 * b04 - a31 * b02 + a33 * b00;\n  out[11] = a21 * b02 - a20 * b04 - a23 * b00;\n  out[12] = a11 * b07 - a10 * b09 - a12 * b06;\n  out[13] = a00 * b09 - a01 * b07 + a02 * b06;\n  out[14] = a31 * b01 - a30 * b03 - a32 * b00;\n  out[15] = a20 * b03 - a21 * b01 + a22 * b00;\n  return out;\n}\n\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a03 = a[3];\n  var a10 = a[4],\n    a11 = a[5],\n    a12 = a[6],\n    a13 = a[7];\n  var a20 = a[8],\n    a21 = a[9],\n    a22 = a[10],\n    a23 = a[11];\n  var a30 = a[12],\n    a31 = a[13],\n    a32 = a[14],\n    a33 = a[15];\n  var b0 = a00 * a11 - a01 * a10;\n  var b1 = a00 * a12 - a02 * a10;\n  var b2 = a01 * a12 - a02 * a11;\n  var b3 = a20 * a31 - a21 * a30;\n  var b4 = a20 * a32 - a22 * a30;\n  var b5 = a21 * a32 - a22 * a31;\n  var b6 = a00 * b5 - a01 * b4 + a02 * b3;\n  var b7 = a10 * b5 - a11 * b4 + a12 * b3;\n  var b8 = a20 * b2 - a21 * b1 + a22 * b0;\n  var b9 = a30 * b2 - a31 * b1 + a32 * b0;\n\n  // Calculate the determinant\n  return a13 * b6 - a03 * b7 + a33 * b8 - a23 * b9;\n}\n\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function multiply(out, a, b) {\n  var a00 = a[0],\n    a01 = a[1],\n    a02 = a[2],\n    a03 = a[3];\n  var a10 = a[4],\n    a11 = a[5],\n    a12 = a[6],\n    a13 = a[7];\n  var a20 = a[8],\n    a21 = a[9],\n    a22 = a[10],\n    a23 = a[11];\n  var a30 = a[12],\n    a31 = a[13],\n    a32 = a[14],\n    a33 = a[15];\n\n  // Cache only the current line of the second matrix\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3];\n  out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[4];\n  b1 = b[5];\n  b2 = b[6];\n  b3 = b[7];\n  out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[8];\n  b1 = b[9];\n  b2 = b[10];\n  b3 = b[11];\n  out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[12];\n  b1 = b[13];\n  b2 = b[14];\n  b3 = b[15];\n  out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  return out;\n}\n\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\nexport function translate(out, a, v) {\n  var x = v[0],\n    y = v[1],\n    z = v[2];\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n  if (a === out) {\n    out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n    out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n    out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n    out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n  } else {\n    a00 = a[0];\n    a01 = a[1];\n    a02 = a[2];\n    a03 = a[3];\n    a10 = a[4];\n    a11 = a[5];\n    a12 = a[6];\n    a13 = a[7];\n    a20 = a[8];\n    a21 = a[9];\n    a22 = a[10];\n    a23 = a[11];\n    out[0] = a00;\n    out[1] = a01;\n    out[2] = a02;\n    out[3] = a03;\n    out[4] = a10;\n    out[5] = a11;\n    out[6] = a12;\n    out[7] = a13;\n    out[8] = a20;\n    out[9] = a21;\n    out[10] = a22;\n    out[11] = a23;\n    out[12] = a00 * x + a10 * y + a20 * z + a[12];\n    out[13] = a01 * x + a11 * y + a21 * z + a[13];\n    out[14] = a02 * x + a12 * y + a22 * z + a[14];\n    out[15] = a03 * x + a13 * y + a23 * z + a[15];\n  }\n  return out;\n}\n\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\nexport function scale(out, a, v) {\n  var x = v[0],\n    y = v[1],\n    z = v[2];\n  out[0] = a[0] * x;\n  out[1] = a[1] * x;\n  out[2] = a[2] * x;\n  out[3] = a[3] * x;\n  out[4] = a[4] * y;\n  out[5] = a[5] * y;\n  out[6] = a[6] * y;\n  out[7] = a[7] * y;\n  out[8] = a[8] * z;\n  out[9] = a[9] * z;\n  out[10] = a[10] * z;\n  out[11] = a[11] * z;\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function rotate(out, a, rad, axis) {\n  var x = axis[0],\n    y = axis[1],\n    z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * z);\n  var s, c, t;\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n  var b00, b01, b02;\n  var b10, b11, b12;\n  var b20, b21, b22;\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c;\n  a00 = a[0];\n  a01 = a[1];\n  a02 = a[2];\n  a03 = a[3];\n  a10 = a[4];\n  a11 = a[5];\n  a12 = a[6];\n  a13 = a[7];\n  a20 = a[8];\n  a21 = a[9];\n  a22 = a[10];\n  a23 = a[11];\n\n  // Construct the elements of the rotation matrix\n  b00 = x * x * t + c;\n  b01 = y * x * t + z * s;\n  b02 = z * x * t - y * s;\n  b10 = x * y * t - z * s;\n  b11 = y * y * t + c;\n  b12 = z * y * t + x * s;\n  b20 = x * z * t + y * s;\n  b21 = y * z * t - x * s;\n  b22 = z * z * t + c;\n\n  // Perform rotation-specific matrix multiplication\n  out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n  out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n  out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n  out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n  out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n  out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n  out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n  out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n  out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n  out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n  out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n  out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n  return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateX(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n\n  // Perform axis-specific matrix multiplication\n  out[4] = a10 * c + a20 * s;\n  out[5] = a11 * c + a21 * s;\n  out[6] = a12 * c + a22 * s;\n  out[7] = a13 * c + a23 * s;\n  out[8] = a20 * c - a10 * s;\n  out[9] = a21 * c - a11 * s;\n  out[10] = a22 * c - a12 * s;\n  out[11] = a23 * c - a13 * s;\n  return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateY(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n\n  // Perform axis-specific matrix multiplication\n  out[0] = a00 * c - a20 * s;\n  out[1] = a01 * c - a21 * s;\n  out[2] = a02 * c - a22 * s;\n  out[3] = a03 * c - a23 * s;\n  out[8] = a00 * s + a20 * c;\n  out[9] = a01 * s + a21 * c;\n  out[10] = a02 * s + a22 * c;\n  out[11] = a03 * s + a23 * c;\n  return out;\n}\n\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function rotateZ(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[8] = a[8];\n    out[9] = a[9];\n    out[10] = a[10];\n    out[11] = a[11];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n\n  // Perform axis-specific matrix multiplication\n  out[0] = a00 * c + a10 * s;\n  out[1] = a01 * c + a11 * s;\n  out[2] = a02 * c + a12 * s;\n  out[3] = a03 * c + a13 * s;\n  out[4] = a10 * c - a00 * s;\n  out[5] = a11 * c - a01 * s;\n  out[6] = a12 * c - a02 * s;\n  out[7] = a13 * c - a03 * s;\n  return out;\n}\n\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromTranslation(out, v) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = v[1];\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = v[2];\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\nexport function fromRotation(out, rad, axis) {\n  var x = axis[0],\n    y = axis[1],\n    z = axis[2];\n  var len = Math.sqrt(x * x + y * y + z * z);\n  var s, c, t;\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c;\n\n  // Perform rotation-specific matrix multiplication\n  out[0] = x * x * t + c;\n  out[1] = y * x * t + z * s;\n  out[2] = z * x * t - y * s;\n  out[3] = 0;\n  out[4] = x * y * t - z * s;\n  out[5] = y * y * t + c;\n  out[6] = z * y * t + x * s;\n  out[7] = 0;\n  out[8] = x * z * t + y * s;\n  out[9] = y * z * t - x * s;\n  out[10] = z * z * t + c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromXRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = c;\n  out[6] = s;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = -s;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromYRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\n  out[0] = c;\n  out[1] = 0;\n  out[2] = -s;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = s;\n  out[9] = 0;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\nexport function fromZRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n\n  // Perform axis-specific matrix multiplication\n  out[0] = c;\n  out[1] = s;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -s;\n  out[5] = c;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, dest, vec);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslation(out, q, v) {\n  // Quaternion math\n  var x = q[0],\n    y = q[1],\n    z = q[2],\n    w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - (yy + zz);\n  out[1] = xy + wz;\n  out[2] = xz - wy;\n  out[3] = 0;\n  out[4] = xy - wz;\n  out[5] = 1 - (xx + zz);\n  out[6] = yz + wx;\n  out[7] = 0;\n  out[8] = xz + wy;\n  out[9] = yz - wx;\n  out[10] = 1 - (xx + yy);\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\nexport function fromQuat2(out, a) {\n  var translation = new glMatrix.ARRAY_TYPE(3);\n  var bx = -a[0],\n    by = -a[1],\n    bz = -a[2],\n    bw = a[3],\n    ax = a[4],\n    ay = a[5],\n    az = a[6],\n    aw = a[7];\n  var magnitude = bx * bx + by * by + bz * bz + bw * bw;\n  //Only scale if it makes sense\n  if (magnitude > 0) {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n  } else {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n  }\n  fromRotationTranslation(out, a, translation);\n  return out;\n}\n\n/**\n * Returns the translation vector component of a transformation\n *  matrix. If a matrix is built with fromRotationTranslation,\n *  the returned vector will be the same as the translation vector\n *  originally supplied.\n * @param  {vec3} out Vector to receive translation component\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getTranslation(out, mat) {\n  out[0] = mat[12];\n  out[1] = mat[13];\n  out[2] = mat[14];\n  return out;\n}\n\n/**\n * Returns the scaling factor component of a transformation\n *  matrix. If a matrix is built with fromRotationTranslationScale\n *  with a normalized Quaternion parameter, the returned vector will be\n *  the same as the scaling vector\n *  originally supplied.\n * @param  {vec3} out Vector to receive scaling factor component\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\nexport function getScaling(out, mat) {\n  var m11 = mat[0];\n  var m12 = mat[1];\n  var m13 = mat[2];\n  var m21 = mat[4];\n  var m22 = mat[5];\n  var m23 = mat[6];\n  var m31 = mat[8];\n  var m32 = mat[9];\n  var m33 = mat[10];\n  out[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n  out[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n  out[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n  return out;\n}\n\n/**\n * Returns a quaternion representing the rotational component\n *  of a transformation matrix. If a matrix is built with\n *  fromRotationTranslation, the returned quaternion will be the\n *  same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\nexport function getRotation(out, mat) {\n  var scaling = new glMatrix.ARRAY_TYPE(3);\n  getScaling(scaling, mat);\n  var is1 = 1 / scaling[0];\n  var is2 = 1 / scaling[1];\n  var is3 = 1 / scaling[2];\n  var sm11 = mat[0] * is1;\n  var sm12 = mat[1] * is2;\n  var sm13 = mat[2] * is3;\n  var sm21 = mat[4] * is1;\n  var sm22 = mat[5] * is2;\n  var sm23 = mat[6] * is3;\n  var sm31 = mat[8] * is1;\n  var sm32 = mat[9] * is2;\n  var sm33 = mat[10] * is3;\n  var trace = sm11 + sm22 + sm33;\n  var S = 0;\n  if (trace > 0) {\n    S = Math.sqrt(trace + 1.0) * 2;\n    out[3] = 0.25 * S;\n    out[0] = (sm23 - sm32) / S;\n    out[1] = (sm31 - sm13) / S;\n    out[2] = (sm12 - sm21) / S;\n  } else if (sm11 > sm22 && sm11 > sm33) {\n    S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n    out[3] = (sm23 - sm32) / S;\n    out[0] = 0.25 * S;\n    out[1] = (sm12 + sm21) / S;\n    out[2] = (sm31 + sm13) / S;\n  } else if (sm22 > sm33) {\n    S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n    out[3] = (sm31 - sm13) / S;\n    out[0] = (sm12 + sm21) / S;\n    out[1] = 0.25 * S;\n    out[2] = (sm23 + sm32) / S;\n  } else {\n    S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n    out[3] = (sm12 - sm21) / S;\n    out[0] = (sm31 + sm13) / S;\n    out[1] = (sm23 + sm32) / S;\n    out[2] = 0.25 * S;\n  }\n  return out;\n}\n\n/**\n * Decomposes a transformation matrix into its rotation, translation\n * and scale components. Returns only the rotation component\n * @param  {quat} out_r Quaternion to receive the rotation component\n * @param  {vec3} out_t Vector to receive the translation vector\n * @param  {vec3} out_s Vector to receive the scaling factor\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @returns {quat} out_r\n */\nexport function decompose(out_r, out_t, out_s, mat) {\n  out_t[0] = mat[12];\n  out_t[1] = mat[13];\n  out_t[2] = mat[14];\n  var m11 = mat[0];\n  var m12 = mat[1];\n  var m13 = mat[2];\n  var m21 = mat[4];\n  var m22 = mat[5];\n  var m23 = mat[6];\n  var m31 = mat[8];\n  var m32 = mat[9];\n  var m33 = mat[10];\n  out_s[0] = Math.sqrt(m11 * m11 + m12 * m12 + m13 * m13);\n  out_s[1] = Math.sqrt(m21 * m21 + m22 * m22 + m23 * m23);\n  out_s[2] = Math.sqrt(m31 * m31 + m32 * m32 + m33 * m33);\n  var is1 = 1 / out_s[0];\n  var is2 = 1 / out_s[1];\n  var is3 = 1 / out_s[2];\n  var sm11 = m11 * is1;\n  var sm12 = m12 * is2;\n  var sm13 = m13 * is3;\n  var sm21 = m21 * is1;\n  var sm22 = m22 * is2;\n  var sm23 = m23 * is3;\n  var sm31 = m31 * is1;\n  var sm32 = m32 * is2;\n  var sm33 = m33 * is3;\n  var trace = sm11 + sm22 + sm33;\n  var S = 0;\n  if (trace > 0) {\n    S = Math.sqrt(trace + 1.0) * 2;\n    out_r[3] = 0.25 * S;\n    out_r[0] = (sm23 - sm32) / S;\n    out_r[1] = (sm31 - sm13) / S;\n    out_r[2] = (sm12 - sm21) / S;\n  } else if (sm11 > sm22 && sm11 > sm33) {\n    S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n    out_r[3] = (sm23 - sm32) / S;\n    out_r[0] = 0.25 * S;\n    out_r[1] = (sm12 + sm21) / S;\n    out_r[2] = (sm31 + sm13) / S;\n  } else if (sm22 > sm33) {\n    S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n    out_r[3] = (sm31 - sm13) / S;\n    out_r[0] = (sm12 + sm21) / S;\n    out_r[1] = 0.25 * S;\n    out_r[2] = (sm23 + sm32) / S;\n  } else {\n    S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n    out_r[3] = (sm12 - sm21) / S;\n    out_r[0] = (sm31 + sm13) / S;\n    out_r[1] = (sm23 + sm32) / S;\n    out_r[2] = 0.25 * S;\n  }\n  return out_r;\n}\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, dest, vec);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *     mat4.scale(dest, dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScale(out, q, v, s) {\n  // Quaternion math\n  var x = q[0],\n    y = q[1],\n    z = q[2],\n    w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  out[0] = (1 - (yy + zz)) * sx;\n  out[1] = (xy + wz) * sx;\n  out[2] = (xz - wy) * sx;\n  out[3] = 0;\n  out[4] = (xy - wz) * sy;\n  out[5] = (1 - (xx + zz)) * sy;\n  out[6] = (yz + wx) * sy;\n  out[7] = 0;\n  out[8] = (xz + wy) * sz;\n  out[9] = (yz - wx) * sz;\n  out[10] = (1 - (xx + yy)) * sz;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, dest, vec);\n *     mat4.translate(dest, dest, origin);\n *     let quatMat = mat4.create();\n *     mat4.fromQuat(quatMat, quat);\n *     mat4.multiply(dest, dest, quatMat);\n *     mat4.scale(dest, dest, scale)\n *     mat4.translate(dest, dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n  // Quaternion math\n  var x = q[0],\n    y = q[1],\n    z = q[2],\n    w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  var ox = o[0];\n  var oy = o[1];\n  var oz = o[2];\n  var out0 = (1 - (yy + zz)) * sx;\n  var out1 = (xy + wz) * sx;\n  var out2 = (xz - wy) * sx;\n  var out4 = (xy - wz) * sy;\n  var out5 = (1 - (xx + zz)) * sy;\n  var out6 = (yz + wx) * sy;\n  var out8 = (xz + wy) * sz;\n  var out9 = (yz - wx) * sz;\n  var out10 = (1 - (xx + yy)) * sz;\n  out[0] = out0;\n  out[1] = out1;\n  out[2] = out2;\n  out[3] = 0;\n  out[4] = out4;\n  out[5] = out5;\n  out[6] = out6;\n  out[7] = 0;\n  out[8] = out8;\n  out[9] = out9;\n  out[10] = out10;\n  out[11] = 0;\n  out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n  out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n  out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\nexport function fromQuat(out, q) {\n  var x = q[0],\n    y = q[1],\n    z = q[2],\n    w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var yx = y * x2;\n  var yy = y * y2;\n  var zx = z * x2;\n  var zy = z * y2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - yy - zz;\n  out[1] = yx + wz;\n  out[2] = zx - wy;\n  out[3] = 0;\n  out[4] = yx - wz;\n  out[5] = 1 - xx - zz;\n  out[6] = zy + wx;\n  out[7] = 0;\n  out[8] = zx + wy;\n  out[9] = zy - wx;\n  out[10] = 1 - xx - yy;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function frustum(out, left, right, bottom, top, near, far) {\n  var rl = 1 / (right - left);\n  var tb = 1 / (top - bottom);\n  var nf = 1 / (near - far);\n  out[0] = near * 2 * rl;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = near * 2 * tb;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = (right + left) * rl;\n  out[9] = (top + bottom) * tb;\n  out[10] = (far + near) * nf;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = far * near * 2 * nf;\n  out[15] = 0;\n  return out;\n}\n\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2);\n  out[0] = f / aspect;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = f;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[15] = 0;\n  if (far != null && far !== Infinity) {\n    var nf = 1 / (near - far);\n    out[10] = (far + near) * nf;\n    out[14] = 2 * far * near * nf;\n  } else {\n    out[10] = -1;\n    out[14] = -2 * near;\n  }\n  return out;\n}\n\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\nexport var perspective = perspectiveNO;\n\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2);\n  out[0] = f / aspect;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = f;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[15] = 0;\n  if (far != null && far !== Infinity) {\n    var nf = 1 / (near - far);\n    out[10] = far * nf;\n    out[14] = far * near * nf;\n  } else {\n    out[10] = -1;\n    out[14] = -near;\n  }\n  return out;\n}\n\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n  var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n  var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n  var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n  var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n  var xScale = 2.0 / (leftTan + rightTan);\n  var yScale = 2.0 / (upTan + downTan);\n  out[0] = xScale;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  out[4] = 0.0;\n  out[5] = yScale;\n  out[6] = 0.0;\n  out[7] = 0.0;\n  out[8] = -((leftTan - rightTan) * xScale * 0.5);\n  out[9] = (upTan - downTan) * yScale * 0.5;\n  out[10] = far / (near - far);\n  out[11] = -1.0;\n  out[12] = 0.0;\n  out[13] = 0.0;\n  out[14] = far * near / (near - far);\n  out[15] = 0.0;\n  return out;\n}\n\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function orthoNO(out, left, right, bottom, top, near, far) {\n  var lr = 1 / (left - right);\n  var bt = 1 / (bottom - top);\n  var nf = 1 / (near - far);\n  out[0] = -2 * lr;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = -2 * bt;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 2 * nf;\n  out[11] = 0;\n  out[12] = (left + right) * lr;\n  out[13] = (top + bottom) * bt;\n  out[14] = (far + near) * nf;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\nexport var ortho = orthoNO;\n\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\nexport function orthoZO(out, left, right, bottom, top, near, far) {\n  var lr = 1 / (left - right);\n  var bt = 1 / (bottom - top);\n  var nf = 1 / (near - far);\n  out[0] = -2 * lr;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = -2 * bt;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = nf;\n  out[11] = 0;\n  out[12] = (left + right) * lr;\n  out[13] = (top + bottom) * bt;\n  out[14] = near * nf;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function lookAt(out, eye, center, up) {\n  var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n  var eyex = eye[0];\n  var eyey = eye[1];\n  var eyez = eye[2];\n  var upx = up[0];\n  var upy = up[1];\n  var upz = up[2];\n  var centerx = center[0];\n  var centery = center[1];\n  var centerz = center[2];\n  if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n    return identity(out);\n  }\n  z0 = eyex - centerx;\n  z1 = eyey - centery;\n  z2 = eyez - centerz;\n  len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n  z0 *= len;\n  z1 *= len;\n  z2 *= len;\n  x0 = upy * z2 - upz * z1;\n  x1 = upz * z0 - upx * z2;\n  x2 = upx * z1 - upy * z0;\n  len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n  if (!len) {\n    x0 = 0;\n    x1 = 0;\n    x2 = 0;\n  } else {\n    len = 1 / len;\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n  y0 = z1 * x2 - z2 * x1;\n  y1 = z2 * x0 - z0 * x2;\n  y2 = z0 * x1 - z1 * x0;\n  len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n  if (!len) {\n    y0 = 0;\n    y1 = 0;\n    y2 = 0;\n  } else {\n    len = 1 / len;\n    y0 *= len;\n    y1 *= len;\n    y2 *= len;\n  }\n  out[0] = x0;\n  out[1] = y0;\n  out[2] = z0;\n  out[3] = 0;\n  out[4] = x1;\n  out[5] = y1;\n  out[6] = z1;\n  out[7] = 0;\n  out[8] = x2;\n  out[9] = y2;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n  out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n  out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} target Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\nexport function targetTo(out, eye, target, up) {\n  var eyex = eye[0],\n    eyey = eye[1],\n    eyez = eye[2],\n    upx = up[0],\n    upy = up[1],\n    upz = up[2];\n  var z0 = eyex - target[0],\n    z1 = eyey - target[1],\n    z2 = eyez - target[2];\n  var len = z0 * z0 + z1 * z1 + z2 * z2;\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    z0 *= len;\n    z1 *= len;\n    z2 *= len;\n  }\n  var x0 = upy * z2 - upz * z1,\n    x1 = upz * z0 - upx * z2,\n    x2 = upx * z1 - upy * z0;\n  len = x0 * x0 + x1 * x1 + x2 * x2;\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n  out[0] = x0;\n  out[1] = x1;\n  out[2] = x2;\n  out[3] = 0;\n  out[4] = z1 * x2 - z2 * x1;\n  out[5] = z2 * x0 - z0 * x2;\n  out[6] = z0 * x1 - z1 * x0;\n  out[7] = 0;\n  out[8] = z0;\n  out[9] = z1;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = eyex;\n  out[13] = eyey;\n  out[14] = eyez;\n  out[15] = 1;\n  return out;\n}\n\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n  return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3] + a[4] * a[4] + a[5] * a[5] + a[6] * a[6] + a[7] * a[7] + a[8] * a[8] + a[9] * a[9] + a[10] * a[10] + a[11] * a[11] + a[12] * a[12] + a[13] * a[13] + a[14] * a[14] + a[15] * a[15]);\n}\n\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  out[4] = a[4] + b[4];\n  out[5] = a[5] + b[5];\n  out[6] = a[6] + b[6];\n  out[7] = a[7] + b[7];\n  out[8] = a[8] + b[8];\n  out[9] = a[9] + b[9];\n  out[10] = a[10] + b[10];\n  out[11] = a[11] + b[11];\n  out[12] = a[12] + b[12];\n  out[13] = a[13] + b[13];\n  out[14] = a[14] + b[14];\n  out[15] = a[15] + b[15];\n  return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  out[4] = a[4] - b[4];\n  out[5] = a[5] - b[5];\n  out[6] = a[6] - b[6];\n  out[7] = a[7] - b[7];\n  out[8] = a[8] - b[8];\n  out[9] = a[9] - b[9];\n  out[10] = a[10] - b[10];\n  out[11] = a[11] - b[11];\n  out[12] = a[12] - b[12];\n  out[13] = a[13] - b[13];\n  out[14] = a[14] - b[14];\n  out[15] = a[15] - b[15];\n  return out;\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  out[4] = a[4] * b;\n  out[5] = a[5] * b;\n  out[6] = a[6] * b;\n  out[7] = a[7] * b;\n  out[8] = a[8] * b;\n  out[9] = a[9] * b;\n  out[10] = a[10] * b;\n  out[11] = a[11] * b;\n  out[12] = a[12] * b;\n  out[13] = a[13] * b;\n  out[14] = a[14] * b;\n  out[15] = a[15] * b;\n  return out;\n}\n\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  out[4] = a[4] + b[4] * scale;\n  out[5] = a[5] + b[5] * scale;\n  out[6] = a[6] + b[6] * scale;\n  out[7] = a[7] + b[7] * scale;\n  out[8] = a[8] + b[8] * scale;\n  out[9] = a[9] + b[9] * scale;\n  out[10] = a[10] + b[10] * scale;\n  out[11] = a[11] + b[11] * scale;\n  out[12] = a[12] + b[12] * scale;\n  out[13] = a[13] + b[13] * scale;\n  out[14] = a[14] + b[14] * scale;\n  out[15] = a[15] + b[15] * scale;\n  return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var a4 = a[4],\n    a5 = a[5],\n    a6 = a[6],\n    a7 = a[7];\n  var a8 = a[8],\n    a9 = a[9],\n    a10 = a[10],\n    a11 = a[11];\n  var a12 = a[12],\n    a13 = a[13],\n    a14 = a[14],\n    a15 = a[15];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3];\n  var b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7];\n  var b8 = b[8],\n    b9 = b[9],\n    b10 = b[10],\n    b11 = b[11];\n  var b12 = b[12],\n    b13 = b[13],\n    b14 = b[14],\n    b15 = b[15];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\nexport var sub = subtract;","import * as glMatrix from \"./common.js\";\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n  return out;\n}\n\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return Math.sqrt(x * x + y * y + z * z);\n}\n\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\nexport function fromValues(x, y, z) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\nexport function set(out, x, y, z) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  return out;\n}\n\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  return out;\n}\n\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  return out;\n}\n\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  return out;\n}\n\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  return out;\n}\n\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  return out;\n}\n\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  return out;\n}\n\n/**\n * symmetric round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  out[2] = glMatrix.round(a[2]);\n  return out;\n}\n\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  return out;\n}\n\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  return out;\n}\n\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return Math.sqrt(x * x + y * y + z * z);\n}\n\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return x * x + y * y + z * z;\n}\n\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return x * x + y * y + z * z;\n}\n\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  return out;\n}\n\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  return out;\n}\n\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var len = x * x + y * y + z * z;\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  out[2] = a[2] * len;\n  return out;\n}\n\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n  var ax = a[0],\n    ay = a[1],\n    az = a[2];\n  var bx = b[0],\n    by = b[1],\n    bz = b[2];\n  out[0] = ay * bz - az * by;\n  out[1] = az * bx - ax * bz;\n  out[2] = ax * by - ay * bx;\n  return out;\n}\n\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  return out;\n}\n\n/**\n * Performs a spherical linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function slerp(out, a, b, t) {\n  var angle = Math.acos(Math.min(Math.max(dot(a, b), -1), 1));\n  var sinTotal = Math.sin(angle);\n  var ratioA = Math.sin((1 - t) * angle) / sinTotal;\n  var ratioB = Math.sin(t * angle) / sinTotal;\n  out[0] = ratioA * a[0] + ratioB * b[0];\n  out[1] = ratioA * a[1] + ratioB * b[1];\n  out[2] = ratioA * a[2] + ratioB * b[2];\n  return out;\n}\n\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function hermite(out, a, b, c, d, t) {\n  var factorTimes2 = t * t;\n  var factor1 = factorTimes2 * (2 * t - 3) + 1;\n  var factor2 = factorTimes2 * (t - 2) + t;\n  var factor3 = factorTimes2 * (t - 1);\n  var factor4 = factorTimes2 * (3 - 2 * t);\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\nexport function bezier(out, a, b, c, d, t) {\n  var inverseFactor = 1 - t;\n  var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n  var factorTimes2 = t * t;\n  var factor1 = inverseFactorTimesTwo * inverseFactor;\n  var factor2 = 3 * t * inverseFactorTimesTwo;\n  var factor3 = 3 * factorTimes2 * inverseFactor;\n  var factor4 = factorTimes2 * t;\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {vec3} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  var z = glMatrix.RANDOM() * 2.0 - 1.0;\n  var zScale = Math.sqrt(1.0 - z * z) * scale;\n  out[0] = Math.cos(r) * zScale;\n  out[1] = Math.sin(r) * zScale;\n  out[2] = z * scale;\n  return out;\n}\n\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n    y = a[1],\n    z = a[2];\n  var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n  w = w || 1.0;\n  out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n  out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n  return out;\n}\n\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n    y = a[1],\n    z = a[2];\n  out[0] = x * m[0] + y * m[3] + z * m[6];\n  out[1] = x * m[1] + y * m[4] + z * m[7];\n  out[2] = x * m[2] + y * m[5] + z * m[8];\n  return out;\n}\n\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q normalized quaternion to transform with\n * @returns {vec3} out\n */\nexport function transformQuat(out, a, q) {\n  // Fast Vector Rotation using Quaternions by Robert Eisele\n  // https://raw.org/proof/vector-rotation-using-quaternions/\n\n  var qx = q[0],\n    qy = q[1],\n    qz = q[2],\n    qw = q[3];\n  var vx = a[0],\n    vy = a[1],\n    vz = a[2];\n\n  // t = q x v\n  var tx = qy * vz - qz * vy;\n  var ty = qz * vx - qx * vz;\n  var tz = qx * vy - qy * vx;\n\n  // t = 2t\n  tx = tx + tx;\n  ty = ty + ty;\n  tz = tz + tz;\n\n  // v + w t + q x t\n  out[0] = vx + qw * tx + qy * tz - qz * ty;\n  out[1] = vy + qw * ty + qz * tx - qx * tz;\n  out[2] = vz + qw * tz + qx * ty - qy * tx;\n  return out;\n}\n\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateX(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\n  r[0] = p[0];\n  r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n  r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad);\n\n  //translate to correct position\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateY(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\n  r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n  r[1] = p[1];\n  r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad);\n\n  //translate to correct position\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\nexport function rotateZ(out, a, b, rad) {\n  var p = [],\n    r = [];\n  //Translate point to the origin\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2];\n\n  //perform rotation\n  r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n  r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n  r[2] = p[2];\n\n  //translate to correct position\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\nexport function angle(a, b) {\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    bx = b[0],\n    by = b[1],\n    bz = b[2],\n    mag = Math.sqrt((ax * ax + ay * ay + az * az) * (bx * bx + by * by + bz * bz)),\n    cosine = mag && dot(a, b) / mag;\n  return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  return out;\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n  return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec3.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 3;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n    }\n    return a;\n  };\n}();","import * as glMatrix from \"./common.js\";\nimport * as mat3 from \"./mat3.js\";\nimport * as vec3 from \"./vec3.js\";\nimport * as vec4 from \"./vec4.js\";\n\n/**\n * Quaternion in the format XYZW\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nexport function identity(out) {\n  out[0] = 0;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\nexport function setAxisAngle(out, axis, rad) {\n  rad = rad * 0.5;\n  var s = Math.sin(rad);\n  out[0] = s * axis[0];\n  out[1] = s * axis[1];\n  out[2] = s * axis[2];\n  out[3] = Math.cos(rad);\n  return out;\n}\n\n/**\n * Gets the rotation axis and angle for a given\n *  quaternion. If a quaternion is created with\n *  setAxisAngle, this method will return the same\n *  values as providied in the original parameter list\n *  OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n *  angle -90 is the same as the quaternion formed by\n *  [0, 0, 1] and 270. This method favors the latter.\n * @param  {vec3} out_axis  Vector receiving the axis of rotation\n * @param  {ReadonlyQuat} q     Quaternion to be decomposed\n * @return {Number}     Angle, in radians, of the rotation\n */\nexport function getAxisAngle(out_axis, q) {\n  var rad = Math.acos(q[3]) * 2.0;\n  var s = Math.sin(rad / 2.0);\n  if (s > glMatrix.EPSILON) {\n    out_axis[0] = q[0] / s;\n    out_axis[1] = q[1] / s;\n    out_axis[2] = q[2] / s;\n  } else {\n    // If s is zero, return any axis (no rotation - axis does not matter)\n    out_axis[0] = 1;\n    out_axis[1] = 0;\n    out_axis[2] = 0;\n  }\n  return rad;\n}\n\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param  {ReadonlyQuat} a     Origin unit quaternion\n * @param  {ReadonlyQuat} b     Destination unit quaternion\n * @return {Number}     Angle, in radians, between the two quaternions\n */\nexport function getAngle(a, b) {\n  var dotproduct = dot(a, b);\n  return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\nexport function multiply(out, a, b) {\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = b[0],\n    by = b[1],\n    bz = b[2],\n    bw = b[3];\n  out[0] = ax * bw + aw * bx + ay * bz - az * by;\n  out[1] = ay * bw + aw * by + az * bx - ax * bz;\n  out[2] = az * bw + aw * bz + ax * by - ay * bx;\n  out[3] = aw * bw - ax * bx - ay * by - az * bz;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateX(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw + aw * bx;\n  out[1] = ay * bw + az * bx;\n  out[2] = az * bw - ay * bx;\n  out[3] = aw * bw - ax * bx;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateY(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var by = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw - az * by;\n  out[1] = ay * bw + aw * by;\n  out[2] = az * bw + ax * by;\n  out[3] = aw * bw - ay * by;\n  return out;\n}\n\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\nexport function rotateZ(out, a, rad) {\n  rad *= 0.5;\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bz = Math.sin(rad),\n    bw = Math.cos(rad);\n  out[0] = ax * bw + ay * bz;\n  out[1] = ay * bw - ax * bz;\n  out[2] = az * bw + aw * bz;\n  out[3] = aw * bw - az * bz;\n  return out;\n}\n\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\nexport function calculateW(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2];\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n  return out;\n}\n\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\nexport function exp(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2],\n    w = a[3];\n  var r = Math.sqrt(x * x + y * y + z * z);\n  var et = Math.exp(w);\n  var s = r > 0 ? et * Math.sin(r) / r : 0;\n  out[0] = x * s;\n  out[1] = y * s;\n  out[2] = z * s;\n  out[3] = et * Math.cos(r);\n  return out;\n}\n\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\nexport function ln(out, a) {\n  var x = a[0],\n    y = a[1],\n    z = a[2],\n    w = a[3];\n  var r = Math.sqrt(x * x + y * y + z * z);\n  var t = r > 0 ? Math.atan2(r, w) / r : 0;\n  out[0] = x * t;\n  out[1] = y * t;\n  out[2] = z * t;\n  out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n  return out;\n}\n\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\nexport function pow(out, a, b) {\n  ln(out, a);\n  scale(out, out, b);\n  exp(out, out);\n  return out;\n}\n\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\nexport function slerp(out, a, b, t) {\n  // benchmarks:\n  //    http://jsperf.com/quaternion-slerp-implementations\n  var ax = a[0],\n    ay = a[1],\n    az = a[2],\n    aw = a[3];\n  var bx = b[0],\n    by = b[1],\n    bz = b[2],\n    bw = b[3];\n  var omega, cosom, sinom, scale0, scale1;\n\n  // calc cosine\n  cosom = ax * bx + ay * by + az * bz + aw * bw;\n  // adjust signs (if necessary)\n  if (cosom < 0.0) {\n    cosom = -cosom;\n    bx = -bx;\n    by = -by;\n    bz = -bz;\n    bw = -bw;\n  }\n  // calculate coefficients\n  if (1.0 - cosom > glMatrix.EPSILON) {\n    // standard case (slerp)\n    omega = Math.acos(cosom);\n    sinom = Math.sin(omega);\n    scale0 = Math.sin((1.0 - t) * omega) / sinom;\n    scale1 = Math.sin(t * omega) / sinom;\n  } else {\n    // \"from\" and \"to\" quaternions are very close\n    //  ... so we can do a linear interpolation\n    scale0 = 1.0 - t;\n    scale1 = t;\n  }\n  // calculate final values\n  out[0] = scale0 * ax + scale1 * bx;\n  out[1] = scale0 * ay + scale1 * by;\n  out[2] = scale0 * az + scale1 * bz;\n  out[3] = scale0 * aw + scale1 * bw;\n  return out;\n}\n\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\nexport function random(out) {\n  // Implementation of http://planning.cs.uiuc.edu/node198.html\n  // TODO: Calling random 3 times is probably not the fastest solution\n  var u1 = glMatrix.RANDOM();\n  var u2 = glMatrix.RANDOM();\n  var u3 = glMatrix.RANDOM();\n  var sqrt1MinusU1 = Math.sqrt(1 - u1);\n  var sqrtU1 = Math.sqrt(u1);\n  out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n  out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n  out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n  out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n  return out;\n}\n\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\nexport function invert(out, a) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n  var invDot = dot ? 1.0 / dot : 0;\n\n  // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n  out[0] = -a0 * invDot;\n  out[1] = -a1 * invDot;\n  out[2] = -a2 * invDot;\n  out[3] = a3 * invDot;\n  return out;\n}\n\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\nexport function conjugate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\nexport function fromMat3(out, m) {\n  // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n  // article \"Quaternion Calculus and Fast Animation\".\n  var fTrace = m[0] + m[4] + m[8];\n  var fRoot;\n  if (fTrace > 0.0) {\n    // |w| > 1/2, may as well choose w > 1/2\n    fRoot = Math.sqrt(fTrace + 1.0); // 2w\n    out[3] = 0.5 * fRoot;\n    fRoot = 0.5 / fRoot; // 1/(4w)\n    out[0] = (m[5] - m[7]) * fRoot;\n    out[1] = (m[6] - m[2]) * fRoot;\n    out[2] = (m[1] - m[3]) * fRoot;\n  } else {\n    // |w| <= 1/2\n    var i = 0;\n    if (m[4] > m[0]) i = 1;\n    if (m[8] > m[i * 3 + i]) i = 2;\n    var j = (i + 1) % 3;\n    var k = (i + 2) % 3;\n    fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n    out[i] = 0.5 * fRoot;\n    fRoot = 0.5 / fRoot;\n    out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n    out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n    out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n  }\n  return out;\n}\n\n/**\n * Creates a quaternion from the given euler angle x, y, z using the provided intrinsic order for the conversion.\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x Angle to rotate around X axis in degrees.\n * @param {Number} y Angle to rotate around Y axis in degrees.\n * @param {Number} z Angle to rotate around Z axis in degrees.\n * @param {'xyz'|'xzy'|'yxz'|'yzx'|'zxy'|'zyx'} order Intrinsic order for conversion, default is zyx.\n * @returns {quat} out\n * @function\n */\nexport function fromEuler(out, x, y, z) {\n  var order = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : glMatrix.ANGLE_ORDER;\n  var halfToRad = Math.PI / 360;\n  x *= halfToRad;\n  z *= halfToRad;\n  y *= halfToRad;\n  var sx = Math.sin(x);\n  var cx = Math.cos(x);\n  var sy = Math.sin(y);\n  var cy = Math.cos(y);\n  var sz = Math.sin(z);\n  var cz = Math.cos(z);\n  switch (order) {\n    case \"xyz\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"xzy\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    case \"yxz\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz - sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    case \"yzx\":\n      out[0] = sx * cy * cz + cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"zxy\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz + sx * sy * cz;\n      out[3] = cx * cy * cz - sx * sy * sz;\n      break;\n    case \"zyx\":\n      out[0] = sx * cy * cz - cx * sy * sz;\n      out[1] = cx * sy * cz + sx * cy * sz;\n      out[2] = cx * cy * sz - sx * sy * cz;\n      out[3] = cx * cy * cz + sx * sy * sz;\n      break;\n    default:\n      throw new Error('Unknown angle order ' + order);\n  }\n  return out;\n}\n\n/**\n * Returns a string representation of a quaternion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n  return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\nexport var clone = vec4.clone;\n\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\nexport var fromValues = vec4.fromValues;\n\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\nexport var copy = vec4.copy;\n\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\nexport var set = vec4.set;\n\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\nexport var add = vec4.add;\n\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\nexport var scale = vec4.scale;\n\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\nexport var dot = vec4.dot;\n\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\nexport var lerp = vec4.lerp;\n\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport var length = vec4.length;\n\n/**\n * Alias for {@link quat.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\nexport var squaredLength = vec4.squaredLength;\n\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\nexport var normalize = vec4.normalize;\n\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport var exactEquals = vec4.exactEquals;\n\n/**\n * Returns whether or not the quaternions point approximately to the same direction.\n *\n * Both quaternions are assumed to be unit length.\n *\n * @param {ReadonlyQuat} a The first unit quaternion.\n * @param {ReadonlyQuat} b The second unit quaternion.\n * @returns {Boolean} True if the quaternions are equal, false otherwise.\n */\nexport function equals(a, b) {\n  return Math.abs(vec4.dot(a, b)) >= 1 - glMatrix.EPSILON;\n}\n\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\nexport var rotationTo = function () {\n  var tmpvec3 = vec3.create();\n  var xUnitVec3 = vec3.fromValues(1, 0, 0);\n  var yUnitVec3 = vec3.fromValues(0, 1, 0);\n  return function (out, a, b) {\n    var dot = vec3.dot(a, b);\n    if (dot < -0.999999) {\n      vec3.cross(tmpvec3, xUnitVec3, a);\n      if (vec3.len(tmpvec3) < 0.000001) vec3.cross(tmpvec3, yUnitVec3, a);\n      vec3.normalize(tmpvec3, tmpvec3);\n      setAxisAngle(out, tmpvec3, Math.PI);\n      return out;\n    } else if (dot > 0.999999) {\n      out[0] = 0;\n      out[1] = 0;\n      out[2] = 0;\n      out[3] = 1;\n      return out;\n    } else {\n      vec3.cross(tmpvec3, a, b);\n      out[0] = tmpvec3[0];\n      out[1] = tmpvec3[1];\n      out[2] = tmpvec3[2];\n      out[3] = 1 + dot;\n      return normalize(out, out);\n    }\n  };\n}();\n\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\nexport var sqlerp = function () {\n  var temp1 = create();\n  var temp2 = create();\n  return function (out, a, b, c, d, t) {\n    slerp(temp1, a, d, t);\n    slerp(temp2, b, c, t);\n    slerp(out, temp1, temp2, 2 * t * (1 - t));\n    return out;\n  };\n}();\n\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view  the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up    the vector representing the local \"up\" direction\n * @returns {quat} out\n */\nexport var setAxes = function () {\n  var matr = mat3.create();\n  return function (out, view, right, up) {\n    matr[0] = right[0];\n    matr[3] = right[1];\n    matr[6] = right[2];\n    matr[1] = up[0];\n    matr[4] = up[1];\n    matr[7] = up[2];\n    matr[2] = -view[0];\n    matr[5] = -view[1];\n    matr[8] = -view[2];\n    return normalize(out, fromMat3(out, matr));\n  };\n}();","import * as glMatrix from \"./common.js\";\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n  }\n  return out;\n}\n\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\nexport function fromValues(x, y) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\nexport function set(out, x, y) {\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  return out;\n}\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  return out;\n}\n\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  return out;\n}\n\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  return out;\n}\n\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  return out;\n}\n\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  return out;\n}\n\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  return out;\n}\n\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  return out;\n}\n\n/**\n * symmetric round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\nexport function round(out, a) {\n  out[0] = glMatrix.round(a[0]);\n  out[1] = glMatrix.round(a[1]);\n  return out;\n}\n\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  return out;\n}\n\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  return out;\n}\n\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\nexport function distance(a, b) {\n  var x = b[0] - a[0],\n    y = b[1] - a[1];\n  return Math.sqrt(x * x + y * y);\n}\n\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0],\n    y = b[1] - a[1];\n  return x * x + y * y;\n}\n\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\nexport function length(a) {\n  var x = a[0],\n    y = a[1];\n  return Math.sqrt(x * x + y * y);\n}\n\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nexport function squaredLength(a) {\n  var x = a[0],\n    y = a[1];\n  return x * x + y * y;\n}\n\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  return out;\n}\n\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  return out;\n}\n\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\nexport function normalize(out, a) {\n  var x = a[0],\n    y = a[1];\n  var len = x * x + y * y;\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  return out;\n}\n\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1];\n}\n\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\nexport function cross(out, a, b) {\n  var z = a[0] * b[1] - a[1] * b[0];\n  out[0] = out[1] = 0;\n  out[2] = z;\n  return out;\n}\n\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\nexport function lerp(out, a, b, t) {\n  var ax = a[0],\n    ay = a[1];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  return out;\n}\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If omitted, a unit vector will be returned\n * @returns {vec2} out\n */\nexport function random(out, scale) {\n  scale = scale === undefined ? 1.0 : scale;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  out[0] = Math.cos(r) * scale;\n  out[1] = Math.sin(r) * scale;\n  return out;\n}\n\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat2(out, a, m) {\n  var x = a[0],\n    y = a[1];\n  out[0] = m[0] * x + m[2] * y;\n  out[1] = m[1] * x + m[3] * y;\n  return out;\n}\n\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat2d(out, a, m) {\n  var x = a[0],\n    y = a[1];\n  out[0] = m[0] * x + m[2] * y + m[4];\n  out[1] = m[1] * x + m[3] * y + m[5];\n  return out;\n}\n\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n    y = a[1];\n  out[0] = m[0] * x + m[3] * y + m[6];\n  out[1] = m[1] * x + m[4] * y + m[7];\n  return out;\n}\n\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\nexport function transformMat4(out, a, m) {\n  var x = a[0];\n  var y = a[1];\n  out[0] = m[0] * x + m[4] * y + m[12];\n  out[1] = m[1] * x + m[5] * y + m[13];\n  return out;\n}\n\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\nexport function rotate(out, a, b, rad) {\n  //Translate point to the origin\n  var p0 = a[0] - b[0],\n    p1 = a[1] - b[1],\n    sinC = Math.sin(rad),\n    cosC = Math.cos(rad);\n\n  //perform rotation and translate to correct position\n  out[0] = p0 * cosC - p1 * sinC + b[0];\n  out[1] = p0 * sinC + p1 * cosC + b[1];\n  return out;\n}\n\n/**\n * Get the smallest angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\nexport function angle(a, b) {\n  var ax = a[0],\n    ay = a[1],\n    bx = b[0],\n    by = b[1];\n  return Math.abs(Math.atan2(ay * bx - ax * by, ax * bx + ay * by));\n}\n\n/**\n * Get the signed angle in the interval [-pi,pi] between two 2D vectors (positive if `a` is to the right of `b`)\n * \n * @param {ReadonlyVec2} a The first vector\n * @param {ReadonlyVec2} b The second vector\n * @returns {number} The signed angle in radians\n */\nexport function signedAngle(a, b) {\n  var ax = a[0],\n    ay = a[1],\n    bx = b[0],\n    by = b[1];\n  return Math.atan2(ax * by - ay * bx, ax * bx + ay * by);\n}\n\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  return out;\n}\n\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\nexport function str(a) {\n  return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1];\n}\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1];\n  var b0 = b[0],\n    b1 = b[1];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n\n/**\n * Alias for {@link vec2.length}\n * @function\n */\nexport var len = length;\n\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\nexport var sub = subtract;\n\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\nexport var div = divide;\n\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\nexport var dist = distance;\n\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\nexport var sqrDist = squaredDistance;\n\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\nexport var sqrLen = squaredLength;\n\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n    if (!stride) {\n      stride = 2;\n    }\n    if (!offset) {\n      offset = 0;\n    }\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n    }\n    return a;\n  };\n}();","import {EXTENT} from '../data/extent';\n\nimport type {OverscaledTileID} from '../tile/tile_id';\n\n/**\n * Converts a pixel value at a the given zoom level to tile units.\n *\n * The shaders mostly calculate everything in tile units so style\n * properties need to be converted from pixels to tile units using this.\n *\n * For example, a translation by 30 pixels at zoom 6.5 will be a\n * translation by pixelsToTileUnits(30, 6.5) tile units.\n *\n * @returns value in tile units\n */\nexport function pixelsToTileUnits(\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    },\n    pixelValue: number,\n    z: number\n): number {\n    return pixelValue * (EXTENT / (tile.tileSize * Math.pow(2, z - tile.tileID.overscaledZ)));\n}\n","import * as glMatrix from \"./common.js\";\n\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n  }\n  out[0] = 1;\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 1;\n  return out;\n}\n\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\nexport function fromValues(m00, m01, m10, m11) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m10;\n  out[3] = m11;\n  return out;\n}\n\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\nexport function set(out, m00, m01, m10, m11) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m10;\n  out[3] = m11;\n  return out;\n}\n\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache\n  // some values\n  if (out === a) {\n    var a1 = a[1];\n    out[1] = a[2];\n    out[2] = a1;\n  } else {\n    out[0] = a[0];\n    out[1] = a[2];\n    out[2] = a[1];\n    out[3] = a[3];\n  }\n  return out;\n}\n\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2 | null} out, or null if source matrix is not invertible\n */\nexport function invert(out, a) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n\n  // Calculate the determinant\n  var det = a0 * a3 - a2 * a1;\n  if (!det) {\n    return null;\n  }\n  det = 1.0 / det;\n  out[0] = a3 * det;\n  out[1] = -a1 * det;\n  out[2] = -a2 * det;\n  out[3] = a0 * det;\n  return out;\n}\n\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\nexport function adjoint(out, a) {\n  // Caching this value is necessary if out == a\n  var a0 = a[0];\n  out[0] = a[3];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = a0;\n  return out;\n}\n\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\nexport function determinant(a) {\n  return a[0] * a[3] - a[2] * a[1];\n}\n\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function multiply(out, a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3];\n  out[0] = a0 * b0 + a2 * b1;\n  out[1] = a1 * b0 + a3 * b1;\n  out[2] = a0 * b2 + a2 * b3;\n  out[3] = a1 * b2 + a3 * b3;\n  return out;\n}\n\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function rotate(out, a, rad) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  out[0] = a0 * c + a2 * s;\n  out[1] = a1 * c + a3 * s;\n  out[2] = a0 * -s + a2 * c;\n  out[3] = a1 * -s + a3 * c;\n  return out;\n}\n\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\nexport function scale(out, a, v) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var v0 = v[0],\n    v1 = v[1];\n  out[0] = a0 * v0;\n  out[1] = a1 * v0;\n  out[2] = a2 * v1;\n  out[3] = a3 * v1;\n  return out;\n}\n\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n *     mat2.identity(dest);\n *     mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\nexport function fromRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  out[0] = c;\n  out[1] = s;\n  out[2] = -s;\n  out[3] = c;\n  return out;\n}\n\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat2.identity(dest);\n *     mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = v[1];\n  return out;\n}\n\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\nexport function str(a) {\n  return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\nexport function frob(a) {\n  return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2] + a[3] * a[3]);\n}\n\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nexport function LDU(L, D, U, a) {\n  L[2] = a[2] / a[0];\n  U[0] = a[0];\n  U[1] = a[1];\n  U[3] = a[3] - L[2] * U[1];\n  return [L, D, U];\n}\n\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  return out;\n}\n\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  return out;\n}\n\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\nexport function equals(a, b) {\n  var a0 = a[0],\n    a1 = a[1],\n    a2 = a[2],\n    a3 = a[3];\n  var b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  return out;\n}\n\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  return out;\n}\n\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\nexport var mul = multiply;\n\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\nexport var sub = subtract;","import {AbortError} from './abort_error';\nimport {subscribe} from './util';\n\nlet linkEl;\n\nlet reducedMotionQuery: MediaQueryList;\nlet reducedMotionOverride: boolean | undefined;\n\n/** */\nexport const browser = {\n    /**\n     * Schedules a callback to be invoked on the next animation frame.\n     * @param abortController - Controller to abort the scheduled frame.\n     * @param fn - Callback to invoke with the paint start timestamp.\n     * @param reject - Callback to invoke if the frame is aborted.\n     * @param targetWindow - Optional window to use for requestAnimationFrame.\n     *   When the map is rendered in a popup window or iframe, pass the owning\n     *   window to ensure animation frames continue even when the main window\n     *   is not focused.\n     */\n    frame(abortController: AbortController, fn: (paintStartTimestamp: number) => void, reject: (error: Error) => void, targetWindow?: Window): void {\n        const win = targetWindow || window;\n        const frameId = win.requestAnimationFrame((paintStartTimestamp)=>{\n            unsubscribe();\n            fn(paintStartTimestamp);\n        });\n\n        const {unsubscribe} = subscribe(abortController.signal, 'abort', () => {\n            unsubscribe();\n            win.cancelAnimationFrame(frameId);\n            reject(new AbortError(abortController.signal.reason));\n        }, false);\n    },\n\n    /**\n     * Returns a promise that resolves on the next animation frame.\n     * @param abortController - Controller to abort the scheduled frame.\n     * @param targetWindow - Optional window to use for requestAnimationFrame.\n     * @see {@link browser.frame}\n     */\n    frameAsync(abortController: AbortController, targetWindow?: Window): Promise<number> {\n        return new Promise((resolve, reject) => {\n            this.frame(abortController, resolve, reject, targetWindow);\n        });\n    },\n\n    getImageData(img:  HTMLImageElement | ImageBitmap, padding: number = 0): ImageData {\n        const context = this.getImageCanvasContext(img);\n        return context.getImageData(-padding, -padding, img.width as number + 2 * padding, img.height as number + 2 * padding);\n    },\n\n    getImageCanvasContext(img: HTMLImageElement | ImageBitmap): CanvasRenderingContext2D {\n        const canvas = window.document.createElement('canvas') as HTMLCanvasElement;\n        const context = canvas.getContext('2d', {willReadFrequently: true});\n        if (!context) {\n            throw new Error('failed to create canvas 2d context');\n        }\n        canvas.width = img.width as number;\n        canvas.height = img.height as number;\n        context.drawImage(img, 0, 0, img.width as number, img.height as number);\n        return context;\n    },\n\n    resolveURL(path: string) {\n        if (!linkEl) linkEl = document.createElement('a');\n        linkEl.href = path;\n        return linkEl.href;\n    },\n\n    hardwareConcurrency: typeof navigator !== 'undefined' && navigator.hardwareConcurrency || 4,\n\n    get prefersReducedMotion(): boolean {\n        if (reducedMotionOverride !== undefined) return reducedMotionOverride;\n        // In case your test crashes when checking matchMedia, call setMatchMedia from 'src/util/test/util'\n        if (!matchMedia) return false;\n        //Lazily initialize media query\n        if (reducedMotionQuery == null) {\n            reducedMotionQuery = matchMedia('(prefers-reduced-motion: reduce)');\n        }\n        return reducedMotionQuery.matches;\n    },\n\n    set prefersReducedMotion(value: boolean) {\n        reducedMotionOverride = value;\n    }\n};\n","/**\n * Manages time flow with optional freezing capability for deterministic rendering.\n */\nclass TimeManager {\n    private _realTime = typeof performance !== 'undefined' && performance && performance.now ?\n        performance.now.bind(performance) :\n        Date.now.bind(Date);\n\n    private _frozenAt: number | null = null;\n\n    /**\n     * Gets the current time, either real or frozen.\n     * @returns Current time in milliseconds\n     */\n    getCurrentTime(): number {\n        return this._frozenAt !== null ? this._frozenAt : this._realTime();\n    }\n\n    /**\n     * Sets time at a specific timestamp.\n     * @param timestamp - Time in milliseconds to set\n     */\n    setNow(timestamp: number): void {\n        this._frozenAt = timestamp;\n    }\n\n    /**\n     * Restores normal time flow.\n     */\n    restoreNow(): void {\n        this._frozenAt = null;\n    }\n\n    /**\n     * Returns whether time is currently frozen.\n     * @returns True if time is frozen, false otherwise\n     */\n    isFrozen(): boolean {\n        return this._frozenAt !== null;\n    }\n}\n\nconst timeManager = new TimeManager();\n\n/**\n * Returns the current time in milliseconds.\n * When time is frozen via setNow(), returns the frozen timestamp.\n * Otherwise returns real browser time (performance.now() or Date.now()).\n *\n * @returns Current time in milliseconds\n * @example\n * ```ts\n * // Measure elapsed time\n * const start = maplibregl.now();\n * // ... later ...\n * const elapsed = maplibregl.now() - start;\n *\n * // During frozen time\n * maplibregl.setNow(16.67);\n * console.log(maplibregl.now()); // 16.67\n * maplibregl.restoreNow();\n * console.log(maplibregl.now()); // real time\n * ```\n */\nexport function now(): number {\n    return timeManager.getCurrentTime();\n}\n\n/**\n * Freezes time at a specific timestamp for deterministic rendering.\n * Useful for frame-by-frame video capture where each frame needs\n * a consistent time value.\n *\n * @param timestamp - Time in milliseconds to freeze at\n * @example\n * ```ts\n * // Freeze time for video export at 60fps\n * setNow(0);           // First frame\n * // ... render frame ...\n * setNow(16.67);       // Second frame\n * // ... render frame ...\n * setNow(33.34);       // Third frame\n * // ... done ...\n * restoreNow();        // Resume normal time\n * ```\n */\nexport function setNow(timestamp: number): void {\n    timeManager.setNow(timestamp);\n}\n\n/**\n * Restores normal time flow after freezing with setNow().\n * Call this after finishing deterministic rendering operations.\n *\n * @example\n * ```ts\n * // After video export, resume normal time\n * setNow(0);\n * // ... export frames ...\n * restoreNow(); // Map animations resume normally\n * ```\n */\nexport function restoreNow(): void {\n    timeManager.restoreNow();\n}\n\n/**\n * Returns whether time is currently frozen.\n * @returns True if time is frozen via setNow(), false otherwise\n * @example\n * ```ts\n * setNow(1000);\n * console.log(isTimeFrozen()); // true\n * restoreNow();\n * console.log(isTimeFrozen()); // false\n * ```\n */\nexport function isTimeFrozen(): boolean {\n    return timeManager.isFrozen();\n}","import Point from '@mapbox/point-geometry';\n\ntype ScaleReturnValue = {\n    x: number;\n    y: number;\n    boundingClientRect: DOMRect;\n};\n\nexport class DOM {\n    private static readonly docStyle = typeof window !== 'undefined' && window.document && window.document.documentElement.style;\n\n    private static userSelect: string;\n\n    private static selectProp = DOM.testProp(['userSelect', 'MozUserSelect', 'WebkitUserSelect', 'msUserSelect']);\n\n    private static transformProp = DOM.testProp(['transform', 'WebkitTransform']);\n\n    private static testProp(props: string[]): string {\n        if (!DOM.docStyle) return props[0];\n        for (let i = 0; i < props.length; i++) {\n            if (props[i] in DOM.docStyle) {\n                return props[i];\n            }\n        }\n        return props[0];\n    }\n\n    public static create<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K] {\n        const el = window.document.createElement(tagName);\n        if (className !== undefined) el.className = className;\n        if (container) container.appendChild(el);\n        return el;\n    }\n\n    public static createNS(namespaceURI: string, tagName: string) {\n        const el = window.document.createElementNS(namespaceURI, tagName);\n        return el;\n    }\n\n    public static disableDrag() {\n        if (DOM.docStyle && DOM.selectProp) {\n            DOM.userSelect = DOM.docStyle[DOM.selectProp];\n            DOM.docStyle[DOM.selectProp] = 'none';\n        }\n    }\n\n    public static enableDrag() {\n        if (DOM.docStyle && DOM.selectProp) {\n            DOM.docStyle[DOM.selectProp] = DOM.userSelect;\n        }\n    }\n\n    public static setTransform(el: HTMLElement, value: string) {\n        el.style[DOM.transformProp] = value;\n    }\n\n    public static addEventListener(target: HTMLElement | Window | Document, type: string, callback: EventListenerOrEventListenerObject, options: {\n        passive?: boolean;\n        capture?: boolean;\n    } = {}) {\n        if ('passive' in options) {\n            target.addEventListener(type, callback, options);\n        } else {\n            target.addEventListener(type, callback, options.capture);\n        }\n    }\n\n    public static removeEventListener(target: HTMLElement | Window | Document, type: string, callback: EventListenerOrEventListenerObject, options: {\n        passive?: boolean;\n        capture?: boolean;\n    } = {}) {\n        if ('passive' in options) {\n            target.removeEventListener(type, callback, options);\n        } else {\n            target.removeEventListener(type, callback, options.capture);\n        }\n    }\n\n    // Suppress the next click, but only if it's immediate.\n    private static suppressClickInternal(e) {\n        e.preventDefault();\n        e.stopPropagation();\n        window.removeEventListener('click', DOM.suppressClickInternal, true);\n    }\n\n    public static suppressClick() {\n        window.addEventListener('click', DOM.suppressClickInternal, true);\n        window.setTimeout(() => {\n            window.removeEventListener('click', DOM.suppressClickInternal, true);\n        }, 0);\n    }\n\n    private static getScale(element: HTMLElement): ScaleReturnValue {\n        const rect = element.getBoundingClientRect();\n        return {\n            x: (rect.width / element.offsetWidth) || 1,\n            y: (rect.height / element.offsetHeight) || 1,\n            boundingClientRect: rect,\n        };\n    }\n\n    private static getPoint(el: HTMLElement, scale: ScaleReturnValue, e: MouseEvent | Touch): Point {\n        const rect = scale.boundingClientRect;\n        return new Point(\n            // rect.left/top values are in page scale (like clientX/Y),\n            // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\n            ((e.clientX - rect.left) / scale.x) - el.clientLeft,\n            ((e.clientY - rect.top) / scale.y) - el.clientTop\n        );\n    }\n\n    public static mousePos(el: HTMLElement, e: MouseEvent | Touch): Point {\n        const scale = DOM.getScale(el);\n        return DOM.getPoint(el, scale, e);\n    }\n\n    public static touchPos(el: HTMLElement, touches: TouchList) {\n        const points: Point[] = [];\n        const scale = DOM.getScale(el);\n        for (let i = 0; i < touches.length; i++) {\n            points.push(DOM.getPoint(el, scale, touches[i]));\n        }\n        return points;\n    }\n\n    public static mouseButton(e: MouseEvent) {\n        return e.button;\n    }\n\n    public static remove(node: HTMLElement) {\n        if (node.parentNode) {\n            node.parentNode.removeChild(node);\n        }\n    }\n\n    /**\n     * Sanitize an HTML string - this might not be enough to prevent all XSS attacks\n     * Base on https://javascriptsource.com/sanitize-an-html-string-to-reduce-the-risk-of-xss-attacks/\n     * (c) 2021 Chris Ferdinandi, MIT License, https://gomakethings.com\n     */\n    public static sanitize(str: string): string {\n        const parser = new DOMParser();\n        const doc = parser.parseFromString(str, 'text/html');\n        const html = doc.body || document.createElement('body');\n        const scripts = html.querySelectorAll('script');\n        for (const script of scripts) {\n            script.remove();\n        }\n\n        DOM.clean(html);\n\n        return html.innerHTML;\n    }\n\n    /**\n     * Check if the attribute is potentially dangerous\n     */\n    private static isPossiblyDangerous(name: string, value: string): boolean {\n        const val = value.replace(/\\s+/g, '').toLowerCase();\n        if (['src', 'href', 'xlink:href'].includes(name)) {\n            if (val.includes('javascript:') || val.includes('data:')) return true;\n        }\n        if (name.startsWith('on')) return true;\n    }\n\n    /**\n\t * Remove dangerous stuff from the HTML document's nodes\n\t * @param html - The HTML document\n\t */\n    private static clean(html: Element) {\n        const nodes = html.children;\n        for (const node of nodes) {\n            DOM.removeAttributes(node);\n            DOM.clean(node);\n        }\n    }\n\n    /**\n\t * Remove potentially dangerous attributes from an element\n\t * @param elem - The element\n\t */\n    private static removeAttributes(elem: Element) {\n        for (const {name, value} of elem.attributes) {\n            if (!DOM.isPossiblyDangerous(name, value)) continue;\n            elem.removeAttribute(name);\n        }\n    }\n}\n","export const webpSupported = {\n    supported: false,\n    testSupport\n};\n\nlet glForTesting: WebGLRenderingContext|WebGL2RenderingContext;\nlet webpCheckComplete = false;\nlet webpImgTest;\nlet webpImgTestOnloadComplete = false;\n\nif (typeof document !== 'undefined') {\n    webpImgTest = document.createElement('img');\n    webpImgTest.onload = () => {\n        if (glForTesting) testWebpTextureUpload(glForTesting);\n        glForTesting = null;\n        webpImgTestOnloadComplete = true;\n    };\n    webpImgTest.onerror = () => {\n        webpCheckComplete = true;\n        glForTesting = null;\n    };\n    webpImgTest.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=';\n}\n\nfunction testSupport(gl: WebGLRenderingContext | WebGL2RenderingContext) {\n    if (webpCheckComplete || !webpImgTest) return;\n\n    // HTMLImageElement.complete is set when an image is done loading it's source\n    // regardless of whether the load was successful or not.\n    // It's possible for an error to set HTMLImageElement.complete to true which would trigger\n    // testWebpTextureUpload and mistakenly set exported.supported to true in browsers which don't support webp\n    // To avoid this, we set a flag in the image's onload handler and only call testWebpTextureUpload\n    // after a successful image load event.\n    if (webpImgTestOnloadComplete) {\n        testWebpTextureUpload(gl);\n    } else {\n        glForTesting = gl;\n\n    }\n}\n\nfunction testWebpTextureUpload(gl: WebGLRenderingContext|WebGL2RenderingContext) {\n    // Edge 18 supports WebP but not uploading a WebP image to a gl texture\n    // Test support for this before allowing WebP images.\n    // https://github.com/mapbox/mapbox-gl-js/issues/7671\n    const texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n\n    try {\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, webpImgTest);\n\n        // The error does not get triggered in Edge if the context is lost\n        if (gl.isContextLost()) return;\n\n        webpSupported.supported = true;\n    } catch {\n        // Catch \"Unspecified Error.\" in Edge 18.\n    }\n\n    gl.deleteTexture(texture);\n\n    webpCheckComplete = true;\n}\n","import {type RequestParameters, makeRequest, sameOrigin, type GetResourceResponse} from './ajax';\nimport {arrayBufferToImageBitmap, arrayBufferToImage, extend, isWorker, isImageBitmap} from './util';\nimport {webpSupported} from './webp_supported';\nimport {config} from './config';\nimport {AbortError} from './abort_error';\nimport {getProtocol} from '../source/protocol_crud';\n\ntype ImageQueueThrottleControlCallback = () => boolean;\n\nexport type ImageRequestQueueItem  = {\n    requestParameters: RequestParameters;\n    supportImageRefresh: boolean;\n    state: 'queued' | 'running' | 'completed';\n    abortController: AbortController;\n    onError: (error: Error) => void;\n    onSuccess: (response: GetResourceResponse<HTMLImageElement | ImageBitmap | null>) => void;\n};\n\ntype ImageQueueThrottleCallbackDictionary = {\n    [Key: number]: ImageQueueThrottleControlCallback;\n};\n\ntype HTMLImageElementWithPriority = HTMLImageElement &\n{\n    // fetchPriority is experimental property supported on Chromium browsers from Version 102\n    // By default images are downloaded with priority low, whereas fetch request downloads with priority high\n    // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority\n    fetchPriority?: 'auto' | 'high' | 'low';\n};\n\n/**\n * By default, the image queue is self driven, meaning as soon as one requested item is processed,\n * it will move on to next one as quickly as it can while limiting\n * the number of concurrent requests to MAX_PARALLEL_IMAGE_REQUESTS. The default behavior\n * ensures that static views of the map can be rendered with minimal delay.\n *\n * However, the default behavior can prevent dynamic views of the map from rendering\n * smoothly in that many requests can finish in one render frame, putting too much pressure on GPU.\n *\n * When the view of the map is moving dynamically, smoother frame rates can be achieved\n * by throttling the number of items processed by the queue per frame. This can be\n * accomplished by using {@link addThrottleControl} to allow the caller to\n * use a lambda function to determine when the queue should be throttled (e.g. when isMoving())\n * and manually calling {@link processQueue} in the render loop.\n */\nexport namespace ImageRequest {\n    let imageRequestQueue : ImageRequestQueueItem[];\n    let currentParallelImageRequests:number;\n\n    let throttleControlCallbackHandleCounter: number;\n    let throttleControlCallbacks: ImageQueueThrottleCallbackDictionary;\n\n    /**\n     * Reset the image request queue, removing all pending requests.\n     */\n    export const resetRequestQueue = (): void => {\n        imageRequestQueue = [];\n        currentParallelImageRequests = 0;\n        throttleControlCallbackHandleCounter = 0;\n        throttleControlCallbacks = {};\n    };\n\n    /**\n     * Install a callback to control when image queue throttling is desired.\n     * (e.g. when the map view is moving)\n     * @param callback - The callback function to install\n     * @returns handle that identifies the installed callback.\n     */\n    export const addThrottleControl = (callback: ImageQueueThrottleControlCallback): number => {\n        const handle = throttleControlCallbackHandleCounter++;\n        throttleControlCallbacks[handle] = callback;\n        return handle;\n    };\n\n    /**\n     * Remove a previously installed callback by passing in the handle returned\n     * by {@link addThrottleControl}.\n     * @param callbackHandle - The handle for the callback to remove.\n     */\n    export const removeThrottleControl = (callbackHandle: number): void => {\n        delete throttleControlCallbacks[callbackHandle];\n        // Try updating the queue\n        processQueue();\n    };\n\n    /**\n     * Check to see if any of the installed callbacks are requesting the queue\n     * to be throttled.\n     * @returns `true` if any callback is causing the queue to be throttled.\n     */\n    const isThrottled = (): boolean => {\n        for (const key of Object.keys(throttleControlCallbacks)) {\n            if (throttleControlCallbacks[key]()) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /**\n     * Request to load an image.\n     * @param requestParameters - Request parameters.\n     * @param abortController - allows to abort the request.\n     * @param supportImageRefresh - `true`, if the image request need to support refresh based on cache headers.\n     * @returns - A promise resolved when the image is loaded.\n     */\n    export const getImage = (requestParameters: RequestParameters, abortController: AbortController, supportImageRefresh: boolean = true): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>> => {\n        return new Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>((resolve, reject) => {\n            if (webpSupported.supported) {\n                if (!requestParameters.headers) {\n                    requestParameters.headers = {};\n                }\n                requestParameters.headers.accept = 'image/webp,*/*';\n            }\n            extend(requestParameters, {type: 'image'});\n            const request: ImageRequestQueueItem = {\n                abortController,\n                requestParameters,\n                supportImageRefresh,\n                state: 'queued',\n                onError: (error: Error) => {\n                    reject(error);\n                },\n                onSuccess: (response) => {\n                    resolve(response);\n                }\n            };\n\n            imageRequestQueue.push(request);\n            processQueue();\n        });\n    };\n\n    const arrayBufferToCanvasImageSource = (data: ArrayBuffer): Promise<HTMLImageElement | ImageBitmap | null> => {\n        const imageBitmapSupported = typeof createImageBitmap === 'function';\n        if (imageBitmapSupported) {\n            return arrayBufferToImageBitmap(data);\n        } else {\n            return arrayBufferToImage(data);\n        }\n    };\n\n    const doImageRequest = async (itemInQueue: ImageRequestQueueItem) => {\n        itemInQueue.state = 'running';\n        const {requestParameters, supportImageRefresh, onError, onSuccess, abortController} = itemInQueue;\n        // - If refreshExpiredTiles is false, then we can use HTMLImageElement to download raster images.\n        // - Fetch/XHR (via MakeRequest API) will be used to download images for following scenarios:\n        //      1. Style image sprite will had a issue with HTMLImageElement as described\n        //          here: https://github.com/mapbox/mapbox-gl-js/issues/1470\n        //      2. If refreshExpiredTiles is true (default), then in order to read the image cache header,\n        //          fetch/XHR request will be required\n        // - For any special case handling like use of AddProtocol, worker initiated request or additional headers\n        //      let makeRequest handle it.\n        // - HtmlImageElement request automatically adds accept header for all the browser supported images\n        const canUseHTMLImageElement = supportImageRefresh === false &&\n            !isWorker(self) &&\n            !getProtocol(requestParameters.url) &&\n            (!requestParameters.headers ||\n                Object.keys(requestParameters.headers).reduce((acc, item) => acc && item === 'accept', true));\n\n        currentParallelImageRequests++;\n\n        const getImagePromise = canUseHTMLImageElement ?\n            getImageUsingHtmlImage(requestParameters, abortController) :\n            makeRequest(requestParameters, abortController);\n\n        try {\n            const response = await getImagePromise;\n            delete itemInQueue.abortController;\n            itemInQueue.state = 'completed';\n            if (response.data instanceof HTMLImageElement || isImageBitmap(response.data)) {\n                // User using addProtocol can directly return HTMLImageElement/ImageBitmap type\n                // If HtmlImageElement is used to get image then response type will be HTMLImageElement\n                onSuccess(response as GetResourceResponse<HTMLImageElement | ImageBitmap | null>);\n            } else if (response.data) {\n                const img = await arrayBufferToCanvasImageSource(response.data);\n                onSuccess({data: img, cacheControl: response.cacheControl, expires: response.expires});\n            }\n        } catch (err) {\n            delete itemInQueue.abortController;\n            onError(err);\n        } finally {\n            currentParallelImageRequests--;\n            processQueue();\n        }\n    };\n\n    /**\n     * Process some number of items in the image request queue.\n     */\n    const processQueue = (): void => {\n\n        const maxImageRequests = isThrottled() ?\n            config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME :\n            config.MAX_PARALLEL_IMAGE_REQUESTS;\n\n        // limit concurrent image loads to help with raster sources performance on big screens\n        for (let numImageRequests = currentParallelImageRequests;\n            numImageRequests < maxImageRequests && imageRequestQueue.length > 0;\n            numImageRequests++) {\n\n            const topItemInQueue: ImageRequestQueueItem = imageRequestQueue.shift();\n            if (topItemInQueue.abortController.signal.aborted) {\n                numImageRequests--;\n                continue;\n            }\n            doImageRequest(topItemInQueue);\n        }\n    };\n\n    const getImageUsingHtmlImage = (requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>  => {\n        return new Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>((resolve, reject) => {\n\n            const image = new Image() as HTMLImageElementWithPriority;\n            const url = requestParameters.url;\n            const credentials = requestParameters.credentials;\n            if (credentials && credentials === 'include') {\n                image.crossOrigin = 'use-credentials';\n            } else if ((credentials && credentials === 'same-origin') || !sameOrigin(url)) {\n                image.crossOrigin = 'anonymous';\n            }\n\n            abortController.signal.addEventListener('abort', () => {\n                // Set src to '' to actually cancel the request\n                image.src = '';\n                reject(new AbortError(abortController.signal.reason));\n            });\n\n            image.fetchPriority = 'high';\n            image.onload = () => {\n                image.onerror = image.onload = null;\n                resolve({data: image});\n            };\n            image.onerror = () => {\n                image.onerror = image.onload = null;\n                if (abortController.signal.aborted) {\n                    return;\n                }\n                reject(new Error('Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.'));\n            };\n            image.src = url;\n        });\n    };\n}\n\nImageRequest.resetRequestQueue();\n","import type {RequestParameters} from './ajax';\n\n/**\n * A type of MapLibre resource.\n */\nexport const enum ResourceType {\n    Glyphs = 'Glyphs',\n    Image = 'Image',\n    Source = 'Source',\n    SpriteImage = 'SpriteImage',\n    SpriteJSON = 'SpriteJSON',\n    Style = 'Style',\n    Tile = 'Tile',\n    Unknown = 'Unknown',\n}\n\n/**\n * This function is used to tranform a request.\n * It is used just before executing the relevant request.\n */\nexport type RequestTransformFunction = (url: string, resourceType?: ResourceType) => RequestParameters | undefined;\n\nexport class RequestManager {\n    _transformRequestFn: RequestTransformFunction | null;\n\n    constructor(transformRequestFn?: RequestTransformFunction | null) {\n        this._transformRequestFn = transformRequestFn ?? null;\n    }\n\n    transformRequest(url: string, type: ResourceType) {\n        if (this._transformRequestFn) {\n            return this._transformRequestFn(url, type) || {url};\n        }\n\n        return {url};\n    }\n\n    setTransformRequest(transformRequest: RequestTransformFunction | null) {\n        this._transformRequestFn = transformRequest;\n    }\n}\n\n","import type {SpriteSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * Takes a SpriteSpecification value and returns it in its array form. If `undefined` is passed as an input value, an\n * empty array is returned.\n * duplicated entries with identical id/url will be removed in returned array\n * @param sprite - optional sprite to coerce\n * @returns an empty array in case `undefined` is passed; id-url pairs otherwise\n */\nexport function coerceSpriteToArray(sprite?: SpriteSpecification): {id: string; url: string}[] {\n    const resultArray: {id: string; url: string}[]  = [];\n\n    if (typeof sprite === 'string') {\n        resultArray.push({id: 'default', url: sprite});\n    } else if (sprite && sprite.length > 0) {\n        const dedupArray: string[] = [];\n        for (const {id, url} of sprite) {\n            const key = `${id}${url}`;\n            if (dedupArray.indexOf(key) === -1) {\n                dedupArray.push(key);\n                resultArray.push({id, url});\n            }\n        }\n    }\n\n    return resultArray;\n\n}\n","import {type GetResourceResponse, getJSON} from '../util/ajax';\nimport {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\n\nimport {browser} from '../util/browser';\nimport {coerceSpriteToArray} from '../util/style';\n\nimport type {SpriteSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {SpriteJSON, StyleImage} from './style_image';\nimport type {RequestManager} from '../util/request_manager';\n\nexport type LoadSpriteResult = {\n    [spriteName: string]: {\n        [id: string]: StyleImage;\n    };\n};\n\nexport function normalizeSpriteURL(url: string, format: string, extension: string): string {\n    try {\n        const parsed = new URL(url);\n        parsed.pathname += `${format}${extension}`;\n        return parsed.toString();\n    }\n    catch {\n        throw new Error(`Invalid sprite URL \"${url}\", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`);\n    }\n}\n\nexport async function loadSprite(\n    originalSprite: SpriteSpecification,\n    requestManager: RequestManager,\n    pixelRatio: number,\n    abortController: AbortController,\n): Promise<LoadSpriteResult> {\n    const spriteArray = coerceSpriteToArray(originalSprite);\n    const format = pixelRatio > 1 ? '@2x' : '';\n\n    const jsonsMap: {[id: string]: Promise<GetResourceResponse<SpriteJSON>>} = {};\n    const imagesMap: {[id: string]: Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>>} = {};\n\n    for (const {id, url} of spriteArray) {\n        const jsonRequestParameters = requestManager.transformRequest(normalizeSpriteURL(url, format, '.json'), ResourceType.SpriteJSON);\n        jsonsMap[id] = getJSON<SpriteJSON>(jsonRequestParameters, abortController);\n\n        const imageRequestParameters = requestManager.transformRequest(normalizeSpriteURL(url, format, '.png'), ResourceType.SpriteImage);\n        imagesMap[id] = ImageRequest.getImage(imageRequestParameters, abortController);\n    }\n\n    await Promise.all([...Object.values(jsonsMap), ...Object.values(imagesMap)]);\n    return doOnceCompleted(jsonsMap, imagesMap);\n}\n\n/**\n * @param jsonsMap - JSON data map\n * @param imagesMap - image data map\n */\nasync function doOnceCompleted(\n    jsonsMap:{[id: string]: Promise<GetResourceResponse<SpriteJSON>>},\n    imagesMap:{[id: string]: Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>>}): Promise<LoadSpriteResult> {\n\n    const result = {} as {[spriteName: string]: {[id: string]: StyleImage}};\n    for (const spriteName in jsonsMap) {\n        result[spriteName] = {};\n\n        const context = browser.getImageCanvasContext((await imagesMap[spriteName]).data);\n        const json = (await jsonsMap[spriteName]).data;\n\n        for (const id in json) {\n            const {width, height, x, y, sdf, pixelRatio, stretchX, stretchY, content, textFitWidth, textFitHeight} = json[id];\n            const spriteData = {width, height, x, y, context};\n            result[spriteName][id] = {data: null, pixelRatio, sdf, stretchX, stretchY, content, textFitWidth, textFitHeight, spriteData};\n        }\n    }\n\n    return result;\n}\n","import {type RGBAImage} from '../util/image';\n\nimport type {Map} from '../ui/map';\n\nexport type SpriteJSON = {[id: string]: StyleImageMetadata & {\n    width: number;\n    height: number;\n    x: number;\n    y: number;\n};};\n\n/**\n * The sprite data\n */\nexport type SpriteOnDemandStyleImage = {\n    width: number;\n    height: number;\n    x: number;\n    y: number;\n    context: CanvasRenderingContext2D;\n};\n\n/**\n * The style's image metadata\n */\nexport type StyleImageData = {\n    data: RGBAImage;\n    version?: number;\n    hasRenderCallback?: boolean;\n    userImage?: StyleImageInterface;\n    spriteData?: SpriteOnDemandStyleImage;\n};\n\n/**\n * Enumeration of possible values for StyleImageMetadata.textFitWidth and textFitHeight.\n */\nexport const enum TextFit {\n    /**\n     * The image will be resized on the specified axis to tightly fit the content rectangle to target text.\n     * This is the same as not being defined.\n     */\n    stretchOrShrink = 'stretchOrShrink',\n    /**\n     * The image will be resized on the specified axis to fit the content rectangle to the target text, but will not\n     * fall below the aspect ratio of the original content rectangle if the other axis is set to proportional.\n     */\n    stretchOnly = 'stretchOnly',\n    /**\n     * The image will be resized on the specified axis to fit the content rectangle to the target text and\n     * will resize the other axis to maintain the aspect ratio of the content rectangle.\n     */\n    proportional = 'proportional'\n}\n\n/**\n * The style's image metadata\n */\nexport type StyleImageMetadata = {\n    /**\n     * The ratio of pixels in the image to physical pixels on the screen\n     */\n    pixelRatio: number;\n    /**\n     * Whether the image should be interpreted as an SDF image\n     */\n    sdf: boolean;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched horizontally.\n     */\n    stretchX?: Array<[number, number]>;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched vertically.\n     */\n    stretchY?: Array<[number, number]>;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part of the image that can be covered by the content in `text-field`.\n     */\n    content?: [number, number, number, number];\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines constraints on the horizontal scaling of the image.\n     */\n    textFitWidth?: TextFit;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines constraints on the vertical scaling of the image.\n     */\n    textFitHeight?: TextFit;\n};\n\n/**\n * the style's image, including data and metedata\n */\nexport type StyleImage = StyleImageData & StyleImageMetadata;\n\n/**\n * Interface for dynamically generated style images. This is a specification for\n * implementers to model: it is not an exported method or class.\n *\n * Images implementing this interface can be redrawn for every frame. They can be used to animate\n * icons and patterns or make them respond to user input. Style images can implement a\n * {@link StyleImageInterface.render} method. The method is called every frame and\n * can be used to update the image.\n *\n * @see [Add an animated icon to the map.](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-animated/)\n *\n * @example\n * ```ts\n * let flashingSquare = {\n *     width: 64,\n *     height: 64,\n *     data: new Uint8Array(64 * 64 * 4),\n *\n *     onAdd: function(map) {\n *         this.map = map;\n *     },\n *\n *     render: function() {\n *         // keep repainting while the icon is on the map\n *         this.map.triggerRepaint();\n *\n *         // alternate between black and white based on the time\n *         let value = Math.round(Date.now() / 1000) % 2 === 0  ? 255 : 0;\n *\n *         // check if image needs to be changed\n *         if (value !== this.previousValue) {\n *             this.previousValue = value;\n *\n *             let bytesPerPixel = 4;\n *             for (let x = 0; x < this.width; x++) {\n *                 for (let y = 0; y < this.height; y++) {\n *                     let offset = (y * this.width + x) * bytesPerPixel;\n *                     this.data[offset + 0] = value;\n *                     this.data[offset + 1] = value;\n *                     this.data[offset + 2] = value;\n *                     this.data[offset + 3] = 255;\n *                 }\n *             }\n *\n *             // return true to indicate that the image changed\n *             return true;\n *         }\n *     }\n *  }\n *\n *  map.addImage('flashing_square', flashingSquare);\n * ```\n */\n\nexport interface StyleImageInterface {\n    width: number;\n    height: number;\n    data: Uint8Array | Uint8ClampedArray;\n    /**\n     * This method is called once before every frame where the icon will be used.\n     * The method can optionally update the image's `data` member with a new image.\n     *\n     * If the method updates the image it must return `true` to commit the change.\n     * If the method returns `false` or nothing the image is assumed to not have changed.\n     *\n     * If updates are infrequent it maybe easier to use {@link Map.updateImage} to update\n     * the image instead of implementing this method.\n     *\n     * @returns `true` if this method updated the image. `false` if the image was not changed.\n     */\n    render?: () => boolean;\n    /**\n     * Optional method called when the layer has been added to the Map with {@link Map.addImage}.\n     *\n     * @param map - The Map this custom layer was just added to.\n     */\n    onAdd?: (map: Map, id: string) => void;\n    /**\n     * Optional method called when the icon is removed from the map with {@link Map.removeImage}.\n     * This gives the image a chance to clean up resources and event listeners.\n     */\n    onRemove?: () => void;\n}\n\nexport function renderStyleImage(image: StyleImage) {\n    const {userImage} = image;\n    if (userImage && userImage.render) {\n        const updated = userImage.render();\n        if (updated) {\n            image.data.replace(new Uint8Array(userImage.data.buffer));\n            return true;\n        }\n    }\n    return false;\n}\n","/* eslint-disable key-spacing */\nimport potpack from 'potpack';\n\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {RGBAImage} from '../util/image';\nimport {ImagePosition} from './image_atlas';\nimport {Texture} from './texture';\nimport {renderStyleImage} from '../style/style_image';\nimport {warnOnce} from '../util/util';\n\nimport type {StyleImage} from '../style/style_image';\nimport type {Context} from '../gl/context';\nimport type {PotpackBox} from 'potpack';\nimport type {GetImagesResponse} from '../util/actor_messages';\n\ntype Pattern = {\n    bin: PotpackBox;\n    position: ImagePosition;\n};\n\n/**\n * When copied into the atlas texture, image data is padded by one pixel on each side. Icon\n * images are padded with fully transparent pixels, while pattern images are padded with a\n * copy of the image data wrapped from the opposite side. In both cases, this ensures the\n * correct behavior of GL_LINEAR texture sampling mode.\n */\nconst padding = 1;\n\n/**\n * ImageManager does three things:\n *\n * 1. Tracks requests for icon images from tile workers and sends responses when the requests are fulfilled.\n * 2. Builds a texture atlas for pattern images.\n * 3. Rerenders renderable images once per frame\n *\n * These are disparate responsibilities and should eventually be handled by different classes. When we implement\n * data-driven support for `*-pattern`, we'll likely use per-bucket pattern atlases, and that would be a good time\n * to refactor this.\n*/\nexport class ImageManager extends Evented {\n    images: {[_: string]: StyleImage};\n    updatedImages: {[_: string]: boolean};\n    callbackDispatchedThisFrame: {[_: string]: boolean};\n    loaded: boolean;\n    /**\n     * This is used to track requests for images that are not yet available. When the image is loaded,\n     * the requestors will be notified.\n     */\n    requestors: Array<{\n        ids: Array<string>;\n        promiseResolve: (value: GetImagesResponse) => void;\n    }>;\n\n    patterns: {[_: string]: Pattern};\n    atlasImage: RGBAImage;\n    atlasTexture: Texture;\n    dirty: boolean;\n\n    constructor() {\n        super();\n        this.images = {};\n        this.updatedImages = {};\n        this.callbackDispatchedThisFrame = {};\n        this.loaded = false;\n        this.requestors = [];\n\n        this.patterns = {};\n        this.atlasImage = new RGBAImage({width: 1, height: 1});\n        this.dirty = true;\n    }\n\n    destroy() {\n        // Destroy atlas texture if it exists\n        if (this.atlasTexture) {\n            this.atlasTexture.destroy();\n            this.atlasTexture = null;\n        }\n        // Remove all images and patterns\n        for (const id of Object.keys(this.images)) {\n            this.removeImage(id);\n        }\n\n        this.patterns = {};\n        this.atlasImage = new RGBAImage({width: 1, height: 1});\n        this.dirty = true;\n    }\n    isLoaded() {\n        return this.loaded;\n    }\n\n    setLoaded(loaded: boolean) {\n        if (this.loaded === loaded) {\n            return;\n        }\n\n        this.loaded = loaded;\n\n        if (loaded) {\n            for (const {ids, promiseResolve} of this.requestors) {\n                promiseResolve(this._getImagesForIds(ids));\n            }\n            this.requestors = [];\n        }\n    }\n\n    getImage(id: string): StyleImage {\n        const image = this.images[id];\n        // Extract sprite image data on demand\n        if (image && !image.data && image.spriteData) {\n            const spriteData = image.spriteData;\n            image.data = new RGBAImage({\n                width: spriteData.width,\n                height: spriteData.height\n            }, spriteData.context.getImageData(\n                spriteData.x,\n                spriteData.y,\n                spriteData.width,\n                spriteData.height).data);\n            image.spriteData = null;\n        }\n\n        return image;\n    }\n\n    addImage(id: string, image: StyleImage) {\n        if (this.images[id]) throw new Error(`Image id ${id} already exist, use updateImage instead`);\n        if (this._validate(id, image)) {\n            this.images[id] = image;\n        }\n    }\n\n    _validate(id: string, image: StyleImage) {\n        let valid = true;\n        const data = image.data || image.spriteData;\n        if (!this._validateStretch(image.stretchX, data && data.width)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"stretchX\" value`)));\n            valid = false;\n        }\n        if (!this._validateStretch(image.stretchY, data && data.height)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"stretchY\" value`)));\n            valid = false;\n        }\n        if (!this._validateContent(image.content, image)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"content\" value`)));\n            valid = false;\n        }\n        return valid;\n    }\n\n    _validateStretch(stretch: Array<[number, number]>, size: number) {\n        if (!stretch) return true;\n        let last = 0;\n        for (const part of stretch) {\n            if (part[0] < last || part[1] < part[0] || size < part[1]) return false;\n            last = part[1];\n        }\n        return true;\n    }\n\n    _validateContent(content: [number, number, number, number], image: StyleImage) {\n        if (!content) return true;\n        if (content.length !== 4) return false;\n        const spriteData = image.spriteData;\n        const width = (spriteData && spriteData.width) || image.data.width;\n        const height = (spriteData && spriteData.height) || image.data.height;\n        if (content[0] < 0 || width < content[0]) return false;\n        if (content[1] < 0 || height < content[1]) return false;\n        if (content[2] < 0 || width < content[2]) return false;\n        if (content[3] < 0 || height < content[3]) return false;\n        if (content[2] < content[0]) return false;\n        if (content[3] < content[1]) return false;\n        return true;\n    }\n\n    updateImage(id: string, image: StyleImage, validate = true) {\n        const oldImage = this.getImage(id);\n        if (validate && (oldImage.data.width !== image.data.width || oldImage.data.height !== image.data.height)) {\n            throw new Error(`size mismatch between old image (${oldImage.data.width}x${oldImage.data.height}) and new image (${image.data.width}x${image.data.height}).`);\n        }\n        image.version = oldImage.version + 1;\n        this.images[id] = image;\n        this.updatedImages[id] = true;\n    }\n\n    removeImage(id: string) {\n        const image = this.images[id];\n        delete this.images[id];\n        delete this.patterns[id];\n\n        if (image.userImage && image.userImage.onRemove) {\n            image.userImage.onRemove();\n        }\n    }\n\n    listImages(): Array<string> {\n        return Object.keys(this.images);\n    }\n\n    getImages(ids: Array<string>): Promise<GetImagesResponse> {\n        return new Promise<GetImagesResponse>((resolve, _reject) => {\n            // If the sprite has been loaded, or if all the icon dependencies are already present\n            // (i.e. if they've been added via runtime styling), then notify the requestor immediately.\n            // Otherwise, delay notification until the sprite is loaded. At that point, if any of the\n            // dependencies are still unavailable, we'll just assume they are permanently missing.\n            let hasAllDependencies = true;\n            if (!this.isLoaded()) {\n                for (const id of ids) {\n                    if (!this.images[id]) {\n                        hasAllDependencies = false;\n                    }\n                }\n            }\n            if (this.isLoaded() || hasAllDependencies) {\n                resolve(this._getImagesForIds(ids));\n            } else {\n                this.requestors.push({ids, promiseResolve: resolve});\n            }\n        });\n    }\n\n    _getImagesForIds(ids: Array<string>): GetImagesResponse {\n        const response: GetImagesResponse = {};\n\n        for (const id of ids) {\n            let image = this.getImage(id);\n\n            if (!image) {\n                this.fire(new Event('styleimagemissing', {id}));\n                //Try to acquire image again in case styleimagemissing has populated it\n                image = this.getImage(id);\n            }\n\n            if (image) {\n                // Clone the image so that our own copy of its ArrayBuffer doesn't get transferred.\n                response[id] = {\n                    data: image.data.clone(),\n                    pixelRatio: image.pixelRatio,\n                    sdf: image.sdf,\n                    version: image.version,\n                    stretchX: image.stretchX,\n                    stretchY: image.stretchY,\n                    content: image.content,\n                    textFitWidth: image.textFitWidth,\n                    textFitHeight: image.textFitHeight,\n                    hasRenderCallback: Boolean(image.userImage && image.userImage.render)\n                };\n            } else {\n                warnOnce(`Image \"${id}\" could not be loaded. Please make sure you have added the image with map.addImage() or a \"sprite\" property in your style. You can provide missing images by listening for the \"styleimagemissing\" map event.`);\n            }\n        }\n        return response;\n    }\n\n    // Pattern stuff\n\n    getPixelSize() {\n        const {width, height} = this.atlasImage;\n        return {width, height};\n    }\n\n    getPattern(id: string): ImagePosition {\n        const pattern = this.patterns[id];\n\n        const image = this.getImage(id);\n        if (!image) {\n            return null;\n        }\n\n        if (pattern && pattern.position.version === image.version) {\n            return pattern.position;\n        }\n\n        if (!pattern) {\n            const w = image.data.width + padding * 2;\n            const h = image.data.height + padding * 2;\n            const bin = {w, h, x: 0, y: 0};\n            const position = new ImagePosition(bin, image);\n            this.patterns[id] = {bin, position};\n        } else {\n            pattern.position.version = image.version;\n        }\n\n        this._updatePatternAtlas();\n\n        return this.patterns[id].position;\n    }\n\n    bind(context: Context) {\n        const gl = context.gl;\n        if (!this.atlasTexture) {\n            this.atlasTexture = new Texture(context, this.atlasImage, gl.RGBA);\n        } else if (this.dirty) {\n            this.atlasTexture.update(this.atlasImage);\n            this.dirty = false;\n        }\n\n        this.atlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n    }\n\n    _updatePatternAtlas() {\n        const bins = [];\n        for (const id in this.patterns) {\n            bins.push(this.patterns[id].bin);\n        }\n\n        const {w, h} = potpack(bins);\n\n        const dst = this.atlasImage;\n        dst.resize({width: w || 1, height: h || 1});\n\n        for (const id in this.patterns) {\n            const {bin} = this.patterns[id];\n            const x = bin.x + padding;\n            const y = bin.y + padding;\n            const src = this.getImage(id).data;\n            const w = src.width;\n            const h = src.height;\n\n            RGBAImage.copy(src, dst, {x: 0, y: 0}, {x, y}, {width: w, height: h});\n\n            // Add 1 pixel wrapped padding on each side of the image.\n            RGBAImage.copy(src, dst, {x: 0, y: h - 1}, {x, y: y - 1}, {width: w, height: 1}); // T\n            RGBAImage.copy(src, dst, {x: 0, y:     0}, {x, y: y + h}, {width: w, height: 1}); // B\n            RGBAImage.copy(src, dst, {x: w - 1, y: 0}, {x: x - 1, y}, {width: 1, height: h}); // L\n            RGBAImage.copy(src, dst, {x: 0,     y: 0}, {x: x + w, y}, {width: 1, height: h}); // R\n        }\n\n        this.dirty = true;\n    }\n\n    beginFrame() {\n        this.callbackDispatchedThisFrame = {};\n    }\n\n    dispatchRenderCallbacks(ids: Array<string>) {\n        for (const id of ids) {\n\n            // the callback for the image was already dispatched for a different frame\n            if (this.callbackDispatchedThisFrame[id]) continue;\n            this.callbackDispatchedThisFrame[id] = true;\n\n            const image = this.getImage(id);\n            if (!image) warnOnce(`Image with ID: \"${id}\" was not found`);\n\n            const updated = renderStyleImage(image);\n            if (updated) {\n                this.updateImage(id, image);\n            }\n        }\n    }\n\n    cloneImages() {\n        const clonedImages: Record<string, StyleImage> = {};\n        for (const id in this.images) {\n            const image = this.images[id];\n            clonedImages[id] = {\n                ...image,\n                data: image.data ? image.data.clone() : null\n            };\n        }\n        return clonedImages;\n    }\n}\n","const INF = 1e20;\n\nexport default class TinySDF {\n    constructor({\n        fontSize = 24,\n        buffer = 3,\n        radius = 8,\n        cutoff = 0.25,\n        fontFamily = 'sans-serif',\n        fontWeight = 'normal',\n        fontStyle = 'normal',\n        lang = null\n    } = {}) {\n        this.buffer = buffer;\n        this.cutoff = cutoff;\n        this.radius = radius;\n        this.lang = lang;\n\n        // make the canvas size big enough to both have the specified buffer around the glyph\n        // for \"halo\", and account for some glyphs possibly being larger than their font size\n        const size = this.size = fontSize + buffer * 4;\n\n        const canvas = this._createCanvas(size);\n        const ctx = this.ctx = canvas.getContext('2d', {willReadFrequently: true});\n        ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily}`;\n\n        ctx.textBaseline = 'alphabetic';\n        ctx.textAlign = 'left'; // Necessary so that RTL text doesn't have different alignment\n        ctx.fillStyle = 'black';\n\n        // temporary arrays for the distance transform\n        this.gridOuter = new Float64Array(size * size);\n        this.gridInner = new Float64Array(size * size);\n        this.f = new Float64Array(size);\n        this.z = new Float64Array(size + 1);\n        this.v = new Uint16Array(size);\n    }\n\n    _createCanvas(size) {\n        const canvas = document.createElement('canvas');\n        canvas.width = canvas.height = size;\n        return canvas;\n    }\n\n    draw(char) {\n        const {\n            width: glyphAdvance,\n            actualBoundingBoxAscent,\n            actualBoundingBoxDescent,\n            actualBoundingBoxLeft,\n            actualBoundingBoxRight\n        } = this.ctx.measureText(char);\n\n        // The integer/pixel part of the top alignment is encoded in metrics.glyphTop\n        // The remainder is implicitly encoded in the rasterization\n        const glyphTop = Math.ceil(actualBoundingBoxAscent);\n        const glyphLeft = 0;\n\n        // If the glyph overflows the canvas size, it will be clipped at the bottom/right\n        const glyphWidth = Math.max(0, Math.min(this.size - this.buffer, Math.ceil(actualBoundingBoxRight - actualBoundingBoxLeft)));\n        const glyphHeight = Math.min(this.size - this.buffer, glyphTop + Math.ceil(actualBoundingBoxDescent));\n\n        const width = glyphWidth + 2 * this.buffer;\n        const height = glyphHeight + 2 * this.buffer;\n\n        const len = Math.max(width * height, 0);\n        const data = new Uint8ClampedArray(len);\n        const glyph = {data, width, height, glyphWidth, glyphHeight, glyphTop, glyphLeft, glyphAdvance};\n        if (glyphWidth === 0 || glyphHeight === 0) return glyph;\n\n        const {ctx, buffer, gridInner, gridOuter} = this;\n        if (this.lang) ctx.lang = this.lang;\n        ctx.clearRect(buffer, buffer, glyphWidth, glyphHeight);\n        ctx.fillText(char, buffer, buffer + glyphTop);\n        const imgData = ctx.getImageData(buffer, buffer, glyphWidth, glyphHeight);\n\n        // Initialize grids outside the glyph range to alpha 0\n        gridOuter.fill(INF, 0, len);\n        gridInner.fill(0, 0, len);\n\n        for (let y = 0; y < glyphHeight; y++) {\n            for (let x = 0; x < glyphWidth; x++) {\n                const a = imgData.data[4 * (y * glyphWidth + x) + 3] / 255; // alpha value\n                if (a === 0) continue; // empty pixels\n\n                const j = (y + buffer) * width + x + buffer;\n\n                if (a === 1) { // fully drawn pixels\n                    gridOuter[j] = 0;\n                    gridInner[j] = INF;\n\n                } else { // aliased pixels\n                    const d = 0.5 - a;\n                    gridOuter[j] = d > 0 ? d * d : 0;\n                    gridInner[j] = d < 0 ? d * d : 0;\n                }\n            }\n        }\n\n        edt(gridOuter, 0, 0, width, height, width, this.f, this.v, this.z);\n        edt(gridInner, buffer, buffer, glyphWidth, glyphHeight, width, this.f, this.v, this.z);\n\n        for (let i = 0; i < len; i++) {\n            const d = Math.sqrt(gridOuter[i]) - Math.sqrt(gridInner[i]);\n            data[i] = Math.round(255 - 255 * (d / this.radius + this.cutoff));\n        }\n\n        return glyph;\n    }\n}\n\n// 2D Euclidean squared distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/papers/dt-final.pdf\nfunction edt(data, x0, y0, width, height, gridSize, f, v, z) {\n    for (let x = x0; x < x0 + width; x++) edt1d(data, y0 * gridSize + x, gridSize, height, f, v, z);\n    for (let y = y0; y < y0 + height; y++) edt1d(data, y * gridSize + x0, 1, width, f, v, z);\n}\n\n// 1D squared distance transform\nfunction edt1d(grid, offset, stride, length, f, v, z) {\n    v[0] = 0;\n    z[0] = -INF;\n    z[1] = INF;\n    f[0] = grid[offset];\n\n    for (let q = 1, k = 0, s = 0; q < length; q++) {\n        f[q] = grid[offset + q * stride];\n        const q2 = q * q;\n        do {\n            const r = v[k];\n            s = (f[q] - f[r] + q2 - r * r) / (q - r) / 2;\n        } while (s <= z[k] && --k > -1);\n\n        k++;\n        v[k] = q;\n        z[k] = s;\n        z[k + 1] = INF;\n    }\n\n    for (let q = 0, k = 0; q < length; q++) {\n        while (z[k + 1] < q) k++;\n        const r = v[k];\n        const qr = q - r;\n        grid[offset + q * stride] = f[r] + qr * qr;\n    }\n}\n","import {loadGlyphRange} from '../style/load_glyph_range';\n\nimport TinySDF from '@mapbox/tiny-sdf';\nimport {codePointUsesLocalIdeographFontFamily} from '../util/unicode_properties.g';\nimport {AlphaImage} from '../util/image';\nimport {warnOnce} from '../util/util';\n\nimport type {StyleGlyph} from '../style/style_glyph';\nimport type {RequestManager} from '../util/request_manager';\nimport type {GetGlyphsResponse} from '../util/actor_messages';\n\nimport {v8} from '@maplibre/maplibre-gl-style-spec';\n\ntype Entry = {\n    // null means we've requested the range, but the glyph wasn't included in the result.\n    glyphs: {\n        [id: number]: StyleGlyph | null;\n    };\n    requests: {\n        [range: number]: Promise<{[_: number]: StyleGlyph | null}>;\n    };\n    ranges: {\n        [range: number]: boolean | null;\n    };\n    tinySDF?: TinySDF;\n    ideographTinySDF?: TinySDF;\n};\n\n/**\n * The style specification hard-codes some last resort fonts as a default fontstack.\n */\nconst defaultStack = v8.layout_symbol['text-font'].default.join(',');\n/**\n * The CSS generic font family closest to `defaultStack`.\n */\nconst defaultGenericFontFamily = 'sans-serif';\n\n/**\n * Scale factor for client-generated glyphs.\n *\n * Client-generated glyphs are rendered at 2Ã because CJK glyphs are more detailed than others.\n */\nconst textureScale = 2;\n\nexport class GlyphManager {\n    requestManager: RequestManager;\n    localIdeographFontFamily: string | false;\n    entries: {[stack: string]: Entry};\n    url: string;\n    lang?: string;\n\n    // exposed as statics to enable stubbing in unit tests\n    static loadGlyphRange = loadGlyphRange;\n    static TinySDF = TinySDF;\n\n    constructor(requestManager: RequestManager, localIdeographFontFamily?: string | false, lang?: string) {\n        this.requestManager = requestManager;\n        this.localIdeographFontFamily = localIdeographFontFamily;\n        this.entries = {};\n        this.lang = lang;\n    }\n\n    setURL(url?: string | null) {\n        this.url = url;\n    }\n\n    async getGlyphs(glyphs: {[stack: string]: Array<number>}): Promise<GetGlyphsResponse> {\n        const glyphsPromises: Promise<{stack: string; id: number; glyph: StyleGlyph}>[] = [];\n\n        for (const stack in glyphs) {\n            for (const id of glyphs[stack]) {\n                glyphsPromises.push(this._getAndCacheGlyphsPromise(stack, id));\n            }\n        }\n\n        const updatedGlyphs = await Promise.all(glyphsPromises);\n\n        const result: GetGlyphsResponse = {};\n\n        for (const {stack, id, glyph} of updatedGlyphs) {\n            if (!result[stack]) {\n                result[stack] = {};\n            }\n            // Clone the glyph so that our own copy of its ArrayBuffer doesn't get transferred.\n            result[stack][id] = glyph && {\n                id: glyph.id,\n                bitmap: glyph.bitmap.clone(),\n                metrics: glyph.metrics\n            };\n        }\n\n        return result;\n    }\n\n    async _getAndCacheGlyphsPromise(stack: string, id: number): Promise<{stack: string; id: number; glyph: StyleGlyph}> {\n        // Create an entry for this fontstack if it doesnât already exist.\n        let entry = this.entries[stack];\n        if (!entry) {\n            entry = this.entries[stack] = {\n                glyphs: {},\n                requests: {},\n                ranges: {}\n            };\n        }\n\n        // Try to get the glyph from the cache of client-side glyphs by codepoint.\n        let glyph = entry.glyphs[id];\n        if (glyph !== undefined) {\n            return {stack, id, glyph};\n        }\n\n        // If the style hasnât opted into server-side fonts or this codepoint is CJK, draw the glyph locally and cache it.\n        if (!this.url || this._charUsesLocalIdeographFontFamily(id)) {\n            glyph = entry.glyphs[id] = this._drawGlyph(entry, stack, id);\n            return {stack, id, glyph};\n        }\n\n        return await this._downloadAndCacheRangePromise(stack, id);\n    }\n\n    async _downloadAndCacheRangePromise(stack: string, id: number): Promise<{stack: string; id: number; glyph: StyleGlyph}> {\n        // Try to get the glyph from the cache of server-side glyphs by PBF range.\n        const entry = this.entries[stack];\n        const range = Math.floor(id / 256);\n        if (entry.ranges[range]) {\n            return {stack, id, glyph: null};\n        }\n\n        // Start downloading this range unless weâre currently downloading it.\n        if (!entry.requests[range]) {\n            const promise = GlyphManager.loadGlyphRange(stack, range, this.url, this.requestManager);\n            entry.requests[range] = promise;\n        }\n\n        try {\n            // Get the response and cache the glyphs from it.\n            const response = await entry.requests[range];\n            for (const id in response) {\n                entry.glyphs[+id] = response[+id];\n            }\n            entry.ranges[range] = true;\n            return {stack, id, glyph: response[id] || null};\n        } catch (e) {\n            // Fall back to drawing the glyph locally and caching it.\n            const glyph = entry.glyphs[id] = this._drawGlyph(entry, stack, id);\n            this._warnOnMissingGlyphRange(glyph, range, id, e);\n            return {stack, id, glyph};\n        }\n    }\n\n    _warnOnMissingGlyphRange(glyph: StyleGlyph, range: number, id: number, err: Error) {\n        const begin = range * 256;\n        const end = begin + 255;\n        const codePoint = id.toString(16).padStart(4, '0').toUpperCase();\n        warnOnce(`Unable to load glyph range ${range}, ${begin}-${end}. Rendering codepoint U+${codePoint} locally instead. ${err}`);\n    }\n\n    /**\n     * Returns whether the given codepoint should be rendered locally.\n     */\n    _charUsesLocalIdeographFontFamily(id: number): boolean {\n        return !!this.localIdeographFontFamily && codePointUsesLocalIdeographFontFamily(id);\n    }\n\n    /**\n     * Draws a glyph offscreen using TinySDF, creating a TinySDF instance lazily.\n     */\n    _drawGlyph(entry: Entry, stack: string, id: number): StyleGlyph {\n        // The CJK fallback font specified by the developer takes precedence over the last resort fontstack in the style specification.\n        const usesLocalIdeographFontFamily = stack === defaultStack && this.localIdeographFontFamily !== '' && this._charUsesLocalIdeographFontFamily(id);\n\n        // Keep a separate TinySDF instance for when we need to apply the localIdeographFontFamily fallback to keep the font selection from bleeding into non-CJK text.\n        const tinySDFKey = usesLocalIdeographFontFamily ? 'ideographTinySDF' : 'tinySDF';\n        entry[tinySDFKey] ||= this._createTinySDF(usesLocalIdeographFontFamily ? this.localIdeographFontFamily : stack);\n        const char = entry[tinySDFKey].draw(String.fromCodePoint(id));\n\n        /**\n         * TinySDF's \"top\" is the distance from the alphabetic baseline to the top of the glyph.\n         * Server-generated fonts specify \"top\" relative to an origin above the em box (the origin\n         * comes from FreeType, but I'm unclear on exactly how it's derived)\n         * ref: https://github.com/mapbox/sdf-glyph-foundry\n         *\n         * Server fonts don't yet include baseline information, so we can't line up exactly with them\n         * (and they don't line up with each other)\n         * ref: https://github.com/mapbox/node-fontnik/pull/160\n         *\n         * To approximately align TinySDF glyphs with server-provided glyphs, we use this baseline adjustment\n         * factor calibrated to be in between DIN Pro and Arial Unicode (but closer to Arial Unicode)\n         */\n        const topAdjustment = 27.5;\n\n        const leftAdjustment = 0.5;\n\n        // By definition, control characters are invisible and nonspacing.\n        const isControl = /^\\p{gc=Cf}+$/u.test(String.fromCodePoint(id));\n\n        return {\n            id,\n            bitmap: new AlphaImage({width: char.width || 30 * textureScale, height: char.height || 30 * textureScale}, char.data),\n            metrics: {\n                width: isControl ? 0 : (char.glyphWidth / textureScale || 24),\n                height: char.glyphHeight / textureScale || 24,\n                left: (char.glyphLeft / textureScale + leftAdjustment) || 0,\n                top: char.glyphTop / textureScale - topAdjustment || -8,\n                advance: isControl ? 0 : (char.glyphAdvance / textureScale || 24),\n                isDoubleResolution: true\n            }\n        };\n    }\n\n    _createTinySDF(stack: String | false): TinySDF {\n        // Escape and quote the font family list for use in CSS.\n        const fontFamilies = stack ? stack.split(',') : [];\n        fontFamilies.push(defaultGenericFontFamily);\n        const fontFamily = fontFamilies.map(fontName =>\n            /[-\\w]+/.test(fontName) ? fontName : `'${CSS.escape(fontName)}'`\n        ).join(',');\n\n        return new GlyphManager.TinySDF({\n            fontSize: 24 * textureScale,\n            buffer: 3 * textureScale,\n            radius: 8 * textureScale,\n            cutoff: 0.25,\n            fontFamily: fontFamily,\n            fontWeight: this._fontWeight(fontFamilies[0]),\n            fontStyle: this._fontStyle(fontFamilies[0]),\n            lang: this.lang\n        });\n    }\n\n    /**\n     * Sniffs the font style out of a font family name.\n     */\n    _fontStyle(fontFamily: string): string {\n        if (/italic/i.test(fontFamily)) {\n            return 'italic';\n        } else if (/oblique/i.test(fontFamily)) {\n            return 'oblique';\n        }\n        return 'normal';\n    }\n\n    /**\n     * Sniffs the font weight out of a font family name.\n     */\n    _fontWeight(fontFamily: string): string {\n        // Based on the OpenType specification\n        // https://learn.microsoft.com/en-us/typography/opentype/spec/os2#usweightclass\n        const weightsByName = {\n            thin: 100, hairline: 100,\n            'extra light': 200, 'ultra light': 200,\n            light: 300,\n            normal: 400, regular: 400,\n            medium: 500,\n            semibold: 600, demibold: 600,\n            bold: 700,\n            'extra bold': 800, 'ultra bold': 800,\n            black: 900, heavy: 900,\n            'extra black': 950, 'ultra black': 950\n        };\n        let match;\n        for (const [name, weight] of Object.entries(weightsByName)) {\n            if (new RegExp(`\\\\b${name}\\\\b`, 'i').test(fontFamily)) {\n                match = `${weight}`;\n            }\n        }\n        return match;\n    }\n\n    destroy() {\n        for (const stack in this.entries) {\n            const entry = this.entries[stack];\n            if (entry.tinySDF) {\n                entry.tinySDF = null;\n            }\n            if (entry.ideographTinySDF) {\n                entry.ideographTinySDF = null;\n            }\n            entry.glyphs = {};\n            entry.requests = {};\n            entry.ranges = {};\n        }\n        this.entries = {};\n    }\n}\n","import {getArrayBuffer} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\n\nimport {parseGlyphPbf} from './parse_glyph_pbf';\n\nimport type {StyleGlyph} from './style_glyph';\nimport type {RequestManager} from '../util/request_manager';\n\nexport async function loadGlyphRange(fontstack: string,\n    range: number,\n    urlTemplate: string,\n    requestManager: RequestManager): Promise<{[_: number]: StyleGlyph | null}> {\n    const begin = range * 256;\n    const end = begin + 255;\n\n    const request = requestManager.transformRequest(\n        urlTemplate.replace('{fontstack}', fontstack).replace('{range}', `${begin}-${end}`),\n        ResourceType.Glyphs\n    );\n\n    const response = await getArrayBuffer(request, new AbortController());\n    if (!response || !response.data) {\n        throw new Error(`Could not load glyph range. range: ${range}, ${begin}-${end}`);\n    }\n    const glyphs = {};\n\n    for (const glyph of parseGlyphPbf(response.data)) {\n        glyphs[glyph.id] = glyph;\n    }\n\n    return glyphs;\n}\n","import {interpolates, type Color, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {sphericalToCartesian} from '../util/util';\nimport {Evented} from '../util/evented';\nimport {\n    validateStyle,\n    validateLight,\n    emitValidationErrors\n} from './validate_style';\n\nimport type {StylePropertySpecification, LightSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {EvaluationParameters} from './evaluation_parameters';\nimport type {StyleSetterOptions} from '../style/style';\nimport {Properties, Transitionable, type Transitioning, type PossiblyEvaluated, DataConstantProperty, TRANSITION_SUFFIX} from './properties';\n\nimport type {\n    Property,\n    PropertyValue,\n    TransitionParameters\n} from './properties';\n\ntype LightPosition = {\n    x: number;\n    y: number;\n    z: number;\n};\n\nclass LightPositionProperty implements Property<[number, number, number], LightPosition> {\n    specification: StylePropertySpecification;\n\n    constructor() {\n        this.specification = styleSpec.light.position as StylePropertySpecification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<[number, number, number], LightPosition>,\n        parameters: EvaluationParameters\n    ): LightPosition {\n        return sphericalToCartesian(value.expression.evaluate(parameters));\n    }\n\n    interpolate(a: LightPosition, b: LightPosition, t: number): LightPosition {\n        return {\n            x: interpolates.number(a.x, b.x, t),\n            y: interpolates.number(a.y, b.y, t),\n            z: interpolates.number(a.z, b.z, t),\n        };\n    }\n}\n\ntype LightProps = {\n    'anchor': DataConstantProperty<'map' | 'viewport'>;\n    'position': LightPositionProperty;\n    'color': DataConstantProperty<Color>;\n    'intensity': DataConstantProperty<number>;\n};\n\ntype LightPropsPossiblyEvaluated = {\n    'anchor': 'map' | 'viewport';\n    'position': LightPosition;\n    'color': Color;\n    'intensity': number;\n};\n\nlet lightProperties: Properties<LightProps>;\n\n/*\n * Represents the light used to light extruded features.\n */\nexport class Light extends Evented {\n    _transitionable: Transitionable<LightProps>;\n    _transitioning: Transitioning<LightProps>;\n    properties: PossiblyEvaluated<LightProps, LightPropsPossiblyEvaluated>;\n\n    constructor(lightOptions?: LightSpecification) {\n        super();\n        lightProperties = lightProperties || new Properties({\n            'anchor': new DataConstantProperty(styleSpec.light.anchor as StylePropertySpecification),\n            'position': new LightPositionProperty(),\n            'color': new DataConstantProperty(styleSpec.light.color as StylePropertySpecification),\n            'intensity': new DataConstantProperty(styleSpec.light.intensity as StylePropertySpecification),\n        });\n        this._transitionable = new Transitionable(lightProperties, undefined);\n        this.setLight(lightOptions);\n        this._transitioning = this._transitionable.untransitioned();\n    }\n\n    getLight(): LightSpecification {\n        return this._transitionable.serialize();\n    }\n\n    setLight(light?: LightSpecification, options: StyleSetterOptions = {}) {\n        if (this._validate(validateLight, light, options)) {\n            return;\n        }\n\n        for (const name in light) {\n            const value = light[name];\n            if (name.endsWith(TRANSITION_SUFFIX)) {\n                this._transitionable.setTransition(name.slice(0, -TRANSITION_SUFFIX.length) as keyof LightProps, value);\n            } else {\n                this._transitionable.setValue(name as keyof LightProps, value);\n            }\n        }\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition() {\n        return this._transitioning.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    _validate(validate: Function, value: unknown, options?: {\n        validate?: boolean;\n    }) {\n        if (options && options.validate === false) {\n            return false;\n        }\n\n        return emitValidationErrors(this, validate.call(validateStyle, {\n            value,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true},\n            styleSpec\n        }));\n    }\n}\n","import {DataConstantProperty, type PossiblyEvaluated, Properties, TRANSITION_SUFFIX, Transitionable, type Transitioning, type TransitionParameters} from './properties';\nimport {Evented} from '../util/evented';\nimport {EvaluationParameters} from './evaluation_parameters';\nimport {emitValidationErrors, validateSky, validateStyle} from './validate_style';\nimport {extend} from '../util/util';\nimport {type Color, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\nimport {type Mesh} from '../render/mesh';\nimport type {StylePropertySpecification, SkySpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {StyleSetterOptions} from './style';\n\ntype SkyProps = {\n    'sky-color': DataConstantProperty<Color>;\n    'horizon-color': DataConstantProperty<Color>;\n    'fog-color': DataConstantProperty<Color>;\n    'fog-ground-blend': DataConstantProperty<number>;\n    'horizon-fog-blend': DataConstantProperty<number>;\n    'sky-horizon-blend': DataConstantProperty<number>;\n    'atmosphere-blend': DataConstantProperty<number>;\n};\n\ntype SkyPropsPossiblyEvaluated = {\n    'sky-color': Color;\n    'horizon-color': Color;\n    'fog-color': Color;\n    'fog-ground-blend': number;\n    'horizon-fog-blend': number;\n    'sky-horizon-blend': number;\n    'atmosphere-blend': number;\n};\n\nconst properties: Properties<SkyProps> = new Properties({\n    'sky-color': new DataConstantProperty(styleSpec.sky['sky-color'] as StylePropertySpecification),\n    'horizon-color': new DataConstantProperty(styleSpec.sky['horizon-color'] as StylePropertySpecification),\n    'fog-color': new DataConstantProperty(styleSpec.sky['fog-color'] as StylePropertySpecification),\n    'fog-ground-blend': new DataConstantProperty(styleSpec.sky['fog-ground-blend'] as StylePropertySpecification),\n    'horizon-fog-blend': new DataConstantProperty(styleSpec.sky['horizon-fog-blend'] as StylePropertySpecification),\n    'sky-horizon-blend': new DataConstantProperty(styleSpec.sky['sky-horizon-blend'] as StylePropertySpecification),\n    'atmosphere-blend': new DataConstantProperty(styleSpec.sky['atmosphere-blend'] as StylePropertySpecification)\n});\n\nexport class Sky extends Evented {\n    properties: PossiblyEvaluated<SkyProps, SkyPropsPossiblyEvaluated>;\n\n    /**\n     * This is used to cache the gl mesh for the sky, it should be initialized only once.\n     */\n    mesh: Mesh | undefined;\n    atmosphereMesh: Mesh | undefined;\n    _transitionable: Transitionable<SkyProps>;\n    _transitioning: Transitioning<SkyProps>;\n\n    constructor(sky?: SkySpecification) {\n        super();\n        this._transitionable = new Transitionable(properties, undefined);\n        this.setSky(sky);\n        this._transitioning = this._transitionable.untransitioned();\n        this.recalculate(new EvaluationParameters(0));\n    }\n\n    setSky(sky?: SkySpecification, options: StyleSetterOptions = {}) {\n        if (this._validate(validateSky, sky, options)) return;\n\n        if (!sky) {\n            sky = {\n                'sky-color': 'transparent',\n                'horizon-color': 'transparent',\n                'fog-color': 'transparent',\n                'fog-ground-blend': 1,\n                'atmosphere-blend': 0,\n            };\n        }\n\n        for (const name in sky) {\n            const value = sky[name];\n            if (name.endsWith(TRANSITION_SUFFIX)) {\n                this._transitionable.setTransition(name.slice(0, -TRANSITION_SUFFIX.length) as keyof SkyProps, value);\n            } else {\n                this._transitionable.setValue(name as keyof SkyProps, value);\n            }\n        }\n    }\n\n    getSky(): SkySpecification {\n        return this._transitionable.serialize();\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition() {\n        return this._transitioning.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    _validate(validate: Function, value: unknown, options: StyleSetterOptions = {}) {\n        if (options?.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, extend({\n            value,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true},\n            styleSpec\n        })));\n    }\n\n    /**\n     * Currently fog is a very simple implementation, and should only used\n     * to create an atmosphere near the horizon.\n     * But because the fog is drawn from the far-clipping-plane to\n     * map-center, and because the fog does nothing know about the horizon,\n     * this method does a fadeout in respect of pitch. So, when the horizon\n     * gets out of view, which is at about pitch 70, this methods calculates\n     * the corresponding opacity values. Below pitch 60 the fog is completely\n     * invisible.\n     */\n    calculateFogBlendOpacity(pitch: number) {\n        if (pitch < 60) return 0; // disable\n        if (pitch < 70) return (pitch - 60) / 10; // fade in\n        return 1;\n    }\n}\n","import {warnOnce} from '../util/util';\n\nimport type {Context} from '../gl/context';\n\n/**\n * A dash entry\n */\nexport type DashEntry = {\n    y: number;\n    height: number;\n    width: number;\n};\n\n/**\n * @internal\n * A LineAtlas lets us reuse rendered dashed lines\n * by writing many of them to a texture and then fetching their positions\n * using {@link LineAtlas.getDash}.\n *\n * @param width - the width\n * @param height - the height\n */\nexport class LineAtlas {\n    width: number;\n    height: number;\n    nextRow: number;\n    bytes: number;\n    data: Uint8Array;\n    dashEntry: {[_: string]: DashEntry};\n    dirty: boolean;\n    texture: WebGLTexture;\n\n    constructor(width: number, height: number) {\n        this.width = width;\n        this.height = height;\n        this.nextRow = 0;\n\n        this.data = new Uint8Array(this.width * this.height);\n\n        this.dashEntry = {};\n    }\n\n    /**\n     * Get or create a dash line pattern.\n     *\n     * @param dasharray - the key (represented by numbers) to get the dash texture\n     * @param round - whether to add circle caps in between dash segments\n     * @returns position of dash texture in {@link DashEntry}\n     */\n    getDash(dasharray: Array<number>, round: boolean) {\n        const key = dasharray.join(',') + String(round);\n\n        if (!this.dashEntry[key]) {\n            this.dashEntry[key] = this.addDash(dasharray, round);\n        }\n        return this.dashEntry[key];\n    }\n\n    getDashRanges(dasharray: Array<number>, lineAtlasWidth: number, stretch: number) {\n        // If dasharray has an odd length, both the first and last parts\n        // are dashes and should be joined seamlessly.\n        const oddDashArray = dasharray.length % 2 === 1;\n\n        const ranges = [];\n\n        let left = oddDashArray ? -dasharray[dasharray.length - 1] * stretch : 0;\n        let right = dasharray[0] * stretch;\n        let isDash = true;\n\n        ranges.push({left, right, isDash, zeroLength: dasharray[0] === 0});\n\n        let currentDashLength = dasharray[0];\n        for (let i = 1; i < dasharray.length; i++) {\n            isDash = !isDash;\n\n            const dashLength = dasharray[i];\n            left = currentDashLength * stretch;\n            currentDashLength += dashLength;\n            right = currentDashLength * stretch;\n\n            ranges.push({left, right, isDash, zeroLength: dashLength === 0});\n        }\n\n        return ranges;\n    }\n\n    addRoundDash(ranges: any, stretch: number, n: number) {\n        const halfStretch = stretch / 2;\n\n        for (let y = -n; y <= n; y++) {\n            const row = this.nextRow + n + y;\n            const index = this.width * row;\n            let currIndex = 0;\n            let range = ranges[currIndex];\n\n            for (let x = 0; x < this.width; x++) {\n                if (x / range.right > 1) { range = ranges[++currIndex]; }\n\n                const distLeft = Math.abs(x - range.left);\n                const distRight = Math.abs(x - range.right);\n                const minDist = Math.min(distLeft, distRight);\n                let signedDistance;\n\n                const distMiddle =  y / n * (halfStretch + 1);\n                if (range.isDash) {\n                    const distEdge = halfStretch - Math.abs(distMiddle);\n                    signedDistance = Math.sqrt(minDist * minDist + distEdge * distEdge);\n                } else {\n                    signedDistance = halfStretch - Math.sqrt(minDist * minDist + distMiddle * distMiddle);\n                }\n\n                this.data[index + x] = Math.max(0, Math.min(255, signedDistance + 128));\n            }\n        }\n    }\n\n    addRegularDash(ranges: any) {\n\n        // Collapse any zero-length range\n        // Collapse neighbouring same-type parts into a single part\n        for (let i = ranges.length - 1; i >= 0; --i) {\n            const part = ranges[i];\n            const next = ranges[i + 1];\n            if (part.zeroLength) {\n                ranges.splice(i, 1);\n            } else if (next && next.isDash === part.isDash) {\n                next.left = part.left;\n                ranges.splice(i, 1);\n            }\n        }\n\n        // Combine the first and last parts if possible\n        const first = ranges[0];\n        const last = ranges[ranges.length - 1];\n        if (first.isDash === last.isDash) {\n            first.left = last.left - this.width;\n            last.right = first.right + this.width;\n        }\n\n        const index = this.width * this.nextRow;\n        let currIndex = 0;\n        let range = ranges[currIndex];\n\n        for (let x = 0; x < this.width; x++) {\n            if (x / range.right > 1) {\n                range = ranges[++currIndex];\n            }\n\n            const distLeft = Math.abs(x - range.left);\n            const distRight = Math.abs(x - range.right);\n\n            const minDist = Math.min(distLeft, distRight);\n            const signedDistance = range.isDash ? minDist : -minDist;\n\n            this.data[index + x] = Math.max(0, Math.min(255, signedDistance + 128));\n        }\n    }\n\n    addDash(dasharray: Array<number>, round: boolean): DashEntry {\n        const n = round ? 7 : 0;\n        const height = 2 * n + 1;\n\n        if (this.nextRow + height > this.height) {\n            warnOnce('LineAtlas out of space');\n            return null;\n        }\n\n        let length = 0;\n        for (let i = 0; i < dasharray.length; i++) { length += dasharray[i]; }\n\n        if (length !== 0) {\n            const stretch = this.width / length;\n            const ranges = this.getDashRanges(dasharray, this.width, stretch);\n\n            if (round) {\n                this.addRoundDash(ranges, stretch, n);\n            } else {\n                this.addRegularDash(ranges);\n            }\n        }\n\n        const dashEntry = {\n            y: this.nextRow + n,\n            height: 2 * n,\n            width: length\n        };\n\n        this.nextRow += height;\n        this.dirty = true;\n\n        return dashEntry;\n    }\n\n    bind(context: Context) {\n        const gl = context.gl;\n        if (!this.texture) {\n            this.texture = gl.createTexture();\n            gl.bindTexture(gl.TEXTURE_2D, this.texture);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, this.width, this.height, 0, gl.ALPHA, gl.UNSIGNED_BYTE, this.data);\n\n        } else {\n            gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n            if (this.dirty) {\n                this.dirty = false;\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.width, this.height, gl.ALPHA, gl.UNSIGNED_BYTE, this.data);\n            }\n        }\n    }\n}\n","import {workerFactory} from './web_worker';\nimport {browser} from './browser';\nimport {isSafari} from './util';\nimport {type ActorTarget} from './actor';\n\nexport const PRELOAD_POOL_ID = 'maplibre_preloaded_worker_pool';\n\n/**\n * Constructs a worker pool.\n */\nexport class WorkerPool {\n    static workerCount: number;\n\n    active: {\n        [_ in number | string]: boolean;\n    };\n    workers: Array<ActorTarget>;\n\n    constructor() {\n        this.active = {};\n    }\n\n    acquire(mapId: number | string): Array<ActorTarget> {\n        if (!this.workers) {\n            // Lazily look up the value of getWorkerCount so that\n            // client code has had a chance to set it.\n            this.workers = [];\n            while (this.workers.length < WorkerPool.workerCount) {\n                this.workers.push(workerFactory());\n            }\n        }\n\n        this.active[mapId] = true;\n        return this.workers.slice();\n    }\n\n    release(mapId: number | string) {\n        delete this.active[mapId];\n        if (this.numActive() === 0) {\n            this.workers.forEach((w) => {\n                w.terminate();\n            });\n            this.workers = null;\n        }\n    }\n\n    isPreloaded(): boolean {\n        return !!this.active[PRELOAD_POOL_ID];\n    }\n\n    numActive(): number {\n        return Object.keys(this.active).length;\n    }\n}\n\n// Based on results from A/B testing: https://github.com/maplibre/maplibre-gl-js/pull/2354\nconst availableLogicalProcessors = Math.floor(browser.hardwareConcurrency / 2);\nWorkerPool.workerCount = isSafari(globalThis) ? Math.max(Math.min(availableLogicalProcessors, 3), 1) : 1;\n","import {type AddProtocolAction, config} from './config';\nimport type {default as MaplibreWorker} from '../source/worker';\nimport type {WorkerSourceConstructor} from '../source/worker_source';\n\nexport interface WorkerGlobalScopeInterface {\n    importScripts(...urls: Array<string>): void;\n    registerWorkerSource: (sourceName: string, sourceConstructor: WorkerSourceConstructor) => void;\n    registerRTLTextPlugin: (_: any) => void;\n    addProtocol: (customProtocol: string, loadFn: AddProtocolAction) => void;\n    removeProtocol: (customProtocol: string) => void;\n    worker: MaplibreWorker;\n}\n\nexport function workerFactory() {\n    return new Worker(config.WORKER_URL);\n}\n","import {WorkerPool, PRELOAD_POOL_ID} from './worker_pool';\n\nlet globalWorkerPool;\n\n/**\n * Creates (if necessary) and returns the single, global WorkerPool instance\n * to be shared across each Map\n */\nexport function getGlobalWorkerPool() {\n    if (!globalWorkerPool) {\n        globalWorkerPool = new WorkerPool();\n    }\n    return globalWorkerPool;\n}\n\n/**\n * Initializes resources like WebWorkers that can be shared across maps to lower load\n * times in some situations. `setWorkerUrl()` and `setWorkerCount()`, if being\n * used, must be set before `prewarm()` is called to have an effect.\n *\n * By default, the lifecycle of these resources is managed automatically, and they are\n * lazily initialized when a Map is first created. By invoking `prewarm()`, these\n * resources will be created ahead of time, and will not be cleared when the last Map\n * is removed from the page. This allows them to be re-used by new Map instances that\n * are created later. They can be manually cleared by calling\n * `clearPrewarmedResources()`. This is only necessary if your web page remains\n * active but stops using maps altogether.\n *\n * This is primarily useful when using GL-JS maps in a single page app, wherein a user\n * would navigate between various views that can cause Map instances to constantly be\n * created and destroyed.\n *\n * @example\n * ```ts\n * prewarm()\n * ```\n */\nexport function prewarm() {\n    const workerPool = getGlobalWorkerPool();\n    workerPool.acquire(PRELOAD_POOL_ID);\n}\n\n/**\n * Clears up resources that have previously been created by `prewarm()`.\n * Note that this is typically not necessary. You should only call this function\n * if you expect the user of your app to not return to a Map view at any point\n * in your application.\n *\n * @example\n * ```ts\n * clearPrewarmedResources()\n * ```\n */\nexport function clearPrewarmedResources() {\n    const pool = globalWorkerPool;\n    if (pool) {\n        // Remove the pool only if all maps that referenced the preloaded global worker pool have been removed.\n        if (pool.isPreloaded() && pool.numActive() === 1) {\n            pool.release(PRELOAD_POOL_ID);\n            globalWorkerPool = null;\n        } else {\n            console.warn('Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()');\n        }\n    }\n}\n","import {Actor, type MessageHandler} from './actor';\nimport {getGlobalWorkerPool} from './global_worker_pool';\nimport {GLOBAL_DISPATCHER_ID, makeRequest} from './ajax';\n\nimport type {WorkerPool} from './worker_pool';\nimport type {RequestResponseMessageMap} from './actor_messages';\nimport {MessageType} from './actor_messages';\n\n/**\n * Responsible for sending messages from a {@link Source} to an associated worker source (usually with the same name).\n */\nexport class Dispatcher {\n    workerPool: WorkerPool;\n    actors: Array<Actor>;\n    currentActor: number;\n    id: string | number;\n\n    constructor(workerPool: WorkerPool, mapId: string | number) {\n        this.workerPool = workerPool;\n        this.actors = [];\n        this.currentActor = 0;\n        this.id = mapId;\n        const workers = this.workerPool.acquire(mapId);\n        for (let i = 0; i < workers.length; i++) {\n            const worker = workers[i];\n            const actor = new Actor(worker, mapId);\n            actor.name = `Worker ${i}`;\n            this.actors.push(actor);\n        }\n        if (!this.actors.length) throw new Error('No actors found');\n    }\n\n    /**\n     * Broadcast a message to all Workers.\n     */\n    broadcast<T extends MessageType>(type: T, data: RequestResponseMessageMap[T][0]): Promise<RequestResponseMessageMap[T][1][]> {\n        const promises: Promise<RequestResponseMessageMap[T][1]>[] = [];\n        for (const actor of this.actors) {\n            promises.push(actor.sendAsync({type, data}));\n        }\n        return Promise.all(promises);\n    }\n\n    /**\n     * Acquires an actor to dispatch messages to. The actors are distributed in round-robin fashion.\n     * @returns An actor object backed by a web worker for processing messages.\n     */\n    getActor(): Actor {\n        this.currentActor = (this.currentActor + 1) % this.actors.length;\n        return this.actors[this.currentActor];\n    }\n\n    remove(mapRemoved: boolean = true) {\n        this.actors.forEach((actor) => { actor.remove(); });\n        this.actors = [];\n        if (mapRemoved) this.workerPool.release(this.id);\n    }\n\n    public registerMessageHandler<T extends MessageType>(type: T, handler: MessageHandler<T>) {\n        for (const actor of this.actors) {\n            actor.registerMessageHandler(type, handler);\n        }\n    }\n\n    public unregisterMessageHandler<T extends MessageType>(type: T) {\n        for (const actor of this.actors) {\n            actor.unregisterMessageHandler(type);\n        }\n    }\n}\n\nlet globalDispatcher: Dispatcher;\n\nexport function getGlobalDispatcher(): Dispatcher {\n    if (!globalDispatcher) {\n        globalDispatcher = new Dispatcher(getGlobalWorkerPool(), GLOBAL_DISPATCHER_ID);\n        globalDispatcher.registerMessageHandler(MessageType.getResource, (_mapId, params, abortController) => {\n            return makeRequest(params, abortController);\n        });\n    }\n    return globalDispatcher;\n}\n","import {mat4} from 'gl-matrix';\nimport type Point from '@mapbox/point-geometry';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CollisionIndex} from '../symbol/collision_index';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {RetainedQueryData} from '../symbol/placement';\nimport type {FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {GeoJSONFeature, MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {QueryResults, QueryResultsItem} from '../data/feature_index';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\ntype RenderedFeatureLayer = {\n    wrappedTileID: string;\n    queryResults: QueryResults;\n};\n\n/**\n * Options to pass to query the map for the rendered features\n */\nexport type QueryRenderedFeaturesOptions = {\n    /**\n     * An array or set of [style layer IDs](https://maplibre.org/maplibre-style-spec/#layer-id) for the query to inspect.\n     * Only features within these layers will be returned. If this parameter is undefined, all layers will be checked.\n     */\n    layers?: Array<string> | Set<string>;\n    /**\n     * A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter) to limit query results.\n     */\n    filter?: FilterSpecification;\n    /**\n     * An array of string representing the available images\n     */\n    availableImages?: Array<string>;\n    /**\n     * Whether to check if the [options.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     */\n    validate?: boolean;\n};\n\n/**\n * @internal\n * A version of QueryRenderedFeaturesOptions used internally\n */\nexport type QueryRenderedFeaturesOptionsStrict = Omit<QueryRenderedFeaturesOptions, 'layers'> & {\n    layers: Set<string> | null;\n    globalState?: Record<string, any>;\n};\n\n/**\n * The options object related to the {@link Map.querySourceFeatures} method\n */\nexport type QuerySourceFeatureOptions = {\n    /**\n     * The name of the source layer to query. *For vector tile sources, this parameter is required.* For GeoJSON sources, it is ignored.\n     */\n    sourceLayer?: string;\n    /**\n     * A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)\n     * to limit query results.\n     */\n    filter?: FilterSpecification;\n    /**\n     * Whether to check if the [parameters.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     * @defaultValue true\n     */\n    validate?: boolean;\n};\n\n/**\n * @internal\n * A version of QuerySourceFeatureOptions used internally\n */\nexport type QuerySourceFeatureOptionsStrict = QuerySourceFeatureOptions & {\n    globalState?: Record<string, any>;\n};\n\nexport type QueryRenderedFeaturesResults = {\n    [key: string]: QueryRenderedFeaturesResultsItem[];\n};\n\nexport type QueryRenderedFeaturesResultsItem = QueryResultsItem & { feature: MapGeoJSONFeature };\n\n/*\n * Returns a matrix that can be used to convert from tile coordinates to viewport pixel coordinates.\n */\nfunction getPixelPosMatrix(transform, tileID: OverscaledTileID) {\n    const t = mat4.create();\n    mat4.translate(t, t, [1, 1, 0]);\n    mat4.scale(t, t, [transform.width * 0.5, transform.height * 0.5, 1]);\n    if (transform.calculatePosMatrix) { // Globe: TODO: remove this hack once queryRendererFeatures supports globe properly\n        return mat4.multiply(t, t, transform.calculatePosMatrix(tileID.toUnwrapped()));\n    } else {\n        return t;\n    }\n}\n\nfunction queryIncludes3DLayer(layers: Set<string> | undefined, styleLayers: {[_: string]: StyleLayer}, sourceID: string) {\n    if (layers) {\n        for (const layerID of layers) {\n            const layer = styleLayers[layerID];\n            if (layer && layer.source === sourceID && layer.type === 'fill-extrusion') {\n                return true;\n            }\n        }\n    } else {\n        for (const key in styleLayers) {\n            const layer = styleLayers[key];\n            if (layer.source === sourceID && layer.type === 'fill-extrusion') {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nexport function queryRenderedFeatures(\n    tileManager: TileManager,\n    styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: any},\n    queryGeometry: Array<Point>,\n    params: QueryRenderedFeaturesOptionsStrict | undefined,\n    transform: IReadonlyTransform,\n    getElevation: undefined | ((id: OverscaledTileID, x: number, y: number) => number)\n): QueryRenderedFeaturesResults {\n\n    const has3DLayer = queryIncludes3DLayer(params?.layers ?? null, styleLayers, tileManager.id);\n    const maxPitchScaleFactor = transform.maxPitchScaleFactor();\n    const tilesIn = tileManager.tilesIn(queryGeometry, maxPitchScaleFactor, has3DLayer);\n\n    tilesIn.sort(sortTilesIn);\n    const renderedFeatureLayers: RenderedFeatureLayer[] = [];\n    for (const tileIn of tilesIn) {\n        renderedFeatureLayers.push({\n            wrappedTileID: tileIn.tileID.wrapped().key,\n            queryResults: tileIn.tile.queryRenderedFeatures(\n                styleLayers,\n                serializedLayers,\n                tileManager.getState(),\n                tileIn.queryGeometry,\n                tileIn.cameraQueryGeometry,\n                tileIn.scale,\n                params,\n                transform,\n                maxPitchScaleFactor,\n                getPixelPosMatrix(transform, tileIn.tileID),\n                getElevation ? (x: number, y: number) => getElevation(tileIn.tileID, x, y) : undefined,\n            )\n        });\n    }\n\n    const result = mergeRenderedFeatureLayers(renderedFeatureLayers);\n\n    return convertFeaturesToMapFeatures(result, tileManager);\n}\n\nexport function queryRenderedSymbols(styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: StyleLayer},\n    tileManagers: {[_: string]: TileManager},\n    queryGeometry: Array<Point>,\n    params: QueryRenderedFeaturesOptionsStrict,\n    collisionIndex: CollisionIndex,\n    retainedQueryData: {\n        [_: number]: RetainedQueryData;\n    }): QueryRenderedFeaturesResults {\n    const result: QueryResults = {};\n    const renderedSymbols = collisionIndex.queryRenderedSymbols(queryGeometry);\n    const bucketQueryData: RetainedQueryData[] = [];\n    for (const bucketInstanceId of Object.keys(renderedSymbols).map(Number)) {\n        bucketQueryData.push(retainedQueryData[bucketInstanceId]);\n    }\n    bucketQueryData.sort(sortTilesIn);\n\n    for (const queryData of bucketQueryData) {\n        const bucketSymbols = queryData.featureIndex.lookupSymbolFeatures(\n            renderedSymbols[queryData.bucketInstanceId],\n            serializedLayers,\n            queryData.bucketIndex,\n            queryData.sourceLayerIndex,\n            {\n                filterSpec: params.filter,\n                globalState: params.globalState\n            },\n            params.layers,\n            params.availableImages,\n            styleLayers);\n\n        for (const layerID in bucketSymbols) {\n            const resultFeatures = result[layerID] = result[layerID] || [];\n            const layerSymbols = bucketSymbols[layerID];\n            layerSymbols.sort((a, b) => {\n                // Match topDownFeatureComparator from FeatureIndex, but using\n                // most recent sorting of features from bucket.sortFeatures\n                const featureSortOrder = queryData.featureSortOrder;\n                if (featureSortOrder) {\n                    // queryRenderedSymbols documentation says we'll return features in\n                    // \"top-to-bottom\" rendering order (aka last-to-first).\n                    // Actually there can be multiple symbol instances per feature, so\n                    // we sort each feature based on the first matching symbol instance.\n                    const sortedA = featureSortOrder.indexOf(a.featureIndex);\n                    const sortedB = featureSortOrder.indexOf(b.featureIndex);\n                    return sortedB - sortedA;\n                } else {\n                    // Bucket hasn't been re-sorted based on angle, so use the\n                    // reverse of the order the features appeared in the data.\n                    return b.featureIndex - a.featureIndex;\n                }\n            });\n            for (const symbolFeature of layerSymbols) {\n                resultFeatures.push(symbolFeature);\n            }\n        }\n    }\n\n    return convertFeaturesToMapFeaturesMultiple(result, styleLayers, tileManagers);\n}\n\nexport function querySourceFeatures(tileManager: TileManager, params: QuerySourceFeatureOptionsStrict | undefined): GeoJSONFeature[] {\n    const tiles = tileManager.getRenderableIds().map((id) => {\n        return tileManager.getTileByID(id);\n    });\n\n    const result: GeoJSONFeature[] = [];\n\n    const dataTiles = {};\n    for (let i = 0; i < tiles.length; i++) {\n        const tile = tiles[i];\n        const dataID = tile.tileID.canonical.key;\n        if (!dataTiles[dataID]) {\n            dataTiles[dataID] = true;\n            tile.querySourceFeatures(result, params);\n        }\n    }\n\n    return result;\n}\n\nfunction sortTilesIn(a: {tileID: OverscaledTileID}, b: {tileID: OverscaledTileID}) {\n    const idA = a.tileID;\n    const idB = b.tileID;\n    return (idA.overscaledZ - idB.overscaledZ) || (idA.canonical.y - idB.canonical.y) || (idA.wrap - idB.wrap) || (idA.canonical.x - idB.canonical.x);\n}\n\nfunction mergeRenderedFeatureLayers(tiles: RenderedFeatureLayer[]): QueryResults {\n    // Merge results from all tiles, but if two tiles share the same\n    // wrapped ID, don't duplicate features between the two tiles\n    const result: QueryResults = {};\n    const wrappedIDLayerMap = {};\n    for (const tile of tiles) {\n        const queryResults = tile.queryResults;\n        const wrappedID = tile.wrappedTileID;\n        const wrappedIDLayers = wrappedIDLayerMap[wrappedID] = wrappedIDLayerMap[wrappedID] || {};\n        for (const layerID in queryResults) {\n            const tileFeatures = queryResults[layerID];\n            const wrappedIDFeatures = wrappedIDLayers[layerID] = wrappedIDLayers[layerID] || {};\n            const resultFeatures = result[layerID] = result[layerID] || [];\n            for (const tileFeature of tileFeatures) {\n                if (!wrappedIDFeatures[tileFeature.featureIndex]) {\n                    wrappedIDFeatures[tileFeature.featureIndex] = true;\n                    resultFeatures.push(tileFeature);\n                }\n            }\n        }\n    }\n    return result;\n}\n\nfunction convertFeaturesToMapFeatures(result: QueryResults, tileManager: TileManager): QueryRenderedFeaturesResults {\n    // Merge state from TileManager into the results\n    for (const layerID in result) {\n        for (const featureWrapper of result[layerID]) {\n            convertFeatureToMapFeature(featureWrapper, tileManager);\n        };\n    }\n    return result as QueryRenderedFeaturesResults;\n}\n\nfunction convertFeaturesToMapFeaturesMultiple(result: QueryResults, styleLayers: {[_: string]: StyleLayer}, tileManagers: {[_: string]: TileManager}): QueryRenderedFeaturesResults {\n    // Merge state from TileManager into the results\n    for (const layerName in result) {\n        for (const featureWrapper of result[layerName]) {\n            const layer = styleLayers[layerName];\n            const tileManager = tileManagers[layer.source];\n            convertFeatureToMapFeature(featureWrapper, tileManager);\n        };\n    }\n    return result as QueryRenderedFeaturesResults;\n}\n\nfunction convertFeatureToMapFeature(featureWrapper: QueryResultsItem, tileManager: TileManager) {\n    const feature = featureWrapper.feature as MapGeoJSONFeature;\n    const state = tileManager.getFeatureState(feature.layer['source-layer'], feature.id);\n    feature.source = feature.layer.source;\n    if (feature.layer['source-layer']) {\n        feature.sourceLayer = feature.layer['source-layer'];\n    }\n    feature.state = state;\n}\n","import {pick, extend, type TileJSON} from '../util/util';\nimport {getJSON} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\n\nimport type {RequestManager} from '../util/request_manager';\nimport type {RasterDEMSourceSpecification, RasterSourceSpecification, VectorSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LoadTileJsonResponse = {\n    tiles: Array<string>;\n    minzoom: number;\n    maxzoom: number;\n    attribution: string;\n    bounds: RasterSourceSpecification['bounds'];\n    scheme: RasterSourceSpecification['scheme'];\n    tileSize: number;\n    encoding: RasterDEMSourceSpecification['encoding'];\n    vectorLayerIds?: Array<string>;\n};\n\nexport async function loadTileJson(\n    options: RasterSourceSpecification | RasterDEMSourceSpecification | VectorSourceSpecification,\n    requestManager: RequestManager,\n    abortController: AbortController,\n    targetWindow?: Window,\n): Promise<LoadTileJsonResponse | null> {\n    let tileJSON: TileJSON | typeof options = options;\n    if (options.url) {\n        const response = await getJSON<TileJSON>(requestManager.transformRequest(options.url, ResourceType.Source), abortController);\n        tileJSON = response.data;\n    } else {\n        await browser.frameAsync(abortController, targetWindow);\n    }\n    if (!tileJSON) {\n        return null;\n    }\n    const result = pick(\n        // explicit source options take precedence over TileJSON\n        extend(tileJSON, options),\n        ['tiles', 'minzoom', 'maxzoom', 'attribution', 'bounds', 'scheme', 'tileSize', 'encoding']\n    ) as LoadTileJsonResponse;\n\n    if ('vector_layers' in tileJSON && tileJSON.vector_layers) {\n        result.vectorLayerIds = tileJSON.vector_layers.map((layer) => { return layer.id; });\n    }\n\n    return result;\n}\n","import {LngLat} from './lng_lat';\nimport type {LngLatLike} from './lng_lat';\nimport {wrap} from '../util/util';\n\n/**\n * A {@link LngLatBounds} object, an array of {@link LngLatLike} objects in [sw, ne] order,\n * or an array of numbers in [west, south, east, north] order.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let v1 = new LngLatBounds(\n *   new LngLat(-73.9876, 40.7661),\n *   new LngLat(-73.9397, 40.8002)\n * );\n * let v2 = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002])\n * let v3 = [[-73.9876, 40.7661], [-73.9397, 40.8002]];\n * ```\n */\nexport type LngLatBoundsLike = LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number];\n\n/**\n * A `LngLatBounds` object represents a geographical bounding box,\n * defined by its southwest and northeast points in longitude and latitude.\n *\n * If no arguments are provided to the constructor, a `null` bounding box is created.\n *\n * Note that any Mapbox GL method that accepts a `LngLatBounds` object as an argument or option\n * can also accept an `Array` of two {@link LngLatLike} constructs and will perform an implicit conversion.\n * This flexible type is documented as {@link LngLatBoundsLike}.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let sw = new LngLat(-73.9876, 40.7661);\n * let ne = new LngLat(-73.9397, 40.8002);\n * let llb = new LngLatBounds(sw, ne);\n * ```\n */\nexport class LngLatBounds {\n    _ne: LngLat;\n    _sw: LngLat;\n\n    /**\n     * @param sw - The southwest corner of the bounding box.\n     * OR array of 4 numbers in the order of  west, south, east, north\n     * OR array of 2 LngLatLike: [sw,ne]\n     * @param ne - The northeast corner of the bounding box.\n     * @example\n     * ```ts\n     * let sw = new LngLat(-73.9876, 40.7661);\n     * let ne = new LngLat(-73.9397, 40.8002);\n     * let llb = new LngLatBounds(sw, ne);\n     * ```\n     * OR\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661, -73.9397, 40.8002]);\n     * ```\n     * OR\n     * ```ts\n     * let llb = new LngLatBounds([sw, ne]);\n     * ```\n     */\n    constructor(sw?: LngLatLike | [number, number, number, number] | [LngLatLike, LngLatLike], ne?: LngLatLike) {\n        if (!sw) {\n            // noop\n        } else if (ne) {\n            this.setSouthWest(<LngLatLike>sw).setNorthEast(ne);\n        } else if (Array.isArray(sw)) {\n            if (sw.length === 4) {\n            // 4 element array: west, south, east, north\n                this.setSouthWest([sw[0], sw[1]]).setNorthEast([sw[2], sw[3]]);\n            } else {\n                this.setSouthWest(sw[0] as LngLatLike).setNorthEast(sw[1] as LngLatLike);\n            }\n        }\n    }\n\n    /**\n     * Set the northeast corner of the bounding box\n     *\n     * @param ne - a {@link LngLatLike} object describing the northeast corner of the bounding box.\n     */\n    setNorthEast(ne: LngLatLike): this {\n        this._ne = ne instanceof LngLat ? new LngLat(ne.lng, ne.lat) : LngLat.convert(ne);\n        return this;\n    }\n\n    /**\n     * Set the southwest corner of the bounding box\n     *\n     * @param sw - a {@link LngLatLike} object describing the southwest corner of the bounding box.\n     */\n    setSouthWest(sw: LngLatLike): this {\n        this._sw = sw instanceof LngLat ? new LngLat(sw.lng, sw.lat) : LngLat.convert(sw);\n        return this;\n    }\n\n    /**\n     * Extend the bounds to include a given LngLatLike or LngLatBoundsLike.\n     *\n     * @param obj - object to extend to\n     */\n    extend(obj: LngLatLike | LngLatBoundsLike): this {\n        const sw = this._sw,\n            ne = this._ne;\n        let sw2, ne2;\n\n        if (obj instanceof LngLat) {\n            sw2 = obj;\n            ne2 = obj;\n\n        } else if (obj instanceof LngLatBounds) {\n            sw2 = obj._sw;\n            ne2 = obj._ne;\n\n            if (!sw2 || !ne2) return this;\n\n        } else {\n            if (Array.isArray(obj)) {\n                if (obj.length === 4 || (obj as any[]).every(Array.isArray)) {\n                    const lngLatBoundsObj = (obj as any as LngLatBoundsLike);\n                    return this.extend(LngLatBounds.convert(lngLatBoundsObj));\n                } else {\n                    const lngLatObj = (obj as any as LngLatLike);\n                    return this.extend(LngLat.convert(lngLatObj));\n                }\n\n            } else if (obj && ('lng' in obj || 'lon' in obj) && 'lat' in obj) {\n                return this.extend(LngLat.convert(obj));\n            }\n\n            return this;\n        }\n\n        if (!sw && !ne) {\n            this._sw = new LngLat(sw2.lng, sw2.lat);\n            this._ne = new LngLat(ne2.lng, ne2.lat);\n\n        } else {\n            sw.lng = Math.min(sw2.lng, sw.lng);\n            sw.lat = Math.min(sw2.lat, sw.lat);\n            ne.lng = Math.max(ne2.lng, ne.lng);\n            ne.lat = Math.max(ne2.lat, ne.lat);\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns the geographical coordinate equidistant from the bounding box's corners.\n     *\n     * @returns The bounding box's center.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}\n     * ```\n     */\n    getCenter(): LngLat {\n        return new LngLat((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2);\n    }\n\n    /**\n     * Returns the southwest corner of the bounding box.\n     *\n     * @returns The southwest corner of the bounding box.\n     */\n    getSouthWest(): LngLat { return this._sw; }\n\n    /**\n     * Returns the northeast corner of the bounding box.\n     *\n     * @returns The northeast corner of the bounding box.\n     */\n    getNorthEast(): LngLat { return this._ne; }\n\n    /**\n     * Returns the northwest corner of the bounding box.\n     *\n     * @returns The northwest corner of the bounding box.\n     */\n    getNorthWest(): LngLat { return new LngLat(this.getWest(), this.getNorth()); }\n\n    /**\n     * Returns the southeast corner of the bounding box.\n     *\n     * @returns The southeast corner of the bounding box.\n     */\n    getSouthEast(): LngLat { return new LngLat(this.getEast(), this.getSouth()); }\n\n    /**\n     * Returns the west edge of the bounding box.\n     *\n     * @returns The west edge of the bounding box.\n     */\n    getWest(): number { return this._sw.lng; }\n\n    /**\n     * Returns the south edge of the bounding box.\n     *\n     * @returns The south edge of the bounding box.\n     */\n    getSouth(): number { return this._sw.lat; }\n\n    /**\n     * Returns the east edge of the bounding box.\n     *\n     * @returns The east edge of the bounding box.\n     */\n    getEast(): number { return this._ne.lng; }\n\n    /**\n     * Returns the north edge of the bounding box.\n     *\n     * @returns The north edge of the bounding box.\n     */\n    getNorth(): number { return this._ne.lat; }\n\n    /**\n     * Returns the bounding box represented as an array.\n     *\n     * @returns The bounding box represented as an array, consisting of the\n     * southwest and northeast coordinates of the bounding represented as arrays of numbers.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.toArray(); // = [[-73.9876, 40.7661], [-73.9397, 40.8002]]\n     * ```\n     */\n    toArray() {\n        return [this._sw.toArray(), this._ne.toArray()];\n    }\n\n    /**\n     * Return the bounding box represented as a string.\n     *\n     * @returns The bounding box represents as a string of the format\n     * `'LngLatBounds(LngLat(lng, lat), LngLat(lng, lat))'`.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.toString(); // = \"LngLatBounds(LngLat(-73.9876, 40.7661), LngLat(-73.9397, 40.8002))\"\n     * ```\n     */\n    toString() {\n        return `LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`;\n    }\n\n    /**\n     * Check if the bounding box is an empty/`null`-type box.\n     *\n     * @returns True if bounds have been defined, otherwise false.\n     */\n    isEmpty() {\n        return !(this._sw && this._ne);\n    }\n\n    /**\n     * Check if the point is within the bounding box.\n     *\n     * @param lnglat - geographic point to check against.\n     * @returns `true` if the point is within the bounding box.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds(\n     *   new LngLat(-73.9876, 40.7661),\n     *   new LngLat(-73.9397, 40.8002)\n     * );\n     *\n     * let ll = new LngLat(-73.9567, 40.7789);\n     *\n     * console.log(llb.contains(ll)); // = true\n     * ```\n     */\n    contains(lnglat: LngLatLike) {\n        const {lng, lat} = LngLat.convert(lnglat);\n\n        const containsLatitude = this._sw.lat <= lat && lat <= this._ne.lat;\n        let containsLongitude = this._sw.lng <= lng && lng <= this._ne.lng;\n        if (this._sw.lng > this._ne.lng) { // wrapped coordinates\n            containsLongitude = this._sw.lng >= lng && lng >= this._ne.lng;\n        }\n\n        return containsLatitude && containsLongitude;\n    }\n\n    /**\n     * Checks if this bounding box intersects with another bounding box.\n     *\n     * Returns true if the bounding boxes share any area, including cases where\n     * they only touch along an edge or at a corner.\n     *\n     * This method properly handles cases where either or both bounding boxes cross\n     * the antimeridian (date line).\n     */\n    intersects(other: LngLatBoundsLike): boolean {\n        other = LngLatBounds.convert(other);\n\n        const latIntersects =\n            other.getNorth() >= this.getSouth() &&\n            other.getSouth() <= this.getNorth();\n\n        if (!latIntersects) return false;\n\n        // Check if either bound covers the full world (|span| >= 360Â°)\n        // This must be done before wrapping to preserve the span information\n        const thisSpan = Math.abs(this.getEast() - this.getWest());\n        const otherSpan = Math.abs(other.getEast() - other.getWest());\n\n        if (thisSpan >= 360 || otherSpan >= 360) {\n            return true;\n        }\n\n        // Normalize longitudes to [-180, 180] range\n        const thisWest = wrap(this.getWest(), -180, 180);\n        const thisEast = wrap(this.getEast(), -180, 180);\n        const otherWest = wrap(other.getWest(), -180, 180);\n        const otherEast = wrap(other.getEast(), -180, 180);\n\n        // Check if either bounds wraps around the antimeridian\n        const thisWraps = thisWest >= thisEast;\n        const otherWraps = otherWest >= otherEast;\n\n        // Both wrap: they always intersect\n        if (thisWraps && otherWraps) {\n            return true;\n        }\n\n        // Only this wraps: intersects if other is outside the gap\n        if (thisWraps) {\n            return otherEast >= thisWest || otherWest <= thisEast;\n        }\n\n        if (otherWraps) {\n            // Only other wraps: intersects if this is outside the gap\n            return thisEast >= otherWest || thisWest <= otherEast;\n        }\n\n        // Neither wraps: standard intersection check\n        return otherWest <= thisEast && otherEast >= thisWest;\n    }\n\n    /**\n     * Converts an array to a `LngLatBounds` object.\n     *\n     * If a `LngLatBounds` object is passed in, the function returns it unchanged.\n     *\n     * Internally, the function calls {@link LngLat.convert} to convert arrays to `LngLat` values.\n     *\n     * @param input - An array of two coordinates to convert, or a `LngLatBounds` object to return.\n     * @returns A new `LngLatBounds` object, if a conversion occurred, or the original `LngLatBounds` object.\n     * @example\n     * ```ts\n     * let arr = [[-73.9876, 40.7661], [-73.9397, 40.8002]];\n     * let llb = LngLatBounds.convert(arr); // = LngLatBounds {_sw: LngLat {lng: -73.9876, lat: 40.7661}, _ne: LngLat {lng: -73.9397, lat: 40.8002}}\n     * ```\n     */\n    static convert(input: LngLatBoundsLike | null): LngLatBounds {\n        if (input instanceof LngLatBounds) return input;\n        if (!input) return input as null;\n        return new LngLatBounds(input);\n    }\n\n    /**\n     * Returns a `LngLatBounds` from the coordinates extended by a given `radius`. The returned `LngLatBounds` completely contains the `radius`.\n     *\n     * @param center - center coordinates of the new bounds.\n     * @param radius - Distance in meters from the coordinates to extend the bounds.\n     * @returns A new `LngLatBounds` object representing the coordinates extended by the `radius`.\n     * @example\n     * ```ts\n     * let center = new LngLat(-73.9749, 40.7736);\n     * LngLatBounds.fromLngLat(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]\n     * ```\n     */\n    static fromLngLat(center: LngLat, radius:number = 0): LngLatBounds {\n        const earthCircumferenceInMetersAtEquator = 40075017;\n        const latAccuracy = 360 * radius / earthCircumferenceInMetersAtEquator,\n            lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * center.lat);\n\n        return new LngLatBounds(new LngLat(center.lng - lngAccuracy, center.lat - latAccuracy),\n            new LngLat(center.lng + lngAccuracy, center.lat + latAccuracy));\n    }\n\n    /**\n     * Adjusts the given bounds to handle the case where the bounds cross the 180th meridian (antimeridian).\n     *\n     * @returns The adjusted LngLatBounds\n     * @example\n     * ```ts\n     * let bounds = new LngLatBounds([175.813127, -20.157768], [-178. 340903, -15.449124]);\n     * let adjustedBounds = bounds.adjustAntiMeridian();\n     * // adjustedBounds will be: [[175.813127, -20.157768], [181.659097, -15.449124]]\n     * ```\n     */\n    adjustAntiMeridian(): LngLatBounds {\n        const sw = new LngLat(this._sw.lng, this._sw.lat);\n        const ne = new LngLat(this._ne.lng, this._ne.lat);\n\n        if (sw.lng > ne.lng) {\n            return new LngLatBounds(\n                sw,\n                new LngLat(ne.lng + 360, ne.lat)\n            );\n        }\n\n        return new LngLatBounds(sw, ne);\n    }\n\n}\n","import {LngLatBounds, type LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport {mercatorXfromLng, mercatorYfromLat} from '../geo/mercator_coordinate';\n\nimport type {CanonicalTileID} from './tile_id';\n\nexport class TileBounds {\n    bounds: LngLatBounds;\n    minzoom: number;\n    maxzoom: number;\n\n    constructor(bounds: [number, number, number, number], minzoom?: number | null, maxzoom?: number | null) {\n        this.bounds = LngLatBounds.convert(this.validateBounds(bounds));\n        this.minzoom = minzoom || 0;\n        this.maxzoom = maxzoom || 24;\n    }\n\n    validateBounds(bounds: [number, number, number, number]): LngLatBoundsLike {\n        // make sure the bounds property contains valid longitude and latitudes\n        if (!Array.isArray(bounds) || bounds.length !== 4) return [-180, -90, 180, 90];\n        return [Math.max(-180, bounds[0]), Math.max(-90, bounds[1]), Math.min(180, bounds[2]), Math.min(90, bounds[3])];\n    }\n\n    contains(tileID: CanonicalTileID) {\n        const worldSize = Math.pow(2, tileID.z);\n        const level = {\n            minX: Math.floor(mercatorXfromLng(this.bounds.getWest()) * worldSize),\n            minY: Math.floor(mercatorYfromLat(this.bounds.getNorth()) * worldSize),\n            maxX: Math.ceil(mercatorXfromLng(this.bounds.getEast()) * worldSize),\n            maxY: Math.ceil(mercatorYfromLat(this.bounds.getSouth()) * worldSize)\n        };\n        const hit = tileID.x >= level.minX && tileID.x < level.maxX && tileID.y >= level.minY && tileID.y < level.maxY;\n        return hit;\n    }\n}\n","import {Event, ErrorEvent, Evented} from '../util/evented';\n\nimport {extend, pick} from '../util/util';\nimport {loadTileJson} from './load_tilejson';\nimport {TileBounds} from '../tile/tile_bounds';\nimport {ResourceType} from '../util/request_manager';\nimport {MessageType} from '../util/actor_messages';\nimport {isAbortError} from '../util/abort_error';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {VectorSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {WorkerTileParameters, OverzoomParameters, WorkerTileResult} from './worker_source';\n\nexport type VectorTileSourceOptions = VectorSourceSpecification & {\n    collectResourceTiming?: boolean;\n    tileSize?: number;\n};\n\n/**\n * A source containing vector tiles in [Maplibre Vector Tile format](https://maplibre.org/maplibre-tile-spec/) or [Mapbox Vector Tile format](https://docs.mapbox.com/vector-tiles/reference/).\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'vector',\n *     url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'vector',\n *     tiles: ['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt'],\n *     minzoom: 6,\n *     maxzoom: 14\n * });\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setUrl(\"https://demotiles.maplibre.org/tiles/tiles.json\");\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setTiles(['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt']);\n * ```\n * @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-vector-tile-source/)\n */\nexport class VectorTileSource extends Evented implements Source {\n    type: 'vector';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    url: string;\n    scheme: string;\n    encoding: string;\n    tileSize: number;\n    promoteId: PromoteIdSpecification;\n\n    _options: VectorSourceSpecification;\n    _collectResourceTiming: boolean;\n    dispatcher: Dispatcher;\n    map: Map;\n    bounds: [number, number, number, number];\n    tiles: Array<string>;\n    tileBounds: TileBounds;\n    reparseOverscaled: boolean;\n    isTileClipped: boolean;\n    _tileJSONRequest: AbortController;\n    _loaded: boolean;\n\n    constructor(id: string, options: VectorTileSourceOptions, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n\n        this.type = 'vector';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.scheme = 'xyz';\n        this.tileSize = 512;\n        this.reparseOverscaled = true;\n        this.isTileClipped = true;\n        this._loaded = false;\n\n        extend(this, pick(options, ['url', 'scheme', 'tileSize', 'promoteId', 'encoding']));\n        this._options = extend({type: 'vector'}, options);\n\n        this._collectResourceTiming = options.collectResourceTiming;\n\n        if (this.tileSize !== 512) {\n            throw new Error('vector tile sources must have a tileSize of 512');\n        }\n\n        this.setEventedParent(eventedParent);\n    }\n\n    async load() {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n        this._tileJSONRequest = new AbortController();\n        try {\n            const tileJSON = await loadTileJson(this._options, this.map._requestManager, this._tileJSONRequest, this.map._ownerWindow);\n            this._tileJSONRequest = null;\n            this._loaded = true;\n            this.map.style.tileManagers[this.id].clearTiles();\n            if (tileJSON) {\n                extend(this, tileJSON);\n                if (tileJSON.bounds) this.tileBounds = new TileBounds(tileJSON.bounds, this.minzoom, this.maxzoom);\n\n                // `content` is included here to prevent a race condition where `Style._updateSources` is called\n                // before the TileJSON arrives. this makes sure the tiles needed are loaded once TileJSON arrives\n                // ref: https://github.com/mapbox/mapbox-gl-js/pull/4347#discussion_r104418088\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content'}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this._loaded = true; // let's pretend it's loaded so the source will be ignored\n\n            // only fire error event if it is not due to aborting the request\n            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(err));\n            }\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    hasTile(tileID: OverscaledTileID) {\n        return !this.tileBounds || this.tileBounds.contains(tileID.canonical);\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    setSourceProperty(callback: Function) {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n        }\n\n        callback();\n\n        this.load();\n    }\n\n    /**\n     * Sets the source `tiles` property and re-renders the map.\n     *\n     * @param tiles - An array of one or more tile source URLs, as in the TileJSON spec.\n     */\n    setTiles(tiles: Array<string>): this {\n        this.setSourceProperty(() => {\n            this._options.tiles = tiles;\n        });\n\n        return this;\n    }\n\n    /**\n     * Sets the source `url` property and re-renders the map.\n     *\n     * @param url - A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.\n     */\n    setUrl(url: string): this {\n        this.setSourceProperty(() => {\n            this.url = url;\n            this._options.url = url;\n        });\n\n        return this;\n    }\n\n    onRemove() {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n    }\n\n    serialize(): VectorSourceSpecification {\n        return extend({}, this._options);\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        const params: WorkerTileParameters = {\n            request: this.map._requestManager.transformRequest(url, ResourceType.Tile),\n            uid: tile.uid,\n            tileID: tile.tileID,\n            zoom: tile.tileID.overscaledZ,\n            tileSize: this.tileSize * tile.tileID.overscaleFactor(),\n            type: this.type,\n            source: this.id,\n            pixelRatio: this.map.getPixelRatio(),\n            showCollisionBoxes: this.map.showCollisionBoxes,\n            promoteId: this.promoteId,\n            subdivisionGranularity: this.map.style.projection.subdivisionGranularity,\n            encoding: this.encoding,\n            overzoomParameters: this._getOverzoomParameters(tile),\n        };\n        params.request.collectResourceTiming = this._collectResourceTiming;\n        let messageType: MessageType.loadTile | MessageType.reloadTile = MessageType.reloadTile;\n        if (!tile.actor || tile.state === 'expired') {\n            tile.actor = this.dispatcher.getActor();\n            messageType = MessageType.loadTile;\n        } else if (tile.state === 'loading') {\n            return new Promise<void>((resolve, reject) => {\n                tile.reloadPromise = {resolve, reject};\n            });\n        }\n        tile.abortController = new AbortController();\n        try {\n            const data = await tile.actor.sendAsync({type: messageType, data: params}, tile.abortController);\n            delete tile.abortController;\n\n            if (tile.aborted) {\n                return;\n            }\n            this._afterTileLoadWorkerResponse(tile, data);\n        } catch (err) {\n            delete tile.abortController;\n\n            if (tile.aborted) {\n                return;\n            }\n            if (err && err.status !== 404) {\n                throw err;\n            }\n            this._afterTileLoadWorkerResponse(tile, null);\n        }\n    }\n\n    /**\n     * When the requested tile has a higher canonical Z than source maxzoom, pass overzoom parameters so worker can load the\n     * deepest tile at source max zoom to generate sub tiles using geojsonvt for highest performance on vector overscaling\n     */\n    private _getOverzoomParameters(tile: Tile): OverzoomParameters | undefined {\n        if (tile.tileID.canonical.z <= this.maxzoom) {\n            return undefined;\n        }\n        if (this.map._zoomLevelsToOverscale === undefined) {\n            return undefined;\n        }\n        const maxZoomTileID = tile.tileID.scaledTo(this.maxzoom).canonical;\n        const maxZoomTileUrl = maxZoomTileID.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n\n        return {\n            maxZoomTileID,\n            overzoomRequest: this.map._requestManager.transformRequest(maxZoomTileUrl, ResourceType.Tile)\n        };\n    }\n\n    private _afterTileLoadWorkerResponse(tile: Tile, data: WorkerTileResult) {\n        if (data && data.resourceTiming) {\n            tile.resourceTiming = data.resourceTiming;\n        }\n\n        if (data && this.map._refreshExpiredTiles) {\n            tile.setExpiryData(data);\n        }\n        tile.loadVectorData(data, this.map.painter);\n\n        if (tile.reloadPromise) {\n            const reloadPromise = tile.reloadPromise;\n            tile.reloadPromise = null;\n            this.loadTile(tile).then(reloadPromise.resolve).catch(reloadPromise.reject);\n        }\n    }\n\n    async abortTile(tile: Tile): Promise<void> {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n        if (tile.actor) {\n            await tile.actor.sendAsync({\n                type: MessageType.abortTile,\n                data: {uid: tile.uid, type: this.type, source: this.id}\n            });\n        }\n    }\n\n    async unloadTile(tile: Tile): Promise<void> {\n        tile.unloadVectorData();\n        if (tile.actor) {\n            await tile.actor.sendAsync({\n                type: MessageType.removeTile,\n                data: {\n                    uid: tile.uid,\n                    type: this.type,\n                    source: this.id}\n            });\n        }\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n","import {extend, pick} from '../util/util';\n\nimport {ImageRequest} from '../util/image_request';\n\nimport {ResourceType} from '../util/request_manager';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {loadTileJson} from './load_tilejson';\nimport {TileBounds} from '../tile/tile_bounds';\nimport {Texture} from '../render/texture';\nimport {isAbortError} from '../util/abort_error';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {\n    RasterSourceSpecification,\n    RasterDEMSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A source containing raster tiles (See the [raster source documentation](https://maplibre.org/maplibre-style-spec/sources/#raster) for detailed documentation of options.)\n *\n * @group Sources\n *\n * \\> â¹ï¸ **Note:** The default `tileSize` is `512`. If your tile provider (such as OpenStreetMap or Stadia Maps) serves 256px tiles, set `tileSize: 256` manually to avoid blurry rendering due to upscaling.\n *\n * @example\n * ```ts\n * map.addSource('raster-source', {\n *     'type': 'raster',\n *     'tiles': ['https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg'],\n *     'tileSize': 256, // Set this to match tile server output to avoid blurry rendering\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('wms-test-source', {\n *      'type': 'raster',\n * // use the tiles option to specify a WMS tile source URL\n *      'tiles': [\n *          'https://img.nj.gov/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=Natural2015'\n *      ],\n *      'tileSize': 256 // Important for WMS if tiles are 256px\n * });\n * ```\n * @see [Add a raster tile source](https://maplibre.org/maplibre-gl-js/docs/examples/map-tiles/)\n * @see [Add a WMS source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-wms-source/)\n * @see [Display a satellite map](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-satellite-map/)\n */\nexport class RasterTileSource extends Evented implements Source {\n    type: 'raster' | 'raster-dem';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    url: string;\n    scheme: string;\n    tileSize: number;\n\n    bounds: [number, number, number, number];\n    tileBounds: TileBounds;\n    roundZoom: boolean;\n    dispatcher: Dispatcher;\n    map: Map;\n    tiles: Array<string>;\n\n    _loaded: boolean;\n    _options: RasterSourceSpecification | RasterDEMSourceSpecification;\n    _tileJSONRequest: AbortController;\n\n    constructor(id: string, options: RasterSourceSpecification | RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n        this.setEventedParent(eventedParent);\n\n        this.type = 'raster';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.roundZoom = true;\n        this.scheme = 'xyz';\n        this.tileSize = 512;\n        this._loaded = false;\n\n        this._options = extend({type: 'raster'}, options);\n        extend(this, pick(options, ['url', 'scheme', 'tileSize']));\n    }\n\n    async load(sourceDataChanged: boolean = false) {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n        this._tileJSONRequest = new AbortController();\n        try {\n            const tileJSON = await loadTileJson(this._options, this.map._requestManager, this._tileJSONRequest, this.map._ownerWindow);\n            this._tileJSONRequest = null;\n            this._loaded = true;\n            if (tileJSON) {\n                extend(this, tileJSON);\n                if (tileJSON.bounds) this.tileBounds = new TileBounds(tileJSON.bounds, this.minzoom, this.maxzoom);\n\n                // `content` is included here to prevent a race condition where `Style._updateSources` is called\n                // before the TileJSON arrives. this makes sure the tiles needed are loaded once TileJSON arrives\n                // ref: https://github.com/mapbox/mapbox-gl-js/pull/4347#discussion_r104418088\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content', sourceDataChanged}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this._loaded = true; // let's pretend it's loaded so the source will be ignored\n\n            // only fire error event if it is not due to aborting the request\n            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(err));\n            }\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    onRemove() {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n    }\n\n    setSourceProperty(callback: Function) {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n\n        callback();\n\n        this.load(true);\n    }\n\n    /**\n     * Sets the source `tiles` property and re-renders the map.\n     *\n     * @param tiles - An array of one or more tile source URLs, as in the raster tiles spec (See the [Style Specification](https://maplibre.org/maplibre-style-spec/)\n     */\n    setTiles(tiles: Array<string>): this {\n        this.setSourceProperty(() => {\n            this._options.tiles = tiles;\n        });\n\n        return this;\n    }\n\n    /**\n     * Sets the source `url` property and re-renders the map.\n     *\n     * @param url - A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.\n     */\n    setUrl(url: string): this {\n        this.setSourceProperty(() => {\n            this.url = url;\n            this._options.url = url;\n        });\n\n        return this;\n    }\n\n    serialize() {\n        return extend({}, this._options);\n    }\n\n    hasTile(tileID: OverscaledTileID) {\n        return !this.tileBounds || this.tileBounds.contains(tileID.canonical);\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        tile.abortController = new AbortController();\n        try {\n            const response = await ImageRequest.getImage(this.map._requestManager.transformRequest(url, ResourceType.Tile), tile.abortController, this.map._refreshExpiredTiles);\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n                return;\n            }\n            if (response && response.data) {\n                if (this.map._refreshExpiredTiles && (response.cacheControl || response.expires)) {\n                    tile.setExpiryData({cacheControl: response.cacheControl, expires: response.expires});\n                }\n                const context = this.map.painter.context;\n                const gl = context.gl;\n                const img = response.data;\n                tile.texture = this.map.painter.getTileTexture(img.width);\n                if (tile.texture) {\n                    tile.texture.update(img, {useMipmap: true});\n                } else {\n                    tile.texture = new Texture(context, img, gl.RGBA, {useMipmap: true});\n                    tile.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n                }\n                tile.state = 'loaded';\n            }\n        } catch (err) {\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n            } else if (err) {\n                tile.state = 'errored';\n                throw err;\n            }\n        }\n    }\n\n    async abortTile(tile: Tile) {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n    }\n\n    async unloadTile(tile: Tile) {\n        if (tile.texture) {\n            this.map.painter.saveTileTexture(tile.texture);\n        }\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n","import {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\nimport {extend, isImageBitmap, readImageUsingVideoFrame} from '../util/util';\nimport {type Evented} from '../util/evented';\nimport {browser} from '../util/browser';\nimport {offscreenCanvasSupported} from '../util/offscreen_canvas_supported';\nimport {OverscaledTileID} from '../tile/tile_id';\nimport {RasterTileSource} from './raster_tile_source';\n// ensure DEMData is registered for worker transfer on main thread:\nimport '../data/dem_data';\nimport type {DEMEncoding} from '../data/dem_data';\n\nimport type {Source} from './source';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {RasterDEMSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {isOffscreenCanvasDistorted} from '../util/offscreen_canvas_distorted';\nimport {RGBAImage} from '../util/image';\nimport {MessageType} from '../util/actor_messages';\n\n/**\n * A source containing raster DEM tiles (See the [Style Specification](https://maplibre.org/maplibre-style-spec/) for detailed documentation of options.)\n * This source can be used to show hillshading and 3D terrain\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('raster-dem-source', {\n *      type: 'raster-dem',\n *      url: 'https://demotiles.maplibre.org/terrain-tiles/tiles.json',\n *      tileSize: 256\n * });\n * ```\n * @see [3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/)\n */\nexport class RasterDEMTileSource extends RasterTileSource implements Source {\n    encoding: DEMEncoding;\n    redFactor?: number;\n    greenFactor?: number;\n    blueFactor?: number;\n    baseShift?: number;\n\n    constructor(id: string, options: RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n        this.type = 'raster-dem';\n        this.maxzoom = 22;\n        this._options = extend({type: 'raster-dem'}, options);\n        this.encoding = options.encoding || 'mapbox';\n        this.redFactor = options.redFactor;\n        this.greenFactor = options.greenFactor;\n        this.blueFactor = options.blueFactor;\n        this.baseShift = options.baseShift;\n    }\n\n    override async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        const request = this.map._requestManager.transformRequest(url, ResourceType.Tile);\n        tile.neighboringTiles = this._getNeighboringTiles(tile.tileID);\n        tile.abortController = new AbortController();\n        try {\n            const response = await ImageRequest.getImage(request, tile.abortController, this.map._refreshExpiredTiles);\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n                return;\n            }\n            if (response && response.data) {\n                const img = response.data;\n                if (this.map._refreshExpiredTiles && (response.cacheControl || response.expires)) {\n                    tile.setExpiryData({cacheControl: response.cacheControl, expires: response.expires});\n                }\n                const transfer = isImageBitmap(img) && offscreenCanvasSupported();\n                const rawImageData = transfer ? img : await this.readImageNow(img);\n                const params = {\n                    type: this.type,\n                    uid: tile.uid,\n                    source: this.id,\n                    rawImageData,\n                    encoding: this.encoding,\n                    redFactor: this.redFactor,\n                    greenFactor: this.greenFactor,\n                    blueFactor: this.blueFactor,\n                    baseShift: this.baseShift\n                };\n\n                if (!tile.actor || tile.state === 'expired') {\n                    tile.actor = this.dispatcher.getActor();\n                    const data = await tile.actor.sendAsync({type: MessageType.loadDEMTile, data: params});\n                    tile.dem = data;\n                    tile.needsHillshadePrepare = true;\n                    tile.needsTerrainPrepare = true;\n                    tile.state = 'loaded';\n                }\n            }\n        } catch (err) {\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n            } else if (err) {\n                tile.state = 'errored';\n                throw err;\n            }\n        }\n    }\n\n    async readImageNow(img: ImageBitmap | HTMLImageElement): Promise<RGBAImage | ImageData> {\n        if (typeof VideoFrame !== 'undefined' && isOffscreenCanvasDistorted()) {\n            const width = img.width + 2;\n            const height = img.height + 2;\n            try {\n                return new RGBAImage({width, height}, await readImageUsingVideoFrame(img, -1, -1, width, height));\n            } catch {\n                // fall-back to browser canvas decoding\n            }\n        }\n        return browser.getImageData(img, 1);\n    }\n\n    _getNeighboringTiles(tileID: OverscaledTileID): Record<string, {backfilled: boolean}> {\n        const canonical = tileID.canonical;\n        const dim = Math.pow(2, canonical.z);\n\n        const px = (canonical.x - 1 + dim) % dim;\n        const pxw = canonical.x === 0 ? tileID.wrap - 1 : tileID.wrap;\n        const nx = (canonical.x + 1 + dim) % dim;\n        const nxw = canonical.x + 1 === dim ? tileID.wrap + 1 : tileID.wrap;\n\n        const neighboringTiles: Record<string, {backfilled: boolean}> = {};\n        // add adjacent tiles\n        neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y).key] = {backfilled: false};\n        neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y).key] = {backfilled: false};\n\n        // Add upper neighboringTiles\n        if (canonical.y > 0) {\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y - 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, tileID.wrap, canonical.z, canonical.x, canonical.y - 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y - 1).key] = {backfilled: false};\n        }\n        // Add lower neighboringTiles\n        if (canonical.y + 1 < dim) {\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y + 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, tileID.wrap, canonical.z, canonical.x, canonical.y + 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y + 1).key] = {backfilled: false};\n        }\n\n        return neighboringTiles;\n    }\n\n    async unloadTile(tile: Tile) {\n        if (tile.demTexture) this.map.painter.saveTileTexture(tile.demTexture);\n        if (tile.fbo) {\n            tile.fbo.destroy();\n            delete tile.fbo;\n        }\n        if (tile.dem) delete tile.dem;\n        delete tile.neighboringTiles;\n\n        tile.state = 'unloaded';\n        if (tile.actor) {\n            await tile.actor.sendAsync({type: MessageType.removeDEMTile, data: {type: this.type, uid: tile.uid, source: this.id}});\n        }\n    }\n}\n","import {LngLatBounds} from '../geo/lng_lat_bounds';\n\nfunction getCoordinatesFromGeometry(geometry: GeoJSON.Geometry): number[] {\n    if (geometry.type === 'GeometryCollection') {\n        return geometry.geometries.map((g: Exclude<GeoJSON.Geometry, GeoJSON.GeometryCollection>) => g.coordinates).flat(Infinity) as number[];\n    }\n    return geometry.coordinates.flat(Infinity) as number[];\n}\n\n/**\n * Calculates the bounding box of GeoJSON data.\n * @param data - The GeoJSON data to calculate bounds for\n * @returns The bounding box of the GeoJSON data\n */\nexport function getGeoJSONBounds(data: GeoJSON.GeoJSON): LngLatBounds {\n    const bounds = new LngLatBounds();\n    let coordinates: number[];\n    switch (data.type) {\n        case 'FeatureCollection':\n            coordinates = data.features.map(f => getCoordinatesFromGeometry(f.geometry)).flat(Infinity) as number[];\n            break;\n        case 'Feature':\n            coordinates = getCoordinatesFromGeometry(data.geometry);\n            break;\n        default:\n            coordinates = getCoordinatesFromGeometry(data);\n            break;\n    }\n    if (coordinates.length == 0) {\n        return bounds;\n    }\n    for (let i = 0; i < coordinates.length - 1; i += 2) {\n        bounds.extend([coordinates[i], coordinates[i+1]]);\n    }\n    return bounds;\n}\n","import {Event, ErrorEvent, Evented} from '../util/evented';\nimport {extend, warnOnce, type ExactlyOne} from '../util/util';\nimport {EXTENT} from '../data/extent';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\nimport {applySourceDiff, mergeSourceDiffs, toUpdateable} from './geojson_source_diff';\nimport {getGeoJSONBounds} from '../util/geojson_bounds';\nimport {MessageType} from '../util/actor_messages';\nimport {tileIdToLngLatBounds} from '../tile/tile_id_to_lng_lat_bounds';\n\nimport type {LngLatBounds} from '../geo/lng_lat_bounds';\nimport type {Source} from './source';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {Actor} from '../util/actor';\nimport type {GeoJSONWorkerSourceLoadDataResult} from '../util/actor_messages';\nimport type {GeoJSONSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {GeoJSONFeatureId, GeoJSONSourceDiff} from './geojson_source_diff';\nimport type {GeoJSONWorkerOptions, LoadGeoJSONParameters} from './geojson_worker_source';\nimport type {WorkerTileParameters} from './worker_source';\n\n/**\n * Options object for GeoJSONSource.\n */\nexport type GeoJSONSourceOptions = GeoJSONSourceSpecification & {\n    workerOptions?: GeoJSONWorkerOptions;\n    collectResourceTiming?: boolean;\n    data: GeoJSON.GeoJSON | string;\n};\n\nexport type GeoJSONSourceInternalOptions = {\n    data?: GeoJSON.GeoJSON | string | undefined;\n    cluster?: boolean;\n    clusterMaxZoom?: number;\n    clusterRadius?: number;\n    clusterMinPoints?: number;\n    generateId?: boolean;\n};\n\n/**\n * @internal\n */\nexport type GeoJSONSourceShouldReloadTileOptions = {\n    /**\n     * Refresh all tiles that WILL contain these bounds.\n     */\n    affectedBounds: LngLatBounds[];\n};\n\n/**\n * The cluster options to set\n */\nexport type SetClusterOptions = {\n    /**\n     * Whether or not to cluster\n     */\n    cluster?: boolean;\n    /**\n     * The cluster's max zoom.\n     * Non-integer values are rounded to the closest integer due to supercluster integer value requirements.\n     */\n    clusterMaxZoom?: number;\n    /**\n     * The cluster's radius\n     */\n    clusterRadius?: number;\n};\n\n/**\n * A source containing GeoJSON.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-geojson) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'geojson',\n *     data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_ports.geojson'\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *    type: 'geojson',\n *    data: {\n *        \"type\": \"FeatureCollection\",\n *        \"features\": [{\n *            \"type\": \"Feature\",\n *            \"properties\": {},\n *            \"geometry\": {\n *                \"type\": \"Point\",\n *                \"coordinates\": [\n *                    -76.53063297271729,\n *                    39.18174077994108\n *                ]\n *            }\n *        }]\n *    }\n * });\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setData({\n *   \"type\": \"FeatureCollection\",\n *   \"features\": [{\n *       \"type\": \"Feature\",\n *       \"properties\": { \"name\": \"Null Island\" },\n *       \"geometry\": {\n *           \"type\": \"Point\",\n *           \"coordinates\": [ 0, 0 ]\n *       }\n *   }]\n * });\n * ```\n * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js/docs/examples/draw-geojson-points/)\n * @see [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-geojson-line/)\n * @see [Create a heatmap from points](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-heatmap-layer/)\n * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/create-and-style-clusters/)\n */\nexport class GeoJSONSource extends Evented implements Source {\n    type: 'geojson';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    tileSize: number;\n    attribution: string;\n    promoteId: PromoteIdSpecification;\n\n    isTileClipped: boolean;\n    reparseOverscaled: boolean;\n    _data: ExactlyOne<{\n        url: string;\n        geojson: GeoJSON.GeoJSON;\n        updateable: globalThis.Map<GeoJSONFeatureId, GeoJSON.Feature>;\n    }>;\n    _options: GeoJSONSourceInternalOptions;\n    workerOptions: GeoJSONWorkerOptions;\n    map: Map;\n    actor: Actor;\n    _isUpdatingWorker: boolean;\n    _pendingWorkerUpdate: { data?: GeoJSON.GeoJSON | string; diff?: GeoJSONSourceDiff; optionsChanged?: boolean };\n    _collectResourceTiming: boolean;\n    _removed: boolean;\n\n    /** @internal */\n    constructor(id: string, options: GeoJSONSourceOptions, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n\n        this.id = id;\n\n        // `type` is a property rather than a constant to make it easy for 3rd\n        // parties to use GeoJSONSource to build their own source types.\n        this.type = 'geojson';\n\n        this.minzoom = 0;\n        this.maxzoom = 18;\n        this.tileSize = 512;\n        this.isTileClipped = true;\n        this.reparseOverscaled = true;\n        this._removed = false;\n        this._isUpdatingWorker = false;\n        this._pendingWorkerUpdate = {data: options.data};\n\n        this.actor = dispatcher.getActor();\n        this.setEventedParent(eventedParent);\n\n        this._data = typeof options.data === 'string' ? {url: options.data} : {geojson: options.data};\n        this._options = extend({}, options);\n\n        this._collectResourceTiming = options.collectResourceTiming;\n\n        if (options.maxzoom !== undefined) this.maxzoom = options.maxzoom;\n        if (options.type) this.type = options.type;\n        if (options.attribution) this.attribution = options.attribution;\n        this.promoteId = options.promoteId;\n\n        if (options.clusterMaxZoom !== undefined && this.maxzoom <= options.clusterMaxZoom) {\n            warnOnce(`The maxzoom value \"${this.maxzoom}\" is expected to be greater than the clusterMaxZoom value \"${options.clusterMaxZoom}\".`);\n        }\n\n        // sent to the worker, along with `url: ...` or `data: literal geojson`,\n        // so that it can load/parse/index the geojson data\n        // extending with `options.workerOptions` helps to make it easy for\n        // third-party sources to hack/reuse GeoJSONSource.\n        this.workerOptions = extend({\n            source: this.id,\n            cluster: options.cluster || false,\n            geojsonVtOptions: {\n                buffer: this._pixelsToTileUnits(options.buffer !== undefined ? options.buffer : 128),\n                tolerance: this._pixelsToTileUnits(options.tolerance !== undefined ? options.tolerance : 0.375),\n                extent: EXTENT,\n                maxZoom: this.maxzoom,\n                lineMetrics: options.lineMetrics || false,\n                generateId: options.generateId || false\n            },\n            superclusterOptions: {\n                maxZoom: this._getClusterMaxZoom(options.clusterMaxZoom),\n                minPoints: Math.max(2, options.clusterMinPoints || 2),\n                extent: EXTENT,\n                radius: this._pixelsToTileUnits(options.clusterRadius || 50),\n                log: false,\n                generateId: options.generateId || false\n            },\n            clusterProperties: options.clusterProperties,\n            filter: options.filter\n        }, options.workerOptions);\n\n        // send the promoteId to the worker to have more flexible updates, but only if it is a string\n        if (typeof this.promoteId === 'string') {\n            this.workerOptions.promoteId = this.promoteId;\n        }\n    }\n\n    private _hasPendingWorkerUpdate(): boolean {\n        return this._pendingWorkerUpdate.data !== undefined || this._pendingWorkerUpdate.diff !== undefined || this._pendingWorkerUpdate.optionsChanged;\n    }\n\n    private _pixelsToTileUnits(pixelValue: number): number {\n        return pixelValue * (EXTENT / this.tileSize);\n    }\n\n    private _getClusterMaxZoom(clusterMaxZoom: number): number {\n        const effectiveClusterMaxZoom = clusterMaxZoom ? Math.round(clusterMaxZoom) : this.maxzoom - 1;\n        if (!(Number.isInteger(clusterMaxZoom) || clusterMaxZoom === undefined)) {\n            warnOnce(`Integer expected for option 'clusterMaxZoom': provided value \"${clusterMaxZoom}\" rounded to \"${effectiveClusterMaxZoom}\"`);\n        }\n        return effectiveClusterMaxZoom;\n    }\n\n    async load() {\n        await this._updateWorkerData();\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    /**\n     * Sets the GeoJSON data and re-renders the map.\n     *\n     * @param data - A GeoJSON data object or a URL to one. The latter is preferable in the case of large GeoJSON files.\n     * @param waitForCompletion - If true, the method will return a promise that resolves when set data is complete.\n     */\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion: true): Promise<void>;\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion?: false): this;\n    setData(data: GeoJSON.GeoJSON | string, waitForCompletion?: boolean): this | Promise<void> {\n        this._data = typeof data === 'string' ? {url: data} : {geojson: data};\n        this._pendingWorkerUpdate = {data};\n        const updatePromise = this._updateWorkerData();\n        if (waitForCompletion) return updatePromise;\n        return this;\n    }\n\n    /**\n     * Updates the source's GeoJSON, and re-renders the map.\n     *\n     * For sources with lots of features, this method can be used to make updates more quickly.\n     *\n     * This approach requires unique IDs for every feature in the source. The IDs can either be specified on the feature,\n     * or by using the promoteId option to specify which property should be used as the ID.\n     *\n     * It is an error to call updateData on a source that did not have unique IDs for each of its features already.\n     *\n     * Updates are applied on a best-effort basis, updating an ID that does not exist will not result in an error.\n     *\n     * @param diff - The changes that need to be applied.\n     * @param waitForCompletion - If true, the method will return a promise that resolves when the update is complete.\n     */\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion: true): Promise<void>;\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion?: false): this;\n    updateData(diff: GeoJSONSourceDiff, waitForCompletion?: boolean): this | Promise<void> {\n        this._pendingWorkerUpdate.diff = mergeSourceDiffs(this._pendingWorkerUpdate.diff, diff);\n        const updatePromise = this._updateWorkerData();\n        if (waitForCompletion) return updatePromise;\n        return this;\n    }\n\n    /**\n     * Allows to get the source's actual GeoJSON data.\n     *\n     * @returns a promise which resolves to the source's actual GeoJSON data\n     */\n    async getData(): Promise<GeoJSON.GeoJSON> {\n        const options: LoadGeoJSONParameters = extend({type: this.type}, this.workerOptions);\n        return this.actor.sendAsync({type: MessageType.getData, data: options});\n    }\n\n    /**\n     * Allows getting the source's boundaries.\n     * If there's a problem with the source's data, it will return an empty {@link LngLatBounds}.\n     * @returns a promise which resolves to the source's boundaries\n     */\n    async getBounds(): Promise<LngLatBounds> {\n        return getGeoJSONBounds(await this.getData());\n    }\n\n    /**\n     * To disable/enable clustering on the source options\n     * @param options - The options to set\n     * @example\n     * ```ts\n     * map.getSource('some id').setClusterOptions({cluster: false});\n     * map.getSource('some id').setClusterOptions({cluster: false, clusterRadius: 50, clusterMaxZoom: 14});\n     * ```\n     */\n    setClusterOptions(options: SetClusterOptions): this {\n        this.workerOptions.cluster = options.cluster;\n        if (options.clusterRadius !== undefined) {\n            this.workerOptions.superclusterOptions.radius = this._pixelsToTileUnits(options.clusterRadius);\n        }\n        if (options.clusterMaxZoom !== undefined) {\n            this.workerOptions.superclusterOptions.maxZoom = this._getClusterMaxZoom(options.clusterMaxZoom);\n        }\n        this._pendingWorkerUpdate.optionsChanged = true;\n        this._updateWorkerData();\n        return this;\n    }\n\n    /**\n     * For clustered sources, fetches the zoom at which the given cluster expands.\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @returns a promise that is resolved with the zoom number\n     */\n    getClusterExpansionZoom(clusterId: number): Promise<number> {\n        return this.actor.sendAsync({type: MessageType.getClusterExpansionZoom, data: {type: this.type, clusterId, source: this.id}});\n    }\n\n    /**\n     * For clustered sources, fetches the children of the given cluster on the next zoom level (as an array of GeoJSON features).\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @returns a promise that is resolved when the features are retrieved\n     */\n    getClusterChildren(clusterId: number): Promise<Array<GeoJSON.Feature>> {\n        return this.actor.sendAsync({type: MessageType.getClusterChildren, data: {type: this.type, clusterId, source: this.id}});\n    }\n\n    /**\n     * For clustered sources, fetches the original points that belong to the cluster (as an array of GeoJSON features).\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @param limit - The maximum number of features to return.\n     * @param offset - The number of features to skip (e.g. for pagination).\n     * @returns a promise that is resolved when the features are retrieved\n     * @example\n     * Retrieve cluster leaves on click\n     * ```ts\n     * map.on('click', 'clusters', (e) => {\n     *   let features = map.queryRenderedFeatures(e.point, {\n     *     layers: ['clusters']\n     *   });\n     *\n     *   let clusterId = features[0].properties.cluster_id;\n     *   let pointCount = features[0].properties.point_count;\n     *   let clusterSource = map.getSource('clusters');\n     *\n     *   const features = await clusterSource.getClusterLeaves(clusterId, pointCount);\n     *   // Print cluster leaves in the console\n     *   console.log('Cluster leaves:', features);\n     * });\n     * ```\n     */\n    getClusterLeaves(clusterId: number, limit: number, offset: number): Promise<Array<GeoJSON.Feature>> {\n        return this.actor.sendAsync({type: MessageType.getClusterLeaves, data: {\n            type: this.type,\n            source: this.id,\n            clusterId,\n            limit,\n            offset\n        }});\n    }\n\n    /**\n     * Responsible for invoking WorkerSource's geojson.loadData target, which\n     * handles loading the geojson data and preparing to serve it up as tiles,\n     * using geojson-vt or supercluster as appropriate.\n     */\n    async _updateWorkerData(): Promise<void> {\n        if (this._isUpdatingWorker) return;\n\n        if (!this._hasPendingWorkerUpdate()) {\n            warnOnce(`No pending worker updates for GeoJSONSource ${this.id}.`);\n            return;\n        }\n\n        const {data, diff} = this._pendingWorkerUpdate;\n        const params = this._getLoadGeoJSONParameters(data, diff);\n\n        if (data !== undefined) {\n            this._pendingWorkerUpdate.data = undefined;\n        } else if (diff) {\n            this._pendingWorkerUpdate.diff = undefined;\n        }\n\n        // Reset the flag since this update is using the latest options\n        this._pendingWorkerUpdate.optionsChanged = undefined;\n\n        await this._dispatchWorkerUpdate(params);\n    }\n\n    /**\n     * Create the parameters object that will be sent to the worker and used to load GeoJSON.\n     */\n    private _getLoadGeoJSONParameters(data: string | GeoJSON.GeoJSON<GeoJSON.Geometry>, diff: GeoJSONSourceDiff): LoadGeoJSONParameters {\n        const params: LoadGeoJSONParameters = extend({type: this.type}, this.workerOptions);\n\n        // Data comes from a remote url\n        if (typeof data === 'string') {\n            params.request = this.map._requestManager.transformRequest(browser.resolveURL(data as string), ResourceType.Source);\n            params.request.collectResourceTiming = this._collectResourceTiming;\n            return params;\n        }\n\n        // Data is a geojson object\n        if (data !== undefined) {\n            params.data = data;\n            return params;\n        }\n\n        // Data is a differential update\n        if (diff) {\n            params.dataDiff = diff;\n            return params;\n        }\n\n        return params;\n    }\n\n    /**\n     * Send the worker update data from the main thread to the worker\n     */\n    private async _dispatchWorkerUpdate(options: LoadGeoJSONParameters) {\n        this._isUpdatingWorker = true;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n\n        try {\n            const result = await this.actor.sendAsync({type: MessageType.loadData, data: options});\n            this._isUpdatingWorker = false;\n\n            if (this._removed || result.abandoned) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n\n            // Update the copy of the data in this source with the worker result. (only sent for url based geojson data)\n            if (result.data) {\n                this._data = {geojson: result.data};\n            }\n\n            const affectedGeometries = this._applyDiffToSource(options.dataDiff);\n            const shouldReloadTileOptions = this._getShouldReloadTileOptions(affectedGeometries);\n\n            const eventData = {dataType: 'source'};\n            this._applyResourceTiming(eventData, result);\n\n            // Fire the metadata event to let the TileManager know it's ok to start requesting tiles.\n            this.fire(new Event('data', {...eventData, sourceDataType: 'metadata'}));\n            this.fire(new Event('data', {...eventData, sourceDataType: 'content', shouldReloadTileOptions}));\n        } catch (err) {\n            this._isUpdatingWorker = false;\n\n            if (this._removed) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n\n            this.fire(new ErrorEvent(err));\n        } finally {\n            // If there is more pending data, update the worker again.\n            if (this._hasPendingWorkerUpdate()) {\n                this._updateWorkerData();\n            }\n        }\n    }\n\n    /**\n     * Apply resource timing data to the event object.\n     */\n    private _applyResourceTiming(eventData: {dataType: string}, result: GeoJSONWorkerSourceLoadDataResult) {\n        if (!this._collectResourceTiming) return;\n\n        const timingData = result.resourceTiming?.[this.id];\n        if (!timingData) return;\n\n        const resourceTiming = timingData.slice(0);\n        if (!resourceTiming?.length) return;\n\n        extend(eventData, {resourceTiming});\n    }\n\n    /**\n     * Apply a diff to this source's data and return the affected feature geometries.\n     * @param diff - The {@link GeoJSONSourceDiff} to apply.\n     * @returns The affected geometries, or undefined if the diff is not applicable or all geometries are affected.\n     */\n    private _applyDiffToSource(diff: GeoJSONSourceDiff): GeoJSON.Geometry[] | undefined {\n        if (!diff) {\n            return undefined;\n        }\n\n        const promoteId = typeof this.promoteId === 'string' ? this.promoteId : undefined;\n\n        // Lazily convert `this._data` to updateable if it's not already\n        if (!this._data.url && !this._data.updateable) {\n            const updateable = toUpdateable(this._data.geojson, promoteId);\n            if (!updateable) throw new Error(`GeoJSONSource \"${this.id}\": GeoJSON data is not compatible with updateData`);\n            this._data = {updateable};\n        }\n\n        if (!this._data.updateable) {\n            return undefined;\n        }\n        const affectedGeometries = applySourceDiff(this._data.updateable, diff, promoteId);\n\n        if (diff.removeAll || this._options.cluster) {\n            return undefined;\n        }\n\n        return affectedGeometries;\n    }\n\n    /**\n     * Get options for use in determining whether to reload a tile based on the modified features.\n     * @param affectedGeometries - The feature geometries affected by the update.\n     * @returns A {@link GeoJSONSourceShouldReloadTileOptions} object which contains an array of affected bounds caused by the update.\n     */\n    private _getShouldReloadTileOptions(affectedGeometries: GeoJSON.Geometry[]): GeoJSONSourceShouldReloadTileOptions | undefined {\n        if (!affectedGeometries) return undefined;\n\n        const affectedBounds = affectedGeometries\n            .filter(Boolean)\n            .map(g => getGeoJSONBounds(g));\n\n        return {affectedBounds};\n    }\n\n    /**\n     * Determine whether a tile should be reloaded based on a set of options associated with a {@link MapSourceDataChangedEvent}.\n     * @internal\n     */\n    shouldReloadTile(tile: Tile, {affectedBounds}: GeoJSONSourceShouldReloadTileOptions) : boolean {\n        if (tile.state === 'loading') {\n            return true;\n        }\n        if (tile.state === 'unloaded') {\n            return false;\n        }\n\n        // Update the tile if contained or will contain an updated feature.\n        const {buffer, extent} = this.workerOptions.geojsonVtOptions;\n        const tileBounds = tileIdToLngLatBounds(\n            tile.tileID.canonical,\n            buffer / extent\n        );\n        for (const bounds of affectedBounds) {\n            if (tileBounds.intersects(bounds)) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    loaded(): boolean {\n        return !this._isUpdatingWorker && !this._hasPendingWorkerUpdate();\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const message = !tile.actor ?  MessageType.loadTile :  MessageType.reloadTile;\n        tile.actor = this.actor;\n        const params: WorkerTileParameters = {\n            type: this.type,\n            uid: tile.uid,\n            tileID: tile.tileID,\n            zoom: tile.tileID.overscaledZ,\n            maxZoom: this.maxzoom,\n            tileSize: this.tileSize,\n            source: this.id,\n            pixelRatio: this.map.getPixelRatio(),\n            showCollisionBoxes: this.map.showCollisionBoxes,\n            promoteId: this.promoteId,\n            subdivisionGranularity: this.map.style.projection.subdivisionGranularity\n        };\n\n        tile.abortController = new AbortController();\n        const data = await this.actor.sendAsync({type: message, data: params}, tile.abortController);\n        delete tile.abortController;\n        tile.unloadVectorData();\n\n        if (!tile.aborted) {\n            tile.loadVectorData(data, this.map.painter, message ===  MessageType.reloadTile);\n        }\n    }\n\n    async abortTile(tile: Tile) {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n        tile.aborted = true;\n    }\n\n    async unloadTile(tile: Tile) {\n        tile.unloadVectorData();\n        await this.actor.sendAsync({type: MessageType.removeTile, data: {uid: tile.uid, type: this.type, source: this.id}});\n    }\n\n    onRemove() {\n        this._removed = true;\n        this.actor.sendAsync({type: MessageType.removeSource, data: {type: this.type, source: this.id}});\n    }\n\n    serialize(): GeoJSONSourceSpecification {\n        return extend({}, this._options, {\n            type: this.type,\n            data: this._data.updateable ?\n                {\n                    type: 'FeatureCollection',\n                    features: Array.from(this._data.updateable.values())\n                } :\n                this._data.url || this._data.geojson\n        });\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n","import {latFromMercatorY, lngFromMercatorX} from '../geo/mercator_coordinate';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport type {CanonicalTileID} from './tile_id';\n\nexport function tileIdToLngLatBounds(\n    {x,y,z}: CanonicalTileID,\n    buffer: number = 0,\n): LngLatBounds {\n    const lngMin = lngFromMercatorX((x - buffer) / Math.pow(2, z));\n    const latMin = latFromMercatorY((y + 1 + buffer) / Math.pow(2, z));\n\n    const lngMax = lngFromMercatorX((x + 1 + buffer) / Math.pow(2, z));\n    const latMax = latFromMercatorY((y - buffer) / Math.pow(2, z));\n\n    return new LngLatBounds([lngMin, latMin], [lngMax, latMax]);\n}\n","import {CanonicalTileID} from '../tile/tile_id';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\nimport {Texture} from '../render/texture';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\nimport type {Source} from './source';\nimport type {CanvasSourceSpecification} from './canvas_source';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from '../tile/tile';\nimport type {\n    ImageSourceSpecification,\n    VideoSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\nimport type Point from '@mapbox/point-geometry';\nimport {MAX_TILE_ZOOM} from '../util/util';\nimport {Bounds} from '../geo/bounds';\nimport {isAbortError} from '../util/abort_error';\n\n/**\n * Four geographical coordinates,\n * represented as arrays of longitude and latitude numbers, which define the corners of the image.\n * The coordinates start at the top left corner of the image and proceed in clockwise order.\n * They do not have to represent a rectangle.\n */\nexport type Coordinates = [[number, number], [number, number], [number, number], [number, number]];\n\n/**\n * The options object for the {@link ImageSource.updateImage} method\n */\nexport type UpdateImageOptions = {\n    /**\n     * Required image URL.\n     */\n    url: string;\n    /**\n     * The image coordinates\n     */\n    coordinates?: Coordinates;\n};\n\nexport type CanonicalTileRange = {\n    minTileY: number;\n    maxTileY: number;\n\n    /**\n     * Image can exceed the boundary of a single \"world\" (tile 0/0/0),\n     * so we need to know the tile range for wrapping.\n     */\n    minTileXWrapped: number;\n    maxTileXWrapped: number;\n    minWrap: number;\n    maxWrap: number;\n};\n\n/**\n * A data source containing an image.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-image) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'image',\n *    url: 'https://www.maplibre.org/images/foo.png',\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update coordinates\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * // update url and coordinates simultaneously\n * mySource.updateImage({\n *    url: 'https://www.maplibre.org/images/bar.png',\n *    coordinates: [\n *        [-76.54335737228394, 39.18579907229748],\n *        [-76.52803659439087, 39.1838364847587],\n *        [-76.5295386314392, 39.17683392507606],\n *        [-76.54520273208618, 39.17876344106642]\n *    ]\n * })\n *\n * map.removeSource('some id');  // remove\n * ```\n */\nexport class ImageSource extends Evented implements Source {\n    type: string;\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    tileSize: number;\n    url: string;\n    /**\n     * This object is used to store the range of terrain tiles that overlap with this tile.\n     * It is relevant for image tiles, as the image exceeds single tile boundaries.\n     */\n    terrainTileRanges: {[zoom: string]: CanonicalTileRange};\n\n    coordinates: Coordinates;\n    tiles: {[_: string]: Tile};\n    options: any;\n    dispatcher: Dispatcher;\n    map: Map;\n    texture: Texture | null;\n    image: HTMLImageElement | ImageBitmap;\n    tileID: CanonicalTileID;\n    tileCoords: Array<Point>;\n    flippedWindingOrder: boolean = false;\n    _loaded: boolean;\n    _request: AbortController;\n\n    /** @internal */\n    constructor(id: string, options: ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n        this.coordinates = options.coordinates;\n\n        this.type = 'image';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.tileSize = 512;\n        this.tiles = {};\n        this._loaded = false;\n\n        this.setEventedParent(eventedParent);\n\n        this.options = options;\n    }\n\n    async load(newCoordinates?: Coordinates): Promise<void> {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n\n        this.url = this.options.url;\n\n        this._request = new AbortController();\n        try {\n            const image = await ImageRequest.getImage(this.map._requestManager.transformRequest(this.url, ResourceType.Image), this._request);\n            this._request = null;\n            this._loaded = true;\n\n            if (image && image.data) {\n                this.image = image.data;\n                if (newCoordinates) {\n                    this.coordinates = newCoordinates;\n                }\n                this._finishLoading();\n            }\n        } catch (err) {\n            this._request = null;\n            this._loaded = true;\n            if (!isAbortError(err)) {\n                this.fire(new ErrorEvent(err));\n            }\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    /**\n     * Updates the image URL and, optionally, the coordinates. To avoid having the image flash after changing,\n     * set the `raster-fade-duration` paint property on the raster layer to 0.\n     *\n     * @param options - The options object.\n     */\n    updateImage(options: UpdateImageOptions): this {\n        if (!options.url) {\n            return this;\n        }\n\n        if (this._request) {\n            this._request.abort();\n            this._request = null;\n        }\n\n        this.options.url = options.url;\n        this.load(options.coordinates).finally(() => { this.texture = null; });\n        return this;\n    }\n\n    _finishLoading() {\n        if (this.map) {\n            this.setCoordinates(this.coordinates);\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n        }\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    onRemove() {\n        if (this._request) {\n            this._request.abort();\n            this._request = null;\n        }\n    }\n\n    /**\n     * Sets the image's coordinates and re-renders the map.\n     *\n     * @param coordinates - Four geographical coordinates,\n     * represented as arrays of longitude and latitude numbers, which define the corners of the image.\n     * The coordinates start at the top left corner of the image and proceed in clockwise order.\n     * They do not have to represent a rectangle.\n     */\n    setCoordinates(coordinates: Coordinates): this {\n        this.coordinates = coordinates;\n\n        // Calculate which mercator tile is suitable for rendering the video in\n        // and create a buffer with the corner coordinates. These coordinates\n        // may be outside the tile, because raster tiles aren't clipped when rendering.\n\n        // transform the geo coordinates into (zoom 0) tile space coordinates\n        const cornerCoords = coordinates.map(MercatorCoordinate.fromLngLat);\n\n        // Compute the coordinates of the tile we'll use to hold this image's\n        // render data\n        this.tileID = getCoordinatesCenterTileID(cornerCoords);\n\n        // Compute tiles overlapping with the image. We need to know for which\n        // terrain tiles we have to render the image.\n        this.terrainTileRanges = this._getOverlappingTileRanges(cornerCoords);\n\n        // Constrain min/max zoom to our tile's zoom level in order to force\n        // TileManager to request this tile (no matter what the map's zoom\n        // level)\n        this.minzoom = this.maxzoom = this.tileID.z;\n\n        // Transform the corner coordinates into the coordinate space of our\n        // tile.\n        this.tileCoords = cornerCoords.map((coord) => this.tileID.getTilePoint(coord)._round());\n        this.flippedWindingOrder = hasWrongWindingOrder(this.tileCoords);\n\n        this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content'}));\n        return this;\n    }\n\n    prepare() {\n        if (Object.keys(this.tiles).length === 0 || !this.image) {\n            return;\n        }\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.image, gl.RGBA);\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        // We have a single tile -- whose coordinates are this.tileID -- that\n        // covers the image we want to render.  If that's the one being\n        // requested, set it up with the image; otherwise, mark the tile as\n        // `errored` to indicate that we have no data for it.\n        // If the world wraps, we may have multiple \"wrapped\" copies of the\n        // single tile.\n        if (this.tileID && this.tileID.equals(tile.tileID.canonical)) {\n            this.tiles[String(tile.tileID.wrap)] = tile;\n            tile.buckets = {};\n        } else {\n            tile.state = 'errored';\n        }\n    }\n\n    serialize(): ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification {\n        return {\n            type: 'image',\n            url: this.options.url,\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return false;\n    }\n\n    /**\n     * Given a list of coordinates, determine overlapping tile ranges for all zoom levels.\n     *\n     * @returns Overlapping tile ranges for all zoom levels.\n     * @internal\n     */\n    private _getOverlappingTileRanges(\n        coords: Array<MercatorCoordinate>\n    ): {[zoom: string]: CanonicalTileRange} {\n        const {minX, minY, maxX, maxY} = Bounds.fromPoints(coords);\n\n        const ranges: {[zoom: string]: CanonicalTileRange} = {};\n\n        for (let z = 0; z <= MAX_TILE_ZOOM; z++) {\n            const tilesAtZoom = Math.pow(2, z);\n            const minTileX = Math.floor(minX * tilesAtZoom);\n            const minTileY = Math.floor(minY * tilesAtZoom);\n            const maxTileX = Math.floor(maxX * tilesAtZoom);\n            const maxTileY = Math.floor(maxY * tilesAtZoom);\n\n            const minTileXWrapped = ((minTileX % tilesAtZoom) + tilesAtZoom) % tilesAtZoom;\n            const maxTileXWrapped = maxTileX % tilesAtZoom;\n            const minWrap = Math.floor(minTileX / tilesAtZoom);\n            const maxWrap = Math.floor(maxTileX / tilesAtZoom);\n\n            ranges[z] = {\n                minWrap,\n                maxWrap,\n                minTileXWrapped,\n                maxTileXWrapped,\n                minTileY,\n                maxTileY\n            };\n        }\n\n        return ranges;\n    }\n}\n\n/**\n * Given a list of coordinates, get their center as a coordinate.\n *\n * @returns centerpoint\n * @internal\n */\nexport function getCoordinatesCenterTileID(coords: Array<MercatorCoordinate>) {\n    const bounds = Bounds.fromPoints(coords);\n\n    const dx = bounds.width();\n    const dy = bounds.height();\n    const dMax = Math.max(dx, dy);\n    const zoom = Math.max(0, Math.floor(-Math.log(dMax) / Math.LN2));\n    const tilesAtZoom = Math.pow(2, zoom);\n\n    return new CanonicalTileID(\n        zoom,\n        Math.floor((bounds.minX + bounds.maxX) / 2 * tilesAtZoom),\n        Math.floor((bounds.minY + bounds.maxY) / 2 * tilesAtZoom));\n}\n\nfunction hasWrongWindingOrder(coords: Array<Point>) {\n    const e0x = coords[1].x - coords[0].x;\n    const e0y = coords[1].y - coords[0].y;\n    const e1x = coords[2].x - coords[0].x;\n    const e1y = coords[2].y - coords[0].y;\n\n    const crossProduct = e0x * e1y - e0y * e1x;\n\n    return crossProduct < 0;\n}\n","import {getVideo} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\n\nimport {ImageSource} from './image_source';\nimport {Texture} from '../render/texture';\nimport {Event, ErrorEvent} from '../util/evented';\nimport {ValidationError} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Evented} from '../util/evented';\nimport type {VideoSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A data source containing video.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-video) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'video',\n *    url: [\n *        'https://www.mapbox.com/blog/assets/baltimore-smoke.mp4',\n *        'https://www.mapbox.com/blog/assets/baltimore-smoke.webm'\n *    ],\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * map.removeSource('some id');  // remove\n * ```\n * @see [Add a video](https://maplibre.org/maplibre-gl-js/docs/examples/video-on-a-map/)\n *\n * Note that when rendered as a raster layer, the layer's `raster-fade-duration` property will cause the video to fade in.\n * This happens when playback is started, paused and resumed, or when the video's coordinates are updated. To avoid this behavior,\n * set the layer's `raster-fade-duration` property to `0`.\n */\nexport class VideoSource extends ImageSource {\n    options: VideoSourceSpecification;\n    urls: Array<string>;\n    video: HTMLVideoElement;\n    roundZoom: boolean;\n\n    constructor(id: string, options: VideoSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n        this.roundZoom = true;\n        this.type = 'video';\n        this.options = options;\n    }\n\n    async load() {\n        this._loaded = false;\n        const options = this.options;\n\n        this.urls = [];\n        for (const url of options.urls) {\n            this.urls.push(this.map._requestManager.transformRequest(url, ResourceType.Source).url);\n        }\n        try {\n            const video = await getVideo(this.urls);\n            this._loaded = true;\n            if (!video) {\n                return;\n            }\n            this.video = video;\n            this.video.loop = true;\n\n            // Start repainting when video starts playing. hasTransition() will then return\n            // true to trigger additional frames as long as the videos continues playing.\n            this.video.addEventListener('playing', () => {\n                this.map.triggerRepaint();\n            });\n\n            if (this.map) {\n                this.video.play();\n            }\n\n            this._finishLoading();\n        } catch (err) {\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    /**\n     * Pauses the video.\n     */\n    pause() {\n        if (this.video) {\n            this.video.pause();\n        }\n    }\n\n    /**\n     * Plays the video.\n     */\n    play() {\n        if (this.video) {\n            this.video.play();\n        }\n    }\n\n    /**\n     * Sets playback to a timestamp, in seconds.\n     */\n    seek(seconds: number) {\n        if (this.video) {\n            const seekableRange = this.video.seekable;\n            if (seconds < seekableRange.start(0) || seconds > seekableRange.end(0)) {\n                this.fire(new ErrorEvent(new ValidationError(`sources.${this.id}`, null, `Playback for this video can be set only between the ${seekableRange.start(0)} and ${seekableRange.end(0)}-second mark.`)));\n            } else this.video.currentTime = seconds;\n        }\n    }\n\n    /**\n     * Returns the HTML `video` element.\n     *\n     * @returns The HTML `video` element.\n     */\n    getVideo(): HTMLVideoElement {\n        return this.video;\n    }\n\n    onAdd(map: Map) {\n        if (this.map) return;\n        this.map = map;\n        this.load();\n        if (this.video) {\n            this.video.play();\n            this.setCoordinates(this.coordinates);\n        }\n    }\n\n    /**\n     * Sets the video's coordinates and re-renders the map.\n     */\n    prepare(): this {\n        if (Object.keys(this.tiles).length === 0 || this.video.readyState < 2) {\n            return; // not enough data for current position\n        }\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.video, gl.RGBA);\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        } else if (!this.video.paused) {\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, this.video);\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    serialize(): VideoSourceSpecification {\n        return {\n            type: 'video',\n            urls: this.urls,\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return this.video && !this.video.paused;\n    }\n}\n","import {ImageSource} from './image_source';\n\nimport {Texture} from '../render/texture';\nimport {Event, ErrorEvent} from '../util/evented';\nimport {ValidationError} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Evented} from '../util/evented';\n\n/**\n * Options to add a canvas source type to the map.\n */\nexport type CanvasSourceSpecification = {\n    /**\n     * Source type. Must be `\"canvas\"`.\n     */\n    type: 'canvas';\n    /**\n     * Four geographical coordinates denoting where to place the corners of the canvas, specified in `[longitude, latitude]` pairs.\n     */\n    coordinates: [[number, number], [number, number], [number, number], [number, number]];\n    /**\n     * Whether the canvas source is animated. If the canvas is static (i.e. pixels do not need to be re-read on every frame), `animate` should be set to `false` to improve performance.\n     * @defaultValue true\n     */\n    animate?: boolean;\n    /**\n     * Canvas source from which to read pixels. Can be a string representing the ID of the canvas element, or the `HTMLCanvasElement` itself.\n     */\n    canvas?: string | HTMLCanvasElement;\n};\n\n/**\n * A data source containing the contents of an HTML canvas. See {@link CanvasSourceSpecification} for detailed documentation of options.\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'canvas',\n *    canvas: 'idOfMyHTMLCanvas',\n *    animate: true,\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * map.removeSource('some id');  // remove\n * ```\n */\nexport class CanvasSource extends ImageSource {\n    options: CanvasSourceSpecification;\n    animate: boolean;\n    canvas: HTMLCanvasElement;\n    width: number;\n    height: number;\n    /**\n     * Enables animation. The image will be copied from the canvas to the map on each frame.\n     */\n    play: () => void;\n    /**\n     * Disables animation. The map will display a static copy of the canvas image.\n     */\n    pause: () => void;\n    _playing: boolean;\n\n    /** @internal */\n    constructor(id: string, options: CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n\n        // We build in some validation here, since canvas sources aren't included in the style spec:\n        if (!options.coordinates) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'missing required property \"coordinates\"')));\n        } else if (!Array.isArray(options.coordinates) || options.coordinates.length !== 4 ||\n                options.coordinates.some(c => !Array.isArray(c) || c.length !== 2 || c.some(l => typeof l !== 'number'))) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, '\"coordinates\" property must be an array of 4 longitude/latitude array pairs')));\n        }\n\n        if (options.animate && typeof options.animate !== 'boolean') {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'optional \"animate\" property must be a boolean value')));\n        }\n\n        if (!options.canvas) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'missing required property \"canvas\"')));\n        } else if (typeof options.canvas !== 'string' && !(options.canvas instanceof HTMLCanvasElement)) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, '\"canvas\" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance')));\n        }\n\n        this.options = options;\n        this.animate = options.animate !== undefined ? options.animate : true;\n    }\n\n    async load() {\n        this._loaded = true;\n        if (!this.canvas) {\n            this.canvas = (this.options.canvas instanceof HTMLCanvasElement) ?\n                this.options.canvas :\n                document.getElementById(this.options.canvas) as HTMLCanvasElement;\n            // cast to HTMLCanvasElement in else of ternary\n            // should we do a safety check and throw if it's not actually HTMLCanvasElement?\n        }\n        this.width = this.canvas.width;\n        this.height = this.canvas.height;\n\n        if (this._hasInvalidDimensions()) {\n            this.fire(new ErrorEvent(new Error('Canvas dimensions cannot be less than or equal to zero.')));\n            return;\n        }\n\n        this.play = function() {\n            this._playing = true;\n            this.map.triggerRepaint();\n        };\n\n        this.pause = function() {\n            if (this._playing) {\n                this.prepare();\n                this._playing = false;\n            }\n        };\n\n        this._finishLoading();\n    }\n\n    /**\n     * Returns the HTML `canvas` element.\n     *\n     * @returns The HTML `canvas` element.\n     */\n    getCanvas(): HTMLCanvasElement {\n        return this.canvas;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n        if (this.canvas) {\n            if (this.animate) this.play();\n        }\n    }\n\n    onRemove() {\n        this.pause();\n    }\n\n    prepare() {\n        let resize = false;\n        if (this.canvas.width !== this.width) {\n            this.width = this.canvas.width;\n            resize = true;\n        }\n        if (this.canvas.height !== this.height) {\n            this.height = this.canvas.height;\n            resize = true;\n        }\n\n        if (this._hasInvalidDimensions()) return;\n\n        if (Object.keys(this.tiles).length === 0) return; // not enough data for current position\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.canvas, gl.RGBA, {premultiply: true});\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        } else if (resize || this._playing) {\n            this.texture.update(this.canvas, {premultiply: true});\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    serialize(): CanvasSourceSpecification {\n        return {\n            type: 'canvas',\n            animate: this.animate,\n            canvas: this.options.canvas,\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return this._playing;\n    }\n\n    _hasInvalidDimensions() {\n        for (const x of [this.canvas.width, this.canvas.height]) {\n            if (isNaN(x) || x <= 0) return true;\n        }\n        return false;\n    }\n}\n","import {VectorTileSource} from '../source/vector_tile_source';\nimport {RasterTileSource} from '../source/raster_tile_source';\nimport {RasterDEMTileSource} from '../source/raster_dem_tile_source';\nimport {GeoJSONSource, type GeoJSONSourceShouldReloadTileOptions} from '../source/geojson_source';\nimport {VideoSource} from '../source/video_source';\nimport {ImageSource} from '../source/image_source';\nimport {CanvasSource} from '../source/canvas_source';\nimport {type Dispatcher} from '../util/dispatcher';\n\nimport type {SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Event, Evented} from '../util/evented';\nimport type {Map} from '../ui/map';\nimport type {Tile} from '../tile/tile';\nimport type {OverscaledTileID, CanonicalTileID} from '../tile/tile_id';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport {type CalculateTileZoomFunction} from '../geo/projection/covering_tiles';\n\nconst registeredSources = {} as {[key:string]: SourceClass};\n\n/**\n * The `Source` interface must be implemented by each source type, including \"core\" types (`vector`, `raster`,\n * `video`, etc.) and all custom, third-party types.\n *\n * **Event** `data` - Fired with `{dataType: 'source', sourceDataType: 'metadata'}` to indicate that any necessary metadata\n * has been loaded so that it's okay to call `loadTile`; and with `{dataType: 'source', sourceDataType: 'content'}`\n * to indicate that the source data has changed, so that any current caches should be flushed.\n *\n * @group Sources\n */\nexport interface Source {\n    readonly type: string;\n    /**\n     * The id for the source. Must not be used by any existing source.\n     */\n    id: string;\n    /**\n     * The minimum zoom level for the source.\n     */\n    minzoom: number;\n    /**\n     * The maximum zoom level for the source.\n     */\n    maxzoom: number;\n    /**\n     * The tile size for the source.\n     */\n    tileSize: number;\n    /**\n     * The attribution for the source.\n     */\n    attribution?: string;\n    /**\n     * `true` if zoom levels are rounded to the nearest integer in the source data, `false` if they are floor-ed to the nearest integer.\n     */\n    roundZoom?: boolean;\n    /**\n     * `false` if tiles can be drawn outside their boundaries, `true` if they cannot.\n     */\n    isTileClipped?: boolean;\n    tileID?: CanonicalTileID;\n    /**\n     * `true` if tiles should be sent back to the worker for each overzoomed zoom level, `false` if not.\n     */\n    reparseOverscaled?: boolean;\n    vectorLayerIds?: Array<string>;\n    /**\n     * True if the source has transition, false otherwise.\n     */\n    hasTransition(): boolean;\n    /**\n     * True if the source is loaded, false otherwise.\n     */\n    loaded(): boolean;\n    /**\n     * An ability to fire an event to all the listeners, see {@link Evented}\n     * @param event - The event to fire\n     */\n    fire(event: Event): unknown;\n    /**\n     * This method is called when the source is added to the map.\n     * @param map - The map instance\n     */\n    onAdd?(map: Map): void;\n    /**\n     * This method is called when the source is removed from the map.\n     * @param map - The map instance\n     */\n    onRemove?(map: Map): void;\n    /**\n     * This method does the heavy lifting of loading a tile.\n     * In most cases it will defer the work to the relevant worker source.\n     * @param tile - The tile to load\n     */\n    loadTile(tile: Tile): Promise<void>;\n    /**\n     * True is the tile is part of the source, false otherwise.\n     * @param tileID - The tile ID\n     */\n    hasTile?(tileID: OverscaledTileID): boolean;\n    /**\n     * Allows to abort a tile loading.\n     * @param tile - The tile to abort\n     */\n    abortTile?(tile: Tile): Promise<void>;\n    /**\n     * Allows to unload a tile.\n     * @param tile - The tile to unload\n     */\n    unloadTile?(tile: Tile): Promise<void>;\n    /**\n     * @returns A plain (stringifiable) JS object representing the current state of the source.\n     * Creating a source using the returned object as the `options` should result in a Source that is\n     * equivalent to this one.\n     */\n    serialize(): any;\n    /**\n     * Allows to execute a prepare step before the source is used.\n     */\n    prepare?(): void;\n    /**\n     * Optional function to redefine how tiles are loaded at high pitch angles.\n     */\n    calculateTileZoom?: CalculateTileZoomFunction;\n    /**\n     * Optional function to determine whether a tile should be reloaded, given a\n     * set of options associated with a `MapSourceDataChangedEvent`.\n     * @internal\n     */\n    shouldReloadTile?(tile: Tile, options: GeoJSONSourceShouldReloadTileOptions): boolean;\n}\n\n/**\n * A general definition of a {@link Source} class for factory usage\n */\nexport type SourceClass = {\n    new (id: string, specification: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented): Source;\n};\n\n/**\n * Creates a tiled data source instance given an options object.\n *\n * @param id - The id for the source. Must not be used by any existing source.\n * @param specification - Source options, specific to the source type (except for `options.type`, which is always required).\n * @param source - A source definition object compliant with\n * [`maplibre-gl-style-spec`](https://maplibre.org/maplibre-style-spec/#sources) or, for a third-party source type,\n  * with that type's requirements.\n * @param dispatcher - A {@link Dispatcher} instance, which can be used to send messages to the workers.\n * @returns a newly created source\n */\nexport const create = (id: string, specification: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented): Source => {\n\n    const Class = getSourceType(specification.type);\n    const source = new Class(id, specification, dispatcher, eventedParent);\n\n    if (source.id !== id) {\n        throw new Error(`Expected Source id to be ${id} instead of ${source.id}`);\n    }\n\n    return source;\n};\n\nconst getSourceType = (name: string): SourceClass => {\n    switch (name) {\n        case 'geojson':\n            return GeoJSONSource;\n        case 'image':\n            return ImageSource;\n        case 'raster':\n            return RasterTileSource;\n        case 'raster-dem':\n            return RasterDEMTileSource;\n        case 'vector':\n            return VectorTileSource;\n        case 'video':\n            return VideoSource;\n        case 'canvas':\n            return CanvasSource;\n    }\n    return registeredSources[name];\n};\n\nconst setSourceType = (name: string, type: SourceClass) => {\n    registeredSources[name] = type;\n};\n\n/**\n * Adds a custom source type, making it available for use with {@link Map.addSource}.\n * @param name - The name of the source type; source definition objects use this name in the `{type: ...}` field.\n * @param SourceType - A {@link SourceClass} - which is a constructor for the `Source` interface.\n * @returns a promise that is resolved when the source type is ready or rejected with an error.\n */\nexport const addSourceType = async (name: string, SourceType: SourceClass): Promise<void> => {\n    if (getSourceType(name)) {\n        throw new Error(`A source type called \"${name}\" already exists.`);\n    }\n    setSourceType(name, SourceType);\n};\n","/**\n * The possible option of the plugin's status\n *\n * `unavailable`: Not loaded.\n *\n * `deferred`: The plugin URL has been specified, but loading has been deferred.\n *\n * `requested`: at least one tile needs RTL to render, but the plugin has not been set\n *\n * `loading`: RTL is in the process of being loaded by worker.\n *\n * `loaded`: The plugin is now loaded\n *\n *  `error`: The plugin failed to load\n */\nexport type RTLPluginStatus =\n                'unavailable' |\n                'deferred' |\n                'requested' |\n                'loading' |\n                'loaded' |\n                'error';\n\n/**\n * The RTL plugin state\n */\nexport type PluginState = {\n    pluginStatus: RTLPluginStatus;\n    pluginURL: string;\n};\n\nexport const RTLPluginLoadedEventName = 'RTLPluginLoaded';\n\n","\nimport {browser} from '../util/browser';\nimport {Event, Evented} from '../util/evented';\nimport {type RTLPluginStatus, RTLPluginLoadedEventName, type PluginState} from './rtl_text_plugin_status';\nimport {type Dispatcher, getGlobalDispatcher} from '../util/dispatcher';\nimport {MessageType} from '../util/actor_messages';\n\nclass RTLMainThreadPlugin extends Evented {\n    status: RTLPluginStatus = 'unavailable';\n    url: string = null;\n    dispatcher: Dispatcher = getGlobalDispatcher();\n\n    /** Sync RTL plugin state by broadcasting a message to the worker */\n    _syncState(statusToSend: RTLPluginStatus): Promise<PluginState[]> {\n        this.status = statusToSend;\n        return this.dispatcher.broadcast(MessageType.syncRTLPluginState, {pluginStatus: statusToSend, pluginURL: this.url})\n            .catch((e: any) => {\n                this.status = 'error';\n                throw e;\n            });\n    }\n\n    /** This one is exposed to outside */\n    getRTLTextPluginStatus(): RTLPluginStatus {\n        return this.status;\n    }\n\n    clearRTLTextPlugin(): void {\n        this.status = 'unavailable';\n        this.url = null;\n    }\n\n    async setRTLTextPlugin(url: string, deferred: boolean = false): Promise<void> {\n        if (this.url) {\n            // error\n            throw new Error('setRTLTextPlugin cannot be called multiple times.');\n        }\n\n        this.url = browser.resolveURL(url);\n        if (!this.url) {\n            throw new Error(`requested url ${url} is invalid`);\n        }\n        if (this.status === 'unavailable') {\n\n            // from initial state:\n            if (deferred) {\n\n                this.status = 'deferred';\n                // fire and forget: in this case it does not need wait for the broadcasting result\n                // it is important to sync the deferred status once because\n                // symbol_bucket will be checking it in worker\n                this._syncState(this.status);\n\n            } else {\n                return this._requestImport();\n            }\n\n        } else if (this.status === 'requested') {\n            return this._requestImport();\n        }\n    }\n\n    /** Send a message to worker which will import the RTL plugin script */\n    async _requestImport() : Promise<void> {\n\n        // all errors/exceptions will be handled by _syncState\n        await this._syncState('loading');\n        this.status = 'loaded';\n        this.fire(new Event(RTLPluginLoadedEventName));\n    }\n\n    /** Start a lazy loading process of RTL plugin */\n    lazyLoad(): void {\n        if (this.status === 'unavailable') {\n            this.status = 'requested';\n        } else if (this.status === 'deferred') {\n            this._requestImport();\n        }\n    }\n}\n\nlet rtlMainThreadPlugin: RTLMainThreadPlugin = null;\n\nexport function rtlMainThreadPluginFactory(): RTLMainThreadPlugin {\n    if (!rtlMainThreadPlugin) {\n        rtlMainThreadPlugin = new RTLMainThreadPlugin();\n    }\n    return rtlMainThreadPlugin;\n}\n","import {uniqueId, parseCacheControl} from '../util/util';\nimport {deserialize as deserializeBucket} from '../data/bucket';\nimport {GEOJSON_TILE_LAYER_NAME, type FeatureIndex, type QueryResults} from '../data/feature_index';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson';\nimport {featureFilter} from '@maplibre/maplibre-gl-style-spec';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {CollisionBoxArray} from '../data/array_types.g';\nimport {Texture} from '../render/texture';\nimport {now} from '../util/time_control';\nimport {toEvaluationFeature} from '../data/evaluation_feature';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {rtlMainThreadPluginFactory} from '../source/rtl_text_plugin_main_thread';\n\nconst CLOCK_SKEW_RETRY_TIMEOUT = 30000;\n\nimport type {SourceFeatureState} from '../source/source_state';\nimport type {Bucket} from '../data/bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {WorkerTileResult} from '../source/worker_source';\nimport type {Actor} from '../util/actor';\nimport type {DEMData} from '../data/dem_data';\nimport type {AlphaImage} from '../util/image';\nimport type {ImageAtlas} from '../render/image_atlas';\nimport type {ImageManager} from '../render/image_manager';\nimport type {Context} from '../gl/context';\nimport type {OverscaledTileID} from './tile_id';\nimport type {Framebuffer} from '../gl/framebuffer';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {LayerFeatureStates} from '../source/source_state';\nimport type Point from '@mapbox/point-geometry';\nimport type {mat4} from 'gl-matrix';\nimport type {ExpiryData} from '../util/ajax';\nimport type {QueryRenderedFeaturesOptionsStrict, QuerySourceFeatureOptionsStrict} from '../source/query_features';\nimport type {DashEntry} from '../render/line_atlas';\nimport type {VectorTileLayerLike} from '@maplibre/vt-pbf';\n/**\n * The tile's state, can be:\n *\n * - `loading` Tile data is in the process of loading.\n * - `loaded` Tile data has been loaded. Tile can be rendered.\n * - `reloading` Tile data has been loaded and is being updated. Tile can be rendered.\n * - `unloaded` Tile data has been deleted.\n * - `errored` Tile data was not loaded because of an error.\n * - `expired` Tile data was previously loaded, but has expired per its HTTP headers and is in the process of refreshing.\n */\nexport type TileState = 'loading' | 'loaded' | 'reloading' | 'unloaded' | 'errored' | 'expired';\n\n/** @internal */\ntype CrossFadeArgs = {\n    fadingRole: FadingRoles;\n    fadingDirection: FadingDirections;\n    fadingParentID?: OverscaledTileID;\n    fadeEndTime: number;\n};\n\nexport enum FadingRoles {\n    Base, Parent\n}\nexport enum FadingDirections {\n    Departing, Incoming\n}\n\n/**\n * A tile object is the combination of a Coordinate, which defines\n * its place, as well as a unique ID and data tracking for its content\n */\nexport class Tile {\n    tileID: OverscaledTileID;\n    uid: number;\n    uses: number;\n    tileSize: number;\n    buckets: {[_: string]: Bucket};\n    latestFeatureIndex: FeatureIndex | null;\n    latestRawTileData: ArrayBuffer;\n    latestEncoding: string;\n    imageAtlas: ImageAtlas;\n    imageAtlasTexture: Texture;\n    dashPositions: {[_: string]: DashEntry};\n    glyphAtlasImage: AlphaImage;\n    glyphAtlasTexture: Texture;\n    expirationTime: any;\n    expiredRequestCount: number;\n    state: TileState;\n    fadingRole: FadingRoles;\n    fadingDirection: FadingDirections;\n    fadingParentID: OverscaledTileID;\n    selfFading: boolean;\n    timeAdded: number = 0;\n    fadeEndTime: number = 0;\n    fadeOpacity: number = 1;\n    collisionBoxArray: CollisionBoxArray;\n    redoWhenDone: boolean;\n    showCollisionBoxes: boolean;\n    placementSource: any;\n    actor: Actor;\n    vtLayers: {[_: string]: VectorTileLayerLike};\n\n    neighboringTiles: Record<string, {backfilled: boolean}>;\n    dem: DEMData;\n    demMatrix: mat4;\n    aborted: boolean;\n    needsHillshadePrepare: boolean;\n    needsTerrainPrepare: boolean;\n    abortController: AbortController;\n    texture: any;\n    fbo: Framebuffer;\n    demTexture: Texture;\n    refreshedUponExpiration: boolean;\n    reloadPromise: {resolve: () => void; reject: () => void};\n    resourceTiming: Array<PerformanceResourceTiming>;\n    queryPadding: number;\n\n    symbolFadeHoldUntil: number;\n    hasSymbolBuckets: boolean;\n    hasRTLText: boolean;\n    dependencies: any;\n    rtt: Array<{id: number; stamp: number}>;\n    rttCoords: {[_:string]: string};\n\n    /**\n     * @param tileID - the tile ID\n     * @param size - The tile size\n     */\n    constructor(tileID: OverscaledTileID, size: number) {\n        this.tileID = tileID;\n        this.uid = uniqueId();\n        this.uses = 0;\n        this.tileSize = size;\n        this.buckets = {};\n        this.expirationTime = null;\n        this.queryPadding = 0;\n        this.hasSymbolBuckets = false;\n        this.hasRTLText = false;\n        this.dependencies = {};\n        this.rtt = [];\n        this.rttCoords = {};\n\n        // Counts the number of times a response was already expired when\n        // received. We're using this to add a delay when making a new request\n        // so we don't have to keep retrying immediately in case of a server\n        // serving expired tiles.\n        this.expiredRequestCount = 0;\n\n        this.state = 'loading';\n    }\n\n    isRenderable(symbolLayer: boolean): boolean {\n        return (\n            this.hasData() &&\n            (!this.fadeEndTime || this.fadeOpacity > 0) &&  // raster fading\n            (symbolLayer || !this.holdingForSymbolFade())   // symbol fading\n        );\n    }\n\n    /**\n     * @internal\n     * Many-to-one crossfade between a base tile and parent/ancestor tile (when zooming)\n     */\n    setCrossFadeLogic({fadingRole, fadingDirection, fadingParentID, fadeEndTime}: CrossFadeArgs) {\n        this.resetFadeLogic();\n\n        this.fadingRole = fadingRole;\n        this.fadingDirection = fadingDirection;\n        this.fadingParentID = fadingParentID;\n        this.fadeEndTime = fadeEndTime;\n    }\n\n    /**\n     * Self fading for edge tiles (when panning map)\n     */\n    setSelfFadeLogic(fadeEndTime: number) {\n        this.resetFadeLogic();\n        this.selfFading = true;\n        this.fadeEndTime = fadeEndTime;\n    }\n\n    resetFadeLogic() {\n        this.fadingRole = null;\n        this.fadingDirection = null;\n        this.fadingParentID = null;\n        this.selfFading = false;\n\n        this.timeAdded = now();\n        this.fadeEndTime = 0;\n        this.fadeOpacity = 1;\n    }\n\n    wasRequested() {\n        return this.state === 'errored' || this.state === 'loaded' || this.state === 'reloading';\n    }\n\n    clearTextures(painter: any) {\n        if (this.demTexture) painter.saveTileTexture(this.demTexture);\n        this.demTexture = null;\n    }\n\n    /**\n     * Given a data object with a 'buffers' property, load it into\n     * this tile's elementGroups and buffers properties and set loaded\n     * to true. If the data is null, like in the case of an empty\n     * GeoJSON tile, no-op but still set loaded to true.\n     * @param data - The data from the worker\n     * @param painter - the painter\n     * @param justReloaded - `true` to just reload\n     */\n    loadVectorData(data: WorkerTileResult, painter: any, justReloaded?: boolean | null) {\n        if (this.hasData()) {\n            this.unloadVectorData();\n        }\n\n        this.state = 'loaded';\n\n        // empty GeoJSON tile\n        if (!data) {\n            this.collisionBoxArray = new CollisionBoxArray();\n            return;\n        }\n\n        if (data.featureIndex) {\n            this.latestFeatureIndex = data.featureIndex;\n            if (data.rawTileData) {\n                // Only vector tiles have rawTileData, and they won't update it for\n                // 'reloadTile'\n                this.latestRawTileData = data.rawTileData;\n                this.latestFeatureIndex.rawTileData = data.rawTileData;\n                this.latestFeatureIndex.encoding = data.encoding;\n            } else if (this.latestRawTileData) {\n                // If rawTileData hasn't updated, hold onto a pointer to the last\n                // one we received\n                this.latestFeatureIndex.rawTileData = this.latestRawTileData;\n                this.latestFeatureIndex.encoding = this.latestEncoding;\n            }\n        }\n        this.collisionBoxArray = data.collisionBoxArray;\n        this.buckets = deserializeBucket(data.buckets, painter?.style);\n\n        this.hasSymbolBuckets = false;\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            if (bucket instanceof SymbolBucket) {\n                this.hasSymbolBuckets = true;\n                if (justReloaded) {\n                    bucket.justReloaded = true;\n                } else {\n                    break;\n                }\n            }\n        }\n\n        this.hasRTLText = false;\n        if (this.hasSymbolBuckets) {\n            for (const id in this.buckets) {\n                const bucket = this.buckets[id];\n                if (bucket instanceof SymbolBucket) {\n                    if (bucket.hasRTLText) {\n                        this.hasRTLText = true;\n                        rtlMainThreadPluginFactory().lazyLoad();\n                        break;\n                    }\n                }\n            }\n        }\n\n        this.queryPadding = 0;\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            this.queryPadding = Math.max(this.queryPadding, painter.style.getLayer(id).queryRadius(bucket));\n        }\n\n        if (data.imageAtlas) {\n            this.imageAtlas = data.imageAtlas;\n        }\n        if (data.glyphAtlasImage) {\n            this.glyphAtlasImage = data.glyphAtlasImage;\n        }\n        this.dashPositions = data.dashPositions;\n    }\n\n    /**\n     * Release any data or WebGL resources referenced by this tile.\n     */\n    unloadVectorData() {\n        for (const id in this.buckets) {\n            this.buckets[id].destroy();\n        }\n        this.buckets = {};\n\n        if (this.imageAtlasTexture) {\n            this.imageAtlasTexture.destroy();\n        }\n\n        if (this.imageAtlas) {\n            this.imageAtlas = null;\n        }\n\n        if (this.glyphAtlasTexture) {\n            this.glyphAtlasTexture.destroy();\n        }\n\n        if (this.dashPositions) {\n            this.dashPositions = null;\n        }\n\n        this.latestFeatureIndex = null;\n        this.state = 'unloaded';\n    }\n\n    getBucket(layer: StyleLayer) {\n        return this.buckets[layer.id];\n    }\n\n    upload(context: Context) {\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            if (bucket.uploadPending()) {\n                bucket.upload(context);\n            }\n        }\n\n        const gl = context.gl;\n        if (this.imageAtlas && !this.imageAtlas.uploaded) {\n            this.imageAtlasTexture = new Texture(context, this.imageAtlas.image, gl.RGBA);\n            this.imageAtlas.uploaded = true;\n        }\n\n        if (this.glyphAtlasImage) {\n            this.glyphAtlasTexture = new Texture(context, this.glyphAtlasImage, gl.ALPHA);\n            this.glyphAtlasImage = null;\n        }\n    }\n\n    prepare(imageManager: ImageManager) {\n        if (this.imageAtlas) {\n            this.imageAtlas.patchUpdatedImages(imageManager, this.imageAtlasTexture);\n        }\n    }\n\n    // Queries non-symbol features rendered for this tile.\n    // Symbol features are queried globally\n    queryRenderedFeatures(\n        layers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState: SourceFeatureState,\n        queryGeometry: Array<Point>,\n        cameraQueryGeometry: Array<Point>,\n        scale: number,\n        params: Pick<QueryRenderedFeaturesOptionsStrict, 'filter' | 'layers' | 'availableImages'> | undefined,\n        transform: IReadonlyTransform,\n        maxPitchScaleFactor: number,\n        pixelPosMatrix: mat4,\n        getElevation: undefined | ((x: number, y: number) => number)\n    ): QueryResults {\n        if (!this.latestFeatureIndex || !this.latestFeatureIndex.rawTileData)\n            return {};\n\n        return this.latestFeatureIndex.query({\n            queryGeometry,\n            cameraQueryGeometry,\n            scale,\n            tileSize: this.tileSize,\n            pixelPosMatrix,\n            transform,\n            params,\n            queryPadding: this.queryPadding * maxPitchScaleFactor,\n            getElevation\n        }, layers, serializedLayers, sourceFeatureState);\n    }\n\n    querySourceFeatures(result: Array<GeoJSONFeature>, params?: QuerySourceFeatureOptionsStrict) {\n        const featureIndex = this.latestFeatureIndex;\n        if (!featureIndex || !featureIndex.rawTileData) return;\n\n        const vtLayers = featureIndex.loadVTLayers();\n\n        const sourceLayer = params && params.sourceLayer ? params.sourceLayer : '';\n        const layer = vtLayers[GEOJSON_TILE_LAYER_NAME] || vtLayers[sourceLayer];\n\n        if (!layer) return;\n\n        const filter = featureFilter(params?.filter, params?.globalState);\n        const {z, x, y} = this.tileID.canonical;\n        const coord = {z, x, y};\n\n        for (let i = 0; i < layer.length; i++) {\n            const feature = layer.feature(i);\n            if (filter.needGeometry) {\n                const evaluationFeature = toEvaluationFeature(feature, true);\n                if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), evaluationFeature, this.tileID.canonical)) continue;\n            } else if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), feature)) {\n                continue;\n            }\n            const id = featureIndex.getId(feature, sourceLayer);\n            const geojsonFeature = new GeoJSONFeature(feature, z, x, y, id);\n            (geojsonFeature as any).tile = coord;\n            result.push(geojsonFeature);\n        }\n    }\n\n    hasData() {\n        return this.state === 'loaded' || this.state === 'reloading' || this.state === 'expired';\n    }\n\n    patternsLoaded() {\n        return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length;\n    }\n\n    setExpiryData(data: ExpiryData) {\n        const prior = this.expirationTime;\n\n        if (data.cacheControl) {\n            const parsedCC = parseCacheControl(data.cacheControl);\n            if (parsedCC['max-age']) this.expirationTime = Date.now() + parsedCC['max-age'] * 1000;\n        } else if (data.expires) {\n            this.expirationTime = new Date(data.expires).getTime();\n        }\n\n        if (this.expirationTime) {\n            const now = Date.now();\n            let isExpired = false;\n\n            if (this.expirationTime > now) {\n                isExpired = false;\n            } else if (!prior) {\n                isExpired = true;\n            } else if (this.expirationTime < prior) {\n                // Expiring date is going backwards:\n                // fall back to exponential backoff\n                isExpired = true;\n\n            } else {\n                const delta = this.expirationTime - prior;\n\n                if (!delta) {\n                    // Server is serving the same expired resource over and over: fall\n                    // back to exponential backoff.\n                    isExpired = true;\n\n                } else {\n                    // Assume that either the client or the server clock is wrong and\n                    // try to interpolate a valid expiration date (from the client POV)\n                    // observing a minimum timeout.\n                    this.expirationTime = now + Math.max(delta, CLOCK_SKEW_RETRY_TIMEOUT);\n\n                }\n            }\n\n            if (isExpired) {\n                this.expiredRequestCount++;\n                this.state = 'expired';\n            } else {\n                this.expiredRequestCount = 0;\n            }\n        }\n    }\n\n    getExpiryTimeout() {\n        if (this.expirationTime) {\n            if (this.expiredRequestCount) {\n                return 1000 * (1 << Math.min(this.expiredRequestCount - 1, 31));\n            } else {\n                // Max value for `setTimeout` implementations is a 32 bit integer; cap this accordingly\n                return Math.min(this.expirationTime - new Date().getTime(), Math.pow(2, 31) - 1);\n            }\n        }\n    }\n\n    setFeatureState(states: LayerFeatureStates, painter: any) {\n        if (!this.latestFeatureIndex ||\n            !this.latestFeatureIndex.rawTileData ||\n            Object.keys(states).length === 0) {\n            return;\n        }\n\n        const vtLayers = this.latestFeatureIndex.loadVTLayers();\n\n        for (const id in this.buckets) {\n            if (!painter.style.hasLayer(id)) continue;\n\n            const bucket = this.buckets[id];\n            // Buckets are grouped by common source-layer\n            const sourceLayerId = bucket.layers[0]['sourceLayer'] || GEOJSON_TILE_LAYER_NAME;\n            const sourceLayer = vtLayers[sourceLayerId];\n            const sourceLayerStates = states[sourceLayerId];\n            if (!sourceLayer || !sourceLayerStates || Object.keys(sourceLayerStates).length === 0) continue;\n\n            bucket.update(sourceLayerStates, sourceLayer, this.imageAtlas && this.imageAtlas.patternPositions || {}, this.dashPositions || {});\n            const layer = painter && painter.style && painter.style.getLayer(id);\n            if (layer) {\n                this.queryPadding = Math.max(this.queryPadding, layer.queryRadius(bucket));\n            }\n        }\n    }\n\n    holdingForSymbolFade(): boolean {\n        return this.symbolFadeHoldUntil !== undefined;\n    }\n\n    symbolFadeFinished(): boolean {\n        return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < now();\n    }\n\n    clearSymbolFadeHold() {\n        this.symbolFadeHoldUntil = undefined;\n    }\n\n    setSymbolHoldDuration(duration: number) {\n        this.symbolFadeHoldUntil = now() + duration;\n    }\n\n    setDependencies(namespace: string, dependencies: Array<string>) {\n        const index = {};\n        for (const dep of dependencies) {\n            index[dep] = true;\n        }\n        this.dependencies[namespace] = index;\n    }\n\n    hasDependency(namespaces: Array<string>, keys: Array<string>) {\n        for (const namespace of namespaces) {\n            const dependencies = this.dependencies[namespace];\n            if (dependencies) {\n                for (const key of keys) {\n                    if (dependencies[key]) {\n                        return true;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n}\n","import type {CollisionBoxArray} from './array_types.g';\nimport type {Style} from '../style/style';\nimport type {TypedStyleLayer} from '../style/style_layer/typed_style_layer';\nimport type {FeatureIndex} from './feature_index';\nimport type {Context} from '../gl/context';\nimport type {FeatureStates} from '../source/source_state';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {CanonicalTileID} from '../tile/tile_id';\nimport type Point from '@mapbox/point-geometry';\nimport type {SubdivisionGranularitySetting} from '../render/subdivision_granularity_settings';\nimport type {DashEntry} from '../render/line_atlas';\nimport type {Feature as StyleFeature} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTileFeatureLike, VectorTileLayerLike} from '@maplibre/vt-pbf';\n\nexport type BucketParameters<Layer extends TypedStyleLayer> = {\n    index: number;\n    layers: Array<Layer>;\n    zoom: number;\n    pixelRatio: number;\n    overscaling: number;\n    collisionBoxArray: CollisionBoxArray;\n    sourceLayerIndex: number;\n    sourceID: string;\n};\n\nexport type PopulateParameters = {\n    featureIndex: FeatureIndex;\n    iconDependencies: {};\n    patternDependencies: {};\n    glyphDependencies: {};\n    dashDependencies: Record<string, {round: boolean; dasharray: Array<number>}>;\n    availableImages: Array<string>;\n    subdivisionGranularity: SubdivisionGranularitySetting;\n};\n\nexport type IndexedFeature = {\n    feature: VectorTileFeatureLike;\n    id: number | string;\n    index: number;\n    sourceLayerIndex: number;\n};\n\nexport type BucketFeature = {\n    index: number;\n    sourceLayerIndex: number;\n    geometry: Array<Array<Point>>;\n    properties: any;\n    type: 0 | 1 | 2 | 3;\n    id?: any;\n    readonly patterns: {\n        [_: string]: {\n            'min': string;\n            'mid': string;\n            'max': string;\n        };\n    };\n    readonly dashes?: NonNullable<StyleFeature['dashes']>;\n    sortKey?: number;\n};\n\n/**\n * @hidden\n * The `Bucket` interface is the single point of knowledge about turning vector\n * tiles into WebGL buffers.\n *\n * `Bucket` is an abstract interface. An implementation exists for each style layer type.\n * Create a bucket via the `StyleLayer.createBucket` method.\n *\n * The concrete bucket types, using layout options from the style layer,\n * transform feature geometries into vertex and index data for use by the\n * vertex shader.  They also (via `ProgramConfiguration`) use feature\n * properties and the zoom level to populate the attributes needed for\n * data-driven styling.\n *\n * Buckets are designed to be built on a worker thread and then serialized and\n * transferred back to the main thread for rendering.  On the worker side, a\n * bucket's vertex, index, and attribute data is stored in `bucket.arrays: ArrayGroup`.\n * When a bucket's data is serialized and sent back to the main thread,\n * is gets deserialized (using `new Bucket(serializedBucketData)`, with\n * the array data now stored in `bucket.buffers: BufferGroup`. BufferGroups\n * hold the same data as ArrayGroups, but are tuned for consumption by WebGL.\n */\nexport interface Bucket {\n    layerIds: Array<string>;\n    hasDependencies: boolean;\n    readonly layers: Array<any>;\n    readonly stateDependentLayers: Array<any>;\n    readonly stateDependentLayerIds: Array<string>;\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;\n    update(states: FeatureStates, vtLayer: VectorTileLayerLike, imagePositions: {[_: string]: ImagePosition}, dashPositions: Record<string, DashEntry>): void;\n    isEmpty(): boolean;\n    upload(context: Context): void;\n    uploadPending(): boolean;\n    /**\n     * Release the WebGL resources associated with the buffers. Note that because\n     * buckets are shared between layers having the same layout properties, they\n     * must be destroyed in groups (all buckets for a tile, or all symbol buckets).\n     */\n    destroy(): void;\n}\n\nexport function deserialize(input: Array<Bucket>, style: Style): {[_: string]: Bucket} {\n    const output = {};\n\n    // Guard against the case where the map's style has been set to null while\n    // this bucket has been parsing.\n    if (!style) return output;\n\n    for (const bucket of input) {\n        const layers = bucket.layerIds\n            .map((id) => style.getLayer(id))\n            .filter(Boolean);\n\n        if (layers.length === 0) {\n            continue;\n        }\n\n        // look up StyleLayer objects from layer ids (since we don't\n        // want to waste time serializing/copying them from the worker)\n        (bucket as any).layers = layers;\n        if (bucket.stateDependentLayerIds) {\n            (bucket as any).stateDependentLayers = bucket.stateDependentLayerIds.map((lId) => layers.filter((l) => l.id === lId)[0]);\n        }\n        for (const layer of layers) {\n            output[layer.id] = bucket;\n        }\n    }\n\n    return output;\n}\n","import {extend} from '../util/util';\nimport type {Tile} from '../tile/tile';\nimport type {FeatureState} from '@maplibre/maplibre-gl-style-spec';\nimport type {InViewTiles} from '../tile/tile_manager_in_view_tiles';\n\nexport type FeatureStates = {[featureId: string]: FeatureState};\nexport type LayerFeatureStates = {[layer: string]: FeatureStates};\n\n/**\n * @internal\n * SourceFeatureState manages the state and pending changes\n * to features in a source, separated by source layer.\n * stateChanges and deletedStates batch all changes to the tile (updates and removes, respectively)\n * between coalesce() events. addFeatureState() and removeFeatureState() also update their counterpart's\n * list of changes, such that coalesce() can apply the proper state changes while agnostic to the order of operations.\n * In deletedStates, all null's denote complete removal of state at that scope\n*/\nexport class SourceFeatureState {\n    state: LayerFeatureStates;\n    stateChanges: LayerFeatureStates;\n    deletedStates: {};\n\n    constructor() {\n        this.state = {};\n        this.stateChanges = {};\n        this.deletedStates = {};\n    }\n\n    updateState(sourceLayer: string, featureId: number | string, newState: any) {\n        const feature = String(featureId);\n        this.stateChanges[sourceLayer] = this.stateChanges[sourceLayer] || {};\n        this.stateChanges[sourceLayer][feature] = this.stateChanges[sourceLayer][feature] || {};\n        extend(this.stateChanges[sourceLayer][feature], newState);\n\n        if (this.deletedStates[sourceLayer] === null) {\n            this.deletedStates[sourceLayer] = {};\n            for (const ft in this.state[sourceLayer]) {\n                if (ft !== feature) this.deletedStates[sourceLayer][ft] = null;\n            }\n        } else {\n            const featureDeletionQueued = this.deletedStates[sourceLayer] && this.deletedStates[sourceLayer][feature] === null;\n            if (featureDeletionQueued) {\n                this.deletedStates[sourceLayer][feature] = {};\n                for (const prop in this.state[sourceLayer][feature]) {\n                    if (!newState[prop]) this.deletedStates[sourceLayer][feature][prop] = null;\n                }\n            } else {\n                for (const key in newState) {\n                    const deletionInQueue = this.deletedStates[sourceLayer] && this.deletedStates[sourceLayer][feature] && this.deletedStates[sourceLayer][feature][key] === null;\n                    if (deletionInQueue) delete this.deletedStates[sourceLayer][feature][key];\n                }\n            }\n        }\n    }\n\n    removeFeatureState(sourceLayer: string, featureId?: number | string, key?: string) {\n        const sourceLayerDeleted = this.deletedStates[sourceLayer] === null;\n        if (sourceLayerDeleted) return;\n\n        const feature = String(featureId);\n\n        this.deletedStates[sourceLayer] = this.deletedStates[sourceLayer] || {};\n\n        if (key && featureId !== undefined) {\n            if (this.deletedStates[sourceLayer][feature] !== null) {\n                this.deletedStates[sourceLayer][feature] = this.deletedStates[sourceLayer][feature] || {};\n                this.deletedStates[sourceLayer][feature][key] = null;\n            }\n        } else if (featureId !== undefined) {\n            const updateInQueue = this.stateChanges[sourceLayer] && this.stateChanges[sourceLayer][feature];\n            if (updateInQueue) {\n                this.deletedStates[sourceLayer][feature] = {};\n                for (key in this.stateChanges[sourceLayer][feature]) this.deletedStates[sourceLayer][feature][key] = null;\n\n            } else {\n                this.deletedStates[sourceLayer][feature] = null;\n            }\n        } else {\n            this.deletedStates[sourceLayer] = null;\n        }\n\n    }\n\n    getState(sourceLayer: string, featureId: number | string) {\n        const feature = String(featureId);\n        const base = this.state[sourceLayer] || {};\n        const changes = this.stateChanges[sourceLayer] || {};\n\n        const reconciledState = extend({}, base[feature], changes[feature]);\n\n        //return empty object if the whole source layer is awaiting deletion\n        if (this.deletedStates[sourceLayer] === null) return {};\n        else if (this.deletedStates[sourceLayer]) {\n            const featureDeletions = this.deletedStates[sourceLayer][featureId];\n            if (featureDeletions === null) return {};\n            for (const prop in featureDeletions) delete reconciledState[prop];\n        }\n        return reconciledState;\n    }\n\n    initializeTileState(tile: Tile, painter: any) {\n        tile.setFeatureState(this.state, painter);\n    }\n\n    coalesceChanges(inViewTiles: InViewTiles, painter: any) {\n        //track changes with full state objects, but only for features that got modified\n        const featuresChanged: LayerFeatureStates = {};\n\n        for (const sourceLayer in this.stateChanges) {\n            this.state[sourceLayer]  = this.state[sourceLayer] || {};\n            const layerStates = {};\n            for (const feature in this.stateChanges[sourceLayer]) {\n                if (!this.state[sourceLayer][feature]) this.state[sourceLayer][feature] = {};\n                extend(this.state[sourceLayer][feature], this.stateChanges[sourceLayer][feature]);\n                layerStates[feature] = this.state[sourceLayer][feature];\n            }\n            featuresChanged[sourceLayer] = layerStates;\n        }\n\n        for (const sourceLayer in this.deletedStates) {\n            this.state[sourceLayer]  = this.state[sourceLayer] || {};\n            const layerStates = {};\n\n            if (this.deletedStates[sourceLayer] === null) {\n                for (const ft in this.state[sourceLayer]) {\n                    layerStates[ft] = {};\n                    this.state[sourceLayer][ft] = {};\n                }\n            } else {\n                for (const feature in this.deletedStates[sourceLayer]) {\n                    const deleteWholeFeatureState = this.deletedStates[sourceLayer][feature] === null;\n                    if (deleteWholeFeatureState) this.state[sourceLayer][feature] = {};\n                    else {\n                        for (const key of Object.keys(this.deletedStates[sourceLayer][feature])) {\n                            delete this.state[sourceLayer][feature][key];\n                        }\n                    }\n                    layerStates[feature] = this.state[sourceLayer][feature];\n                }\n            }\n\n            featuresChanged[sourceLayer] = featuresChanged[sourceLayer] || {};\n            extend(featuresChanged[sourceLayer], layerStates);\n        }\n\n        this.stateChanges = {};\n        this.deletedStates = {};\n\n        if (Object.keys(featuresChanged).length === 0) return;\n\n        inViewTiles.setFeatureState(featuresChanged, painter);\n    }\n}\n","import {mat4} from 'gl-matrix';\nimport {EXTENT} from '../../data/extent';\nimport {clamp, degreesToRadians, MAX_VALID_LATITUDE, zoomScale} from '../../util/util';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from '../mercator_coordinate';\nimport Point from '@mapbox/point-geometry';\nimport type {UnwrappedTileIDType} from '../transform_helper';\nimport type {LngLat} from '../lng_lat';\n\n/*\n* The maximum angle to use for the Mercator horizon. This must be less than 90\n* to prevent errors in `MercatorTransform::_calcMatrices()`. It shouldn't be too close\n* to 90, or the distance to the horizon will become very large, unnecessarily increasing\n* the number of tiles needed to render the map.\n*/\nexport const maxMercatorHorizonAngle = 89.25;\n\n/**\n * Returns mercator coordinates in range 0..1 for given coordinates inside a specified tile.\n * @param inTileX - X coordinate in tile units - range [0..EXTENT].\n * @param inTileY - Y coordinate in tile units - range [0..EXTENT].\n * @param canonicalTileID - Tile canonical ID - mercator X, Y and zoom.\n * @returns Mercator coordinates of the specified point in range [0..1].\n */\nexport function tileCoordinatesToMercatorCoordinates(inTileX: number, inTileY: number, canonicalTileID: {x: number; y: number; z: number}): MercatorCoordinate {\n    const scale = 1.0 / (1 << canonicalTileID.z);\n    return new MercatorCoordinate(\n        inTileX / EXTENT * scale + canonicalTileID.x * scale,\n        inTileY / EXTENT * scale + canonicalTileID.y * scale\n    );\n}\n\n/**\n * Returns LngLat for given in-tile coordinates and tile ID.\n * @param inTileX - X coordinate in tile units - range [0..EXTENT].\n * @param inTileY - Y coordinate in tile units - range [0..EXTENT].\n * @param canonicalTileID - Tile canonical ID - mercator X, Y and zoom.\n */\nexport function tileCoordinatesToLocation(inTileX: number, inTileY: number, canonicalTileID: {x: number; y: number; z: number}): LngLat {\n    return tileCoordinatesToMercatorCoordinates(inTileX, inTileY, canonicalTileID).toLngLat();\n}\n\n/**\n * Convert from LngLat to world coordinates (Mercator coordinates scaled by world size).\n * @param worldSize - Mercator world size computed from zoom level and tile size.\n * @param lnglat - The location to convert.\n * @returns Point\n */\nexport function projectToWorldCoordinates(worldSize: number, lnglat: LngLat): Point {\n    const lat = clamp(lnglat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);\n    return new Point(\n        mercatorXfromLng(lnglat.lng) * worldSize,\n        mercatorYfromLat(lat) * worldSize);\n}\n\n/**\n * Convert from world coordinates (mercator coordinates scaled by world size) to LngLat.\n * @param worldSize - Mercator world size computed from zoom level and tile size.\n * @param point - World coordinate.\n * @returns LngLat\n */\nexport function unprojectFromWorldCoordinates(worldSize: number, point: Point): LngLat {\n    return new MercatorCoordinate(point.x / worldSize, point.y / worldSize).toLngLat();\n}\n\n/**\n * Calculate pixel height of the visible horizon in relation to map-center (e.g. height/2),\n * multiplied by a static factor to simulate the earth-radius.\n * The calculated value is the horizontal line from the camera-height to sea-level.\n * @returns Horizon above center in pixels.\n */\nexport function getMercatorHorizon(transform: {pitch: number; cameraToCenterDistance: number}): number {\n    return transform.cameraToCenterDistance * Math.min(Math.tan(degreesToRadians(90 - transform.pitch)) * 0.85,\n        Math.tan(degreesToRadians(maxMercatorHorizonAngle - transform.pitch)));\n}\n\nexport function calculateTileMatrix(unwrappedTileID: UnwrappedTileIDType, worldSize: number): mat4 {\n    const canonical = unwrappedTileID.canonical;\n    const scale = worldSize / zoomScale(canonical.z);\n    const unwrappedX = canonical.x + Math.pow(2, canonical.z) * unwrappedTileID.wrap;\n\n    const worldMatrix = mat4.identity(new Float64Array(16) as any);\n    mat4.translate(worldMatrix, worldMatrix, [unwrappedX * scale, canonical.y * scale, 0]);\n    mat4.scale(worldMatrix, worldMatrix, [scale / EXTENT, scale / EXTENT, 1]);\n    return worldMatrix;\n}\n\nexport function cameraMercatorCoordinateFromCenterAndRotation(center: LngLat, elevation: number, pitch: number, bearing: number, distance: number): MercatorCoordinate {\n    const centerMercator = MercatorCoordinate.fromLngLat(center, elevation);\n    const mercUnitsPerMeter = mercatorZfromAltitude(1, center.lat);\n    const dMercator = distance * mercUnitsPerMeter;\n    const {x, y, z} = cameraDirectionFromPitchBearing(pitch, bearing);\n    const dxMercator = dMercator * -x;\n    const dyMercator = dMercator * -y;\n    const dzMercator = dMercator * -z;\n    return new MercatorCoordinate(centerMercator.x + dxMercator, centerMercator.y + dyMercator, centerMercator.z + dzMercator);\n}\n\nexport function cameraDirectionFromPitchBearing(pitch: number, bearing: number): {x: number; y: number; z: number} {\n    const pitchRadians = degreesToRadians(pitch);\n    const bearingRadians = degreesToRadians(bearing);\n    const z = Math.cos(-pitchRadians);\n    const h = Math.sin(pitchRadians);\n    const x = h * Math.sin(bearingRadians);\n    const y = -h * Math.cos(bearingRadians);\n    return {x, y, z};\n}\n","import {OverscaledTileID} from '../../tile/tile_id';\nimport {vec2, type vec4} from 'gl-matrix';\nimport {MercatorCoordinate} from '../mercator_coordinate';\nimport {degreesToRadians, scaleZoom} from '../../util/util';\n\nimport type {IReadonlyTransform} from '../transform_interface';\nimport type {Terrain} from '../../render/terrain';\nimport type {Frustum} from '../../util/primitives/frustum';\nimport {maxMercatorHorizonAngle} from './mercator_utils';\nimport {type IBoundingVolume, IntersectionResult} from '../../util/primitives/bounding_volume';\n\ntype CoveringTilesResult = {\n    tileID: OverscaledTileID;\n    distanceSq: number;\n    tileDistanceToCamera: number;\n};\n\ntype CoveringTilesStackEntry = {\n    zoom: number;\n    x: number;\n    y: number;\n    wrap: number;\n    fullyVisible: boolean;\n};\n\nexport type CoveringTilesOptions = {\n    /**\n     * Smallest allowed tile zoom.\n     */\n    minzoom?: number;\n    /**\n     * Largest allowed tile zoom.\n     */\n    maxzoom?: number;\n    /**\n     * Whether to round or floor the target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.\n     */\n    roundZoom?: boolean;\n    /**\n     * Tile size, expressed in screen pixels.\n     */\n    tileSize: number;\n};\n\nexport type CoveringTilesOptionsInternal = CoveringTilesOptions & {\n    /**\n     * `true` if tiles should be sent back to the worker for each overzoomed zoom level, `false` if not.\n     * Fill this option when computing covering tiles for a source.\n     * When true, any tile at `maxzoom` level that should be overscaled to a greater zoom will have\n     * its zoom set to the overscaled greater zoom. When false, such tiles will have zoom set to `maxzoom`.\n     */\n    reparseOverscaled?: boolean;\n    /**\n     * When terrain is present, tile visibility will be computed in regards to the min and max elevations for each tile.\n     */\n    terrain?: Terrain;\n    /**\n     * Optional function to redefine how tiles are loaded at high pitch angles.\n     */\n    calculateTileZoom?: CalculateTileZoomFunction;\n};\n\n/**\n * Function to define how tiles are loaded at high pitch angles\n * @param requestedCenterZoom - the requested zoom level, valid at the center point.\n * @param distanceToTile2D - 2D distance from the camera to the candidate tile, in mercator units.\n * @param distanceToTileZ - vertical distance from the camera to the candidate tile, in mercator units.\n * @param distanceToCenter3D - distance from camera to center point, in mercator units\n * @param cameraVerticalFOV - camera vertical field of view, in degrees\n * @return the desired zoom level for this tile. May not be an integer.\n */\nexport type CalculateTileZoomFunction = (requestedCenterZoom: number,\n    distanceToTile2D: number,\n    distanceToTileZ: number,\n    distanceToCenter3D: number,\n    cameraVerticalFOV: number) => number;\n\n/**\n * A simple/heuristic function that returns whether the tile is visible under the current transform.\n * @returns an {@link IntersectionResult}.\n */\nexport function isTileVisible(frustum: Frustum, tileBoundingVolume: IBoundingVolume, plane?: vec4): IntersectionResult {\n    const frustumTest = tileBoundingVolume.intersectsFrustum(frustum);\n    if (!plane || frustumTest === IntersectionResult.None) {\n        return frustumTest;\n    }\n    const planeTest = tileBoundingVolume.intersectsPlane(plane);\n\n    if (planeTest === IntersectionResult.None) {\n        return IntersectionResult.None;\n    }\n\n    if (frustumTest === IntersectionResult.Full && planeTest === IntersectionResult.Full) {\n        return IntersectionResult.Full;\n    }\n\n    return IntersectionResult.Partial;\n}\n\n/**\n * Definite integral of cos(x)^p. The analytical solution is described in `developer-guides/covering-tiles.md`,\n * but here the integral is evaluated numerically.\n * @param p - the power to raise cos(x) to inside the itegral\n * @param x1 - the starting point of the integral.\n * @param x2 - the ending point of the integral.\n * @return the integral of cos(x)^p from x=x1 to x=x2\n */\nfunction integralOfCosXByP(p: number, x1: number, x2: number): number {\n    const numPoints = 10;\n    let sum = 0;\n    const dx = (x2 - x1 ) / numPoints;\n    // Midpoint integration\n    for( let i = 0; i < numPoints; i++)\n    {\n        const x = x1 + (i + 0.5)/numPoints * (x2 - x1);\n        sum += dx * Math.pow(Math.cos(x), p);\n    }\n    return sum;\n}\n\nexport function createCalculateTileZoomFunction(maxZoomLevelsOnScreen: number, tileCountMaxMinRatio: number): CalculateTileZoomFunction {\n    return function (requestedCenterZoom: number,\n        distanceToTile2D: number,\n        distanceToTileZ: number,\n        distanceToCenter3D: number,\n        cameraVerticalFOV: number): number {\n        /**\n        * Controls how tiles are loaded at high pitch angles. Higher numbers cause fewer, lower resolution\n        * tiles to be loaded. Calculate the value that will result in the selected number of zoom levels in\n        * the worst-case condition (when the horizon is at the top of the screen). For more information, see\n        * `developer-guides/covering-tiles.md`\n        */\n        const pitchTileLoadingBehavior = 2 * ((maxZoomLevelsOnScreen - 1) /\n            scaleZoom(Math.cos(degreesToRadians(maxMercatorHorizonAngle - cameraVerticalFOV)) /\n                Math.cos(degreesToRadians(maxMercatorHorizonAngle))) - 1);\n\n        const centerPitch = Math.acos(distanceToTileZ / distanceToCenter3D);\n        const tileCountPitch0 = 2 * integralOfCosXByP(pitchTileLoadingBehavior - 1, 0, degreesToRadians(cameraVerticalFOV / 2));\n        const highestPitch = Math.min(degreesToRadians(maxMercatorHorizonAngle), centerPitch + degreesToRadians(cameraVerticalFOV / 2));\n        const lowestPitch = Math.min(highestPitch, centerPitch - degreesToRadians(cameraVerticalFOV / 2));\n        const tileCount = integralOfCosXByP(pitchTileLoadingBehavior - 1, lowestPitch, highestPitch);\n        const thisTilePitch = Math.atan(distanceToTile2D / distanceToTileZ);\n        const distanceToTile3D = Math.hypot(distanceToTile2D, distanceToTileZ);\n\n        let thisTileDesiredZ = requestedCenterZoom;\n        // if distance to candidate tile is a tiny bit farther than distance to center,\n        // use the same zoom as the center. This is achieved by the scaling distance ratio by cos(fov/2)\n        thisTileDesiredZ = thisTileDesiredZ + scaleZoom(distanceToCenter3D / distanceToTile3D / Math.max(0.5, Math.cos(degreesToRadians(cameraVerticalFOV / 2))));\n        thisTileDesiredZ += pitchTileLoadingBehavior * scaleZoom(Math.cos(thisTilePitch)) / 2;\n        thisTileDesiredZ -= scaleZoom(Math.max(1, tileCount / tileCountPitch0 / tileCountMaxMinRatio)) / 2;\n        return thisTileDesiredZ;\n    };\n}\nconst defaultMaxZoomLevelsOnScreen = 9.314;\nconst defaultTileCountMaxMinRatio = 3.0;\nconst defaultCalculateTileZoom = createCalculateTileZoomFunction(defaultMaxZoomLevelsOnScreen, defaultTileCountMaxMinRatio);\n\n/**\n * Return what zoom level of a tile source would most closely cover the tiles displayed by this transform.\n * @param options - The options, most importantly the source's tile size.\n * @returns An integer zoom level at which all tiles will be visible.\n */\nexport function coveringZoomLevel(transform: IReadonlyTransform, options: CoveringTilesOptions): number {\n    const z = (options.roundZoom ? Math.round : Math.floor)(\n        transform.zoom + scaleZoom(transform.tileSize / options.tileSize)\n    );\n    // At negative zoom levels load tiles from z0 because negative tile zoom levels don't exist.\n    return Math.max(0, z);\n}\n\n/**\n * Returns a list of tiles that optimally covers the screen. Adapted for globe projection.\n * Correctly handles LOD when moving over the antimeridian.\n * @param transform - The transform instance.\n * @param frustum - The covering frustum.\n * @param plane - The clipping plane used by globe transform, or null.\n * @param cameraCoord - The x, y, z position of the camera in MercatorCoordinates.\n * @param centerCoord - The x, y, z position of the center point in MercatorCoordinates.\n * @param options - Additional coveringTiles options.\n * @param details - Interface to define required helper functions.\n * @returns A list of tile coordinates, ordered by ascending distance from camera.\n */\nexport function coveringTiles(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): OverscaledTileID[] {\n    const frustum = transform.getCameraFrustum();\n    const plane = transform.getClippingPlane();\n    const cameraCoord = transform.screenPointToMercatorCoordinate(transform.getCameraPoint());\n    const centerCoord = MercatorCoordinate.fromLngLat(transform.center, transform.elevation);\n    cameraCoord.z = centerCoord.z + Math.cos(transform.pitchInRadians) * transform.cameraToCenterDistance / transform.worldSize;\n    const detailsProvider = transform.getCoveringTilesDetailsProvider();\n    const allowVariableZoom = detailsProvider.allowVariableZoom(transform, options);\n    \n    const desiredZ = coveringZoomLevel(transform, options);\n    const minZoom = options.minzoom || 0;\n    const maxZoom = options.maxzoom !== undefined ? options.maxzoom : transform.maxZoom;\n    const nominalZ = Math.min(Math.max(0, desiredZ), maxZoom);\n\n    const numTiles = Math.pow(2, nominalZ);\n    const cameraPoint = [numTiles * cameraCoord.x, numTiles * cameraCoord.y, 0];\n    const centerPoint = [numTiles * centerCoord.x, numTiles * centerCoord.y, 0];\n    const distanceToCenter2d = Math.hypot(centerCoord.x - cameraCoord.x, centerCoord.y - cameraCoord.y);\n    const distanceZ = Math.abs(centerCoord.z - cameraCoord.z);\n    const distanceToCenter3d = Math.hypot(distanceToCenter2d, distanceZ);\n\n    const newRootTile = (wrap: number): CoveringTilesStackEntry => {\n        return {\n            zoom: 0,\n            x: 0,\n            y: 0,\n            wrap,\n            fullyVisible: false\n        };\n    };\n\n    // Do a depth-first traversal to find visible tiles and proper levels of detail\n    const stack: Array<CoveringTilesStackEntry> = [];\n    const result: Array<CoveringTilesResult> = [];\n\n    if (transform.renderWorldCopies && detailsProvider.allowWorldCopies()) {\n        // Render copy of the globe thrice on both sides\n        for (let i = 1; i <= 3; i++) {\n            stack.push(newRootTile(-i));\n            stack.push(newRootTile(i));\n        }\n    }\n\n    stack.push(newRootTile(0));\n\n    while (stack.length > 0) {\n        const it = stack.pop();\n        const x = it.x;\n        const y = it.y;\n        let fullyVisible = it.fullyVisible;\n        const tileID = {x, y, z: it.zoom};\n        const boundingVolume = detailsProvider.getTileBoundingVolume(tileID, it.wrap, transform.elevation, options);\n\n        // Visibility of a tile is not required if any of its ancestor is fully visible\n        if (!fullyVisible) {\n            const intersectResult = isTileVisible(frustum, boundingVolume, plane);\n\n            if (intersectResult === IntersectionResult.None)\n                continue;\n\n            fullyVisible = intersectResult === IntersectionResult.Full;\n        }\n\n        const distToTile2d = detailsProvider.distanceToTile2d(cameraCoord.x, cameraCoord.y, tileID, boundingVolume);\n\n        let thisTileDesiredZ = desiredZ;\n        if (allowVariableZoom) {\n            const tileZoomFunc = options.calculateTileZoom || defaultCalculateTileZoom;\n            thisTileDesiredZ = tileZoomFunc(transform.zoom + scaleZoom(transform.tileSize / options.tileSize),\n                distToTile2d,\n                distanceZ,\n                distanceToCenter3d,\n                transform.fov);\n        }\n        thisTileDesiredZ = (options.roundZoom ? Math.round : Math.floor)(thisTileDesiredZ);\n        thisTileDesiredZ = Math.max(0, thisTileDesiredZ);\n        const z = Math.min(thisTileDesiredZ, maxZoom);\n\n        // We need to compute a valid wrap value for the tile to keep globe compatibility with mercator\n        it.wrap = detailsProvider.getWrap(centerCoord, tileID, it.wrap);\n\n        // Have we reached the target depth?\n        if (it.zoom >= z) {\n            if (it.zoom < minZoom) {\n                continue;\n            }\n            const dz = nominalZ - it.zoom;\n            const dx = cameraPoint[0] - 0.5 - (x << dz);\n            const dy = cameraPoint[1] - 0.5 - (y << dz);\n            const overscaledZ = options.reparseOverscaled ? Math.max(it.zoom, thisTileDesiredZ) : it.zoom;\n            result.push({\n                tileID: new OverscaledTileID(it.zoom === maxZoom ? overscaledZ : it.zoom, it.wrap, it.zoom, x, y),\n                distanceSq: vec2.sqrLen([centerPoint[0] - 0.5 - x, centerPoint[1] - 0.5 - y]),\n                // this variable is currently not used, but may be important to reduce the amount of loaded tiles\n                tileDistanceToCamera: Math.sqrt(dx * dx + dy * dy)\n            });\n            continue;\n        }\n\n        for (let i = 0; i < 4; i++) {\n            const childX = (x << 1) + (i % 2);\n            const childY = (y << 1) + (i >> 1);\n            const childZ = it.zoom + 1;\n            stack.push({zoom: childZ, x: childX, y: childY, wrap: it.wrap, fullyVisible});\n        }\n    }\n\n    return result.sort((a, b) => a.distanceSq - b.distanceSq).map(a => a.tileID);\n}\n","import Point from '@mapbox/point-geometry';\nimport {Bounds, type ReadOnlyBounds} from '../geo/bounds';\nimport {EXTENT} from './extent';\n\n/**\n * The bounding box covering the entire extent of a tile.\n */\nexport const EXTENT_BOUNDS = Bounds.fromPoints([new Point(0, 0), new Point(EXTENT, EXTENT)]) as ReadOnlyBounds;","import {now} from '../util/time_control';\nimport {getEdgeTiles} from '../util/util';\nimport {FadingDirections, FadingRoles, type Tile} from './tile';\nimport {type OverscaledTileID} from './tile_id';\nimport {type InViewTiles} from './tile_manager_in_view_tiles';\n\nexport function isRasterType(type: string): boolean {\n    return type === 'raster' || type === 'image' || type === 'video';\n}\n\n/**\n * Designate fading bases and parents using a many-to-one relationship where the lower children fade in/out\n * with their parents. Raster shaders are not currently designed for a one-to-many fade relationship.\n *\n * Tiles that are candidates for fading out must be loaded and rendered tiles, as loading a tile to then\n * fade it out would not appear smoothly. The first source of truth for tile fading always starts at the\n * ideal tile, which continually changes on map adjustment. The state of the previously rendered ideal\n * tile plane indicates which direction to fade each part of the newer ideal plane (with varying z).\n *\n * For a pitched map, the back of the map can have decreasing zooms while the front can have increasing zooms.\n * Fade logic must therefore adapt dynamically based on the previously rendered ideal tile set.\n */\nexport function updateFadingTiles(\n    inViewTiles: InViewTiles,\n    idealTileIDs: OverscaledTileID[], \n    retain: Record<string, OverscaledTileID>,\n    maxFadingAncestorLevels: number,\n    sourceMinZoom: number,\n    sourceMaxZoom: number,\n    rasterFadeDuration: number) {\n    const currentTime: number = now();\n    const edgeTileIDs: Set<OverscaledTileID> = getEdgeTiles(idealTileIDs);\n\n    for (const idealID of idealTileIDs) {\n        const idealTile = inViewTiles.getTileById(idealID.key);\n\n        // reset any previously departing(ed) tiles that are now ideal tiles\n        if (idealTile.fadingDirection === FadingDirections.Departing || idealTile.fadeOpacity === 0) {\n            idealTile.resetFadeLogic();\n        }\n\n        const parentIsFader = updateFadingAncestor(inViewTiles, idealTile, retain, currentTime, maxFadingAncestorLevels, sourceMinZoom, rasterFadeDuration);\n        if (parentIsFader) continue;\n\n        const childIsFader = updateFadingDescendents(inViewTiles, idealTile, retain, currentTime, sourceMaxZoom, rasterFadeDuration);\n        if (childIsFader) continue;\n\n        const edgeIsFader = updateFadingEdge(idealTile, edgeTileIDs, currentTime, rasterFadeDuration);\n        if (edgeIsFader) continue;\n\n        // for all remaining non-fading ideal tiles reset the fade logic\n        idealTile.resetFadeLogic();\n    }\n}\n\n/**\n * Many-to-one cross-fade. Set 4 ideal tiles as the fading base for a rendered parent tile\n * as the fading parent. Here the parent is fading out and the ideal tile is fading in.\n *\n * Parent tile - fading out                                â                                 -- Fading Parent\n *                                   ââââââââââââââââ¬âââââââ´ââââââââ¬âââââââââââââââ\n * Ideal tiles - fading in           â               â               â               â          -- Base Role = Incoming\n *                             âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ\n *                             â    â    â    â   â    â    â    â   â    â    â    â   â    â    â    â \n */\nfunction updateFadingAncestor(\n    inViewTiles: InViewTiles,\n    idealTile: Tile, \n    retain: Record<string, OverscaledTileID>, \n    now: number,\n    maxFadingAncestorLevels: number,\n    sourceMinZoom: number,\n    rasterFadeDuration: number): boolean {\n    if (!idealTile.hasData()) return false;\n\n    const {tileID: idealID, fadingRole, fadingDirection, fadingParentID} = idealTile;\n    // ideal tile already has fading parent - retain and return\n    if (fadingRole === FadingRoles.Base && fadingDirection === FadingDirections.Incoming && fadingParentID) {\n        retain[fadingParentID.key] = fadingParentID;\n        return true;\n    }\n\n    // find a loaded parent tile to fade with the ideal tile\n    const minAncestorZ = Math.max(idealID.overscaledZ - maxFadingAncestorLevels, sourceMinZoom);\n    for (let ancestorZ = idealID.overscaledZ - 1; ancestorZ >= minAncestorZ; ancestorZ--) {\n        const ancestorID = idealID.scaledTo(ancestorZ);\n        const ancestorTile = inViewTiles.getLoadedTile(ancestorID);\n        if (!ancestorTile) continue;\n\n        // ideal tile (base) is fading in\n        idealTile.setCrossFadeLogic({\n            fadingRole: FadingRoles.Base,\n            fadingDirection: FadingDirections.Incoming,\n            fadingParentID: ancestorTile.tileID,  // fading out\n            fadeEndTime: now + rasterFadeDuration\n        });\n        // ancestor tile (parent) is fading out\n        ancestorTile.setCrossFadeLogic({\n            fadingRole: FadingRoles.Parent,\n            fadingDirection: FadingDirections.Departing,\n            fadeEndTime: now + rasterFadeDuration\n        });\n\n        retain[ancestorID.key] = ancestorID;\n        return true;\n    }\n    return false;\n}\n\n/**\n * Many-to-one cross-fade. Search descendents of ideal tiles as the fading base with the ideal tile\n * as the fading parent. Here the children are fading out and the ideal tile is fading in.\n *\n *                                                         â \n *                                   ââââââââââââââââ¬âââââââ´ââââââââ¬âââââââââââââââ\n * Ideal tiles - fading in           â               â               â               â           -- Fading Parent\n *                             âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ  âââââ¬ââ´ââ¬ââââ\n * Child tiles - fading out    â    â    â    â   â    â    â    â   â    â    â    â   â    â    â    â     -- Base Role = Departing\n *\n * Try direct children first. If none found, try grandchildren. Stops at the first generation that provides a fader.\n */\nfunction updateFadingDescendents(inViewTiles: InViewTiles, idealTile: Tile, retain: Record<string, OverscaledTileID>, now: number, sourceMaxZoom: number, rasterFadeDuration: number): boolean {\n    if (!idealTile.hasData()) return false;\n\n    // search first level of descendents (4 tiles)\n    const idealChildren = idealTile.tileID.children(sourceMaxZoom);\n    let hasFader = updateFadingChildren(inViewTiles, idealTile, idealChildren, retain, now, sourceMaxZoom, rasterFadeDuration);\n    if (hasFader) return true;\n\n    // search second level of descendents (16 tiles)\n    for (const childID of idealChildren) {\n        const grandChildIDs = childID.children(sourceMaxZoom);\n        if (updateFadingChildren(inViewTiles, idealTile, grandChildIDs, retain, now, sourceMaxZoom, rasterFadeDuration)) {\n            hasFader = true;\n        }\n    }\n\n    return hasFader;\n}\n\nfunction updateFadingChildren(\n    inViewTiles: InViewTiles,\n    idealTile: Tile, \n    childIDs: OverscaledTileID[], \n    retain: Record<string, OverscaledTileID>, \n    now: number, \n    sourceMaxZoom: number,\n    rasterFadeDuration: number): boolean {\n    if (childIDs[0].overscaledZ >= sourceMaxZoom) return false;\n    let foundFader = false;\n\n    // find loaded child tiles to fade with the ideal tile\n    for (const childID of childIDs) {\n        const childTile = inViewTiles.getLoadedTile(childID);\n        if (!childTile) continue;\n\n        const {fadingRole, fadingDirection, fadingParentID} = childTile;\n        if (fadingRole !== FadingRoles.Base || fadingDirection !== FadingDirections.Departing || !fadingParentID) {\n            // child tile (base) is fading out\n            childTile.setCrossFadeLogic({\n                fadingRole: FadingRoles.Base,\n                fadingDirection: FadingDirections.Departing,\n                fadingParentID: idealTile.tileID,\n                fadeEndTime: now + rasterFadeDuration\n            });\n            // ideal tile (parent) is fading in\n            idealTile.setCrossFadeLogic({\n                fadingRole: FadingRoles.Parent,\n                fadingDirection: FadingDirections.Incoming,\n                fadeEndTime: now + rasterFadeDuration\n            });\n        }\n\n        retain[childID.key] = childID;\n        foundFader = true;\n    }\n\n    return foundFader;\n}\n\n/**\n * One-to-one self fading for unloaded edge tiles (for panning sideways on map). for loading tiles over gaps it feels\n * more natural for them to fade in, however if they are already loaded/cached then there is no need to fade as map will\n * look cohesive with no gaps. Note that draw_raster determines fade priority, as many-to-one fade supersedes edge fading.\n */\nfunction updateFadingEdge(idealTile: Tile, edgeTileIDs: Set<OverscaledTileID>, now: number, rasterFadeDuration: number): boolean {\n    const idealID: OverscaledTileID = idealTile.tileID;\n\n    // tile is already self fading\n    if (idealTile.selfFading) {\n        return true;\n    }\n\n    // fading not needed for tiles that are already loaded\n    if (idealTile.hasData()) {\n        return false;\n    }\n\n    // enable fading for loading edges with no data\n    if (edgeTileIDs.has(idealID)) {\n        const fadeEndTime = now + rasterFadeDuration;\n        idealTile.setSelfFadeLogic(fadeEndTime);\n        return true;\n    }\n\n    return false;\n}\n\nexport function hasRasterTransition(inViewTiles: InViewTiles, rasterFadeDuration: number) {\n    if (rasterFadeDuration <= 0) {\n        return false;\n    }\n    const currentTime = now();\n    for (const tile of inViewTiles.getAllTiles()) {\n        if (tile.fadeEndTime >= currentTime) {\n            return true;\n        }\n    }\n    return false;\n}","import {type Tile} from './tile';\nimport {type InViewTiles} from './tile_manager_in_view_tiles';\n\n/**\n * For raster terrain source, backfill DEM to eliminate visible tile boundaries\n */\nexport function backfillDEM(tile: Tile, inViewTiles: InViewTiles) {\n    const renderables = inViewTiles.getRenderableIds();\n    for (const borderId of renderables) {\n        if (!tile.neighboringTiles || !tile.neighboringTiles[borderId]) {\n            continue;\n        }\n        const borderTile = inViewTiles.getTileById(borderId);\n        if (!tile.neighboringTiles[borderId].backfilled) {\n            fillBorder(tile, borderTile);\n        }\n        if (borderTile.neighboringTiles?.[tile.tileID.key]?.backfilled) {\n            continue;\n        }\n        fillBorder(borderTile, tile);\n    }\n}\n\nfunction fillBorder(tile: Tile, borderTile: Tile) {\n    tile.needsHillshadePrepare = true;\n    tile.needsTerrainPrepare = true;\n    let dx = borderTile.tileID.canonical.x - tile.tileID.canonical.x;\n    const dy = borderTile.tileID.canonical.y - tile.tileID.canonical.y;\n    const dim = Math.pow(2, tile.tileID.canonical.z);\n    const borderId = borderTile.tileID.key;\n    if (dx === 0 && dy === 0) return;\n\n    if (Math.abs(dy) > 1) {\n        return;\n    }\n    if (Math.abs(dx) > 1) {\n        // Adjust the delta coordinate for world wraparound.\n        if (Math.abs(dx + dim) === 1) {\n            dx += dim;\n        } else if (Math.abs(dx - dim) === 1) {\n            dx -= dim;\n        }\n    }\n    if (!borderTile.dem || !tile.dem) return;\n    tile.dem.backfillBorder(borderTile.dem, dx, dy);\n    if (tile.neighboringTiles?.[borderId]) {\n        tile.neighboringTiles[borderId].backfilled = true;\n    }\n}\n\n","import Point from '@mapbox/point-geometry';\nimport {type LayerFeatureStates} from '../source/source_state';\nimport {type Tile} from './tile';\nimport {compareTileId, type OverscaledTileID} from './tile_id';\n\nexport class InViewTiles {\n    private _tiles: Record<string, Tile> = {};\n\n    public handleWrapJump(wrapDelta: number) {\n        const tiles: Record<string, Tile> = {};\n        for (const id in this._tiles) {\n            const tile = this._tiles[id];\n            tile.tileID = tile.tileID.unwrapTo(tile.tileID.wrap + wrapDelta);\n            tiles[tile.tileID.key] = tile;\n        }\n        this._tiles = tiles;\n    }\n\n    public setFeatureState(featuresChanged: LayerFeatureStates, painter: any) {\n        for (const id in this._tiles) {\n            const tile = this._tiles[id];\n            tile.setFeatureState(featuresChanged, painter);\n        }\n    }\n\n    public getAllTiles(): Tile[] {\n        return Object.values(this._tiles);\n    }\n\n    public getAllIds(sorted = false): string[] {\n        if (sorted) {\n            return Object.values(this._tiles).map(tile => tile.tileID).sort(compareTileId).map(id => id.key);\n        }\n        return Object.keys(this._tiles);\n    }\n\n    public getTileById(key: string): Tile | undefined {\n        return this._tiles[key];\n    }\n\n    public setTile(key: string, tile: Tile) {\n        this._tiles[key] = tile;\n    }\n\n    public deleteTileById(key: string) {\n        delete this._tiles[key];\n    }\n\n    /**\n     * Get a currently loaded tile.\n     * - a cached tile is not a loaded tile\n     * @returns the tile if it's in view and had data, null otherwise.\n     */\n    public getLoadedTile(tileID: OverscaledTileID): Tile | null {\n        const tile = this.getTileById(tileID.key);\n        if (tile?.hasData()) {\n            return tile;\n        }\n        return null;\n    }\n\n    public isIdRenderable(id: string, symbolLayer: boolean = false) {\n        return this.getTileById(id)?.isRenderable(symbolLayer);\n    }\n\n    public getRenderableIds(bearingInRadians: number = 0, symbolLayer?: boolean): Array<string> {\n        const renderables: Array<Tile> = [];\n        for (const id of this.getAllIds()) {\n            if (this.isIdRenderable(id, symbolLayer)) {\n                renderables.push(this.getTileById(id));\n            }\n        }\n        if (symbolLayer) {\n            return renderables.sort((a_: Tile, b_: Tile) => {\n                const a = a_.tileID;\n                const b = b_.tileID;\n                const rotatedA = (new Point(a.canonical.x, a.canonical.y))._rotate(-bearingInRadians);\n                const rotatedB = (new Point(b.canonical.x, b.canonical.y))._rotate(-bearingInRadians);\n                return a.overscaledZ - b.overscaledZ || rotatedB.y - rotatedA.y || rotatedB.x - rotatedA.x;\n            }).map(tile => tile.tileID.key);\n        }\n        return renderables.map(tile => tile.tileID).sort(compareTileId).map(id => id.key);\n    }\n}","import {create as createSource} from '../source/source';\n\nimport {Tile} from './tile';\nimport {ErrorEvent, Event, Evented} from '../util/evented';\nimport {TileCache} from './tile_cache';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {EXTENT} from '../data/extent';\nimport type Point from '@mapbox/point-geometry';\nimport {now} from '../util/time_control';\nimport {OverscaledTileID} from './tile_id';\nimport {SourceFeatureState} from '../source/source_state';\nimport {config} from '../util/config';\nimport {coveringTiles, coveringZoomLevel} from '../geo/projection/covering_tiles';\nimport {Bounds} from '../geo/bounds';\nimport {EXTENT_BOUNDS} from '../data/extent_bounds';\nimport {GEOJSON_TILE_LAYER_NAME} from '../data/feature_index';\nimport {hasRasterTransition, isRasterType, updateFadingTiles} from './tile_manager_raster';\nimport {backfillDEM} from './tile_manager_raster_dem';\nimport {InViewTiles} from './tile_manager_in_view_tiles';\n\nimport type {Context} from '../gl/context';\nimport type {Source} from '../source/source';\nimport type {Map} from '../ui/map';\nimport type {Style} from '../style/style';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\nimport type {TileState} from './tile';\nimport type {ICanonicalTileID, SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {MapSourceDataEvent} from '../ui/events';\nimport type {Terrain} from '../render/terrain';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\n\ntype TileResult = {\n    tile: Tile;\n    tileID: OverscaledTileID;\n    queryGeometry: Array<Point>;\n    cameraQueryGeometry: Array<Point>;\n    scale: number;\n};\n\n/**\n * @internal\n * `TileManager` is responsible for\n *\n *  - creating an instance of `Source`\n *  - caching tiles loaded from an instance of `Source`\n *  - handling incoming source data events events from `Map` and coordinating updates\n *  - providing the current renderable tile coordinates to the `Painter`\n *  - loading the tiles needed to render a given viewport\n *  - retaining the tiles needed as substitutes for pending loading tiles\n *  - retaining the tiles needed for fading between parents and children (for raster sources)\n *  - reloading tiles when source data or dependencies change\n *  - handling tile expiration and refresh timers\n *  - unloading cached tiles not needed to render a given viewport\n *  - managing tile state and feature state\n */\nexport class TileManager extends Evented {\n    id: string;\n    dispatcher: Dispatcher;\n    map: Map;\n    style: Style;\n\n    _source: Source;\n\n    /**\n     * @internal\n     * signifies that the TileJSON is loaded if applicable.\n     * if the source type does not come with a TileJSON, the flag signifies the\n     * source data has loaded (i.e geojson has been tiled on the worker and is ready)\n     */\n    _sourceLoaded: boolean;\n\n    _sourceErrored: boolean;\n    _inViewTiles: InViewTiles;\n    _prevLng: number;\n    _outOfViewCache: TileCache;\n    _timers: Record<string, ReturnType<typeof setTimeout>>;\n    _maxTileCacheSize: number;\n    _maxTileCacheZoomLevels: number;\n    _paused: boolean;\n    _shouldReloadOnResume: boolean;\n    transform: ITransform;\n    terrain: Terrain;\n    used: boolean;\n    usedForTerrain: boolean;\n    tileSize: number;\n    _state: SourceFeatureState;\n    _didEmitContent: boolean;\n    _updated: boolean;\n    _rasterFadeDuration: number;\n    _maxFadingAncestorLevels: number;\n\n    static maxUnderzooming: number = 10;\n    static maxOverzooming: number = 3;\n\n    constructor(id: string, options: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n\n        this.on('data', (e: MapSourceDataEvent) => this._dataHandler(e));\n\n        this.on('dataloading', () => {\n            this._sourceErrored = false;\n        });\n\n        this.on('error', () => {\n            // Only set _sourceErrored if the source does not have pending loads.\n            this._sourceErrored = this._source.loaded();\n        });\n\n        this._source = createSource(id, options, dispatcher, this);\n\n        this._inViewTiles = new InViewTiles();\n        this._outOfViewCache = new TileCache(0, (tile) => this._unloadTile(tile));\n        this._timers = {};\n        this._maxTileCacheSize = null;\n        this._maxTileCacheZoomLevels = null;\n        this._rasterFadeDuration = 0;\n        this._maxFadingAncestorLevels = 5;\n\n        this._state = new SourceFeatureState();\n        this._didEmitContent = false;\n        this._updated = false;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this._maxTileCacheSize = map ? map._maxTileCacheSize : null;\n        this._maxTileCacheZoomLevels = map ? map._maxTileCacheZoomLevels : null;\n        if (this._source && this._source.onAdd) {\n            this._source.onAdd(map);\n        }\n    }\n\n    onRemove(map: Map) {\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            tile.unloadVectorData();\n        }\n        this.clearTiles();\n        if (this._source && this._source.onRemove) {\n            this._source.onRemove(map);\n        }\n        this._inViewTiles = new InViewTiles();\n    }\n\n    /**\n     * Return true if no tile data is pending, tiles will not change unless\n     * an additional API call is received.\n     */\n    loaded(): boolean {\n        if (this._sourceErrored) { return true; }\n        if (!this._sourceLoaded) { return false; }\n        if (!this._source.loaded()) { return false; }\n        if ((this.used !== undefined || this.usedForTerrain !== undefined) && !this.used && !this.usedForTerrain) { return true; }\n        // do not consider as loaded if the update hasn't been called yet (we do not know if we will have any tiles to fetch)\n        if (!this._updated) { return false; }\n\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            if (tile.state !== 'loaded' && tile.state !== 'errored')\n                return false;\n        }\n        return true;\n    }\n\n    getSource(): Source {\n        return this._source;\n    }\n\n    getState(): SourceFeatureState {\n        return this._state;\n    }\n\n    pause() {\n        this._paused = true;\n    }\n\n    resume() {\n        if (!this._paused) return;\n        const shouldReload = this._shouldReloadOnResume;\n        this._paused = false;\n        this._shouldReloadOnResume = false;\n        if (shouldReload) this.reload();\n        if (this.transform) this.update(this.transform, this.terrain);\n    }\n\n    async _loadTile(tile: Tile, id: string, state: TileState): Promise<void> {\n        try {\n            await this._source.loadTile(tile);\n            this._tileLoaded(tile, id, state);\n        } catch (err) {\n            tile.state = 'errored';\n            if ((err as any).status !== 404) {\n                this._source.fire(new ErrorEvent(err, {tile}));\n            } else {\n                // continue to try loading parent/children tiles if a tile doesn't exist (404)\n                this.update(this.transform, this.terrain);\n            }\n        }\n    }\n\n    _unloadTile(tile: Tile) {\n        if (this._source.unloadTile)\n            this._source.unloadTile(tile);\n    }\n\n    _abortTile(tile: Tile) {\n        if (this._source.abortTile)\n            this._source.abortTile(tile);\n\n        this._source.fire(new Event('dataabort', {tile, coord: tile.tileID, dataType: 'source'}));\n    }\n\n    serialize() {\n        return this._source.serialize();\n    }\n\n    prepare(context: Context) {\n        if  (this._source.prepare) {\n            this._source.prepare();\n        }\n\n        this._state.coalesceChanges(this._inViewTiles, this.map ? this.map.painter : null);\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            tile.upload(context);\n            tile.prepare(this.map.style.imageManager);\n        }\n    }\n\n    /**\n     * Return all tile ids ordered with z-order, and cast to numbers\n     */\n    getIds(): Array<string> {\n        return this._inViewTiles.getAllIds(true);\n    }\n\n    getRenderableIds(symbolLayer?: boolean): Array<string> {\n        return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians, symbolLayer);\n    }\n\n    hasRenderableParent(tileID: OverscaledTileID) {\n        const parentZ = tileID.overscaledZ - 1;\n        if (parentZ >= this._source.minzoom) {\n            const parentTile = this.getLoadedTile(tileID.scaledTo(parentZ));\n            if (parentTile) {\n                return this._inViewTiles.isIdRenderable(parentTile.tileID.key);\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Reload tiles based on the current state of the source.\n     * @param sourceDataChanged - If `true`, reload all tiles using a state of 'expired', otherwise reload only non-errored tiles using state of 'reloading'.\n     * @param shouldReloadTileOptions - Set of options associated with a `MapSourceDataChangedEvent` that can be passed back to the associated `Source` determine whether a tile should be reloaded.\n     */\n    reload(\n        sourceDataChanged?: boolean,\n        shouldReloadTileOptions: any = undefined\n    ) {\n        if (this._paused) {\n            this._shouldReloadOnResume = true;\n            return;\n        }\n\n        this._outOfViewCache.reset();\n\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (shouldReloadTileOptions && !this._source.shouldReloadTile(tile, shouldReloadTileOptions)) {\n                continue;\n            } else if (sourceDataChanged) {\n                this._reloadTile(id, 'expired');\n            } else if (tile.state !== 'errored') {\n                this._reloadTile(id, 'reloading');\n            }\n        }\n    }\n\n    async _reloadTile(id: string, state: TileState) {\n        const tile = this._inViewTiles.getTileById(id);\n\n        // this potentially does not address all underlying\n        // issues https://github.com/mapbox/mapbox-gl-js/issues/4252\n        // - hard to tell without repro steps\n        if (!tile) return;\n\n        // The difference between \"loading\" tiles and \"reloading\" or \"expired\"\n        // tiles is that \"reloading\"/\"expired\" tiles are \"renderable\".\n        // Therefore, a \"loading\" tile cannot become a \"reloading\" tile without\n        // first becoming a \"loaded\" tile.\n        if (tile.state !== 'loading') {\n            tile.state = state;\n        }\n        await this._loadTile(tile, id, state);\n    }\n\n    _tileLoaded(tile: Tile, id: string, previousState: TileState) {\n        tile.timeAdded = now();\n        // Since self-fading applies to unloaded tiles, fadeEndTime must be updated upon load\n        if (tile.selfFading) {\n            tile.fadeEndTime = tile.timeAdded + this._rasterFadeDuration;\n        }\n\n        if (previousState === 'expired') tile.refreshedUponExpiration = true;\n        this._setTileReloadTimer(id, tile);\n        if (this.getSource().type === 'raster-dem' && tile.dem) {\n            backfillDEM(tile, this._inViewTiles);\n        }\n        this._state.initializeTileState(tile, this.map ? this.map.painter : null);\n\n        if (!tile.aborted) {\n            this._source.fire(new Event('data', {dataType: 'source', tile, coord: tile.tileID}));\n        }\n    }\n    /**\n     * Get a specific tile by TileID\n     */\n    getTile(tileID: OverscaledTileID): Tile {\n        return this.getTileByID(tileID.key);\n    }\n\n    /**\n     * Get a specific tile by id\n     */\n    getTileByID(id: string): Tile | undefined {\n        return this._inViewTiles.getTileById(id);\n    }\n\n    /**\n     * Retain the uppermost loaded children of each provided target tile, within a variable covering zoom range.\n     *\n     * On pitched maps, different parts of the screen show different zoom levels simultaneously.\n     * Ideal tiles are generated using coveringTiles() above, which returns the ideal tile set for\n     * the current pitched plane, which can carry tiles of varying zooms (overscaledZ).\n     * See: https://maplibre.org/maplibre-gl-js/docs/examples/level-of-detail-control/\n     *\n     * A fixed `maxCoveringZoom` on a pitched map would incorrectly intersect with some\n     * ideal tiles and cause distant high-pitch tiles to skip their uppermost children.\n     *\n     * To solve this, we calculate the max covering zoom for each ideal tile separately using its\n     * `overscaledZ`. This effectively makes the \"max covering zoom plane\" parallel to the\n     * \"ideal tile plane,\" ensuring that we correctly capture the uppermost children\n     * of each ideal tile across the pitched view.\n     *\n     * Analogy: imagine two sheets of paper in 3D space:\n     *   - one sheet = ideal tiles at varying overscaledZ\n     *   - the second sheet = maxCoveringZoom\n     * \n     * @param retainTileMap - this parameters will be updated with the child tiles to keep\n     * @param idealTilesWithoutData - which of the ideal tiles currently does not have loaded data\n     * @return a set of tiles that need to be loaded\n     */\n    _retainLoadedChildren(retainTileMap: Record<string, OverscaledTileID>, idealTilesWithoutData: Set<OverscaledTileID>): Set<OverscaledTileID> {\n        const loadedDescendents: Record<string, Tile[]> = this._getLoadedDescendents(idealTilesWithoutData);\n        const incomplete = new Set<OverscaledTileID>();\n\n        // retain the uppermost descendents of target tiles\n        for (const targetID of idealTilesWithoutData) {\n            const descendents = loadedDescendents[targetID.key];\n            if (!descendents?.length) {\n                incomplete.add(targetID);\n                continue;\n            }\n\n            // find descendents within the max covering zoom range\n            const maxCoveringZoom = targetID.overscaledZ + TileManager.maxOverzooming;\n            const candidates = descendents.filter(t => t.tileID.overscaledZ <= maxCoveringZoom);\n            if (!candidates.length) {\n                incomplete.add(targetID);\n                continue;\n            }\n\n            // retain the uppermost descendents in the topmost zoom below the target tile\n            const topZoom = Math.min(...candidates.map(t => t.tileID.overscaledZ));\n            const topIDs = candidates.filter(t => t.tileID.overscaledZ === topZoom).map(t => t.tileID);\n            for (const tileID of topIDs) {\n                retainTileMap[tileID.key] = tileID;\n            }\n\n            //determine if the retained generation is fully covered\n            if (!this._areDescendentsComplete(topIDs, topZoom, targetID.overscaledZ)) {\n                incomplete.add(targetID);\n            }\n        }\n\n        return incomplete;\n    }\n\n    /**\n     * Return dictionary of qualified loaded descendents for each provided target tile id\n     */\n    _getLoadedDescendents(targetTileIDs: Set<OverscaledTileID>) {\n        const loadedDescendents: Record<string, Tile[]> = {};\n\n        // enumerate current tiles and find the loaded descendents of each target tile\n        for (const tile of this._inViewTiles.getAllTiles().filter(tile => tile.hasData())) {\n            // determine if the loaded tile (hasData) is a qualified descendent of any target tile\n            for (const targetID of targetTileIDs) {\n                if (tile.tileID.isChildOf(targetID)) {\n                    (loadedDescendents[targetID.key] ||= []).push(tile);\n                }\n            }\n        }\n\n        return loadedDescendents;\n    }\n\n    /**\n     * Determine if tile ids fully cover the current generation.\n     * - 1st generation: need 4 children or 1 overscaled child\n     * - 2nd generation: need 16 children or 1 overscaled child\n     */\n    _areDescendentsComplete(generationIDs: OverscaledTileID[], generationZ: number, ancestorZ: number) {\n        //if overscaled, seeking 1 tile at generationZ, otherwise seeking a power of 4 for each descending Z\n        if (generationIDs.length === 1 && generationIDs[0].isOverscaled()) {\n            return generationIDs[0].overscaledZ === generationZ;\n        } else {\n            const expectedTiles = Math.pow(4, generationZ - ancestorZ);  //4, 16, 64 (for first 3 gens)\n            return expectedTiles === generationIDs.length;\n        }\n    }\n\n    /**\n     * Get a currently loaded tile.\n     * - a cached tile is not a loaded tile\n     * @returns the tile if it's in view and had data, null otherwise.\n     */\n    getLoadedTile(tileID: OverscaledTileID): Tile | null {\n        return this._inViewTiles.getLoadedTile(tileID);\n    }\n\n    /**\n     * Resizes the tile cache based on the current viewport's size\n     * or the maxTileCacheSize option passed during map creation\n     *\n     * Larger viewports use more tiles and need larger caches. Larger viewports\n     * are more likely to be found on devices with more memory and on pages where\n     * the map is more important.\n     */\n    updateCacheSize(transform: IReadonlyTransform) {\n        const widthInTiles = Math.ceil(transform.width / this._source.tileSize) + 1;\n        const heightInTiles = Math.ceil(transform.height / this._source.tileSize) + 1;\n        const approxTilesInView = widthInTiles * heightInTiles;\n        const commonZoomRange = this._maxTileCacheZoomLevels === null ?\n            config.MAX_TILE_CACHE_ZOOM_LEVELS : this._maxTileCacheZoomLevels;\n        const viewDependentMaxSize = Math.floor(approxTilesInView * commonZoomRange);\n        const maxSize = typeof this._maxTileCacheSize === 'number' ?\n            Math.min(this._maxTileCacheSize, viewDependentMaxSize) : viewDependentMaxSize;\n\n        this._outOfViewCache.setMaxSize(maxSize);\n    }\n\n    handleWrapJump(lng: number) {\n        // On top of the regular z/x/y values, TileIDs have a `wrap` value that specify\n        // which copy of the world the tile belongs to. For example, at `lng: 10` you\n        // might render z/x/y/0 while at `lng: 370` you would render z/x/y/1.\n        //\n        // When lng values get wrapped (going from `lng: 370` to `long: 10`) you expect\n        // to see the same thing on the screen (370 degrees and 10 degrees is the same\n        // place in the world) but all the TileIDs will have different wrap values.\n        //\n        // In order to make this transition seamless, we calculate the rounded difference of\n        // \"worlds\" between the last frame and the current frame. If the map panned by\n        // a world, then we can assign all the tiles new TileIDs with updated wrap values.\n        // For example, assign z/x/y/1 a new id: z/x/y/0. It is the same tile, just rendered\n        // in a different position.\n        //\n        // This enables us to reuse the tiles at more ideal locations and prevent flickering.\n        const prevLng = this._prevLng === undefined ? lng : this._prevLng;\n        const lngDifference = lng - prevLng;\n        const worldDifference = lngDifference / 360;\n        const wrapDelta = Math.round(worldDifference);\n        this._prevLng = lng;\n\n        if (wrapDelta) {\n            this._inViewTiles.handleWrapJump(wrapDelta);\n            this._resetTileReloadTimers();\n        }\n    }\n\n    /**\n     * Removes tiles that are outside the viewport and adds new tiles that\n     * are inside the viewport.\n     */\n    update(transform: ITransform, terrain?: Terrain) {\n        if (!this._sourceLoaded || this._paused) {\n            return;\n        }\n        this.transform = transform;\n        this.terrain = terrain;\n\n        this.updateCacheSize(transform);\n        this.handleWrapJump(this.transform.center.lng);\n\n        let idealTileIDs: OverscaledTileID[];\n\n        if (!this.used && !this.usedForTerrain) {\n            idealTileIDs = [];\n        } else if (this._source.tileID) { // image source\n            idealTileIDs = transform.getVisibleUnwrappedCoordinates(this._source.tileID)\n                .map((unwrapped) => new OverscaledTileID(unwrapped.canonical.z, unwrapped.wrap, unwrapped.canonical.z, unwrapped.canonical.x, unwrapped.canonical.y));\n        } else {\n            idealTileIDs = coveringTiles(transform, {\n                tileSize: this.usedForTerrain ? this.tileSize : this._source.tileSize,\n                minzoom: this._source.minzoom,\n                maxzoom: this._source.type === 'vector' && this.map._zoomLevelsToOverscale !== undefined\n                    ? transform.maxZoom - this.map._zoomLevelsToOverscale \n                    : this._source.maxzoom,\n                roundZoom: this.usedForTerrain ? false : this._source.roundZoom,\n                reparseOverscaled: this._source.reparseOverscaled,\n                terrain,\n                calculateTileZoom: this._source.calculateTileZoom,\n            });\n\n            if (this._source.hasTile) { // tile should be in bounds\n                idealTileIDs = idealTileIDs.filter((coord) => this._source.hasTile(coord));\n            }\n        }\n\n        // When tilemanager is used for terrain also load parent tiles for complete rendering of 3d terrain levels\n        if (this.usedForTerrain) {\n            idealTileIDs = this._addTerrainIdealTiles(idealTileIDs);\n        }\n\n        const noPendingDataEmissions = idealTileIDs.length === 0 && !this._updated && this._didEmitContent;\n        this._updated = true;\n        // if we won't have any tiles to fetch and content is already emitted\n        // there will be no more data emissions, so we need to emit the event with isSourceLoaded = true\n        if (noPendingDataEmissions) {\n            this.fire(new Event('data', {sourceDataType: 'idle', dataType: 'source', sourceId: this.id}));\n        }\n\n        // Retain is a list of tiles that we shouldn't delete, even if they are not\n        // the most ideal tile for the current viewport. This may include tiles like\n        // parent or child tiles that are *already* loaded.\n        const zoom: number = coveringZoomLevel(transform, this._source);\n        const retain: Record<string, OverscaledTileID> = this._updateRetainedTiles(idealTileIDs, zoom);\n\n        // enable fading for raster source except when using terrain which doesn't currently support fading\n        const isRaster = isRasterType(this._source.type);\n        if (isRaster && this._rasterFadeDuration > 0 && !terrain) {\n            updateFadingTiles(this._inViewTiles, idealTileIDs, retain, this._maxFadingAncestorLevels, this._source.minzoom, this._source.maxzoom, this._rasterFadeDuration);\n        }\n\n        // clean up non-retained tiles that are no longer needed\n        if (isRaster) {\n            this._cleanUpRasterTiles(retain);\n        } else {\n            this._cleanUpVectorTiles(retain);\n        }\n    }\n\n    /**\n     * Remove raster tiles that are no longer retained\n     */\n    _cleanUpRasterTiles(retain: Record<string, OverscaledTileID>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            if (!retain[id]) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Remove vector tiles that are no longer retained and also not needed for symbol fading\n     */\n    _cleanUpVectorTiles(retain: Record<string, OverscaledTileID>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n\n            // retained - clear fade hold so if it's removed again fade timer starts fresh.\n            if (retain[id]) {\n                tile.clearSymbolFadeHold();\n                continue;\n            }\n\n            // remove non-retained tiles without symbols\n            if (!tile.hasSymbolBuckets) {\n                this._removeTile(id);\n                continue;\n            }\n\n            // for tile with symbols - hold for fade - then remove\n            if (!tile.holdingForSymbolFade()) {\n                tile.setSymbolHoldDuration(this.map._fadeDuration);\n            } else if (tile.symbolFadeFinished()) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Add ideal tiles needed for 3D terrain rendering\n     */\n    _addTerrainIdealTiles(idealTileIDs: OverscaledTileID[]): OverscaledTileID[] {\n        const ancestors = [];\n\n        for (const tileID of idealTileIDs) {\n            if (tileID.canonical.z > this._source.minzoom) {\n                const parent = tileID.scaledTo(tileID.canonical.z - 1);\n                ancestors.push(parent);\n                // load very low zoom to calculate tile visibility in transform.coveringTiles and high zoom levels correct\n                const parent2 = tileID.scaledTo(Math.max(this._source.minzoom, Math.min(tileID.canonical.z, 5)));\n                ancestors.push(parent2);\n            }\n        }\n\n        return idealTileIDs.concat(ancestors);\n    }\n\n    releaseSymbolFadeTiles() {\n        for (const id of this._inViewTiles.getAllIds()) {\n            if (this._inViewTiles.getTileById(id).holdingForSymbolFade()) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    /**\n     * Set tiles to be retained on update of the source. For ideal tiles that do not have data, retain their loaded\n     * children so they can be displayed as substitutes pending load of each ideal tile (to reduce flickering).\n     * If no loaded children are available, fallback to seeking loaded parents as an alternative substitute.\n     */\n    _updateRetainedTiles(idealTileIDs: Array<OverscaledTileID>, zoom: number): Record<string, OverscaledTileID> {\n        const idealTilesWithoutData = new Set<OverscaledTileID>();\n        for (const idealID of idealTileIDs) {\n            const idealTile = this._addTile(idealID);\n\n            if (!idealTile.hasData()) {\n                idealTilesWithoutData.add(idealID);\n            }\n        }\n\n        // retain the tile even if it's not loaded because it's an ideal tile.\n        const retainTileMap: Record<string, OverscaledTileID> = idealTileIDs.reduce((acc, t) => { acc[t.key] = t; return acc;}, {});\n        const tileIdsWithoutData = this._retainLoadedChildren(retainTileMap, idealTilesWithoutData);\n\n        // for remaining missing tiles with incomplete child coverage, seek a loaded parent tile\n        const checked: Record<string, boolean> = {};\n        const minCoveringZoom = Math.max(zoom - TileManager.maxUnderzooming, this._source.minzoom);\n        for (const tileID of tileIdsWithoutData) {\n            let tile = this._inViewTiles.getTileById(tileID.key);\n\n            // As we ascend up the tile pyramid of the ideal tile, we check whether the parent\n            // tile has been previously requested (and errored because we only loop over tiles with no data)\n            // in order to determine if we need to request its parent.\n            let parentWasRequested = tile?.wasRequested();\n\n            for (let overscaledZ = tileID.overscaledZ - 1; overscaledZ >= minCoveringZoom; --overscaledZ) {\n                const parentId = tileID.scaledTo(overscaledZ);\n\n                // Break parent tile ascent if this route has been previously checked by another child.\n                if (checked[parentId.key]) break;\n                checked[parentId.key] = true;\n\n                tile = this.getTile(parentId);\n                if (!tile && parentWasRequested) {\n                    tile = this._addTile(parentId);\n                }\n                if (tile) {\n                    const hasData = tile.hasData();\n                    if (hasData || !this.map?.cancelPendingTileRequestsWhileZooming || parentWasRequested) {\n                        retainTileMap[parentId.key] = parentId;\n                    }\n                    // Save the current values, since they're the parent of the next iteration\n                    // of the parent tile ascent loop.\n                    parentWasRequested = tile.wasRequested();\n                    if (hasData) break;\n                }\n            }\n        }\n\n        return retainTileMap;\n    }\n\n    /**\n     * Add a tile, given its coordinate, to the pyramid.\n     */\n    _addTile(tileID: OverscaledTileID): Tile {\n        let tile = this._inViewTiles.getTileById(tileID.key);\n        if (tile)\n            return tile;\n\n        tile = this._outOfViewCache.getAndRemove(tileID);\n        if (tile) {\n            //reset fading logic to remove stale fading data from cache\n            tile.resetFadeLogic();\n\n            // set timer for the reloading of the tile upon expiration\n            this._setTileReloadTimer(tileID.key, tile);\n\n            // set the tileID because the cached tile could have had a different wrap value\n            tile.tileID = tileID;\n            this._state.initializeTileState(tile, this.map ? this.map.painter : null);\n        }\n\n        const cached = tile;\n\n        if (!tile) {\n            tile = new Tile(tileID, this._source.tileSize * tileID.overscaleFactor());\n            this._loadTile(tile, tileID.key, tile.state);\n        }\n\n        tile.uses++;\n        this._inViewTiles.setTile(tileID.key, tile);\n        if (!cached) {\n            this._source.fire(new Event('dataloading', {tile, coord: tile.tileID, dataType: 'source'}));\n        }\n\n        return tile;\n    }\n\n    /**\n     * Set a timeout to reload the tile after it expires\n     */\n    _setTileReloadTimer(id: string, tile: Tile) {\n        this._clearTileReloadTimer(id);\n\n        const expiryTimeout = tile.getExpiryTimeout();\n        if (expiryTimeout) {\n            const reload = () => {\n                this._reloadTile(id, 'expired');\n                delete this._timers[id];\n            };\n            this._timers[id] = setTimeout(reload, expiryTimeout);\n        }\n    }\n\n    _clearTileReloadTimer(id: string) {\n        const timeout = this._timers[id];\n        if (timeout) {\n            clearTimeout(timeout);\n            delete this._timers[id];\n        }\n    }\n\n    _resetTileReloadTimers() {\n        for (const id in this._timers) {\n            clearTimeout(this._timers[id]);\n            delete this._timers[id];\n        }\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            this._setTileReloadTimer(id, tile);\n        }\n    }\n\n    /**\n     * Reload any currently renderable tiles that are match one of the incoming `tileId` x/y/z\n     */\n    refreshTiles(tileIds: Array<ICanonicalTileID>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (!this._inViewTiles.isIdRenderable(id) && tile.state != 'errored') {\n                continue;\n            }\n            if (tileIds.some(tid => tid.equals(tile.tileID.canonical))) {\n                this._reloadTile(id, 'expired');\n            }\n        }\n    }\n\n    /**\n     * Remove a tile, given its id, from the pyramid\n     */\n    _removeTile(id: string) {\n        const tile = this._inViewTiles.getTileById(id);\n        if (!tile)\n            return;\n\n        tile.uses--;\n        this._inViewTiles.deleteTileById(id);\n        this._clearTileReloadTimer(id);\n\n        if (tile.uses > 0)\n            return;\n\n        if (tile.hasData() && tile.state !== 'reloading') {\n            this._outOfViewCache.add(tile.tileID, tile, tile.getExpiryTimeout());\n        } else {\n            tile.aborted = true;\n            this._abortTile(tile);\n            this._unloadTile(tile);\n        }\n    }\n\n    /** @internal\n     * Handles incoming source data messages (i.e. after the source has been updated via a worker that has fired\n     * to map.ts data event). For sources with mutable data, the 'content' event fires when the underlying data\n     * to a source has changed. (i.e. GeoJSONSource.setData and ImageSource.setCoordinates)\n     */\n    private _dataHandler(e: MapSourceDataEvent) {\n        if (e.dataType !== 'source') return;\n\n        if (e.sourceDataType === 'metadata') {\n            this._sourceLoaded = true;\n            return;\n        }\n\n        if (e.sourceDataType !== 'content' || !this._sourceLoaded || this._paused) {\n            return;\n        }\n\n        this.reload(e.sourceDataChanged, e.shouldReloadTileOptions);\n        if (this.transform) {\n            this.update(this.transform, this.terrain);\n        }\n        this._didEmitContent = true;\n    }\n\n    /**\n     * Remove all tiles from this pyramid\n     */\n    clearTiles() {\n        this._shouldReloadOnResume = false;\n        this._paused = false;\n\n        for (const id of this._inViewTiles.getAllIds()) {\n            this._removeTile(id);\n        }\n\n        this._outOfViewCache.reset();\n    }\n\n    /**\n     * Search through our current tiles and attempt to find the tiles that\n     * cover the given bounds.\n     * @param pointQueryGeometry - coordinates of the corners of bounding rectangle\n     * @returns result items have `{tile, minX, maxX, minY, maxY}`, where min/max bounding values are the given bounds transformed in into the coordinate space of this tile.\n     */\n    tilesIn(pointQueryGeometry: Array<Point>, maxPitchScaleFactor: number, has3DLayer: boolean): TileResult[] {\n        const tileResults: TileResult[] = [];\n\n        const transform = this.transform;\n        if (!transform) return tileResults;\n        const allowWorldCopies = transform.getCoveringTilesDetailsProvider().allowWorldCopies();\n\n        const cameraPointQueryGeometry = has3DLayer ?\n            transform.getCameraQueryGeometry(pointQueryGeometry) :\n            pointQueryGeometry;\n\n        const project = (point: Point) => transform.screenPointToMercatorCoordinate(point, this.terrain);\n        const queryGeometry = this.transformBbox(pointQueryGeometry, project, !allowWorldCopies);\n        const cameraQueryGeometry = this.transformBbox(cameraPointQueryGeometry, project, !allowWorldCopies);\n\n        const ids = this.getIds();\n\n        const cameraBounds = Bounds.fromPoints(cameraQueryGeometry);\n\n        for (let i = 0; i < ids.length; i++) {\n            const tile = this._inViewTiles.getTileById(ids[i]);\n            if (tile.holdingForSymbolFade()) {\n                // Tiles held for fading are covered by tiles that are closer to ideal\n                continue;\n            }\n            // if the projection does not render world copies then we need to explicitly check for the bounding box crossing the antimeridian\n            const tileIDs = allowWorldCopies ? [tile.tileID] : [tile.tileID.unwrapTo(-1), tile.tileID.unwrapTo(0)];\n            const scale = Math.pow(2, transform.zoom - tile.tileID.overscaledZ);\n            const queryPadding = maxPitchScaleFactor * tile.queryPadding * EXTENT / tile.tileSize / scale;\n\n            for (const tileID of tileIDs) {\n\n                const tileSpaceBounds = cameraBounds.map(point => tileID.getTilePoint(new MercatorCoordinate(point.x, point.y)));\n                tileSpaceBounds.expandBy(queryPadding);\n\n                if (tileSpaceBounds.intersects(EXTENT_BOUNDS)) {\n\n                    const tileSpaceQueryGeometry: Array<Point> = queryGeometry.map((c) => tileID.getTilePoint(c));\n                    const tileSpaceCameraQueryGeometry = cameraQueryGeometry.map((c) => tileID.getTilePoint(c));\n\n                    tileResults.push({\n                        tile,\n                        tileID: allowWorldCopies ? tileID : tileID.unwrapTo(0),\n                        queryGeometry: tileSpaceQueryGeometry,\n                        cameraQueryGeometry: tileSpaceCameraQueryGeometry,\n                        scale\n                    });\n                }\n            }\n        }\n\n        return tileResults;\n    }\n\n    private transformBbox(geom: Point[], project: (point: Point) => MercatorCoordinate, checkWrap: boolean): MercatorCoordinate[] {\n        let transformed = geom.map(project);\n        if (checkWrap) {\n            // If the projection does not allow world copies, then a bounding box may span the antimeridian and\n            // instead of a bounding box going from 179Â°E to 179Â°W, it goes from 179Â°W to 179Â°E and covers the entire\n            // planet except for what should be inside it.\n            const bounds = Bounds.fromPoints(geom);\n            bounds.shrinkBy(Math.min(bounds.width(), bounds.height()) * 0.001);\n            const projected = bounds.map(project);\n\n            const newBounds = Bounds.fromPoints(transformed);\n\n            if (!newBounds.covers(projected)) {\n                transformed = transformed.map((coord) => coord.x > 0.5 ?\n                    new MercatorCoordinate(coord.x - 1, coord.y, coord.z) :\n                    coord\n                );\n            }\n        }\n        return transformed;\n    }\n\n    getVisibleCoordinates(symbolLayer?: boolean): Array<OverscaledTileID> {\n        const coords = this.getRenderableIds(symbolLayer).map((id) => this._inViewTiles.getTileById(id).tileID);\n        if (this.transform) {\n            this.transform.populateCache(coords);\n        }\n        return coords;\n    }\n\n    hasTransition() {\n        if (this._source.hasTransition()) {\n            return true;\n        }\n\n        if (isRasterType(this._source.type) && hasRasterTransition(this._inViewTiles, this._rasterFadeDuration)) {\n            return true;\n        }\n\n        return false;\n    }\n\n    setRasterFadeDuration(fadeDuration: number) {\n        this._rasterFadeDuration = fadeDuration;\n    }\n\n    /**\n     * Set the value of a particular state for a feature\n     */\n    setFeatureState(sourceLayer: string, featureId: number | string, state: any) {\n        sourceLayer = sourceLayer || GEOJSON_TILE_LAYER_NAME;\n        this._state.updateState(sourceLayer, featureId, state);\n    }\n\n    /**\n     * Resets the value of a particular state key for a feature\n     */\n    removeFeatureState(sourceLayer?: string, featureId?: number | string, key?: string) {\n        sourceLayer = sourceLayer || GEOJSON_TILE_LAYER_NAME;\n        this._state.removeFeatureState(sourceLayer, featureId, key);\n    }\n\n    /**\n     * Get the entire state object for a feature\n     */\n    getFeatureState(sourceLayer: string, featureId: number | string) {\n        sourceLayer = sourceLayer || GEOJSON_TILE_LAYER_NAME;\n        return this._state.getState(sourceLayer, featureId);\n    }\n\n    /**\n     * Sets the set of keys that the tile depends on. This allows tiles to\n     * be reloaded when their dependencies change.\n     */\n    setDependencies(tileKey: string, namespace: string, dependencies: Array<string>) {\n        const tile = this._inViewTiles.getTileById(tileKey);\n        if (tile) {\n            tile.setDependencies(namespace, dependencies);\n        }\n    }\n\n    /**\n     * Reloads all tiles that depend on the given keys.\n     */\n    reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>) {\n        for (const id of this._inViewTiles.getAllIds()) {\n            const tile = this._inViewTiles.getTileById(id);\n            if (tile.hasDependency(namespaces, keys)) {\n                this._reloadTile(id, 'reloading');\n            }\n        }\n        this._outOfViewCache.filter(tile => !tile.hasDependency(namespaces, keys));\n    }\n\n    areTilesLoaded(): boolean {\n        for (const tile of this._inViewTiles.getAllTiles()) {\n            if (!(tile.state === 'loaded' || tile.state === 'errored')) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n","import {clamp} from '../util/util';\nimport type Point from '@mapbox/point-geometry';\n\nexport class PathInterpolator {\n    points: Array<Point>;\n    length: number;\n    paddedLength: number;\n    padding: number;\n    _distances: Array<number>;\n\n    constructor(points_?: Array<Point> | null, padding_?: number | null) {\n        this.reset(points_, padding_);\n    }\n\n    reset(points_?: Array<Point> | null, padding_?: number | null) {\n        this.points = points_ || [];\n\n        // Compute cumulative distance from first point to every other point in the segment.\n        // Last entry in the array is total length of the path\n        this._distances = [0.0];\n\n        for (let i = 1; i < this.points.length; i++) {\n            this._distances[i] = this._distances[i - 1] + this.points[i].dist(this.points[i - 1]);\n        }\n\n        this.length = this._distances[this._distances.length - 1];\n        this.padding = Math.min(padding_ || 0, this.length * 0.5);\n        this.paddedLength = this.length - this.padding * 2.0;\n    }\n\n    lerp(t: number): Point {\n        if (this.points.length === 1) {\n            return this.points[0];\n        }\n\n        t = clamp(t, 0, 1);\n\n        // Find the correct segment [p0, p1] where p0 <= x < p1\n        let currentIndex = 1;\n        let distOfCurrentIdx = this._distances[currentIndex];\n        const distToTarget = t * this.paddedLength + this.padding;\n\n        while (distOfCurrentIdx < distToTarget && currentIndex < this._distances.length) {\n            distOfCurrentIdx = this._distances[++currentIndex];\n        }\n\n        // Interpolate between the two points of the segment\n        const idxOfPrevPoint = currentIndex - 1;\n        const distOfPrevIdx = this._distances[idxOfPrevPoint];\n        const segmentLength = distOfCurrentIdx - distOfPrevIdx;\n        const segmentT = segmentLength > 0 ? (distToTarget - distOfPrevIdx) / segmentLength : 0;\n\n        return this.points[idxOfPrevPoint].mult(1.0 - segmentT).add(this.points[currentIndex].mult(segmentT));\n    }\n}\n","import type {OverlapMode} from '../style/style_layer/overlap_mode';\n\ntype QueryArgs = {\n    hitTest: boolean;\n    overlapMode?: OverlapMode;\n    circle?: {\n        x: number;\n        y: number;\n        radius: number;\n    };\n    seenUids: {\n        box: {\n            [_: number]: boolean;\n        };\n        circle: {\n            [_: number]: boolean;\n        };\n    };\n};\n\ntype QueryResult<T> = {\n    key: T;\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n};\n\n/**\n * A key for the grid\n */\nexport type GridKey = {\n    overlapMode?: OverlapMode;\n};\n\nfunction overlapAllowed(overlapA: OverlapMode, overlapB: OverlapMode): boolean {\n    let allowed = true;\n\n    if (overlapA === 'always') {\n        // symbol A using 'always' overlap - allowed to overlap anything.\n    } else if (overlapA === 'never' || overlapB === 'never') {\n        // symbol A using 'never' overlap - can't overlap anything\n        // symbol A using 'cooperative' overlap - can overlap 'always' or 'cooperative' symbol; can't overlap 'never'\n        allowed = false;\n    }\n\n    return allowed;\n}\n\n/**\n * @internal\n * GridIndex is a data structure for testing the intersection of\n * circles and rectangles in a 2d plane.\n * It is optimized for rapid insertion and querying.\n * GridIndex splits the plane into a set of \"cells\" and keeps track\n * of which geometries intersect with each cell. At query time,\n * full geometry comparisons are only done for items that share\n * at least one cell. As long as the geometries are relatively\n * uniformly distributed across the plane, this greatly reduces\n * the number of comparisons necessary.\n */\nexport class GridIndex<T extends GridKey> {\n    circleKeys: Array<T>;\n    boxKeys: Array<T>;\n    boxCells: Array<Array<number>>;\n    circleCells: Array<Array<number>>;\n    bboxes: Array<number>;\n    circles: Array<number>;\n    xCellCount: number;\n    yCellCount: number;\n    width: number;\n    height: number;\n    xScale: number;\n    yScale: number;\n    boxUid: number;\n    circleUid: number;\n\n    constructor (width: number, height: number, cellSize: number) {\n        const boxCells = this.boxCells = [];\n        const circleCells = this.circleCells = [];\n\n        // More cells -> fewer geometries to check per cell, but items tend\n        // to be split across more cells.\n        // Sweet spot allows most small items to fit in one cell\n        this.xCellCount = Math.ceil(width / cellSize);\n        this.yCellCount = Math.ceil(height / cellSize);\n\n        for (let i = 0; i < this.xCellCount * this.yCellCount; i++) {\n            boxCells.push([]);\n            circleCells.push([]);\n        }\n        this.circleKeys = [];\n        this.boxKeys = [];\n        this.bboxes = [];\n        this.circles = [];\n\n        this.width = width;\n        this.height = height;\n        this.xScale = this.xCellCount / width;\n        this.yScale = this.yCellCount / height;\n        this.boxUid = 0;\n        this.circleUid = 0;\n    }\n\n    keysLength() {\n        return this.boxKeys.length + this.circleKeys.length;\n    }\n\n    insert(key: T, x1: number, y1: number, x2: number, y2: number) {\n        this._forEachCell(x1, y1, x2, y2, this._insertBoxCell, this.boxUid++);\n        this.boxKeys.push(key);\n        this.bboxes.push(x1);\n        this.bboxes.push(y1);\n        this.bboxes.push(x2);\n        this.bboxes.push(y2);\n    }\n\n    insertCircle(key: T, x: number, y: number, radius: number) {\n        // Insert circle into grid for all cells in the circumscribing square\n        // It's more than necessary (by a factor of 4/PI), but fast to insert\n        this._forEachCell(x - radius, y - radius, x + radius, y + radius, this._insertCircleCell, this.circleUid++);\n        this.circleKeys.push(key);\n        this.circles.push(x);\n        this.circles.push(y);\n        this.circles.push(radius);\n    }\n\n    private _insertBoxCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number) {\n        this.boxCells[cellIndex].push(uid);\n    }\n\n    private _insertCircleCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number)  {\n        this.circleCells[cellIndex].push(uid);\n    }\n\n    private _query(x1: number, y1: number, x2: number, y2: number, hitTest: boolean, overlapMode: OverlapMode, predicate?: (key: T) => boolean): Array<QueryResult<T>> {\n        if (x2 < 0 || x1 > this.width || y2 < 0 || y1 > this.height) {\n            return [];\n        }\n        const result: Array<QueryResult<T>> = [];\n        if (x1 <= 0 && y1 <= 0 && this.width <= x2 && this.height <= y2) {\n            if (hitTest) {\n                // Covers the entire grid, so collides with everything\n                return [{\n                    key: null,\n                    x1,\n                    y1,\n                    x2,\n                    y2\n                }];\n            }\n            for (let boxUid = 0; boxUid < this.boxKeys.length; boxUid++) {\n                result.push({\n                    key: this.boxKeys[boxUid],\n                    x1: this.bboxes[boxUid * 4],\n                    y1: this.bboxes[boxUid * 4 + 1],\n                    x2: this.bboxes[boxUid * 4 + 2],\n                    y2: this.bboxes[boxUid * 4 + 3]\n                });\n            }\n            for (let circleUid = 0; circleUid < this.circleKeys.length; circleUid++) {\n                const x = this.circles[circleUid * 3];\n                const y = this.circles[circleUid * 3 + 1];\n                const radius = this.circles[circleUid * 3 + 2];\n                result.push({\n                    key: this.circleKeys[circleUid],\n                    x1: x - radius,\n                    y1: y - radius,\n                    x2: x + radius,\n                    y2: y + radius\n                });\n            }\n        } else {\n            const queryArgs: QueryArgs = {\n                hitTest,\n                overlapMode,\n                seenUids: {box: {}, circle: {}}\n            };\n            this._forEachCell(x1, y1, x2, y2, this._queryCell, result, queryArgs, predicate);\n        }\n\n        return result;\n    }\n\n    query(x1: number, y1: number, x2: number, y2: number): Array<QueryResult<T>> {\n        return this._query(x1, y1, x2, y2, false, null);\n    }\n\n    hitTest(x1: number, y1: number, x2: number, y2: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean {\n        return this._query(x1, y1, x2, y2, true, overlapMode, predicate).length > 0;\n    }\n\n    hitTestCircle(x: number, y: number, radius: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean {\n        // Insert circle into grid for all cells in the circumscribing square\n        // It's more than necessary (by a factor of 4/PI), but fast to insert\n        const x1 = x - radius;\n        const x2 = x + radius;\n        const y1 = y - radius;\n        const y2 = y + radius;\n        if (x2 < 0 || x1 > this.width || y2 < 0 || y1 > this.height) {\n            return false;\n        }\n\n        // Box query early exits if the bounding box is larger than the grid, but we don't do\n        // the equivalent calculation for circle queries because early exit is less likely\n        // and the calculation is more expensive\n        const result: boolean[] = [];\n        const queryArgs: QueryArgs = {\n            hitTest: true,\n            overlapMode,\n            circle: {x, y, radius},\n            seenUids: {box: {}, circle: {}}\n        };\n        this._forEachCell(x1, y1, x2, y2, this._queryCellCircle, result, queryArgs, predicate);\n        return result.length > 0;\n    }\n\n    private _queryCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, result: Array<QueryResult<T>>, queryArgs: QueryArgs, predicate?: (key: T) => boolean): boolean {\n        const {seenUids, hitTest, overlapMode} = queryArgs;\n        const boxCell = this.boxCells[cellIndex];\n\n        if (boxCell !== null) {\n            const bboxes = this.bboxes;\n            for (const boxUid of boxCell) {\n                if (!seenUids.box[boxUid]) {\n                    seenUids.box[boxUid] = true;\n                    const offset = boxUid * 4;\n                    const key = this.boxKeys[boxUid];\n\n                    if ((x1 <= bboxes[offset + 2]) &&\n                        (y1 <= bboxes[offset + 3]) &&\n                        (x2 >= bboxes[offset + 0]) &&\n                        (y2 >= bboxes[offset + 1]) &&\n                        (!predicate || predicate(key))) {\n                        if (!hitTest || !overlapAllowed(overlapMode, key.overlapMode)) {\n                            result.push({\n                                key,\n                                x1: bboxes[offset],\n                                y1: bboxes[offset + 1],\n                                x2: bboxes[offset + 2],\n                                y2: bboxes[offset + 3]\n                            });\n                            if (hitTest) {\n                                // true return value stops the query after first match\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        const circleCell = this.circleCells[cellIndex];\n        if (circleCell !== null) {\n            const circles = this.circles;\n            for (const circleUid of circleCell) {\n                if (!seenUids.circle[circleUid]) {\n                    seenUids.circle[circleUid] = true;\n                    const offset = circleUid * 3;\n                    const key = this.circleKeys[circleUid];\n\n                    if (this._circleAndRectCollide(\n                        circles[offset],\n                        circles[offset + 1],\n                        circles[offset + 2],\n                        x1,\n                        y1,\n                        x2,\n                        y2) &&\n                        (!predicate || predicate(key))) {\n                        if (!hitTest || !overlapAllowed(overlapMode, key.overlapMode)) {\n                            const x = circles[offset];\n                            const y = circles[offset + 1];\n                            const radius = circles[offset + 2];\n                            result.push({\n                                key,\n                                x1: x - radius,\n                                y1: y - radius,\n                                x2: x + radius,\n                                y2: y + radius\n                            });\n                            if (hitTest) {\n                                // true return value stops the query after first match\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        // false return to continue query\n        return false;\n    }\n\n    private _queryCellCircle(x1: number, y1: number, x2: number, y2: number, cellIndex: number, result: Array<boolean>, queryArgs: QueryArgs, predicate?: (key: T) => boolean): boolean {\n        const {circle, seenUids, overlapMode} = queryArgs;\n        const boxCell = this.boxCells[cellIndex];\n\n        if (boxCell !== null) {\n            const bboxes = this.bboxes;\n            for (const boxUid of boxCell) {\n                if (!seenUids.box[boxUid]) {\n                    seenUids.box[boxUid] = true;\n                    const offset = boxUid * 4;\n                    const key = this.boxKeys[boxUid];\n                    if (this._circleAndRectCollide(\n                        circle.x,\n                        circle.y,\n                        circle.radius,\n                        bboxes[offset + 0],\n                        bboxes[offset + 1],\n                        bboxes[offset + 2],\n                        bboxes[offset + 3]) &&\n                        (!predicate || predicate(key)) &&\n                        !overlapAllowed(overlapMode, key.overlapMode)) {\n                        result.push(true);\n                        return true;\n                    }\n                }\n            }\n        }\n\n        const circleCell = this.circleCells[cellIndex];\n        if (circleCell !== null) {\n            const circles = this.circles;\n            for (const circleUid of circleCell) {\n                if (!seenUids.circle[circleUid]) {\n                    seenUids.circle[circleUid] = true;\n                    const offset = circleUid * 3;\n                    const key = this.circleKeys[circleUid];\n                    if (this._circlesCollide(\n                        circles[offset],\n                        circles[offset + 1],\n                        circles[offset + 2],\n                        circle.x,\n                        circle.y,\n                        circle.radius) &&\n                        (!predicate || predicate(key)) &&\n                        !overlapAllowed(overlapMode, key.overlapMode)) {\n                        result.push(true);\n                        return true;\n                    }\n                }\n            }\n        }\n    }\n\n    private _forEachCell<TArg>(\n        x1: number,\n        y1: number,\n        x2: number,\n        y2: number,\n        fn: (x1: number, y1: number, x2: number, y2: number, cellIndex: number, arg1: TArg, arg2?: QueryArgs, predicate?: (key: T) => boolean) => boolean | void,\n        arg1: TArg,\n        arg2?: QueryArgs,\n        predicate?: (key: T) => boolean) {\n        const cx1 = this._convertToXCellCoord(x1);\n        const cy1 = this._convertToYCellCoord(y1);\n        const cx2 = this._convertToXCellCoord(x2);\n        const cy2 = this._convertToYCellCoord(y2);\n\n        for (let x = cx1; x <= cx2; x++) {\n            for (let y = cy1; y <= cy2; y++) {\n                const cellIndex = this.xCellCount * y + x;\n                if (fn.call(this, x1, y1, x2, y2, cellIndex, arg1, arg2, predicate)) return;\n            }\n        }\n    }\n\n    private _convertToXCellCoord(x: number) {\n        return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(x * this.xScale)));\n    }\n\n    private _convertToYCellCoord(y: number) {\n        return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(y * this.yScale)));\n    }\n\n    private _circlesCollide(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): boolean {\n        const dx = x2 - x1;\n        const dy = y2 - y1;\n        const bothRadii = r1 + r2;\n        return (bothRadii * bothRadii) > (dx * dx + dy * dy);\n    }\n\n    private _circleAndRectCollide(\n        circleX: number,\n        circleY: number,\n        radius: number,\n        x1: number,\n        y1: number,\n        x2: number,\n        y2: number\n    ): boolean {\n        const halfRectWidth = (x2 - x1) / 2;\n        const distX = Math.abs(circleX - (x1 + halfRectWidth));\n        if (distX > (halfRectWidth + radius)) {\n            return false;\n        }\n\n        const halfRectHeight = (y2 - y1) / 2;\n        const distY = Math.abs(circleY - (y1 + halfRectHeight));\n        if (distY > (halfRectHeight + radius)) {\n            return false;\n        }\n\n        if (distX <= halfRectWidth || distY <= halfRectHeight) {\n            return true;\n        }\n\n        const dx = distX - halfRectWidth;\n        const dy = distY - halfRectHeight;\n        return (dx * dx + dy * dy <= (radius * radius));\n    }\n}\n","import Point from '@mapbox/point-geometry';\n\nimport {mat2, mat4, vec2, vec4} from 'gl-matrix';\nimport * as symbolSize from './symbol_size';\nimport {addDynamicAttributes} from '../data/bucket/symbol_bucket';\n\nimport type {Painter} from '../render/painter';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    SymbolLineVertexArray,\n    SymbolDynamicLayoutArray,\n    PlacedSymbol,\n} from '../data/array_types.g';\nimport {WritingMode} from '../symbol/shaping';\nimport {findLineIntersection} from '../util/util';\nimport {type UnwrappedTileID} from '../tile/tile_id';\nimport {type StructArray} from '../util/struct_array';\n\n/**\n * The result of projecting a point to the screen, with some additional information about the projection.\n */\nexport type PointProjection = {\n    /**\n     * The projected point.\n     */\n    point: Point;\n    /**\n     * The original W component of the projection.\n     */\n    signedDistanceFromCamera: number;\n    /**\n     * For complex projections (such as globe), true if the point is occluded by the projection, such as by being on the backfacing side of the globe.\n     * If the point is simply beyond the edge of the screen, this should NOT be set to false.\n     */\n    isOccluded: boolean;\n};\n\n/*\n * # Overview of coordinate spaces\n *\n * ## Tile coordinate spaces\n * Each label has an anchor. Some labels have corresponding line geometries.\n * The points for both anchors and lines are stored in tile units. Each tile has it's own\n * coordinate space going from (0, 0) at the top left to (EXTENT, EXTENT) at the bottom right.\n *\n * ## Clip space (GL coordinate space)\n * At the end of everything, the vertex shader needs to produce a position in clip space,\n * which is (-1, 1) at the top left and (1, -1) in the bottom right.\n * In the depth buffer, values are between 0 (near plane) to 1 (far plane).\n *\n * ## Map pixel coordinate spaces\n * Each tile has a pixel coordinate space. It's just the tile units scaled so that one unit is\n * whatever counts as 1 pixel at the current zoom.\n * This space is used for pitch-alignment=map, rotation-alignment=map\n *\n * ## Rotated map pixel coordinate spaces\n * Like the above, but rotated so axis of the space are aligned with the viewport instead of the tile.\n * This space is used for pitch-alignment=map, rotation-alignment=viewport\n *\n * ## Viewport pixel coordinate space\n * (0, 0) is at the top left of the canvas and (pixelWidth, pixelHeight) is at the bottom right corner\n * of the canvas. This space is used for pitch-alignment=viewport\n *\n *\n * # Vertex projection\n * It goes roughly like this:\n * 1. project the anchor and line from tile units into the correct label coordinate space\n *      - map pixel space           pitch-alignment=map         rotation-alignment=map\n *      - rotated map pixel space   pitch-alignment=map         rotation-alignment=viewport\n *      - viewport pixel space      pitch-alignment=viewport    rotation-alignment=*\n * 2. if the label follows a line, find the point along the line that is the correct distance from the anchor.\n * 3. add the glyph's corner offset to the point from step 3\n * 4. convert from the label coordinate space to clip space\n *\n * For horizontal labels we want to do step 1 in the shader for performance reasons (no cpu work).\n *      This is what `u_label_plane_matrix` is used for.\n * For labels aligned with lines we have to steps 1 and 2 on the cpu since we need access to the line geometry.\n *      This is what `updateLineLabels(...)` does.\n *      Since the conversion is handled on the cpu we just set `u_label_plane_matrix` to an identity matrix.\n *\n * Steps 3 and 4 are done in the shaders for all labels.\n *\n *\n * # Custom projection handling\n * Note that since MapLibre now supports more than one projection, the transformation\n * to viewport pixel space and GL clip space now *must* go through the projection's (`transform`'s)\n * `projectTileCoordinates` function, since it might do nontrivial transformations.\n *\n * Hence projecting anything to a symbol's label plane can no longer be handled by a simple matrix,\n * since, if the symbol's label plane is viewport pixel space, `projectTileCoordinates` must be used.\n * This is applies both here and in the symbol vertex shaders.\n */\n\nexport function getPitchedLabelPlaneMatrix(\n    rotateWithMap: boolean,\n    transform: IReadonlyTransform,\n    pixelsToTileUnits: number) {\n    const m = mat4.create();\n    if (!rotateWithMap) {\n        const {vecSouth, vecEast} = getTileSkewVectors(transform);\n        const skew = mat2.create();\n        skew[0] = vecEast[0];\n        skew[1] = vecEast[1];\n        skew[2] = vecSouth[0];\n        skew[3] = vecSouth[1];\n        mat2.invert(skew, skew);\n        m[0] = skew[0];\n        m[1] = skew[1];\n        m[4] = skew[2];\n        m[5] = skew[3];\n    }\n    mat4.scale(m, m, [1 / pixelsToTileUnits, 1 / pixelsToTileUnits, 1]);\n    return m;\n}\n\n/*\n * Returns a matrix for either converting from pitched label space to tile space,\n * or for converting from screenspace pixels to clip space.\n */\nexport function getGlCoordMatrix(\n    pitchWithMap: boolean,\n    rotateWithMap: boolean,\n    transform: IReadonlyTransform,\n    pixelsToTileUnits: number) {\n    if (pitchWithMap) {\n        const m = mat4.create();\n        if (!rotateWithMap) {\n            const {vecSouth, vecEast} = getTileSkewVectors(transform);\n            m[0] = vecEast[0];\n            m[1] = vecEast[1];\n            m[4] = vecSouth[0];\n            m[5] = vecSouth[1];\n        }\n        mat4.scale(m, m, [pixelsToTileUnits, pixelsToTileUnits, 1]);\n        return m;\n    } else {\n        return transform.pixelsToClipSpaceMatrix;\n    }\n}\n\nexport function getTileSkewVectors(transform: IReadonlyTransform): {vecEast: vec2; vecSouth: vec2} {\n    const cosRoll = Math.cos(transform.rollInRadians);\n    const sinRoll = Math.sin(transform.rollInRadians);\n    const cosPitch = Math.cos(transform.pitchInRadians);\n    const cosBearing = Math.cos(transform.bearingInRadians);\n    const sinBearing = Math.sin(transform.bearingInRadians);\n    const vecSouth = vec2.create();\n    vecSouth[0] = -cosBearing * cosPitch * sinRoll - sinBearing * cosRoll;\n    vecSouth[1] = -sinBearing * cosPitch * sinRoll + cosBearing * cosRoll;\n    const vecSouthLen = vec2.length(vecSouth);\n    if (vecSouthLen < 1.0e-9) {\n        vec2.zero(vecSouth);\n    } else {\n        vec2.scale(vecSouth, vecSouth, 1 / vecSouthLen);\n    }\n    const vecEast = vec2.create();\n    vecEast[0] = cosBearing * cosPitch * cosRoll - sinBearing * sinRoll;\n    vecEast[1] = sinBearing * cosPitch * cosRoll + cosBearing * sinRoll;\n    const vecEastLen = vec2.length(vecEast);\n    if (vecEastLen < 1.0e-9) {\n        vec2.zero(vecEast);\n    } else {\n        vec2.scale(vecEast, vecEast, 1 / vecEastLen);\n    }\n\n    return {vecEast, vecSouth};\n}\n\n/**\n * Projects a point using a specified matrix, including the perspective divide.\n * Uses a fast path if `getElevation` is undefined.\n */\nexport function projectWithMatrix(x: number, y: number, matrix: mat4, getElevation?: (x: number, y: number) => number): PointProjection {\n    let pos;\n    if (getElevation) { // slow because of handle z-index\n        pos = [x, y, getElevation(x, y), 1] as vec4;\n        vec4.transformMat4(pos, pos, matrix);\n    } else { // fast because of ignore z-index\n        pos = [x, y, 0, 1] as vec4;\n        xyTransformMat4(pos, pos, matrix);\n    }\n    const w = pos[3];\n    return {\n        point: new Point(pos[0] / w, pos[1] / w),\n        signedDistanceFromCamera: w,\n        isOccluded: false\n    };\n}\n\nexport function getPerspectiveRatio(cameraToCenterDistance: number, signedDistanceFromCamera: number): number {\n    return 0.5 + 0.5 * (cameraToCenterDistance / signedDistanceFromCamera);\n}\n\nfunction isVisible(p: Point,\n    clippingBuffer: [number, number]) {\n    const inPaddedViewport = (\n        p.x >= -clippingBuffer[0] &&\n        p.x <= clippingBuffer[0] &&\n        p.y >= -clippingBuffer[1] &&\n        p.y <= clippingBuffer[1]);\n    return inPaddedViewport;\n}\n\n/*\n *  Update the `dynamicLayoutVertexBuffer` for the buffer with the correct glyph positions for the current map view.\n *  This is only run on labels that are aligned with lines. Horizontal labels are handled entirely in the shader.\n */\nexport function updateLineLabels(bucket: SymbolBucket,\n    painter: Painter,\n    isText: boolean,\n    pitchedLabelPlaneMatrix: mat4,\n    pitchedLabelPlaneMatrixInverse: mat4,\n    pitchWithMap: boolean,\n    keepUpright: boolean,\n    rotateToLine: boolean,\n    unwrappedTileID: UnwrappedTileID,\n    viewportWidth: number,\n    viewportHeight: number,\n    translation: [number, number],\n    getElevation: (x: number, y: number) => number) {\n\n    const sizeData = isText ? bucket.textSizeData : bucket.iconSizeData;\n    const partiallyEvaluatedSize = symbolSize.evaluateSizeForZoom(sizeData, painter.transform.zoom);\n\n    const clippingBuffer: [number, number] = [256 / painter.width * 2 + 1, 256 / painter.height * 2 + 1];\n\n    const dynamicLayoutVertexArray = isText ?\n        bucket.text.dynamicLayoutVertexArray :\n        bucket.icon.dynamicLayoutVertexArray;\n    dynamicLayoutVertexArray.clear();\n\n    const lineVertexArray = bucket.lineVertexArray;\n    const placedSymbols = isText ? bucket.text.placedSymbolArray : bucket.icon.placedSymbolArray;\n\n    const aspectRatio = painter.transform.width / painter.transform.height;\n\n    let useVertical = false;\n\n    for (let s = 0; s < placedSymbols.length; s++) {\n        const symbol = placedSymbols.get(s);\n\n        // Don't do calculations for vertical glyphs unless the previous symbol was horizontal\n        // and we determined that vertical glyphs were necessary.\n        // Also don't do calculations for symbols that are collided and fully faded out\n        if (symbol.hidden || symbol.writingMode === WritingMode.vertical && !useVertical) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n            continue;\n        }\n        // Awkward... but we're counting on the paired \"vertical\" symbol coming immediately after its horizontal counterpart\n        useVertical = false;\n\n        const tileAnchorPoint = new Point(symbol.anchorX, symbol.anchorY);\n        const projectionCache: ProjectionCache = {projections: {}, offsets: {}, cachedAnchorPoint: undefined, anyProjectionOccluded: false};\n\n        const projectionContext: SymbolProjectionContext = {\n            getElevation,\n            pitchedLabelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            transform: painter.transform,\n            tileAnchorPoint,\n            unwrappedTileID,\n            width: viewportWidth,\n            height: viewportHeight,\n            translation\n        };\n\n        const anchorPos = projectTileCoordinatesToClipSpace(symbol.anchorX, symbol.anchorY, projectionContext);\n\n        // Don't bother calculating the correct point for invisible labels.\n        if (!isVisible(anchorPos.point, clippingBuffer)) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n            continue;\n        }\n\n        const cameraToAnchorDistance = anchorPos.signedDistanceFromCamera;\n        const perspectiveRatio = getPerspectiveRatio(painter.transform.cameraToCenterDistance, cameraToAnchorDistance);\n\n        const fontSize = symbolSize.evaluateSizeForFeature(sizeData, partiallyEvaluatedSize, symbol);\n        const pitchScaledFontSize = pitchWithMap ? (fontSize * painter.transform.getPitchedTextCorrection(symbol.anchorX, symbol.anchorY, unwrappedTileID) / perspectiveRatio) : fontSize * perspectiveRatio;\n\n        const placeUnflipped = placeGlyphsAlongLine({\n            projectionContext,\n            pitchedLabelPlaneMatrixInverse,\n            symbol,\n            fontSize: pitchScaledFontSize,\n            flip: false,\n            keepUpright,\n            glyphOffsetArray: bucket.glyphOffsetArray,\n            dynamicLayoutVertexArray,\n            aspectRatio,\n            rotateToLine,\n        });\n\n        useVertical = placeUnflipped.useVertical;\n\n        if (placeUnflipped.notEnoughRoom || useVertical ||\n            (placeUnflipped.needsFlipping &&\n                placeGlyphsAlongLine({\n                    projectionContext,\n                    pitchedLabelPlaneMatrixInverse,\n                    symbol,\n                    fontSize: pitchScaledFontSize,\n                    flip: true, // flipped\n                    keepUpright,\n                    glyphOffsetArray: bucket.glyphOffsetArray,\n                    dynamicLayoutVertexArray,\n                    aspectRatio,\n                    rotateToLine,\n                }).notEnoughRoom)) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n        }\n    }\n\n    if (isText) {\n        bucket.text.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray);\n    } else {\n        bucket.icon.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray);\n    }\n}\n\ntype FirstAndLastGlyphPlacement = {\n    first: PlacedGlyph;\n    last: PlacedGlyph;\n} | null;\n\n/*\n * Place the first and last glyph of a line label, projected to the label plane.\n * This function is called both during collision detection (to determine the label's size)\n * and during line label rendering (to make sure the label fits on the line geometry with\n * the current camera position, which may differ from the position used during collision detection).\n *\n * Calling this function has the effect of populating the \"projectionCache\" with all projected\n * vertex locations the label will need, making future calls to placeGlyphAlongLine (for all the\n * intermediate glyphs) much cheaper.\n *\n * Returns null if the label can't fit on the geometry\n */\nexport function placeFirstAndLastGlyph(\n    fontScale: number,\n    glyphOffsetArray: GlyphOffsetArray,\n    lineOffsetX: number,\n    lineOffsetY: number,\n    flip: boolean,\n    symbol: PlacedSymbol,\n    rotateToLine: boolean,\n    projectionContext: SymbolProjectionContext): FirstAndLastGlyphPlacement {\n    const glyphEndIndex = symbol.glyphStartIndex + symbol.numGlyphs;\n    const lineStartIndex = symbol.lineStartIndex;\n    const lineEndIndex = symbol.lineStartIndex + symbol.lineLength;\n\n    const firstGlyphOffset = glyphOffsetArray.getoffsetX(symbol.glyphStartIndex);\n    const lastGlyphOffset = glyphOffsetArray.getoffsetX(glyphEndIndex - 1);\n\n    const firstPlacedGlyph = placeGlyphAlongLine(fontScale * firstGlyphOffset, lineOffsetX, lineOffsetY, flip, symbol.segment,\n        lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n    if (!firstPlacedGlyph)\n        return null;\n\n    const lastPlacedGlyph = placeGlyphAlongLine(fontScale * lastGlyphOffset, lineOffsetX, lineOffsetY, flip, symbol.segment,\n        lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n    if (!lastPlacedGlyph)\n        return null;\n\n    if (projectionContext.projectionCache.anyProjectionOccluded) {\n        return null;\n    }\n\n    return {first: firstPlacedGlyph, last: lastPlacedGlyph};\n}\n\ntype OrientationChangeType = {\n    useVertical?: boolean;\n    needsFlipping?: boolean;\n};\n\nfunction requiresOrientationChange(writingMode, firstPoint, lastPoint, aspectRatio): OrientationChangeType {\n    if (writingMode === WritingMode.horizontal) {\n        // On top of choosing whether to flip, choose whether to render this version of the glyphs or the alternate\n        // vertical glyphs. We can't just filter out vertical glyphs in the horizontal range because the horizontal\n        // and vertical versions can have slightly different projections which could lead to angles where both or\n        // neither showed.\n        const rise = Math.abs(lastPoint.y - firstPoint.y);\n        const run = Math.abs(lastPoint.x - firstPoint.x) * aspectRatio;\n        if (rise > run) {\n            return {useVertical: true};\n        }\n    }\n\n    if (writingMode === WritingMode.vertical ? firstPoint.y < lastPoint.y : firstPoint.x > lastPoint.x) {\n        // Includes \"horizontalOnly\" case for labels without vertical glyphs\n        return {needsFlipping: true};\n    }\n\n    return null;\n}\n\ntype GlyphLinePlacementResult = OrientationChangeType & {\n    notEnoughRoom?: boolean;\n};\n\ntype GlyphLinePlacementArgs = {\n    projectionContext: SymbolProjectionContext;\n    pitchedLabelPlaneMatrixInverse: mat4;\n    symbol: PlacedSymbol;\n    fontSize: number;\n    flip: boolean;\n    keepUpright: boolean;\n    glyphOffsetArray: GlyphOffsetArray;\n    dynamicLayoutVertexArray: StructArray;\n    aspectRatio: number;\n    rotateToLine: boolean;\n};\n\n/*\n* Place first and last glyph along the line projected to label plane, and if they fit\n* iterate through all the intermediate glyphs, calculating their label plane positions\n* from the projected line.\n*\n* Finally, add resulting glyph position calculations to dynamicLayoutVertexArray for\n* upload to the GPU\n*/\nfunction placeGlyphsAlongLine(args: GlyphLinePlacementArgs): GlyphLinePlacementResult {\n    const {\n        projectionContext,\n        pitchedLabelPlaneMatrixInverse,\n        symbol,\n        fontSize,\n        flip,\n        keepUpright,\n        glyphOffsetArray,\n        dynamicLayoutVertexArray,\n        aspectRatio,\n        rotateToLine\n    } = args;\n\n    const fontScale = fontSize / 24;\n    const lineOffsetX = symbol.lineOffsetX * fontScale;\n    const lineOffsetY = symbol.lineOffsetY * fontScale;\n\n    let placedGlyphs;\n    if (symbol.numGlyphs > 1) {\n        const glyphEndIndex = symbol.glyphStartIndex + symbol.numGlyphs;\n        const lineStartIndex = symbol.lineStartIndex;\n        const lineEndIndex = symbol.lineStartIndex + symbol.lineLength;\n\n        // Place the first and the last glyph in the label first, so we can figure out\n        // the overall orientation of the label and determine whether it needs to be flipped in keepUpright mode\n        // Note: these glyphs are placed onto the label plane\n        const firstAndLastGlyph = placeFirstAndLastGlyph(fontScale, glyphOffsetArray, lineOffsetX, lineOffsetY, flip, symbol, rotateToLine, projectionContext);\n        if (!firstAndLastGlyph) {\n            return {notEnoughRoom: true};\n        }\n        const firstPoint = projectFromLabelPlaneToClipSpace(firstAndLastGlyph.first.point.x, firstAndLastGlyph.first.point.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n        const lastPoint = projectFromLabelPlaneToClipSpace(firstAndLastGlyph.last.point.x, firstAndLastGlyph.last.point.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n\n        if (keepUpright && !flip) {\n            const orientationChange = requiresOrientationChange(symbol.writingMode, firstPoint, lastPoint, aspectRatio);\n            if (orientationChange) {\n                return orientationChange;\n            }\n        }\n\n        placedGlyphs = [firstAndLastGlyph.first];\n        for (let glyphIndex = symbol.glyphStartIndex + 1; glyphIndex < glyphEndIndex - 1; glyphIndex++) {\n            // Since first and last glyph fit on the line, try placing the rest of the glyphs.\n            const placedGlyph = placeGlyphAlongLine(fontScale * glyphOffsetArray.getoffsetX(glyphIndex), lineOffsetX, lineOffsetY, flip, symbol.segment,\n                lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n            if (!placedGlyph) {\n                return {notEnoughRoom: true};\n            }\n            placedGlyphs.push(placedGlyph);\n        }\n        placedGlyphs.push(firstAndLastGlyph.last);\n    } else {\n        // Only a single glyph to place\n        // So, determine whether to flip based on projected angle of the line segment it's on\n        if (keepUpright && !flip) {\n            const a = projectTileCoordinatesToLabelPlane(projectionContext.tileAnchorPoint.x, projectionContext.tileAnchorPoint.y, projectionContext).point;\n            const tileVertexIndex = (symbol.lineStartIndex + symbol.segment + 1);\n            const tileSegmentEnd = new Point(projectionContext.lineVertexArray.getx(tileVertexIndex), projectionContext.lineVertexArray.gety(tileVertexIndex));\n            const projectedVertex = projectTileCoordinatesToLabelPlane(tileSegmentEnd.x, tileSegmentEnd.y, projectionContext);\n            // We know the anchor will be in the viewport, but the end of the line segment may be\n            // behind the plane of the camera, in which case we can use a point at any arbitrary (closer)\n            // point on the segment.\n            const b = (projectedVertex.signedDistanceFromCamera > 0) ?\n                projectedVertex.point :\n                projectTruncatedLineSegmentToLabelPlane(projectionContext.tileAnchorPoint, tileSegmentEnd, a, 1, projectionContext);\n\n            const clipSpaceA = projectFromLabelPlaneToClipSpace(a.x, a.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n            const clipSpaceB = projectFromLabelPlaneToClipSpace(b.x, b.y, projectionContext, pitchedLabelPlaneMatrixInverse);\n\n            const orientationChange = requiresOrientationChange(symbol.writingMode, clipSpaceA, clipSpaceB, aspectRatio);\n            if (orientationChange) {\n                return orientationChange;\n            }\n        }\n        const singleGlyph = placeGlyphAlongLine(fontScale * glyphOffsetArray.getoffsetX(symbol.glyphStartIndex), lineOffsetX, lineOffsetY, flip, symbol.segment,\n            symbol.lineStartIndex, symbol.lineStartIndex + symbol.lineLength, projectionContext, rotateToLine);\n        if (!singleGlyph || projectionContext.projectionCache.anyProjectionOccluded)\n            return {notEnoughRoom: true};\n\n        placedGlyphs = [singleGlyph];\n    }\n\n    for (const glyph of placedGlyphs) {\n        addDynamicAttributes(dynamicLayoutVertexArray, glyph.point, glyph.angle);\n    }\n    return {};\n}\n\n/**\n * Takes a line and direction from `previousTilePoint` to `currentTilePoint`, projects it to the correct label plane,\n * and returns a projected point along this projected line that is `minimumLength` distance away from `previousProjectedPoint`.\n * Projects a \"virtual\" vertex along a line segment.\n * @param previousTilePoint - Line start point, in tile coordinates.\n * @param currentTilePoint - Line end point, in tile coordinates.\n * @param previousProjectedPoint - Projection of `previousTilePoint` into label plane\n * @param minimumLength - Distance in the projected space along the line for the returned point.\n * @param projectionContext - Projection context, used to get terrain's `getElevation`, and to project the points to screen pixels.\n */\nfunction projectTruncatedLineSegmentToLabelPlane(previousTilePoint: Point, currentTilePoint: Point, previousProjectedPoint: Point, minimumLength: number, projectionContext: SymbolProjectionContext) {\n    // We are assuming \"previousTilePoint\" won't project to a point within one unit of the camera plane\n    // If it did, that would mean our label extended all the way out from within the viewport to a (very distant)\n    // point near the plane of the camera. We wouldn't be able to render the label anyway once it crossed the\n    // plane of the camera.\n    const unitVertexToBeProjected = previousTilePoint.add(previousTilePoint.sub(currentTilePoint)._unit());\n    const projectedUnitVertex = projectTileCoordinatesToLabelPlane(unitVertexToBeProjected.x, unitVertexToBeProjected.y, projectionContext).point;\n    const projectedUnitSegment = previousProjectedPoint.sub(projectedUnitVertex);\n    return previousProjectedPoint.add(projectedUnitSegment._mult(minimumLength / projectedUnitSegment.mag()));\n}\n\ntype IndexToPointCache = { [lineIndex: number]: Point };\n\n/**\n * @internal\n * We calculate label-plane projected points for line vertices as we place glyphs along the line\n * Since we will use the same vertices for potentially many glyphs, cache the results for this bucket\n * over the course of the render. Each vertex location also potentially has one offset equivalent\n * for us to hold onto. The vertex indices are per-symbol-bucket.\n */\ntype ProjectionCache = {\n    /**\n     * tile-unit vertices projected into label-plane units\n     */\n    projections: IndexToPointCache;\n    /**\n     * label-plane vertices which have been shifted to follow an offset line\n     */\n    offsets: IndexToPointCache;\n    /**\n     * Cached projected anchor point.\n     */\n    cachedAnchorPoint: Point | undefined;\n    /**\n     * Was any projected point occluded by the map itself (eg. occluded by the planet when using globe projection).\n     *\n     * Viewport-pitched line-following texts where *any* of the line points is hidden behind the planet curve becomes entirely hidden.\n     * This is perhaps not the most ideal behavior, but it works, it is simple and planetary-scale texts such as this seem to be a rare edge case.\n     */\n    anyProjectionOccluded: boolean;\n};\n\n/**\n * @internal\n * Arguments necessary to project a vertex to the label plane\n */\nexport type SymbolProjectionContext = {\n    /**\n     * Used to cache results, save cost if projecting the same vertex multiple times\n     */\n    projectionCache: ProjectionCache;\n    /**\n     * The array of tile-unit vertices transferred from worker\n     */\n    lineVertexArray: SymbolLineVertexArray;\n    /**\n     * Matrix for transforming from pixels (symbol shaping) to potentially rotated tile units (pitched map label plane).\n     */\n    pitchedLabelPlaneMatrix: mat4;\n    /**\n     * Function to get elevation at a point\n     * @param x - the x coordinate\n     * @param y - the y coordinate\n    */\n    getElevation: (x: number, y: number) => number;\n    /**\n     * Only for creating synthetic vertices if vertex would otherwise project behind plane of camera,\n     * but still convenient to pass it inside this type.\n     */\n    tileAnchorPoint: Point;\n    /**\n     * True when line glyphs are projected onto the map, instead of onto the viewport.\n     */\n    pitchWithMap: boolean;\n    transform: IReadonlyTransform;\n    unwrappedTileID: UnwrappedTileID;\n    /**\n     * Viewport width.\n     */\n    width: number;\n    /**\n     * Viewport height.\n     */\n    height: number;\n    /**\n     * Translation in tile units, computed using text-translate and text-translate-anchor paint style properties.\n     */\n    translation: [number, number];\n};\n\n/**\n * Only for creating synthetic vertices if vertex would otherwise project behind plane of camera\n */\nexport type ProjectionSyntheticVertexArgs = {\n    distanceFromAnchor: number;\n    previousVertex: Point;\n    direction: number;\n    absOffsetX: number;\n};\n\n/**\n * Transform a vertex from tile coordinates to label plane coordinates\n * @param index - index of vertex to project\n * @param projectionContext - necessary data to project a vertex\n * @returns the vertex projected to the label plane\n */\nexport function projectLineVertexToLabelPlane(index: number, projectionContext: SymbolProjectionContext, syntheticVertexArgs: ProjectionSyntheticVertexArgs): Point {\n    const cache = projectionContext.projectionCache;\n\n    if (cache.projections[index]) {\n        return cache.projections[index];\n    }\n    const currentVertex = new Point(\n        projectionContext.lineVertexArray.getx(index),\n        projectionContext.lineVertexArray.gety(index));\n\n    const projection = projectTileCoordinatesToLabelPlane(currentVertex.x, currentVertex.y, projectionContext);\n\n    if (projection.signedDistanceFromCamera > 0) {\n        cache.projections[index] = projection.point;\n        cache.anyProjectionOccluded = cache.anyProjectionOccluded || projection.isOccluded;\n        return projection.point;\n    }\n\n    // The vertex is behind the plane of the camera, so we can't project it\n    // Instead, we'll create a vertex along the line that's far enough to include the glyph\n    const previousLineVertexIndex = index - syntheticVertexArgs.direction;\n    const previousTilePoint = syntheticVertexArgs.distanceFromAnchor === 0 ?\n        projectionContext.tileAnchorPoint :\n        new Point(projectionContext.lineVertexArray.getx(previousLineVertexIndex), projectionContext.lineVertexArray.gety(previousLineVertexIndex));\n\n    // Don't cache because the new vertex might not be far enough out for future glyphs on the same segment\n    const minimumLength = syntheticVertexArgs.absOffsetX - syntheticVertexArgs.distanceFromAnchor + 1;\n    return projectTruncatedLineSegmentToLabelPlane(previousTilePoint, currentVertex, syntheticVertexArgs.previousVertex, minimumLength, projectionContext);\n}\n\n/**\n * Projects the given point in tile coordinates to the correct label plane.\n * If pitchWithMap is true, the (rotated) map plane in pixels is used,\n * otherwise screen pixels are used.\n */\nexport function projectTileCoordinatesToLabelPlane(x: number, y: number, projectionContext: SymbolProjectionContext): PointProjection {\n    const translatedX = x + projectionContext.translation[0];\n    const translatedY = y + projectionContext.translation[1];\n    let projection;\n    if (projectionContext.pitchWithMap) {\n        projection = projectWithMatrix(translatedX, translatedY, projectionContext.pitchedLabelPlaneMatrix, projectionContext.getElevation);\n        projection.isOccluded = false;\n    } else {\n        projection = projectionContext.transform.projectTileCoordinates(translatedX, translatedY, projectionContext.unwrappedTileID, projectionContext.getElevation);\n        projection.point.x = (projection.point.x * 0.5 + 0.5) * projectionContext.width;\n        projection.point.y = (-projection.point.y * 0.5 + 0.5) * projectionContext.height;\n    }\n    return projection;\n}\n\nfunction projectFromLabelPlaneToClipSpace(x: number, y: number, projectionContext: SymbolProjectionContext, pitchedLabelPlaneMatrixInverse: mat4): {x: number; y: number} {\n    if (projectionContext.pitchWithMap) {\n        const pos = [x, y, 0, 1] as vec4;\n        vec4.transformMat4(pos, pos, pitchedLabelPlaneMatrixInverse);\n        return projectionContext.transform.projectTileCoordinates(pos[0] / pos[3], pos[1] / pos[3], projectionContext.unwrappedTileID, projectionContext.getElevation).point;\n    } else {\n        return {\n            x: (x / projectionContext.width) * 2.0 - 1.0,\n            y: 1.0 - (y / projectionContext.height) * 2.0\n        };\n    }\n}\n\n/**\n * Projects the given point in tile coordinates to the GL clip space (-1..1).\n */\nexport function projectTileCoordinatesToClipSpace(x: number, y: number, projectionContext: SymbolProjectionContext): PointProjection {\n    const projection = projectionContext.transform.projectTileCoordinates(x, y, projectionContext.unwrappedTileID, projectionContext.getElevation);\n    return projection;\n}\n\n/**\n * Calculate the normal vector for a line segment\n * @param segmentVector - will be mutated as a tiny optimization\n * @param offset - magnitude of resulting vector\n * @param direction - direction of line traversal\n * @returns a normal vector from the segment, with magnitude equal to offset amount\n */\nexport function transformToOffsetNormal(segmentVector: Point, offset: number, direction: number): Point {\n    return segmentVector._unit()._perp()._mult(offset * direction);\n}\n\n/**\n * Construct offset line segments for the current segment and the next segment, then extend/shrink\n * the segments until they intersect. If the segments are parallel, then they will touch with no modification.\n *\n * @param index - Index of the current vertex\n * @param prevToCurrentOffsetNormal - Normal vector of the line segment from the previous vertex to the current vertex\n * @param currentVertex - Current (non-offset) vertex projected to the label plane\n * @param lineStartIndex - Beginning index for the line this label is on\n * @param lineEndIndex - End index for the line this label is on\n * @param offsetPreviousVertex - The previous vertex projected to the label plane, and then offset along the previous segments normal\n * @param lineOffsetY - Magnitude of the offset\n * @param projectionContext - Necessary data for tile-to-label-plane projection\n * @returns The point at which the current and next line segments intersect, once offset and extended/shrunk to their meeting point\n */\nexport function findOffsetIntersectionPoint(\n    index: number,\n    prevToCurrentOffsetNormal: Point,\n    currentVertex: Point,\n    lineStartIndex: number,\n    lineEndIndex: number,\n    offsetPreviousVertex: Point,\n    lineOffsetY: number,\n    projectionContext: SymbolProjectionContext,\n    syntheticVertexArgs: ProjectionSyntheticVertexArgs) {\n    if (projectionContext.projectionCache.offsets[index]) {\n        return projectionContext.projectionCache.offsets[index];\n    }\n\n    const offsetCurrentVertex = currentVertex.add(prevToCurrentOffsetNormal);\n\n    if (index + syntheticVertexArgs.direction < lineStartIndex || index + syntheticVertexArgs.direction >= lineEndIndex) {\n        // This is the end of the line, no intersection to calculate\n        projectionContext.projectionCache.offsets[index] = offsetCurrentVertex;\n        return offsetCurrentVertex;\n    }\n    // Offset the vertices for the next segment\n    const nextVertex = projectLineVertexToLabelPlane(index + syntheticVertexArgs.direction, projectionContext, syntheticVertexArgs);\n    const currentToNextOffsetNormal = transformToOffsetNormal(nextVertex.sub(currentVertex), lineOffsetY, syntheticVertexArgs.direction);\n    const offsetNextSegmentBegin = currentVertex.add(currentToNextOffsetNormal);\n    const offsetNextSegmentEnd = nextVertex.add(currentToNextOffsetNormal);\n\n    // find the intersection of these two lines\n    // if the lines are parallel, offsetCurrent/offsetNextBegin will touch\n    projectionContext.projectionCache.offsets[index] = findLineIntersection(offsetPreviousVertex, offsetCurrentVertex, offsetNextSegmentBegin, offsetNextSegmentEnd) || offsetCurrentVertex;\n\n    return projectionContext.projectionCache.offsets[index];\n}\n\n/**\n * Placed Glyph type\n */\ntype PlacedGlyph = {\n    /**\n     * The point at which the glyph should be placed, in label plane coordinates\n     */\n    point: Point;\n    /**\n     * The angle at which the glyph should be placed\n     */\n    angle: number;\n    /**\n     * The label-plane path used to reach this glyph: used only for collision detection\n     */\n    path: Array<Point>;\n};\n\n/*\n * Place a single glyph along its line, projected into the label plane, by iterating outward\n * from the anchor point until the distance traversed in the label plane equals the glyph's\n * offsetX. Returns null if the glyph can't fit on the line geometry.\n */\nexport function placeGlyphAlongLine(\n    offsetX: number,\n    lineOffsetX: number,\n    lineOffsetY: number,\n    flip: boolean,\n    anchorSegment: number,\n    lineStartIndex: number,\n    lineEndIndex: number,\n    projectionContext: SymbolProjectionContext,\n    rotateToLine: boolean): PlacedGlyph | null {\n\n    const combinedOffsetX = flip ?\n        offsetX - lineOffsetX :\n        offsetX + lineOffsetX;\n\n    let direction = combinedOffsetX > 0 ? 1 : -1;\n\n    let angle = 0;\n    if (flip) {\n        // The label needs to be flipped to keep text upright.\n        // Iterate in the reverse direction.\n        direction *= -1;\n        angle = Math.PI;\n    }\n\n    if (direction < 0) angle += Math.PI;\n\n    let currentIndex = direction > 0 ?\n        lineStartIndex + anchorSegment :\n        lineStartIndex + anchorSegment + 1;\n\n    // Project anchor point to viewport and cache it\n    let anchorPoint: Point;\n\n    if (projectionContext.projectionCache.cachedAnchorPoint) {\n        anchorPoint = projectionContext.projectionCache.cachedAnchorPoint;\n    } else {\n        anchorPoint = projectTileCoordinatesToLabelPlane(projectionContext.tileAnchorPoint.x, projectionContext.tileAnchorPoint.y, projectionContext).point;\n        projectionContext.projectionCache.cachedAnchorPoint = anchorPoint;\n    }\n\n    let currentVertex = anchorPoint;\n    let previousVertex = anchorPoint;\n\n    // offsetPrev and intersectionPoint are analogous to previousVertex and currentVertex\n    // but if there's a line offset they are calculated in parallel as projection happens\n    let offsetIntersectionPoint: Point;\n    let offsetPreviousVertex: Point;\n\n    let distanceFromAnchor = 0;\n    let currentSegmentDistance = 0;\n    const absOffsetX = Math.abs(combinedOffsetX);\n    const pathVertices: Array<Point> = [];\n\n    let currentLineSegment: Point;\n    while (distanceFromAnchor + currentSegmentDistance <= absOffsetX) {\n        currentIndex += direction;\n\n        // offset does not fit on the projected line\n        if (currentIndex < lineStartIndex || currentIndex >= lineEndIndex)\n            return null;\n\n        // accumulate values from last iteration\n        distanceFromAnchor += currentSegmentDistance;\n        previousVertex = currentVertex;\n        offsetPreviousVertex = offsetIntersectionPoint;\n\n        const syntheticVertexArgs: ProjectionSyntheticVertexArgs = {\n            absOffsetX,\n            direction,\n            distanceFromAnchor,\n            previousVertex\n        };\n\n        // find next vertex in viewport space\n        currentVertex = projectLineVertexToLabelPlane(currentIndex, projectionContext, syntheticVertexArgs);\n        if (lineOffsetY === 0) {\n            // Store vertices for collision detection and update current segment geometry\n            pathVertices.push(previousVertex);\n            currentLineSegment = currentVertex.sub(previousVertex);\n        } else {\n            // Calculate the offset for this section\n            let prevToCurrentOffsetNormal;\n            const prevToCurrent = currentVertex.sub(previousVertex);\n            if (prevToCurrent.mag() === 0) {\n                // We are starting with our anchor point directly on the vertex, so look one vertex ahead\n                // to calculate a normal\n                const nextVertex = projectLineVertexToLabelPlane(currentIndex + direction, projectionContext, syntheticVertexArgs);\n                prevToCurrentOffsetNormal = transformToOffsetNormal(nextVertex.sub(currentVertex), lineOffsetY, direction);\n            } else {\n                prevToCurrentOffsetNormal = transformToOffsetNormal(prevToCurrent, lineOffsetY, direction);\n            }\n            // Initialize offsetPrev on our first iteration, after that it will be pre-calculated\n            if (!offsetPreviousVertex)\n                offsetPreviousVertex = previousVertex.add(prevToCurrentOffsetNormal);\n\n            offsetIntersectionPoint = findOffsetIntersectionPoint(currentIndex, prevToCurrentOffsetNormal, currentVertex, lineStartIndex, lineEndIndex, offsetPreviousVertex, lineOffsetY, projectionContext, syntheticVertexArgs);\n\n            pathVertices.push(offsetPreviousVertex);\n            currentLineSegment = offsetIntersectionPoint.sub(offsetPreviousVertex);\n        }\n        currentSegmentDistance = currentLineSegment.mag();\n    }\n\n    // The point is on the current segment. Interpolate to find it.\n    const segmentInterpolationT = (absOffsetX - distanceFromAnchor) / currentSegmentDistance;\n    const p = currentLineSegment._mult(segmentInterpolationT)._add(offsetPreviousVertex || previousVertex);\n\n    const segmentAngle = angle + Math.atan2(currentVertex.y - previousVertex.y, currentVertex.x - previousVertex.x);\n\n    pathVertices.push(p);\n\n    return {\n        point: p,\n        angle: rotateToLine ? segmentAngle : 0.0,\n        path: pathVertices\n    };\n}\n\nconst hiddenGlyphAttributes = new Float32Array([-Infinity, -Infinity, 0, -Infinity, -Infinity, 0, -Infinity, -Infinity, 0, -Infinity, -Infinity, 0]);\n\n// Hide them by moving them offscreen. We still need to add them to the buffer\n// because the dynamic buffer is paired with a static buffer that doesn't get updated.\nexport function hideGlyphs(num: number, dynamicLayoutVertexArray: SymbolDynamicLayoutArray) {\n    for (let i = 0; i < num; i++) {\n        const offset = dynamicLayoutVertexArray.length;\n        dynamicLayoutVertexArray.resize(offset + 4);\n        // Since all hidden glyphs have the same attributes, we can build up the array faster with a single call to Float32Array.set\n        // for each set of four vertices, instead of calling addDynamicAttributes for each vertex.\n        dynamicLayoutVertexArray.float32.set(hiddenGlyphAttributes, offset * 3);\n    }\n}\n\n// For line label layout, we're not using z output and our w input is always 1\n// This custom matrix transformation ignores those components to make projection faster\nexport function xyTransformMat4(out: vec4, a: vec4, m: mat4) {\n    const x = a[0], y = a[1];\n    out[0] = m[0] * x + m[4] * y + m[12];\n    out[1] = m[1] * x + m[5] * y + m[13];\n    out[3] = m[3] * x + m[7] * y + m[15];\n    return out;\n}\n\n/**\n * Takes a path of points that was previously projected using the `pitchedLabelPlaneMatrix`\n * and projects it using the map projection's (mercator/globe...) `projectTileCoordinates` function.\n * Returns a new array of the projected points.\n * Does not modify the input array.\n */\nexport function projectPathSpecialProjection(projectedPath: Array<Point>, projectionContext: SymbolProjectionContext): Array<PointProjection> {\n    const inverseLabelPlaneMatrix = mat4.create();\n    mat4.invert(inverseLabelPlaneMatrix, projectionContext.pitchedLabelPlaneMatrix);\n    return projectedPath.map(p => {\n        const backProjected = projectWithMatrix(p.x, p.y, inverseLabelPlaneMatrix, projectionContext.getElevation);\n        const projected = projectionContext.transform.projectTileCoordinates(\n            backProjected.point.x,\n            backProjected.point.y,\n            projectionContext.unwrappedTileID,\n            projectionContext.getElevation\n        );\n        projected.point.x = (projected.point.x * 0.5 + 0.5) * projectionContext.width;\n        projected.point.y = (-projected.point.y * 0.5 + 0.5) * projectionContext.height;\n        return projected;\n    });\n}\n\n/**\n * Takes a path of points projected to screenspace, finds the longest continuous unoccluded segment of that path\n * and returns it.\n * Does not modify the input array.\n */\nexport function pathSlicedToLongestUnoccluded(path: Array<PointProjection>): Array<PointProjection> {\n    let longestUnoccludedStart = 0;\n    let longestUnoccludedLength = 0;\n    let currentUnoccludedStart = 0;\n    let currentUnoccludedLength = 0;\n    for (let i = 0; i < path.length; i++) {\n        if (path[i].isOccluded) {\n            currentUnoccludedStart = i + 1;\n            currentUnoccludedLength = 0;\n        } else {\n            currentUnoccludedLength++;\n            if (currentUnoccludedLength > longestUnoccludedLength) {\n                longestUnoccludedLength = currentUnoccludedLength;\n                longestUnoccludedStart = currentUnoccludedStart;\n            }\n        }\n    }\n    return path.slice(longestUnoccludedStart, longestUnoccludedStart + longestUnoccludedLength);\n}\n","import Point from '@mapbox/point-geometry';\nimport {clipLine} from './clip_line';\nimport {PathInterpolator} from './path_interpolator';\n\nimport * as intersectionTests from '../util/intersection_tests';\nimport {GridIndex} from './grid_index';\nimport {mat4, vec4} from 'gl-matrix';\nimport ONE_EM from '../symbol/one_em';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {SingleCollisionBox} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    PlacedSymbol,\n    SymbolLineVertexArray\n} from '../data/array_types.g';\nimport type {OverlapMode} from '../style/style_layer/overlap_mode';\nimport {type OverscaledTileID, type UnwrappedTileID} from '../tile/tile_id';\nimport {type PointProjection, type SymbolProjectionContext, getTileSkewVectors, pathSlicedToLongestUnoccluded, placeFirstAndLastGlyph, projectPathSpecialProjection, xyTransformMat4} from '../symbol/projection';\nimport {clamp, getAABB} from '../util/util';\nimport {Bounds} from '../geo/bounds';\n\n// When a symbol crosses the edge that causes it to be included in\n// collision detection, it will cause changes in the symbols around\n// it. This constant specifies how many pixels to pad the edge of\n// the viewport for collision detection so that the bulk of the changes\n// occur offscreen. Making this constant greater increases label\n// stability, but it's expensive.\nexport const viewportPadding = 100;\n\nexport type PlacedCircles = {\n    circles: Array<number>;\n    offscreen: boolean;\n    collisionDetected: boolean;\n};\n\nexport type PlacedBox = {\n    box: Array<number>;\n    placeable: boolean;\n    offscreen: boolean;\n    occluded: boolean;\n};\n\nexport type FeatureKey = {\n    bucketInstanceId: number;\n    featureIndex: number;\n    collisionGroupID: number;\n    overlapMode: OverlapMode;\n};\n\ntype ProjectedBox = {\n    /**\n     * The AABB in the format [minX, minY, maxX, maxY].\n     */\n    box: [number, number, number, number];\n    allPointsOccluded: boolean;\n};\n\n/**\n * @internal\n * A collision index used to prevent symbols from overlapping. It keep tracks of\n * where previous symbols have been placed and is used to check if a new\n * symbol overlaps with any previously added symbols.\n *\n * There are two steps to insertion: first placeCollisionBox/Circles checks if\n * there's room for a symbol, then insertCollisionBox/Circles actually puts the\n * symbol in the index. The two step process allows paired symbols to be inserted\n * together even if they overlap.\n */\nexport class CollisionIndex {\n    grid: GridIndex<FeatureKey>;\n    ignoredGrid: GridIndex<FeatureKey>;\n    transform: IReadonlyTransform;\n    pitchFactor: number;\n    screenRightBoundary: number;\n    screenBottomBoundary: number;\n    gridRightBoundary: number;\n    gridBottomBoundary: number;\n\n    // With perspectiveRatio the fontsize is calculated for tilted maps (near = bigger, far = smaller).\n    // The cutoff defines a threshold to no longer render labels near the horizon.\n    perspectiveRatioCutoff: number;\n\n    constructor(\n        transform: IReadonlyTransform,\n        grid = new GridIndex<FeatureKey>(transform.width + 2 * viewportPadding, transform.height + 2 * viewportPadding, 25),\n        ignoredGrid = new GridIndex<FeatureKey>(transform.width + 2 * viewportPadding, transform.height + 2 * viewportPadding, 25)\n    ) {\n        this.transform = transform;\n\n        this.grid = grid;\n        this.ignoredGrid = ignoredGrid;\n        this.pitchFactor = Math.cos(transform.pitch * Math.PI / 180.0) * transform.cameraToCenterDistance;\n\n        this.screenRightBoundary = transform.width + viewportPadding;\n        this.screenBottomBoundary = transform.height + viewportPadding;\n        this.gridRightBoundary = transform.width + 2 * viewportPadding;\n        this.gridBottomBoundary = transform.height + 2 * viewportPadding;\n\n        this.perspectiveRatioCutoff = 0.6;\n    }\n\n    placeCollisionBox(\n        collisionBox: SingleCollisionBox,\n        overlapMode: OverlapMode,\n        textPixelRatio: number,\n        tileID: OverscaledTileID,\n        unwrappedTileID: UnwrappedTileID,\n        pitchWithMap: boolean,\n        rotateWithMap: boolean,\n        translation: [number, number],\n        collisionGroupPredicate?: (key: FeatureKey) => boolean,\n        getElevation?: (x: number, y: number) => number,\n        shift?: Point,\n        simpleProjectionMatrix?: mat4,\n    ): PlacedBox {\n        const x = collisionBox.anchorPointX + translation[0];\n        const y = collisionBox.anchorPointY + translation[1];\n        const projectedPoint = this.projectAndGetPerspectiveRatio(\n            x,\n            y,\n            unwrappedTileID,\n            getElevation,\n            simpleProjectionMatrix\n        );\n\n        const tileToViewport = textPixelRatio * projectedPoint.perspectiveRatio;\n        let projectedBox: ProjectedBox;\n\n        if (!pitchWithMap && !rotateWithMap) {\n            // Fast path for common symbols\n            const pointX = projectedPoint.x + (shift ? shift.x * tileToViewport : 0);\n            const pointY = projectedPoint.y + (shift ? shift.y * tileToViewport : 0);\n            projectedBox = {\n                allPointsOccluded: false,\n                box: [\n                    pointX + collisionBox.x1 * tileToViewport,\n                    pointY + collisionBox.y1 * tileToViewport,\n                    pointX + collisionBox.x2 * tileToViewport,\n                    pointY + collisionBox.y2 * tileToViewport,\n                ]\n            };\n        } else {\n            projectedBox = this._projectCollisionBox(\n                collisionBox,\n                tileToViewport,\n                tileID,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translation,\n                projectedPoint,\n                getElevation,\n                shift,\n                simpleProjectionMatrix,\n            );\n        }\n\n        const [tlX, tlY, brX, brY] = projectedBox.box;\n\n        // Conditions are ordered from the fastest to evaluate to the slowest.\n        const occluded = pitchWithMap ? projectedBox.allPointsOccluded : projectedPoint.isOccluded;\n\n        let unplaceable = occluded;\n        unplaceable ||= projectedPoint.perspectiveRatio < this.perspectiveRatioCutoff;\n        unplaceable ||= !this.isInsideGrid(tlX, tlY, brX, brY);\n\n        if (unplaceable ||\n            (overlapMode !== 'always' && this.grid.hitTest(tlX, tlY, brX, brY, overlapMode, collisionGroupPredicate))) {\n            return {\n                box: [tlX, tlY, brX, brY],\n                placeable: false,\n                offscreen: false,\n                occluded\n            };\n        }\n\n        return {\n            box: [tlX, tlY, brX, brY],\n            placeable: true,\n            offscreen: this.isOffscreen(tlX, tlY, brX, brY),\n            occluded\n        };\n    }\n\n    placeCollisionCircles(\n        overlapMode: OverlapMode,\n        symbol: PlacedSymbol,\n        lineVertexArray: SymbolLineVertexArray,\n        glyphOffsetArray: GlyphOffsetArray,\n        fontSize: number,\n        unwrappedTileID: UnwrappedTileID,\n        pitchedLabelPlaneMatrix: mat4,\n        showCollisionCircles: boolean,\n        pitchWithMap: boolean,\n        collisionGroupPredicate: (key: FeatureKey) => boolean,\n        circlePixelDiameter: number,\n        textPixelPadding: number,\n        translation: [number, number],\n        getElevation: (x: number, y: number) => number\n    ): PlacedCircles {\n        const placedCollisionCircles = [];\n\n        const tileUnitAnchorPoint = new Point(symbol.anchorX, symbol.anchorY);\n        const perspectiveRatio = this.getPerspectiveRatio(tileUnitAnchorPoint.x, tileUnitAnchorPoint.y, unwrappedTileID, getElevation);\n\n        const labelPlaneFontSize = pitchWithMap ? (fontSize * this.transform.getPitchedTextCorrection(symbol.anchorX, symbol.anchorY, unwrappedTileID) / perspectiveRatio) : fontSize * perspectiveRatio;\n        const labelPlaneFontScale = labelPlaneFontSize / ONE_EM;\n\n        const projectionCache = {projections: {}, offsets: {}, cachedAnchorPoint: undefined, anyProjectionOccluded: false};\n        const lineOffsetX = symbol.lineOffsetX * labelPlaneFontScale;\n        const lineOffsetY = symbol.lineOffsetY * labelPlaneFontScale;\n\n        const projectionContext: SymbolProjectionContext = {\n            getElevation,\n            pitchedLabelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            transform: this.transform,\n            tileAnchorPoint: tileUnitAnchorPoint,\n            unwrappedTileID,\n            width: this.transform.width,\n            height: this.transform.height,\n            translation\n        };\n\n        const firstAndLastGlyph = placeFirstAndLastGlyph(\n            labelPlaneFontScale,\n            glyphOffsetArray,\n            lineOffsetX,\n            lineOffsetY,\n            /*flip*/ false,\n            symbol,\n            false,\n            projectionContext);\n\n        let collisionDetected = false;\n        let inGrid = false;\n        let entirelyOffscreen = true;\n\n        if (firstAndLastGlyph) {\n            const radius = circlePixelDiameter * 0.5 * perspectiveRatio + textPixelPadding;\n            const screenPlaneMin = new Point(-viewportPadding, -viewportPadding);\n            const screenPlaneMax = new Point(this.screenRightBoundary, this.screenBottomBoundary);\n            const interpolator = new PathInterpolator();\n\n            // Construct a projected path from projected line vertices. Anchor points are ignored and removed\n            const first = firstAndLastGlyph.first;\n            const last = firstAndLastGlyph.last;\n\n            let projectedPath: Array<Point> = [];\n            for (let i = first.path.length - 1; i >= 1; i--) {\n                projectedPath.push(first.path[i]);\n            }\n            for (let i = 1; i < last.path.length; i++) {\n                projectedPath.push(last.path[i]);\n            }\n\n            // Tolerate a slightly longer distance than one diameter between two adjacent circles\n            const circleDist = radius * 2.5;\n\n            // The path might need to be converted into screen space if a pitched map is used as the label space\n            if (pitchWithMap) {\n                const screenSpacePath = this.projectPathToScreenSpace(projectedPath, projectionContext);\n                // Do not try to place collision circles if even one of the points is behind the camera.\n                // This is a plausible scenario with big camera pitch angles\n                if (screenSpacePath.some(point => point.signedDistanceFromCamera <= 0)) {\n                    projectedPath = [];\n                } else {\n                    projectedPath = screenSpacePath.map(p => p.point);\n                }\n            }\n\n            let segments = [];\n\n            if (projectedPath.length > 0) {\n                // Quickly check if the path is fully inside or outside of the padded collision region.\n                // For overlapping paths we'll only create collision circles for the visible segments\n                const minPoint = projectedPath[0].clone();\n                const maxPoint = projectedPath[0].clone();\n\n                for (let i = 1; i < projectedPath.length; i++) {\n                    minPoint.x = Math.min(minPoint.x, projectedPath[i].x);\n                    minPoint.y = Math.min(minPoint.y, projectedPath[i].y);\n                    maxPoint.x = Math.max(maxPoint.x, projectedPath[i].x);\n                    maxPoint.y = Math.max(maxPoint.y, projectedPath[i].y);\n                }\n\n                if (minPoint.x >= screenPlaneMin.x && maxPoint.x <= screenPlaneMax.x &&\n                    minPoint.y >= screenPlaneMin.y && maxPoint.y <= screenPlaneMax.y) {\n                    // Quad fully visible\n                    segments = [projectedPath];\n                } else if (maxPoint.x < screenPlaneMin.x || minPoint.x > screenPlaneMax.x ||\n                    maxPoint.y < screenPlaneMin.y || minPoint.y > screenPlaneMax.y) {\n                    // Not visible\n                    segments = [];\n                } else {\n                    segments = clipLine([projectedPath], screenPlaneMin.x, screenPlaneMin.y, screenPlaneMax.x, screenPlaneMax.y);\n                }\n            }\n\n            for (const seg of segments) {\n                // interpolate positions for collision circles. Add a small padding to both ends of the segment\n                interpolator.reset(seg, radius * 0.25);\n\n                let numCircles = 0;\n\n                if (interpolator.length <= 0.5 * radius) {\n                    numCircles = 1;\n                } else {\n                    numCircles = Math.ceil(interpolator.paddedLength / circleDist) + 1;\n                }\n\n                for (let i = 0; i < numCircles; i++) {\n                    const t = i / Math.max(numCircles - 1, 1);\n                    const circlePosition = interpolator.lerp(t);\n\n                    // add viewport padding to the position and perform initial collision check\n                    const centerX = circlePosition.x + viewportPadding;\n                    const centerY = circlePosition.y + viewportPadding;\n\n                    placedCollisionCircles.push(centerX, centerY, radius, 0);\n\n                    const x1 = centerX - radius;\n                    const y1 = centerY - radius;\n                    const x2 = centerX + radius;\n                    const y2 = centerY + radius;\n\n                    entirelyOffscreen = entirelyOffscreen && this.isOffscreen(x1, y1, x2, y2);\n                    inGrid = inGrid || this.isInsideGrid(x1, y1, x2, y2);\n\n                    if (overlapMode !== 'always' && this.grid.hitTestCircle(centerX, centerY, radius, overlapMode, collisionGroupPredicate)) {\n                        // Don't early exit if we're showing the debug circles because we still want to calculate\n                        // which circles are in use\n                        collisionDetected = true;\n                        if (!showCollisionCircles) {\n                            return {\n                                circles: [],\n                                offscreen: false,\n                                collisionDetected\n                            };\n                        }\n                    }\n                }\n            }\n        }\n\n        return {\n            circles: ((!showCollisionCircles && collisionDetected) || !inGrid || perspectiveRatio < this.perspectiveRatioCutoff) ? [] : placedCollisionCircles,\n            offscreen: entirelyOffscreen,\n            collisionDetected\n        };\n    }\n\n    projectPathToScreenSpace(projectedPath: Array<Point>, projectionContext: SymbolProjectionContext): Array<PointProjection> {\n        const screenSpacePath = projectPathSpecialProjection(projectedPath, projectionContext);\n        // We don't want to generate screenspace collision circles for parts of the line that\n        // are occluded by the planet itself. Find the longest segment of the path that is\n        // not occluded, and remove everything else.\n        return pathSlicedToLongestUnoccluded(screenSpacePath);\n    }\n\n    /**\n     * Because the geometries in the CollisionIndex are an approximation of the shape of\n     * symbols on the map, we use the CollisionIndex to look up the symbol part of\n     * `queryRenderedFeatures`.\n     */\n    queryRenderedSymbols(viewportQueryGeometry: Array<Point>) {\n        if (viewportQueryGeometry.length === 0 || (this.grid.keysLength() === 0 && this.ignoredGrid.keysLength() === 0)) {\n            return {};\n        }\n\n        const query = [];\n        const bounds = new Bounds();\n        for (const point of viewportQueryGeometry) {\n            const gridPoint = new Point(point.x + viewportPadding, point.y + viewportPadding);\n            bounds.extend(gridPoint);\n            query.push(gridPoint);\n        }\n\n        const {minX, minY, maxX, maxY} = bounds;\n        const features = this.grid.query(minX, minY, maxX, maxY)\n            .concat(this.ignoredGrid.query(minX, minY, maxX, maxY));\n\n        const seenFeatures = {};\n        const result = {};\n\n        for (const feature of features) {\n            const featureKey = feature.key;\n            // Skip already seen features.\n            if (seenFeatures[featureKey.bucketInstanceId] === undefined) {\n                seenFeatures[featureKey.bucketInstanceId] = {};\n            }\n            if (seenFeatures[featureKey.bucketInstanceId][featureKey.featureIndex]) {\n                continue;\n            }\n\n            // Check if query intersects with the feature box\n            // \"Collision Circles\" for line labels are treated as boxes here\n            // Since there's no actual collision taking place, the circle vs. square\n            // distinction doesn't matter as much, and box geometry is easier\n            // to work with.\n            const bbox = [\n                new Point(feature.x1, feature.y1),\n                new Point(feature.x2, feature.y1),\n                new Point(feature.x2, feature.y2),\n                new Point(feature.x1, feature.y2)\n            ];\n            if (!intersectionTests.polygonIntersectsPolygon(query, bbox)) {\n                continue;\n            }\n\n            seenFeatures[featureKey.bucketInstanceId][featureKey.featureIndex] = true;\n            if (result[featureKey.bucketInstanceId] === undefined) {\n                result[featureKey.bucketInstanceId] = [];\n            }\n            result[featureKey.bucketInstanceId].push(featureKey.featureIndex);\n        }\n\n        return result;\n    }\n\n    insertCollisionBox(collisionBox: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number) {\n        const grid = ignorePlacement ? this.ignoredGrid : this.grid;\n\n        const key = {bucketInstanceId, featureIndex, collisionGroupID, overlapMode};\n        grid.insert(key, collisionBox[0], collisionBox[1], collisionBox[2], collisionBox[3]);\n    }\n\n    insertCollisionCircles(collisionCircles: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number) {\n        const grid = ignorePlacement ? this.ignoredGrid : this.grid;\n\n        const key = {bucketInstanceId, featureIndex, collisionGroupID, overlapMode};\n        for (let k = 0; k < collisionCircles.length; k += 4) {\n            grid.insertCircle(key, collisionCircles[k], collisionCircles[k + 1], collisionCircles[k + 2]);\n        }\n    }\n\n    projectAndGetPerspectiveRatio(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation?: (x: number, y: number) => number, simpleProjectionMatrix?: mat4) {\n        if (simpleProjectionMatrix) {\n            // This branch is a fast-path for mercator transform.\n            // The code here is a copy of MercatorTransform.projectTileCoordinates, slightly modified for extra performance.\n            // This has a huge impact for some reason.\n            let pos;\n            if (getElevation) { // slow because of handle z-index\n                pos = [x, y, getElevation(x, y), 1] as vec4;\n                vec4.transformMat4(pos, pos, simpleProjectionMatrix);\n            } else { // fast because of ignore z-index\n                pos = [x, y, 0, 1] as vec4;\n                xyTransformMat4(pos, pos, simpleProjectionMatrix);\n            }\n            const w = pos[3];\n            return {\n                x: (((pos[0] / w + 1) / 2) * this.transform.width) + viewportPadding,\n                y: (((-pos[1] / w + 1) / 2) * this.transform.height) + viewportPadding,\n                perspectiveRatio: 0.5 + 0.5 * (this.transform.cameraToCenterDistance / w),\n                isOccluded: false,\n                signedDistanceFromCamera: w\n            };\n        } else {\n            const projected = this.transform.projectTileCoordinates(x, y, unwrappedTileID, getElevation);\n            return {\n                x: (((projected.point.x + 1) / 2) * this.transform.width) + viewportPadding,\n                y: (((-projected.point.y + 1) / 2) * this.transform.height) + viewportPadding,\n                // See perspective ratio comment in symbol_sdf.vertex\n                // We're doing collision detection in viewport space so we need\n                // to scale down boxes in the distance\n                perspectiveRatio: 0.5 + 0.5 * (this.transform.cameraToCenterDistance / projected.signedDistanceFromCamera),\n                isOccluded: projected.isOccluded,\n                signedDistanceFromCamera: projected.signedDistanceFromCamera\n            };\n        }\n    }\n\n    getPerspectiveRatio(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation?: (x: number, y: number) => number): number {\n        // We don't care about the actual projected point, just its W component.\n        const projected = this.transform.projectTileCoordinates(x, y, unwrappedTileID, getElevation);\n        return 0.5 + 0.5 * (this.transform.cameraToCenterDistance / projected.signedDistanceFromCamera);\n    }\n\n    isOffscreen(x1: number, y1: number, x2: number, y2: number) {\n        return x2 < viewportPadding || x1 >= this.screenRightBoundary || y2 < viewportPadding || y1 > this.screenBottomBoundary;\n    }\n\n    isInsideGrid(x1: number, y1: number, x2: number, y2: number) {\n        return x2 >= 0 && x1 < this.gridRightBoundary && y2 >= 0 && y1 < this.gridBottomBoundary;\n    }\n\n    /*\n    * Returns a matrix for transforming collision shapes to viewport coordinate space.\n    * Use this function to render e.g. collision circles on the screen.\n    *   example transformation: clipPos = glCoordMatrix * viewportMatrix * circle_pos\n    */\n    getViewportMatrix() {\n        const m = mat4.identity([] as any);\n        mat4.translate(m, m, [-viewportPadding, -viewportPadding, 0.0]);\n        return m;\n    }\n\n    /**\n     * Applies all layout+paint properties of the given box in order to find as good approximation of its screen-space bounding box as possible.\n     */\n    private _projectCollisionBox(\n        collisionBox: SingleCollisionBox,\n        tileToViewport: number,\n        tileID: OverscaledTileID,\n        unwrappedTileID: UnwrappedTileID,\n        pitchWithMap: boolean,\n        rotateWithMap: boolean,\n        translation: [number, number],\n        projectedPoint: {x: number; y: number; perspectiveRatio: number; signedDistanceFromCamera: number},\n        getElevation?: (x: number, y: number) => number,\n        shift?: Point,\n        simpleProjectionMatrix?: mat4,\n    ): ProjectedBox {\n        // These vectors are valid both for screen space viewport-rotation-aligned texts and for pitch-align: map texts that are map-rotation-aligned.\n        let vecEastX = 1;\n        let vecEastY = 0;\n        let vecSouthX = 0;\n        let vecSouthY = 1;\n\n        const translatedAnchorX = collisionBox.anchorPointX + translation[0];\n        const translatedAnchorY = collisionBox.anchorPointY + translation[1];\n\n        if (rotateWithMap && !pitchWithMap) {\n            // Handles screen space texts that are always aligned east-west.\n            const projectedEast = this.projectAndGetPerspectiveRatio(\n                translatedAnchorX + 1,\n                translatedAnchorY,\n                unwrappedTileID,\n                getElevation,\n                simpleProjectionMatrix,\n            );\n            const toEastX = projectedEast.x - projectedPoint.x;\n            const toEastY = projectedEast.y - projectedPoint.y;\n            const angle = Math.atan(toEastY / toEastX) + (toEastX < 0 ? Math.PI : 0);\n            const sin = Math.sin(angle);\n            const cos = Math.cos(angle);\n            vecEastX = cos;\n            vecEastY = sin;\n            vecSouthX = -sin;\n            vecSouthY = cos;\n        } else if (!rotateWithMap && pitchWithMap) {\n            // Handles pitch-align: map texts that are always aligned with the viewport's X axis.\n            const skew = getTileSkewVectors(this.transform);\n            vecEastX = skew.vecEast[0];\n            vecEastY = skew.vecEast[1];\n            vecSouthX = skew.vecSouth[0];\n            vecSouthY = skew.vecSouth[1];\n        }\n\n        // Configuration for screen space offsets\n        let basePointX = projectedPoint.x;\n        let basePointY = projectedPoint.y;\n        let distanceMultiplier = tileToViewport;\n\n        if (pitchWithMap) {\n            // Configuration for tile space (map-pitch-aligned) offsets\n            basePointX = translatedAnchorX;\n            basePointY = translatedAnchorY;\n\n            const zoomFraction = this.transform.zoom - tileID.overscaledZ;\n            distanceMultiplier = Math.pow(2, -zoomFraction);\n            distanceMultiplier *= this.transform.getPitchedTextCorrection(translatedAnchorX, translatedAnchorY, unwrappedTileID);\n\n            // This next correction can't be applied when variable anchors are in use.\n            if (!shift) {\n                // Shader applies a perspective size correction, we need to apply the same correction.\n                // For non-pitchWithMap texts, this is handled above by multiplying `textPixelRatio` with `projectedPoint.perspectiveRatio`,\n                // which is equivalent to the non-pitchWithMap branch of the GLSL code.\n                // Here, we compute and apply the pitchWithMap branch.\n                // See the computation of `perspective_ratio` in the symbol vertex shaders for the GLSL code.\n                const distanceRatio = projectedPoint.signedDistanceFromCamera / this.transform.cameraToCenterDistance;\n                const perspectiveRatio = clamp(0.5 + 0.5 * distanceRatio, 0.0, 4.0); // Same clamp as what is used in the shader.\n                distanceMultiplier *= perspectiveRatio;\n            }\n        }\n\n        if (shift) {\n            // Variable anchors are in use\n            basePointX += vecEastX * shift.x * distanceMultiplier + vecSouthX * shift.y * distanceMultiplier;\n            basePointY += vecEastY * shift.x * distanceMultiplier + vecSouthY * shift.y * distanceMultiplier;\n        }\n\n        const offsetXmin = collisionBox.x1 * distanceMultiplier;\n        const offsetXmax = collisionBox.x2 * distanceMultiplier;\n        const offsetXhalf = (offsetXmin + offsetXmax) / 2;\n        const offsetYmin = collisionBox.y1 * distanceMultiplier;\n        const offsetYmax = collisionBox.y2 * distanceMultiplier;\n        const offsetYhalf = (offsetYmin + offsetYmax) / 2;\n\n        // 0--1--2\n        // |     |\n        // 7     3\n        // |     |\n        // 6--5--4\n        const offsetsArray: Array<{offsetX: number; offsetY: number}> = [\n            {offsetX: offsetXmin,  offsetY: offsetYmin},\n            {offsetX: offsetXhalf, offsetY: offsetYmin},\n            {offsetX: offsetXmax,  offsetY: offsetYmin},\n            {offsetX: offsetXmax,  offsetY: offsetYhalf},\n            {offsetX: offsetXmax,  offsetY: offsetYmax},\n            {offsetX: offsetXhalf, offsetY: offsetYmax},\n            {offsetX: offsetXmin,  offsetY: offsetYmax},\n            {offsetX: offsetXmin,  offsetY: offsetYhalf}\n        ];\n\n        let points: Array<Point> = [];\n\n        for (const {offsetX, offsetY} of offsetsArray) {\n            points.push(new Point(\n                basePointX + vecEastX * offsetX + vecSouthX * offsetY,\n                basePointY + vecEastY * offsetX + vecSouthY * offsetY\n            ));\n        }\n\n        // Is any point of the collision shape visible on the globe (on beyond horizon)?\n        let anyPointVisible = false;\n\n        if (pitchWithMap) {\n            const projected = points.map(p => this.projectAndGetPerspectiveRatio(p.x, p.y, unwrappedTileID, getElevation, simpleProjectionMatrix));\n\n            // Is at least one of the projected points NOT behind the horizon?\n            anyPointVisible = projected.some(p => !p.isOccluded);\n\n            points = projected.map(p => new Point(p.x, p.y));\n        } else {\n            // Labels that are not pitchWithMap cannot ever hide behind the horizon.\n            anyPointVisible = true;\n        }\n\n        return {\n            box: getAABB(points),\n            allPointsOccluded: !anyPointVisible\n        };\n    }\n}\n","import {CollisionIndex, viewportPadding} from './collision_index';\nimport type {FeatureKey, PlacedBox, PlacedCircles} from './collision_index';\nimport {EXTENT} from '../data/extent';\nimport * as symbolSize from './symbol_size';\nimport * as projection from './projection';\nimport {getAnchorJustification} from './symbol_layout';\nimport {getAnchorAlignment, WritingMode} from './shaping';\nimport {type mat4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport Point from '@mapbox/point-geometry';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\nimport type {StyleLayer} from '../style/style_layer';\nimport {type PossiblyEvaluated} from '../style/properties';\nimport type {SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated} from '../style/style_layer/symbol_style_layer_properties.g';\nimport {getOverlapMode, type OverlapMode} from '../style/style_layer/overlap_mode';\n\nimport type {Tile} from '../tile/tile';\nimport type {SymbolBucket, CollisionArrays, SingleCollisionBox, SymbolBuffers} from '../data/bucket/symbol_bucket';\nimport type {CollisionBoxArray, CollisionVertexArray, SymbolInstance, TextAnchorOffset} from '../data/array_types.g';\nimport type {FeatureIndex} from '../data/feature_index';\nimport type {OverscaledTileID, UnwrappedTileID} from '../tile/tile_id';\nimport {type Terrain} from '../render/terrain';\nimport {translatePosition, warnOnce} from '../util/util';\nimport {type TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\n\nclass OpacityState {\n    opacity: number;\n    placed: boolean;\n    constructor(prevState: OpacityState, increment: number, placed: boolean, skipFade?: boolean | null) {\n        if (prevState) {\n            this.opacity = Math.max(0, Math.min(1, prevState.opacity + (prevState.placed ? increment : -increment)));\n        } else {\n            this.opacity = (skipFade && placed) ? 1 : 0;\n        }\n        this.placed = placed;\n    }\n    isHidden() {\n        return this.opacity === 0 && !this.placed;\n    }\n}\n\nclass JointOpacityState {\n    text: OpacityState;\n    icon: OpacityState;\n    constructor(prevState: JointOpacityState, increment: number, placedText: boolean, placedIcon: boolean, skipFade?: boolean | null) {\n        this.text = new OpacityState(prevState ? prevState.text : null, increment, placedText, skipFade);\n        this.icon = new OpacityState(prevState ? prevState.icon : null, increment, placedIcon, skipFade);\n    }\n    isHidden() {\n        return this.text.isHidden() && this.icon.isHidden();\n    }\n}\n\nclass JointPlacement {\n    text: boolean;\n    icon: boolean;\n    // skipFade = outside viewport, but within CollisionIndex::viewportPadding px of the edge\n    // Because these symbols aren't onscreen yet, we can skip the \"fade in\" animation,\n    // and if a subsequent viewport change brings them into view, they'll be fully\n    // visible right away.\n    skipFade: boolean;\n    constructor(text: boolean, icon: boolean, skipFade: boolean) {\n        this.text = text;\n        this.icon = icon;\n        this.skipFade = skipFade;\n    }\n}\n\nexport class RetainedQueryData {\n    bucketInstanceId: number;\n    featureIndex: FeatureIndex;\n    sourceLayerIndex: number;\n    bucketIndex: number;\n    tileID: OverscaledTileID;\n    featureSortOrder: Array<number>;\n    constructor(bucketInstanceId: number,\n        featureIndex: FeatureIndex,\n        sourceLayerIndex: number,\n        bucketIndex: number,\n        tileID: OverscaledTileID) {\n        this.bucketInstanceId = bucketInstanceId;\n        this.featureIndex = featureIndex;\n        this.sourceLayerIndex = sourceLayerIndex;\n        this.bucketIndex = bucketIndex;\n        this.tileID = tileID;\n    }\n}\n\ntype CollisionGroup = {\n    ID: number;\n    predicate?: (key: FeatureKey) => boolean;\n};\n\nclass CollisionGroups {\n    collisionGroups: {[groupName: string]: CollisionGroup};\n    maxGroupID: number;\n    crossSourceCollisions: boolean;\n\n    constructor(crossSourceCollisions: boolean) {\n        this.crossSourceCollisions = crossSourceCollisions;\n        this.maxGroupID = 0;\n        this.collisionGroups = {};\n    }\n\n    get(sourceID: string) {\n        // The predicate/groupID mechanism allows for arbitrary grouping,\n        // but the current interface defines one source == one group when\n        // crossSourceCollisions == true.\n        if (!this.crossSourceCollisions) {\n            if (!this.collisionGroups[sourceID]) {\n                const nextGroupID = ++this.maxGroupID;\n                this.collisionGroups[sourceID] = {\n                    ID: nextGroupID,\n                    predicate: (key) => {\n                        return key.collisionGroupID === nextGroupID;\n                    }\n                };\n            }\n            return this.collisionGroups[sourceID];\n        } else {\n            return {ID: 0, predicate: null};\n        }\n    }\n}\n\nfunction calculateVariableLayoutShift(\n    anchor: TextAnchor,\n    width: number,\n    height: number,\n    textOffset: [number, number],\n    textBoxScale: number\n): Point {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(anchor);\n    const shiftX = -(horizontalAlign - 0.5) * width;\n    const shiftY = -(verticalAlign - 0.5) * height;\n    return new Point(\n        shiftX + textOffset[0] * textBoxScale,\n        shiftY + textOffset[1] * textBoxScale\n    );\n}\n\nexport type VariableOffset = {\n    textOffset: [number, number];\n    width: number;\n    height: number;\n    anchor: TextAnchor;\n    textBoxScale: number;\n    prevAnchor?: TextAnchor;\n};\n\ntype TileLayerParameters = {\n    bucket: SymbolBucket;\n    layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;\n    translationText: [number, number];\n    translationIcon: [number, number];\n    unwrappedTileID: UnwrappedTileID;\n    pitchedLabelPlaneMatrix: mat4;\n    scale: number;\n    textPixelRatio: number;\n    holdingForFade: boolean;\n    collisionBoxArray: CollisionBoxArray;\n    partiallyEvaluatedTextSize: {\n        uSize: number;\n        uSizeT: number;\n    };\n    collisionGroup: CollisionGroup;\n};\n\nexport type BucketPart = {\n    sortKey?: number | void;\n    symbolInstanceStart: number;\n    symbolInstanceEnd: number;\n    parameters: TileLayerParameters;\n};\n\nexport type CrossTileID = string | number;\n\nexport class Placement {\n    transform: IReadonlyTransform;\n    terrain: Terrain;\n    collisionIndex: CollisionIndex;\n    placements: {\n        [_ in CrossTileID]: JointPlacement;\n    };\n    opacities: {\n        [_ in CrossTileID]: JointOpacityState;\n    };\n    variableOffsets: {\n        [_ in CrossTileID]: VariableOffset;\n    };\n    placedOrientations: {\n        [_ in CrossTileID]: number;\n    };\n    commitTime: number;\n    prevZoomAdjustment: number;\n    lastPlacementChangeTime: number;\n    stale: boolean;\n    fadeDuration: number;\n    retainedQueryData: {\n        [_: number]: RetainedQueryData;\n    };\n    collisionGroups: CollisionGroups;\n    prevPlacement: Placement;\n    zoomAtLastRecencyCheck: number;\n    collisionCircleArrays: {\n        [k in any]: Array<number>;\n    };\n    collisionBoxArrays: Map<number, Map<number, {\n        text: number[];\n        icon: number[];\n    }>>;\n\n    constructor(transform: ITransform, terrain: Terrain, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement) {\n        this.transform = transform.clone();\n        this.terrain = terrain;\n        this.collisionIndex = new CollisionIndex(this.transform);\n        this.placements = {};\n        this.opacities = {};\n        this.variableOffsets = {};\n        this.stale = false;\n        this.commitTime = 0;\n        this.fadeDuration = fadeDuration;\n        this.retainedQueryData = {};\n        this.collisionGroups = new CollisionGroups(crossSourceCollisions);\n        this.collisionCircleArrays = {};\n        this.collisionBoxArrays = new Map<number, Map<number, {\n            text: number[];\n            icon: number[];\n        }>>();\n\n        this.prevPlacement = prevPlacement;\n        if (prevPlacement) {\n            prevPlacement.prevPlacement = undefined; // Only hold on to one placement back\n        }\n\n        this.placedOrientations = {};\n    }\n\n    private _getTerrainElevationFunc(tileID: OverscaledTileID) {\n        const terrain = this.terrain;\n        return terrain ? (x: number, y: number) => terrain.getElevation(tileID, x, y) : null;\n    }\n\n    getBucketParts(results: Array<BucketPart>, styleLayer: StyleLayer, tile: Tile, sortAcrossTiles: boolean) {\n        const symbolBucket = (tile.getBucket(styleLayer) as SymbolBucket);\n        const bucketFeatureIndex = tile.latestFeatureIndex;\n        if (!symbolBucket || !bucketFeatureIndex || styleLayer.id !== symbolBucket.layerIds[0])\n            return;\n\n        const collisionBoxArray = tile.collisionBoxArray;\n\n        const layout = symbolBucket.layers[0].layout;\n        const paint = symbolBucket.layers[0].paint;\n\n        const scale = Math.pow(2, this.transform.zoom - tile.tileID.overscaledZ);\n        const textPixelRatio = tile.tileSize / EXTENT;\n\n        const unwrappedTileID = tile.tileID.toUnwrapped();\n\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pixelsToTiles = pixelsToTileUnits(tile, 1, this.transform.zoom);\n\n        const translationText = translatePosition(\n            this.collisionIndex.transform,\n            tile,\n            paint.get('text-translate'),\n            paint.get('text-translate-anchor'),);\n\n        const translationIcon = translatePosition(\n            this.collisionIndex.transform,\n            tile,\n            paint.get('icon-translate'),\n            paint.get('icon-translate-anchor'),);\n\n        const pitchedLabelPlaneMatrix = projection.getPitchedLabelPlaneMatrix(rotateWithMap, this.transform, pixelsToTiles);\n\n        // As long as this placement lives, we have to hold onto this bucket's\n        // matching FeatureIndex/data for querying purposes\n        this.retainedQueryData[symbolBucket.bucketInstanceId] = new RetainedQueryData(\n            symbolBucket.bucketInstanceId,\n            bucketFeatureIndex,\n            symbolBucket.sourceLayerIndex,\n            symbolBucket.index,\n            tile.tileID\n        );\n\n        const parameters: TileLayerParameters = {\n            bucket: symbolBucket,\n            layout,\n            translationText,\n            translationIcon,\n            unwrappedTileID,\n            pitchedLabelPlaneMatrix,\n            scale,\n            textPixelRatio,\n            holdingForFade: tile.holdingForSymbolFade(),\n            collisionBoxArray,\n            partiallyEvaluatedTextSize: symbolSize.evaluateSizeForZoom(symbolBucket.textSizeData, this.transform.zoom),\n            collisionGroup: this.collisionGroups.get(symbolBucket.sourceID)\n        };\n\n        if (sortAcrossTiles) {\n            for (const range of symbolBucket.sortKeyRanges) {\n                const {sortKey, symbolInstanceStart, symbolInstanceEnd} = range;\n                results.push({sortKey, symbolInstanceStart, symbolInstanceEnd, parameters});\n            }\n        } else {\n            results.push({\n                symbolInstanceStart: 0,\n                symbolInstanceEnd: symbolBucket.symbolInstances.length,\n                parameters\n            });\n        }\n    }\n\n    attemptAnchorPlacement(\n        textAnchorOffset: TextAnchorOffset,\n        textBox: SingleCollisionBox,\n        width: number,\n        height: number,\n        textBoxScale: number,\n        rotateWithMap: boolean,\n        pitchWithMap: boolean,\n        textPixelRatio: number,\n        tileID: OverscaledTileID,\n        unwrappedTileID,\n        collisionGroup: CollisionGroup,\n        textOverlapMode: OverlapMode,\n        symbolInstance: SymbolInstance,\n        bucket: SymbolBucket,\n        orientation: number,\n        translationText: [number, number],\n        translationIcon: [number, number],\n        iconBox?: SingleCollisionBox | null,\n        getElevation?: (x: number, y: number) => number,\n        simpleProjectionMatrix?: mat4,\n    ): {\n        shift: Point;\n        placedGlyphBoxes: PlacedBox;\n    } {\n\n        const anchor = TextAnchorEnum[textAnchorOffset.textAnchor] as TextAnchor;\n        const textOffset = [textAnchorOffset.textOffset0, textAnchorOffset.textOffset1] as [number, number];\n        const shift = calculateVariableLayoutShift(anchor, width, height, textOffset, textBoxScale);\n\n        const placedGlyphBoxes = this.collisionIndex.placeCollisionBox(\n            textBox,\n            textOverlapMode,\n            textPixelRatio,\n            tileID,\n            unwrappedTileID,\n            pitchWithMap,\n            rotateWithMap,\n            translationText,\n            collisionGroup.predicate,\n            getElevation,\n            shift,\n            simpleProjectionMatrix,\n        );\n\n        if (iconBox) {\n            const placedIconBoxes = this.collisionIndex.placeCollisionBox(\n                iconBox,\n                textOverlapMode,\n                textPixelRatio,\n                tileID,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translationIcon,\n                collisionGroup.predicate,\n                getElevation,\n                shift,\n                simpleProjectionMatrix,\n            );\n            if (!placedIconBoxes.placeable) return;\n        }\n\n        if (placedGlyphBoxes.placeable) {\n            let prevAnchor;\n            // If this label was placed in the previous placement, record the anchor position\n            // to allow us to animate the transition\n            if (this.prevPlacement &&\n                this.prevPlacement.variableOffsets[symbolInstance.crossTileID] &&\n                this.prevPlacement.placements[symbolInstance.crossTileID] &&\n                this.prevPlacement.placements[symbolInstance.crossTileID].text) {\n                prevAnchor = this.prevPlacement.variableOffsets[symbolInstance.crossTileID].anchor;\n            }\n            if (symbolInstance.crossTileID === 0) throw new Error('symbolInstance.crossTileID can\\'t be 0');\n            this.variableOffsets[symbolInstance.crossTileID] = {\n                textOffset,\n                width,\n                height,\n                anchor,\n                textBoxScale,\n                prevAnchor\n            };\n            this.markUsedJustification(bucket, anchor, symbolInstance, orientation);\n\n            if (bucket.allowVerticalPlacement) {\n                this.markUsedOrientation(bucket, orientation, symbolInstance);\n                this.placedOrientations[symbolInstance.crossTileID] = orientation;\n            }\n\n            return {shift, placedGlyphBoxes};\n        }\n    }\n\n    placeLayerBucketPart(bucketPart: BucketPart, seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    }, showCollisionBoxes: boolean) {\n\n        const {\n            bucket,\n            layout,\n            translationText,\n            translationIcon,\n            unwrappedTileID,\n            pitchedLabelPlaneMatrix,\n            textPixelRatio,\n            holdingForFade,\n            collisionBoxArray,\n            partiallyEvaluatedTextSize,\n            collisionGroup\n        } = bucketPart.parameters;\n\n        const textOptional = layout.get('text-optional');\n        const iconOptional = layout.get('icon-optional');\n        const textOverlapMode = getOverlapMode(layout, 'text-overlap', 'text-allow-overlap');\n        const textAlwaysOverlap = textOverlapMode === 'always';\n        const iconOverlapMode = getOverlapMode(layout, 'icon-overlap', 'icon-allow-overlap');\n        const iconAlwaysOverlap = iconOverlapMode === 'always';\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pitchWithMap = layout.get('text-pitch-alignment') === 'map';\n        const hasIconTextFit = layout.get('icon-text-fit') !== 'none';\n        const zOrderByViewportY = layout.get('symbol-z-order') === 'viewport-y';\n\n        // This logic is similar to the \"defaultOpacityState\" logic below in updateBucketOpacities\n        // If we know a symbol is always supposed to show, force it to be marked visible even if\n        // it wasn't placed into the collision index (because some or all of it was outside the range\n        // of the collision grid).\n        // There is a subtle edge case here we're accepting:\n        //  Symbol A has text-allow-overlap: true, icon-allow-overlap: true, icon-optional: false\n        //  A's icon is outside the grid, so doesn't get placed\n        //  A's text would be inside grid, but doesn't get placed because of icon-optional: false\n        //  We still show A because of the allow-overlap settings.\n        //  Symbol B has allow-overlap: false, and gets placed where A's text would be\n        //  On panning in, there is a short period when Symbol B and Symbol A will overlap\n        //  This is the reverse of our normal policy of \"fade in on pan\", but should look like any other\n        //  collision and hopefully not be too noticeable.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/7172\n        const alwaysShowText = textAlwaysOverlap && (iconAlwaysOverlap || !bucket.hasIconData() || iconOptional);\n        const alwaysShowIcon = iconAlwaysOverlap && (textAlwaysOverlap || !bucket.hasTextData() || textOptional);\n\n        if (!bucket.collisionArrays && collisionBoxArray) {\n            bucket.deserializeCollisionBoxes(collisionBoxArray);\n        }\n\n        const tileID = this.retainedQueryData[bucket.bucketInstanceId].tileID;\n        const getElevation = this._getTerrainElevationFunc(tileID);\n        const simpleProjectionMatrix = this.transform.getFastPathSimpleProjectionMatrix(tileID);\n\n        const placeSymbol = (symbolInstance: SymbolInstance, collisionArrays: CollisionArrays, symbolIndex: number) => {\n            if (seenCrossTileIDs[symbolInstance.crossTileID]) return;\n            if (holdingForFade) {\n                // Mark all symbols from this tile as \"not placed\", but don't add to seenCrossTileIDs, because we don't\n                // know yet if we have a duplicate in a parent tile that _should_ be placed.\n                this.placements[symbolInstance.crossTileID] = new JointPlacement(false, false, false);\n                return;\n            }\n\n            let placeText = false;\n            let placeIcon = false;\n            let offscreen = true;\n            let shift = null;\n\n            let placed: PlacedBox = {box: null, placeable: false, offscreen: null, occluded: false};\n            let placedVerticalText = {box: null, placeable: false, offscreen: null};\n\n            let placedGlyphBoxes: PlacedBox = null;\n            let placedGlyphCircles: PlacedCircles = null;\n            let placedIconBoxes: PlacedBox = null;\n            let textFeatureIndex = 0;\n            let verticalTextFeatureIndex = 0;\n            let iconFeatureIndex = 0;\n\n            if (collisionArrays.textFeatureIndex) {\n                textFeatureIndex = collisionArrays.textFeatureIndex;\n            } else if (symbolInstance.useRuntimeCollisionCircles) {\n                textFeatureIndex = symbolInstance.featureIndex;\n            }\n            if (collisionArrays.verticalTextFeatureIndex) {\n                verticalTextFeatureIndex = collisionArrays.verticalTextFeatureIndex;\n            }\n\n            const textBox = collisionArrays.textBox;\n            if (textBox) {\n\n                const updatePreviousOrientationIfNotPlaced = (isPlaced) => {\n                    let previousOrientation = WritingMode.horizontal;\n                    if (bucket.allowVerticalPlacement && !isPlaced && this.prevPlacement) {\n                        const prevPlacedOrientation = this.prevPlacement.placedOrientations[symbolInstance.crossTileID];\n                        if (prevPlacedOrientation) {\n                            this.placedOrientations[symbolInstance.crossTileID] = prevPlacedOrientation;\n                            previousOrientation = prevPlacedOrientation;\n                            this.markUsedOrientation(bucket, previousOrientation, symbolInstance);\n                        }\n                    }\n                    return previousOrientation;\n                };\n\n                const placeTextForPlacementModes = (placeHorizontalFn, placeVerticalFn) => {\n                    if (bucket.allowVerticalPlacement && symbolInstance.numVerticalGlyphVertices > 0 && collisionArrays.verticalTextBox) {\n                        for (const placementMode of bucket.writingModes) {\n                            if (placementMode === WritingMode.vertical) {\n                                placed = placeVerticalFn();\n                                placedVerticalText = placed;\n                            } else {\n                                placed = placeHorizontalFn();\n                            }\n                            if (placed && placed.placeable) break;\n                        }\n                    } else {\n                        placed = placeHorizontalFn();\n                    }\n                };\n\n                const textAnchorOffsetStart = symbolInstance.textAnchorOffsetStartIndex;\n                const textAnchorOffsetEnd = symbolInstance.textAnchorOffsetEndIndex;\n\n                // If start+end indices match, text-variable-anchor is not in play.\n                if (textAnchorOffsetEnd === textAnchorOffsetStart) {\n                    const placeBox = (collisionTextBox, orientation) => {\n                        const placedFeature = this.collisionIndex.placeCollisionBox(\n                            collisionTextBox,\n                            textOverlapMode,\n                            textPixelRatio,\n                            tileID,\n                            unwrappedTileID,\n                            pitchWithMap,\n                            rotateWithMap,\n                            translationText,\n                            collisionGroup.predicate,\n                            getElevation,\n                            undefined,\n                            simpleProjectionMatrix,\n                        );\n                        if (placedFeature && placedFeature.placeable) {\n                            this.markUsedOrientation(bucket, orientation, symbolInstance);\n                            this.placedOrientations[symbolInstance.crossTileID] = orientation;\n                        }\n                        return placedFeature;\n                    };\n\n                    const placeHorizontal = () => {\n                        return placeBox(textBox, WritingMode.horizontal);\n                    };\n\n                    const placeVertical = () => {\n                        const verticalTextBox = collisionArrays.verticalTextBox;\n                        if (bucket.allowVerticalPlacement && symbolInstance.numVerticalGlyphVertices > 0 && verticalTextBox) {\n                            return placeBox(verticalTextBox, WritingMode.vertical);\n                        }\n                        return {box: null, offscreen: null};\n                    };\n\n                    placeTextForPlacementModes(placeHorizontal, placeVertical);\n                    updatePreviousOrientationIfNotPlaced(placed && placed.placeable);\n\n                } else {\n                    // If this symbol was in the last placement, prefer placement using same anchor, if it's still available\n                    let prevAnchor = TextAnchorEnum[this.prevPlacement?.variableOffsets[symbolInstance.crossTileID]?.anchor];\n\n                    const placeBoxForVariableAnchors = (collisionTextBox, collisionIconBox, orientation) => {\n                        const width = collisionTextBox.x2 - collisionTextBox.x1;\n                        const height = collisionTextBox.y2 - collisionTextBox.y1;\n                        const textBoxScale = symbolInstance.textBoxScale;\n                        const variableIconBox = hasIconTextFit && (iconOverlapMode === 'never') ? collisionIconBox : null;\n\n                        let placedBox: PlacedBox = null;\n                        let placementPasses = (textOverlapMode === 'never') ? 1 : 2;\n                        let overlapMode: OverlapMode = 'never';\n\n                        if (prevAnchor) {\n                            placementPasses++;\n                        }\n\n                        for (let pass = 0; pass < placementPasses; pass++) {\n                            for (let i = textAnchorOffsetStart; i < textAnchorOffsetEnd; i++) {\n                                const textAnchorOffset = bucket.textAnchorOffsets.get(i);\n\n                                if (prevAnchor && textAnchorOffset.textAnchor !== prevAnchor) {\n                                    continue;\n                                }\n\n                                const result = this.attemptAnchorPlacement(\n                                    textAnchorOffset, collisionTextBox, width, height,\n                                    textBoxScale, rotateWithMap, pitchWithMap, textPixelRatio, tileID, unwrappedTileID,\n                                    collisionGroup, overlapMode, symbolInstance, bucket, orientation, translationText, translationIcon, variableIconBox, getElevation);\n\n                                if (result) {\n                                    placedBox = result.placedGlyphBoxes;\n                                    if (placedBox && placedBox.placeable) {\n                                        placeText = true;\n                                        shift = result.shift;\n                                        return placedBox;\n                                    }\n                                }\n                            }\n\n                            if (prevAnchor) {\n                                prevAnchor = null;\n                            } else {\n                                overlapMode = textOverlapMode;\n                            }\n                        }\n\n                        if (showCollisionBoxes && !placedBox) {\n                            // No box was successfully placed\n                            // Generate bounds for a fake centered box, so that we can at least display something for collision debug.\n                            const placedFakeGlyphBox = this.collisionIndex.placeCollisionBox(\n                                textBox,\n                                'always', // Skips expensive collision check with already placed boxes\n                                textPixelRatio,\n                                tileID,\n                                unwrappedTileID,\n                                pitchWithMap,\n                                rotateWithMap,\n                                translationText,\n                                collisionGroup.predicate,\n                                getElevation,\n                                undefined,\n                                simpleProjectionMatrix,\n                            );\n                            placedBox = {\n                                box: placedFakeGlyphBox.box,\n                                offscreen: false,\n                                placeable: false,\n                                occluded: false,\n                            };\n                        }\n\n                        return placedBox;\n                    };\n\n                    const placeHorizontal = () => {\n                        return placeBoxForVariableAnchors(textBox, collisionArrays.iconBox, WritingMode.horizontal);\n                    };\n\n                    const placeVertical = () => {\n                        const verticalTextBox = collisionArrays.verticalTextBox;\n                        const wasPlaced = placed && placed.placeable;\n                        if (bucket.allowVerticalPlacement && !wasPlaced && symbolInstance.numVerticalGlyphVertices > 0 && verticalTextBox) {\n                            return placeBoxForVariableAnchors(verticalTextBox, collisionArrays.verticalIconBox, WritingMode.vertical);\n                        }\n                        return {box: null, occluded: true, offscreen: null};\n                    };\n\n                    placeTextForPlacementModes(placeHorizontal, placeVertical);\n\n                    if (placed) {\n                        placeText = placed.placeable;\n                        offscreen = placed.offscreen;\n                    }\n\n                    const prevOrientation = updatePreviousOrientationIfNotPlaced(placed && placed.placeable);\n\n                    // If we didn't get placed, we still need to copy our position from the last placement for\n                    // fade animations\n                    if (!placeText && this.prevPlacement) {\n                        const prevOffset = this.prevPlacement.variableOffsets[symbolInstance.crossTileID];\n                        if (prevOffset) {\n                            this.variableOffsets[symbolInstance.crossTileID] = prevOffset;\n                            this.markUsedJustification(bucket, prevOffset.anchor, symbolInstance, prevOrientation);\n                        }\n                    }\n\n                }\n            }\n\n            placedGlyphBoxes = placed;\n            placeText = placedGlyphBoxes && placedGlyphBoxes.placeable;\n            offscreen = placedGlyphBoxes && placedGlyphBoxes.offscreen;\n\n            if (symbolInstance.useRuntimeCollisionCircles && symbolInstance.centerJustifiedTextSymbolIndex >= 0) {\n                const placedSymbol = bucket.text.placedSymbolArray.get(symbolInstance.centerJustifiedTextSymbolIndex);\n                const fontSize = symbolSize.evaluateSizeForFeature(bucket.textSizeData, partiallyEvaluatedTextSize, placedSymbol);\n\n                const textPixelPadding = layout.get('text-padding');\n                const circlePixelDiameter = symbolInstance.collisionCircleDiameter;\n\n                placedGlyphCircles = this.collisionIndex.placeCollisionCircles(\n                    textOverlapMode,\n                    placedSymbol,\n                    bucket.lineVertexArray,\n                    bucket.glyphOffsetArray,\n                    fontSize,\n                    unwrappedTileID,\n                    pitchedLabelPlaneMatrix,\n                    showCollisionBoxes,\n                    pitchWithMap,\n                    collisionGroup.predicate,\n                    circlePixelDiameter,\n                    textPixelPadding,\n                    translationText,\n                    getElevation\n                );\n\n                if (placedGlyphCircles.circles.length && placedGlyphCircles.collisionDetected && !showCollisionBoxes) {\n                    warnOnce('Collisions detected, but collision boxes are not shown');\n                }\n\n                // If text-overlap is set to 'always', force \"placedCircles\" to true\n                // In theory there should always be at least one circle placed\n                // in this case, but for now quirks in text-anchor\n                // and text-offset may prevent that from being true.\n                placeText = textAlwaysOverlap || (placedGlyphCircles.circles.length > 0 && !placedGlyphCircles.collisionDetected);\n                offscreen = offscreen && placedGlyphCircles.offscreen;\n            }\n\n            if (collisionArrays.iconFeatureIndex) {\n                iconFeatureIndex = collisionArrays.iconFeatureIndex;\n            }\n\n            if (collisionArrays.iconBox) {\n                const placeIconFeature = iconBox => {\n                    return this.collisionIndex.placeCollisionBox(\n                        iconBox,\n                        iconOverlapMode,\n                        textPixelRatio,\n                        tileID,\n                        unwrappedTileID,\n                        pitchWithMap,\n                        rotateWithMap,\n                        translationIcon,\n                        collisionGroup.predicate,\n                        getElevation,\n                        (hasIconTextFit && shift) ? shift : undefined,\n                        simpleProjectionMatrix,\n                    );\n                };\n\n                if (placedVerticalText && placedVerticalText.placeable && collisionArrays.verticalIconBox) {\n                    placedIconBoxes = placeIconFeature(collisionArrays.verticalIconBox);\n                    placeIcon = placedIconBoxes.placeable;\n                } else {\n                    placedIconBoxes = placeIconFeature(collisionArrays.iconBox);\n                    placeIcon = placedIconBoxes.placeable;\n                }\n                offscreen = offscreen && placedIconBoxes.offscreen;\n            }\n\n            const iconWithoutText = textOptional ||\n                (symbolInstance.numHorizontalGlyphVertices === 0 && symbolInstance.numVerticalGlyphVertices === 0);\n            const textWithoutIcon = iconOptional || symbolInstance.numIconVertices === 0;\n\n            // Combine the scales for icons and text.\n            if (!iconWithoutText && !textWithoutIcon) {\n                placeIcon = placeText = placeIcon && placeText;\n            } else if (!textWithoutIcon) {\n                placeText = placeIcon && placeText;\n            } else if (!iconWithoutText) {\n                placeIcon = placeIcon && placeText;\n            }\n\n            const hasTextBox = placeText && placedGlyphBoxes.placeable;\n            const hasIconBox = placeIcon && placedIconBoxes.placeable;\n\n            if (hasTextBox) {\n                if (placedVerticalText && placedVerticalText.placeable && verticalTextFeatureIndex) {\n                    this.collisionIndex.insertCollisionBox(\n                        placedGlyphBoxes.box,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        verticalTextFeatureIndex,\n                        collisionGroup.ID);\n                } else {\n                    this.collisionIndex.insertCollisionBox(\n                        placedGlyphBoxes.box,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        textFeatureIndex,\n                        collisionGroup.ID);\n                }\n\n            }\n            if (hasIconBox) {\n                this.collisionIndex.insertCollisionBox(\n                    placedIconBoxes.box,\n                    iconOverlapMode,\n                    layout.get('icon-ignore-placement'),\n                    bucket.bucketInstanceId,\n                    iconFeatureIndex,\n                    collisionGroup.ID);\n            }\n            if (placedGlyphCircles) {\n                if (placeText) {\n                    this.collisionIndex.insertCollisionCircles(\n                        placedGlyphCircles.circles,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        textFeatureIndex,\n                        collisionGroup.ID);\n                }\n            }\n\n            if (showCollisionBoxes) {\n                this.storeCollisionData(bucket.bucketInstanceId, symbolIndex, collisionArrays, placedGlyphBoxes, placedIconBoxes, placedGlyphCircles);\n            }\n\n            if (symbolInstance.crossTileID === 0) throw new Error('symbolInstance.crossTileID can\\'t be 0');\n            if (bucket.bucketInstanceId === 0) throw new Error('bucket.bucketInstanceId can\\'t be 0');\n\n            // Do not show text or icons that are occluded by the globe, even if overlap mode is 'always'!\n            const textVisible: boolean = (placeText || alwaysShowText) && !(placedGlyphBoxes?.occluded);\n            const iconVisible = (placeIcon || alwaysShowIcon) && !(placedIconBoxes?.occluded);\n            this.placements[symbolInstance.crossTileID] = new JointPlacement(textVisible, iconVisible, offscreen || bucket.justReloaded);\n            seenCrossTileIDs[symbolInstance.crossTileID] = true;\n        };\n\n        if (zOrderByViewportY) {\n            if (bucketPart.symbolInstanceStart !== 0) throw new Error('bucket.bucketInstanceId should be 0');\n            const symbolIndexes = bucket.getSortedSymbolIndexes(-this.transform.bearingInRadians);\n            for (let i = symbolIndexes.length - 1; i >= 0; --i) {\n                const symbolIndex = symbolIndexes[i];\n                placeSymbol(bucket.symbolInstances.get(symbolIndex), bucket.collisionArrays[symbolIndex], symbolIndex);\n            }\n        } else {\n            for (let i = bucketPart.symbolInstanceStart; i < bucketPart.symbolInstanceEnd; i++) {\n                placeSymbol(bucket.symbolInstances.get(i), bucket.collisionArrays[i], i);\n            }\n        }\n\n        bucket.justReloaded = false;\n    }\n\n    storeCollisionData(bucketInstanceId: number, symbolIndex: number, collisionArrays: CollisionArrays, placedGlyphBoxes: PlacedBox, placedIconBoxes: PlacedBox, placedGlyphCircles: PlacedCircles): void {\n        if (collisionArrays.textBox || collisionArrays.iconBox) {\n            // Store the actually used collision box for debug draw\n            let boxArray: Map<number, {\n                text: number[];\n                icon: number[];\n            }>;\n\n            if (this.collisionBoxArrays.has(bucketInstanceId)) {\n                boxArray = this.collisionBoxArrays.get(bucketInstanceId);\n            } else {\n                boxArray = new Map<number, {\n                    text: number[];\n                    icon: number[];\n                }>();\n                this.collisionBoxArrays.set(bucketInstanceId, boxArray);\n            }\n            let realCollisionBox: {\n                text: number[];\n                icon: number[];\n            };\n\n            if (boxArray.has(symbolIndex)) {\n                realCollisionBox = boxArray.get(symbolIndex);\n            } else {\n                realCollisionBox = {\n                    text: null,\n                    icon: null\n                };\n                boxArray.set(symbolIndex, realCollisionBox);\n            }\n\n            if (collisionArrays.textBox) {\n                realCollisionBox.text = placedGlyphBoxes.box;\n            }\n            if (collisionArrays.iconBox) {\n                realCollisionBox.icon = placedIconBoxes.box;\n            }\n        }\n\n        if (placedGlyphCircles) {\n            let circleArray = this.collisionCircleArrays[bucketInstanceId];\n\n            // Group collision circles together by bucket. Circles can't be pushed forward for rendering yet as the symbol placement\n            // for a bucket is not guaranteed to be complete before the commit-function has been called\n            if (circleArray === undefined)\n                circleArray = this.collisionCircleArrays[bucketInstanceId] = [];\n\n            for (let i = 0; i < placedGlyphCircles.circles.length; i += 4) {\n                circleArray.push(placedGlyphCircles.circles[i + 0] - viewportPadding); // x\n                circleArray.push(placedGlyphCircles.circles[i + 1] - viewportPadding); // y\n                circleArray.push(placedGlyphCircles.circles[i + 2]);                   // radius\n                circleArray.push(placedGlyphCircles.collisionDetected ? 1 : 0);        // collisionDetected-flag\n            }\n        }\n    }\n\n    markUsedJustification(bucket: SymbolBucket, placedAnchor: TextAnchor, symbolInstance: SymbolInstance, orientation: number) {\n        const justifications = {\n            'left': symbolInstance.leftJustifiedTextSymbolIndex,\n            'center': symbolInstance.centerJustifiedTextSymbolIndex,\n            'right': symbolInstance.rightJustifiedTextSymbolIndex\n        };\n\n        let autoIndex;\n        if (orientation === WritingMode.vertical) {\n            autoIndex = symbolInstance.verticalPlacedTextSymbolIndex;\n        } else {\n            autoIndex = justifications[getAnchorJustification(placedAnchor)];\n        }\n\n        const indexes = [\n            symbolInstance.leftJustifiedTextSymbolIndex,\n            symbolInstance.centerJustifiedTextSymbolIndex,\n            symbolInstance.rightJustifiedTextSymbolIndex,\n            symbolInstance.verticalPlacedTextSymbolIndex\n        ];\n\n        for (const index of indexes) {\n            if (index >= 0) {\n                if (autoIndex >= 0 && index !== autoIndex) {\n                    // There are multiple justifications and this one isn't it: shift offscreen\n                    bucket.text.placedSymbolArray.get(index).crossTileID = 0;\n                } else {\n                    // Either this is the chosen justification or the justification is hardwired: use this one\n                    bucket.text.placedSymbolArray.get(index).crossTileID = symbolInstance.crossTileID;\n                }\n            }\n        }\n    }\n\n    markUsedOrientation(bucket: SymbolBucket, orientation: number, symbolInstance: SymbolInstance) {\n        const horizontal = (orientation === WritingMode.horizontal || orientation === WritingMode.horizontalOnly) ? orientation : 0;\n        const vertical = orientation === WritingMode.vertical ? orientation : 0;\n\n        const horizontalIndexes = [\n            symbolInstance.leftJustifiedTextSymbolIndex,\n            symbolInstance.centerJustifiedTextSymbolIndex,\n            symbolInstance.rightJustifiedTextSymbolIndex\n        ];\n\n        for (const index of horizontalIndexes) {\n            bucket.text.placedSymbolArray.get(index).placedOrientation = horizontal;\n        }\n\n        if (symbolInstance.verticalPlacedTextSymbolIndex) {\n            bucket.text.placedSymbolArray.get(symbolInstance.verticalPlacedTextSymbolIndex).placedOrientation = vertical;\n        }\n    }\n\n    commit(now: number): void {\n        this.commitTime = now;\n        this.zoomAtLastRecencyCheck = this.transform.zoom;\n\n        const prevPlacement = this.prevPlacement;\n        let placementChanged = false;\n\n        this.prevZoomAdjustment = prevPlacement ? prevPlacement.zoomAdjustment(this.transform.zoom) : 0;\n        const increment = prevPlacement ? prevPlacement.symbolFadeChange(now) : 1;\n\n        const prevOpacities = prevPlacement ? prevPlacement.opacities : {};\n        const prevOffsets = prevPlacement ? prevPlacement.variableOffsets : {};\n        const prevOrientations = prevPlacement ? prevPlacement.placedOrientations : {};\n\n        // add the opacities from the current placement, and copy their current values from the previous placement\n        for (const crossTileID in this.placements) {\n            const jointPlacement = this.placements[crossTileID];\n            const prevOpacity = prevOpacities[crossTileID];\n            if (prevOpacity) {\n                this.opacities[crossTileID] = new JointOpacityState(prevOpacity, increment, jointPlacement.text, jointPlacement.icon);\n                placementChanged = placementChanged ||\n                    jointPlacement.text !== prevOpacity.text.placed ||\n                    jointPlacement.icon !== prevOpacity.icon.placed;\n            } else {\n                this.opacities[crossTileID] = new JointOpacityState(null, increment, jointPlacement.text, jointPlacement.icon, jointPlacement.skipFade);\n                placementChanged = placementChanged || jointPlacement.text || jointPlacement.icon;\n            }\n        }\n\n        // copy and update values from the previous placement that aren't in the current placement but haven't finished fading\n        for (const crossTileID in prevOpacities) {\n            const prevOpacity = prevOpacities[crossTileID];\n            if (!this.opacities[crossTileID]) {\n                const jointOpacity = new JointOpacityState(prevOpacity, increment, false, false);\n                if (!jointOpacity.isHidden()) {\n                    this.opacities[crossTileID] = jointOpacity;\n                    placementChanged = placementChanged || prevOpacity.text.placed || prevOpacity.icon.placed;\n                }\n            }\n        }\n        for (const crossTileID in prevOffsets) {\n            if (!this.variableOffsets[crossTileID] && this.opacities[crossTileID] && !this.opacities[crossTileID].isHidden()) {\n                this.variableOffsets[crossTileID] = prevOffsets[crossTileID];\n            }\n        }\n\n        for (const crossTileID in prevOrientations) {\n            if (!this.placedOrientations[crossTileID] && this.opacities[crossTileID] && !this.opacities[crossTileID].isHidden()) {\n                this.placedOrientations[crossTileID] = prevOrientations[crossTileID];\n            }\n        }\n\n        // this.lastPlacementChangeTime is the time of the last commit() that\n        // resulted in a placement change -- in other words, the start time of\n        // the last symbol fade animation\n        if (prevPlacement && prevPlacement.lastPlacementChangeTime === undefined) {\n            throw new Error('Last placement time for previous placement is not defined');\n        }\n        if (placementChanged) {\n            this.lastPlacementChangeTime = now;\n        } else if (typeof this.lastPlacementChangeTime !== 'number') {\n            this.lastPlacementChangeTime = prevPlacement ? prevPlacement.lastPlacementChangeTime : now;\n        }\n    }\n\n    updateLayerOpacities(styleLayer: StyleLayer, tiles: Array<Tile>) {\n        const seenCrossTileIDs = {};\n        for (const tile of tiles) {\n            const symbolBucket = tile.getBucket(styleLayer) as SymbolBucket;\n            if (symbolBucket && tile.latestFeatureIndex && styleLayer.id === symbolBucket.layerIds[0]) {\n                this.updateBucketOpacities(symbolBucket, tile.tileID, seenCrossTileIDs, tile.collisionBoxArray);\n            }\n        }\n    }\n\n    updateBucketOpacities(bucket: SymbolBucket, tileID: OverscaledTileID, seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    }, collisionBoxArray?: CollisionBoxArray | null) {\n        if (bucket.hasTextData()) {\n            bucket.text.opacityVertexArray.clear();\n            bucket.text.hasVisibleVertices = false;\n        }\n        if (bucket.hasIconData()) {\n            bucket.icon.opacityVertexArray.clear();\n            bucket.icon.hasVisibleVertices = false;\n        }\n        if (bucket.hasIconCollisionBoxData()) bucket.iconCollisionBox.collisionVertexArray.clear();\n        if (bucket.hasTextCollisionBoxData()) bucket.textCollisionBox.collisionVertexArray.clear();\n\n        const layer = bucket.layers[0];\n        const layout = layer.layout;\n        const duplicateOpacityState = new JointOpacityState(null, 0, false, false, true);\n        const textAllowOverlap = layout.get('text-allow-overlap');\n        const iconAllowOverlap = layout.get('icon-allow-overlap');\n        const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pitchWithMap = layout.get('text-pitch-alignment') === 'map';\n        const hasIconTextFit = layout.get('icon-text-fit') !== 'none';\n        // If allow-overlap is true, we can show symbols before placement runs on them\n        // But we have to wait for placement if we potentially depend on a paired icon/text\n        // with allow-overlap: false.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/7032\n        const defaultOpacityState = new JointOpacityState(null, 0,\n            textAllowOverlap && (iconAllowOverlap || !bucket.hasIconData() || layout.get('icon-optional')),\n            iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || layout.get('text-optional')),\n            true);\n\n        if (!bucket.collisionArrays && collisionBoxArray && ((bucket.hasIconCollisionBoxData() || bucket.hasTextCollisionBoxData()))) {\n            bucket.deserializeCollisionBoxes(collisionBoxArray);\n        }\n\n        const addOpacities = (iconOrText: SymbolBuffers, numVertices: number, opacity: number) => {\n            for (let i = 0; i < numVertices / 4; i++) {\n                iconOrText.opacityVertexArray.emplaceBack(opacity);\n            }\n            iconOrText.hasVisibleVertices = iconOrText.hasVisibleVertices || (opacity !== PACKED_HIDDEN_OPACITY);\n        };\n\n        const boxArrays = this.collisionBoxArrays.get(bucket.bucketInstanceId);\n\n        for (let s = 0; s < bucket.symbolInstances.length; s++) {\n            const symbolInstance = bucket.symbolInstances.get(s);\n            const {\n                numHorizontalGlyphVertices,\n                numVerticalGlyphVertices,\n                crossTileID\n            } = symbolInstance;\n\n            const isDuplicate = seenCrossTileIDs[crossTileID];\n\n            let opacityState = this.opacities[crossTileID];\n            if (isDuplicate) {\n                opacityState = duplicateOpacityState;\n            } else if (!opacityState) {\n                opacityState = defaultOpacityState;\n                // store the state so that future placements use it as a starting point\n                this.opacities[crossTileID] = opacityState;\n            }\n\n            seenCrossTileIDs[crossTileID] = true;\n\n            const hasText = numHorizontalGlyphVertices > 0 || numVerticalGlyphVertices > 0;\n            const hasIcon = symbolInstance.numIconVertices > 0;\n\n            const placedOrientation = this.placedOrientations[symbolInstance.crossTileID];\n            const horizontalHidden = placedOrientation === WritingMode.vertical;\n            const verticalHidden = placedOrientation === WritingMode.horizontal || placedOrientation === WritingMode.horizontalOnly;\n\n            if (hasText) {\n                const packedOpacity = packOpacity(opacityState.text);\n                // Vertical text fades in/out on collision the same way as corresponding\n                // horizontal text. Switch between vertical/horizontal should be instantaneous\n                const horizontalOpacity = horizontalHidden ? PACKED_HIDDEN_OPACITY : packedOpacity;\n                addOpacities(bucket.text, numHorizontalGlyphVertices, horizontalOpacity);\n                const verticalOpacity = verticalHidden ? PACKED_HIDDEN_OPACITY : packedOpacity;\n                addOpacities(bucket.text, numVerticalGlyphVertices, verticalOpacity);\n\n                // If this label is completely faded, mark it so that we don't have to calculate\n                // its position at render time. If this layer has variable placement, shift the various\n                // symbol instances appropriately so that symbols from buckets that have yet to be placed\n                // offset appropriately.\n                const symbolHidden = opacityState.text.isHidden();\n                [\n                    symbolInstance.rightJustifiedTextSymbolIndex,\n                    symbolInstance.centerJustifiedTextSymbolIndex,\n                    symbolInstance.leftJustifiedTextSymbolIndex\n                ].forEach(index => {\n                    if (index >= 0) {\n                        bucket.text.placedSymbolArray.get(index).hidden = symbolHidden || horizontalHidden ? 1 : 0;\n                    }\n                });\n\n                if (symbolInstance.verticalPlacedTextSymbolIndex >= 0) {\n                    bucket.text.placedSymbolArray.get(symbolInstance.verticalPlacedTextSymbolIndex).hidden = symbolHidden || verticalHidden ? 1 : 0;\n                }\n\n                const prevOffset = this.variableOffsets[symbolInstance.crossTileID];\n                if (prevOffset) {\n                    this.markUsedJustification(bucket, prevOffset.anchor, symbolInstance, placedOrientation);\n                }\n\n                const prevOrientation = this.placedOrientations[symbolInstance.crossTileID];\n                if (prevOrientation) {\n                    this.markUsedJustification(bucket, 'left', symbolInstance, prevOrientation);\n                    this.markUsedOrientation(bucket, prevOrientation, symbolInstance);\n                }\n            }\n\n            if (hasIcon) {\n                const packedOpacity = packOpacity(opacityState.icon);\n\n                const useHorizontal = !(hasIconTextFit && symbolInstance.verticalPlacedIconSymbolIndex && horizontalHidden);\n\n                if (symbolInstance.placedIconSymbolIndex >= 0) {\n                    const horizontalOpacity = useHorizontal ? packedOpacity : PACKED_HIDDEN_OPACITY;\n                    addOpacities(bucket.icon, symbolInstance.numIconVertices, horizontalOpacity);\n                    bucket.icon.placedSymbolArray.get(symbolInstance.placedIconSymbolIndex).hidden =\n                        (opacityState.icon.isHidden() as any);\n                }\n\n                if (symbolInstance.verticalPlacedIconSymbolIndex >= 0) {\n                    const verticalOpacity = !useHorizontal ? packedOpacity : PACKED_HIDDEN_OPACITY;\n                    addOpacities(bucket.icon, symbolInstance.numVerticalIconVertices, verticalOpacity);\n                    bucket.icon.placedSymbolArray.get(symbolInstance.verticalPlacedIconSymbolIndex).hidden =\n                        (opacityState.icon.isHidden() as any);\n                }\n            }\n\n            const realBoxes = (boxArrays && boxArrays.has(s)) ? boxArrays.get(s) : {\n                text: null,\n                icon: null\n            };\n\n            if (bucket.hasIconCollisionBoxData() || bucket.hasTextCollisionBoxData()) {\n                const collisionArrays = bucket.collisionArrays[s];\n                if (collisionArrays) {\n                    let shift = new Point(0, 0);\n                    if (collisionArrays.textBox || collisionArrays.verticalTextBox) {\n                        let used = true;\n                        if (hasVariablePlacement) {\n                            const variableOffset = this.variableOffsets[crossTileID];\n                            if (variableOffset) {\n                                // This will show either the currently placed position or the last\n                                // successfully placed position (so you can visualize what collision\n                                // just made the symbol disappear, and the most likely place for the\n                                // symbol to come back)\n                                shift = calculateVariableLayoutShift(variableOffset.anchor,\n                                    variableOffset.width,\n                                    variableOffset.height,\n                                    variableOffset.textOffset,\n                                    variableOffset.textBoxScale);\n                                if (rotateWithMap) {\n                                    shift._rotate(pitchWithMap ? -this.transform.bearingInRadians : this.transform.bearingInRadians);\n                                }\n                            } else {\n                                // No offset -> this symbol hasn't been placed since coming on-screen\n                                // No single box is particularly meaningful and all of them would be too noisy\n                                // Use the center box just to show something's there, but mark it \"not used\"\n                                used = false;\n                            }\n                        }\n\n                        if (collisionArrays.textBox || collisionArrays.verticalTextBox) {\n                            let hidden: boolean;\n                            if (collisionArrays.textBox) {\n                                hidden = horizontalHidden;\n                            }\n                            if (collisionArrays.verticalTextBox) {\n                                hidden = verticalHidden;\n                            }\n                            updateCollisionVertices(bucket.textCollisionBox.collisionVertexArray, opacityState.text.placed, !used || hidden, realBoxes.text, shift.x, shift.y);\n                        }\n                    }\n\n                    if (collisionArrays.iconBox || collisionArrays.verticalIconBox) {\n                        const verticalIconUsed = Boolean(!verticalHidden && collisionArrays.verticalIconBox);\n                        let hidden: boolean;\n                        if (collisionArrays.iconBox) {\n                            hidden = verticalIconUsed;\n                        }\n                        if (collisionArrays.verticalIconBox) {\n                            hidden = !verticalIconUsed;\n                        }\n                        updateCollisionVertices(bucket.iconCollisionBox.collisionVertexArray, opacityState.icon.placed, hidden, realBoxes.icon,\n                            hasIconTextFit ? shift.x : 0,\n                            hasIconTextFit ? shift.y : 0);\n                    }\n                }\n            }\n        }\n\n        bucket.sortFeatures(-this.transform.bearingInRadians);\n        if (this.retainedQueryData[bucket.bucketInstanceId]) {\n            this.retainedQueryData[bucket.bucketInstanceId].featureSortOrder = bucket.featureSortOrder;\n        }\n\n        if (bucket.hasTextData() && bucket.text.opacityVertexBuffer) {\n            bucket.text.opacityVertexBuffer.updateData(bucket.text.opacityVertexArray);\n        }\n        if (bucket.hasIconData() && bucket.icon.opacityVertexBuffer) {\n            bucket.icon.opacityVertexBuffer.updateData(bucket.icon.opacityVertexArray);\n        }\n        if (bucket.hasIconCollisionBoxData() && bucket.iconCollisionBox.collisionVertexBuffer) {\n            bucket.iconCollisionBox.collisionVertexBuffer.updateData(bucket.iconCollisionBox.collisionVertexArray);\n        }\n        if (bucket.hasTextCollisionBoxData() && bucket.textCollisionBox.collisionVertexBuffer) {\n            bucket.textCollisionBox.collisionVertexBuffer.updateData(bucket.textCollisionBox.collisionVertexArray);\n        }\n\n        if (bucket.text.opacityVertexArray.length !== bucket.text.layoutVertexArray.length / 4) throw new Error(`bucket.text.opacityVertexArray.length (= ${bucket.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${bucket.text.layoutVertexArray.length}) / 4`);\n        if (bucket.icon.opacityVertexArray.length !== bucket.icon.layoutVertexArray.length / 4) throw new Error(`bucket.icon.opacityVertexArray.length (= ${bucket.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${bucket.icon.layoutVertexArray.length}) / 4`);\n\n        // Push generated collision circles to the bucket for debug rendering\n        if (bucket.bucketInstanceId in this.collisionCircleArrays) {\n            bucket.collisionCircleArray = this.collisionCircleArrays[bucket.bucketInstanceId];\n            delete this.collisionCircleArrays[bucket.bucketInstanceId];\n        }\n    }\n\n    symbolFadeChange(now: number) {\n        return this.fadeDuration === 0 ?\n            1 :\n            ((now - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment);\n    }\n\n    zoomAdjustment(zoom: number) {\n        // When zooming out quickly, labels can overlap each other. This\n        // adjustment is used to reduce the interval between placement calculations\n        // and to reduce the fade duration when zooming out quickly. Discovering the\n        // collisions more quickly and fading them more quickly reduces the unwanted effect.\n        return Math.max(0, (this.transform.zoom - zoom) / 1.5);\n    }\n\n    hasTransitions(now: number) {\n        return this.stale ||\n            now - this.lastPlacementChangeTime < this.fadeDuration;\n    }\n\n    stillRecent(now: number, zoom: number) {\n        // The adjustment makes placement more frequent when zooming.\n        // This condition applies the adjustment only after the map has\n        // stopped zooming. This avoids adding extra jank while zooming.\n        const durationAdjustment = this.zoomAtLastRecencyCheck === zoom ?\n            (1 - this.zoomAdjustment(zoom)) :\n            1;\n        this.zoomAtLastRecencyCheck = zoom;\n\n        return this.commitTime + this.fadeDuration * durationAdjustment > now;\n    }\n\n    setStale() {\n        this.stale = true;\n    }\n}\n\nfunction updateCollisionVertices(collisionVertexArray: CollisionVertexArray, placed: boolean, notUsed: boolean | number, realBox: Array<number>, shiftX?: number, shiftY?: number) {\n    if (!realBox || realBox.length === 0) {\n        realBox = [0, 0, 0, 0];\n    }\n\n    const tlX = realBox[0] - viewportPadding;\n    const tlY = realBox[1] - viewportPadding;\n    const brX = realBox[2] - viewportPadding;\n    const brY = realBox[3] - viewportPadding;\n\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, tlX, tlY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, brX, tlY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, brX, brY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, tlX, brY);\n}\n\n// All four vertices for a glyph will have the same opacity state\n// So we pack the opacity into a uint8, and then repeat it four times\n// to make a single uint32 that we can upload for each glyph in the\n// label.\nconst shift25 = Math.pow(2, 25);\nconst shift24 = Math.pow(2, 24);\nconst shift17 = Math.pow(2, 17);\nconst shift16 = Math.pow(2, 16);\nconst shift9 = Math.pow(2, 9);\nconst shift8 = Math.pow(2, 8);\nconst shift1 = Math.pow(2, 1);\nfunction packOpacity(opacityState: OpacityState): number {\n    if (opacityState.opacity === 0 && !opacityState.placed) {\n        return 0;\n    } else if (opacityState.opacity === 1 && opacityState.placed) {\n        return 4294967295;\n    }\n    const targetBit = opacityState.placed ? 1 : 0;\n    const opacityBits = Math.floor(opacityState.opacity * 127);\n    return opacityBits * shift25 + targetBit * shift24 +\n        opacityBits * shift17 + targetBit * shift16 +\n        opacityBits * shift9 + targetBit * shift8 +\n        opacityBits * shift1 + targetBit;\n}\n\nconst PACKED_HIDDEN_OPACITY = 0;\n","import {now} from '../util/time_control';\nimport {Placement} from '../symbol/placement';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {StyleLayer} from './style_layer';\nimport type {SymbolStyleLayer} from './style_layer/symbol_style_layer';\nimport type {Tile} from '../tile/tile';\nimport type {BucketPart} from '../symbol/placement';\nimport type {Terrain} from '../render/terrain';\n\nclass LayerPlacement {\n    _sortAcrossTiles: boolean;\n    _currentTileIndex: number;\n    _currentPartIndex: number;\n    _seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    };\n    _bucketParts: Array<BucketPart>;\n\n    constructor(styleLayer: SymbolStyleLayer) {\n        this._sortAcrossTiles = styleLayer.layout.get('symbol-z-order') !== 'viewport-y' &&\n            !styleLayer.layout.get('symbol-sort-key').isConstant();\n\n        this._currentTileIndex = 0;\n        this._currentPartIndex = 0;\n        this._seenCrossTileIDs = {};\n        this._bucketParts = [];\n    }\n\n    continuePlacement(tiles: Array<Tile>, placement: Placement, showCollisionBoxes: boolean, styleLayer: StyleLayer, shouldPausePlacement: () => boolean) {\n\n        const bucketParts = this._bucketParts;\n\n        while (this._currentTileIndex < tiles.length) {\n            const tile = tiles[this._currentTileIndex];\n            placement.getBucketParts(bucketParts, styleLayer, tile, this._sortAcrossTiles);\n\n            this._currentTileIndex++;\n            if (shouldPausePlacement()) {\n                return true;\n            }\n        }\n\n        if (this._sortAcrossTiles) {\n            this._sortAcrossTiles = false;\n            bucketParts.sort((a, b) => (a.sortKey as any as number) - (b.sortKey as any as number));\n        }\n\n        while (this._currentPartIndex < bucketParts.length) {\n            const bucketPart = bucketParts[this._currentPartIndex];\n            placement.placeLayerBucketPart(bucketPart, this._seenCrossTileIDs, showCollisionBoxes);\n\n            this._currentPartIndex++;\n            if (shouldPausePlacement()) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n\nexport class PauseablePlacement {\n    placement: Placement;\n    _done: boolean;\n    _currentPlacementIndex: number;\n    _forceFullPlacement: boolean;\n    _showCollisionBoxes: boolean;\n    _inProgressLayer: LayerPlacement;\n\n    constructor(\n        transform: ITransform,\n        terrain: Terrain,\n        order: Array<string>,\n        forceFullPlacement: boolean,\n        showCollisionBoxes: boolean,\n        fadeDuration: number,\n        crossSourceCollisions: boolean,\n        prevPlacement?: Placement\n    ) {\n        this.placement = new Placement(transform, terrain, fadeDuration, crossSourceCollisions, prevPlacement);\n        this._currentPlacementIndex = order.length - 1;\n        this._forceFullPlacement = forceFullPlacement;\n        this._showCollisionBoxes = showCollisionBoxes;\n        this._done = false;\n    }\n\n    isDone() {\n        return this._done;\n    }\n\n    continuePlacement(\n        order: Array<string>,\n        layers: {[_: string]: StyleLayer},\n        layerTiles: {[_: string]: Array<Tile>}\n    ) {\n        const startTime = now();\n\n        const shouldPausePlacement = () => {\n            return this._forceFullPlacement ? false : (now() - startTime) > 2;\n        };\n\n        while (this._currentPlacementIndex >= 0) {\n            const layerId = order[this._currentPlacementIndex];\n            const layer = layers[layerId];\n            const placementZoom = this.placement.collisionIndex.transform.zoom;\n            if (layer.type === 'symbol' &&\n                (!layer.minzoom || layer.minzoom <= placementZoom) &&\n                (!layer.maxzoom || layer.maxzoom > placementZoom)) {\n\n                if (!this._inProgressLayer) {\n                    this._inProgressLayer = new LayerPlacement(layer as any as SymbolStyleLayer);\n                }\n\n                const pausePlacement = this._inProgressLayer.continuePlacement(layerTiles[layer.source], this.placement, this._showCollisionBoxes, layer, shouldPausePlacement);\n\n                if (pausePlacement) {\n                    // We didn't finish placing all layers within 2ms,\n                    // but we can keep rendering with a partial placement\n                    // We'll resume here on the next frame\n                    return;\n                }\n\n                delete this._inProgressLayer;\n            }\n\n            this._currentPlacementIndex--;\n        }\n\n        this._done = true;\n    }\n\n    commit(now: number) {\n        this.placement.commit(now);\n        return this.placement;\n    }\n}\n","import KDBush from 'kdbush';\nimport {EXTENT} from '../data/extent';\n\nimport {type SymbolInstanceArray} from '../data/array_types.g';\n\nimport type {SymbolInstance} from '../data/array_types.g';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {Tile} from '../tile/tile';\n\n/*\n    The CrossTileSymbolIndex generally works on the assumption that\n    a conceptual \"unique symbol\" can be identified by the text of\n    the label combined with the anchor point. The goal is to assign\n    these conceptual \"unique symbols\" a shared crossTileID that can be\n    used by Placement to keep fading opacity states consistent and to\n    deduplicate labels.\n\n    The CrossTileSymbolIndex indexes all the current symbol instances and\n    their crossTileIDs. When a symbol bucket gets added or updated, the\n    index assigns a crossTileID to each of it's symbol instances by either\n    matching it with an existing id or assigning a new one.\n*/\n\n// Round anchor positions to roughly 4 pixel grid\nconst roundingFactor = 512 / EXTENT / 2;\n\nexport const KDBUSH_THRESHHOLD = 128;\n\ninterface SymbolsByKeyEntry {\n    index?: KDBush;\n    positions?: {x: number; y: number}[];\n    crossTileIDs: number[];\n}\n\nclass TileLayerIndex {\n    _symbolsByKey: Record<number, SymbolsByKeyEntry> = {};\n\n    constructor(public tileID: OverscaledTileID, symbolInstances: SymbolInstanceArray, public bucketInstanceId: number) {\n        // group the symbolInstances by key\n        const symbolInstancesByKey = new Map<number, SymbolInstance[]>();\n        for (let i = 0; i < symbolInstances.length; i++) {\n            const symbolInstance = symbolInstances.get(i);\n            const key = symbolInstance.key;\n            const instances = symbolInstancesByKey.get(key);\n            if (instances) {\n                // This tile may have multiple symbol instances with the same key\n                // Store each one along with its coordinates\n                instances.push(symbolInstance);\n            } else {\n                symbolInstancesByKey.set(key, [symbolInstance]);\n            }\n        }\n\n        // index the SymbolInstances in this each bucket\n        for (const [key, symbols] of symbolInstancesByKey) {\n            const positions = symbols.map(symbolInstance => ({x: Math.floor(symbolInstance.anchorX * roundingFactor), y: Math.floor(symbolInstance.anchorY * roundingFactor)}));\n            const crossTileIDs = symbols.map(v => v.crossTileID);\n            const entry: SymbolsByKeyEntry = {positions, crossTileIDs};\n\n            // once we get too many symbols for a given key, it becomes much faster to index it before queries\n            if (entry.positions.length > KDBUSH_THRESHHOLD) {\n\n                const index = new KDBush(entry.positions.length, 16, Uint16Array);\n                for (const {x, y} of entry.positions) index.add(x, y);\n                index.finish();\n\n                // clear all references to the original positions data\n                delete entry.positions;\n                entry.index = index;\n            }\n\n            this._symbolsByKey[key] = entry;\n        }\n    }\n\n    // Converts the coordinates of the input symbol instance into coordinates that be can compared\n    // against other symbols in this index. Coordinates are:\n    // (1) local-tile-based (so after correction we get x,y values relative to our local anchorX/Y)\n    // (2) converted to the z-scale of this TileLayerIndex\n    // (3) down-sampled by \"roundingFactor\" from tile coordinate precision in order to be\n    //     more tolerant of small differences between tiles.\n    getScaledCoordinates(symbolInstance: SymbolInstance, childTileID: OverscaledTileID): {x: number; y: number} {\n        const {x: localX, y: localY, z: localZ} = this.tileID.canonical;\n        const {x, y, z} = childTileID.canonical;\n\n        const zDifference = z - localZ;\n        const scale = roundingFactor / Math.pow(2, zDifference);\n        const xWorld = (x * EXTENT + symbolInstance.anchorX) * scale;\n        const yWorld = (y * EXTENT + symbolInstance.anchorY) * scale;\n        const xOffset = localX * EXTENT * roundingFactor;\n        const yOffset = localY * EXTENT * roundingFactor;\n        const result =  {\n            x: Math.floor(xWorld - xOffset),\n            y: Math.floor(yWorld - yOffset)\n        };\n\n        return result;\n    }\n\n    findMatches(symbolInstances: SymbolInstanceArray, newTileID: OverscaledTileID, zoomCrossTileIDs: {\n        [crossTileID: number]: boolean;\n    }) {\n        const tolerance = this.tileID.canonical.z < newTileID.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - newTileID.canonical.z);\n\n        for (let i = 0; i < symbolInstances.length; i++) {\n            const symbolInstance = symbolInstances.get(i);\n            if (symbolInstance.crossTileID) {\n                // already has a match, skip\n                continue;\n            }\n\n            const entry = this._symbolsByKey[symbolInstance.key];\n            if (!entry) {\n                // No symbol with this key in this bucket\n                continue;\n            }\n\n            const scaledSymbolCoord = this.getScaledCoordinates(symbolInstance, newTileID);\n\n            if (entry.index) {\n                // Return any symbol with the same keys whose coordinates are within 1\n                // grid unit. (with a 4px grid, this covers a 12px by 12px area)\n                const indexes = entry.index.range(\n                    scaledSymbolCoord.x - tolerance,\n                    scaledSymbolCoord.y - tolerance,\n                    scaledSymbolCoord.x + tolerance,\n                    scaledSymbolCoord.y + tolerance).sort();\n\n                for (const i of indexes) {\n                    const crossTileID = entry.crossTileIDs[i];\n\n                    if (!zoomCrossTileIDs[crossTileID]) {\n                        // Once we've marked ourselves duplicate against this parent symbol,\n                        // don't let any other symbols at the same zoom level duplicate against\n                        // the same parent (see issue #5993)\n                        zoomCrossTileIDs[crossTileID] = true;\n                        symbolInstance.crossTileID = crossTileID;\n                        break;\n                    }\n                }\n            } else if (entry.positions) {\n                for (let i = 0; i < entry.positions.length; i++) {\n                    const thisTileSymbol = entry.positions[i];\n                    const crossTileID = entry.crossTileIDs[i];\n\n                    // Return any symbol with the same keys whose coordinates are within 1\n                    // grid unit. (with a 4px grid, this covers a 12px by 12px area)\n                    if (Math.abs(thisTileSymbol.x - scaledSymbolCoord.x) <= tolerance &&\n                        Math.abs(thisTileSymbol.y - scaledSymbolCoord.y) <= tolerance &&\n                        !zoomCrossTileIDs[crossTileID]) {\n                        // Once we've marked ourselves duplicate against this parent symbol,\n                        // don't let any other symbols at the same zoom level duplicate against\n                        // the same parent (see issue #5993)\n                        zoomCrossTileIDs[crossTileID] = true;\n                        symbolInstance.crossTileID = crossTileID;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    getCrossTileIDsLists() {\n        return Object.values(this._symbolsByKey).map(({crossTileIDs}) => crossTileIDs);\n    }\n}\n\nclass CrossTileIDs {\n    maxCrossTileID: number;\n    constructor() {\n        this.maxCrossTileID = 0;\n    }\n    generate() {\n        return ++this.maxCrossTileID;\n    }\n}\n\nclass CrossTileSymbolLayerIndex {\n    indexes: {\n        [zoom in string | number]: {\n            [tileId in string | number]: TileLayerIndex;\n        };\n    };\n    usedCrossTileIDs: {\n        [zoom in string | number]: {\n            [crossTileID: number]: boolean;\n        };\n    };\n    lng: number;\n\n    constructor() {\n        this.indexes = {};\n        this.usedCrossTileIDs = {};\n        this.lng = 0;\n    }\n\n    /*\n     * Sometimes when a user pans across the antimeridian the longitude value gets wrapped.\n     * To prevent labels from flashing out and in we adjust the tileID values in the indexes\n     * so that they match the new wrapped version of the map.\n     */\n    handleWrapJump(lng: number) {\n        const wrapDelta = Math.round((lng - this.lng) / 360);\n        if (wrapDelta !== 0) {\n            for (const zoom in this.indexes) {\n                const zoomIndexes = this.indexes[zoom];\n                const newZoomIndex = {};\n                for (const key in zoomIndexes) {\n                    // change the tileID's wrap and add it to a new index\n                    const index = zoomIndexes[key];\n                    index.tileID = index.tileID.unwrapTo(index.tileID.wrap + wrapDelta);\n                    newZoomIndex[index.tileID.key] = index;\n                }\n                this.indexes[zoom] = newZoomIndex;\n            }\n        }\n        this.lng = lng;\n    }\n\n    addBucket(tileID: OverscaledTileID, bucket: SymbolBucket, crossTileIDs: CrossTileIDs) {\n        if (this.indexes[tileID.overscaledZ] &&\n            this.indexes[tileID.overscaledZ][tileID.key]) {\n            if (this.indexes[tileID.overscaledZ][tileID.key].bucketInstanceId ===\n                bucket.bucketInstanceId) {\n                return false;\n            } else {\n                // We're replacing this bucket with an updated version\n                // Remove the old bucket's \"used crossTileIDs\" now so that\n                // the new bucket can claim them.\n                // The old index entries themselves stick around until\n                // 'removeStaleBuckets' is called.\n                this.removeBucketCrossTileIDs(tileID.overscaledZ,\n                    this.indexes[tileID.overscaledZ][tileID.key]);\n            }\n        }\n\n        for (let i = 0; i < bucket.symbolInstances.length; i++) {\n            const symbolInstance = bucket.symbolInstances.get(i);\n            symbolInstance.crossTileID = 0;\n        }\n\n        if (!this.usedCrossTileIDs[tileID.overscaledZ]) {\n            this.usedCrossTileIDs[tileID.overscaledZ] = {};\n        }\n        const zoomCrossTileIDs = this.usedCrossTileIDs[tileID.overscaledZ];\n\n        for (const zoom in this.indexes) {\n            const zoomIndexes = this.indexes[zoom];\n            if (Number(zoom) > tileID.overscaledZ) {\n                for (const id in zoomIndexes) {\n                    const childIndex = zoomIndexes[id];\n                    if (childIndex.tileID.isChildOf(tileID)) {\n                        childIndex.findMatches(bucket.symbolInstances, tileID, zoomCrossTileIDs);\n                    }\n                }\n            } else {\n                const parentCoord = tileID.scaledTo(Number(zoom));\n                const parentIndex = zoomIndexes[parentCoord.key];\n                if (parentIndex) {\n                    parentIndex.findMatches(bucket.symbolInstances, tileID, zoomCrossTileIDs);\n                }\n            }\n        }\n\n        for (let i = 0; i < bucket.symbolInstances.length; i++) {\n            const symbolInstance = bucket.symbolInstances.get(i);\n            if (!symbolInstance.crossTileID) {\n                // symbol did not match any known symbol, assign a new id\n                symbolInstance.crossTileID = crossTileIDs.generate();\n                zoomCrossTileIDs[symbolInstance.crossTileID] = true;\n            }\n        }\n\n        if (this.indexes[tileID.overscaledZ] === undefined) {\n            this.indexes[tileID.overscaledZ] = {};\n        }\n        this.indexes[tileID.overscaledZ][tileID.key] = new TileLayerIndex(tileID, bucket.symbolInstances, bucket.bucketInstanceId);\n\n        return true;\n    }\n\n    removeBucketCrossTileIDs(zoom: string | number, removedBucket: TileLayerIndex) {\n        for (const crossTileIDs of removedBucket.getCrossTileIDsLists()) {\n            for (const crossTileID of crossTileIDs) {\n                delete this.usedCrossTileIDs[zoom][crossTileID];\n            }\n        }\n    }\n\n    removeStaleBuckets(currentIDs: {\n        [k in string | number]: boolean;\n    }) {\n        let tilesChanged = false;\n        for (const z in this.indexes) {\n            const zoomIndexes = this.indexes[z];\n            for (const tileKey in zoomIndexes) {\n                if (!currentIDs[zoomIndexes[tileKey].bucketInstanceId]) {\n                    this.removeBucketCrossTileIDs(z, zoomIndexes[tileKey]);\n                    delete zoomIndexes[tileKey];\n                    tilesChanged = true;\n                }\n            }\n        }\n        return tilesChanged;\n    }\n}\n\nexport class CrossTileSymbolIndex {\n    layerIndexes: {[layerId: string]: CrossTileSymbolLayerIndex};\n    crossTileIDs: CrossTileIDs;\n    maxBucketInstanceId: number;\n    bucketsInCurrentPlacement: {[_: number]: boolean};\n\n    constructor() {\n        this.layerIndexes = {};\n        this.crossTileIDs = new CrossTileIDs();\n        this.maxBucketInstanceId = 0;\n        this.bucketsInCurrentPlacement = {};\n    }\n\n    addLayer(styleLayer: StyleLayer, tiles: Array<Tile>, lng: number) {\n        let layerIndex = this.layerIndexes[styleLayer.id];\n        if (layerIndex === undefined) {\n            layerIndex = this.layerIndexes[styleLayer.id] = new CrossTileSymbolLayerIndex();\n        }\n\n        let symbolBucketsChanged = false;\n        const currentBucketIDs = {};\n\n        layerIndex.handleWrapJump(lng);\n\n        for (const tile of tiles) {\n            const symbolBucket = (tile.getBucket(styleLayer) as any as SymbolBucket);\n            if (!symbolBucket || styleLayer.id !== symbolBucket.layerIds[0])\n                continue;\n\n            if (!symbolBucket.bucketInstanceId) {\n                symbolBucket.bucketInstanceId = ++this.maxBucketInstanceId;\n            }\n\n            if (layerIndex.addBucket(tile.tileID, symbolBucket, this.crossTileIDs)) {\n                symbolBucketsChanged = true;\n            }\n            currentBucketIDs[symbolBucket.bucketInstanceId] = true;\n        }\n\n        if (layerIndex.removeStaleBuckets(currentBucketIDs)) {\n            symbolBucketsChanged = true;\n        }\n\n        return symbolBucketsChanged;\n    }\n\n    pruneUnusedLayers(usedLayers: Array<string>) {\n        const usedLayerMap = {};\n        usedLayers.forEach((usedLayer) => {\n            usedLayerMap[usedLayer] = true;\n        });\n        for (const layerId in this.layerIndexes) {\n            if (!usedLayerMap[layerId]) {\n                delete this.layerIndexes[layerId];\n            }\n        }\n    }\n}\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#if !defined(lowp)\\n#define lowp\\n#endif\\n#if !defined(mediump)\\n#define mediump\\n#endif\\n#if !defined(highp)\\n#define highp\\n#endif\\n#endif\\nout highp vec4 fragColor;';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'void main() {fragColor=vec4(1.0);}';\n","// Disable Flow annotations here because Flow doesn't support importing GLSL files\n\nimport preludeFrag from './_prelude.fragment.glsl.g';\nimport preludeVert from './_prelude.vertex.glsl.g';\nimport backgroundFrag from './background.fragment.glsl.g';\nimport backgroundVert from './background.vertex.glsl.g';\nimport backgroundPatternFrag from './background_pattern.fragment.glsl.g';\nimport backgroundPatternVert from './background_pattern.vertex.glsl.g';\nimport circleFrag from './circle.fragment.glsl.g';\nimport circleVert from './circle.vertex.glsl.g';\nimport clippingMaskFrag from './clipping_mask.fragment.glsl.g';\nimport clippingMaskVert from './clipping_mask.vertex.glsl.g';\nimport heatmapFrag from './heatmap.fragment.glsl.g';\nimport heatmapVert from './heatmap.vertex.glsl.g';\nimport heatmapTextureFrag from './heatmap_texture.fragment.glsl.g';\nimport heatmapTextureVert from './heatmap_texture.vertex.glsl.g';\nimport collisionBoxFrag from './collision_box.fragment.glsl.g';\nimport collisionBoxVert from './collision_box.vertex.glsl.g';\nimport collisionCircleFrag from './collision_circle.fragment.glsl.g';\nimport collisionCircleVert from './collision_circle.vertex.glsl.g';\nimport colorReliefFrag from './color_relief.fragment.glsl.g';\nimport colorReliefVert from './color_relief.vertex.glsl.g';\nimport debugFrag from './debug.fragment.glsl.g';\nimport debugVert from './debug.vertex.glsl.g';\nimport depthVert from './depth.vertex.glsl.g';\nimport fillFrag from './fill.fragment.glsl.g';\nimport fillVert from './fill.vertex.glsl.g';\nimport fillOutlineFrag from './fill_outline.fragment.glsl.g';\nimport fillOutlineVert from './fill_outline.vertex.glsl.g';\nimport fillOutlinePatternFrag from './fill_outline_pattern.fragment.glsl.g';\nimport fillOutlinePatternVert from './fill_outline_pattern.vertex.glsl.g';\nimport fillPatternFrag from './fill_pattern.fragment.glsl.g';\nimport fillPatternVert from './fill_pattern.vertex.glsl.g';\nimport fillExtrusionFrag from './fill_extrusion.fragment.glsl.g';\nimport fillExtrusionVert from './fill_extrusion.vertex.glsl.g';\nimport fillExtrusionPatternFrag from './fill_extrusion_pattern.fragment.glsl.g';\nimport fillExtrusionPatternVert from './fill_extrusion_pattern.vertex.glsl.g';\nimport hillshadePrepareFrag from './hillshade_prepare.fragment.glsl.g';\nimport hillshadePrepareVert from './hillshade_prepare.vertex.glsl.g';\nimport hillshadeFrag from './hillshade.fragment.glsl.g';\nimport hillshadeVert from './hillshade.vertex.glsl.g';\nimport lineFrag from './line.fragment.glsl.g';\nimport lineVert from './line.vertex.glsl.g';\nimport lineGradientFrag from './line_gradient.fragment.glsl.g';\nimport lineGradientVert from './line_gradient.vertex.glsl.g';\nimport linePatternFrag from './line_pattern.fragment.glsl.g';\nimport linePatternVert from './line_pattern.vertex.glsl.g';\nimport lineSDFFrag from './line_sdf.fragment.glsl.g';\nimport lineSDFVert from './line_sdf.vertex.glsl.g';\nimport lineGradientSDFFrag from './line_gradient_sdf.fragment.glsl.g';\nimport lineGradientSDFVert from './line_gradient_sdf.vertex.glsl.g';\nimport rasterFrag from './raster.fragment.glsl.g';\nimport rasterVert from './raster.vertex.glsl.g';\nimport symbolIconFrag from './symbol_icon.fragment.glsl.g';\nimport symbolIconVert from './symbol_icon.vertex.glsl.g';\nimport symbolSDFFrag from './symbol_sdf.fragment.glsl.g';\nimport symbolSDFVert from './symbol_sdf.vertex.glsl.g';\nimport symbolTextAndIconFrag from './symbol_text_and_icon.fragment.glsl.g';\nimport symbolTextAndIconVert from './symbol_text_and_icon.vertex.glsl.g';\nimport terrainDepthFrag from './terrain_depth.fragment.glsl.g';\nimport terrainCoordsFrag from './terrain_coords.fragment.glsl.g';\nimport terrainFrag from './terrain.fragment.glsl.g';\nimport terrainVert from './terrain.vertex.glsl.g';\nimport terrainVertDepth from './terrain_depth.vertex.glsl.g';\nimport terrainVertCoords from './terrain_coords.vertex.glsl.g';\nimport projectionErrorMeasurementVert from './projection_error_measurement.vertex.glsl.g';\nimport projectionErrorMeasurementFrag from './projection_error_measurement.fragment.glsl.g';\nimport projectionMercatorVert from './_projection_mercator.vertex.glsl.g';\nimport projectionGlobeVert from './_projection_globe.vertex.glsl.g';\nimport atmosphereFrag from './atmosphere.fragment.glsl.g';\nimport atmosphereVert from './atmosphere.vertex.glsl.g';\nimport skyFrag from './sky.fragment.glsl.g';\nimport skyVert from './sky.vertex.glsl.g';\n\nexport type PreparedShader = {\n    fragmentSource: string;\n    vertexSource: string;\n    staticAttributes: Array<string>;\n    staticUniforms: Array<string>;\n};\n\nexport const shaders = {\n    prelude: prepare(preludeFrag, preludeVert),\n    projectionMercator: prepare('', projectionMercatorVert),\n    projectionGlobe: prepare('', projectionGlobeVert),\n    background: prepare(backgroundFrag, backgroundVert),\n    backgroundPattern: prepare(backgroundPatternFrag, backgroundPatternVert),\n    circle: prepare(circleFrag, circleVert),\n    clippingMask: prepare(clippingMaskFrag, clippingMaskVert),\n    heatmap: prepare(heatmapFrag, heatmapVert),\n    heatmapTexture: prepare(heatmapTextureFrag, heatmapTextureVert),\n    collisionBox: prepare(collisionBoxFrag, collisionBoxVert),\n    collisionCircle: prepare(collisionCircleFrag, collisionCircleVert),\n    colorRelief: prepare(colorReliefFrag, colorReliefVert),\n    debug: prepare(debugFrag, debugVert),\n    depth: prepare(clippingMaskFrag, depthVert),\n    fill: prepare(fillFrag, fillVert),\n    fillOutline: prepare(fillOutlineFrag, fillOutlineVert),\n    fillOutlinePattern: prepare(fillOutlinePatternFrag, fillOutlinePatternVert),\n    fillPattern: prepare(fillPatternFrag, fillPatternVert),\n    fillExtrusion: prepare(fillExtrusionFrag, fillExtrusionVert),\n    fillExtrusionPattern: prepare(fillExtrusionPatternFrag, fillExtrusionPatternVert),\n    hillshadePrepare: prepare(hillshadePrepareFrag, hillshadePrepareVert),\n    hillshade: prepare(hillshadeFrag, hillshadeVert),\n    line: prepare(lineFrag, lineVert),\n    lineGradient: prepare(lineGradientFrag, lineGradientVert),\n    linePattern: prepare(linePatternFrag, linePatternVert),\n    lineSDF: prepare(lineSDFFrag, lineSDFVert),\n    lineGradientSDF: prepare(lineGradientSDFFrag, lineGradientSDFVert),\n    raster: prepare(rasterFrag, rasterVert),\n    symbolIcon: prepare(symbolIconFrag, symbolIconVert),\n    symbolSDF: prepare(symbolSDFFrag, symbolSDFVert),\n    symbolTextAndIcon: prepare(symbolTextAndIconFrag, symbolTextAndIconVert),\n    terrain: prepare(terrainFrag, terrainVert),\n    terrainDepth: prepare(terrainDepthFrag, terrainVertDepth),\n    terrainCoords: prepare(terrainCoordsFrag, terrainVertCoords),\n    projectionErrorMeasurement: prepare(projectionErrorMeasurementFrag, projectionErrorMeasurementVert),\n    atmosphere: prepare(atmosphereFrag, atmosphereVert),\n    sky: prepare(skyFrag, skyVert),\n};\n\n/** Expand #pragmas to #ifdefs, extract attributes and uniforms */\nfunction prepare(fragmentSource: string, vertexSource: string): PreparedShader {\n    const re = /#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g;\n\n    const vertexAttributes = vertexSource.match(/in ([\\w]+) ([\\w]+)/g);\n    const fragmentUniforms = fragmentSource.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g);\n    const vertexUniforms = vertexSource.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g);\n    const shaderUniforms = vertexUniforms ? vertexUniforms.concat(fragmentUniforms) : fragmentUniforms;\n\n    const fragmentPragmas = {};\n\n    fragmentSource = fragmentSource.replace(re, (match, operation, precision, type, name) => {\n        fragmentPragmas[name] = true;\n        if (operation === 'define') {\n            return `\n#ifndef HAS_UNIFORM_u_${name}\nin ${precision} ${type} ${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n        } else /* if (operation === 'initialize') */ {\n            return `\n#ifdef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n        }\n    });\n\n    vertexSource = vertexSource.replace(re, (match, operation, precision, type, name) => {\n        const attrType = type === 'float' ? 'vec2' : 'vec4';\n        const unpackType = name.match(/color/) ? 'color' : attrType;\n\n        if (fragmentPragmas[name]) {\n            if (operation === 'define') {\n                return `\n#ifndef HAS_UNIFORM_u_${name}\nuniform lowp float u_${name}_t;\nin ${precision} ${attrType} a_${name};\nout ${precision} ${type} ${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n            } else /* if (operation === 'initialize') */ {\n                if (unpackType === 'vec4') {\n                    // vec4 attributes are only used for cross-faded properties, and are not packed\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${name} = a_${name};\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                } else {\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                }\n            }\n        } else {\n            if (operation === 'define') {\n                return `\n#ifndef HAS_UNIFORM_u_${name}\nuniform lowp float u_${name}_t;\nin ${precision} ${attrType} a_${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n            } else /* if (operation === 'initialize') */ {\n                if (unpackType === 'vec4') {\n                    // vec4 attributes are only used for cross-faded properties, and are not packed\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = a_${name};\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                } else /* */ {\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                }\n            }\n        }\n    });\n\n    return {fragmentSource, vertexSource, staticAttributes: vertexAttributes, staticUniforms: shaderUniforms};\n}\n\n/** Transpile WebGL2 vertex shader source to WebGL1 */\nexport function transpileVertexShaderToWebGL1(source: string): string {\n    return source\n        .replace(/\\bin\\s/g, 'attribute ')\n        .replace(/\\bout\\s/g, 'varying ')\n        .replace(/texture\\(/g, 'texture2D(');\n}\n\n/** Transpile WebGL2 fragment shader source to WebGL1 */\nexport function transpileFragmentShaderToWebGL1(source: string): string {\n    return source\n        .replace(/\\bin\\s/g, 'varying ')\n        .replace('out highp vec4 fragColor;', '')\n        .replace(/fragColor/g, 'gl_FragColor')\n        .replace(/texture\\(/g, 'texture2D(');\n}\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#else\\n#if !defined(lowp)\\n#define lowp\\n#endif\\n#if !defined(mediump)\\n#define mediump\\n#endif\\n#if !defined(highp)\\n#define highp\\n#endif\\n#endif\\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c\\n);}\\n#ifdef TERRAIN3D\\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\\n#endif\\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\\n#ifdef TERRAIN3D\\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\\n#else\\nreturn 1.0;\\n#endif\\n}float calculate_visibility(vec4 pos) {\\n#ifdef TERRAIN3D\\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\\n#else\\nreturn 1.0;\\n#endif\\n}float ele(vec2 pos) {\\n#ifdef TERRAIN3D\\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\\n#else\\nreturn 0.0;\\n#endif\\n}float get_elevation(vec2 pos) {\\n#ifdef TERRAIN3D\\n#ifdef GLOBE\\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\\n#endif\\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\\n#else\\nreturn 0.0;\\n#endif\\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define GLOBE_RADIUS 6371008.8\\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \\nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 v_data;in float v_visibility;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define highp vec4 stroke_color\\n#pragma mapbox: define mediump float stroke_width\\n#pragma mapbox: define lowp float stroke_opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize mediump float radius\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize highp vec4 stroke_color\\n#pragma mapbox: initialize mediump float stroke_width\\n#pragma mapbox: initialize lowp float stroke_opacity\\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define highp vec4 stroke_color\\n#pragma mapbox: define mediump float stroke_width\\n#pragma mapbox: define lowp float stroke_opacity\\nvoid main(void) {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize mediump float radius\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize highp vec4 stroke_color\\n#pragma mapbox: initialize mediump float stroke_width\\n#pragma mapbox: initialize lowp float stroke_opacity\\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\\n#ifdef GLOBE\\nvec3 center_vector=projectToSphere(circle_center);\\n#endif\\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\\n#ifdef GLOBE\\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\\n#else\\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\\n#endif\\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\\n#ifdef GLOBE\\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\\n#else\\ngl_Position=projectTileWithElevation(corner_position,ele);\\n#endif\\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform highp float u_intensity;in vec2 v_extrude;\\n#pragma mapbox: define highp float weight\\n#define GAUSS_COEF 0.3989422804014327\\nvoid main() {\\n#pragma mapbox: initialize highp float weight\\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\\n#pragma mapbox: define highp float weight\\n#pragma mapbox: define mediump float radius\\nconst highp float ZERO=1.0/255.0/16.0;\\n#define GAUSS_COEF 0.3989422804014327\\nvoid main(void) {\\n#pragma mapbox: initialize highp float weight\\n#pragma mapbox: initialize mediump float radius\\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\\n#ifdef GLOBE\\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\\n#else\\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(0.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {\\n#ifdef GLOBE\\ngl_Position=projectTileFor3D(a_pos,0.0);\\n#else\\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float opacity\\nfragColor=color*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_fill_translate;in vec2 a_pos;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float opacity\\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 v_pos;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 outline_color\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 outline_color\\n#pragma mapbox: initialize lowp float opacity\\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 v_color;void main() {fragColor=v_color;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nin vec2 a_centroid;\\n#endif\\nout vec4 v_color;\\n#pragma mapbox: define highp float base\\n#pragma mapbox: define highp float height\\n#pragma mapbox: define highp vec4 color\\nvoid main() {\\n#pragma mapbox: initialize highp float base\\n#pragma mapbox: initialize highp float height\\n#pragma mapbox: initialize highp vec4 color\\nvec3 normal=a_normal_ed.xyz;\\n#ifdef TERRAIN3D\\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\\n#else\\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\\n#endif\\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\\n#ifdef GLOBE\\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\\n#else\\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\\n#endif\\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\\n#ifdef GLOBE\\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\\n#endif\\ndirectional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\\n#pragma mapbox: define lowp float base\\n#pragma mapbox: define lowp float height\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float base\\n#pragma mapbox: initialize lowp float height\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nin vec2 a_centroid;\\n#endif\\n#ifdef GLOBE\\nout vec3 v_sphere_pos;\\n#endif\\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\\n#pragma mapbox: define lowp float base\\n#pragma mapbox: define lowp float height\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float base\\n#pragma mapbox: initialize lowp float height\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\\n#ifdef TERRAIN3D\\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\\n#else\\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\\n#endif\\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\\n#ifdef GLOBE\\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\\n#else\\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\\n#endif\\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\\n? a_pos\\n: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\\n#define PI 3.141592653589793\\n#define STANDARD 0\\n#define COMBINED 1\\n#define IGOR 2\\n#define MULTIDIRECTIONAL 3\\n#define BASIC 4\\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_width2=vec2(outset,inset);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_width2=vec2(outset,inset);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\n#define LINE_DISTANCE_SCALE 2.0\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\n#define LINE_DISTANCE_SCALE 2.0\\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\\n#ifdef GLOBE\\nin float v_depth;\\n#endif\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\\n#ifdef GLOBE\\nif (v_depth > 1.0) {discard;}\\n#endif\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\n#define LINE_DISTANCE_SCALE 2.0\\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\\n#ifdef GLOBE\\nout float v_depth;\\n#endif\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define mediump vec4 dasharray_from\\n#pragma mapbox: define mediump vec4 dasharray_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 dasharray_from\\n#pragma mapbox: initialize mediump vec4 dasharray_to\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\\n#ifdef GLOBE\\nv_depth=gl_Position.z/gl_Position.w;\\n#endif\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\\n#ifdef GLOBE\\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\\n#endif\\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\\n#ifdef GLOBE\\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define SDF_PX 8.0\\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\\n#ifdef GLOBE\\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define SDF_PX 8.0\\n#define SDF 1.0\\n#define ICON 0.0\\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\\n#ifdef OVERDRAW_INSPECTOR\\nfragColor=vec4(1.0);\\n#endif\\n}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\\n#ifdef GLOBE\\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\\n#endif\\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}';\n","// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}';\n","import {type SegmentVector} from '../data/segment';\nimport {type VertexBuffer} from '../gl/vertex_buffer';\nimport {type IndexBuffer} from '../gl/index_buffer';\n\nexport class Mesh {\n    vertexBuffer: VertexBuffer;\n    indexBuffer: IndexBuffer;\n    segments: SegmentVector;\n\n    constructor(vertexBuffer: VertexBuffer, indexBuffer: IndexBuffer, segments: SegmentVector) {\n        this.vertexBuffer = vertexBuffer;\n        this.indexBuffer = indexBuffer;\n        this.segments = segments;\n    }\n\n    destroy(): void {\n        this.vertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.segments.destroy();\n\n        this.vertexBuffer = null;\n        this.indexBuffer = null;\n        this.segments = null;\n    }\n}\n","import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos', type: 'Int16', components: 2}\n]);\n","import type {Projection, ProjectionGPUContext, TileMeshUsage} from './projection';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport {EXTENT} from '../../data/extent';\nimport {type PreparedShader, shaders} from '../../shaders/shaders';\nimport type {Context} from '../../gl/context';\nimport {Mesh} from '../../render/mesh';\nimport {PosArray, TriangleIndexArray} from '../../data/array_types.g';\nimport {SegmentVector} from '../../data/segment';\nimport posAttributes from '../../data/pos_attributes';\nimport {SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\n\nexport const MercatorShaderDefine = '#define PROJECTION_MERCATOR';\nexport const MercatorShaderVariantKey = 'mercator';\n\nexport class MercatorProjection implements Projection {\n    private _cachedMesh: Mesh = null;\n\n    get name(): 'mercator' {\n        return 'mercator';\n    }\n\n    get useSubdivision(): boolean {\n        // Mercator never uses subdivision.\n        return false;\n    }\n\n    get shaderVariantName(): string {\n        return MercatorShaderVariantKey;\n    }\n\n    get shaderDefine(): string {\n        return MercatorShaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return shaders.projectionMercator;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return shaders.projectionMercator.vertexSource;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return SubdivisionGranularitySetting.noSubdivision;\n    }\n\n    get useGlobeControls(): boolean {\n        return false;\n    }\n\n    get transitionState(): number {\n        return 0;\n    }\n\n    get latitudeErrorCorrectionRadians(): number {\n        return 0;\n    }\n\n    public destroy(): void {\n        // Do nothing.\n    }\n\n    public updateGPUdependent(_: ProjectionGPUContext): void {\n        // Do nothing.\n    }\n\n    public getMeshFromTileID(context: Context, _tileID: CanonicalTileID, _hasBorder: boolean, _allowPoles: boolean, _usage: TileMeshUsage): Mesh {\n        if (this._cachedMesh) {\n            return this._cachedMesh;\n        }\n\n        // The parameters tileID, hasBorder and allowPoles are all ignored on purpose for mercator meshes.\n\n        const tileExtentArray = new PosArray();\n        tileExtentArray.emplaceBack(0, 0);\n        tileExtentArray.emplaceBack(EXTENT, 0);\n        tileExtentArray.emplaceBack(0, EXTENT);\n        tileExtentArray.emplaceBack(EXTENT, EXTENT);\n        const tileExtentBuffer = context.createVertexBuffer(tileExtentArray, posAttributes.members);\n        const tileExtentSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const quadTriangleIndices = new TriangleIndexArray();\n        quadTriangleIndices.emplaceBack(1, 0, 2);\n        quadTriangleIndices.emplaceBack(1, 2, 3);\n        const quadTriangleIndexBuffer = context.createIndexBuffer(quadTriangleIndices);\n\n        this._cachedMesh = new Mesh(tileExtentBuffer, quadTriangleIndexBuffer, tileExtentSegments);\n        return this._cachedMesh;\n    }\n\n    public recalculate(): void {\n        // Do nothing.\n    }\n\n    public hasTransition(): boolean {\n        return false;\n    }\n\n    setErrorQueryLatitudeDegrees(_value: number) {\n        // Do nothing.\n    }\n}\n","import {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport Point from '@mapbox/point-geometry';\nimport {clamp, type Complete, type RequireAtLeastOne} from '../util/util';\n\n/**\n * An `EdgeInset` object represents screen space padding applied to the edges of the viewport.\n * This shifts the apparent center or the vanishing point of the map. This is useful for adding floating UI elements\n * on top of the map and having the vanishing point shift as UI elements resize.\n *\n * @group Geography and Geometry\n */\nexport class EdgeInsets {\n    /**\n     * @defaultValue 0\n     */\n    top: number;\n    /**\n     * @defaultValue 0\n     */\n    bottom: number;\n    /**\n     * @defaultValue 0\n     */\n    left: number;\n    /**\n     * @defaultValue 0\n     */\n    right: number;\n\n    constructor(top: number = 0, bottom: number = 0, left: number = 0, right: number = 0) {\n        if (isNaN(top) || top < 0 ||\n            isNaN(bottom) || bottom < 0 ||\n            isNaN(left) || left < 0 ||\n            isNaN(right) || right < 0\n        ) {\n            throw new Error('Invalid value for edge-insets, top, bottom, left and right must all be numbers');\n        }\n\n        this.top = top;\n        this.bottom = bottom;\n        this.left = left;\n        this.right = right;\n    }\n\n    /**\n     * Interpolates the inset in-place.\n     * This maintains the current inset value for any inset not present in `target`.\n     * @param start - interpolation start\n     * @param target - interpolation target\n     * @param t - interpolation step/weight\n     * @returns the insets\n     */\n    interpolate(start: PaddingOptions | EdgeInsets, target: PaddingOptions, t: number): EdgeInsets {\n        if (target.top != null && start.top != null) this.top = interpolates.number(start.top, target.top, t);\n        if (target.bottom != null && start.bottom != null) this.bottom = interpolates.number(start.bottom, target.bottom, t);\n        if (target.left != null && start.left != null) this.left = interpolates.number(start.left, target.left, t);\n        if (target.right != null && start.right != null) this.right = interpolates.number(start.right, target.right, t);\n\n        return this;\n    }\n\n    /**\n     * Utility method that computes the new apprent center or vanishing point after applying insets.\n     * This is in pixels and with the top left being (0.0) and +y being downwards.\n     *\n     * @param width - the width\n     * @param height - the height\n     * @returns the point\n     */\n    getCenter(width: number, height: number): Point {\n        // Clamp insets so they never overflow width/height and always calculate a valid center\n        const x = clamp((this.left + width - this.right) / 2, 0, width);\n        const y = clamp((this.top + height - this.bottom) / 2, 0, height);\n\n        return new Point(x, y);\n    }\n\n    equals(other: PaddingOptions): boolean {\n        return this.top === other.top &&\n            this.bottom === other.bottom &&\n            this.left === other.left &&\n            this.right === other.right;\n    }\n\n    clone(): EdgeInsets {\n        return new EdgeInsets(this.top, this.bottom, this.left, this.right);\n    }\n\n    /**\n     * Returns the current state as json, useful when you want to have a\n     * read-only representation of the inset.\n     *\n     * @returns state as json\n     */\n    toJSON(): Complete<PaddingOptions> {\n        return {\n            top: this.top,\n            bottom: this.bottom,\n            left: this.left,\n            right: this.right\n        };\n    }\n}\n\n/**\n * Options for setting padding on calls to methods such as {@link Map.fitBounds}, {@link Map.fitScreenCoordinates}, and {@link Map.setPadding}. Adjust these options to set the amount of padding in pixels added to the edges of the canvas. Set a uniform padding on all edges or individual values for each edge. All properties of this object must be\n * non-negative integers.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let bbox = [[-79, 43], [-73, 45]];\n * map.fitBounds(bbox, {\n *   padding: {top: 10, bottom:25, left: 15, right: 5}\n * });\n * ```\n *\n * @example\n * ```ts\n * let bbox = [[-79, 43], [-73, 45]];\n * map.fitBounds(bbox, {\n *   padding: 20\n * });\n * ```\n * @see [Fit to the bounds of a LineString](https://maplibre.org/maplibre-gl-js/docs/examples/zoomto-linestring/)\n * @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/)\n */\nexport type PaddingOptions = RequireAtLeastOne<{\n    /**\n     * Padding in pixels from the top of the map canvas.\n     */\n    top: number;\n    /**\n     * Padding in pixels from the bottom of the map canvas.\n     */\n    bottom: number;\n    /**\n     * Padding in pixels from the left of the map canvas.\n     */\n    right: number;\n    /**\n     * Padding in pixels from the right of the map canvas.\n     */\n    left: number;\n}>;\n","import {LngLat, type LngLatLike} from './lng_lat';\nimport {LngLatBounds} from './lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {wrap, clamp, degreesToRadians, radiansToDegrees, zoomScale, MAX_VALID_LATITUDE, scaleZoom} from '../util/util';\nimport {mat4, mat2} from 'gl-matrix';\nimport {EdgeInsets} from './edge_insets';\nimport {altitudeFromMercatorZ, MercatorCoordinate, mercatorZfromAltitude} from './mercator_coordinate';\nimport {cameraMercatorCoordinateFromCenterAndRotation, cameraDirectionFromPitchBearing} from './projection/mercator_utils';\nimport {EXTENT} from '../data/extent';\n\nimport type {PaddingOptions} from './edge_insets';\nimport type {IReadonlyTransform, ITransformGetters, TransformConstrainFunction} from './transform_interface';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport {Bounds} from './bounds';\n/**\n * If a path crossing the antimeridian would be shorter, extend the final coordinate so that\n * interpolating between the two endpoints will cross it.\n * @param center - The LngLat object of the desired center. This object will be mutated.\n */\nexport function normalizeCenter(tr: IReadonlyTransform, center: LngLat): void {\n    if (!tr.renderWorldCopies || tr.lngRange) return;\n    const delta = center.lng - tr.center.lng;\n    center.lng +=\n        delta > 180 ? -360 :\n            delta < -180 ? 360 : 0;\n}\n\nexport type UnwrappedTileIDType = {\n    /**\n     * Tile wrap: 0 for the \"main\" world,\n     * negative values for worlds left of the main,\n     * positive values for worlds right of the main.\n     */\n    wrap?: number;\n    canonical: {\n        /**\n         * Tile X coordinate, in range 0..(z^2)-1\n         */\n        x: number;\n        /**\n         * Tile Y coordinate, in range 0..(z^2)-1\n         */\n        y: number;\n        /**\n         * Tile zoom level.\n         */\n        z: number;\n    };\n};\n\nexport type TransformHelperCallbacks = {\n    /**\n     * The transform's default getter of center lngLat and zoom to ensure that\n     * 1) everything beyond the bounds is excluded\n     * 2) a given lngLat is as near the center as possible\n     * Bounds are those set by maxBounds or North & South \"Poles\" and, if only 1 globe is displayed, antimeridian.\n     */\n    defaultConstrain: TransformConstrainFunction;\n\n    /**\n     * Updates the underlying transform's internal matrices.\n     */\n    calcMatrices: () => void;\n};\n\nexport type TransformOptions = {\n    /**\n     * The minimum zoom level of the map.\n     */\n    minZoom?: number;\n    /**\n     * The maximum zoom level of the map.\n     */\n    maxZoom?: number;\n    /**\n     * The minimum pitch of the map.\n     */\n    minPitch?: number;\n    /**\n     * The maximum pitch of the map.\n     */\n    maxPitch?: number;\n    /**\n     * Whether to render multiple copies of the world side by side in the map.\n     */\n    renderWorldCopies?: boolean;\n    /**\n     * An override of the transform's default constraining function for respecting its longitude and latitude bounds.\n     */\n    constrainOverride?: TransformConstrainFunction | null;\n};\n\nfunction getTileZoom(zoom: number): number {\n    return Math.max(0, Math.floor(zoom));\n}\n\n/**\n * @internal\n * This class stores all values that define a transform's state,\n * such as center, zoom, minZoom, etc.\n * This can be used as a helper for implementing the ITransform interface.\n */\nexport class TransformHelper implements ITransformGetters {\n    private _callbacks: TransformHelperCallbacks;\n\n    _tileSize: number; // constant\n    _tileZoom: number; // integer zoom level for tiles\n    _lngRange: [number, number];\n    _latRange: [number, number];\n    _scale: number; // computed based on zoom\n    _width: number;\n    _height: number;\n    /**\n     * Vertical field of view in radians.\n     */\n    _fovInRadians: number;\n    /**\n     * This transform's bearing in radians.\n     */\n    _bearingInRadians: number;\n    /**\n     * Pitch in radians.\n     */\n    _pitchInRadians: number;\n    /**\n     * Roll in radians.\n     */\n    _rollInRadians: number;\n    _zoom: number;\n    _renderWorldCopies: boolean;\n    _minZoom: number;\n    _maxZoom: number;\n    _minPitch: number;\n    _maxPitch: number;\n    _center: LngLat;\n    _elevation: number;\n    _minElevationForCurrentTile: number;\n    _pixelPerMeter: number;\n    _edgeInsets: EdgeInsets;\n    _unmodified: boolean;\n\n    _constraining: boolean;\n    _rotationMatrix: mat2;\n    _pixelsToGLUnits: [number, number];\n    _pixelsToClipSpaceMatrix: mat4;\n    _clipSpaceToPixelsMatrix: mat4;\n    _cameraToCenterDistance: number;\n\n    _nearZ: number;\n    _farZ: number;\n    _autoCalculateNearFarZ: boolean;\n\n    _constrainOverride: TransformConstrainFunction;\n\n    constructor(callbacks: TransformHelperCallbacks, options?: TransformOptions) {\n        this._callbacks = callbacks;\n        this._tileSize = 512; // constant\n\n        this._renderWorldCopies = options?.renderWorldCopies === undefined ? true : !!options?.renderWorldCopies;\n        this._minZoom = options?.minZoom || 0;\n        this._maxZoom = options?.maxZoom || 22;\n\n        this._minPitch = (options?.minPitch === undefined || options?.minPitch === null) ? 0 : options?.minPitch;\n        this._maxPitch = (options?.maxPitch === undefined || options?.maxPitch === null) ? 60 : options?.maxPitch;\n\n        this._constrainOverride = options?.constrainOverride ?? null;\n\n        this.setMaxBounds();\n\n        this._width = 0;\n        this._height = 0;\n        this._center = new LngLat(0, 0);\n        this._elevation = 0;\n        this._zoom = 0;\n        this._tileZoom = getTileZoom(this._zoom);\n        this._scale = zoomScale(this._zoom);\n        this._bearingInRadians = 0;\n        this._fovInRadians = 0.6435011087932844;\n        this._pitchInRadians = 0;\n        this._rollInRadians = 0;\n        this._unmodified = true;\n        this._edgeInsets = new EdgeInsets();\n        this._minElevationForCurrentTile = 0;\n        this._autoCalculateNearFarZ = true;\n    }\n\n    public apply(thatI: ITransformGetters, constrain: boolean, forceOverrideZ?: boolean): void {\n        this._constrainOverride = thatI.constrainOverride;\n        this._latRange = thatI.latRange;\n        this._lngRange = thatI.lngRange;\n        this._width = thatI.width;\n        this._height = thatI.height;\n        this._center = thatI.center;\n        this._elevation = thatI.elevation;\n        this._minElevationForCurrentTile = thatI.minElevationForCurrentTile;\n        this._zoom = thatI.zoom;\n        this._tileZoom = getTileZoom(this._zoom);\n        this._scale = zoomScale(this._zoom);\n        this._bearingInRadians = thatI.bearingInRadians;\n        this._fovInRadians = thatI.fovInRadians;\n        this._pitchInRadians = thatI.pitchInRadians;\n        this._rollInRadians = thatI.rollInRadians;\n        this._unmodified = thatI.unmodified;\n        this._edgeInsets = new EdgeInsets(thatI.padding.top, thatI.padding.bottom, thatI.padding.left, thatI.padding.right);\n        this._minZoom = thatI.minZoom;\n        this._maxZoom = thatI.maxZoom;\n        this._minPitch = thatI.minPitch;\n        this._maxPitch = thatI.maxPitch;\n        this._renderWorldCopies = thatI.renderWorldCopies;\n        this._cameraToCenterDistance = thatI.cameraToCenterDistance;\n        this._nearZ = thatI.nearZ;\n        this._farZ = thatI.farZ;\n        this._autoCalculateNearFarZ = !forceOverrideZ && thatI.autoCalculateNearFarZ;\n        if (constrain) {\n            this.constrainInternal();\n        }\n        this._calcMatrices();\n    }\n\n    get pixelsToClipSpaceMatrix(): mat4 { return this._pixelsToClipSpaceMatrix; }\n    get clipSpaceToPixelsMatrix(): mat4 { return this._clipSpaceToPixelsMatrix; }\n\n    get minElevationForCurrentTile(): number { return this._minElevationForCurrentTile; }\n    setMinElevationForCurrentTile(ele: number) {\n        this._minElevationForCurrentTile = ele;\n    }\n\n    get tileSize(): number { return this._tileSize; }\n    get tileZoom(): number { return this._tileZoom; }\n    get scale(): number { return this._scale; }\n\n    /**\n     * Gets the transform's width in pixels. Use {@link resize} to set the transform's size.\n     */\n    get width(): number { return this._width; }\n\n    /**\n     * Gets the transform's height in pixels. Use {@link resize} to set the transform's size.\n     */\n    get height(): number { return this._height; }\n\n    /**\n     * Gets the transform's bearing in radians.\n     */\n    get bearingInRadians(): number { return this._bearingInRadians; }\n\n    get lngRange(): [number, number] { return this._lngRange; }\n    get latRange(): [number, number] { return this._latRange; }\n\n    get pixelsToGLUnits(): [number, number] { return this._pixelsToGLUnits; }\n\n    get minZoom(): number { return this._minZoom; }\n    setMinZoom(zoom: number) {\n        if (this._minZoom === zoom) return;\n        this._minZoom = zoom;\n        this.setZoom(this.applyConstrain(this._center, this.zoom).zoom);\n    }\n\n    get maxZoom(): number { return this._maxZoom; }\n    setMaxZoom(zoom: number) {\n        if (this._maxZoom === zoom) return;\n        this._maxZoom = zoom;\n        this.setZoom(this.applyConstrain(this._center, this.zoom).zoom);\n    }\n\n    get minPitch(): number { return this._minPitch; }\n    setMinPitch(pitch: number) {\n        if (this._minPitch === pitch) return;\n        this._minPitch = pitch;\n        this.setPitch(Math.max(this.pitch, pitch));\n    }\n\n    get maxPitch(): number { return this._maxPitch; }\n    setMaxPitch(pitch: number) {\n        if (this._maxPitch === pitch) return;\n        this._maxPitch = pitch;\n        this.setPitch(Math.min(this.pitch, pitch));\n    }\n\n    get renderWorldCopies(): boolean { return this._renderWorldCopies; }\n    setRenderWorldCopies(renderWorldCopies: boolean) {\n        if (renderWorldCopies === undefined) {\n            renderWorldCopies = true;\n        } else if (renderWorldCopies === null) {\n            renderWorldCopies = false;\n        }\n\n        this._renderWorldCopies = renderWorldCopies;\n    }\n\n    get constrainOverride(): TransformConstrainFunction { return this._constrainOverride; }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null) {\n        if (constrain === undefined) constrain = null;\n        if (this._constrainOverride === constrain) return;\n        this._constrainOverride = constrain;\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    get worldSize(): number {\n        return this._tileSize * this._scale;\n    }\n\n    get centerOffset(): Point {\n        return this.centerPoint._sub(this.size._div(2));\n    }\n\n    /**\n     * Gets the transform's dimensions packed into a Point object.\n     */\n    get size(): Point {\n        return new Point(this._width, this._height);\n    }\n\n    get bearing(): number {\n        return this._bearingInRadians / Math.PI * 180;\n    }\n    setBearing(bearing: number) {\n        const b = wrap(bearing, -180, 180) * Math.PI / 180;\n        if (this._bearingInRadians === b) return;\n        this._unmodified = false;\n        this._bearingInRadians = b;\n        this._calcMatrices();\n\n        // 2x2 matrix for rotating points\n        this._rotationMatrix = mat2.create();\n        mat2.rotate(this._rotationMatrix, this._rotationMatrix, -this._bearingInRadians);\n    }\n\n    get rotationMatrix(): mat2 { return this._rotationMatrix; }\n\n    get pitchInRadians(): number {\n        return this._pitchInRadians;\n    }\n    get pitch(): number {\n        return this._pitchInRadians / Math.PI * 180;\n    }\n    setPitch(pitch: number) {\n        const p = clamp(pitch, this.minPitch, this.maxPitch) / 180 * Math.PI;\n        if (this._pitchInRadians === p) return;\n        this._unmodified = false;\n        this._pitchInRadians = p;\n        this._calcMatrices();\n    }\n\n    get rollInRadians(): number {\n        return this._rollInRadians;\n    }\n    get roll(): number {\n        return this._rollInRadians / Math.PI * 180;\n    }\n    setRoll(roll: number) {\n        const r = roll / 180 * Math.PI;\n        if (this._rollInRadians === r) return;\n        this._unmodified = false;\n        this._rollInRadians = r;\n        this._calcMatrices();\n    }\n\n    get fovInRadians(): number {\n        return this._fovInRadians;\n    }\n    get fov(): number {\n        return radiansToDegrees(this._fovInRadians);\n    }\n    setFov(fov: number) {\n        fov = clamp(fov, 0.1, 150);\n        if (this.fov === fov) return;\n        this._unmodified = false;\n        this._fovInRadians = degreesToRadians(fov);\n        this._calcMatrices();\n    }\n\n    get zoom(): number { return this._zoom; }\n    setZoom(zoom: number) {\n        const constrainedZoom = this.applyConstrain(this._center, zoom).zoom;\n        if (this._zoom === constrainedZoom) return;\n        this._unmodified = false;\n        this._zoom = constrainedZoom;\n        this._tileZoom = Math.max(0, Math.floor(constrainedZoom));\n        this._scale = zoomScale(constrainedZoom);\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    get center(): LngLat { return this._center; }\n    setCenter(center: LngLat) {\n        if (center.lat === this._center.lat && center.lng === this._center.lng) return;\n        this._unmodified = false;\n        this._center = center;\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    /**\n     * Elevation at current center point, meters above sea level\n     */\n    get elevation(): number { return this._elevation; }\n    setElevation(elevation: number) {\n        if (elevation === this._elevation) return;\n        this._elevation = elevation;\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    get padding(): PaddingOptions { return this._edgeInsets.toJSON(); }\n    setPadding(padding: PaddingOptions) {\n        if (this._edgeInsets.equals(padding)) return;\n        this._unmodified = false;\n        // Update edge-insets in-place\n        this._edgeInsets.interpolate(this._edgeInsets, padding, 1);\n        this._calcMatrices();\n    }\n\n    /**\n     * The center of the screen in pixels with the top-left corner being (0,0)\n     * and +y axis pointing downwards. This accounts for padding.\n     */\n    get centerPoint(): Point {\n        return this._edgeInsets.getCenter(this._width, this._height);\n    }\n\n    /**\n     * @internal\n     */\n    get pixelsPerMeter(): number { return this._pixelPerMeter; }\n\n    get unmodified(): boolean { return this._unmodified; }\n\n    get cameraToCenterDistance(): number { return this._cameraToCenterDistance; }\n\n    get nearZ(): number { return this._nearZ; }\n    get farZ(): number { return this._farZ; }\n    get autoCalculateNearFarZ(): boolean { return this._autoCalculateNearFarZ; }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._autoCalculateNearFarZ = false;\n        this._nearZ = nearZ;\n        this._farZ = farZ;\n        this._calcMatrices();\n    }\n    clearNearFarZOverride(): void {\n        this._autoCalculateNearFarZ = true;\n        this._calcMatrices();\n    }\n\n    /**\n     * Returns if the padding params match\n     *\n     * @param padding - the padding to check against\n     * @returns true if they are equal, false otherwise\n     */\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._edgeInsets.equals(padding);\n    }\n\n    /**\n     * Helper method to update edge-insets in place\n     *\n     * @param start - the starting padding\n     * @param target - the target padding\n     * @param t - the step/weight\n     */\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        this._unmodified = false;\n        this._edgeInsets.interpolate(start, target, t);\n        this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    resize(width: number, height: number, constrain: boolean = true): void {\n        this._width = width;\n        this._height = height;\n        if (constrain) this.constrainInternal();\n        this._calcMatrices();\n    }\n\n    /**\n     * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.\n     * @returns max bounds\n     */\n    getMaxBounds(): LngLatBounds | null {\n        if (!this._latRange || this._latRange.length !== 2 ||\n            !this._lngRange || this._lngRange.length !== 2) return null;\n\n        return new LngLatBounds([this._lngRange[0], this._latRange[0]], [this._lngRange[1], this._latRange[1]]);\n    }\n\n    /**\n     * Sets or clears the map's geographical constraints.\n     * @param bounds - A {@link LngLatBounds} object describing the new geographic boundaries of the map.\n     */\n    setMaxBounds(bounds?: LngLatBounds | null): void {\n        if (bounds) {\n            this._lngRange = [bounds.getWest(), bounds.getEast()];\n            this._latRange = [bounds.getSouth(), bounds.getNorth()];\n            this.constrainInternal();\n        } else {\n            this._lngRange = null;\n            this._latRange = [-MAX_VALID_LATITUDE, MAX_VALID_LATITUDE];\n        }\n    }\n\n    /**\n     * When the map is pitched, some of the 3D features that intersect a query will not intersect\n     * the query at the surface of the earth. Instead the feature may be closer and only intersect\n     * the query because it extrudes into the air.\n     * @param queryGeometry - For point queries, the line from the query point to the \"camera point\",\n     * for other geometries, the envelope of the query geometry and the \"camera point\"\n     * @returns a geometry that includes all of the original query as well as all possible ares of the\n     * screen where the *base* of a visible extrusion could be.\n     *\n     */\n    getCameraQueryGeometry(cameraPoint: Point, queryGeometry: Array<Point>): Array<Point> {\n        if (queryGeometry.length === 1) {\n            return [queryGeometry[0], cameraPoint];\n        } else {\n            const {minX, minY, maxX, maxY} = Bounds.fromPoints(queryGeometry).extend(cameraPoint);\n            return [\n                new Point(minX, minY),\n                new Point(maxX, minY),\n                new Point(maxX, maxY),\n                new Point(minX, maxY),\n                new Point(minX, minY)\n            ];\n        }\n    }\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        if (this._constrainOverride !== null) {\n            return this._constrainOverride(lngLat, zoom);\n        } else {\n            return this._callbacks.defaultConstrain(lngLat, zoom);\n        }\n    };\n\n    /**\n     * @internal\n     * Snaps the transform's center, zoom, etc. into the valid range.\n     */\n    private constrainInternal(): void {\n        if (!this.center || !this._width || !this._height || this._constraining) return;\n        this._constraining = true;\n        const unmodified = this._unmodified;\n        const {center, zoom} = this.applyConstrain(this.center, this.zoom);\n        this.setCenter(center);\n        this.setZoom(zoom);\n        this._unmodified = unmodified;\n        this._constraining = false;\n    }\n\n    /**\n     * This function is called every time one of the transform's defining properties (center, pitch, etc.) changes.\n     * This function should update the transform's internal data, such as matrices.\n     * Any derived `_calcMatrices` function should also call the base function first. The base function only depends on the `_width` and `_height` fields.\n     */\n    private _calcMatrices(): void {\n        if (this._width && this._height) {\n            this._pixelsToGLUnits = [2 / this._width, -2 / this._height];\n\n            let m = mat4.identity(new Float64Array(16) as any);\n            mat4.scale(m, m, [this._width / 2, -this._height / 2, 1]);\n            mat4.translate(m, m, [1, -1, 0]);\n            this._clipSpaceToPixelsMatrix = m;\n\n            m = mat4.identity(new Float64Array(16) as any);\n            mat4.scale(m, m, [1, -1, 1]);\n            mat4.translate(m, m, [-1, -1, 0]);\n            mat4.scale(m, m, [2 / this._width, 2 / this._height, 1]);\n            this._pixelsToClipSpaceMatrix = m;\n            const halfFov = this.fovInRadians / 2;\n            this._cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this._height;\n        }\n        this._callbacks.calcMatrices();\n    }\n\n    calculateCenterFromCameraLngLatAlt(lnglat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        const cameraBearing = bearing !== undefined ? bearing : this.bearing;\n        const cameraPitch = pitch = pitch !== undefined ? pitch : this.pitch;\n\n        const {distanceToCenter, clampedElevation} = this._distanceToCenterFromAltElevationPitch(alt, this.elevation, cameraPitch);\n        const {x, y} = cameraDirectionFromPitchBearing(cameraPitch, cameraBearing);\n        \n        // The mercator transform scale changes with latitude. At high latitudes, there are more \"Merc units\" per meter\n        // than at the equator. We treat the center point as our fundamental quantity. This means we want to convert\n        // elevation to Mercator Z using the scale factor at the center point (not the camera point). Since the center point is\n        // initially unknown, we compute it using the scale factor at the camera point. This gives us a better estimate of the\n        // center point scale factor, which we use to recompute the center point. We repeat until the error is very small.\n        // This typically takes about 5 iterations.\n        const camMercator = MercatorCoordinate.fromLngLat(lnglat, alt);\n        let metersPerMercUnit = altitudeFromMercatorZ(1, camMercator.y);\n        let centerMercator: MercatorCoordinate;\n        let dMercator: number;\n        let iter = 0;\n        const maxIter = 10;\n        do {\n            iter += 1;\n            if (iter > maxIter) {\n                break;\n            }\n            dMercator = distanceToCenter / metersPerMercUnit;\n            const dx = x * dMercator;\n            const dy = y * dMercator;\n            centerMercator = new MercatorCoordinate(camMercator.x + dx, camMercator.y + dy);\n            metersPerMercUnit = 1 / centerMercator.meterInMercatorCoordinateUnits();\n        } while (Math.abs(distanceToCenter - dMercator * metersPerMercUnit) > 1.0e-12);\n\n        const center = centerMercator.toLngLat();\n        const zoom = scaleZoom(this.height / 2 / Math.tan(this.fovInRadians / 2) / dMercator / this.tileSize);\n        return {center, elevation: clampedElevation, zoom};\n    }\n\n    recalculateZoomAndCenter(elevation: number): void {\n        if (this.elevation - elevation === 0) return;\n\n        // Critical: Stay in pixels and use original center to avoid instability at extreme latitudes when using Mercator-LngLat\n        const mercUnitsPerPixel = 1 / this.worldSize;\n        const originalMercUnitsPerMeter = mercatorZfromAltitude(1, this.center.lat);\n        const originalPixelsPerMeter = originalMercUnitsPerMeter * this.worldSize;\n\n        // Determine camera\n        const originalCenterMercator = MercatorCoordinate.fromLngLat(this.center, this.elevation);\n        const originalCenterPixelX = originalCenterMercator.x / mercUnitsPerPixel;\n        const originalCenterPixelY = originalCenterMercator.y / mercUnitsPerPixel;\n        const originalCenterPixelZ = originalCenterMercator.z / mercUnitsPerPixel;\n        \n        const cameraPitch = this.pitch;\n        const cameraBearing = this.bearing;\n        const {x, y, z} = cameraDirectionFromPitchBearing(cameraPitch, cameraBearing);\n        const dCamPixel = this.cameraToCenterDistance;\n        const camPixelX = originalCenterPixelX + dCamPixel * -x;\n        const camPixelY = originalCenterPixelY + dCamPixel * -y;\n        const camPixelZ = originalCenterPixelZ + dCamPixel * z;\n\n        // Determine corresponding center\n        const {distanceToCenter, clampedElevation} = this._distanceToCenterFromAltElevationPitch(camPixelZ / originalPixelsPerMeter, elevation, cameraPitch);\n        const distanceToCenterPixels = distanceToCenter * originalPixelsPerMeter;\n        const centerPixelX = camPixelX + x * distanceToCenterPixels;\n        const centerPixelY = camPixelY + y * distanceToCenterPixels;\n        const center = new MercatorCoordinate(centerPixelX * mercUnitsPerPixel, centerPixelY * mercUnitsPerPixel, 0).toLngLat();\n\n        const mercUnitsPerMeter = mercatorZfromAltitude(1, center.lat);\n        const zoom = scaleZoom(this.height / 2 / Math.tan(this.fovInRadians / 2) / distanceToCenter / mercUnitsPerMeter / this.tileSize);\n\n        // Update matrices\n        this._elevation = clampedElevation;\n        this._center = center;\n        this.setZoom(zoom);\n    }\n\n    _distanceToCenterFromAltElevationPitch(alt: number, elevation: number, pitch: number): {distanceToCenter: number; clampedElevation: number} {\n        const dzNormalized = -Math.cos(degreesToRadians(pitch));\n        const altitudeAGL = alt - elevation;\n        let distanceToCenter: number;\n        let clampedElevation = elevation;\n        if (dzNormalized * altitudeAGL >= 0.0 || Math.abs(dzNormalized) < 0.1) {\n            distanceToCenter = 10000;\n            clampedElevation = alt + distanceToCenter * dzNormalized;\n        } else {\n            distanceToCenter = -altitudeAGL / dzNormalized;\n        }\n        return {distanceToCenter, clampedElevation};\n    }\n\n    getCameraPoint(): Point {\n        const pitch = this.pitchInRadians;\n        const offset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);\n        return this.centerPoint.add(new Point(offset * Math.sin(this.rollInRadians), offset * Math.cos(this.rollInRadians)));\n    }\n\n    getCameraAltitude(): number {\n        const altitude = Math.cos(this.pitchInRadians) * this._cameraToCenterDistance / this._pixelPerMeter;\n        return altitude + this.elevation;\n    }\n\n    getCameraLngLat(): LngLat {\n        const pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n        const cameraToCenterDistanceMeters = this.cameraToCenterDistance / pixelPerMeter;\n        const camMercator = cameraMercatorCoordinateFromCenterAndRotation(this.center, this.elevation, this.pitch, this.bearing, cameraToCenterDistanceMeters);\n        return camMercator.toLngLat();\n    }\n\n    getMercatorTileCoordinates(overscaledTileID: OverscaledTileID): [number, number, number, number] {\n        if (!overscaledTileID) {\n            return [0, 0, 1, 1];\n        }\n        const scale = (overscaledTileID.canonical.z >= 0) ? (1 << overscaledTileID.canonical.z) : Math.pow(2.0, overscaledTileID.canonical.z);\n        return [\n            overscaledTileID.canonical.x / scale,\n            overscaledTileID.canonical.y / scale,\n            1.0 / scale / EXTENT,\n            1.0 / scale / EXTENT\n        ];\n    }\n}\n","import {vec3, type vec4} from 'gl-matrix';\nimport {type Frustum} from './frustum';\nimport {IntersectionResult, type IBoundingVolume} from './bounding_volume';\n\nexport class Aabb implements IBoundingVolume {\n    min: vec3;\n    max: vec3;\n    center: vec3;\n\n    constructor(min_: vec3, max_: vec3) {\n        this.min = min_;\n        this.max = max_;\n        this.center = vec3.scale([] as any, vec3.add([] as any, this.min, this.max), 0.5);\n    }\n\n    quadrant(index: number): Aabb {\n        const split = [(index % 2) === 0, index < 2];\n        const qMin = vec3.clone(this.min);\n        const qMax = vec3.clone(this.max);\n        for (let axis = 0; axis < split.length; axis++) {\n            qMin[axis] = split[axis] ? this.min[axis] : this.center[axis];\n            qMax[axis] = split[axis] ? this.center[axis] : this.max[axis];\n        }\n        // Elevation is always constant, hence quadrant.max.z = this.max.z\n        qMax[2] = this.max[2];\n        return new Aabb(qMin, qMax);\n    }\n\n    distanceX(point: Array<number>): number {\n        const pointOnAabb = Math.max(Math.min(this.max[0], point[0]), this.min[0]);\n        return pointOnAabb - point[0];\n    }\n\n    distanceY(point: Array<number>): number {\n        const pointOnAabb = Math.max(Math.min(this.max[1], point[1]), this.min[1]);\n        return pointOnAabb - point[1];\n    }\n\n    /**\n     * Performs a frustum-aabb intersection test.\n     */\n    intersectsFrustum(frustum: Frustum): IntersectionResult {\n        // Execute separating axis test between two convex objects to find intersections\n        // Each frustum plane together with 3 major axes define the separating axes\n        let fullyInside = true;\n\n        for (let p = 0; p < frustum.planes.length; p++) {\n            const planeIntersection = this.intersectsPlane(frustum.planes[p]);\n\n            if (planeIntersection === IntersectionResult.None) {\n                return IntersectionResult.None;\n            }\n            if (planeIntersection === IntersectionResult.Partial) {\n                fullyInside = false;\n            }\n        }\n\n        if (fullyInside) {\n            return IntersectionResult.Full;\n        }\n\n        if (frustum.aabb.min[0] > this.max[0] || frustum.aabb.min[1] > this.max[1] || frustum.aabb.min[2] > this.max[2] ||\n            frustum.aabb.max[0] < this.min[0] || frustum.aabb.max[1] < this.min[1] || frustum.aabb.max[2] < this.min[2]) {\n            return IntersectionResult.None;\n        }\n\n        return IntersectionResult.Partial;\n    }\n\n    /**\n     * Performs a halfspace-aabb intersection test.\n     */\n    intersectsPlane(plane: vec4): IntersectionResult {\n        let distMin = plane[3];\n        let distMax = plane[3];\n        for (let i = 0; i < 3; i++) {\n            if (plane[i] > 0) {\n                distMin += plane[i] * this.min[i];\n                distMax += plane[i] * this.max[i];\n            } else {\n                distMax += plane[i] * this.min[i];\n                distMin += plane[i] * this.max[i];\n            }\n        }\n\n        if (distMin >= 0) {\n            return IntersectionResult.Full;\n        }\n        if (distMax < 0) {\n            return IntersectionResult.None;\n        }\n        return IntersectionResult.Partial;\n    }\n}\n","import {OverscaledTileID} from '../../tile/tile_id';\nimport {Aabb} from '../../util/primitives/aabb';\nimport {clamp} from '../../util/util';\nimport {type MercatorCoordinate} from '../mercator_coordinate';\nimport {type IReadonlyTransform} from '../transform_interface';\nimport {type CoveringTilesOptionsInternal} from './covering_tiles';\nimport {type CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\nexport class MercatorCoveringTilesDetailsProvider implements CoveringTilesDetailsProvider {\n\n    distanceToTile2d(pointX: number, pointY: number, _tileID: {x: number; y: number; z: number}, aabb: Aabb): number {\n        const distanceX = aabb.distanceX([pointX, pointY]);\n        const distanceY = aabb.distanceY([pointX, pointY]);\n        return Math.hypot(distanceX, distanceY);\n    }\n\n    /**\n     * Returns the wrap value for a given tile, computed so that tiles will remain loaded when crossing the antimeridian.\n     */\n    getWrap(centerCoord: MercatorCoordinate, tileID: {x:number; y: number; z: number}, parentWrap: number): number {\n        return parentWrap;\n    }\n\n    /**\n     * Returns the AABB of the specified tile.\n     * @param tileID - Tile x, y and z for zoom.\n     */\n    getTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): Aabb {\n        let minElevation = 0;\n        let maxElevation = 0;\n        if (options?.terrain) {\n            const overscaledTileID = new OverscaledTileID(tileID.z, wrap, tileID.z, tileID.x, tileID.y);\n            const minMax = options.terrain.getMinMaxElevation(overscaledTileID);\n            minElevation = minMax.minElevation ?? Math.min(0, elevation);\n            maxElevation = minMax.maxElevation ?? Math.max(0, elevation);\n        }\n        const numTiles = 1 << tileID.z;\n        return new Aabb([wrap + tileID.x / numTiles, tileID.y / numTiles, minElevation],\n            [wrap + (tileID.x + 1) / numTiles, (tileID.y + 1) / numTiles, maxElevation]);\n    }\n    \n    allowVariableZoom(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): boolean {\n        const zfov = transform.fov * (Math.abs(Math.cos(transform.rollInRadians)) * transform.height + Math.abs(Math.sin(transform.rollInRadians)) * transform.width) / transform.height;\n        const maxConstantZoomPitch = clamp(78.5 - zfov / 2, 0.0, 60.0);\n        return (!!options.terrain || transform.pitch > maxConstantZoomPitch);\n    }\n\n    allowWorldCopies(): boolean {\n        return true;\n    }\n\n    prepareNextFrame(): void { \n        // Do nothing\n    }\n}","import {type mat4, vec3, vec4} from 'gl-matrix';\nimport {Aabb} from './aabb';\nimport {pointPlaneSignedDistance, rayPlaneIntersection} from '../util';\n\nexport class Frustum {\n\n    constructor(public points: vec4[], public planes: vec4[], public aabb: Aabb) { }\n\n    public static fromInvProjectionMatrix(invProj: mat4, worldSize: number = 1, zoom: number = 0, horizonPlane?: vec4, flippedNearFar?: boolean): Frustum {\n        const clipSpaceCorners = [\n            [-1, 1, -1, 1],\n            [1, 1, -1, 1],\n            [1, -1, -1, 1],\n            [-1, -1, -1, 1],\n            [-1, 1, 1, 1],\n            [1, 1, 1, 1],\n            [1, -1, 1, 1],\n            [-1, -1, 1, 1]\n        ];\n\n        // Globe and mercator projection matrices have different Y directions, hence we need different sets of indices.\n        // This should be fixed in the future.\n        const frustumPlanePointIndices = flippedNearFar ? [\n            [6, 5, 4],  // near\n            [0, 1, 2],  // far\n            [0, 3, 7],  // left\n            [2, 1, 5],  // right\n            [3, 2, 6],  // bottom\n            [0, 4, 5]   // top\n        ] : [\n            [0, 1, 2],  // near\n            [6, 5, 4],  // far\n            [0, 3, 7],  // left\n            [2, 1, 5],  // right\n            [3, 2, 6],  // bottom\n            [0, 4, 5]   // top\n        ];\n\n        const scale = Math.pow(2, zoom);\n\n        // Transform frustum corner points from clip space to tile space, Z to meters\n        const frustumCoords = clipSpaceCorners.map(v => unprojectClipSpacePoint(v, invProj, worldSize, scale));\n\n        if (horizonPlane) {\n            // A horizon clipping plane was supplied.\n            adjustFarPlaneByHorizonPlane(frustumCoords, frustumPlanePointIndices[0], horizonPlane, flippedNearFar);\n        }\n\n        const frustumPlanes = frustumPlanePointIndices.map((p: number[]) => {\n            const a = vec3.sub([] as any, frustumCoords[p[0]] as vec3, frustumCoords[p[1]] as vec3);\n            const b = vec3.sub([] as any, frustumCoords[p[2]] as vec3, frustumCoords[p[1]] as vec3);\n            const n = vec3.normalize([] as any, vec3.cross([] as any, a, b)) as any;\n            const d = -vec3.dot(n, frustumCoords[p[1]] as vec3);\n            return n.concat(d);\n        });\n\n        const min: vec3 = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];\n        const max: vec3 = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];\n\n        for (const p of frustumCoords) {\n            for (let i = 0; i < 3; i++) {\n                min[i] = Math.min(min[i], p[i]);\n                max[i] = Math.max(max[i], p[i]);\n            }\n        }\n\n        return new Frustum(frustumCoords, frustumPlanes, new Aabb(min, max));\n    }\n}\n\nfunction unprojectClipSpacePoint(point: vec4 | number[], invProj: mat4, worldSize: number, scale: number): vec4 {\n    const v = vec4.transformMat4([] as any, point as any, invProj) as any;\n    const s = 1.0 / v[3] / worldSize * scale;\n    return vec4.mul(v as any, v as any, [s, s, 1.0 / v[3], s] as vec4);\n}\n\n/**\n * Modifies points in the supplied `frustumCoords` array so that the frustum's far plane only lies as far as the horizon,\n * which improves frustum culling effectiveness.\n * @param frustumCoords - Points of the frustum.\n * @param nearPlanePointsIndices - Which indices in the `frustumCoords` form the near plane.\n * @param horizonPlane - The horizon plane.\n */\nfunction adjustFarPlaneByHorizonPlane(frustumCoords: vec4[], nearPlanePointsIndices: number[], horizonPlane: vec4, flippedNearFar: boolean): void {\n    // For each of the 4 edges from near to far plane,\n    // we find at which distance these edges intersect the given clipping plane,\n    // select the maximal value from these distances and then we move\n    // the frustum's far plane so that it is at most as far away from the near plane\n    // as this maximal distance.\n\n    const nearPlanePointsOffset = flippedNearFar ? 4 : 0;\n    const farPlanePointsOffset = flippedNearFar ? 0 : 4;\n\n    let maxDist = 0;\n    const cornerRayLengths: number[] = [];\n    const cornerRayNormalizedDirections: vec3[] = [];\n    for (let i = 0; i < 4; i++) {\n        const dir = vec3.sub([] as any, frustumCoords[i + farPlanePointsOffset] as vec3, frustumCoords[i + nearPlanePointsOffset] as vec3);\n        const len = vec3.length(dir);\n        vec3.scale(dir, dir, 1.0 / len); // normalize\n        cornerRayLengths.push(len);\n        cornerRayNormalizedDirections.push(dir);\n    }\n\n    for (let i = 0; i < 4; i++) {\n        const dist = rayPlaneIntersection(frustumCoords[i + nearPlanePointsOffset] as vec3, cornerRayNormalizedDirections[i], horizonPlane);\n        if (dist !== null && dist >= 0) {\n            maxDist = Math.max(maxDist, dist);\n        } else {\n            // Use the original ray length for rays parallel to the horizon plane, or for rays pointing away from it.\n            maxDist = Math.max(maxDist, cornerRayLengths[i]);\n        }\n    }\n\n    // Compute the near plane.\n    // We use its normal as the \"view vector\" - direction in which the camera is looking.\n    const nearPlaneNormalized = getNormalizedNearPlane(frustumCoords, nearPlanePointsIndices);\n\n    // We also try to adjust the far plane position so that it exactly intersects the point on the horizon\n    // that is most distant from the near plane.\n    const idealFarPlaneDistanceFromNearPlane = getIdealNearFarPlaneDistance(horizonPlane, nearPlaneNormalized);\n    if (idealFarPlaneDistanceFromNearPlane !== null) {\n        const idealCornerRayLength = idealFarPlaneDistanceFromNearPlane / vec3.dot(cornerRayNormalizedDirections[0], nearPlaneNormalized as vec3); // dot(near plane, ray dir) is the same for all 4 corners\n        maxDist = Math.min(maxDist, idealCornerRayLength);\n    }\n\n    for (let i = 0; i < 4; i++) {\n        const targetLength = Math.min(maxDist, cornerRayLengths[i]);\n        const newPoint = [\n            frustumCoords[i + nearPlanePointsOffset][0] + cornerRayNormalizedDirections[i][0] * targetLength,\n            frustumCoords[i + nearPlanePointsOffset][1] + cornerRayNormalizedDirections[i][1] * targetLength,\n            frustumCoords[i + nearPlanePointsOffset][2] + cornerRayNormalizedDirections[i][2] * targetLength,\n            1,\n        ] as vec4;\n        frustumCoords[i + farPlanePointsOffset] = newPoint;\n    }\n}\n\n/**\n * Returns the near plane equation with unit length direction.\n * @param frustumCoords - Points of the frustum.\n * @param nearPlanePointsIndices - Which indices in the `frustumCoords` form the near plane.\n */\nfunction getNormalizedNearPlane(frustumCoords: vec4[], nearPlanePointsIndices: number[]): vec4 {\n    const nearPlaneA = vec3.sub([] as any, frustumCoords[nearPlanePointsIndices[0]] as vec3, frustumCoords[nearPlanePointsIndices[1]] as vec3);\n    const nearPlaneB = vec3.sub([] as any, frustumCoords[nearPlanePointsIndices[2]] as vec3, frustumCoords[nearPlanePointsIndices[1]] as vec3);\n    const nearPlaneNormalized = [0, 0, 0, 0] as vec4;\n    vec3.normalize(nearPlaneNormalized as vec3, vec3.cross([] as any, nearPlaneA, nearPlaneB)) as any;\n    nearPlaneNormalized[3] = -vec3.dot(nearPlaneNormalized as vec3, frustumCoords[nearPlanePointsIndices[0]] as vec3);\n    return nearPlaneNormalized;\n}\n\n/**\n * Returns the ideal distance between the frustum's near and far plane so that the far plane only lies as far as the horizon.\n */\nfunction getIdealNearFarPlaneDistance(horizonPlane: vec4, nearPlaneNormalized: vec4): number | null {\n    // Normalize the horizon plane to unit direction\n    const horizonPlaneLen = vec3.len(horizonPlane as vec3);\n    const normalizedHorizonPlane = vec4.scale([] as any, horizonPlane, 1 / horizonPlaneLen);\n\n    // Project the view vector onto the horizon plane\n    const projectedViewDirection = vec3.sub([] as any, nearPlaneNormalized as vec3, vec3.scale([] as any, normalizedHorizonPlane as vec3, vec3.dot(nearPlaneNormalized as vec3, normalizedHorizonPlane as vec3)));\n    const projectedViewLength = vec3.len(projectedViewDirection);\n    \n    // projectedViewLength will be 0 if the camera is looking straight down\n    if (projectedViewLength > 0) {\n        // Find the radius and center of the horizon circle (the horizon circle is the intersection of the planet's sphere and the horizon plane).\n        const horizonCircleRadius = Math.sqrt(1 - normalizedHorizonPlane[3] * normalizedHorizonPlane[3]);\n        const horizonCircleCenter = vec3.scale([] as any, normalizedHorizonPlane as vec3, -normalizedHorizonPlane[3]); // The horizon plane normal always points towards the camera.\n        // Find the furthest point on the horizon circle from the near plane.\n        const pointFurthestOnHorizonCircle = vec3.add([] as any, horizonCircleCenter, vec3.scale([] as any, projectedViewDirection, horizonCircleRadius / projectedViewLength));\n        // Compute this point's distance from the near plane.\n        return pointPlaneSignedDistance(nearPlaneNormalized, pointFurthestOnHorizonCircle);\n    } else {\n        return null;\n    }\n}\n","import {LngLat, type LngLatLike} from '../lng_lat';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from '../mercator_coordinate';\nimport Point from '@mapbox/point-geometry';\nimport {wrap, clamp, createIdentityMat4f64, createMat4f64, degreesToRadians, createIdentityMat4f32, zoomScale, scaleZoom} from '../../util/util';\nimport {type mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {UnwrappedTileID, OverscaledTileID, type CanonicalTileID, calculateTileKey} from '../../tile/tile_id';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {type PointProjection, xyTransformMat4} from '../../symbol/projection';\nimport {LngLatBounds} from '../lng_lat_bounds';\nimport {getMercatorHorizon, projectToWorldCoordinates, unprojectFromWorldCoordinates, calculateTileMatrix, maxMercatorHorizonAngle, cameraMercatorCoordinateFromCenterAndRotation} from './mercator_utils';\nimport {EXTENT} from '../../data/extent';\nimport {TransformHelper} from '../transform_helper';\nimport {MercatorCoveringTilesDetailsProvider} from './mercator_covering_tiles_details_provider';\nimport {Frustum} from '../../util/primitives/frustum';\n\nimport type {Terrain} from '../../render/terrain';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\nexport class MercatorTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        return this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number, constrain: boolean = true): void {\n        this._helper.resize(width, height, constrain);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get cameraToCenterDistance(): number { \n        return this._helper.cameraToCenterDistance;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number { \n        return this._helper.nearZ; \n    }\n    public get farZ(): number { \n        return this._helper.farZ; \n    }\n    public get autoCalculateNearFarZ(): boolean { \n        return this._helper.autoCalculateNearFarZ; \n    }\n    setTransitionState(_value: number, _error: number): void {\n        // Do nothing\n    }\n    //\n    // Implementation of mercator transform\n    //\n\n    private _cameraPosition: vec3;\n\n    private _mercatorMatrix: mat4;\n    private _projectionMatrix: mat4;\n    private _viewProjMatrix: mat4;\n    private _invViewProjMatrix: mat4;\n    private _invProjMatrix: mat4;\n    private _alignedProjMatrix: mat4;\n    private _pixelMatrix: mat4;\n    private _pixelMatrix3D: mat4;\n    private _pixelMatrixInverse: mat4;\n    private _fogMatrix: mat4;\n\n    private _posMatrixCache: Map<string, {f64: mat4; f32: mat4}> = new Map();\n    private _alignedPosMatrixCache: Map<string, {f64: mat4; f32: mat4}> = new Map();\n    private _fogMatrixCacheF32: Map<string, mat4> = new Map();\n\n    private _coveringTilesDetailsProvider;\n\n    constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => { this._calcMatrices(); },\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._coveringTilesDetailsProvider = new MercatorCoveringTilesDetailsProvider();\n    }\n\n    public clone(): ITransform {\n        const clone = new MercatorTransform();\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean, forceOverrideZ?: boolean): void {\n        this._helper.apply(that, constrain, forceOverrideZ);\n    }\n\n    public get cameraPosition(): vec3 { return this._cameraPosition; }\n    public get projectionMatrix(): mat4 { return this._projectionMatrix; }\n    public get modelViewProjectionMatrix(): mat4 { return this._viewProjMatrix; }\n    public get inverseProjectionMatrix(): mat4 { return this._invProjMatrix; }\n    public get mercatorMatrix(): mat4 { return this._mercatorMatrix; } // Not part of ITransform interface\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): Array<UnwrappedTileID> {\n        const result = [new UnwrappedTileID(0, tileID)];\n        if (this._helper._renderWorldCopies) {\n            const utl = this.screenPointToMercatorCoordinate(new Point(0, 0));\n            const utr = this.screenPointToMercatorCoordinate(new Point(this._helper._width, 0));\n            const ubl = this.screenPointToMercatorCoordinate(new Point(this._helper._width, this._helper._height));\n            const ubr = this.screenPointToMercatorCoordinate(new Point(0, this._helper._height));\n            const w0 = Math.floor(Math.min(utl.x, utr.x, ubl.x, ubr.x));\n            const w1 = Math.floor(Math.max(utl.x, utr.x, ubl.x, ubr.x));\n\n            // Add an extra copy of the world on each side to properly render ImageSources and CanvasSources.\n            // Both sources draw outside the tile boundaries of the tile that \"contains them\" so we need\n            // to add extra copies on both sides in case offscreen tiles need to draw into on-screen ones.\n            const extraWorldCopy = 1;\n\n            for (let w = w0 - extraWorldCopy; w <= w1 + extraWorldCopy; w++) {\n                if (w === 0) continue;\n                result.push(new UnwrappedTileID(w, tileID));\n            }\n        }\n        return result;\n    }\n\n    getCameraFrustum(): Frustum {\n        return Frustum.fromInvProjectionMatrix(this._invViewProjMatrix, this.worldSize);\n    }\n    getClippingPlane(): vec4 | null {\n        return null;\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this._coveringTilesDetailsProvider;\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        // find position the camera is looking on\n        const center = this.screenPointToLocation(this.centerPoint, terrain);\n        const elevation = terrain ? terrain.getElevationForLngLatZoom(center, this._helper._tileZoom) : 0;\n        this._helper.recalculateZoomAndCenter(elevation);\n    }\n\n    setLocationAtPoint(lnglat: LngLat, point: Point) {\n        const z = mercatorZfromAltitude(this.elevation, this.center.lat);\n        const a = this.screenPointToMercatorCoordinateAtZ(point, z);\n        const b = this.screenPointToMercatorCoordinateAtZ(this.centerPoint, z);\n        const loc = MercatorCoordinate.fromLngLat(lnglat);\n        const newCenter = new MercatorCoordinate(\n            loc.x - (a.x - b.x),\n            loc.y - (a.y - b.y));\n        this.setCenter(newCenter?.toLngLat());\n        if (this._helper._renderWorldCopies) {\n            this.setCenter(this.center.wrap());\n        }\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        return terrain ?\n            this.coordinatePoint(MercatorCoordinate.fromLngLat(lnglat), terrain.getElevationForLngLat(lnglat, this), this._pixelMatrix3D) :\n            this.coordinatePoint(MercatorCoordinate.fromLngLat(lnglat));\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.screenPointToMercatorCoordinate(p, terrain)?.toLngLat();\n    }\n\n    screenPointToMercatorCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        // get point-coordinate from terrain coordinates framebuffer\n        if (terrain) {\n            const coordinate = terrain.pointCoordinate(p);\n            if (coordinate != null) {\n                return coordinate;\n            }\n        }\n        return this.screenPointToMercatorCoordinateAtZ(p);\n    }\n\n    screenPointToMercatorCoordinateAtZ(p: Point, mercatorZ?: number): MercatorCoordinate {\n\n        // calculate point-coordinate on flat earth\n        const targetZ = mercatorZ ? mercatorZ : 0;\n        // since we don't know the correct projected z value for the point,\n        // unproject two points to get a line and then find the point on that\n        // line with z=0\n\n        const coord0 = [p.x, p.y, 0, 1] as vec4;\n        const coord1 = [p.x, p.y, 1, 1] as vec4;\n\n        vec4.transformMat4(coord0, coord0, this._pixelMatrixInverse);\n        vec4.transformMat4(coord1, coord1, this._pixelMatrixInverse);\n\n        const w0 = coord0[3];\n        const w1 = coord1[3];\n        const x0 = coord0[0] / w0;\n        const x1 = coord1[0] / w1;\n        const y0 = coord0[1] / w0;\n        const y1 = coord1[1] / w1;\n        const z0 = coord0[2] / w0;\n        const z1 = coord1[2] / w1;\n\n        const t = z0 === z1 ? 0 : (targetZ - z0) / (z1 - z0);\n\n        return new MercatorCoordinate(\n            interpolates.number(x0, x1, t) / this.worldSize,\n            interpolates.number(y0, y1, t) / this.worldSize,\n            targetZ);\n    }\n\n    /**\n     * Given a coordinate, return the screen point that corresponds to it\n     * @param coord - the coordinates\n     * @param elevation - the elevation\n     * @param pixelMatrix - the pixel matrix\n     * @returns screen point\n     */\n    coordinatePoint(coord: MercatorCoordinate, elevation: number = 0, pixelMatrix: mat4 = this._pixelMatrix): Point {\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, elevation, 1] as vec4;\n        vec4.transformMat4(p, p, pixelMatrix);\n        return new Point(p[0] / p[3], p[1] / p[3]);\n    }\n\n    getBounds(): LngLatBounds {\n        const top = Math.max(0, this._helper._height / 2 - getMercatorHorizon(this));\n        return new LngLatBounds()\n            .extend(this.screenPointToLocation(new Point(0, top)))\n            .extend(this.screenPointToLocation(new Point(this._helper._width, top)))\n            .extend(this.screenPointToLocation(new Point(this._helper._width, this._helper._height)))\n            .extend(this.screenPointToLocation(new Point(0, this._helper._height)));\n    }\n\n    isPointOnMapSurface(p: Point, terrain?: Terrain): boolean {\n        if (terrain) {\n            const coordinate = terrain.pointCoordinate(p);\n            return coordinate != null;\n        }\n        return (p.y > this.height / 2 - getMercatorHorizon(this));\n    }\n\n    /**\n     * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.\n     * This function is specific to the mercator projection.\n     * @param tileID - the tile ID\n     * @param aligned - whether to use a pixel-aligned matrix variant, intended for rendering raster tiles\n     * @param useFloat32 - when true, returns a float32 matrix instead of float64. Use float32 for matrices that are passed to shaders, use float64 for everything else.\n     */\n    calculatePosMatrix(tileID: UnwrappedTileID | OverscaledTileID, aligned: boolean = false, useFloat32?: boolean): mat4 {\n        const posMatrixKey = tileID.key ?? calculateTileKey(tileID.wrap, tileID.canonical.z, tileID.canonical.z, tileID.canonical.x, tileID.canonical.y);\n        const cache = aligned ? this._alignedPosMatrixCache : this._posMatrixCache;\n        if (cache.has(posMatrixKey)) {\n            const matrices = cache.get(posMatrixKey);\n            return useFloat32 ? matrices.f32 : matrices.f64;\n        }\n\n        const tileMatrix = calculateTileMatrix(tileID, this.worldSize);\n        mat4.multiply(tileMatrix, aligned ? this._alignedProjMatrix : this._viewProjMatrix, tileMatrix);\n        const matrices = {\n            f64: tileMatrix,\n            f32: new Float32Array(tileMatrix), // Must have a 32 bit float version for WebGL, otherwise WebGL calls in Chrome get very slow.\n        };\n        cache.set(posMatrixKey, matrices);\n        // Make sure to return the correct precision\n        return useFloat32 ? matrices.f32 : matrices.f64;\n    }\n\n    calculateFogMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        const posMatrixKey = unwrappedTileID.key;\n        const cache = this._fogMatrixCacheF32;\n        if (cache.has(posMatrixKey)) {\n            return cache.get(posMatrixKey);\n        }\n\n        const fogMatrix = calculateTileMatrix(unwrappedTileID, this.worldSize);\n        mat4.multiply(fogMatrix, this._fogMatrix, fogMatrix);\n\n        cache.set(posMatrixKey, new Float32Array(fogMatrix)); // Must be 32 bit floats, otherwise WebGL calls in Chrome get very slow.\n        return cache.get(posMatrixKey);\n    }\n\n    /**\n     * This mercator implementation returns center lngLat and zoom to ensure that:\n     *\n     * 1) everything beyond the bounds is excluded\n     * 2) a given lngLat is as near the center as possible\n     *\n     * Bounds are those set by maxBounds or North & South \"Poles\" and, if only 1 globe is displayed, antimeridian.\n     */\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        zoom = clamp(+zoom, this.minZoom, this.maxZoom);\n        const result = {\n            center: new LngLat(lngLat.lng, lngLat.lat),\n            zoom\n        };\n\n        let lngRange = this._helper._lngRange;\n\n        if (!this._helper._renderWorldCopies && lngRange === null) {\n            const almost180 = 180 - 1e-10;\n            lngRange = [-almost180, almost180];\n        }\n\n        const worldSize = this.tileSize * zoomScale(result.zoom); // A world size for the requested zoom level, not the current world size\n        let minY = 0;\n        let maxY = worldSize;\n        let minX = 0;\n        let maxX = worldSize;\n        let scaleY = 0;\n        let scaleX = 0;\n        const {x: screenWidth, y: screenHeight} = this.size;\n\n        if (this._helper._latRange) {\n            const latRange = this._helper._latRange;\n            minY = mercatorYfromLat(latRange[1]) * worldSize;\n            maxY = mercatorYfromLat(latRange[0]) * worldSize;\n            const shouldZoomIn = maxY - minY < screenHeight;\n            if (shouldZoomIn) scaleY = screenHeight / (maxY - minY);\n        }\n\n        if (lngRange) {\n            minX = wrap(\n                mercatorXfromLng(lngRange[0]) * worldSize,\n                0,\n                worldSize\n            );\n            maxX = wrap(\n                mercatorXfromLng(lngRange[1]) * worldSize,\n                0,\n                worldSize\n            );\n\n            if (maxX < minX) maxX += worldSize;\n\n            const shouldZoomIn = maxX - minX < screenWidth;\n            if (shouldZoomIn) scaleX = screenWidth / (maxX - minX);\n        }\n\n        const {x: originalX, y: originalY} = projectToWorldCoordinates(worldSize, lngLat);\n        let modifiedX, modifiedY;\n\n        const scale = Math.max(scaleX || 0, scaleY || 0);\n\n        if (scale) {\n            // zoom in to exclude all beyond the given lng/lat ranges\n            const newPoint = new Point(\n                scaleX ? (maxX + minX) / 2 : originalX,\n                scaleY ? (maxY + minY) / 2 : originalY);\n            result.center = unprojectFromWorldCoordinates(worldSize, newPoint).wrap();\n            result.zoom += scaleZoom(scale);\n            return result;\n        }\n\n        if (this._helper._latRange) {\n            const h2 = screenHeight / 2;\n            if (originalY - h2 < minY) modifiedY = minY + h2;\n            if (originalY + h2 > maxY) modifiedY = maxY - h2;\n        }\n\n        if (lngRange) {\n            const centerX = (minX + maxX) / 2;\n            let wrappedX = originalX;\n            if (this._helper._renderWorldCopies) {\n                wrappedX = wrap(originalX, centerX - worldSize / 2, centerX + worldSize / 2);\n            }\n            const w2 = screenWidth / 2;\n\n            if (wrappedX - w2 < minX) modifiedX = minX + w2;\n            if (wrappedX + w2 > maxX) modifiedX = maxX - w2;\n        }\n\n        // pan the map if the screen goes off the range\n        if (modifiedX !== undefined || modifiedY !== undefined) {\n            const newPoint = new Point(modifiedX ?? originalX, modifiedY ?? originalY);\n            result.center = unprojectFromWorldCoordinates(worldSize, newPoint).wrap();\n        }\n\n        return result;\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lnglat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lnglat, alt, bearing, pitch);\n    }\n\n    _calculateNearFarZIfNeeded(cameraToSeaLevelDistance: number, limitedPitchRadians: number, offset: Point): void {\n        if (!this._helper.autoCalculateNearFarZ) {\n            return;\n        }\n        // In case of negative minimum elevation (e.g. the dead see, under the sea maps) use a lower plane for calculation\n        const minRenderDistanceBelowCameraInMeters = 100;\n        const minElevation = Math.min(this.elevation, this.minElevationForCurrentTile, this.getCameraAltitude() - minRenderDistanceBelowCameraInMeters);\n        const cameraToLowestPointDistance = cameraToSeaLevelDistance - minElevation * this._helper._pixelPerMeter / Math.cos(limitedPitchRadians);\n        const lowestPlane = minElevation < 0 ? cameraToLowestPointDistance : cameraToSeaLevelDistance;\n\n        // Find the distance from the center point [width/2 + offset.x, height/2 + offset.y] to the\n        // center top point [width/2 + offset.x, 0] in Z units, using the law of sines.\n        // 1 Z unit is equivalent to 1 horizontal px at the center of the map\n        // (the distance between[width/2, height/2] and [width/2 + 1, height/2])\n        const groundAngle = Math.PI / 2 + this.pitchInRadians;\n        const zfov = degreesToRadians(this.fov) * (Math.abs(Math.cos(degreesToRadians(this.roll))) * this.height + Math.abs(Math.sin(degreesToRadians(this.roll))) * this.width) / this.height;\n        const fovAboveCenter = zfov * (0.5 + offset.y / this.height);\n        const topHalfSurfaceDistance = Math.sin(fovAboveCenter) * lowestPlane / Math.sin(clamp(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));\n\n        // Find the distance from the center point to the horizon\n        const horizon = getMercatorHorizon(this);\n        const horizonAngle = Math.atan(horizon / this._helper.cameraToCenterDistance);\n        const minFovCenterToHorizonRadians = degreesToRadians(90 - maxMercatorHorizonAngle);\n        const fovCenterToHorizon = horizonAngle > minFovCenterToHorizonRadians ? 2 * horizonAngle * (0.5 + offset.y / (horizon * 2)) : minFovCenterToHorizonRadians;\n        const topHalfSurfaceDistanceHorizon = Math.sin(fovCenterToHorizon) * lowestPlane / Math.sin(clamp(Math.PI - groundAngle - fovCenterToHorizon, 0.01, Math.PI - 0.01));\n\n        // Calculate z distance of the farthest fragment that should be rendered.\n        // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`\n        const topHalfMinDistance = Math.min(topHalfSurfaceDistance, topHalfSurfaceDistanceHorizon);\n\n        this._helper._farZ = (Math.cos(Math.PI / 2 - limitedPitchRadians) * topHalfMinDistance + lowestPlane) * 1.01;\n\n        // The larger the value of nearZ is\n        // - the more depth precision is available for features (good)\n        // - clipping starts appearing sooner when the camera is close to 3d features (bad)\n        //\n        // Other values work for mapbox-gl-js but deck.gl was encountering precision issues\n        // when rendering custom layers. This value was experimentally chosen and\n        // seems to solve z-fighting issues in deck.gl while not clipping buildings too close to the camera.\n        this._helper._nearZ = this._helper._height / 50;\n    }\n\n    _calcMatrices(): void {\n        if (!this._helper._height) return;\n\n        const offset = this.centerOffset;\n        const point = projectToWorldCoordinates(this.worldSize, this.center);\n        const x = point.x, y = point.y;\n        this._helper._pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n\n        // Calculate the camera to sea-level distance in pixel in respect of terrain\n        const limitedPitchRadians = degreesToRadians(Math.min(this.pitch, maxMercatorHorizonAngle));\n        const cameraToSeaLevelDistance = Math.max(this._helper.cameraToCenterDistance / 2, this._helper.cameraToCenterDistance + this._helper._elevation * this._helper._pixelPerMeter / Math.cos(limitedPitchRadians));\n\n        this._calculateNearFarZIfNeeded(cameraToSeaLevelDistance, limitedPitchRadians, offset);\n\n        // matrix for conversion from location to clip space(-1 .. 1)\n        let m: mat4;\n        m = new Float64Array(16) as any;\n        mat4.perspective(m, this.fovInRadians, this._helper._width / this._helper._height, this._helper._nearZ, this._helper._farZ);\n        this._invProjMatrix = new Float64Array(16) as any as mat4;\n        mat4.invert(this._invProjMatrix, m);\n\n        // Apply center of perspective offset\n        m[8] = -offset.x * 2 / this._helper._width;\n        m[9] = offset.y * 2 / this._helper._height;\n        this._projectionMatrix = mat4.clone(m);\n\n        mat4.scale(m, m, [1, -1, 1]);\n        mat4.translate(m, m, [0, 0, -this._helper.cameraToCenterDistance]);\n        mat4.rotateZ(m, m, -this.rollInRadians);\n        mat4.rotateX(m, m, this.pitchInRadians);\n        mat4.rotateZ(m, m, -this.bearingInRadians);\n        mat4.translate(m, m, [-x, -y, 0]);\n\n        // The mercatorMatrix can be used to transform points from mercator coordinates\n        // ([0, 0] nw, [1, 1] se) to clip space.\n        this._mercatorMatrix = mat4.scale([] as any, m, [this.worldSize, this.worldSize, this.worldSize]);\n\n        // scale vertically to meters per pixel (inverse of ground resolution):\n        mat4.scale(m, m, [1, 1, this._helper._pixelPerMeter]);\n\n        // matrix for conversion from world space to screen coordinates in 2D\n        this._pixelMatrix = mat4.multiply(new Float64Array(16) as any, this.clipSpaceToPixelsMatrix, m);\n\n        // matrix for conversion from world space to clip space (-1 .. 1)\n        mat4.translate(m, m, [0, 0, -this.elevation]); // elevate camera over terrain\n        this._viewProjMatrix = m;\n        this._invViewProjMatrix = mat4.invert([] as any, m);\n\n        const cameraPos: vec4 = [0, 0, -1, 1];\n        vec4.transformMat4(cameraPos, cameraPos, this._invViewProjMatrix);\n        this._cameraPosition = [\n            cameraPos[0] / cameraPos[3],\n            cameraPos[1] / cameraPos[3],\n            cameraPos[2] / cameraPos[3]\n        ];\n\n        // create a fog matrix, same es proj-matrix but with near clipping-plane in mapcenter\n        // needed to calculate a correct z-value for fog calculation, because projMatrix z value is not\n        this._fogMatrix = new Float64Array(16) as any;\n        mat4.perspective(this._fogMatrix, this.fovInRadians, this.width / this.height, cameraToSeaLevelDistance, this._helper._farZ);\n        this._fogMatrix[8] = -offset.x * 2 / this.width;\n        this._fogMatrix[9] = offset.y * 2 / this.height;\n        mat4.scale(this._fogMatrix, this._fogMatrix, [1, -1, 1]);\n        mat4.translate(this._fogMatrix, this._fogMatrix, [0, 0, -this.cameraToCenterDistance]);\n        mat4.rotateZ(this._fogMatrix, this._fogMatrix, -this.rollInRadians);\n        mat4.rotateX(this._fogMatrix, this._fogMatrix, this.pitchInRadians);\n        mat4.rotateZ(this._fogMatrix, this._fogMatrix, -this.bearingInRadians);\n        mat4.translate(this._fogMatrix, this._fogMatrix, [-x, -y, 0]);\n        mat4.scale(this._fogMatrix, this._fogMatrix, [1, 1, this._helper._pixelPerMeter]);\n        mat4.translate(this._fogMatrix, this._fogMatrix, [0, 0, -this.elevation]); // elevate camera over terrain\n\n        // matrix for conversion from world space to screen coordinates in 3D\n        this._pixelMatrix3D = mat4.multiply(new Float64Array(16) as any, this.clipSpaceToPixelsMatrix, m);\n\n        // Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles.\n        // We're rounding the (floating point) x/y values to achieve to avoid rendering raster images to fractional\n        // coordinates. Additionally, we adjust by half a pixel in either direction in case that viewport dimension\n        // is an odd integer to preserve rendering to the pixel grid. We're rotating this shift based on the angle\n        // of the transformation so that 0Â°, 90Â°, 180Â°, and 270Â° rasters are crisp, and adjust the shift so that\n        // it is always <= 0.5 pixels.\n        const xShift = (this._helper._width % 2) / 2, yShift = (this._helper._height % 2) / 2,\n            angleCos = Math.cos(this.bearingInRadians), angleSin = Math.sin(-this.bearingInRadians),\n            dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift,\n            dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift;\n        const alignedM = new Float64Array(m) as any as mat4;\n        mat4.translate(alignedM, alignedM, [dx > 0.5 ? dx - 1 : dx, dy > 0.5 ? dy - 1 : dy, 0]);\n        this._alignedProjMatrix = alignedM;\n\n        // inverse matrix for conversion from screen coordinates to location\n        m = mat4.invert(new Float64Array(16) as any, this._pixelMatrix);\n        if (!m) throw new Error('failed to invert matrix');\n        this._pixelMatrixInverse = m;\n\n        this._clearMatrixCaches();\n    }\n\n    private _clearMatrixCaches(): void {\n        this._posMatrixCache.clear();\n        this._alignedPosMatrixCache.clear();\n        this._fogMatrixCacheF32.clear();\n    }\n\n    maxPitchScaleFactor(): number {\n        // calcMatrices hasn't run yet\n        if (!this._pixelMatrixInverse) return 1;\n\n        const coord = this.screenPointToMercatorCoordinate(new Point(0, 0));\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, 0, 1] as vec4;\n        const topPoint = vec4.transformMat4(p, p, this._pixelMatrix);\n        return topPoint[3] / this._helper.cameraToCenterDistance;\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        const pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n        const cameraToCenterDistanceMeters = this._helper.cameraToCenterDistance / pixelPerMeter;\n        const camMercator = cameraMercatorCoordinateFromCenterAndRotation(this.center, this.elevation, this.pitch, this.bearing, cameraToCenterDistanceMeters);\n        return camMercator.toLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number) {\n        const coord = MercatorCoordinate.fromLngLat(lngLat);\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, elevation, 1] as vec4;\n        vec4.transformMat4(p, p, this._viewProjMatrix);\n        return (p[2] / p[3]);\n    }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const {overscaledTileID, aligned, applyTerrainMatrix} = params;\n        const mercatorTileCoordinates = this._helper.getMercatorTileCoordinates(overscaledTileID);\n        const tilePosMatrix = overscaledTileID ? this.calculatePosMatrix(overscaledTileID, aligned, true) : null;\n        \n        let mainMatrix: mat4;\n        if (overscaledTileID && overscaledTileID.terrainRttPosMatrix32f && applyTerrainMatrix) {\n            mainMatrix = overscaledTileID.terrainRttPosMatrix32f;\n        } else if (tilePosMatrix) {\n            mainMatrix = tilePosMatrix; // This matrix should be float32\n        } else {\n            mainMatrix = createIdentityMat4f32();\n        }\n        return {\n            mainMatrix, // Might be set to a custom matrix by different projections.\n            tileMercatorCoords: mercatorTileCoordinates,\n            clippingPlane: [0, 0, 0, 0],\n            projectionTransition: 0.0, // Range 0..1, where 0 is mercator, 1 is another projection, mostly globe.\n            fallbackMatrix: mainMatrix,\n        };\n    }\n\n    isLocationOccluded(_: LngLat): boolean {\n        return false;\n    }\n\n    getPixelScale(): number {\n        return 1.0;\n    }\n\n    getCircleRadiusCorrection(): number {\n        return 1.0;\n    }\n\n    getPitchedTextCorrection(_textAnchorX: number, _textAnchorY: number, _tileID: UnwrappedTileID): number {\n        return 1.0;\n    }\n\n    transformLightDirection(dir: vec3): vec3 {\n        return vec3.clone(dir);\n    }\n\n    getRayDirectionFromPixel(_p: Point): vec3 {\n        throw new Error('Not implemented.'); // No need for this in mercator transform\n    }\n\n    projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        const matrix = this.calculatePosMatrix(unwrappedTileID);\n        let pos;\n        if (getElevation) { // slow because of handle z-index\n            pos = [x, y, getElevation(x, y), 1] as vec4;\n            vec4.transformMat4(pos, pos, matrix);\n        } else { // fast because of ignore z-index\n            pos = [x, y, 0, 1] as vec4;\n            xyTransformMat4(pos, pos, matrix);\n        }\n        const w = pos[3];\n        return {\n            point: new Point(pos[0] / w, pos[1] / w),\n            signedDistanceFromCamera: w,\n            isOccluded: false\n        };\n    }\n\n    populateCache(coords: Array<OverscaledTileID>): void {\n        for (const coord of coords) {\n            // Return value is thrown away, but this function will still\n            // place the pos matrix into the transform's internal cache.\n            this.calculatePosMatrix(coord);\n        }\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        const modelAsMercatorCoordinate = MercatorCoordinate.fromLngLat(\n            location,\n            altitude\n        );\n        const scale = modelAsMercatorCoordinate.meterInMercatorCoordinateUnits();\n\n        const m = createIdentityMat4f64();\n        mat4.translate(m, m, [modelAsMercatorCoordinate.x, modelAsMercatorCoordinate.y, modelAsMercatorCoordinate.z]);\n        mat4.rotateZ(m, m, Math.PI);\n        mat4.rotateX(m, m, Math.PI / 2);\n        mat4.scale(m, m, [-scale, scale, scale]);\n        return m;\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const tileID = new OverscaledTileID(0, 0, 0, 0, 0);\n        const projectionData = this.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix});\n\n        const tileMatrix = calculateTileMatrix(tileID, this.worldSize);\n        mat4.multiply(tileMatrix, this._viewProjMatrix, tileMatrix);\n\n        projectionData.tileMercatorCoords = [0, 0, 1, 1];\n\n        // Even though we requested projection data for the mercator base tile which covers the entire mercator range,\n        // the shader projection machinery still expects inputs to be in tile units range [0..EXTENT].\n        // Since custom layers are expected to supply mercator coordinates [0..1], we need to rescale\n        // both matrices by EXTENT. We also need to rescale Z.\n\n        const scale: vec3 = [EXTENT, EXTENT, this.worldSize / this._helper.pixelsPerMeter];\n\n        // We pass full-precision 64bit float matrices to custom layers to prevent precision loss in case the user wants to do further transformations.\n        // Otherwise we get very visible precision-artifacts and twitching for objects that are bulding-scale.\n        const projectionMatrixScaled = createMat4f64();\n        mat4.scale(projectionMatrixScaled, tileMatrix, scale);\n\n        projectionData.fallbackMatrix = projectionMatrixScaled;\n        projectionData.mainMatrix = projectionMatrixScaled;\n        return projectionData;\n    }\n\n    getFastPathSimpleProjectionMatrix(tileID: OverscaledTileID): mat4 {\n        return this.calculatePosMatrix(tileID);\n    }\n}\n","import Point from '@mapbox/point-geometry';\nimport {type IReadonlyTransform, type ITransform} from '../transform_interface';\nimport {type LngLat, type LngLatLike} from '../lng_lat';\nimport {type CameraForBoundsOptions, type PointLike} from '../../ui/camera';\nimport {type PaddingOptions} from '../edge_insets';\nimport {type LngLatBounds} from '../lng_lat_bounds';\nimport {degreesToRadians, getRollPitchBearing, type RollPitchBearing, rollPitchBearingToQuat, scaleZoom, warnOnce, zoomScale} from '../../util/util';\nimport {quat} from 'gl-matrix';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {projectToWorldCoordinates, unprojectFromWorldCoordinates} from './mercator_utils';\n\nexport type MapControlsDeltas = {\n    panDelta: Point;\n    zoomDelta: number;\n    bearingDelta: number;\n    pitchDelta: number;\n    rollDelta: number;\n    around: Point;\n};\n\nexport type CameraForBoxAndBearingHandlerResult = {\n    center: LngLat;\n    zoom: number;\n    bearing: number;\n};\n\nexport type EaseToHandlerOptions = {\n    bearing: number;\n    pitch: number;\n    roll: number;\n    padding: PaddingOptions;\n    offsetAsPoint: Point;\n    around?: LngLat;\n    aroundPoint?: Point;\n    center?: LngLatLike;\n    zoom?: number;\n    offset?: PointLike;\n};\n\nexport type EaseToHandlerResult = {\n    easeFunc: (k: number) => void;\n    elevationCenter: LngLat;\n    isZooming: boolean;\n};\n\nexport type FlyToHandlerOptions = {\n    bearing: number;\n    pitch: number;\n    roll: number;\n    padding: PaddingOptions;\n    offsetAsPoint: Point;\n    center?: LngLatLike;\n    locationAtOffset: LngLat;\n    zoom?: number;\n    minZoom?: number;\n};\n\nexport type FlyToHandlerResult = {\n    easeFunc: (k: number, scale: number, centerFactor: number, pointAtOffset: Point) => void;\n    scaleOfZoom: number;\n    scaleOfMinZoom?: number;\n    targetCenter: LngLat;\n    pixelPathLength: number;\n};\n\nexport type UpdateRotationArgs = {\n    /**\n     * The starting Euler angles.\n     */\n    startEulerAngles: RollPitchBearing;\n\n    /**\n     * The end Euler angles.\n     */\n    endEulerAngles: RollPitchBearing;\n\n    /**\n     * The transform to be updated\n     */\n    tr: ITransform;\n\n    /**\n     * The interpolation fraction, between 0 and 1.\n     */\n    k: number;\n\n    /**\n     * If true, use spherical linear interpolation. If false, use linear interpolation of Euler angles.\n     */\n    useSlerp: boolean;\n};\n\n/**\n * @internal\n */\nexport function cameraBoundsWarning() {\n    warnOnce(\n        'Map cannot fit within canvas with the given bounds, padding, and/or offset.'\n    );\n}\n\n/**\n * @internal\n * Contains projection-specific functions related to camera controls, easeTo, flyTo, inertia, etc.\n */\nexport interface ICameraHelper {\n    get useGlobeControls(): boolean;\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    };\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void;\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void;\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult;\n\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void;\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult;\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult;\n}\n\n/**\n * @internal\n * Set a transform's rotation to a value interpolated between startEulerAngles and endEulerAngles\n */\nexport function updateRotation(args: UpdateRotationArgs) {\n    if (args.useSlerp) {\n        // At pitch ==0, the Euler angle representation is ambiguous. In this case, set the Euler angles\n        // to the representation requested by the caller\n        if (args.k < 1) {\n            const startRotation = rollPitchBearingToQuat(args.startEulerAngles.roll, args.startEulerAngles.pitch, args.startEulerAngles.bearing);\n            const endRotation = rollPitchBearingToQuat(args.endEulerAngles.roll, args.endEulerAngles.pitch, args.endEulerAngles.bearing);\n            const rotation: quat = new Float64Array(4) as any;\n            quat.slerp(rotation, startRotation, endRotation, args.k);\n            const eulerAngles = getRollPitchBearing(rotation);\n            args.tr.setRoll(eulerAngles.roll);\n            args.tr.setPitch(eulerAngles.pitch);\n            args.tr.setBearing(eulerAngles.bearing);\n        } else {\n            args.tr.setRoll(args.endEulerAngles.roll);\n            args.tr.setPitch(args.endEulerAngles.pitch);\n            args.tr.setBearing(args.endEulerAngles.bearing);\n        }\n    } else {\n        args.tr.setRoll(interpolates.number(args.startEulerAngles.roll, args.endEulerAngles.roll, args.k));\n        args.tr.setPitch(interpolates.number(args.startEulerAngles.pitch, args.endEulerAngles.pitch, args.k));\n        args.tr.setBearing(interpolates.number(args.startEulerAngles.bearing, args.endEulerAngles.bearing, args.k));\n    }\n}\n\nexport function cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult {\n    const edgePadding = tr.padding;\n\n    // Consider all corners of the rotated bounding box derived from the given points\n    // when find the camera position that fits the given points.\n\n    const nwWorld = projectToWorldCoordinates(tr.worldSize, bounds.getNorthWest());\n    const neWorld = projectToWorldCoordinates(tr.worldSize, bounds.getNorthEast());\n    const seWorld = projectToWorldCoordinates(tr.worldSize, bounds.getSouthEast());\n    const swWorld = projectToWorldCoordinates(tr.worldSize, bounds.getSouthWest());\n\n    const bearingRadians = degreesToRadians(-bearing);\n\n    const nwRotatedWorld = nwWorld.rotate(bearingRadians);\n    const neRotatedWorld = neWorld.rotate(bearingRadians);\n    const seRotatedWorld = seWorld.rotate(bearingRadians);\n    const swRotatedWorld = swWorld.rotate(bearingRadians);\n\n    const upperRight = new Point(\n        Math.max(nwRotatedWorld.x, neRotatedWorld.x, swRotatedWorld.x, seRotatedWorld.x),\n        Math.max(nwRotatedWorld.y, neRotatedWorld.y, swRotatedWorld.y, seRotatedWorld.y)\n    );\n\n    const lowerLeft = new Point(\n        Math.min(nwRotatedWorld.x, neRotatedWorld.x, swRotatedWorld.x, seRotatedWorld.x),\n        Math.min(nwRotatedWorld.y, neRotatedWorld.y, swRotatedWorld.y, seRotatedWorld.y)\n    );\n\n    // Calculate zoom: consider the original bbox and padding.\n    const size = upperRight.sub(lowerLeft);\n\n    const availableWidth = (tr.width - (edgePadding.left + edgePadding.right + padding.left + padding.right));\n    const availableHeight = (tr.height - (edgePadding.top + edgePadding.bottom + padding.top + padding.bottom));\n    const scaleX = availableWidth / size.x;\n    const scaleY = availableHeight / size.y;\n\n    if (scaleY < 0 || scaleX < 0) {\n        cameraBoundsWarning();\n        return undefined;\n    }\n\n    const zoom = Math.min(scaleZoom(tr.scale * Math.min(scaleX, scaleY)), options.maxZoom);\n\n    // Calculate center: apply the zoom, the configured offset, as well as offset that exists as a result of padding.\n    const offset = Point.convert(options.offset);\n    const paddingOffsetX = (padding.left - padding.right) / 2;\n    const paddingOffsetY = (padding.top - padding.bottom) / 2;\n    const paddingOffset = new Point(paddingOffsetX, paddingOffsetY);\n    const rotatedPaddingOffset = paddingOffset.rotate(degreesToRadians(bearing));\n    const offsetAtInitialZoom = offset.add(rotatedPaddingOffset);\n    const offsetAtFinalZoom = offsetAtInitialZoom.mult(tr.scale / zoomScale(zoom));\n\n    const center = unprojectFromWorldCoordinates(\n        tr.worldSize,\n        // either world diagonal can be used (NW-SE or NE-SW)\n        nwWorld.add(seWorld).div(2).sub(offsetAtFinalZoom)\n    );\n\n    const result = {\n        center,\n        zoom,\n        bearing\n    };\n\n    return result;\n}","import type Point from '@mapbox/point-geometry';\nimport {LngLat, type LngLatLike} from '../lng_lat';\nimport {cameraForBoxAndBearing, type CameraForBoxAndBearingHandlerResult, type EaseToHandlerResult, type EaseToHandlerOptions, type FlyToHandlerResult, type FlyToHandlerOptions, type ICameraHelper, type MapControlsDeltas, updateRotation, type UpdateRotationArgs} from './camera_helper';\nimport {normalizeCenter} from '../transform_helper';\nimport {rollPitchBearingEqual, scaleZoom, zoomScale} from '../../util/util';\nimport {getMercatorHorizon, projectToWorldCoordinates, unprojectFromWorldCoordinates} from './mercator_utils';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {LngLatBounds} from '../lng_lat_bounds';\n\n/**\n * @internal\n */\nexport class MercatorCameraHelper implements ICameraHelper {\n    get useGlobeControls(): boolean { return false; }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        // Reduce the offset so that it never goes past the horizon. If it goes past\n        // the horizon, the pan direction is opposite of the intended direction.\n        const offsetLength = pan.mag();\n        const pixelsToHorizon = Math.abs(getMercatorHorizon(transform));\n        const horizonFactor = 0.75; // Must be < 1 to prevent the offset from crossing the horizon\n        const offsetAsPoint = pan.mult(Math.min(pixelsToHorizon * horizonFactor / offsetLength, 1.0));\n        return {\n            easingOffset: offsetAsPoint,\n            easingCenter: transform.center,\n        };\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        if (deltas.bearingDelta) tr.setBearing(tr.bearing + deltas.bearingDelta);\n        if (deltas.pitchDelta) tr.setPitch(tr.pitch + deltas.pitchDelta);\n        if (deltas.rollDelta) tr.setRoll(tr.roll + deltas.rollDelta);\n        if (deltas.zoomDelta) tr.setZoom(tr.zoom + deltas.zoomDelta);\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void {\n        // If we are rotating about the center point, there is no need to update the transform center. Doing so causes\n        // a small amount of drift of the center point, especially when pitch is close to 90 degrees.\n        // In this case, return early.\n        if (deltas.around.distSqr(tr.centerPoint) < 1.0e-2) {\n            return;\n        }\n        tr.setLocationAtPoint(preZoomAroundLoc, deltas.around);\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: IReadonlyTransform): CameraForBoxAndBearingHandlerResult {\n        return cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n    }\n\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        // Mercator zoom & center handling.\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const zoom = optionsZoom ? +options.zoom : tr.zoom;\n        if (tr.zoom !== zoom) {\n            tr.setZoom(+options.zoom);\n        }\n\n        if (options.center !== undefined) {\n            tr.setCenter(LngLat.convert(options.center));\n        }\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        const startZoom = tr.zoom;\n        const startPadding = tr.padding;\n        const startEulerAngles = {roll: tr.roll, pitch: tr.pitch, bearing: tr.bearing};\n        const endRoll = options.roll === undefined ? tr.roll : options.roll;\n        const endPitch = options.pitch === undefined ? tr.pitch : options.pitch;\n        const endBearing = options.bearing === undefined ? tr.bearing : options.bearing;\n        const endEulerAngles = {roll: endRoll, pitch: endPitch, bearing: endBearing};\n\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        let isZooming = false;\n\n        const zoom = optionsZoom ? +options.zoom : tr.zoom;\n\n        let pointAtOffset = tr.centerPoint.add(options.offsetAsPoint);\n        const locationAtOffset = tr.screenPointToLocation(pointAtOffset);\n        const {center, zoom: endZoom} = tr.applyConstrain(\n            LngLat.convert(options.center || locationAtOffset),\n            zoom ?? startZoom\n        );\n        normalizeCenter(tr, center);\n\n        const from = projectToWorldCoordinates(tr.worldSize, locationAtOffset);\n        const delta = projectToWorldCoordinates(tr.worldSize, center).sub(from);\n\n        const finalScale = zoomScale(endZoom - startZoom);\n        isZooming = (endZoom !== startZoom);\n\n        const easeFunc = (k: number) => {\n            if (isZooming) {\n                tr.setZoom(interpolates.number(startZoom, endZoom, k));\n            }\n            if (!rollPitchBearingEqual(startEulerAngles, endEulerAngles)) {\n                updateRotation({\n                    startEulerAngles,\n                    endEulerAngles,\n                    tr,\n                    k,\n                    useSlerp: startEulerAngles.roll != endEulerAngles.roll} as UpdateRotationArgs);\n            }\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding, k);\n                // When padding is being applied, Transform.centerPoint is changing continuously,\n                // thus we need to recalculate offsetPoint every frame\n                pointAtOffset = tr.centerPoint.add(options.offsetAsPoint);\n            }\n\n            if (options.around) {\n                tr.setLocationAtPoint(options.around, options.aroundPoint);\n            } else {\n                const scale = zoomScale(tr.zoom - startZoom);\n                const base = endZoom > startZoom ?\n                    Math.min(2, finalScale) :\n                    Math.max(0.5, finalScale);\n                const speedup = Math.pow(base, 1 - k);\n                const newCenter = unprojectFromWorldCoordinates(tr.worldSize, from.add(delta.mult(k * speedup)).mult(scale));\n                tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n            }\n        };\n\n        return {\n            easeFunc,\n            isZooming,\n            elevationCenter: center,\n        };\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const startZoom = tr.zoom;\n\n        // Obtain target center and zoom\n        const constrained = tr.applyConstrain(\n            LngLat.convert(options.center || options.locationAtOffset),\n            optionsZoom ? +options.zoom : startZoom\n        );\n        const targetCenter = constrained.center;\n        const targetZoom = constrained.zoom;\n\n        normalizeCenter(tr, targetCenter);\n\n        const from = projectToWorldCoordinates(tr.worldSize, options.locationAtOffset);\n        const delta = projectToWorldCoordinates(tr.worldSize, targetCenter).sub(from);\n\n        const pixelPathLength = delta.mag();\n\n        const scaleOfZoom = zoomScale(targetZoom - startZoom);\n\n        const optionsMinZoom = typeof options.minZoom !== 'undefined';\n\n        let scaleOfMinZoom: number;\n\n        if (optionsMinZoom) {\n            const minZoomPreConstrain = Math.min(+options.minZoom, startZoom, targetZoom);\n            const minZoom = tr.applyConstrain(targetCenter, minZoomPreConstrain).zoom;\n            scaleOfMinZoom = zoomScale(minZoom - startZoom);\n        }\n\n        const easeFunc = (k: number, scale: number, centerFactor: number, pointAtOffset: Point) => {\n            tr.setZoom(k === 1 ? targetZoom : startZoom + scaleZoom(scale));\n            const newCenter = k === 1 ? targetCenter : unprojectFromWorldCoordinates(tr.worldSize, from.add(delta.mult(centerFactor)).mult(scale));\n            tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n        };\n\n        return {\n            easeFunc,\n            scaleOfZoom,\n            targetCenter,\n            scaleOfMinZoom,\n            pixelPathLength,\n        };\n    }\n}\n","import {Color} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {BlendFuncType, ColorMaskType} from './types';\n\nconst ZERO = 0x0000;\nconst ONE = 0x0001;\nconst ONE_MINUS_SRC_ALPHA = 0x0303;\n\nexport class ColorMode {\n    blendFunction: BlendFuncType;\n    blendColor: Color;\n    mask: ColorMaskType;\n\n    constructor(blendFunction: BlendFuncType, blendColor: Color, mask: ColorMaskType) {\n        this.blendFunction = blendFunction;\n        this.blendColor = blendColor;\n        this.mask = mask;\n    }\n\n    static Replace: BlendFuncType;\n\n    static disabled: Readonly<ColorMode>;\n    static unblended: Readonly<ColorMode>;\n    static alphaBlended: Readonly<ColorMode>;\n}\n\nColorMode.Replace = [ONE, ZERO];\n\nColorMode.disabled = new ColorMode(ColorMode.Replace, Color.transparent, [false, false, false, false]);\nColorMode.unblended = new ColorMode(ColorMode.Replace, Color.transparent, [true, true, true, true]);\nColorMode.alphaBlended = new ColorMode([ONE, ONE_MINUS_SRC_ALPHA], Color.transparent, [true, true, true, true]);\n","import type {CullFaceModeType, FrontFaceType} from './types';\n\nconst FRONT = 0x0404;\nconst BACK = 0x0405;\nconst CCW = 0x0901;\n\nexport class CullFaceMode {\n    enable: boolean;\n    mode: CullFaceModeType;\n    frontFace: FrontFaceType;\n\n    constructor(enable: boolean, mode: CullFaceModeType, frontFace: FrontFaceType) {\n        this.enable = enable;\n        this.mode = mode;\n        this.frontFace = frontFace;\n    }\n\n    static disabled: Readonly<CullFaceMode>;\n\n    /**\n     * The standard GL cull mode. Culls backfacing triangles when counterclockwise vertex order is used.\n     * Use for 3D geometry such as terrain.\n     */\n    static backCCW: Readonly<CullFaceMode>;\n\n    /**\n     * Opposite of {@link backCCW}. Culls front-facing triangles when counterclockwise vertex order is used.\n     */\n    static frontCCW: Readonly<CullFaceMode>;\n}\n\nCullFaceMode.disabled = new CullFaceMode(false, BACK, CCW);\nCullFaceMode.backCCW = new CullFaceMode(true, BACK, CCW);\nCullFaceMode.frontCCW = new CullFaceMode(true, FRONT, CCW);\n","import type {DepthFuncType, DepthMaskType, DepthRangeType} from './types';\n\nconst ALWAYS = 0x0207;\n\nexport class DepthMode {\n    func: DepthFuncType;\n    mask: DepthMaskType;\n    range: DepthRangeType;\n\n    // DepthMask enums\n    static ReadOnly: boolean;\n    static ReadWrite: boolean;\n\n    constructor(depthFunc: DepthFuncType, depthMask: DepthMaskType, depthRange: DepthRangeType) {\n        this.func = depthFunc;\n        this.mask = depthMask;\n        this.range = depthRange;\n    }\n\n    static disabled: Readonly<DepthMode>;\n}\n\nDepthMode.ReadOnly = false;\nDepthMode.ReadWrite = true;\n\nDepthMode.disabled = new DepthMode(ALWAYS, DepthMode.ReadOnly, [0, 1]);\n","import type {StencilOpConstant, StencilTestGL} from './types';\n\nconst ALWAYS = 0x0207;\nconst KEEP = 0x1E00;\n\nexport class StencilMode {\n    test: StencilTestGL;\n    ref: number;\n    mask: number;\n    fail: StencilOpConstant;\n    depthFail: StencilOpConstant;\n    pass: StencilOpConstant;\n\n    constructor(test: StencilTestGL, ref: number, mask: number, fail: StencilOpConstant,\n        depthFail: StencilOpConstant, pass: StencilOpConstant) {\n        this.test = test;\n        this.ref = ref;\n        this.mask = mask;\n        this.fail = fail;\n        this.depthFail = depthFail;\n        this.pass = pass;\n    }\n\n    static disabled: Readonly<StencilMode>;\n}\n\nStencilMode.disabled = new StencilMode({func: ALWAYS, mask: 0}, 0, 0, KEEP, KEEP, KEEP);\n","import {Uniform1f} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../../render/uniform_binding';\n\nexport type ProjectionErrorMeasurementUniformsType = {\n    'u_input': Uniform1f;\n    'u_output_expected': Uniform1f;\n};\n\nconst projectionErrorMeasurementUniforms = (context: Context, locations: UniformLocations): ProjectionErrorMeasurementUniformsType => ({\n    'u_input': new Uniform1f(context, locations.u_input),\n    'u_output_expected': new Uniform1f(context, locations.u_output_expected),\n});\n\nconst projectionErrorMeasurementUniformValues = (\n    input: number,\n    outputExpected: number\n): UniformValues<ProjectionErrorMeasurementUniformsType> => ({\n    'u_input': input,\n    'u_output_expected': outputExpected,\n});\n\nexport {projectionErrorMeasurementUniforms, projectionErrorMeasurementUniformValues};\n","const cache = new WeakMap();\nexport function isWebGL2(\n    gl: WebGLRenderingContext | WebGL2RenderingContext\n): gl is WebGL2RenderingContext {\n    if (cache.has(gl)) {\n        return cache.get(gl);\n    } else {\n        const value = gl.getParameter(gl.VERSION)?.startsWith('WebGL 2.0');\n        cache.set(gl, value);\n        return value;\n    }\n}\n","import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../../gl/color_mode';\nimport {CullFaceMode} from '../../gl/cull_face_mode';\nimport {DepthMode} from '../../gl/depth_mode';\nimport {StencilMode} from '../../gl/stencil_mode';\nimport {warnOnce} from '../../util/util';\nimport {projectionErrorMeasurementUniformValues} from '../../render/program/projection_error_measurement_program';\nimport {Mesh} from '../../render/mesh';\nimport {SegmentVector} from '../../data/segment';\nimport {PosArray, TriangleIndexArray} from '../../data/array_types.g';\nimport posAttributes from '../../data/pos_attributes';\nimport {type Framebuffer} from '../../gl/framebuffer';\nimport {isWebGL2} from '../../gl/webgl2';\nimport {type ProjectionGPUContext} from './projection';\n\n/**\n * For vector globe the vertex shader projects mercator coordinates to angular coordinates on a sphere.\n * This projection requires some inverse trigonometry `atan(exp(...))`, which is inaccurate on some GPUs (mainly on AMD and Nvidia).\n * The inaccuracy is severe enough to require a workaround. The uncorrected map is shifted north-south by up to several hundred meters in some latitudes.\n * Since the inaccuracy is hardware-dependant and may change in the future, we need to measure the error at runtime.\n *\n * Our approach relies on several assumptions:\n *\n * - the error is only present in the \"latitude\" component (longitude doesn't need any inverse trigonometry)\n * - the error is continuous and changes slowly with latitude\n * - at zoom levels where the error is noticeable, the error is more-or-less the same across the entire visible map area (and thus can be described with a single number)\n *\n * Solution:\n *\n * Every few frames, launch a GPU shader that measures the error for the current map center latitude, and writes it to a 1x1 texture.\n * Read back that texture, and offset the globe projection matrix according to the error (interpolating smoothly from old error to new error if needed).\n * The texture readback is done asynchronously using Pixel Pack Buffers (WebGL2) when possible, and has a few frames of latency, but that should not be a problem.\n *\n * General operation of this class each frame is:\n *\n * - render the error shader into a fbo, read that pixel into a PBO, place a fence\n * - wait a few frames to allow the GPU (and driver) to actually execute the shader\n * - wait for the fence to be signalled (guaranteeing the shader to actually be executed)\n * - read back the PBO's contents\n * - wait a few more frames\n * - repeat\n */\nexport class ProjectionErrorMeasurement {\n    // We wait at least this many frames after measuring until we read back the value.\n    // After this period, we might wait more frames until a fence is signalled to make sure the rendering is completed.\n    private readonly _readbackWaitFrames = 4;\n    // We wait this many frames after *reading back* a measurement until we trigger measure again.\n    // We could in theory render the measurement pixel immediately, but we wait to make sure\n    // no pipeline stall happens.\n    private readonly _measureWaitFrames = 6;\n    private readonly _texWidth = 1;\n    private readonly _texHeight = 1;\n    private readonly _texFormat: number;\n    private readonly _texType: number;\n\n    private _fullscreenTriangle: Mesh;\n    private _fbo: Framebuffer;\n    private _resultBuffer: Uint8Array;\n    private _pbo: WebGLBuffer;\n    private _cachedRenderContext: ProjectionGPUContext;\n\n    private _measuredError: number = 0; // Result of last measurement\n    private _updateCount: number = 0;\n    private _lastReadbackFrame: number = -1000;\n\n    get awaitingQuery(): boolean {\n        return !!this._readbackQueue;\n    }\n\n    // There is never more than one readback waiting\n    private _readbackQueue: {\n        frameNumberIssued: number; // Frame number when the data was first computed\n        sync: WebGLSync;\n    } = null;\n\n    public constructor(renderContext: ProjectionGPUContext) {\n        this._cachedRenderContext = renderContext;\n\n        const context = renderContext.context;\n        const gl = context.gl;\n\n        this._texFormat = gl.RGBA;\n        this._texType = gl.UNSIGNED_BYTE;\n\n        const vertexArray = new PosArray();\n        vertexArray.emplaceBack(-1, -1);\n        vertexArray.emplaceBack(2, -1);\n        vertexArray.emplaceBack(-1, 2);\n        const indexArray = new TriangleIndexArray();\n        indexArray.emplaceBack(0, 1, 2);\n\n        this._fullscreenTriangle = new Mesh(\n            context.createVertexBuffer(vertexArray, posAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n\n        this._resultBuffer = new Uint8Array(4);\n\n        context.activeTexture.set(gl.TEXTURE1);\n\n        const texture = gl.createTexture();\n        gl.bindTexture(gl.TEXTURE_2D, texture);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n        gl.texImage2D(gl.TEXTURE_2D, 0, this._texFormat, this._texWidth, this._texHeight, 0, this._texFormat, this._texType, null);\n\n        this._fbo = context.createFramebuffer(this._texWidth, this._texHeight, false, false);\n        this._fbo.colorAttachment.set(texture);\n\n        if (isWebGL2(gl)) {\n            this._pbo = gl.createBuffer();\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.bufferData(gl.PIXEL_PACK_BUFFER, 4, gl.STREAM_READ);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n        }\n    }\n\n    public destroy() {\n        const gl = this._cachedRenderContext.context.gl;\n        this._fullscreenTriangle.destroy();\n        this._fbo.destroy();\n        gl.deleteBuffer(this._pbo);\n        this._fullscreenTriangle = null;\n        this._fbo = null;\n        this._pbo = null;\n        this._resultBuffer = null;\n    }\n\n    public updateErrorLoop(normalizedMercatorY: number, expectedAngleY: number): number {\n        const currentFrame = this._updateCount;\n\n        if (this._readbackQueue) {\n            // Try to read back if enough frames elapsed. Otherwise do nothing, just wait another frame.\n            if (currentFrame >= this._readbackQueue.frameNumberIssued + this._readbackWaitFrames) {\n                // Try to read back - it is possible that this method does nothing, then\n                // the readback queue will not be cleared and we will retry next frame.\n                this._tryReadback();\n            }\n        } else {\n            if (currentFrame >= this._lastReadbackFrame + this._measureWaitFrames) {\n                this._renderErrorTexture(normalizedMercatorY, expectedAngleY);\n            }\n        }\n\n        this._updateCount++;\n        return this._measuredError;\n    }\n\n    private _bindFramebuffer() {\n        const context = this._cachedRenderContext.context;\n        const gl = context.gl;\n        context.activeTexture.set(gl.TEXTURE1);\n        gl.bindTexture(gl.TEXTURE_2D, this._fbo.colorAttachment.get());\n        context.bindFramebuffer.set(this._fbo.framebuffer);\n    }\n\n    private _renderErrorTexture(input: number, outputExpected: number): void {\n        const context = this._cachedRenderContext.context;\n        const gl = context.gl;\n\n        // Update framebuffer contents\n        this._bindFramebuffer();\n        context.viewport.set([0, 0, this._texWidth, this._texHeight]);\n        context.clear({color: Color.transparent});\n\n        const program = this._cachedRenderContext.useProgram('projectionErrorMeasurement');\n\n        program.draw(context, gl.TRIANGLES,\n            DepthMode.disabled, StencilMode.disabled,\n            ColorMode.unblended, CullFaceMode.disabled,\n            projectionErrorMeasurementUniformValues(input, outputExpected), null, null,\n            '$clipping', this._fullscreenTriangle.vertexBuffer, this._fullscreenTriangle.indexBuffer,\n            this._fullscreenTriangle.segments);\n\n        if (this._pbo && isWebGL2(gl)) {\n            // Read back into PBO\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.readBuffer(gl.COLOR_ATTACHMENT0);\n            gl.readPixels(0, 0, this._texWidth, this._texHeight, this._texFormat, this._texType, 0);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n            const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\n            gl.flush();\n\n            this._readbackQueue = {\n                frameNumberIssued: this._updateCount,\n                sync,\n            };\n        } else {\n            // Read it back later.\n            this._readbackQueue = {\n                frameNumberIssued: this._updateCount,\n                sync: null,\n            };\n        }\n    }\n\n    private _tryReadback(): void {\n        const gl = this._cachedRenderContext.context.gl;\n\n        if (this._pbo && this._readbackQueue && isWebGL2(gl)) {\n            // WebGL 2 path\n            const waitResult = gl.clientWaitSync(this._readbackQueue.sync, 0, 0);\n\n            if (waitResult === gl.WAIT_FAILED) {\n                warnOnce('WebGL2 clientWaitSync failed.');\n                this._readbackQueue = null;\n                this._lastReadbackFrame = this._updateCount;\n                return;\n            }\n\n            if (waitResult === gl.TIMEOUT_EXPIRED) {\n                return; // Wait one more frame\n            }\n\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, this._pbo);\n            gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, this._resultBuffer, 0, 4);\n            gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n        } else {\n            // WebGL1 compatible\n            this._bindFramebuffer();\n            gl.readPixels(0, 0, this._texWidth, this._texHeight, this._texFormat, this._texType, this._resultBuffer);\n        }\n\n        // If we made it here, _resultBuffer contains the new measurement\n        this._readbackQueue = null;\n        this._measuredError = ProjectionErrorMeasurement._parseRGBA8float(this._resultBuffer);\n        this._lastReadbackFrame = this._updateCount;\n    }\n\n    private static _parseRGBA8float(buffer: Uint8Array): number {\n        let result = 0;\n        result += buffer[0] / 256.0;\n        result += buffer[1] / 65536.0;\n        result += buffer[2] / 16777216.0;\n        if (buffer[3] < 127.0) {\n            result = -result;\n        }\n        return result / 128.0;\n    }\n}\n","import {type Context} from '../gl/context';\nimport {Mesh} from '../render/mesh';\nimport {PosArray, TriangleIndexArray} from '../data/array_types.g';\nimport {SegmentVector} from '../data/segment';\nimport {NORTH_POLE_Y, SOUTH_POLE_Y} from '../render/subdivision';\nimport {EXTENT} from '../data/extent';\nimport posAttributes from '../data/pos_attributes';\n\n/**\n * The size of border region for stencil masks, in internal tile coordinates.\n * Used for globe rendering.\n */\nconst EXTENT_STENCIL_BORDER = EXTENT / 128;\n\n/**\n * Options for generating a tile mesh.\n * Can optionally configure any of the following:\n * - mesh subdivision granularity\n * - border presence\n * - special geometry for the north and/or south pole\n */\nexport type CreateTileMeshOptions = {\n    /**\n     * Specifies how much should the tile mesh be subdivided.\n     * A value of 1 leads to a simple quad, a value of 4 will result in a grid of 4x4 quads.\n     */\n    granularity?: number;\n    /**\n     * When true, an additional ring of quads is generated along the border, always extending `EXTENT_STENCIL_BORDER` units away from the main mesh.\n     */\n    generateBorders?: boolean;\n    /**\n     * When true, additional geometry is generated along the north edge of the mesh, connecting it to the pole special vertex position.\n     * This geometry replaces the mesh border along this edge, if one is present.\n     */\n    extendToNorthPole?: boolean;\n    /**\n     * When true, additional geometry is generated along the south edge of the mesh, connecting it to the pole special vertex position.\n     * This geometry replaces the mesh border along this edge, if one is present.\n     */\n    extendToSouthPole?: boolean;\n};\n\n/**\n * Stores the prepared vertex and index buffer bytes for a mesh.\n */\nexport type TileMesh = {\n    /**\n     * The vertex data. Each vertex is two 16 bit signed integers, one for X, one for Y.\n     */\n    vertices: ArrayBuffer;\n    /**\n     * The index data. Each triangle is defined by three indices. The indices may either be 16 bit or 32 bit unsigned integers,\n     * depending on the mesh creation arguments and on whether the mesh can fit into 16 bit indices.\n     */\n    indices: ArrayBuffer;\n    /**\n     * A helper boolean indicating whether the indices are 32 bit.\n     */\n    uses32bitIndices: boolean;\n};\n\n/**\n * Describes desired type of vertex indices, either 16 bit uint, 32 bit uint, or, if undefined, any of the two options.\n */\nexport type IndicesType = '32bit' | '16bit' | undefined;\n\n/**\n * @internal\n * Creates a mesh of a quad that covers the entire tile (covering positions in range 0..EXTENT),\n * is optionally subdivided into finer quads, optionally includes a border\n * and optionally extends to the north and/or special pole vertices.\n * Also allocates and populates WebGL buffers for the mesh.\n * Forces 16 bit indices that are used throughout MapLibre.\n * @param context - The WebGL context wrapper.\n * @param options - Specify options for tile mesh creation such as granularity or border.\n * @returns The mesh vertices and indices, already allocated and uploaded into WebGL buffers.\n */\nexport function createTileMeshWithBuffers(context: Context, options: CreateTileMeshOptions): Mesh {\n    const tileMesh = createTileMesh(options, '16bit');\n    const vertices = PosArray.deserialize({\n        arrayBuffer: tileMesh.vertices,\n        length: tileMesh.vertices.byteLength / 2 / 2, // Two values per vertex, 16 bit\n    });\n    const indices = TriangleIndexArray.deserialize({\n        arrayBuffer: tileMesh.indices,\n        length: tileMesh.indices.byteLength / 2 / 3, // Three values per triangle, 16 bit\n    });\n    const mesh = new Mesh(\n        context.createVertexBuffer(vertices, posAttributes.members),\n        context.createIndexBuffer(indices),\n        SegmentVector.simpleSegment(0, 0, vertices.length, indices.length)\n    );\n\n    return mesh;\n}\n\n/**\n * Creates a mesh of a quad that covers the entire tile (covering positions in range 0..EXTENT),\n * is optionally subdivided into finer quads, optionally includes a border\n * and optionally extends to the north and/or special pole vertices.\n * Additionally the resulting mesh indices type can be specified using `forceIndicesSize`.\n * @example\n * ```\n * // Creating a mesh for a tile that can be used for raster layers, hillshade, etc.\n * const meshBuffers = createTileMesh({\n *     granularity: map.style.projection.subdivisionGranularity.tile.getGranularityForZoomLevel(tileID.z),\n *     generateBorders: true,\n *     extendToNorthPole: tileID.y === 0,\n *     extendToSouthPole: tileID.y === (1 << tileID.z) - 1,\n * }, '16bit');\n * ```\n * @param options - Specify options for tile mesh creation such as granularity or border.\n * @param forceIndicesSize - Specifies what indices type to use. The values '32bit' and '16bit' force their respective indices size. If undefined, the mesh may use either size, and will pick 16 bit indices if possible. If '16bit' is specified and the mesh exceeds 65536 vertices, an exception is thrown.\n * @returns Typed arrays of the mesh vertices and indices.\n */\nexport function createTileMesh(options: CreateTileMeshOptions, forceIndicesSize?: IndicesType): TileMesh {\n    // We only want to generate the north/south border if the tile\n    // does NOT border the north/south edge of the mercator range.\n    const granularity = options.granularity !== undefined ? Math.max(options.granularity, 1) : 1;\n\n    const quadsPerAxisX = granularity + (options.generateBorders ? 2 : 0); // two extra quads for border\n    const quadsPerAxisY = granularity + ((options.extendToNorthPole || options.generateBorders) ? 1 : 0) + (options.extendToSouthPole || options.generateBorders ? 1 : 0);\n    const verticesPerAxisX = quadsPerAxisX + 1; // one more vertex than quads\n    const verticesPerAxisY = quadsPerAxisY + 1; // one more vertex than quads\n    const offsetX = options.generateBorders ? -1 : 0;\n    const offsetY = (options.generateBorders || options.extendToNorthPole) ? -1 : 0;\n    const endX = granularity + (options.generateBorders ? 1 : 0);\n    const endY = granularity + ((options.generateBorders || options.extendToSouthPole) ? 1 : 0);\n\n    const vertexCount = verticesPerAxisX * verticesPerAxisY;\n    const indexCount = quadsPerAxisX * quadsPerAxisY * 6;\n\n    const overflows16bitIndices = verticesPerAxisX * verticesPerAxisY > (1 << 16);\n\n    if (overflows16bitIndices && forceIndicesSize === '16bit') {\n        throw new Error('Granularity is too large and meshes would not fit inside 16 bit vertex indices.');\n    }\n\n    const use32bitIndices = overflows16bitIndices || forceIndicesSize === '32bit';\n\n    const vertices = new Int16Array(vertexCount * 2);\n\n    let vertexId = 0;\n\n    for (let y = offsetY; y <= endY; y++) {\n        for (let x = offsetX; x <= endX; x++) {\n            let vx = x / granularity * EXTENT;\n            if (x === -1) {\n                vx = -EXTENT_STENCIL_BORDER;\n            }\n            if (x === granularity + 1) {\n                vx = EXTENT + EXTENT_STENCIL_BORDER;\n            }\n            let vy = y / granularity * EXTENT;\n            if (y === -1) {\n                vy = options.extendToNorthPole ? NORTH_POLE_Y : (-EXTENT_STENCIL_BORDER);\n            }\n            if (y === granularity + 1) {\n                vy = options.extendToSouthPole ? SOUTH_POLE_Y : EXTENT + EXTENT_STENCIL_BORDER;\n            }\n\n            vertices[vertexId++] = vx;\n            vertices[vertexId++] = vy;\n        }\n    }\n\n    const indices = use32bitIndices ? new Uint32Array(indexCount) : new Uint16Array(indexCount);\n\n    let indexId = 0;\n\n    for (let y = 0; y < quadsPerAxisY; y++) {\n        for (let x = 0; x < quadsPerAxisX; x++) {\n            const v0 = x + y * verticesPerAxisX;\n            const v1 = (x + 1) + y * verticesPerAxisX;\n            const v2 = x + (y + 1) * verticesPerAxisX;\n            const v3 = (x + 1) + (y + 1) * verticesPerAxisX;\n\n            // v0----v1\n            //  |  / |\n            //  | /  |\n            // v2----v3\n            indices[indexId++] = v0;\n            indices[indexId++] = v2;\n            indices[indexId++] = v1;\n\n            indices[indexId++] = v1;\n            indices[indexId++] = v2;\n            indices[indexId++] = v3;\n        }\n    }\n\n    return {\n        vertices: vertices.buffer.slice(0),\n        indices: indices.buffer.slice(0),\n        uses32bitIndices: use32bitIndices,\n    };\n}","import type {Context} from '../../gl/context';\nimport type {CanonicalTileID} from '../../tile/tile_id';\nimport {type Mesh} from '../../render/mesh';\nimport {now} from '../../util/time_control';\nimport {easeCubicInOut, lerp} from '../../util/util';\nimport {mercatorYfromLat} from '../mercator_coordinate';\nimport {SubdivisionGranularityExpression, SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport type {Projection, ProjectionGPUContext, TileMeshUsage} from './projection';\nimport {type PreparedShader, shaders} from '../../shaders/shaders';\nimport {ProjectionErrorMeasurement} from './globe_projection_error_measurement';\nimport {createTileMeshWithBuffers, type CreateTileMeshOptions} from '../../util/create_tile_mesh';\nimport {type EvaluationParameters} from '../../style/evaluation_parameters';\n\nexport const VerticalPerspectiveShaderDefine = '#define GLOBE';\nexport const VerticalPerspectiveShaderVariantKey = 'globe';\n\nexport const globeConstants = {\n    errorTransitionTimeSeconds: 0.5\n};\n\nconst granularitySettingsGlobe: SubdivisionGranularitySetting = new SubdivisionGranularitySetting({\n    fill: new SubdivisionGranularityExpression(128, 2),\n    line: new SubdivisionGranularityExpression(512, 0),\n    // Always keep at least some subdivision on raster tiles, etc,\n    // otherwise they will be visibly warped at high zooms (before mercator transition).\n    // This si not needed on fill, because fill geometry tends to already be\n    // highly tessellated and granular at high zooms.\n    tile: new SubdivisionGranularityExpression(128, 32),\n    // Stencil granularity must never be higher than fill granularity,\n    // otherwise we would get seams in the oceans at zoom levels where\n    // stencil has higher granularity than fill.\n    stencil: new SubdivisionGranularityExpression(128, 1),\n    circle: 3\n});\n\nexport class VerticalPerspectiveProjection implements Projection {\n    private _tileMeshCache: {[_: string]: Mesh} = {};\n\n    // GPU atan() error correction\n    private _errorMeasurement: ProjectionErrorMeasurement;\n    private _errorQueryLatitudeDegrees: number;\n    private _errorCorrectionUsable: number = 0.0;\n    private _errorMeasurementLastValue: number = 0.0;\n    private _errorCorrectionPreviousValue: number = 0.0;\n    private _errorMeasurementLastChangeTime: number = -1000.0;\n\n    get name(): 'vertical-perspective' {\n        return 'vertical-perspective';\n    }\n\n    get transitionState(): number {\n        return 1;\n    }\n\n    get useSubdivision(): boolean {\n        return true;\n    }\n\n    get shaderVariantName(): string {\n        return VerticalPerspectiveShaderVariantKey;\n    }\n\n    get shaderDefine(): string {\n        return VerticalPerspectiveShaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return shaders.projectionGlobe;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return shaders.projectionMercator.vertexSource;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return granularitySettingsGlobe;\n    }\n\n    get useGlobeControls(): boolean {\n        return true;\n    }\n\n    /**\n     * @internal\n     * Globe projection periodically measures the error of the GPU's\n     * projection from mercator to globe and computes how much to correct\n     * the globe's latitude alignment.\n     * This stores the correction that should be applied to the projection matrix.\n     */\n    get latitudeErrorCorrectionRadians(): number { return this._errorCorrectionUsable; }\n\n    public destroy() {\n        if (this._errorMeasurement) {\n            this._errorMeasurement.destroy();\n        }\n    }\n\n    public updateGPUdependent(renderContext: ProjectionGPUContext): void {\n        if (!this._errorMeasurement) {\n            this._errorMeasurement = new ProjectionErrorMeasurement(renderContext);\n        }\n        const mercatorY = mercatorYfromLat(this._errorQueryLatitudeDegrees);\n        const expectedResult = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n        const newValue = this._errorMeasurement.updateErrorLoop(mercatorY, expectedResult);\n\n        const currentTime = now();\n\n        if (newValue !== this._errorMeasurementLastValue) {\n            this._errorCorrectionPreviousValue = this._errorCorrectionUsable; // store the interpolated value\n            this._errorMeasurementLastValue = newValue;\n            this._errorMeasurementLastChangeTime = currentTime;\n        }\n\n        const sinceUpdateSeconds = (currentTime - this._errorMeasurementLastChangeTime) / 1000.0;\n        const mix = Math.min(Math.max(sinceUpdateSeconds / globeConstants.errorTransitionTimeSeconds, 0.0), 1.0);\n        const newCorrection = -this._errorMeasurementLastValue; // Note the negation\n        this._errorCorrectionUsable = lerp(this._errorCorrectionPreviousValue, newCorrection, easeCubicInOut(mix));\n    }\n\n    private _getMeshKey(options: CreateTileMeshOptions): string {\n        return `${options.granularity.toString(36)}_${options.generateBorders ? 'b' : ''}${options.extendToNorthPole ? 'n' : ''}${options.extendToSouthPole ? 's' : ''}`;\n    }\n\n    public getMeshFromTileID(context: Context, canonical: CanonicalTileID, hasBorder: boolean, allowPoles: boolean, usage: TileMeshUsage): Mesh {\n        // Stencil granularity must match fill granularity\n        const granularityConfig = usage === 'stencil' ? granularitySettingsGlobe.stencil : granularitySettingsGlobe.tile;\n        const granularity = granularityConfig.getGranularityForZoomLevel(canonical.z);\n        const north = (canonical.y === 0) && allowPoles;\n        const south = (canonical.y === (1 << canonical.z) - 1) && allowPoles;\n        return this._getMesh(context, {\n            granularity,\n            generateBorders: hasBorder,\n            extendToNorthPole: north,\n            extendToSouthPole: south,\n        });\n    }\n\n    private _getMesh(context: Context, options: CreateTileMeshOptions): Mesh {\n        const key = this._getMeshKey(options);\n\n        if (key in this._tileMeshCache) {\n            return this._tileMeshCache[key];\n        }\n\n        const mesh = createTileMeshWithBuffers(context, options);\n        this._tileMeshCache[key] = mesh;\n        return mesh;\n    }\n\n    recalculate(_params: EvaluationParameters): void {\n        // Do nothing.\n    }\n\n    hasTransition(): boolean {\n        const currentTime = now();\n        let dirty = false;\n        // Error correction transition\n        dirty = dirty || (currentTime - this._errorMeasurementLastChangeTime) / 1000.0 < (globeConstants.errorTransitionTimeSeconds + 0.2);\n        // Error correction query in flight\n        dirty = dirty || (this._errorMeasurement && this._errorMeasurement.awaitingQuery);\n        return dirty;\n    }\n\n    setErrorQueryLatitudeDegrees(value: number) {\n        this._errorQueryLatitudeDegrees = value;\n    }\n}","import {ProjectionDefinition, type ProjectionDefinitionSpecification, type ProjectionSpecification, type StylePropertySpecification, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\nimport {DataConstantProperty, type PossiblyEvaluated, Properties, Transitionable, type Transitioning, type TransitionParameters} from '../../style/properties';\nimport {Evented} from '../../util/evented';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\nimport {MercatorProjection} from './mercator_projection';\nimport {VerticalPerspectiveProjection} from './vertical_perspective_projection';\nimport {type Projection, type ProjectionGPUContext, type TileMeshUsage} from './projection';\nimport {type PreparedShader} from '../../shaders/shaders';\nimport {type SubdivisionGranularitySetting} from '../../render/subdivision_granularity_settings';\nimport {type Context} from '../../gl/context';\nimport {type CanonicalTileID} from '../../tile/tile_id';\nimport {type Mesh} from '../../render/mesh';\n\ntype ProjectionProps = {\n    type: DataConstantProperty<ProjectionDefinition>;\n};\n\ntype ProjectionPossiblyEvaluated = {\n    type: ProjectionDefinitionSpecification;\n};\n\nconst properties: Properties<ProjectionProps> = new Properties({\n    'type': new DataConstantProperty(styleSpec.projection.type as StylePropertySpecification)\n});\n\nexport class GlobeProjection extends Evented implements Projection {\n    properties: PossiblyEvaluated<ProjectionProps, ProjectionPossiblyEvaluated>;\n\n    _transitionable: Transitionable<ProjectionProps>;\n    _transitioning: Transitioning<ProjectionProps>;\n    _mercatorProjection: MercatorProjection;\n    _verticalPerspectiveProjection: VerticalPerspectiveProjection;\n\n    constructor(projection?: ProjectionSpecification) {\n        super();\n        this._transitionable = new Transitionable(properties, undefined);\n        this.setProjection(projection);\n        this._transitioning = this._transitionable.untransitioned();\n        this.recalculate(new EvaluationParameters(0));\n        this._mercatorProjection = new MercatorProjection();\n        this._verticalPerspectiveProjection = new VerticalPerspectiveProjection();\n    }\n\n    public get transitionState(): number {\n        const currentProjectionSpecValue = this.properties.get('type');\n        if (typeof currentProjectionSpecValue === 'string' && currentProjectionSpecValue === 'mercator') {\n            return 0;\n        }\n        if (typeof currentProjectionSpecValue === 'string' && currentProjectionSpecValue === 'vertical-perspective') {\n            return 1;\n        }\n        if (currentProjectionSpecValue instanceof ProjectionDefinition) {\n            if (currentProjectionSpecValue.from === 'vertical-perspective' && currentProjectionSpecValue.to === 'mercator') {\n                return 1 - currentProjectionSpecValue.transition;\n            }\n            if (currentProjectionSpecValue.from === 'mercator' && currentProjectionSpecValue.to === 'vertical-perspective') {\n                return currentProjectionSpecValue.transition;\n            }\n        };\n        return 1;\n    }\n\n    get useGlobeRendering(): boolean {\n        return this.transitionState > 0;\n    }\n\n    get latitudeErrorCorrectionRadians(): number { return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians; }\n\n    private get currentProjection(): Projection {\n        return this.useGlobeRendering ? this._verticalPerspectiveProjection : this._mercatorProjection;\n    }\n\n    get name(): ProjectionSpecification['type'] {\n        return 'globe';\n    }\n\n    get useSubdivision(): boolean {\n        return this.currentProjection.useSubdivision;\n    }\n\n    get shaderVariantName(): string {\n        return this.currentProjection.shaderVariantName;\n    }\n\n    get shaderDefine(): string {\n        return this.currentProjection.shaderDefine;\n    }\n\n    get shaderPreludeCode(): PreparedShader {\n        return this.currentProjection.shaderPreludeCode;\n    }\n\n    get vertexShaderPreludeCode(): string {\n        return this.currentProjection.vertexShaderPreludeCode;\n    }\n\n    get subdivisionGranularity(): SubdivisionGranularitySetting {\n        return this.currentProjection.subdivisionGranularity;\n    }\n\n    get useGlobeControls(): boolean {\n        return this.transitionState > 0;\n    }\n\n    public destroy(): void {\n        this._mercatorProjection.destroy();\n        this._verticalPerspectiveProjection.destroy();\n    }\n\n    public updateGPUdependent(context: ProjectionGPUContext): void {\n        this._mercatorProjection.updateGPUdependent(context);\n        this._verticalPerspectiveProjection.updateGPUdependent(context);\n    }\n\n    public getMeshFromTileID(context: Context, _tileID: CanonicalTileID, _hasBorder: boolean, _allowPoles: boolean, _usage: TileMeshUsage): Mesh {\n        return this.currentProjection.getMeshFromTileID(context, _tileID, _hasBorder, _allowPoles, _usage);\n    }\n\n    setProjection(projection?: ProjectionSpecification) {\n        this._transitionable.setValue('type', projection?.type || 'mercator');\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition(): boolean {\n        return this._transitioning.hasTransition() || this.currentProjection.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    setErrorQueryLatitudeDegrees(value: number) {\n        this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(value);\n        this._mercatorProjection.setErrorQueryLatitudeDegrees(value);\n    }\n}\n","import {type ReadonlyVec4, vec3} from 'gl-matrix';\nimport {clamp, createVec3f64, lerp, MAX_VALID_LATITUDE, mod, remapSaturate, scaleZoom, wrap} from '../../util/util';\nimport {LngLat} from '../lng_lat';\nimport {EXTENT} from '../../data/extent';\nimport type Point from '@mapbox/point-geometry';\n\nexport function getGlobeCircumferencePixels(transform: {worldSize: number; center: {lat: number}}): number {\n    const radius = getGlobeRadiusPixels(transform.worldSize, transform.center.lat);\n    const circumference = 2.0 * Math.PI * radius;\n    return circumference;\n}\n\nexport function globeDistanceOfLocationsPixels(transform: {worldSize: number; center: {lat: number}}, a: LngLat, b: LngLat): number {\n    const vecA = angularCoordinatesToSurfaceVector(a);\n    const vecB = angularCoordinatesToSurfaceVector(b);\n    const dot = vec3.dot(vecA, vecB);\n    const radians = Math.acos(dot);\n    const circumference = getGlobeCircumferencePixels(transform);\n    return radians / (2.0 * Math.PI) * circumference;\n}\n\n/**\n * For given mercator coordinates in range 0..1, returns the angular coordinates on the sphere's surface, in radians.\n */\nexport function mercatorCoordinatesToAngularCoordinatesRadians(mercatorX: number, mercatorY: number): [number, number] {\n    const sphericalX = mod(mercatorX * Math.PI * 2.0 + Math.PI, Math.PI * 2);\n    const sphericalY = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n    return [sphericalX, sphericalY];\n}\n\n/**\n * For a given longitude and latitude (note: in radians) returns the normalized vector from the planet center to the specified place on the surface.\n * @param lngRadians - Longitude in radians.\n * @param latRadians - Latitude in radians.\n */\nexport function angularCoordinatesRadiansToVector(lngRadians: number, latRadians: number): vec3 {\n    const len = Math.cos(latRadians);\n    const vec = new Float64Array(3) as any;\n    vec[0] = Math.sin(lngRadians) * len;\n    vec[1] = Math.sin(latRadians);\n    vec[2] = Math.cos(lngRadians) * len;\n    return vec;\n}\n\n/**\n * Projects a point within a tile to the surface of the unit sphere globe.\n * @param inTileX - X coordinate inside the tile in range [0 .. 8192].\n * @param inTileY - Y coordinate inside the tile in range [0 .. 8192].\n * @param tileIdX - Tile's X coordinate in range [0 .. 2^zoom - 1].\n * @param tileIdY - Tile's Y coordinate in range [0 .. 2^zoom - 1].\n * @param tileIdZ - Tile's zoom.\n * @returns A 3D vector - coordinates of the projected point on a unit sphere.\n */\nexport function projectTileCoordinatesToSphere(inTileX: number, inTileY: number, tileIdX: number, tileIdY: number, tileIdZ: number): vec3 {\n    // This code could be assembled from 3 functions, but this is a hot path for symbol placement,\n    // so for optimization purposes everything is inlined by hand.\n    //\n    // Non-inlined variant of this function would be this:\n    //     const mercator = tileCoordinatesToMercatorCoordinates(inTileX, inTileY, tileID);\n    //     const angular = mercatorCoordinatesToAngularCoordinatesRadians(mercator.x, mercator.y);\n    //     const sphere = angularCoordinatesRadiansToVector(angular[0], angular[1]);\n    //     return sphere;\n    const scale = 1.0 / (1 << tileIdZ);\n    const mercatorX = inTileX / EXTENT * scale + tileIdX * scale;\n    const mercatorY = inTileY / EXTENT * scale + tileIdY * scale;\n    const sphericalX = mod(mercatorX * Math.PI * 2.0 + Math.PI, Math.PI * 2);\n    const sphericalY = 2.0 * Math.atan(Math.exp(Math.PI - (mercatorY * Math.PI * 2.0))) - Math.PI * 0.5;\n    const len = Math.cos(sphericalY);\n    const vec = new Float64Array(3) as any;\n    vec[0] = Math.sin(sphericalX) * len;\n    vec[1] = Math.sin(sphericalY);\n    vec[2] = Math.cos(sphericalX) * len;\n    return vec;\n}\n\n/**\n * For a given longitude and latitude (note: in degrees) returns the normalized vector from the planet center to the specified place on the surface.\n */\nexport function angularCoordinatesToSurfaceVector(lngLat: LngLat): vec3 {\n    return angularCoordinatesRadiansToVector(lngLat.lng * Math.PI / 180, lngLat.lat * Math.PI / 180);\n}\n\nexport function getGlobeRadiusPixels(worldSize: number, latitudeDegrees: number) {\n    // We want zoom levels to be consistent between globe and flat views.\n    // This means that the pixel size of features at the map center point\n    // should be the same for both globe and flat view.\n    // For this reason we scale the globe up when map center is nearer to the poles.\n    return worldSize / (2.0 * Math.PI) / Math.cos(latitudeDegrees * Math.PI / 180);\n}\n\n/**\n * Given a 3D point on the surface of a unit sphere, returns its angular coordinates in degrees.\n * The input vector must be normalized.\n */\nexport function sphereSurfacePointToCoordinates(surface: vec3): LngLat {\n    const latRadians = Math.asin(surface[1]);\n    const latDegrees = latRadians / Math.PI * 180.0;\n    const lengthXZ = Math.sqrt(surface[0] * surface[0] + surface[2] * surface[2]);\n    if (lengthXZ > 1e-6) {\n        const projX = surface[0] / lengthXZ;\n        const projZ = surface[2] / lengthXZ;\n        const acosZ = Math.acos(projZ);\n        const lngRadians = (projX > 0) ? acosZ : -acosZ;\n        const lngDegrees = lngRadians / Math.PI * 180.0;\n        return new LngLat(wrap(lngDegrees, -180, 180), latDegrees);\n    } else {\n        return new LngLat(0.0, latDegrees);\n    }\n}\n\n/**\n * Given a normalized horizon plane in Ax+By+Cz+D=0 format, compute the center and radius of\n * the circle in that plain that contains the entire visible portion of the unit sphere from horizon\n * to horizon.\n * @param horizonPlane - The plane that passes through visible horizon in Ax + By + Cz + D = 0 format where mag(A,B,C)=1\n * @returns the center point and radius of the disc that passes through the entire visible horizon\n */\nexport function horizonPlaneToCenterAndRadius(horizonPlane: ReadonlyVec4): { center: vec3; radius: number } {\n    const center = createVec3f64();\n    center[0] = horizonPlane[0] * -horizonPlane[3];\n    center[1] = horizonPlane[1] * -horizonPlane[3];\n    center[2] = horizonPlane[2] * -horizonPlane[3];\n    /*\n                     .*******\n                 ****|\\\n               **    | \\\n             **      |  1\n            * radius |   \\\n           *         |    \\\n           *  center +--D--+(0,0,0)\n     */\n    const radius = Math.sqrt(1 - horizonPlane[3] * horizonPlane[3]);\n    return {center, radius};\n}\n\n/**\n * Computes the closest point on a sphere to `point`.\n * @param center - Center of the sphere\n * @param radius - Radius of the sphere\n * @param point - Point inside or outside the sphere\n * @returns A 3d vector of the point on the sphere closest to `point`\n */\nexport function clampToSphere(center: vec3, radius: number, point: vec3) {\n    const relativeToCenter = createVec3f64();\n    vec3.sub(relativeToCenter, point, center);\n    const clamped = createVec3f64();\n    vec3.scaleAndAdd(clamped, center, relativeToCenter, radius / vec3.len(relativeToCenter));\n    return clamped;\n}\n\nfunction planetScaleAtLatitude(latitudeDegrees: number): number {\n    return Math.cos(latitudeDegrees * Math.PI / 180);\n}\n\n/**\n * Computes how much to modify zoom to keep the globe size constant when changing latitude.\n * @param transform - An instance of any transform. Does not have any relation on the computed values.\n * @param oldLat - Latitude before change, in degrees.\n * @param newLat - Latitude after change, in degrees.\n * @returns A value to add to zoom level used for old latitude to keep same planet radius at new latitude.\n */\nexport function getZoomAdjustment(oldLat: number, newLat: number): number {\n    const oldCircumference = planetScaleAtLatitude(oldLat);\n    const newCircumference = planetScaleAtLatitude(newLat);\n    return scaleZoom(newCircumference / oldCircumference);\n}\n\nexport function getDegreesPerPixel(worldSize: number, lat: number): number {\n    return 360.0 / getGlobeCircumferencePixels({worldSize, center: {lat}});\n}\n\n/**\n * Returns transform's new center rotation after applying panning.\n * @param panDelta - Panning delta, in same units as what is supplied to {@link HandlerManager}.\n * @param tr - Current transform. This object is not modified by the function.\n * @returns New center location to set to the map's transform to apply the specified panning.\n */\nexport function computeGlobePanCenter(panDelta: Point, tr: {\n    readonly bearingInRadians: number;\n    readonly worldSize: number;\n    readonly center: LngLat;\n    readonly zoom: number;\n}): LngLat {\n    // Apply map bearing to the panning vector\n    const rotatedPanDelta = panDelta.rotate(tr.bearingInRadians);\n    // Compute what the current zoom would be if the transform center would be moved to latitude 0.\n    const normalizedGlobeZoom = tr.zoom + getZoomAdjustment(tr.center.lat, 0);\n    // Note: we divide longitude speed by planet width at the given latitude. But we diminish this effect when the globe is zoomed out a lot.\n    const lngSpeed = lerp(\n        1.0 / planetScaleAtLatitude(tr.center.lat), // speed adjusted by latitude\n        1.0 / planetScaleAtLatitude(Math.min(Math.abs(tr.center.lat), 60)), // also adjusted, but latitude is clamped to 60Â° to avoid too large speeds near poles\n        remapSaturate(normalizedGlobeZoom, 7, 3, 0, 1.0) // Values chosen so that globe interactions feel good. Not scientific by any means.\n    );\n    const panningDegreesPerPixel = getDegreesPerPixel(tr.worldSize, tr.center.lat);\n    return new LngLat(\n        tr.center.lng - rotatedPanDelta.x * panningDegreesPerPixel * lngSpeed,\n        clamp(tr.center.lat + rotatedPanDelta.y * panningDegreesPerPixel, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE)\n    );\n}\n\n/**\n * Integration of `1 / cos(x)`.\n */\nfunction integrateSecX(x: number): number {\n    const xHalf = 0.5 * x;\n    const sin = Math.sin(xHalf);\n    const cos = Math.cos(xHalf);\n    return Math.log(sin + cos) - Math.log(cos - sin);\n}\n\n/**\n * Interpolates globe center between two locations while preserving apparent rotation speed during interpolation.\n * @param start - The starting location of the interpolation.\n * @param deltaLng - Longitude delta to the end of the interpolation.\n * @param deltaLat - Latitude delta to the end of the interpolation.\n * @param t - The interpolation point in [0..1], where 0 is starting location, 1 is end location and other values are in between.\n * @returns The interpolated location.\n */\nexport function interpolateLngLatForGlobe(start: LngLat, deltaLng: number, deltaLat: number, t: number): LngLat {\n    // Rate of change of longitude when moving the globe should be roughly 1/cos(latitude)\n    // We want to use this rate of change, even for interpolation during easing.\n    // Thus we know the derivative of our interpolation function: 1/cos(x)\n    // To get our interpolation function, we need to integrate that.\n\n    const interpolatedLat = start.lat + deltaLat * t;\n\n    if (Math.abs(deltaLat) > 1) {\n        const endLat = start.lat + deltaLat;\n        const onDifferentHemispheres = Math.sign(endLat) !== Math.sign(start.lat);\n        // Where do we sample the integrated speed curve?\n        const samplePointStart = (onDifferentHemispheres ? -Math.abs(start.lat) : Math.abs(start.lat)) * Math.PI / 180;\n        const samplePointEnd = Math.abs(start.lat + deltaLat) * Math.PI / 180;\n        // Read the integrated speed curve at those points, and at the interpolation value \"t\".\n        const valueT = integrateSecX(samplePointStart + t * (samplePointEnd - samplePointStart));\n        const valueStart = integrateSecX(samplePointStart);\n        const valueEnd = integrateSecX(samplePointEnd);\n        // Compute new interpolation factor based on the speed curve\n        const newT = (valueT - valueStart) / (valueEnd - valueStart);\n        // Interpolate using that factor\n        const interpolatedLng = start.lng + deltaLng * newT;\n        return new LngLat(\n            interpolatedLng,\n            interpolatedLat\n        );\n    } else {\n        // Fall back to simple interpolation when latitude doesn't change much.\n        const interpolatedLng = start.lng + deltaLng * t;\n        return new LngLat(\n            interpolatedLng,\n            interpolatedLat\n        );\n    }\n}\n","import {type CoveringTilesOptionsInternal} from '../../geo/projection/covering_tiles';\nimport {type IBoundingVolume} from './bounding_volume';\n\ntype BoundingVolumeFactory<T extends IBoundingVolume> = (tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal) => T;\n\nexport class BoundingVolumeCache<T extends IBoundingVolume> {\n    private _cachePrevious: Map<string, T> = new Map();\n    private _cache: Map<string, T> = new Map();\n    private _hadAnyChanges = false;\n    private _boundingVolumeFactory: BoundingVolumeFactory<T>;\n\n    constructor(boundingVolumeFactory: BoundingVolumeFactory<T>) {\n        this._boundingVolumeFactory = boundingVolumeFactory;\n    }\n\n    /**\n     * Prepares bounding volume cache for next frame. Call at the beginning of a frame.\n     * Bounding volume of any tile accesses in the last frame is kept in the cache, other (unaccessed) bounding volumes are deleted.\n     */\n    swapBuffers() {\n        if (!this._hadAnyChanges) {\n            // If no new bounding volumes were added this frame, no need to conserve memory, do not clear caches.\n            return;\n        }\n        const oldCache = this._cachePrevious;\n        this._cachePrevious = this._cache;\n        this._cache = oldCache;\n        this._cache.clear();\n        this._hadAnyChanges = false;\n    }\n\n    /**\n     * Returns the bounding volume of the specified tile, fetching it from cache or creating it using the factory function if needed.\n     * @param tileID - Tile x, y and z for zoom.\n     */\n    getTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): T {\n        const key = `${tileID.z}_${tileID.x}_${tileID.y}_${options?.terrain ? 't' : ''}`;\n        const cached = this._cache.get(key);\n        if (cached) {\n            return cached;\n        }\n        const cachedPrevious = this._cachePrevious.get(key);\n        if (cachedPrevious) {\n            this._cache.set(key, cachedPrevious);\n            return cachedPrevious;\n        }\n        const boundingVolume = this._boundingVolumeFactory(tileID, wrap, elevation, options);\n        this._cache.set(key, boundingVolume);\n        this._hadAnyChanges = true;\n        return boundingVolume;\n    }\n}\n","import {quat, vec3, type vec4} from 'gl-matrix';\nimport {type Frustum} from './frustum';\nimport {IntersectionResult, type IBoundingVolume} from './bounding_volume';\n\n/**\n * A general convex bounding volume, defined by a set of points.\n */\nexport class ConvexVolume implements IBoundingVolume {\n    // Precomputed AABB for rejecting frustum intersection.\n    min: vec3;\n    max: vec3;\n\n    points: vec3[];\n    planes: vec4[];\n\n    /**\n     * Creates an instance of a general convex bounding volume.\n     * Note that the provided points array is used *as is*, its contents are not copied!\n     *\n     * Additionally, an AABB must be provided for rejecting frustum intersections.\n     * This AABB does not need to bound this convex volume (it may be smaller),\n     * but it *must* accurately bound the actual shape this volume is approximating.\n     * @param points - Points forming the convex shape. Note that this array reference is used *as is*, its contents are not copied!\n     * @param min - The bounding AABB's min point.\n     * @param max - The bounding AABB's min point.\n     */\n    constructor(points: vec3[], planes: vec4[], min: vec3, max: vec3) {\n        this.min = min;\n        this.max = max;\n        this.points = points;\n        this.planes = planes;\n    }\n\n    /**\n     * Creates a convex BV equivalent to the specified AABB.\n     * @param min - The AABB's min point.\n     * @param max - The AABB's max point.\n     */\n    public static fromAabb(min: vec3, max: vec3): ConvexVolume {\n        const points = [];\n        for (let i = 0; i < 8; i++) {\n            points.push([\n                ((i >> 0) & 1) === 1 ? max[0] : min[0],\n                ((i >> 1) & 1) === 1 ? max[1] : min[1],\n                ((i >> 2) & 1) === 1 ? max[2] : min[2]\n            ]);\n        }\n        return new ConvexVolume(points, [\n            [-1, 0, 0, max[0]],\n            [1, 0, 0, -min[0]],\n            [0, -1, 0, max[1]],\n            [0, 1, 0, -min[1]],\n            [0, 0, -1, max[2]],\n            [0, 0, 1, -min[2]]\n        ], min, max);\n    }\n\n    /**\n     * Creates a convex bounding volume that is actually an oriented bounding box created from the specified center, half-size and rotation angles.\n     * @param center - Center of the OBB.\n     * @param halfSize - The half-size of the OBB in each axis. The box will extend by this value in each direction for the given axis.\n     * @param angles - The rotation of the box. Euler angles, in degrees.\n     */\n    public static fromCenterSizeAngles(center: vec3, halfSize: vec3, angles: vec3): ConvexVolume {\n        const q = quat.fromEuler([] as any, angles[0], angles[1], angles[2]);\n        const axisX = vec3.transformQuat([] as any, [halfSize[0], 0, 0], q);\n        const axisY = vec3.transformQuat([] as any, [0, halfSize[1], 0], q);\n        const axisZ = vec3.transformQuat([] as any, [0, 0, halfSize[2]], q);\n        // Find the AABB min/max\n        const min = [...center] as vec3;\n        const max = [...center] as vec3;\n        for (let i = 0; i < 8; i++) {\n            for (let axis = 0; axis < 3; axis++) {\n                const point = center[axis]\n                    + axisX[axis] * ((((i >> 0) & 1) === 1) ? 1 : -1)\n                    + axisY[axis] * ((((i >> 1) & 1) === 1) ? 1 : -1)\n                    + axisZ[axis] * ((((i >> 2) & 1) === 1) ? 1 : -1);\n                min[axis] = Math.min(min[axis], point);\n                max[axis] = Math.max(max[axis], point);\n            }\n        }\n        const points = [];\n        for (let i = 0; i < 8; i++) {\n            const p = [...center] as vec3;\n            vec3.add(p, p, vec3.scale([] as any, axisX, ((i >> 0) & 1) === 1 ? 1 : -1));\n            vec3.add(p, p, vec3.scale([] as any, axisY, ((i >> 1) & 1) === 1 ? 1 : -1));\n            vec3.add(p, p, vec3.scale([] as any, axisZ, ((i >> 2) & 1) === 1 ? 1 : -1));\n            points.push(p);\n        }\n        return new ConvexVolume(points, [\n            [...axisX, -vec3.dot(axisX, points[0])] as vec4,\n            [...axisY, -vec3.dot(axisY, points[0])] as vec4,\n            [...axisZ, -vec3.dot(axisZ, points[0])] as vec4,\n            [-axisX[0], -axisX[1], -axisX[2], -vec3.dot(axisX, points[7])] as vec4,\n            [-axisY[0], -axisY[1], -axisY[2], -vec3.dot(axisY, points[7])] as vec4,\n            [-axisZ[0], -axisZ[1], -axisZ[2], -vec3.dot(axisZ, points[7])] as vec4,\n        ], min, max);\n    }\n\n    /**\n     * Performs an approximate frustum-obb intersection test.\n     */\n    intersectsFrustum(frustum: Frustum): IntersectionResult {\n        // Performance-critical\n        let fullyInside = true;\n\n        const boxPointCount = this.points.length;\n        const boxPlaneCount = this.planes.length;\n        const frustumPlaneCount = frustum.planes.length;\n        const frustumPointCount = frustum.points.length;\n\n        // Test whether this volume's points are inside the frustum\n        for (let i = 0; i < frustumPlaneCount; i++) {\n            const plane = frustum.planes[i];\n            let boxPointsPassed = 0;\n            for(let j = 0; j < boxPointCount; j++) {\n                const point = this.points[j];\n                // Get point-plane distance sign\n                if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                    boxPointsPassed++;\n                }\n            }\n\n            if (boxPointsPassed === 0) {\n                return IntersectionResult.None;\n            }\n            if (boxPointsPassed < boxPointCount) {\n                fullyInside = false;\n            }\n        }\n\n        if (fullyInside) {\n            return IntersectionResult.Full;\n        }\n\n        // Test whether the frustum's points are inside this volume.\n        for (let i = 0; i < boxPlaneCount; i++) {\n            const plane = this.planes[i];\n            let frustumPointsPassed = 0;\n            for (let j = 0; j < frustumPointCount; j++) {\n                const point = frustum.points[j];\n                if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                    frustumPointsPassed++;\n                }\n            }\n            if (frustumPointsPassed === 0) {\n                return IntersectionResult.None;\n            }\n        }\n\n        return IntersectionResult.Partial;\n    }\n\n    /**\n     * Performs an intersection test with a halfspace.\n     */\n    intersectsPlane(plane: vec4): IntersectionResult {\n        const pointCount = this.points.length;\n        let positivePoints = 0;\n        for (let i = 0; i < pointCount; i++) {\n            const point = this.points[i];\n            if (plane[0] * point[0] + plane[1] * point[1] + plane[2] * point[2] + plane[3] >= 0) {\n                positivePoints++;\n            }\n        }\n\n        if (positivePoints === pointCount) {\n            return IntersectionResult.Full;\n        }\n        if (positivePoints === 0) {\n            return IntersectionResult.None;\n        }\n        return IntersectionResult.Partial;\n    }\n}\n","import {EXTENT} from '../../data/extent';\nimport {projectTileCoordinatesToSphere} from './globe_utils';\nimport {BoundingVolumeCache} from '../../util/primitives/bounding_volume_cache';\nimport {coveringZoomLevel, type CoveringTilesOptionsInternal} from './covering_tiles';\nimport {vec3, type vec4} from 'gl-matrix';\nimport type {IReadonlyTransform} from '../transform_interface';\nimport type {MercatorCoordinate} from '../mercator_coordinate';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\nimport {OverscaledTileID} from '../../tile/tile_id';\nimport {earthRadius} from '../lng_lat';\nimport {ConvexVolume} from '../../util/primitives/convex_volume';\nimport {threePlaneIntersection} from '../../util/util';\n\n/**\n * Computes distance of a point to a tile in an arbitrary axis.\n * World is assumed to have size 1, distance returned is to the nearer tile edge.\n * @param point - Point position.\n * @param tile - Tile position.\n * @param tileSize - Tile size.\n */\nfunction distanceToTileSimple(point: number, tile: number, tileSize: number): number {\n    const delta = point - tile;\n    return (delta < 0) ? -delta : Math.max(0, delta - tileSize);\n}\n\nfunction distanceToTileWrapX(pointX: number, pointY: number, tileCornerX: number, tileCornerY: number, tileSize: number): number {\n    const tileCornerToPointX = pointX - tileCornerX;\n\n    let distanceX: number;\n    if (tileCornerToPointX < 0) {\n        // Point is left of tile\n        distanceX = Math.min(-tileCornerToPointX, 1.0 + tileCornerToPointX - tileSize);\n    } else if (tileCornerToPointX > 1) {\n        // Point is right of tile\n        distanceX = Math.min(Math.max(tileCornerToPointX - tileSize, 0), 1.0 - tileCornerToPointX);\n    } else {\n        // Point is inside tile in the X axis.\n        distanceX = 0;\n    }\n\n    return Math.max(distanceX, distanceToTileSimple(pointY, tileCornerY, tileSize));\n}\n\nexport class GlobeCoveringTilesDetailsProvider implements CoveringTilesDetailsProvider {\n    private _boundingVolumeCache: BoundingVolumeCache<ConvexVolume> = new BoundingVolumeCache(this._computeTileBoundingVolume);\n\n    /**\n     * Prepares the internal bounding volume cache for the next frame.\n     */\n    prepareNextFrame() {\n        this._boundingVolumeCache.swapBuffers();\n    }\n\n    /**\n     * Returns the distance of a point to a square tile. If the point is inside the tile, returns 0.\n     * Assumes the world to be of size 1.\n     * Handles distances on a sphere correctly: X is wrapped when crossing the antimeridian,\n     * when crossing the poles Y is mirrored and X is shifted by half world size.\n     */\n    distanceToTile2d(pointX: number, pointY: number, tileID: {x: number; y: number; z: number}, _bv: ConvexVolume): number {\n        const scale = 1 << tileID.z;\n        const tileMercatorSize = 1.0 / scale;\n        const tileCornerX = tileID.x / scale; // In range 0..1\n        const tileCornerY = tileID.y / scale; // In range 0..1\n\n        const worldSize = 1.0;\n        const halfWorld = 0.5 * worldSize;\n        let smallestDistance = 2.0 * worldSize;\n        // Original tile\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX, tileCornerY, tileMercatorSize));\n        // Up\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX + halfWorld, -tileCornerY - tileMercatorSize, tileMercatorSize));\n        // Down\n        smallestDistance = Math.min(smallestDistance, distanceToTileWrapX(pointX, pointY, tileCornerX + halfWorld, worldSize + worldSize - tileCornerY - tileMercatorSize, tileMercatorSize));\n\n        return smallestDistance;\n    }\n\n    /**\n     * Returns the wrap value for a given tile, computed so that tiles will remain loaded when crossing the antimeridian.\n     */\n    getWrap(centerCoord: MercatorCoordinate, tileID: {x: number; y: number; z: number}, _parentWrap: number): number {\n        const scale = 1 << tileID.z;\n        const tileMercatorSize = 1.0 / scale;\n        const tileX = tileID.x / scale; // In range 0..1\n        const distanceCurrent = distanceToTileSimple(centerCoord.x, tileX, tileMercatorSize);\n        const distanceLeft = distanceToTileSimple(centerCoord.x, tileX - 1.0, tileMercatorSize);\n        const distanceRight = distanceToTileSimple(centerCoord.x, tileX + 1.0, tileMercatorSize);\n        const distanceSmallest = Math.min(distanceCurrent, distanceLeft, distanceRight);\n        if (distanceSmallest === distanceRight) {\n            return 1;\n        }\n        if (distanceSmallest === distanceLeft) {\n            return -1;\n        }\n        return 0;\n    }\n    \n    allowVariableZoom(transform: IReadonlyTransform, options: CoveringTilesOptionsInternal): boolean {\n        return coveringZoomLevel(transform, options) > 4;\n    }\n\n    allowWorldCopies(): boolean {\n        return false;\n    }\n\n    getTileBoundingVolume(tileID: { x: number; y: number; z: number }, wrap: number, elevation: number, options: CoveringTilesOptionsInternal) {\n        return this._boundingVolumeCache.getTileBoundingVolume(tileID, wrap, elevation, options);\n    }\n\n    private _computeTileBoundingVolume(tileID: {x: number; y: number; z: number}, wrap: number, elevation: number, options: CoveringTilesOptionsInternal): ConvexVolume {\n        let minElevation = 0;\n        let maxElevation = 0;\n        if (options?.terrain) {\n            const overscaledTileID = new OverscaledTileID(tileID.z, wrap, tileID.z, tileID.x, tileID.y);\n            const minMax = options.terrain.getMinMaxElevation(overscaledTileID);\n            minElevation = minMax.minElevation ?? Math.min(0, elevation);\n            maxElevation = minMax.maxElevation ?? Math.max(0, elevation);\n        }\n        // Convert elevation to distances from center of a unit sphere planet (so that 1 is surface)\n        minElevation /= earthRadius;\n        maxElevation /= earthRadius;\n        minElevation += 1;\n        maxElevation += 1;\n\n        if (tileID.z <= 0) {\n            // Tile covers the entire sphere.\n            return ConvexVolume.fromAabb( // We return an AABB in this case.\n                [-maxElevation, -maxElevation, -maxElevation],\n                [maxElevation, maxElevation, maxElevation]\n            );\n        } else if (tileID.z === 1) {\n            // Tile covers a quarter of the sphere.\n            // X is 1 at lng=E90Â°\n            // Y is 1 at **north** pole\n            // Z is 1 at null island\n            return ConvexVolume.fromAabb( // We also just use AABBs for this zoom level.\n                [tileID.x === 0 ? -maxElevation : 0, tileID.y === 0 ? 0 : -maxElevation, -maxElevation],\n                [tileID.x === 0 ? 0 : maxElevation, tileID.y === 0 ? maxElevation : 0, maxElevation]\n            );\n        } else {\n            const corners = [\n                projectTileCoordinatesToSphere(0, 0, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(EXTENT, 0, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(EXTENT, EXTENT, tileID.x, tileID.y, tileID.z),\n                projectTileCoordinatesToSphere(0, EXTENT, tileID.x, tileID.y, tileID.z),\n            ];\n\n            const extremesPoints = [];\n\n            for (const c of corners) {\n                extremesPoints.push(vec3.scale([] as any, c, maxElevation));\n            }\n\n            if (maxElevation !== minElevation) {\n                // Only add additional points if terrain is enabled and is not flat.\n                for (const c of corners) {\n                    extremesPoints.push(vec3.scale([] as any, c, minElevation));\n                }\n            }\n\n            // Special handling of poles - we need to extend the tile AABB\n            // to include the pole for tiles that border mercator north/south edge.\n            if (tileID.y === 0) {\n                extremesPoints.push([0, 1, 0]); // North pole\n            }\n            if (tileID.y === (1 << tileID.z) - 1) {\n                extremesPoints.push([0, -1, 0]); // South pole\n            }\n\n            // Compute a best-fit AABB for the frustum rejection test\n            const aabbMin: vec3 = [1, 1, 1];\n            const aabbMax: vec3 = [-1, -1, -1];\n\n            for (const c of extremesPoints) {\n                for (let i = 0; i < 3; i++) {\n                    aabbMin[i] = Math.min(aabbMin[i], c[i]);\n                    aabbMax[i] = Math.max(aabbMax[i], c[i]);\n                }\n            }\n\n            // Now we compute the actual bounding volume.\n            // The up/down plane will be normal to the tile's center.\n            // The north/south plane will be used for the tile's north and south edge and will be orthogonal to the up/down plane.\n            // The left and right planes will be determined by the tile's east/west edges and will differ slightly - we are not creating a box!\n            // We will find the min and max extents for the up/down and north/south planes using the set of points\n            // where the extremes are likely to lie.\n\n            // Vector \"center\" (from planet center to tile center) will be our up/down axis.\n            const center = projectTileCoordinatesToSphere(EXTENT / 2, EXTENT / 2, tileID.x, tileID.y, tileID.z);\n            // Vector to the east of \"center\".\n            const centerEast = vec3.cross([] as any, [0, 1, 0], center);\n            vec3.normalize(centerEast, centerEast);\n            // Vector to the north of \"center\" will be our north/south axis.\n            const north = vec3.cross([] as any, center, centerEast);\n            vec3.normalize(north, north);\n\n            // Axes for the east and west edge of our bounding volume.\n            // These axes are NOT opposites of each other, they differ!\n            // They are also not orthogonal to the up/down and north/south axes.\n            const axisEast = vec3.cross([] as any, corners[2], corners[1]);\n            vec3.normalize(axisEast, axisEast);\n            const axisWest = vec3.cross([] as any, corners[0], corners[3]);\n            vec3.normalize(axisWest, axisWest);\n\n            // Now we will expand the extremes point set for bounding volume creation.\n            // We will also include the tile center point, since it will always be an extreme for the \"center\" axis.\n            extremesPoints.push(vec3.scale([] as any, center, maxElevation));\n            // No need to include a minElevation-scaled center, since we already have minElevation corners in the set and these will always lie lower than the center.\n\n            // The extremes might also lie on the midpoint of the north or south edge.\n            // For tiles in the north hemisphere, only the south edge can contain an extreme,\n            // since when we imagine the tile's actual shape projected onto the plane normal to \"center\" vector,\n            // the tile's north edge will curve towards the tile center, thus its extremes are accounted for by the\n            // corners, however the south edge will curve away from the center point, extending beyond the tile's edges,\n            // thus it must be included.\n            // The poles are an exception - they must always be included in the extremes, if the tile touches the north/south mercator range edge.\n            //\n            // A tile's exaggerated shape on the northern hemisphere, projected onto the normal plane of \"center\".\n            // The \"c\" is the tile's center point. The \"m\" is the edge mid point we are looking for.\n            //\n            //      /--       --\\\n            //     /   -------   \\\n            //    /               \\\n            //   /        c        \\\n            //  /                   \\\n            // /--                 --\\\n            //    -----       -----\n            //         ---m---\n            \n            if (tileID.y >= (1 << tileID.z) / 2) {\n                // South hemisphere - include the tile's north edge midpoint\n                extremesPoints.push(vec3.scale([] as any, projectTileCoordinatesToSphere(EXTENT / 2, 0, tileID.x, tileID.y, tileID.z), maxElevation));\n                // No need to include minElevation variant of this point, for the same reason why we don't include minElevation center.\n            }\n            if (tileID.y < (1 << tileID.z) / 2) {\n                // North hemisphere - include the tile's south edge midpoint\n                extremesPoints.push(vec3.scale([] as any, projectTileCoordinatesToSphere(EXTENT / 2, EXTENT, tileID.x, tileID.y, tileID.z), maxElevation));\n                // No need to include minElevation variant of this point, for the same reason why we don't include minElevation center.\n            }\n\n            // Find the min and max extends and the midpoints along each axis,\n            // using the set of extreme points.\n            const upDownMinMax = findAxisMinMax(center, extremesPoints);\n            const northSouthMinMax = findAxisMinMax(north, extremesPoints);\n\n            const planeUp = [-center[0], -center[1], -center[2], upDownMinMax.max] as vec4;\n            const planeDown = [center[0], center[1], center[2], -upDownMinMax.min] as vec4;\n            const planeNorth = [-north[0], -north[1], -north[2], northSouthMinMax.max] as vec4;\n            const planeSouth = [north[0], north[1], north[2], -northSouthMinMax.min] as vec4;\n            const planeEast = [...axisEast, 0] as vec4;\n            const planeWest = [...axisWest, 0] as vec4;\n\n            const points: vec3[] = [];\n\n            // North points\n            if (tileID.y === 0) {\n                // If the tile borders a pole, then \n                points.push(\n                    threePlaneIntersection(planeWest, planeEast, planeUp),\n                    threePlaneIntersection(planeWest, planeEast, planeDown),\n                );\n            } else {\n                points.push(\n                    threePlaneIntersection(planeNorth, planeEast, planeUp),\n                    threePlaneIntersection(planeNorth, planeEast, planeDown),\n                    threePlaneIntersection(planeNorth, planeWest, planeUp),\n                    threePlaneIntersection(planeNorth, planeWest, planeDown)\n                );\n            }\n\n            // South points\n            if (tileID.y === (1 << tileID.z) - 1) {\n                points.push(\n                    threePlaneIntersection(planeWest, planeEast, planeUp),\n                    threePlaneIntersection(planeWest, planeEast, planeDown),\n                );\n            } else {\n                points.push(\n                    threePlaneIntersection(planeSouth, planeEast, planeUp),\n                    threePlaneIntersection(planeSouth, planeEast, planeDown),\n                    threePlaneIntersection(planeSouth, planeWest, planeUp),\n                    threePlaneIntersection(planeSouth, planeWest, planeDown)\n                );\n            }\n\n            return new ConvexVolume(points, [\n                planeUp,\n                planeDown,\n                planeNorth,\n                planeSouth,\n                planeEast,\n                planeWest\n            ], aabbMin, aabbMax);\n        }\n    }\n}\n\nfunction findAxisMinMax(axis: vec3, points: vec3[]) {\n    let min = +Infinity;\n    let max = -Infinity;\n    for (const c of points) {\n        const dot = vec3.dot(axis, c);\n        min = Math.min(min, dot);\n        max = Math.max(max, dot);\n    }\n    return {\n        min,\n        max\n    };\n}","import {type mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {TransformHelper} from '../transform_helper';\nimport {LngLat, type LngLatLike, earthRadius} from '../lng_lat';\nimport {angleToRotateBetweenVectors2D, clamp, createIdentityMat4f32, createIdentityMat4f64, createMat4f64, createVec3f64, createVec4f64, differenceOfAnglesDegrees, distanceOfAnglesRadians, MAX_VALID_LATITUDE, pointPlaneSignedDistance, warnOnce} from '../../util/util';\nimport {OverscaledTileID, UnwrappedTileID, type CanonicalTileID} from '../../tile/tile_id';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../mercator_coordinate';\nimport {LngLatBounds} from '../lng_lat_bounds';\nimport {tileCoordinatesToMercatorCoordinates} from './mercator_utils';\nimport {angularCoordinatesToSurfaceVector, clampToSphere, getGlobeRadiusPixels, getZoomAdjustment, horizonPlaneToCenterAndRadius, mercatorCoordinatesToAngularCoordinatesRadians, projectTileCoordinatesToSphere, sphereSurfacePointToCoordinates} from './globe_utils';\nimport {GlobeCoveringTilesDetailsProvider} from './globe_covering_tiles_details_provider';\nimport {Frustum} from '../../util/primitives/frustum';\n\nimport type {Terrain} from '../../render/terrain';\nimport type {PointProjection} from '../../symbol/projection';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\n/**\n * Describes the intersection of ray and sphere.\n * When null, no intersection occurred.\n * When both \"t\" values are the same, the ray just touched the sphere's surface.\n * When both value are different, a full intersection occurred.\n */\ntype RaySphereIntersection = {\n    /**\n     * The ray parameter for intersection that is \"less\" along the ray direction.\n     * Note that this value can be negative, meaning that this intersection occurred before the ray's origin.\n     * The intersection point can be computed as `origin + direction * tMin`.\n     */\n    tMin: number;\n    /**\n     * The ray parameter for intersection that is \"more\" along the ray direction.\n     * Note that this value can be negative, meaning that this intersection occurred before the ray's origin.\n     * The intersection point can be computed as `origin + direction * tMax`.\n     */\n    tMax: number;\n} | null;\n\nexport class VerticalPerspectiveTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        return this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number): void {\n        this._helper.resize(width, height);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number { \n        return this._helper.nearZ; \n    }\n    public get farZ(): number { \n        return this._helper.farZ; \n    }\n    public get autoCalculateNearFarZ(): boolean { \n        return this._helper.autoCalculateNearFarZ; \n    }\n    setTransitionState(_value: number): void {\n        // Do nothing\n    }\n    //\n    // Implementation of globe transform\n    //\n\n    private _cachedClippingPlane: vec4 = createVec4f64();\n    private _cachedFrustum: Frustum;\n    private _projectionMatrix: mat4 = createIdentityMat4f64();\n    private _globeViewProjMatrix32f: mat4 = createIdentityMat4f32(); // Must be 32 bit floats, otherwise WebGL calls in Chrome get very slow.\n    private _globeViewProjMatrixNoCorrection: mat4 = createIdentityMat4f64();\n    private _globeViewProjMatrixNoCorrectionInverted: mat4 = createIdentityMat4f64();\n    private _globeProjMatrixInverted: mat4 = createIdentityMat4f64();\n\n    private _cameraPosition: vec3 = createVec3f64();\n    private _globeLatitudeErrorCorrectionRadians: number = 0;\n    /**\n     * Globe projection can smoothly interpolate between globe view and mercator. This variable controls this interpolation.\n     * Value 0 is mercator, value 1 is globe, anything between is an interpolation between the two projections.\n     */\n\n    private _coveringTilesDetailsProvider: GlobeCoveringTilesDetailsProvider;\n\n    public constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => { this._calcMatrices(); },\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._coveringTilesDetailsProvider = new GlobeCoveringTilesDetailsProvider();\n    }\n\n    clone(): ITransform {\n        const clone = new VerticalPerspectiveTransform();\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean, globeLatitudeErrorCorrectionRadians?: number): void {\n        this._globeLatitudeErrorCorrectionRadians = globeLatitudeErrorCorrectionRadians || 0;\n        this._helper.apply(that, constrain);\n    }\n\n    public get projectionMatrix(): mat4 { return this._projectionMatrix; }\n\n    public get modelViewProjectionMatrix(): mat4 { return this._globeViewProjMatrixNoCorrection; }\n\n    public get inverseProjectionMatrix(): mat4 { return this._globeProjMatrixInverted; }\n\n    public get cameraPosition(): vec3 {\n        // Return a copy - don't let outside code mutate our precomputed camera position.\n        const copy = createVec3f64(); // Ensure the resulting vector is float64s\n        copy[0] = this._cameraPosition[0];\n        copy[1] = this._cameraPosition[1];\n        copy[2] = this._cameraPosition[2];\n        return copy;\n    }\n\n    get cameraToCenterDistance(): number {\n        // Globe uses the same cameraToCenterDistance as mercator.\n        return this._helper.cameraToCenterDistance;\n    }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const {overscaledTileID, applyGlobeMatrix} = params;\n        const mercatorTileCoordinates = this._helper.getMercatorTileCoordinates(overscaledTileID);\n        return {\n            mainMatrix: this._globeViewProjMatrix32f,\n            tileMercatorCoords: mercatorTileCoordinates,\n            clippingPlane: this._cachedClippingPlane as [number, number, number, number],\n            projectionTransition: applyGlobeMatrix ? 1 : 0,\n            fallbackMatrix: this._globeViewProjMatrix32f,\n        };\n    }\n\n    private _computeClippingPlane(globeRadiusPixels: number): vec4 {\n        // We want to compute a plane equation that, when applied to the unit sphere generated\n        // in the vertex shader, places all visible parts of the sphere into the positive half-space\n        // and all the non-visible parts in the negative half-space.\n        // We can then use that to accurately clip all non-visible geometry.\n\n        // cam....------------A\n        //        ....        |\n        //            ....    |\n        //                ....B\n        //                ggggggggg\n        //          gggggg    |   .gggggg\n        //       ggg          |       ...ggg    ^\n        //     gg             |                 |\n        //    g               |                 y\n        //    g               |                 |\n        //   g                C                 #---x--->\n        //\n        // Notes:\n        // - note the coordinate axes\n        // - \"g\" marks the globe edge\n        // - the dotted line is the camera center \"ray\" - we are looking in this direction\n        // - \"cam\" is camera origin\n        // - \"C\" is globe center\n        // - \"B\" is the point on \"top\" of the globe - camera is looking at B - \"B\" is the intersection between the camera center ray and the globe\n        // - this._pitchInRadians is the angle at B between points cam,B,A\n        // - this.cameraToCenterDistance is the distance from camera to \"B\"\n        // - globe radius is (0.5 * this.worldSize)\n        // - \"T\" is any point where a tangent line from \"cam\" touches the globe surface\n        // - elevation is assumed to be zero - globe rendering must be separate from terrain rendering anyway\n\n        const pitch = this.pitchInRadians;\n        // scale things so that the globe radius is 1\n        const distanceCameraToB = this.cameraToCenterDistance / globeRadiusPixels;\n        const radius = 1;\n\n        // Distance from camera to \"A\" - the point at the same elevation as camera, right above center point on globe\n        const distanceCameraToA = Math.sin(pitch) * distanceCameraToB;\n        // Distance from \"A\" to \"C\"\n        const distanceAtoC = (Math.cos(pitch) * distanceCameraToB + radius);\n        // Distance from camera to \"C\" - the globe center\n        const distanceCameraToC = Math.sqrt(distanceCameraToA * distanceCameraToA + distanceAtoC * distanceAtoC);\n        // cam - C - T angle cosine (at C)\n        const camCTcosine = radius / distanceCameraToC;\n        // Distance from globe center to the plane defined by all possible \"T\" points\n        const tangentPlaneDistanceToC = camCTcosine * radius;\n\n        let vectorCtoCamX = -distanceCameraToA;\n        let vectorCtoCamY = distanceAtoC;\n        // Normalize the vector\n        const vectorCtoCamLength = Math.sqrt(vectorCtoCamX * vectorCtoCamX + vectorCtoCamY * vectorCtoCamY);\n        vectorCtoCamX /= vectorCtoCamLength;\n        vectorCtoCamY /= vectorCtoCamLength;\n\n        // Note the swizzled components\n        const planeVector: vec3 = [0, vectorCtoCamX, vectorCtoCamY];\n        // Apply transforms - lat, lng and angle (NOT pitch - already accounted for, as it affects the tangent plane)\n        vec3.rotateZ(planeVector, planeVector, [0, 0, 0], -this.bearingInRadians);\n        vec3.rotateX(planeVector, planeVector, [0, 0, 0], -1 * this.center.lat * Math.PI / 180.0);\n        vec3.rotateY(planeVector, planeVector, [0, 0, 0], this.center.lng * Math.PI / 180.0);\n        // Normalize the plane vector\n        const scale = 1 / vec3.length(planeVector);\n        vec3.scale(planeVector, planeVector, scale);\n        return [...planeVector, -tangentPlaneDistanceToC * scale];\n    }\n\n    public isLocationOccluded(location: LngLat): boolean {\n        return !this.isSurfacePointVisible(angularCoordinatesToSurfaceVector(location));\n    }\n\n    public transformLightDirection(dir: vec3): vec3 {\n        const sphereX = this._helper._center.lng * Math.PI / 180.0;\n        const sphereY = this._helper._center.lat * Math.PI / 180.0;\n\n        const len = Math.cos(sphereY);\n        const spherePos: vec3 = [\n            Math.sin(sphereX) * len,\n            Math.sin(sphereY),\n            Math.cos(sphereX) * len\n        ];\n\n        const axisRight: vec3 = [spherePos[2], 0.0, -spherePos[0]]; // Equivalent to cross(vec3(0.0, 1.0, 0.0), vec)\n        const axisDown: vec3 = [0, 0, 0];\n        vec3.cross(axisDown, axisRight, spherePos);\n        vec3.normalize(axisRight, axisRight);\n        vec3.normalize(axisDown, axisDown);\n\n        const transformed: vec3 = [\n            axisRight[0] * dir[0] + axisDown[0] * dir[1] + spherePos[0] * dir[2],\n            axisRight[1] * dir[0] + axisDown[1] * dir[1] + spherePos[1] * dir[2],\n            axisRight[2] * dir[0] + axisDown[2] * dir[1] + spherePos[2] * dir[2]\n        ];\n\n        const normalized: vec3 = [0, 0, 0];\n        vec3.normalize(normalized, transformed);\n        return normalized;\n    }\n\n    public getPixelScale(): number {\n        return 1.0 / Math.cos(this._helper._center.lat * Math.PI / 180);\n    }\n\n    public getCircleRadiusCorrection(): number {\n        return Math.cos(this._helper._center.lat * Math.PI / 180);\n    }\n\n    public getPitchedTextCorrection(textAnchorX: number, textAnchorY: number, tileID: UnwrappedTileID): number {\n        const mercator = tileCoordinatesToMercatorCoordinates(textAnchorX, textAnchorY, tileID.canonical);\n        const angular = mercatorCoordinatesToAngularCoordinatesRadians(mercator.x, mercator.y);\n        return this.getCircleRadiusCorrection() / Math.cos(angular[1]);\n    }\n\n    public projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        const canonical = unwrappedTileID.canonical;\n        const spherePos = projectTileCoordinatesToSphere(x, y, canonical.x, canonical.y, canonical.z);\n        const elevation = getElevation ? getElevation(x, y) : 0.0;\n        const vectorMultiplier = 1.0 + elevation / earthRadius;\n        const pos: vec4 = [spherePos[0] * vectorMultiplier, spherePos[1] * vectorMultiplier, spherePos[2] * vectorMultiplier, 1];\n        vec4.transformMat4(pos, pos, this._globeViewProjMatrixNoCorrection);\n\n        // Also check whether the point projects to the backfacing side of the sphere.\n        const plane = this._cachedClippingPlane;\n        // dot(position on sphere, occlusion plane equation)\n        const dotResult = plane[0] * spherePos[0] + plane[1] * spherePos[1] + plane[2] * spherePos[2] + plane[3];\n        const isOccluded = dotResult < 0.0;\n\n        return {\n            point: new Point(pos[0] / pos[3], pos[1] / pos[3]),\n            signedDistanceFromCamera: pos[3],\n            isOccluded\n        };\n    }\n\n    private _calcMatrices(): void {\n        if (!this._helper._width || !this._helper._height) {\n            return;\n        }\n\n        const globeRadiusPixels = getGlobeRadiusPixels(this.worldSize, this.center.lat);\n\n        // Construct a completely separate matrix for globe view\n        const globeMatrix = createMat4f64();\n        const globeMatrixUncorrected = createMat4f64();\n        if (this._helper.autoCalculateNearFarZ) {\n            this._helper._nearZ = 0.5;\n            this._helper._farZ = this.cameraToCenterDistance + globeRadiusPixels * 2.0; // just set the far plane far enough - we will calculate our own z in the vertex shader anyway\n        }\n        mat4.perspective(globeMatrix, this.fovInRadians, this.width / this.height, this._helper._nearZ, this._helper._farZ);\n\n        // Apply center of perspective offset\n        const offset = this.centerOffset;\n        globeMatrix[8] = -offset.x * 2 / this._helper._width;\n        globeMatrix[9] = offset.y * 2 / this._helper._height;\n        this._projectionMatrix = mat4.clone(globeMatrix);\n\n        this._globeProjMatrixInverted = createMat4f64();\n        mat4.invert(this._globeProjMatrixInverted, globeMatrix);\n        mat4.translate(globeMatrix, globeMatrix, [0, 0, -this.cameraToCenterDistance]);\n        mat4.rotateZ(globeMatrix, globeMatrix, this.rollInRadians);\n        mat4.rotateX(globeMatrix, globeMatrix, -this.pitchInRadians);\n        mat4.rotateZ(globeMatrix, globeMatrix, this.bearingInRadians);\n        mat4.translate(globeMatrix, globeMatrix, [0.0, 0, -globeRadiusPixels]);\n        // Rotate the sphere to center it on viewed coordinates\n\n        const scaleVec = createVec3f64();\n        scaleVec[0] = globeRadiusPixels;\n        scaleVec[1] = globeRadiusPixels;\n        scaleVec[2] = globeRadiusPixels;\n\n        // Keep a atan-correction-free matrix for transformations done on the CPU with accurate math\n        mat4.rotateX(globeMatrixUncorrected, globeMatrix, this.center.lat * Math.PI / 180.0);\n        mat4.rotateY(globeMatrixUncorrected, globeMatrixUncorrected, -this.center.lng * Math.PI / 180.0);\n        mat4.scale(globeMatrixUncorrected, globeMatrixUncorrected, scaleVec); // Scale the unit sphere to a sphere with diameter of 1\n        this._globeViewProjMatrixNoCorrection = globeMatrixUncorrected;\n\n        mat4.rotateX(globeMatrix, globeMatrix, this.center.lat * Math.PI / 180.0 - this._globeLatitudeErrorCorrectionRadians);\n        mat4.rotateY(globeMatrix, globeMatrix, -this.center.lng * Math.PI / 180.0);\n        mat4.scale(globeMatrix, globeMatrix, scaleVec); // Scale the unit sphere to a sphere with diameter of 1\n        this._globeViewProjMatrix32f = new Float32Array(globeMatrix);\n\n        this._globeViewProjMatrixNoCorrectionInverted = createMat4f64();\n        mat4.invert(this._globeViewProjMatrixNoCorrectionInverted, globeMatrixUncorrected);\n\n        const zero = createVec3f64();\n        this._cameraPosition = createVec3f64();\n        this._cameraPosition[2] = this.cameraToCenterDistance / globeRadiusPixels;\n        vec3.rotateZ(this._cameraPosition, this._cameraPosition, zero, -this.rollInRadians);\n        vec3.rotateX(this._cameraPosition, this._cameraPosition, zero, this.pitchInRadians);\n        vec3.rotateZ(this._cameraPosition, this._cameraPosition, zero, -this.bearingInRadians);\n        vec3.add(this._cameraPosition, this._cameraPosition, [0, 0, 1]);\n        vec3.rotateX(this._cameraPosition, this._cameraPosition, zero, -this.center.lat * Math.PI / 180.0);\n        vec3.rotateY(this._cameraPosition, this._cameraPosition, zero, this.center.lng * Math.PI / 180.0);\n\n        this._cachedClippingPlane = this._computeClippingPlane(globeRadiusPixels);\n\n        const matrix = mat4.clone(this._globeViewProjMatrixNoCorrectionInverted);\n        mat4.scale(matrix, matrix, [1, 1, -1]);\n        this._cachedFrustum = Frustum.fromInvProjectionMatrix(matrix, 1, 0, this._cachedClippingPlane, true);\n    }\n\n    calculateFogMatrix(_unwrappedTileID: UnwrappedTileID): mat4 {\n        warnOnce('calculateFogMatrix is not supported on globe projection.');\n        const m = createMat4f64();\n        mat4.identity(m);\n        return m;\n    }\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[] {\n        // Globe has no wrap.\n        return [new UnwrappedTileID(0, tileID)];\n    }\n\n    getCameraFrustum(): Frustum {\n        return this._cachedFrustum;\n    }\n    getClippingPlane(): vec4 | null {\n        return this._cachedClippingPlane;\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this._coveringTilesDetailsProvider;\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        if (terrain) {\n            warnOnce('terrain is not fully supported on vertical perspective projection.');\n        }\n        this._helper.recalculateZoomAndCenter(0);\n    }\n\n    maxPitchScaleFactor(): number {\n        // In mercaltor it uses the pixelMatrix, but this is not available here...\n        return 1;\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        return this._helper.getCameraLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number): number {\n        if (!this._globeViewProjMatrixNoCorrection) {\n            return 1.0; // _calcMatrices hasn't run yet\n        }\n        const vec = angularCoordinatesToSurfaceVector(lngLat);\n        vec3.scale(vec, vec, (1.0 + elevation / earthRadius));\n        const result = createVec4f64();\n        vec4.transformMat4(result, [vec[0], vec[1], vec[2], 1], this._globeViewProjMatrixNoCorrection);\n        return result[2] / result[3];\n    }\n\n    populateCache(_coords: OverscaledTileID[]): void {\n        // Do nothing\n    }\n\n    getBounds(): LngLatBounds {\n        const xMid = this.width * 0.5;\n        const yMid = this.height * 0.5;\n\n        // LngLat extremes will probably tend to be in screen corners or in middle of screen edges.\n        // These test points should result in a pretty good approximation.\n        const testPoints = [\n            new Point(0, 0),\n            new Point(xMid, 0),\n            new Point(this.width, 0),\n            new Point(this.width, yMid),\n            new Point(this.width, this.height),\n            new Point(xMid, this.height),\n            new Point(0, this.height),\n            new Point(0, yMid),\n        ];\n\n        const projectedPoints = [];\n        for (const p of testPoints) {\n            projectedPoints.push(this.unprojectScreenPoint(p));\n        }\n\n        // We can't construct a simple min/max aabb, since points might lie on either side of the antimeridian.\n        // We will instead compute the furthest points relative to map center.\n        // We also take advantage of the fact that `unprojectScreenPoint` will snap pixels\n        // outside the planet to the closest point on the planet's horizon.\n        let mostEast = 0, mostWest = 0, mostNorth = 0, mostSouth = 0; // We will store these values signed.\n        const center = this.center;\n        for (const p of projectedPoints) {\n            const dLng = differenceOfAnglesDegrees(center.lng, p.lng);\n            const dLat = differenceOfAnglesDegrees(center.lat, p.lat);\n            if (dLng < mostWest) {\n                mostWest = dLng;\n            }\n            if (dLng > mostEast) {\n                mostEast = dLng;\n            }\n            if (dLat < mostSouth) {\n                mostSouth = dLat;\n            }\n            if (dLat > mostNorth) {\n                mostNorth = dLat;\n            }\n        }\n\n        const boundsArray: [number, number, number, number] = [\n            center.lng + mostWest,  // west\n            center.lat + mostSouth, // south\n            center.lng + mostEast,  // east\n            center.lat + mostNorth  // north\n        ];\n\n        // Sometimes the poles might end up not being on the horizon,\n        // thus not being detected as the northernmost/southernmost points.\n        // We fix that here.\n        if (this.isSurfacePointOnScreen([0, 1, 0])) {\n            // North pole is visible\n            // This also means that the entire longitude range must be visible\n            boundsArray[3] = 90;\n            boundsArray[0] = -180;\n            boundsArray[2] = 180;\n        }\n        if (this.isSurfacePointOnScreen([0, -1, 0])) {\n            // South pole is visible\n            boundsArray[1] = -90;\n            boundsArray[0] = -180;\n            boundsArray[2] = 180;\n        }\n\n        return new LngLatBounds(boundsArray);\n    }\n\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        // Globe: TODO: respect _lngRange, _latRange\n        // It is possible to implement exact constrain for globe, but I don't think it is worth the effort.\n        const constrainedLat = clamp(lngLat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);\n        const constrainedZoom = clamp(+zoom, this.minZoom + getZoomAdjustment(0, constrainedLat), this.maxZoom);\n        return {\n            center: new LngLat(\n                lngLat.lng,\n                constrainedLat\n            ),\n            zoom: constrainedZoom\n        };\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lngLat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lngLat, alt, bearing, pitch);\n    }\n\n    /**\n     * Note: automatically adjusts zoom to keep planet size consistent\n     * (same size before and after a {@link setLocationAtPoint} call).\n     */\n    setLocationAtPoint(lnglat: LngLat, point: Point): void {\n        // This returns some fake coordinates for pixels that do not lie on the planet.\n        // Whatever uses this `setLocationAtPoint` function will need to account for that.\n        const pointLngLat = this.unprojectScreenPoint(point);\n        const vecToPixelCurrent = angularCoordinatesToSurfaceVector(pointLngLat);\n        const vecToTarget = angularCoordinatesToSurfaceVector(lnglat);\n\n        const zero = createVec3f64();\n        vec3.zero(zero);\n\n        const rotatedPixelVector = createVec3f64();\n        vec3.rotateY(rotatedPixelVector, vecToPixelCurrent, zero, -this.center.lng * Math.PI / 180.0);\n        vec3.rotateX(rotatedPixelVector, rotatedPixelVector, zero, this.center.lat * Math.PI / 180.0);\n\n        // We are looking for the lng,lat that will rotate `vecToTarget`\n        // so that it is equal to `rotatedPixelVector`.\n\n        // The second rotation around X axis cannot change the X component,\n        // so we first must find the longitude such that rotating `vecToTarget` with it\n        // will place it so its X component is equal to X component of `rotatedPixelVector`.\n        // There will exist zero, one or two longitudes that satisfy this.\n\n        //      x  |\n        //     /   |\n        //    /    | the line is the target X - rotatedPixelVector.x\n        //   /     | the x is vecToTarget projected to x,z plane\n        //  .      | the dot is origin\n        //\n        // We need to rotate vecToTarget so that it intersects the line.\n        // If vecToTarget is shorter than the distance to the line from origin, it is impossible.\n\n        // Otherwise, we compute the intersection of the line with a ring with radius equal to\n        // length of vecToTarget projected to XZ plane.\n\n        const vecToTargetXZLengthSquared = vecToTarget[0] * vecToTarget[0] + vecToTarget[2] * vecToTarget[2];\n        const targetXSquared = rotatedPixelVector[0] * rotatedPixelVector[0];\n        if (vecToTargetXZLengthSquared < targetXSquared) {\n            // Zero solutions - setLocationAtPoint is impossible.\n            return;\n        }\n\n        // The intersection's Z coordinates\n        const intersectionA = Math.sqrt(vecToTargetXZLengthSquared - targetXSquared);\n        const intersectionB = -intersectionA; // the second solution\n\n        const lngA = angleToRotateBetweenVectors2D(vecToTarget[0], vecToTarget[2], rotatedPixelVector[0], intersectionA);\n        const lngB = angleToRotateBetweenVectors2D(vecToTarget[0], vecToTarget[2], rotatedPixelVector[0], intersectionB);\n\n        const vecToTargetLngA = createVec3f64();\n        vec3.rotateY(vecToTargetLngA, vecToTarget, zero, -lngA);\n        const latA = angleToRotateBetweenVectors2D(vecToTargetLngA[1], vecToTargetLngA[2], rotatedPixelVector[1], rotatedPixelVector[2]);\n        const vecToTargetLngB = createVec3f64();\n        vec3.rotateY(vecToTargetLngB, vecToTarget, zero, -lngB);\n        const latB = angleToRotateBetweenVectors2D(vecToTargetLngB[1], vecToTargetLngB[2], rotatedPixelVector[1], rotatedPixelVector[2]);\n        // Is at least one of the needed latitudes valid?\n\n        const limit = Math.PI * 0.5;\n\n        const isValidA = latA >= -limit && latA <= limit;\n        const isValidB = latB >= -limit && latB <= limit;\n\n        let validLng: number;\n        let validLat: number;\n        if (isValidA && isValidB) {\n            // Pick the solution that is closer to current map center.\n            const centerLngRadians = this.center.lng * Math.PI / 180.0;\n            const centerLatRadians = this.center.lat * Math.PI / 180.0;\n            const lngDistA = distanceOfAnglesRadians(lngA, centerLngRadians);\n            const latDistA = distanceOfAnglesRadians(latA, centerLatRadians);\n            const lngDistB = distanceOfAnglesRadians(lngB, centerLngRadians);\n            const latDistB = distanceOfAnglesRadians(latB, centerLatRadians);\n\n            if ((lngDistA + latDistA) < (lngDistB + latDistB)) {\n                validLng = lngA;\n                validLat = latA;\n            } else {\n                validLng = lngB;\n                validLat = latB;\n            }\n        } else if (isValidA) {\n            validLng = lngA;\n            validLat = latA;\n        } else if (isValidB) {\n            validLng = lngB;\n            validLat = latB;\n        } else {\n            // No solution.\n            return;\n        }\n\n        const newLng = validLng / Math.PI * 180;\n        const newLat = validLat / Math.PI * 180;\n        const oldLat = this.center.lat;\n        this.setCenter(new LngLat(newLng, clamp(newLat, -90, 90)));\n        this.setZoom(this.zoom + getZoomAdjustment(oldLat, this.center.lat));\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        const pos = angularCoordinatesToSurfaceVector(lnglat);\n\n        if (terrain) {\n            const elevation = terrain.getElevationForLngLatZoom(lnglat, this._helper._tileZoom);\n            vec3.scale(pos, pos, 1.0 + elevation / earthRadius);\n        }\n\n        return this._projectSurfacePointToScreen(pos);\n    }\n\n    /**\n     * Projects a given vector on the surface of a unit sphere (or possible above the surface)\n     * and returns its coordinates on screen in pixels.\n     */\n    private _projectSurfacePointToScreen(pos: vec3): Point {\n        const projected = createVec4f64();\n        vec4.transformMat4(projected, [...pos, 1] as vec4, this._globeViewProjMatrixNoCorrection);\n        projected[0] /= projected[3];\n        projected[1] /= projected[3];\n        return new Point(\n            (projected[0] * 0.5 + 0.5) * this.width,\n            (-projected[1] * 0.5 + 0.5) * this.height\n        );\n    }\n\n    screenPointToMercatorCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        if (terrain) {\n            // Mercator has terrain handling implemented properly and since terrain\n            // simply draws tile coordinates into a special framebuffer, this works well even for globe.\n            const coordinate = terrain.pointCoordinate(p);\n            if (coordinate) {\n                return coordinate;\n            }\n        }\n        return MercatorCoordinate.fromLngLat(this.unprojectScreenPoint(p));\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.screenPointToMercatorCoordinate(p, terrain)?.toLngLat();\n    }\n\n    isPointOnMapSurface(p: Point, _terrain?: Terrain): boolean {\n        const rayOrigin = this._cameraPosition;\n        const rayDirection = this.getRayDirectionFromPixel(p);\n\n        const intersection = this.rayPlanetIntersection(rayOrigin, rayDirection);\n\n        return !!intersection;\n    }\n\n    /**\n     * Computes normalized direction of a ray from the camera to the given screen pixel.\n     */\n    getRayDirectionFromPixel(p: Point): vec3 {\n        const pos = createVec4f64();\n        pos[0] = (p.x / this.width) * 2.0 - 1.0;\n        pos[1] = ((p.y / this.height) * 2.0 - 1.0) * -1.0;\n        pos[2] = 1;\n        pos[3] = 1;\n        vec4.transformMat4(pos, pos, this._globeViewProjMatrixNoCorrectionInverted);\n        pos[0] /= pos[3];\n        pos[1] /= pos[3];\n        pos[2] /= pos[3];\n        const ray = createVec3f64();\n        ray[0] = pos[0] - this._cameraPosition[0];\n        ray[1] = pos[1] - this._cameraPosition[1];\n        ray[2] = pos[2] - this._cameraPosition[2];\n        const rayNormalized: vec3 = createVec3f64();\n        vec3.normalize(rayNormalized, ray);\n        return rayNormalized;\n    }\n\n    /**\n     * For a given point on the unit sphere of the planet, returns whether it is visible from\n     * camera's position (not taking into account camera rotation at all).\n     */\n    private isSurfacePointVisible(p: vec3): boolean {\n        const plane = this._cachedClippingPlane;\n        // dot(position on sphere, occlusion plane equation)\n        const dotResult = plane[0] * p[0] + plane[1] * p[1] + plane[2] * p[2] + plane[3];\n        return dotResult >= 0.0;\n    }\n\n    /**\n     * Returns whether surface point is visible on screen.\n     * It must both project to a pixel in screen bounds and not be occluded by the planet.\n     */\n    private isSurfacePointOnScreen(vec: vec3): boolean {\n        if (!this.isSurfacePointVisible(vec)) {\n            return false;\n        }\n\n        const projected = createVec4f64();\n        vec4.transformMat4(projected, [...vec, 1] as vec4, this._globeViewProjMatrixNoCorrection);\n        projected[0] /= projected[3];\n        projected[1] /= projected[3];\n        projected[2] /= projected[3];\n        return projected[0] > -1 && projected[0] < 1 &&\n            projected[1] > -1 && projected[1] < 1 &&\n            projected[2] > -1 && projected[2] < 1;\n    }\n\n    /**\n     * Returns the two intersection points of the ray and the planet's sphere,\n     * or null if no intersection occurs.\n     * The intersections are encoded as the parameter for parametric ray equation,\n     * with `tMin` being the first intersection and `tMax` being the second.\n     * Eg. the nearer intersection point can then be computed as `origin + direction * tMin`.\n     * @param origin - The ray origin.\n     * @param direction - The normalized ray direction.\n     */\n    private rayPlanetIntersection(origin: vec3, direction: vec3): RaySphereIntersection {\n        const originDotDirection = vec3.dot(origin, direction);\n        const planetRadiusSquared = 1.0; // planet is a unit sphere, so its radius squared is 1\n\n        // Ray-sphere intersection involves a quadratic equation.\n        // However solving it in the traditional schoolbook way leads to floating point precision issues.\n        // Here we instead use the approach suggested in the book Ray Tracing Gems, chapter 7.\n        // https://www.realtimerendering.com/raytracinggems/rtg/index.html\n        const inner = createVec3f64();\n        const scaledDir = createVec3f64();\n        vec3.scale(scaledDir, direction, originDotDirection);\n        vec3.sub(inner, origin, scaledDir);\n        const discriminant = planetRadiusSquared - vec3.dot(inner, inner);\n\n        if (discriminant < 0) {\n            return null;\n        }\n\n        const c = vec3.dot(origin, origin) - planetRadiusSquared;\n        const q = -originDotDirection + (originDotDirection < 0 ? 1 : -1) * Math.sqrt(discriminant);\n        const t0 = c / q;\n        const t1 = q;\n        // Assume the ray origin is never inside the sphere\n        const tMin = Math.min(t0, t1);\n        const tMax = Math.max(t0, t1);\n        return {\n            tMin,\n            tMax\n        };\n    }\n\n    /**\n     * @internal\n     * Returns a {@link LngLat} representing geographical coordinates that correspond to the specified pixel coordinates.\n     * Note: if the point does not lie on the globe, returns a location on the visible globe horizon (edge) that is\n     * as close to the point as possible.\n     * @param p - Screen point in pixels to unproject.\n     * @param terrain - Optional terrain.\n     */\n    private unprojectScreenPoint(p: Point): LngLat {\n        // Here we compute the intersection of the ray towards the pixel at `p` and the planet sphere.\n        // As always, we assume that the planet is centered at 0,0,0 and has radius 1.\n        // Ray origin is `_cameraPosition` and direction is `rayNormalized`.\n        const rayOrigin = this._cameraPosition;\n        const rayDirection = this.getRayDirectionFromPixel(p);\n        const intersection = this.rayPlanetIntersection(rayOrigin, rayDirection);\n\n        if (intersection) {\n            // Ray intersects the sphere -> compute intersection LngLat.\n            // Assume the ray origin is never inside the sphere - just use tMin\n            const intersectionPoint = createVec3f64();\n            vec3.add(intersectionPoint, rayOrigin, [\n                rayDirection[0] * intersection.tMin,\n                rayDirection[1] * intersection.tMin,\n                rayDirection[2] * intersection.tMin\n            ]);\n            const sphereSurface = createVec3f64();\n            vec3.normalize(sphereSurface, intersectionPoint);\n            return sphereSurfacePointToCoordinates(sphereSurface);\n        }\n\n        // Ray does not intersect the sphere -> find the closest point on the horizon to the ray.\n        // Intersect the ray with the clipping plane, since we know that the intersection of the clipping plane and the sphere is the horizon.\n        const horizonPlane = this._cachedClippingPlane;\n        const directionDotPlaneXyz = horizonPlane[0] * rayDirection[0] + horizonPlane[1] * rayDirection[1] + horizonPlane[2] * rayDirection[2];\n        const originToPlaneDistance = pointPlaneSignedDistance(horizonPlane, rayOrigin);\n        const distanceToIntersection = -originToPlaneDistance / directionDotPlaneXyz;\n\n        const maxRayLength = 2.0; // One globe diameter\n        const planeIntersection = createVec3f64();\n\n        if (distanceToIntersection > 0) {\n            vec3.add(planeIntersection, rayOrigin, [\n                rayDirection[0] * distanceToIntersection,\n                rayDirection[1] * distanceToIntersection,\n                rayDirection[2] * distanceToIntersection\n            ]);\n        } else {\n            // When the ray takes too long to hit the plane (>maxRayLength), or if the plane intersection is behind the camera, handle things differently.\n            // Take a point along the ray at distance maxRayLength, project it to clipping plane, then continue as normal to find the horizon point.\n            const distantPoint = createVec3f64();\n            vec3.add(distantPoint, rayOrigin, [\n                rayDirection[0] * maxRayLength,\n                rayDirection[1] * maxRayLength,\n                rayDirection[2] * maxRayLength\n            ]);\n            const distanceFromPlane = pointPlaneSignedDistance(this._cachedClippingPlane, distantPoint);\n            vec3.sub(planeIntersection, distantPoint, [\n                this._cachedClippingPlane[0] * distanceFromPlane,\n                this._cachedClippingPlane[1] * distanceFromPlane,\n                this._cachedClippingPlane[2] * distanceFromPlane\n            ]);\n        }\n\n        const horizonDisk = horizonPlaneToCenterAndRadius(horizonPlane);\n        const closestOnHorizon = clampToSphere(horizonDisk.center, horizonDisk.radius, planeIntersection);\n\n        return sphereSurfacePointToCoordinates(closestOnHorizon);\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        const lnglat = LngLat.convert(location);\n        const scale = 1.0 / earthRadius;\n\n        const m = createIdentityMat4f64();\n        mat4.rotateY(m, m, lnglat.lng / 180.0 * Math.PI);\n        mat4.rotateX(m, m, -lnglat.lat / 180.0 * Math.PI);\n        mat4.translate(m, m, [0, 0, 1 + altitude / earthRadius]);\n        mat4.rotateX(m, m, Math.PI * 0.5);\n        mat4.scale(m, m, [scale, scale, scale]);\n        return m;\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const globeData = this.getProjectionData({overscaledTileID: new OverscaledTileID(0, 0, 0, 0, 0), applyGlobeMatrix});\n        globeData.tileMercatorCoords = [0, 0, 1, 1];\n        return globeData;\n    }\n\n    getFastPathSimpleProjectionMatrix(_tileID: OverscaledTileID): mat4 {\n        return undefined;\n    }\n}\n","import type {mat2, mat4, vec3, vec4} from 'gl-matrix';\nimport {TransformHelper} from '../transform_helper';\nimport {MercatorTransform} from './mercator_transform';\nimport {VerticalPerspectiveTransform} from './vertical_perspective_transform';\nimport {type LngLat, type LngLatLike,} from '../lng_lat';\nimport {lerp} from '../../util/util';\nimport type {OverscaledTileID, UnwrappedTileID, CanonicalTileID} from '../../tile/tile_id';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {MercatorCoordinate} from '../mercator_coordinate';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {Frustum} from '../../util/primitives/frustum';\nimport type {Terrain} from '../../render/terrain';\nimport type {PointProjection} from '../../symbol/projection';\nimport type {IReadonlyTransform, ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {TransformOptions} from '../transform_helper';\nimport type {PaddingOptions} from '../edge_insets';\nimport type {ProjectionData, ProjectionDataParams} from './projection_data';\nimport type {CoveringTilesDetailsProvider} from './covering_tiles_details_provider';\n\n/**\n * Globe transform is a transform that moves between vertical perspective and mercator projections.\n */\nexport class GlobeTransform implements ITransform {\n    private _helper: TransformHelper;\n\n    //\n    // Implementation of transform getters and setters\n    //\n\n    get pixelsToClipSpaceMatrix(): mat4 {\n        return this._helper.pixelsToClipSpaceMatrix;\n    }\n    get clipSpaceToPixelsMatrix(): mat4 {\n        return this._helper.clipSpaceToPixelsMatrix;\n    }\n    get pixelsToGLUnits(): [number, number] {\n        return this._helper.pixelsToGLUnits;\n    }\n    get centerOffset(): Point {\n        return this._helper.centerOffset;\n    }\n    get size(): Point {\n        return this._helper.size;\n    }\n    get rotationMatrix(): mat2 {\n        return this._helper.rotationMatrix;\n    }\n    get centerPoint(): Point {\n        return this._helper.centerPoint;\n    }\n    get pixelsPerMeter(): number {\n        return this._helper.pixelsPerMeter;\n    }\n    setMinZoom(zoom: number): void {\n        this._helper.setMinZoom(zoom);\n    }\n    setMaxZoom(zoom: number): void {\n        this._helper.setMaxZoom(zoom);\n    }\n    setMinPitch(pitch: number): void {\n        this._helper.setMinPitch(pitch);\n    }\n    setMaxPitch(pitch: number): void {\n        this._helper.setMaxPitch(pitch);\n    }\n    setRenderWorldCopies(renderWorldCopies: boolean): void {\n        this._helper.setRenderWorldCopies(renderWorldCopies);\n    }\n    setBearing(bearing: number): void {\n        this._helper.setBearing(bearing);\n    }\n    setPitch(pitch: number): void {\n        this._helper.setPitch(pitch);\n    }\n    setRoll(roll: number): void {\n        this._helper.setRoll(roll);\n    }\n    setFov(fov: number): void {\n        this._helper.setFov(fov);\n    }\n    setZoom(zoom: number): void {\n        this._helper.setZoom(zoom);\n    }\n    setCenter(center: LngLat): void {\n        this._helper.setCenter(center);\n    }\n    setElevation(elevation: number): void {\n        this._helper.setElevation(elevation);\n    }\n    setMinElevationForCurrentTile(elevation: number): void {\n        this._helper.setMinElevationForCurrentTile(elevation);\n    }\n    setPadding(padding: PaddingOptions): void {\n        this._helper.setPadding(padding);\n    }\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void {\n        return this._helper.interpolatePadding(start, target, t);\n    }\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._helper.isPaddingEqual(padding);\n    }\n    resize(width: number, height: number, constrainTransform: boolean = true): void {\n        this._helper.resize(width, height, constrainTransform);\n    }\n    getMaxBounds(): LngLatBounds {\n        return this._helper.getMaxBounds();\n    }\n    setMaxBounds(bounds?: LngLatBounds): void {\n        this._helper.setMaxBounds(bounds);\n    }\n    setConstrainOverride(constrain?: TransformConstrainFunction | null): void {\n        this._helper.setConstrainOverride(constrain);\n    }\n    overrideNearFarZ(nearZ: number, farZ: number): void {\n        this._helper.overrideNearFarZ(nearZ, farZ);\n    }\n    clearNearFarZOverride(): void {\n        this._helper.clearNearFarZOverride();\n    }\n    getCameraQueryGeometry(queryGeometry: Point[]): Point[] {\n        return this._helper.getCameraQueryGeometry(this.getCameraPoint(), queryGeometry);\n    }\n\n    get tileSize(): number {\n        return this._helper.tileSize;\n    }\n    get tileZoom(): number {\n        return this._helper.tileZoom;\n    }\n    get scale(): number {\n        return this._helper.scale;\n    }\n    get worldSize(): number {\n        return this._helper.worldSize;\n    }\n    get width(): number {\n        return this._helper.width;\n    }\n    get height(): number {\n        return this._helper.height;\n    }\n    get lngRange(): [number, number] {\n        return this._helper.lngRange;\n    }\n    get latRange(): [number, number] {\n        return this._helper.latRange;\n    }\n    get minZoom(): number {\n        return this._helper.minZoom;\n    }\n    get maxZoom(): number {\n        return this._helper.maxZoom;\n    }\n    get zoom(): number {\n        return this._helper.zoom;\n    }\n    get center(): LngLat {\n        return this._helper.center;\n    }\n    get minPitch(): number {\n        return this._helper.minPitch;\n    }\n    get maxPitch(): number {\n        return this._helper.maxPitch;\n    }\n    get pitch(): number {\n        return this._helper.pitch;\n    }\n    get pitchInRadians(): number {\n        return this._helper.pitchInRadians;\n    }\n    get roll(): number {\n        return this._helper.roll;\n    }\n    get rollInRadians(): number {\n        return this._helper.rollInRadians;\n    }\n    get bearing(): number {\n        return this._helper.bearing;\n    }\n    get bearingInRadians(): number {\n        return this._helper.bearingInRadians;\n    }\n    get fov(): number {\n        return this._helper.fov;\n    }\n    get fovInRadians(): number {\n        return this._helper.fovInRadians;\n    }\n    get elevation(): number {\n        return this._helper.elevation;\n    }\n    get minElevationForCurrentTile(): number {\n        return this._helper.minElevationForCurrentTile;\n    }\n    get padding(): PaddingOptions {\n        return this._helper.padding;\n    }\n    get unmodified(): boolean {\n        return this._helper.unmodified;\n    }\n    get renderWorldCopies(): boolean {\n        return this._helper.renderWorldCopies;\n    }\n    get cameraToCenterDistance(): number {\n        return this._helper.cameraToCenterDistance;\n    }\n    get constrainOverride(): TransformConstrainFunction {\n        return this._helper.constrainOverride;\n    }\n    public get nearZ(): number { \n        return this._helper.nearZ; \n    }\n    public get farZ(): number { \n        return this._helper.farZ; \n    }\n    public get autoCalculateNearFarZ(): boolean { \n        return this._helper.autoCalculateNearFarZ; \n    }\n    //\n    // Implementation of globe transform\n    //\n\n    private _globeLatitudeErrorCorrectionRadians: number = 0;\n\n    /**\n     * True when globe render path should be used instead of the old but simpler mercator rendering.\n     * Globe automatically transitions to mercator at high zoom levels, which causes a switch from\n     * globe to mercator render path.\n     */\n    get isGlobeRendering(): boolean {\n        return this._globeness > 0;\n    }\n\n    setTransitionState(globeness: number, errorCorrectionValue: number): void {\n        this._globeness = globeness;\n        this._globeLatitudeErrorCorrectionRadians = errorCorrectionValue;\n        this._calcMatrices();\n        this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame();\n        this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame();\n    }\n\n    private get currentTransform(): ITransform {\n        return this.isGlobeRendering ? this._verticalPerspectiveTransform : this._mercatorTransform;\n    }\n\n    /**\n     * Globe projection can smoothly interpolate between globe view and mercator. This variable controls this interpolation.\n     * Value 0 is mercator, value 1 is globe, anything between is an interpolation between the two projections.\n     */\n    private _globeness: number = 1.0;\n    private _mercatorTransform: MercatorTransform;\n    private _verticalPerspectiveTransform: VerticalPerspectiveTransform;\n\n    public constructor(options?: TransformOptions) {\n        this._helper = new TransformHelper({\n            calcMatrices: () => { this._calcMatrices(); },\n            defaultConstrain: (center, zoom) => { return this.defaultConstrain(center, zoom); }\n        }, options);\n        this._globeness = 1; // When transform is cloned for use in symbols, `_updateAnimation` function which usually sets this value never gets called.\n        this._mercatorTransform = new MercatorTransform();\n        this._verticalPerspectiveTransform = new VerticalPerspectiveTransform();\n    }\n\n    clone(): ITransform {\n        const clone = new GlobeTransform();\n        clone._globeness = this._globeness;\n        clone._globeLatitudeErrorCorrectionRadians = this._globeLatitudeErrorCorrectionRadians;\n        clone.apply(this, false);\n        return clone;\n    }\n\n    public apply(that: IReadonlyTransform, constrain: boolean): void {\n        this._helper.apply(that, constrain);\n        this._mercatorTransform.apply(this, false);\n        this._verticalPerspectiveTransform.apply(this, false, this._globeLatitudeErrorCorrectionRadians);\n    }\n\n    public get projectionMatrix(): mat4 { return this.currentTransform.projectionMatrix; }\n\n    public get modelViewProjectionMatrix(): mat4 { return this.currentTransform.modelViewProjectionMatrix; }\n\n    public get inverseProjectionMatrix(): mat4 { return this.currentTransform.inverseProjectionMatrix; }\n\n    public get cameraPosition(): vec3 { return this.currentTransform.cameraPosition; }\n\n    getProjectionData(params: ProjectionDataParams): ProjectionData {\n        const mercatorProjectionData = this._mercatorTransform.getProjectionData(params);\n        const verticalPerspectiveProjectionData = this._verticalPerspectiveTransform.getProjectionData(params);\n\n        return {\n            mainMatrix: this.isGlobeRendering ? verticalPerspectiveProjectionData.mainMatrix : mercatorProjectionData.mainMatrix,\n            clippingPlane: verticalPerspectiveProjectionData.clippingPlane,\n            tileMercatorCoords: verticalPerspectiveProjectionData.tileMercatorCoords,\n            projectionTransition: params.applyGlobeMatrix ? this._globeness : 0,\n            fallbackMatrix: mercatorProjectionData.fallbackMatrix,\n        };\n    }\n\n    public isLocationOccluded(location: LngLat): boolean {\n        return this.currentTransform.isLocationOccluded(location);\n    }\n\n    public transformLightDirection(dir: vec3): vec3 {\n        return this.currentTransform.transformLightDirection(dir);\n    }\n\n    public getPixelScale(): number {\n        return lerp(this._mercatorTransform.getPixelScale(), this._verticalPerspectiveTransform.getPixelScale(), this._globeness);\n    }\n\n    public getCircleRadiusCorrection(): number {\n        return lerp(this._mercatorTransform.getCircleRadiusCorrection(), this._verticalPerspectiveTransform.getCircleRadiusCorrection(), this._globeness);\n    }\n\n    public getPitchedTextCorrection(textAnchorX: number, textAnchorY: number, tileID: UnwrappedTileID): number {\n        const mercatorCorrection = this._mercatorTransform.getPitchedTextCorrection(textAnchorX, textAnchorY, tileID);\n        const verticalCorrection = this._verticalPerspectiveTransform.getPitchedTextCorrection(textAnchorX, textAnchorY, tileID);\n        return lerp(mercatorCorrection, verticalCorrection, this._globeness);\n    }\n\n    public projectTileCoordinates(x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation: (x: number, y: number) => number): PointProjection {\n        return this.currentTransform.projectTileCoordinates(x, y, unwrappedTileID, getElevation);\n    }\n\n    private _calcMatrices(): void {\n        if (!this._helper._width || !this._helper._height) {\n            return;\n        }\n        // VerticalPerspective reads our near/farZ values and autoCalculateNearFarZ:\n        // - if autoCalculateNearFarZ is true then it computes globe Z values\n        // - if autoCalculateNearFarZ is false then it inherits our Z values\n        // In either case, its Z values are consistent with out settings and we want to copy its Z values to our helper.\n        this._verticalPerspectiveTransform.apply(this, false, this._globeLatitudeErrorCorrectionRadians);\n        this._helper._nearZ = this._verticalPerspectiveTransform.nearZ;\n        this._helper._farZ = this._verticalPerspectiveTransform.farZ;\n\n        // When transitioning between globe and mercator, we need to synchronize the depth values in both transforms.\n        // For this reason we first update vertical perspective and then sync our Z values to its result.\n        // Now if globe rendering, we always want to force mercator transform to adapt our Z values.\n        // If not, it will either compute its own (autoCalculateNearFarZ=false) or adapt our (autoCalculateNearFarZ=true).\n        // In either case we want to (again) sync our Z values, this time with\n        this._mercatorTransform.apply(this, true, this.isGlobeRendering);\n        this._helper._nearZ = this._mercatorTransform.nearZ;\n        this._helper._farZ = this._mercatorTransform.farZ;\n    }\n\n    calculateFogMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        return this.currentTransform.calculateFogMatrix(unwrappedTileID);\n    }\n\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[] {\n        return this.currentTransform.getVisibleUnwrappedCoordinates(tileID);\n    }\n\n    getCameraFrustum(): Frustum {\n        return this.currentTransform.getCameraFrustum();\n    }\n    getClippingPlane(): vec4 | null {\n        return this.currentTransform.getClippingPlane();\n    }\n    getCoveringTilesDetailsProvider(): CoveringTilesDetailsProvider {\n        return this.currentTransform.getCoveringTilesDetailsProvider();\n    }\n\n    recalculateZoomAndCenter(terrain?: Terrain): void {\n        this._mercatorTransform.recalculateZoomAndCenter(terrain);\n        this._verticalPerspectiveTransform.recalculateZoomAndCenter(terrain);\n    }\n\n    maxPitchScaleFactor(): number {\n        // Using mercator version of this should be good enough approximation for globe.\n        return this._mercatorTransform.maxPitchScaleFactor();\n    }\n\n    getCameraPoint(): Point {\n        return this._helper.getCameraPoint();\n    }\n\n    getCameraAltitude(): number {\n        return this._helper.getCameraAltitude();\n    }\n\n    getCameraLngLat(): LngLat {\n        return this._helper.getCameraLngLat();\n    }\n\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number): number {\n        return this.currentTransform.lngLatToCameraDepth(lngLat, elevation);\n    }\n\n    populateCache(coords: OverscaledTileID[]): void {\n        this._mercatorTransform.populateCache(coords);\n        this._verticalPerspectiveTransform.populateCache(coords);\n    }\n\n    getBounds(): LngLatBounds {\n        return this.currentTransform.getBounds();\n    }\n\n    defaultConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this.currentTransform.defaultConstrain(lngLat, zoom);\n    };\n\n    applyConstrain: TransformConstrainFunction = (lngLat, zoom) => {\n        return this._helper.applyConstrain(lngLat, zoom);\n    };\n\n    calculateCenterFromCameraLngLatAlt(lngLat: LngLatLike, alt: number, bearing?: number, pitch?: number): {center: LngLat; elevation: number; zoom: number} {\n        return this._helper.calculateCenterFromCameraLngLatAlt(lngLat, alt, bearing, pitch);\n    }\n\n    /**\n     * Note: automatically adjusts zoom to keep planet size consistent\n     * (same size before and after a {@link setLocationAtPoint} call).\n     */\n    setLocationAtPoint(lnglat: LngLat, point: Point): void {\n        if (!this.isGlobeRendering) {\n            this._mercatorTransform.setLocationAtPoint(lnglat, point);\n            this.apply(this._mercatorTransform, false);\n            return;\n        }\n        this._verticalPerspectiveTransform.setLocationAtPoint(lnglat, point);\n        this.apply(this._verticalPerspectiveTransform, false);\n        return;\n    }\n\n    locationToScreenPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        return this.currentTransform.locationToScreenPoint(lnglat, terrain);\n    }\n\n    screenPointToMercatorCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        return this.currentTransform.screenPointToMercatorCoordinate(p, terrain);\n    }\n\n    screenPointToLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.currentTransform.screenPointToLocation(p, terrain);\n    }\n\n    isPointOnMapSurface(p: Point, terrain?: Terrain): boolean {\n        return this.currentTransform.isPointOnMapSurface(p, terrain);\n    }\n\n    /**\n     * Computes normalized direction of a ray from the camera to the given screen pixel.\n     */\n    getRayDirectionFromPixel(p: Point): vec3 {\n        return this._verticalPerspectiveTransform.getRayDirectionFromPixel(p);\n    }\n\n    getMatrixForModel(location: LngLatLike, altitude?: number): mat4 {\n        return this.currentTransform.getMatrixForModel(location, altitude);\n    }\n\n    getProjectionDataForCustomLayer(applyGlobeMatrix: boolean = true): ProjectionData {\n        const mercatorData = this._mercatorTransform.getProjectionDataForCustomLayer(applyGlobeMatrix);\n\n        if (!this.isGlobeRendering) {\n            return mercatorData;\n        }\n\n        const globeData = this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(applyGlobeMatrix);\n        globeData.fallbackMatrix = mercatorData.mainMatrix;\n        return globeData;\n    }\n\n    getFastPathSimpleProjectionMatrix(tileID: OverscaledTileID): mat4 {\n        return this.currentTransform.getFastPathSimpleProjectionMatrix(tileID);\n    }\n}\n","import Point from '@mapbox/point-geometry';\nimport {cameraBoundsWarning, type CameraForBoxAndBearingHandlerResult, type EaseToHandlerResult, type EaseToHandlerOptions, type FlyToHandlerResult, type FlyToHandlerOptions, type ICameraHelper, type MapControlsDeltas, updateRotation, type UpdateRotationArgs, cameraForBoxAndBearing} from './camera_helper';\nimport {LngLat, type LngLatLike} from '../lng_lat';\nimport {angularCoordinatesToSurfaceVector, computeGlobePanCenter, getGlobeRadiusPixels, getZoomAdjustment, globeDistanceOfLocationsPixels, interpolateLngLatForGlobe} from './globe_utils';\nimport {clamp, createVec3f64, differenceOfAnglesDegrees, MAX_VALID_LATITUDE, remapSaturate, rollPitchBearingEqual, scaleZoom, warnOnce, zoomScale} from '../../util/util';\nimport {type mat4, vec3} from 'gl-matrix';\nimport {normalizeCenter} from '../transform_helper';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {PaddingOptions} from '../edge_insets';\n\n/**\n * @internal\n */\nexport class VerticalPerspectiveCameraHelper implements ICameraHelper {\n\n    get useGlobeControls(): boolean { return true; }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        const panCenter = computeGlobePanCenter(pan, transform);\n        if (Math.abs(panCenter.lng - transform.center.lng) > 180) {\n            // If easeTo target would be over 180Â° distant, the animation would move\n            // in the opposite direction that what the user intended.\n            // Thus we clamp the movement to 179.5Â°.\n            panCenter.lng = transform.center.lng + 179.5 * Math.sign(panCenter.lng - transform.center.lng);\n        }\n        return {\n            easingCenter: panCenter,\n            easingOffset: new Point(0, 0),\n        };\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        const zoomPixel = deltas.around;\n        const zoomLoc = tr.screenPointToLocation(zoomPixel);\n\n        if (deltas.bearingDelta) tr.setBearing(tr.bearing + deltas.bearingDelta);\n        if (deltas.pitchDelta) tr.setPitch(tr.pitch + deltas.pitchDelta);\n        if (deltas.rollDelta) tr.setRoll(tr.roll + deltas.rollDelta);\n        const oldZoomPreZoomDelta = tr.zoom;\n        if (deltas.zoomDelta) tr.setZoom(tr.zoom + deltas.zoomDelta);\n        const actualZoomDelta = tr.zoom - oldZoomPreZoomDelta;\n\n        if (actualZoomDelta === 0) {\n            return;\n        }\n\n        // Problem: `setLocationAtPoint` for globe works when it is called a single time, but is a little glitchy in practice when used repeatedly for zooming.\n        // - `setLocationAtPoint` repeatedly called at a location behind a pole will eventually glitch out\n        // - `setLocationAtPoint` at location the longitude of which is more than 90Â° different from current center will eventually glitch out\n        // But otherwise works fine at higher zooms, or when the target is somewhat near the current map center.\n        // Solution: use a heuristic zooming in the problematic cases and interpolate to `setLocationAtPoint` when possible.\n\n        // Magic numbers that control:\n        // - when zoom movement slowing starts for cursor not on globe (avoid unnatural map movements)\n        // - when we interpolate from exact zooming to heuristic zooming based on longitude difference of target location to current center\n        // - when we interpolate from exact zooming to heuristic zooming based on globe being too small on screen\n        // - when zoom movement slowing starts for globe being too small on viewport (avoids unnatural/unwanted map movements when map is zoomed out a lot)\n        const raySurfaceDistanceForSlowingStart = 0.3; // Zoom movement slowing will start when the planet surface to ray distance is greater than this number (globe radius is 1, so 0.3 is ~2000km form the surface).\n        const slowingMultiplier = 0.5; // The lower this value, the slower will the \"zoom movement slowing\" occur.\n        const interpolateToHeuristicStartLng = 45; // When zoom location longitude is this many degrees away from map center, we start interpolating from exact zooming to heuristic zooming.\n        const interpolateToHeuristicEndLng = 85; // Longitude difference at which interpolation to heuristic zooming ends.\n        const interpolateToHeuristicExponent = 0.25; // Makes interpolation smoother.\n        const interpolateToHeuristicStartRadius = 0.75; // When globe is this many times larger than the smaller viewport dimension, we start interpolating from exact zooming to heuristic zooming.\n        const interpolateToHeuristicEndRadius = 0.35; // Globe size at which interpolation to heuristic zooming ends.\n        const slowingRadiusStart = 0.9; // If globe is this many times larger than the smaller viewport dimension, start inhibiting map movement while zooming\n        const slowingRadiusStop = 0.5;\n        const slowingRadiusSlowFactor = 0.25; // How much is movement slowed when globe is too small\n\n        const dLngRaw = differenceOfAnglesDegrees(tr.center.lng, zoomLoc.lng);\n        const dLng = dLngRaw / (Math.abs(dLngRaw / 180) + 1.0); // This gradually reduces the amount of longitude change if the zoom location is very far, eg. on the other side of the pole (possible when looking at a pole).\n        const dLat = differenceOfAnglesDegrees(tr.center.lat, zoomLoc.lat);\n\n        // Slow zoom movement down if the mouse ray is far from the planet.\n        const rayDirection = tr.getRayDirectionFromPixel(zoomPixel);\n        const rayOrigin = tr.cameraPosition;\n        const distanceToClosestPoint = vec3.dot(rayOrigin, rayDirection) * -1; // Globe center relative to ray origin is equal to -rayOrigin and rayDirection is normalized, thus we want to compute dot(-rayOrigin, rayDirection).\n        const closestPoint = createVec3f64();\n        vec3.add(closestPoint, rayOrigin, [\n            rayDirection[0] * distanceToClosestPoint,\n            rayDirection[1] * distanceToClosestPoint,\n            rayDirection[2] * distanceToClosestPoint\n        ]);\n        const distanceFromSurface = vec3.length(closestPoint) - 1;\n        const distanceFactor = Math.exp(-Math.max(distanceFromSurface - raySurfaceDistanceForSlowingStart, 0) * slowingMultiplier);\n\n        // Slow zoom movement down if the globe is too small on viewport\n        const radius = getGlobeRadiusPixels(tr.worldSize, tr.center.lat) / Math.min(tr.width, tr.height); // Radius relative to larger viewport dimension\n        const radiusFactor = remapSaturate(radius, slowingRadiusStart, slowingRadiusStop, 1.0, slowingRadiusSlowFactor);\n\n        // Compute how much to move towards the zoom location\n        const factor = (1.0 - zoomScale(-actualZoomDelta)) * Math.min(distanceFactor, radiusFactor);\n\n        const oldCenterLat = tr.center.lat;\n        const oldZoom = tr.zoom;\n        const heuristicCenter = new LngLat(\n            tr.center.lng + dLng * factor,\n            clamp(tr.center.lat + dLat * factor, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE)\n        );\n\n        // Now compute the map center exact zoom\n        tr.setLocationAtPoint(zoomLoc, zoomPixel);\n        const exactCenter = tr.center;\n\n        // Interpolate between exact zooming and heuristic zooming depending on the longitude difference between current center and zoom location.\n        const interpolationFactorLongitude = remapSaturate(Math.abs(dLngRaw), interpolateToHeuristicStartLng, interpolateToHeuristicEndLng, 0, 1);\n        const interpolationFactorRadius = remapSaturate(radius, interpolateToHeuristicStartRadius, interpolateToHeuristicEndRadius, 0, 1);\n        const heuristicFactor = Math.pow(Math.max(interpolationFactorLongitude, interpolationFactorRadius), interpolateToHeuristicExponent);\n\n        const lngExactToHeuristic = differenceOfAnglesDegrees(exactCenter.lng, heuristicCenter.lng);\n        const latExactToHeuristic = differenceOfAnglesDegrees(exactCenter.lat, heuristicCenter.lat);\n\n        tr.setCenter(new LngLat(\n            exactCenter.lng + lngExactToHeuristic * heuristicFactor,\n            exactCenter.lat + latExactToHeuristic * heuristicFactor\n        ).wrap());\n        tr.setZoom(oldZoom + getZoomAdjustment(oldCenterLat, tr.center.lat));\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, _preZoomAroundLoc: LngLat): void {\n        if (!deltas.panDelta) {\n            return;\n        }\n\n        // These are actually very similar to mercator controls, and should converge to them at high zooms.\n        // We avoid using the \"grab a place and move it around\" approach from mercator here,\n        // since it is not a very pleasant way to pan a globe.\n        const oldLat = tr.center.lat;\n        const oldZoom = tr.zoom;\n        tr.setCenter(computeGlobePanCenter(deltas.panDelta, tr).wrap());\n        // Setting the center might adjust zoom to keep globe size constant, we need to avoid adding this adjustment a second time\n        tr.setZoom(oldZoom + getZoomAdjustment(oldLat, tr.center.lat));\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: ITransform): CameraForBoxAndBearingHandlerResult {\n        const result = cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n        // If globe is enabled, we use the parameters computed for mercator, and just update the zoom to fit the bounds.\n\n        // Get clip space bounds including padding\n        const xLeft = (padding.left) / tr.width * 2.0 - 1.0;\n        const xRight = (tr.width - padding.right) / tr.width * 2.0 - 1.0;\n        const yTop = (padding.top) / tr.height * -2.0 + 1.0;\n        const yBottom = (tr.height - padding.bottom) / tr.height * -2.0 + 1.0;\n\n        // Get camera bounds\n        const flipEastWest = differenceOfAnglesDegrees(bounds.getWest(), bounds.getEast()) < 0;\n        const lngWest = flipEastWest ? bounds.getEast() : bounds.getWest();\n        const lngEast = flipEastWest ? bounds.getWest() : bounds.getEast();\n\n        const latNorth = Math.max(bounds.getNorth(), bounds.getSouth()); // \"getNorth\" doesn't always return north...\n        const latSouth = Math.min(bounds.getNorth(), bounds.getSouth());\n\n        // Additional vectors will be tested for the rectangle midpoints\n        const lngMid = lngWest + differenceOfAnglesDegrees(lngWest, lngEast) * 0.5;\n        const latMid = latNorth + differenceOfAnglesDegrees(latNorth, latSouth) * 0.5;\n\n        // Obtain a globe projection matrix that does not include pitch (unsupported)\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(result.center);\n        clonedTr.setBearing(result.bearing);\n        clonedTr.setPitch(0);\n        clonedTr.setRoll(0);\n        clonedTr.setZoom(result.zoom);\n        const matrix = clonedTr.modelViewProjectionMatrix;\n\n        // Vectors to test - the bounds' corners and edge midpoints\n        const testVectors = [\n            angularCoordinatesToSurfaceVector(bounds.getNorthWest()),\n            angularCoordinatesToSurfaceVector(bounds.getNorthEast()),\n            angularCoordinatesToSurfaceVector(bounds.getSouthWest()),\n            angularCoordinatesToSurfaceVector(bounds.getSouthEast()),\n            // Also test edge midpoints\n            angularCoordinatesToSurfaceVector(new LngLat(lngEast, latMid)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngWest, latMid)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngMid, latNorth)),\n            angularCoordinatesToSurfaceVector(new LngLat(lngMid, latSouth))\n        ];\n        const vecToCenter = angularCoordinatesToSurfaceVector(result.center);\n\n        // Test each vector, measure how much to scale down the globe to satisfy all tested points that they are inside clip space.\n        let smallestNeededScale = Number.POSITIVE_INFINITY;\n        for (const vec of testVectors) {\n            if (xLeft < 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'x', xLeft));\n            if (xRight > 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'x', xRight));\n            if (yTop > 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'y', yTop));\n            if (yBottom < 0)\n                smallestNeededScale = VerticalPerspectiveCameraHelper.getLesserNonNegativeNonNull(smallestNeededScale, VerticalPerspectiveCameraHelper.solveVectorScale(vec, vecToCenter, matrix, 'y', yBottom));\n        }\n\n        if (!Number.isFinite(smallestNeededScale) || smallestNeededScale === 0) {\n            cameraBoundsWarning();\n            return undefined;\n        }\n\n        // Compute target zoom from the obtained scale.\n        result.zoom = clonedTr.zoom + scaleZoom(smallestNeededScale);\n        return result;\n    }\n\n    /**\n     * Handles the zoom and center change during camera jumpTo.\n     */\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        // Special zoom & center handling for globe:\n        // Globe constrained center isn't dependent on zoom level\n        const startingLat = tr.center.lat;\n        const constrainedCenter = tr.applyConstrain(options.center ? LngLat.convert(options.center) : tr.center, tr.zoom).center;\n        tr.setCenter(constrainedCenter.wrap());\n\n        // Make sure to compute correct target zoom level if no zoom is specified\n        const targetZoom = (typeof options.zoom !== 'undefined') ? +options.zoom : (tr.zoom + getZoomAdjustment(startingLat, constrainedCenter.lat));\n        if (tr.zoom !== targetZoom) {\n            tr.setZoom(targetZoom);\n        }\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        const startZoom = tr.zoom;\n        const startCenter = tr.center;\n        const startPadding = tr.padding;\n        const startEulerAngles = {roll: tr.roll, pitch: tr.pitch, bearing: tr.bearing};\n        const endRoll = options.roll === undefined ? tr.roll : options.roll;\n        const endPitch = options.pitch === undefined ? tr.pitch : options.pitch;\n        const endBearing = options.bearing === undefined ? tr.bearing : options.bearing;\n        const endEulerAngles = {roll: endRoll, pitch: endPitch, bearing: endBearing};\n\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        let isZooming = false;\n\n        // Globe needs special handling for how zoom should be animated.\n        // 1) if zoom is set, ease to the given mercator zoom\n        // 2) if neither is set, assume constant apparent zoom (constant planet size) is to be kept\n        const preConstrainCenter = options.center ?\n            LngLat.convert(options.center) :\n            startCenter;\n        const constrainedCenter = tr.applyConstrain(\n            preConstrainCenter,\n            startZoom // zoom can be whatever at this stage, it should not affect anything if globe is enabled\n        ).center;\n        normalizeCenter(tr, constrainedCenter);\n\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(constrainedCenter);\n\n        clonedTr.setZoom(optionsZoom ?\n            +options.zoom :\n            startZoom + getZoomAdjustment(startCenter.lat, preConstrainCenter.lat));\n        clonedTr.setBearing(options.bearing);\n        const clampedPoint = new Point(\n            clamp(tr.centerPoint.x + options.offsetAsPoint.x, 0, tr.width),\n            clamp(tr.centerPoint.y + options.offsetAsPoint.y, 0, tr.height)\n        );\n        clonedTr.setLocationAtPoint(constrainedCenter, clampedPoint);\n        // Find final animation targets\n        const endCenterWithShift = (options.offset && options.offsetAsPoint.mag()) > 0 ? clonedTr.center : constrainedCenter;\n        const endZoomWithShift = optionsZoom ?\n            +options.zoom :\n            startZoom + getZoomAdjustment(startCenter.lat, endCenterWithShift.lat);\n\n        // Planet radius for a given zoom level differs according to latitude\n        // Convert zooms to what they would be at equator for the given planet radius\n        const normalizedStartZoom = startZoom + getZoomAdjustment(startCenter.lat, 0);\n        const normalizedEndZoom = endZoomWithShift + getZoomAdjustment(endCenterWithShift.lat, 0);\n        const deltaLng = differenceOfAnglesDegrees(startCenter.lng, endCenterWithShift.lng);\n        const deltaLat = differenceOfAnglesDegrees(startCenter.lat, endCenterWithShift.lat);\n\n        const finalScale = zoomScale(normalizedEndZoom - normalizedStartZoom);\n        isZooming = (endZoomWithShift !== startZoom);\n\n        const easeFunc = (k: number) => {\n            if (!rollPitchBearingEqual(startEulerAngles, endEulerAngles)) {\n                updateRotation({\n                    startEulerAngles,\n                    endEulerAngles,\n                    tr,\n                    k,\n                    useSlerp: startEulerAngles.roll != endEulerAngles.roll} as UpdateRotationArgs);\n            }\n\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding,k);\n            }\n\n            if (options.around) {\n                warnOnce('Easing around a point is not supported under globe projection.');\n                tr.setLocationAtPoint(options.around, options.aroundPoint);\n            } else {\n                const base = normalizedEndZoom > normalizedStartZoom ?\n                    Math.min(2, finalScale) :\n                    Math.max(0.5, finalScale);\n                const speedup = Math.pow(base, 1 - k);\n                const factor = k * speedup;\n\n                // Spherical lerp might be used here instead, but that was tested and it leads to very weird paths when the interpolated arc gets near the poles.\n                // Instead we interpolate LngLat almost directly, but taking into account that\n                // one degree of longitude gets progressively smaller relative to latitude towards the poles.\n                const newCenter = interpolateLngLatForGlobe(startCenter, deltaLng, deltaLat, factor);\n                tr.setCenter(newCenter.wrap());\n            }\n\n            if (isZooming) {\n                const normalizedInterpolatedZoom = interpolates.number(normalizedStartZoom, normalizedEndZoom, k);\n                const interpolatedZoom = normalizedInterpolatedZoom + getZoomAdjustment(0, tr.center.lat);\n                tr.setZoom(interpolatedZoom);\n            }\n        };\n\n        return {\n            easeFunc,\n            isZooming,\n            elevationCenter: endCenterWithShift,\n        };\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        const optionsZoom = typeof options.zoom !== 'undefined';\n\n        const startCenter = tr.center;\n        const startZoom = tr.zoom;\n        const startPadding = tr.padding;\n\n        const doPadding = !tr.isPaddingEqual(options.padding);\n\n        // Obtain target center and zoom\n        const constrainedCenter = tr.applyConstrain(\n            LngLat.convert(options.center || options.locationAtOffset),\n            startZoom\n        ).center;\n        const targetZoom = optionsZoom ? +options.zoom : tr.zoom + getZoomAdjustment(tr.center.lat, constrainedCenter.lat);\n\n        // Compute target center that respects offset by creating a temporary transform and calling its `setLocationAtPoint`.\n        const clonedTr = tr.clone();\n        clonedTr.setCenter(constrainedCenter);\n\n        clonedTr.setZoom(targetZoom);\n        clonedTr.setBearing(options.bearing);\n        const clampedPoint = new Point(\n            clamp(tr.centerPoint.x + options.offsetAsPoint.x, 0, tr.width),\n            clamp(tr.centerPoint.y + options.offsetAsPoint.y, 0, tr.height)\n        );\n        clonedTr.setLocationAtPoint(constrainedCenter, clampedPoint);\n        const targetCenter = clonedTr.center;\n\n        normalizeCenter(tr, targetCenter);\n\n        const pixelPathLength = globeDistanceOfLocationsPixels(tr, startCenter, targetCenter);\n\n        const normalizedStartZoom = startZoom + getZoomAdjustment(startCenter.lat, 0);\n        const normalizedTargetZoom = targetZoom + getZoomAdjustment(targetCenter.lat, 0);\n        const scaleOfZoom = zoomScale(normalizedTargetZoom - normalizedStartZoom);\n\n        const optionsMinZoom = typeof options.minZoom === 'number';\n\n        let scaleOfMinZoom: number;\n\n        if (optionsMinZoom) {\n            const normalizedOptionsMinZoom = +options.minZoom + getZoomAdjustment(targetCenter.lat, 0);\n            const normalizedMinZoomPreConstrain = Math.min(normalizedOptionsMinZoom, normalizedStartZoom, normalizedTargetZoom);\n            const minZoomPreConstrain = normalizedMinZoomPreConstrain + getZoomAdjustment(0, targetCenter.lat);\n            const minZoom = tr.applyConstrain(targetCenter, minZoomPreConstrain).zoom;\n            const normalizedMinZoom = minZoom + getZoomAdjustment(targetCenter.lat, 0);\n            scaleOfMinZoom = zoomScale(normalizedMinZoom - normalizedStartZoom);\n        }\n\n        const deltaLng = differenceOfAnglesDegrees(startCenter.lng, targetCenter.lng);\n        const deltaLat = differenceOfAnglesDegrees(startCenter.lat, targetCenter.lat);\n\n        const easeFunc = (k: number, scale: number, centerFactor: number, _pointAtOffset: Point) => {\n            const interpolatedCenter = interpolateLngLatForGlobe(startCenter, deltaLng, deltaLat, centerFactor);\n\n            if (doPadding) {\n                tr.interpolatePadding(startPadding, options.padding,k);\n            }\n\n            const newCenter = k === 1 ? targetCenter : interpolatedCenter;\n            tr.setCenter(newCenter.wrap());\n\n            const interpolatedZoom = normalizedStartZoom + scaleZoom(scale);\n            tr.setZoom(k === 1 ? targetZoom : (interpolatedZoom + getZoomAdjustment(0, newCenter.lat)));\n        };\n\n        return {\n            easeFunc,\n            scaleOfZoom,\n            targetCenter,\n            scaleOfMinZoom,\n            pixelPathLength,\n        };\n    }\n\n    /**\n     * Computes how much to scale the globe in order for a given point on its surface (a location) to project to a given clip space coordinate in either the X or the Y axis.\n     * @param vector - Position of the queried location on the surface of the unit sphere globe.\n     * @param toCenter - Position of current transform center on the surface of the unit sphere globe.\n     * This is needed because zooming the globe not only changes its scale,\n     * but also moves the camera closer or further away along this vector (pitch is disregarded).\n     * @param projection - The globe projection matrix.\n     * @param targetDimension - The dimension in which the scaled vector must match the target value in clip space.\n     * @param targetValue - The target clip space value in the specified dimension to which the queried vector must project.\n     * @returns How much to scale the globe.\n     */\n    private static solveVectorScale(vector: vec3, toCenter: vec3, projection: mat4, targetDimension: 'x' | 'y', targetValue: number): number | null {\n        // We want to compute how much to scale the sphere in order for the input `vector` to project to `targetValue` in the given `targetDimension` (X or Y).\n        const k = targetValue;\n        const columnXorY = targetDimension === 'x' ?\n            [projection[0], projection[4], projection[8], projection[12]] : // X\n            [projection[1], projection[5], projection[9], projection[13]];  // Y\n        const columnZ = [projection[3], projection[7], projection[11], projection[15]];\n\n        const vecDotXY = vector[0] * columnXorY[0] + vector[1] * columnXorY[1] + vector[2] * columnXorY[2];\n        const vecDotZ = vector[0] * columnZ[0] + vector[1] * columnZ[1] + vector[2] * columnZ[2];\n        const toCenterDotXY = toCenter[0] * columnXorY[0] + toCenter[1] * columnXorY[1] + toCenter[2] * columnXorY[2];\n        const toCenterDotZ = toCenter[0] * columnZ[0] + toCenter[1] * columnZ[1] + toCenter[2] * columnZ[2];\n\n        // The following can be derived from writing down what happens to a vector scaled by a parameter (\"V * t\") when it is multiplied by a projection matrix, then solving for \"t\".\n        // Or rather, we derive it for a vector \"V * t + (1-t) * C\". Where V is `vector` and C is `toCenter`. The extra addition is needed because zooming out also moves the camera along \"C\".\n\n        const t = (toCenterDotXY + columnXorY[3] - k * toCenterDotZ - k * columnZ[3]) / (toCenterDotXY - vecDotXY - k * toCenterDotZ + k * vecDotZ);\n\n        if (\n            toCenterDotXY + k * vecDotZ === vecDotXY + k * toCenterDotZ ||\n            columnZ[3] * (vecDotXY - toCenterDotXY) + columnXorY[3] * (toCenterDotZ - vecDotZ) + vecDotXY * toCenterDotZ === toCenterDotXY * vecDotZ\n        ) {\n            // The computed result is invalid.\n            return null;\n        }\n        return t;\n    }\n\n    /**\n     * Returns `newValue` if it is:\n     *\n     * - not null AND\n     * - not negative AND\n     * - smaller than `newValue`,\n     *\n     * ...otherwise returns `oldValue`.\n     */\n    private static getLesserNonNegativeNonNull(oldValue: number, newValue: number): number {\n        if (newValue !== null && newValue >= 0 && newValue < oldValue) {\n            return newValue;\n        } else {\n            return oldValue;\n        }\n    }\n}\n","import {MercatorCameraHelper} from './mercator_camera_helper';\nimport {VerticalPerspectiveCameraHelper} from './vertical_perspective_camera_helper';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {CameraForBoxAndBearingHandlerResult, EaseToHandlerResult, EaseToHandlerOptions, FlyToHandlerResult, FlyToHandlerOptions, ICameraHelper, MapControlsDeltas} from './camera_helper';\nimport type {LngLat, LngLatLike} from '../lng_lat';\nimport type {IReadonlyTransform, ITransform} from '../transform_interface';\nimport type {GlobeProjection} from './globe_projection';\nimport type {CameraForBoundsOptions} from '../../ui/camera';\nimport type {LngLatBounds} from '../lng_lat_bounds';\nimport type {PaddingOptions} from '../edge_insets';\n\n/**\n * @internal\n */\nexport class GlobeCameraHelper implements ICameraHelper {\n    private _globe: GlobeProjection;\n    private _mercatorCameraHelper: MercatorCameraHelper;\n    private _verticalPerspectiveCameraHelper: VerticalPerspectiveCameraHelper;\n\n    constructor(globe: GlobeProjection) {\n        this._globe = globe;\n        this._mercatorCameraHelper = new MercatorCameraHelper();\n        this._verticalPerspectiveCameraHelper = new VerticalPerspectiveCameraHelper();\n    }\n\n    get useGlobeControls(): boolean { return this._globe.useGlobeRendering; }\n\n    get currentHelper(): ICameraHelper {\n        return this.useGlobeControls ? this._verticalPerspectiveCameraHelper : this._mercatorCameraHelper;\n    }\n\n    handlePanInertia(pan: Point, transform: IReadonlyTransform): {\n        easingCenter: LngLat;\n        easingOffset: Point;\n    } {\n        return this.currentHelper.handlePanInertia(pan, transform);\n    }\n\n    handleMapControlsRollPitchBearingZoom(deltas: MapControlsDeltas, tr: ITransform): void {\n        return this.currentHelper.handleMapControlsRollPitchBearingZoom(deltas, tr);\n    }\n\n    handleMapControlsPan(deltas: MapControlsDeltas, tr: ITransform, preZoomAroundLoc: LngLat): void {\n        this.currentHelper.handleMapControlsPan(deltas, tr, preZoomAroundLoc);\n    }\n\n    cameraForBoxAndBearing(options: CameraForBoundsOptions, padding: PaddingOptions, bounds: LngLatBounds, bearing: number, tr: ITransform): CameraForBoxAndBearingHandlerResult {\n        return this.currentHelper.cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n    }\n\n    /**\n     * Handles the zoom and center change during camera jumpTo.\n     */\n    handleJumpToCenterZoom(tr: ITransform, options: { zoom?: number; center?: LngLatLike }): void {\n        this.currentHelper.handleJumpToCenterZoom(tr, options);\n    }\n\n    handleEaseTo(tr: ITransform, options: EaseToHandlerOptions): EaseToHandlerResult {\n        return this.currentHelper.handleEaseTo(tr, options);\n    }\n\n    handleFlyTo(tr: ITransform, options: FlyToHandlerOptions): FlyToHandlerResult {\n        return this.currentHelper.handleFlyTo(tr, options);\n    }\n}","import {Event, ErrorEvent, Evented} from '../util/evented';\nimport {type StyleLayer} from './style_layer';\nimport {isRasterStyleLayer} from './style_layer/raster_style_layer';\nimport {createStyleLayer} from './create_style_layer';\nimport {loadSprite} from './load_sprite';\nimport {ImageManager} from '../render/image_manager';\nimport {GlyphManager} from '../render/glyph_manager';\nimport {Light} from './light';\nimport {Sky} from './sky';\nimport {LineAtlas} from '../render/line_atlas';\nimport {clone, extend, deepEqual, filterObject, mapObject} from '../util/util';\nimport {coerceSpriteToArray} from '../util/style';\nimport {getJSON, getReferrer} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\nimport {now} from '../util/time_control';\nimport {Dispatcher} from '../util/dispatcher';\nimport {validateStyle, emitValidationErrors as _emitValidationErrors} from './validate_style';\nimport {type Source} from '../source/source';\nimport {type QueryRenderedFeaturesOptions, type QueryRenderedFeaturesOptionsStrict, type QueryRenderedFeaturesResults, type QueryRenderedFeaturesResultsItem, type QuerySourceFeatureOptions, queryRenderedFeatures, queryRenderedSymbols, querySourceFeatures} from '../source/query_features';\nimport {TileManager} from '../tile/tile_manager';\nimport {type GeoJSONSource} from '../source/geojson_source';\nimport {latest as styleSpec, derefLayers, emptyStyle, diff as diffStyles, type DiffCommand} from '@maplibre/maplibre-gl-style-spec';\nimport {getGlobalWorkerPool} from '../util/global_worker_pool';\nimport {rtlMainThreadPluginFactory} from '../source/rtl_text_plugin_main_thread';\nimport {RTLPluginLoadedEventName} from '../source/rtl_text_plugin_status';\nimport {PauseablePlacement} from './pauseable_placement';\nimport {ZoomHistory} from './zoom_history';\nimport {CrossTileSymbolIndex} from '../symbol/cross_tile_symbol_index';\nimport {validateCustomStyleLayer} from './style_layer/custom_style_layer';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type Point from '@mapbox/point-geometry';\n\n// We're skipping validation errors with the `source.canvas` identifier in order\n// to continue to allow canvas sources to be added at runtime/updated in\n// smart setStyle (see https://github.com/mapbox/mapbox-gl-js/pull/6424):\nconst emitValidationErrors = (evented: Evented, errors?: ReadonlyArray<{\n    message: string;\n    identifier?: string;\n}> | null) =>\n    _emitValidationErrors(evented, errors && errors.filter(error => error.identifier !== 'source.canvas'));\n\nimport type {Map} from '../ui/map';\nimport type {IReadonlyTransform, ITransform} from '../geo/transform_interface';\nimport type {StyleImage} from './style_image';\nimport type {EvaluationParameters} from './evaluation_parameters';\nimport type {Placement} from '../symbol/placement';\nimport type {\n    LayerSpecification,\n    FilterSpecification,\n    StyleSpecification,\n    LightSpecification,\n    SourceSpecification,\n    SpriteSpecification,\n    DiffOperations,\n    ProjectionSpecification,\n    SkySpecification,\n    StateSpecification\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer';\nimport type {Validator} from './validate_style';\nimport {\n    type GetDashesParameters,\n    type GetDashesResponse,\n    MessageType,\n    type GetGlyphsParameters,\n    type GetGlyphsResponse,\n    type GetImagesParameters,\n    type GetImagesResponse\n} from '../util/actor_messages';\nimport {type Projection} from '../geo/projection/projection';\nimport {createProjectionFromName} from '../geo/projection/projection_factory';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nconst empty = emptyStyle() as StyleSpecification;\n/**\n * A feature identifier that is bound to a source\n */\nexport type FeatureIdentifier = {\n    /**\n     * Unique id of the feature.\n     */\n    id?: string | number | undefined;\n    /**\n     * The id of the vector or GeoJSON source for the feature.\n     */\n    source: string;\n    /**\n     * *For vector tile sources, `sourceLayer` is required.*\n     */\n    sourceLayer?: string | undefined;\n};\n\n/**\n * The options object related to the {@link Map}'s style related methods\n */\nexport type StyleOptions = {\n    /**\n     * If false, style validation will be skipped. Useful in production environment.\n     */\n    validate?: boolean;\n    /**\n     * Defines a CSS\n     * font-family for locally overriding generation of Chinese, Japanese, and Korean characters.\n     * For these characters, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).\n     * Set to `false`, to enable font settings from the map's style for these glyph ranges.\n     * Forces a full update.\n     */\n    localIdeographFontFamily?: string | false;\n};\n\n/**\n * Supporting type to add validation to another style related type\n */\nexport type StyleSetterOptions = {\n    /**\n     * Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     */\n    validate?: boolean;\n};\n\n/**\n * Part of {@link Map.setStyle} options, transformStyle is a convenience function that allows to modify a style after it is fetched but before it is committed to the map state.\n *\n * This function exposes previous and next styles, it can be commonly used to support a range of functionalities like:\n *\n * - when previous style carries certain 'state' that needs to be carried over to a new style gracefully;\n * - when a desired style is a certain combination of previous and incoming style;\n * - when an incoming style requires modification based on external state.\n * - when an incoming style uses relative paths, which need to be converted to absolute.\n *\n * @param previous - The current style.\n * @param next - The next style.\n * @returns resulting style that will to be applied to the map\n *\n * @example\n * ```ts\n * map.setStyle('https://demotiles.maplibre.org/style.json', {\n *   transformStyle: (previousStyle, nextStyle) => ({\n *       ...nextStyle,\n *       // make relative sprite path like \"../sprite\" absolute\n *       sprite: new URL(nextStyle.sprite, \"https://demotiles.maplibre.org/styles/osm-bright-gl-style/sprites/\").href,\n *       // make relative glyphs path like \"../fonts/{fontstack}/{range}.pbf\" absolute\n *       glyphs: new URL(nextStyle.glyphs, \"https://demotiles.maplibre.org/font/\").href,\n *       sources: {\n *           // make relative vector url like \"../../\" absolute\n *           ...nextStyle.sources.map(source => {\n *              if (source.url) {\n *                  source.url = new URL(source.url, \"https://tiles.openfreemap.org/planet\");\n *              }\n *              return source;\n *           }),\n *           // copy a source from previous style\n *           'osm': previousStyle.sources.osm\n *       },\n *       layers: [\n *           // background layer\n *           nextStyle.layers[0],\n *           // copy a layer from previous style\n *           previousStyle.layers[0],\n *           // other layers from the next style\n *           ...nextStyle.layers.slice(1).map(layer => {\n *               // hide the layers we don't need from demotiles style\n *               if (layer.id.startsWith('geolines')) {\n *                   layer.layout = {...layer.layout || {}, visibility: 'none'};\n *               // filter out US polygons\n *               } else if (layer.id.startsWith('coastline') || layer.id.startsWith('countries')) {\n *                   layer.filter = ['!=', ['get', 'ADM0_A3'], 'USA'];\n *               }\n *               return layer;\n *           })\n *       ]\n *   })\n * });\n * ```\n */\nexport type TransformStyleFunction = (previous: StyleSpecification | undefined, next: StyleSpecification) => StyleSpecification;\n\n/**\n * The options object related to the {@link Map}'s style related methods\n */\nexport type StyleSwapOptions = {\n    /**\n     * If false, force a 'full' update, removing the current style\n     * and building the given one instead of attempting a diff-based update.\n     */\n    diff?: boolean;\n    /**\n     * TransformStyleFunction is a convenience function\n     * that allows to modify a style after it is fetched but before it is committed to the map state. Refer to {@link TransformStyleFunction}.\n     */\n    transformStyle?: TransformStyleFunction;\n};\n\n/**\n * Specifies a layer to be added to a {@link Style}. In addition to a standard {@link LayerSpecification}\n * or a {@link CustomLayerInterface}, a {@link LayerSpecification} with an embedded {@link SourceSpecification} can also be provided.\n */\nexport type AddLayerObject = LayerSpecification | (Omit<LayerSpecification, 'source'> & {source: SourceSpecification}) | CustomLayerInterface;\n\n/**\n * The Style base class\n */\nexport class Style extends Evented {\n    map: Map;\n    stylesheet: StyleSpecification;\n    dispatcher: Dispatcher;\n    imageManager: ImageManager;\n    glyphManager: GlyphManager;\n    lineAtlas: LineAtlas;\n    light: Light;\n    projection: Projection | undefined;\n    sky: Sky;\n\n    _frameRequest: AbortController;\n    _loadStyleRequest: AbortController;\n    _spriteRequest: AbortController;\n    _layers: {[_: string]: StyleLayer};\n    _serializedLayers: {[_: string]: LayerSpecification};\n    _order: Array<string>;\n    tileManagers: {[_: string]: TileManager};\n    zoomHistory: ZoomHistory;\n    _loaded: boolean;\n    _changed: boolean;\n    _updatedSources: {[_: string]: 'clear' | 'reload'};\n    _updatedLayers: {[_: string]: true};\n    _removedLayers: {[_: string]: StyleLayer};\n    _changedImages: {[_: string]: true};\n    _glyphsDidChange: boolean;\n    _updatedPaintProps: {[layer: string]: true};\n    _layerOrderChanged: boolean;\n    // image ids of images loaded from style's sprite\n    _spritesImagesIds: {[spriteId: string]: string[]};\n    // image ids of all images loaded (sprite + user)\n    _availableImages: Array<string>;\n    _globalState: Record<string, any>;\n    crossTileSymbolIndex: CrossTileSymbolIndex;\n    pauseablePlacement: PauseablePlacement;\n    placement: Placement;\n    z: number;\n\n    constructor(map: Map, options: StyleOptions = {}) {\n        super();\n\n        this.map = map;\n        this.dispatcher = new Dispatcher(getGlobalWorkerPool(), map._getMapId());\n        this.dispatcher.registerMessageHandler(MessageType.getGlyphs, (mapId, params) => {\n            return this.getGlyphs(mapId, params);\n        });\n        this.dispatcher.registerMessageHandler(MessageType.getImages, (mapId, params) => {\n            return this.getImages(mapId, params);\n        });\n        this.dispatcher.registerMessageHandler(MessageType.getDashes, (mapId, params) => {\n            return this.getDashes(mapId, params);\n        });\n        this.imageManager = new ImageManager();\n        this.imageManager.setEventedParent(this);\n        const glyphLang = map._container?.lang || (typeof document !== 'undefined' && document.documentElement?.lang) || undefined;\n        this.glyphManager = new GlyphManager(map._requestManager, options.localIdeographFontFamily, glyphLang);\n        this.lineAtlas = new LineAtlas(256, 512);\n        this.crossTileSymbolIndex = new CrossTileSymbolIndex();\n\n        this._setInitialValues();\n\n        this._resetUpdates();\n\n        this.dispatcher.broadcast(MessageType.setReferrer, getReferrer());\n        rtlMainThreadPluginFactory().on(RTLPluginLoadedEventName, this._rtlPluginLoaded);\n\n        this.on('data', (event) => {\n            if (event.dataType !== 'source' || event.sourceDataType !== 'metadata') {\n                return;\n            }\n\n            const tileManager = this.tileManagers[event.sourceId];\n            if (!tileManager) {\n                return;\n            }\n\n            const source = tileManager.getSource();\n            if (!source || !source.vectorLayerIds) {\n                return;\n            }\n\n            for (const layerId in this._layers) {\n                const layer = this._layers[layerId];\n                if (layer.source === source.id) {\n                    this._validateLayer(layer);\n                }\n            }\n        });\n    }\n\n    private _setInitialValues() {\n        this._spritesImagesIds = {};\n        this._layers = {};\n        this._order = [];\n        this.tileManagers = {};\n        this.zoomHistory = new ZoomHistory();\n        this._availableImages = [];\n        this._globalState = {};\n        this._serializedLayers = {};\n        this.stylesheet = null;\n        this.light = null;\n        this.sky = null;\n        if (this.projection) {\n            this.projection.destroy();\n            delete this.projection;\n        }\n        this._loaded = false;\n        this._changed = false;\n        this._updatedLayers = {};\n        this._updatedSources = {};\n        this._changedImages = {};\n        this._glyphsDidChange = false;\n        this._updatedPaintProps = {};\n        this._layerOrderChanged = false;\n        this.crossTileSymbolIndex = new (this.crossTileSymbolIndex?.constructor || Object)();\n        this.pauseablePlacement = undefined;\n        this.placement = undefined;\n        this.z = 0;\n    }\n\n    _rtlPluginLoaded = () => {\n        for (const id in this.tileManagers) {\n            const sourceType = this.tileManagers[id].getSource().type;\n            if (sourceType === 'vector' || sourceType === 'geojson') {\n                // Non-vector sources don't have any symbols buckets to reload when the RTL text plugin loads\n                // They also load more quickly, so they're more likely to have already displaying tiles\n                // that would be unnecessarily booted by the plugin load event\n                this.tileManagers[id].reload(); // Should be a no-op if the plugin loads before any tiles load\n            }\n        }\n    };\n\n    setGlobalStateProperty(name: string, value: any) {\n        this._checkLoaded();\n\n        const newValue = value === null ?\n            this.stylesheet.state?.[name]?.default ?? null :\n            value;\n\n        if (deepEqual(newValue, this._globalState[name])) {\n            return this;\n        }\n\n        this._globalState[name] = newValue;\n\n        this._applyGlobalStateChanges([name]);\n    }\n\n    getGlobalState() {\n        return this._globalState;\n    }\n\n    setGlobalState(newStylesheetState: StateSpecification) {\n        this._checkLoaded();\n\n        const changedGlobalStateRefs = [];\n\n        for (const propertyName in newStylesheetState) {\n            const didChange = !deepEqual(this._globalState[propertyName], newStylesheetState[propertyName].default);\n\n            if (didChange) {\n                changedGlobalStateRefs.push(propertyName);\n                this._globalState[propertyName] = newStylesheetState[propertyName].default;\n            }\n        }\n\n        this._applyGlobalStateChanges(changedGlobalStateRefs);\n    }\n\n    /**\n     * @internal\n     * Find all sources that are affected by the global state changes and reload them.\n     * Find all paint properties that are affected by the global state changes and update them.\n     * For example, if a layer filter uses global-state expression, this function will find the source id of that layer.\n     */\n    _applyGlobalStateChanges(globalStateRefs: string[]) {\n        if (globalStateRefs.length === 0) {\n            return;\n        }\n\n        const sourceIdsToReload = new Set<string>();\n        const globalStateChange = {};\n\n        for (const ref of globalStateRefs) {\n            globalStateChange[ref] = this._globalState[ref];\n\n            for (const layerId in this._layers) {\n                const layer = this._layers[layerId];\n                const layoutAffectingGlobalStateRefs = layer.getLayoutAffectingGlobalStateRefs();\n                const paintAffectingGlobalStateRefs = layer.getPaintAffectingGlobalStateRefs();\n                const visibilityAffectingGlobalStateRefs = layer.getVisibilityAffectingGlobalStateRefs();\n\n                if (layoutAffectingGlobalStateRefs.has(ref)) {\n                    sourceIdsToReload.add(layer.source);\n                }\n                if (paintAffectingGlobalStateRefs.has(ref)) {\n                    for (const {name, value} of paintAffectingGlobalStateRefs.get(ref)) {\n                        this._updatePaintProperty(layer, name, value);\n                    }\n                }\n                if (visibilityAffectingGlobalStateRefs?.has(ref)) {\n                    layer.recalculateVisibility();\n                    this._updateLayer(layer);\n                }\n            }\n        }\n\n        // Propagate global state changes to workers\n        this.dispatcher.broadcast(MessageType.updateGlobalState, globalStateChange);\n\n        for (const id in this.tileManagers) {\n            if (sourceIdsToReload.has(id)) {\n                this._reloadSource(id);\n                this._changed = true;\n            }\n        }\n    }\n\n    loadURL(url: string, options: StyleSwapOptions & StyleSetterOptions = {}, previousStyle?: StyleSpecification) {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n\n        options.validate = typeof options.validate === 'boolean' ?\n            options.validate : true;\n\n        const request = this.map._requestManager.transformRequest(url, ResourceType.Style);\n        this._loadStyleRequest = new AbortController();\n        const abortController = this._loadStyleRequest;\n        getJSON<StyleSpecification>(request, this._loadStyleRequest).then((response) => {\n            this._loadStyleRequest = null;\n            this._load(response.data, options, previousStyle);\n        }).catch((error) => {\n            this._loadStyleRequest = null;\n            if (error && !abortController.signal.aborted) { // ignore abort\n                this.fire(new ErrorEvent(error));\n            }\n        });\n    }\n\n    loadJSON(json: StyleSpecification, options: StyleSetterOptions & StyleSwapOptions = {}, previousStyle?: StyleSpecification) {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n\n        this._frameRequest = new AbortController();\n        browser.frameAsync(this._frameRequest, this.map._ownerWindow).then(() => {\n            this._frameRequest = null;\n            options.validate = options.validate !== false;\n            this._load(json, options, previousStyle);\n        }).catch(() => {}); // ignore abort\n    }\n\n    loadEmpty() {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n        this._load(empty, {validate: false});\n    }\n\n    _load(json: StyleSpecification, options: StyleSwapOptions & StyleSetterOptions, previousStyle?: StyleSpecification) {\n        let nextState = options.transformStyle ? options.transformStyle(previousStyle, json) : json;\n        if (options.validate && emitValidationErrors(this, validateStyle(nextState))) {\n            return;\n        }\n\n        nextState = {...nextState};\n\n        this._loaded = true;\n        this.stylesheet = nextState;\n\n        for (const id in nextState.sources) {\n            this.addSource(id, nextState.sources[id], {validate: false});\n        }\n\n        if (nextState.sprite) {\n            this._loadSprite(nextState.sprite);\n        } else {\n            this.imageManager.setLoaded(true);\n        }\n\n        this.glyphManager.setURL(nextState.glyphs);\n        this._createLayers();\n\n        this.light = new Light(this.stylesheet.light);\n        this._setProjectionInternal(this.stylesheet.projection?.type || 'mercator');\n\n        this.sky = new Sky(this.stylesheet.sky);\n\n        this.map.setTerrain(this.stylesheet.terrain ?? null);\n\n        this.fire(new Event('data', {dataType: 'style'}));\n        this.fire(new Event('style.load'));\n    }\n\n    private _createLayers() {\n        const dereferencedLayers = derefLayers(this.stylesheet.layers);\n\n        this.setGlobalState(this.stylesheet.state ?? null);\n\n        // Broadcast layers to workers first, so that expensive style processing (createStyleLayer)\n        // can happen in parallel on both main and worker threads.\n        this.dispatcher.broadcast(MessageType.setLayers, dereferencedLayers);\n\n        this._order = dereferencedLayers.map((layer) => layer.id);\n        this._layers = {};\n\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n        for (const layer of dereferencedLayers) {\n            const styledLayer = createStyleLayer(layer, this._globalState);\n            styledLayer.setEventedParent(this, {layer: {id: layer.id}});\n            this._layers[layer.id] = styledLayer;\n\n            if (isRasterStyleLayer(styledLayer) && this.tileManagers[styledLayer.source]) {\n                const rasterFadeDuration = layer.paint?.['raster-fade-duration'] ?? styledLayer.paint.get('raster-fade-duration');\n                this.tileManagers[styledLayer.source].setRasterFadeDuration(rasterFadeDuration);\n            }\n        }\n    }\n\n    _loadSprite(sprite: SpriteSpecification, isUpdate: boolean = false, completion: (err: Error) => void = undefined) {\n        this.imageManager.setLoaded(false);\n\n        const abortController = new AbortController();\n        this._spriteRequest = abortController;\n        let err: Error;\n        loadSprite(sprite, this.map._requestManager, this.map.getPixelRatio(), this._spriteRequest).then((images) => {\n            this._spriteRequest = null;\n            if (images) {\n                for (const spriteId in images) {\n                    this._spritesImagesIds[spriteId] = [];\n\n                    // remove old sprite's loaded images (for the same sprite id) that are not in new sprite\n                    const imagesToRemove = this._spritesImagesIds[spriteId] ? this._spritesImagesIds[spriteId].filter(id => !(id in images)) : [];\n                    for (const id of imagesToRemove) {\n                        this.imageManager.removeImage(id);\n                        this._changedImages[id] = true;\n                    }\n\n                    for (const id in images[spriteId]) {\n                        // don't prefix images of the \"default\" sprite\n                        const imageId = spriteId === 'default' ? id : `${spriteId}:${id}`;\n                        // save all the sprite's images' ids to be able to delete them in `removeSprite`\n                        this._spritesImagesIds[spriteId].push(imageId);\n                        if (imageId in this.imageManager.images) {\n                            this.imageManager.updateImage(imageId, images[spriteId][id], false);\n                        } else {\n                            this.imageManager.addImage(imageId, images[spriteId][id]);\n                        }\n\n                        if (isUpdate) {\n                            this._changedImages[imageId] = true;\n                        }\n                    }\n                }\n            }\n        }).catch((error) => {\n            this._spriteRequest = null;\n            err = error;\n            if (!abortController.signal.aborted) { // ignore abort\n                this.fire(new ErrorEvent(err));\n            }\n        }).finally(() => {\n            this.imageManager.setLoaded(true);\n            this._availableImages = this.imageManager.listImages();\n\n            if (isUpdate) {\n                this._changed = true;\n            }\n\n            this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n            this.fire(new Event('data', {dataType: 'style'}));\n\n            if (completion) {\n                completion(err);\n            }\n        });\n    }\n\n    _unloadSprite() {\n        for (const id of Object.values(this._spritesImagesIds).flat()) {\n            this.imageManager.removeImage(id);\n            this._changedImages[id] = true;\n        }\n\n        this._spritesImagesIds = {};\n        this._availableImages = this.imageManager.listImages();\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    _validateLayer(layer: StyleLayer) {\n        const tileManager = this.tileManagers[layer.source];\n        if (!tileManager) {\n            return;\n        }\n\n        const sourceLayer = layer.sourceLayer;\n        if (!sourceLayer) {\n            return;\n        }\n\n        const source = tileManager.getSource();\n        if (source.type === 'geojson' || (source.vectorLayerIds && source.vectorLayerIds.indexOf(sourceLayer) === -1)) {\n            this.fire(new ErrorEvent(new Error(\n                `Source layer \"${sourceLayer}\" ` +\n                `does not exist on source \"${source.id}\" ` +\n                `as specified by style layer \"${layer.id}\".`\n            )));\n        }\n    }\n\n    loaded() {\n        if (!this._loaded)\n            return false;\n\n        if (Object.keys(this._updatedSources).length)\n            return false;\n\n        for (const id in this.tileManagers)\n            if (!this.tileManagers[id].loaded())\n                return false;\n\n        if (!this.imageManager.isLoaded())\n            return false;\n\n        return true;\n    }\n\n    /**\n     * @hidden\n     * take an array of string IDs, and based on this._layers, generate an array of LayerSpecification\n     * @param ids - an array of string IDs, for which serialized layers will be generated. If omitted, all serialized layers will be returned\n     * @param returnClose - if true, return a clone of the layer object\n     * @returns generated result\n     */\n    private _serializeByIds(ids: Array<string>, returnClone: boolean = false): Array<LayerSpecification> {\n\n        const serializedLayersDictionary = this._serializedAllLayers();\n        if (!ids || ids.length === 0) {\n            return returnClone ? Object.values(clone(serializedLayersDictionary)) : Object.values(serializedLayersDictionary);\n        }\n\n        const serializedLayers = [];\n        for (const id of ids) {\n            // this check will skip all custom layers\n            if (serializedLayersDictionary[id]) {\n                const toPush = returnClone ? clone(serializedLayersDictionary[id]) : serializedLayersDictionary[id];\n                serializedLayers.push(toPush);\n            }\n        }\n\n        return serializedLayers;\n    }\n\n    /**\n     * @hidden\n     * Lazy initialization of this._serializedLayers dictionary and return it\n     * @returns this._serializedLayers dictionary\n     */\n    private _serializedAllLayers(): {[_: string]: LayerSpecification} {\n        let serializedLayers = this._serializedLayers;\n        if (serializedLayers) {\n            return serializedLayers;\n        }\n\n        serializedLayers = this._serializedLayers = {};\n        const allLayerIds: string [] = Object.keys(this._layers);\n        for (const layerId of allLayerIds) {\n            const layer = this._layers[layerId];\n            if (layer.type !== 'custom') {\n                serializedLayers[layerId] = layer.serialize();\n            }\n        }\n\n        return serializedLayers;\n    }\n\n    hasTransitions() {\n        if (this.light?.hasTransition()) {\n            return true;\n        }\n\n        if (this.sky?.hasTransition()) {\n            return true;\n        }\n\n        if (this.projection?.hasTransition()) {\n            return true;\n        }\n\n        for (const id in this.tileManagers) {\n            if (this.tileManagers[id].hasTransition()) {\n                return true;\n            }\n        }\n\n        for (const id in this._layers) {\n            if (this._layers[id].hasTransition()) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    _checkLoaded() {\n        if (!this._loaded) {\n            throw new Error('Style is not done loading.');\n        }\n    }\n\n    /**\n     * @internal\n     * Apply queued style updates in a batch and recalculate zoom-dependent paint properties.\n     */\n    update(parameters: EvaluationParameters) {\n        if (!this._loaded) {\n            return;\n        }\n\n        const changed = this._changed;\n        if (changed) {\n            const updatedIds = Object.keys(this._updatedLayers);\n            const removedIds = Object.keys(this._removedLayers);\n\n            if (updatedIds.length || removedIds.length) {\n                this._updateWorkerLayers(updatedIds, removedIds);\n            }\n            for (const id in this._updatedSources) {\n                const action = this._updatedSources[id];\n\n                if (action === 'reload') {\n                    this._reloadSource(id);\n                } else if (action === 'clear') {\n                    this._clearSource(id);\n                } else {\n                    throw new Error(`Invalid action ${action}`);\n                }\n            }\n\n            this._updateTilesForChangedImages();\n            this._updateTilesForChangedGlyphs();\n\n            for (const id in this._updatedPaintProps) {\n                this._layers[id].updateTransitions(parameters);\n            }\n\n            this.light.updateTransitions(parameters);\n            this.sky.updateTransitions(parameters);\n\n            this._resetUpdates();\n        }\n\n        const managersUsedBefore = {};\n\n        // save 'used' status to managersUsedBefore object and reset all tileManagers 'used' field to false\n        for (const id in this.tileManagers) {\n            const tileManager = this.tileManagers[id];\n\n            // tileManager.used could be undefined, and managersUsedBefore[id] is also 'undefined'\n            managersUsedBefore[id] = tileManager.used;\n            tileManager.used = false;\n        }\n\n        // loop all layers and find layers that are not hidden at parameters.zoom\n        // and set used to true in tileManagers dictionary for the sources of these layers\n        for (const layerId of this._order) {\n            const layer = this._layers[layerId];\n\n            layer.recalculate(parameters, this._availableImages);\n            if (!layer.isHidden(parameters.zoom) && layer.source) {\n                this.tileManagers[layer.source].used = true;\n            }\n        }\n\n        // cross check managersUsedBefore against updated this.tileManagers dictionary\n        // if \"used\" field is different fire visibility event\n        for (const id in managersUsedBefore) {\n            const tileManager = this.tileManagers[id];\n\n            // (undefine !== false) will evaluate to true and fire an useless visibility event\n            // need force \"falsy\" values to boolean to avoid the case above\n            if (!!managersUsedBefore[id] !== !!tileManager.used) {\n                tileManager.fire(new Event('data',\n                    {\n                        sourceDataType: 'visibility',\n                        dataType: 'source',\n                        sourceId: id\n                    }));\n            }\n        }\n\n        this.light.recalculate(parameters);\n        this.sky.recalculate(parameters);\n        this.projection.recalculate(parameters);\n        this.z = parameters.zoom;\n\n        if (changed) {\n            this.fire(new Event('data', {dataType: 'style'}));\n        }\n    }\n\n    /*\n     * Apply any queued image changes.\n     */\n    _updateTilesForChangedImages() {\n        const changedImages = Object.keys(this._changedImages);\n        if (changedImages.length) {\n            for (const name in this.tileManagers) {\n                this.tileManagers[name].reloadTilesForDependencies(['icons', 'patterns'], changedImages);\n            }\n            this._changedImages = {};\n        }\n    }\n\n    _updateTilesForChangedGlyphs() {\n        if (this._glyphsDidChange) {\n            for (const name in this.tileManagers) {\n                this.tileManagers[name].reloadTilesForDependencies(['glyphs'], ['']);\n            }\n            this._glyphsDidChange = false;\n        }\n    }\n\n    _updateWorkerLayers(updatedIds: Array<string>, removedIds: Array<string>) {\n        this.dispatcher.broadcast(MessageType.updateLayers, {\n            layers: this._serializeByIds(updatedIds, false),\n            removedIds\n        });\n    }\n\n    _resetUpdates() {\n        this._changed = false;\n\n        this._updatedLayers = {};\n        this._removedLayers = {};\n\n        this._updatedSources = {};\n        this._updatedPaintProps = {};\n\n        this._changedImages = {};\n        this._glyphsDidChange = false;\n    }\n\n    /**\n     * Update this style's state to match the given style JSON, performing only\n     * the necessary mutations.\n     *\n     * May throw an Error ('Unimplemented: METHOD') if the mapbox-gl-style-spec\n     * diff algorithm produces an operation that is not supported.\n     *\n     * @returns true if any changes were made; false otherwise\n     */\n    setState(nextState: StyleSpecification, options: StyleSwapOptions & StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const serializedStyle =  this.serialize();\n        nextState = options.transformStyle ? options.transformStyle(serializedStyle, nextState) : nextState;\n        const validate = options.validate ?? true;\n        if (validate && emitValidationErrors(this, validateStyle(nextState))) return false;\n\n        nextState = clone(nextState);\n        nextState.layers = derefLayers(nextState.layers);\n\n        const changes = diffStyles(serializedStyle, nextState);\n        const operations = this._getOperationsToPerform(changes);\n\n        if (operations.unimplemented.length > 0) {\n            throw new Error(`Unimplemented: ${operations.unimplemented.join(', ')}.`);\n        }\n\n        if (operations.operations.length === 0) {\n            return false;\n        }\n\n        for (const styleChangeOperation of operations.operations) {\n            styleChangeOperation();\n        }\n\n        this.stylesheet = nextState;\n\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n\n        this.fire(new Event('style.load', {style: this}));\n\n        return true;\n    }\n\n    _getOperationsToPerform(diff: DiffCommand<DiffOperations>[]) {\n        const operations: Function[] = [];\n        const unimplemented: string[] = [];\n        for (const op of diff) {\n            switch (op.command) {\n                case 'setCenter':\n                case 'setZoom':\n                case 'setBearing':\n                case 'setPitch':\n                case 'setRoll':\n                    continue;\n                case 'addLayer':\n                    operations.push(() => this.addLayer.apply(this, op.args));\n                    break;\n                case 'removeLayer':\n                    operations.push(() => this.removeLayer.apply(this, op.args));\n                    break;\n                case 'setPaintProperty':\n                    operations.push(() => this.setPaintProperty.apply(this, op.args));\n                    break;\n                case 'setLayoutProperty':\n                    operations.push(() => this.setLayoutProperty.apply(this, op.args));\n                    break;\n                case 'setFilter':\n                    operations.push(() => this.setFilter.apply(this, op.args));\n                    break;\n                case 'addSource':\n                    operations.push(() => this.addSource.apply(this, op.args));\n                    break;\n                case 'removeSource':\n                    operations.push(() => this.removeSource.apply(this, op.args));\n                    break;\n                case 'setLayerZoomRange':\n                    operations.push(() => this.setLayerZoomRange.apply(this, op.args));\n                    break;\n                case 'setLight':\n                    operations.push(() => this.setLight.apply(this, op.args));\n                    break;\n                case 'setGeoJSONSourceData':\n                    operations.push(() => this.setGeoJSONSourceData.apply(this, op.args));\n                    break;\n                case 'setGlyphs':\n                    operations.push(() => this.setGlyphs.apply(this, op.args));\n                    break;\n                case 'setSprite':\n                    operations.push(() => this.setSprite.apply(this, op.args));\n                    break;\n                case 'setTerrain':\n                    operations.push(() => this.map.setTerrain.apply(this, op.args));\n                    break;\n                case 'setSky':\n                    operations.push(() => this.setSky.apply(this, op.args));\n                    break;\n                case 'setProjection':\n                    this.setProjection.apply(this, op.args);\n                    break;\n                case 'setGlobalState':\n                    operations.push(() => this.setGlobalState.apply(this, op.args));\n                    break;\n                case 'setTransition':\n                    operations.push(() => {});\n                    break;\n                default:\n                    unimplemented.push(op.command);\n                    break;\n            }\n        }\n        return {\n            operations,\n            unimplemented\n        };\n    }\n\n    addImage(id: string, image: StyleImage) {\n        if (this.getImage(id)) {\n            return this.fire(new ErrorEvent(new Error(`An image named \"${id}\" already exists.`)));\n        }\n        this.imageManager.addImage(id, image);\n        this._afterImageUpdated(id);\n    }\n\n    updateImage(id: string, image: StyleImage) {\n        this.imageManager.updateImage(id, image);\n    }\n\n    getImage(id: string): StyleImage {\n        return this.imageManager.getImage(id);\n    }\n\n    removeImage(id: string) {\n        if (!this.getImage(id)) {\n            return this.fire(new ErrorEvent(new Error(`An image named \"${id}\" does not exist.`)));\n        }\n        this.imageManager.removeImage(id);\n        this._afterImageUpdated(id);\n    }\n\n    _afterImageUpdated(id: string) {\n        this._availableImages = this.imageManager.listImages();\n        this._changedImages[id] = true;\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    listImages() {\n        this._checkLoaded();\n\n        return this.imageManager.listImages();\n    }\n\n    addSource(id: string, source: SourceSpecification | CanvasSourceSpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        if (this.tileManagers[id] !== undefined) {\n            throw new Error(`Source \"${id}\" already exists.`);\n        }\n\n        if (!source.type) {\n            throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(source).join(', ')}.`);\n        }\n\n        const builtIns = ['vector', 'raster', 'geojson', 'video', 'image'];\n        const shouldValidate = builtIns.indexOf(source.type) >= 0;\n        if (shouldValidate && this._validate(validateStyle.source, `sources.${id}`, source, null, options)) return;\n        if (this.map && this.map._collectResourceTiming) (source as any).collectResourceTiming = true;\n        const tileManager = this.tileManagers[id] = new TileManager(id, source, this.dispatcher);\n        tileManager.style = this;\n        tileManager.setEventedParent(this, () => ({\n            isSourceLoaded: tileManager.loaded(),\n            source: tileManager.serialize(),\n            sourceId: id\n        }));\n\n        tileManager.onAdd(this.map);\n        this._changed = true;\n    }\n\n    /**\n     * Remove a source from this stylesheet, given its id.\n     * @param id - id of the source to remove\n     * @throws if no source is found with the given ID\n     */\n    removeSource(id: string): this {\n        this._checkLoaded();\n\n        if (this.tileManagers[id] === undefined) {\n            throw new Error('There is no source with this ID');\n        }\n        for (const layerId in this._layers) {\n            if (this._layers[layerId].source === id) {\n                return this.fire(new ErrorEvent(new Error(`Source \"${id}\" cannot be removed while layer \"${layerId}\" is using it.`)));\n            }\n        }\n\n        const tileManager = this.tileManagers[id];\n        delete this.tileManagers[id];\n        delete this._updatedSources[id];\n        tileManager.fire(new Event('data', {sourceDataType: 'metadata', dataType: 'source', sourceId: id}));\n        tileManager.setEventedParent(null);\n        tileManager.onRemove(this.map);\n        this._changed = true;\n    }\n\n    /**\n     * Set the data of a GeoJSON source, given its id.\n     * @param id - id of the source\n     * @param data - GeoJSON source\n     */\n    setGeoJSONSourceData(id: string, data: GeoJSON.GeoJSON | string) {\n        this._checkLoaded();\n\n        if (this.tileManagers[id] === undefined) throw new Error(`There is no source with this ID=${id}`);\n        const geojsonSource: GeoJSONSource = (this.tileManagers[id].getSource() as any);\n        if (geojsonSource.type !== 'geojson') throw new Error(`geojsonSource.type is ${geojsonSource.type}, which is !== 'geojson`);\n\n        geojsonSource.setData(data);\n        this._changed = true;\n    }\n\n    /**\n     * Get a source by ID.\n     * @param id - ID of the desired source\n     * @returns source\n     */\n    getSource(id: string): Source | undefined {\n        return this.tileManagers[id] && this.tileManagers[id].getSource();\n    }\n\n    /**\n     * Add a layer to the map style. The layer will be inserted before the layer with\n     * ID `before`, or appended if `before` is omitted.\n     * @param layerObject - The style layer to add.\n     * @param before - ID of an existing layer to insert before\n     * @param options - Style setter options.\n     */\n    addLayer(layerObject: AddLayerObject, before?: string, options: StyleSetterOptions = {}): this {\n        this._checkLoaded();\n\n        const id = layerObject.id;\n\n        if (this.getLayer(id)) {\n            this.fire(new ErrorEvent(new Error(`Layer \"${id}\" already exists on this map.`)));\n            return;\n        }\n\n        let layer: ReturnType<typeof createStyleLayer>;\n        if (layerObject.type === 'custom') {\n\n            if (emitValidationErrors(this, validateCustomStyleLayer(layerObject))) return;\n\n            layer = createStyleLayer(layerObject, this._globalState);\n\n        } else {\n            if ('source' in layerObject && typeof layerObject.source === 'object') {\n                this.addSource(id, layerObject.source);\n                layerObject = clone(layerObject);\n                layerObject = extend(layerObject, {source: id});\n            }\n\n            // this layer is not in the style.layers array, so we pass an impossible array index\n            if (this._validate(validateStyle.layer,\n                `layers.${id}`, layerObject, {arrayIndex: -1}, options)) return;\n\n            layer = createStyleLayer(layerObject as LayerSpecification | CustomLayerInterface, this._globalState);\n            this._validateLayer(layer);\n\n            layer.setEventedParent(this, {layer: {id}});\n        }\n\n        const index = before ? this._order.indexOf(before) : this._order.length;\n        if (before && index === -1) {\n            this.fire(new ErrorEvent(new Error(`Cannot add layer \"${id}\" before non-existing layer \"${before}\".`)));\n            return;\n        }\n\n        this._order.splice(index, 0, id);\n        this._layerOrderChanged = true;\n\n        this._layers[id] = layer;\n\n        if (this._removedLayers[id] && layer.source && layer.type !== 'custom') {\n            // If, in the current batch, we have already removed this layer\n            // and we are now re-adding it with a different `type`, then we\n            // need to clear (rather than just reload) the underlying source's\n            // tiles.  Otherwise, tiles marked 'reloading' will have buckets /\n            // buffers that are set up for the _previous_ version of this\n            // layer, causing, e.g.:\n            // https://github.com/mapbox/mapbox-gl-js/issues/3633\n            const removed = this._removedLayers[id];\n            delete this._removedLayers[id];\n            if (removed.type !== layer.type) {\n                this._updatedSources[layer.source] = 'clear';\n            } else {\n                this._updatedSources[layer.source] = 'reload';\n                this.tileManagers[layer.source].pause();\n            }\n        }\n        this._updateLayer(layer);\n\n        if (layer.onAdd) {\n            layer.onAdd(this.map);\n        }\n    }\n\n    /**\n     * Moves a layer to a different z-position. The layer will be inserted before the layer with\n     * ID `before`, or appended if `before` is omitted.\n     * @param id - ID of the layer to move\n     * @param before - ID of an existing layer to insert before\n     */\n    moveLayer(id: string, before?: string) {\n        this._checkLoaded();\n        this._changed = true;\n\n        const layer = this._layers[id];\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`The layer '${id}' does not exist in the map's style and cannot be moved.`)));\n            return;\n        }\n\n        if (id === before) {\n            return;\n        }\n\n        const index = this._order.indexOf(id);\n        this._order.splice(index, 1);\n\n        const newIndex = before ? this._order.indexOf(before) : this._order.length;\n        if (before && newIndex === -1) {\n            this.fire(new ErrorEvent(new Error(`Cannot move layer \"${id}\" before non-existing layer \"${before}\".`)));\n            return;\n        }\n        this._order.splice(newIndex, 0, id);\n\n        this._layerOrderChanged = true;\n    }\n\n    /**\n     * Remove the layer with the given id from the style.\n     * A {@link ErrorEvent} event will be fired if no such layer exists.\n     *\n     * @param id - id of the layer to remove\n     */\n    removeLayer(id: string) {\n        this._checkLoaded();\n\n        const layer = this._layers[id];\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot remove non-existing layer \"${id}\".`)));\n            return;\n        }\n\n        layer.setEventedParent(null);\n\n        const index = this._order.indexOf(id);\n        this._order.splice(index, 1);\n\n        this._layerOrderChanged = true;\n        this._changed = true;\n        this._removedLayers[id] = layer;\n        delete this._layers[id];\n\n        if (this._serializedLayers) {\n            delete this._serializedLayers[id];\n        }\n        delete this._updatedLayers[id];\n        delete this._updatedPaintProps[id];\n\n        if (layer.onRemove) {\n            layer.onRemove(this.map);\n        }\n    }\n\n    /**\n     * Return the style layer object with the given `id`.\n     *\n     * @param id - id of the desired layer\n     * @returns a layer, if one with the given `id` exists\n     */\n    getLayer(id: string): StyleLayer | undefined {\n        return this._layers[id];\n    }\n\n    /**\n     * Return the ids of all layers currently in the style, including custom layers, in order.\n     *\n     * @returns ids of layers, in order\n     */\n    getLayersOrder(): string[] {\n        return [...this._order];\n    }\n\n    /**\n     * Checks if a specific layer is present within the style.\n     *\n     * @param id - the id of the desired layer\n     * @returns a boolean specifying if the given layer is present\n     */\n    hasLayer(id: string): boolean {\n        return id in this._layers;\n    }\n\n    setLayerZoomRange(layerId: string, minzoom?: number | null, maxzoom?: number | null) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (layer.minzoom === minzoom && layer.maxzoom === maxzoom) return;\n\n        if (minzoom != null) {\n            layer.minzoom = minzoom;\n        }\n        if (maxzoom != null) {\n            layer.maxzoom = maxzoom;\n        }\n        this._updateLayer(layer);\n    }\n\n    setFilter(layerId: string, filter?: FilterSpecification | null,  options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot filter non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.filter, filter)) {\n            return;\n        }\n\n        if (filter === null || filter === undefined) {\n            layer.setFilter(undefined);\n            this._updateLayer(layer);\n            return;\n        }\n\n        if (this._validate(validateStyle.filter, `layers.${layer.id}.filter`, filter, null, options)) {\n            return;\n        }\n\n        layer.setFilter(clone(filter));\n        this._updateLayer(layer);\n    }\n\n    /**\n     * Get a layer's filter object\n     * @param layer - the layer to inspect\n     * @returns the layer's filter, if any\n     */\n    getFilter(layer: string): FilterSpecification | void {\n        return clone(this.getLayer(layer).filter);\n    }\n\n    setLayoutProperty(layerId: string, name: string, value: any,  options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot style non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.getLayoutProperty(name), value)) return;\n\n        layer.setLayoutProperty(name, value, options);\n        this._updateLayer(layer);\n    }\n\n    /**\n     * Get a layout property's value from a given layer\n     * @param layerId - the layer to inspect\n     * @param name - the name of the layout property\n     * @returns the property value\n     */\n    getLayoutProperty(layerId: string, name: string) {\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot get style of non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        return layer.getLayoutProperty(name);\n    }\n\n    setPaintProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot style non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.getPaintProperty(name), value)) return;\n\n        this._updatePaintProperty(layer, name, value, options);\n    }\n\n    _updatePaintProperty(layer: StyleLayer, name: string, value: any, options: StyleSetterOptions = {}) {\n        const requiresRelayout = layer.setPaintProperty(name, value, options);\n        if (requiresRelayout) {\n            this._updateLayer(layer);\n        }\n\n        if (isRasterStyleLayer(layer) && name === 'raster-fade-duration') {\n            this.tileManagers[layer.source].setRasterFadeDuration(value);\n        }\n\n        this._changed = true;\n        this._updatedPaintProps[layer.id] = true;\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n    }\n\n    getPaintProperty(layer: string, name: string) {\n        return this.getLayer(layer).getPaintProperty(name);\n    }\n\n    setFeatureState(target: FeatureIdentifier, state: any) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const sourceLayer = target.sourceLayer;\n        const tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n        const sourceType = tileManager.getSource().type;\n        if (sourceType === 'geojson' && sourceLayer) {\n            this.fire(new ErrorEvent(new Error('GeoJSON sources cannot have a sourceLayer parameter.')));\n            return;\n        }\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n        if (target.id === undefined) {\n            this.fire(new ErrorEvent(new Error('The feature id parameter must be provided.')));\n        }\n\n        tileManager.setFeatureState(sourceLayer, target.id, state);\n    }\n\n    removeFeatureState(target: FeatureIdentifier, key?: string) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n\n        const sourceType = tileManager.getSource().type;\n        const sourceLayer = sourceType === 'vector' ? target.sourceLayer : undefined;\n\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n\n        if (key && (typeof target.id !== 'string' && typeof target.id !== 'number')) {\n            this.fire(new ErrorEvent(new Error('A feature id is required to remove its specific state property.')));\n            return;\n        }\n\n        tileManager.removeFeatureState(sourceLayer, target.id, key);\n    }\n\n    getFeatureState(target: FeatureIdentifier) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const sourceLayer = target.sourceLayer;\n        const tileManager = this.tileManagers[sourceId];\n\n        if (tileManager === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n        const sourceType = tileManager.getSource().type;\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n        if (target.id === undefined) {\n            this.fire(new ErrorEvent(new Error('The feature id parameter must be provided.')));\n        }\n\n        return tileManager.getFeatureState(sourceLayer, target.id);\n    }\n\n    getTransition() {\n        return extend({duration: 300, delay: 0}, this.stylesheet && this.stylesheet.transition);\n    }\n\n    serialize(): StyleSpecification | undefined {\n        // We return undefined before we're loaded, following the pattern of Map.getStyle() before\n        // the Style object is initialized.\n        // Internally, Style._validate() calls Style.serialize() but callers are responsible for\n        // calling Style._checkLoaded() first if their validation requires the style to be loaded.\n        if (!this._loaded) return;\n\n        const sources = mapObject(this.tileManagers, (source) => source.serialize());\n        const layers = this._serializeByIds(this._order, true);\n        const terrain = this.map.getTerrain() || undefined;\n        const myStyleSheet = this.stylesheet;\n\n        return filterObject({\n            version: myStyleSheet.version,\n            name: myStyleSheet.name,\n            metadata: myStyleSheet.metadata,\n            light: myStyleSheet.light,\n            sky: myStyleSheet.sky,\n            center: myStyleSheet.center,\n            zoom: myStyleSheet.zoom,\n            bearing: myStyleSheet.bearing,\n            pitch: myStyleSheet.pitch,\n            sprite: myStyleSheet.sprite,\n            glyphs: myStyleSheet.glyphs,\n            transition: myStyleSheet.transition,\n            projection: myStyleSheet.projection,\n            sources,\n            layers,\n            terrain\n        },\n        (value) => { return value !== undefined; });\n    }\n\n    _updateLayer(layer: StyleLayer) {\n        this._updatedLayers[layer.id] = true;\n        if (layer.source && !this._updatedSources[layer.source] &&\n            //Skip for raster layers (https://github.com/mapbox/mapbox-gl-js/issues/7865)\n            this.tileManagers[layer.source].getSource().type !== 'raster') {\n            this._updatedSources[layer.source] = 'reload';\n            this.tileManagers[layer.source].pause();\n        }\n\n        // upon updating, serialized layer dictionary should be reset.\n        // When needed, it will be populated with the correct copy again.\n        this._serializedLayers = null;\n        this._changed = true;\n    }\n\n    _flattenAndSortRenderedFeatures(sourceResults: QueryRenderedFeaturesResults[]): MapGeoJSONFeature[] {\n        // Feature order is complicated.\n        // The order between features in two 2D layers is always determined by layer order.\n        // The order between features in two 3D layers is always determined by depth.\n        // The order between a feature in a 2D layer and a 3D layer is tricky:\n        //      Most often layer order determines the feature order in this case. If\n        //      a line layer is above a extrusion layer the line feature will be rendered\n        //      above the extrusion. If the line layer is below the extrusion layer,\n        //      it will be rendered below it.\n        //\n        //      There is a weird case though.\n        //      You have layers in this order: extrusion_layer_a, line_layer, extrusion_layer_b\n        //      Each layer has a feature that overlaps the other features.\n        //      The feature in extrusion_layer_a is closer than the feature in extrusion_layer_b so it is rendered above.\n        //      The feature in line_layer is rendered above extrusion_layer_a.\n        //      This means that that the line_layer feature is above the extrusion_layer_b feature despite\n        //      it being in an earlier layer.\n\n        const isLayer3D = layerId => this._layers[layerId].type === 'fill-extrusion';\n\n        const layerIndex = {};\n        const features3D: QueryRenderedFeaturesResultsItem[] = [];\n        for (let l = this._order.length - 1; l >= 0; l--) {\n            const layerId = this._order[l];\n            if (isLayer3D(layerId)) {\n                layerIndex[layerId] = l;\n                for (const sourceResult of sourceResults) {\n                    const layerFeatures = sourceResult[layerId];\n                    if (layerFeatures) {\n                        for (const featureWrapper of layerFeatures) {\n                            features3D.push(featureWrapper);\n                        }\n                    }\n                }\n            }\n        }\n\n        features3D.sort((a, b) => {\n            return (b.intersectionZ as number) - (a.intersectionZ as number);\n        });\n\n        const features: MapGeoJSONFeature[] = [];\n        for (let l = this._order.length - 1; l >= 0; l--) {\n            const layerId = this._order[l];\n\n            if (isLayer3D(layerId)) {\n                // add all 3D features that are in or above the current layer\n                for (let i = features3D.length - 1; i >= 0; i--) {\n                    const topmost3D = features3D[i].feature;\n                    if (layerIndex[topmost3D.layer.id] < l) break;\n                    features.push(topmost3D);\n                    features3D.pop();\n                }\n            } else {\n                for (const sourceResult of sourceResults) {\n                    const layerFeatures = sourceResult[layerId];\n                    if (layerFeatures) {\n                        for (const featureWrapper of layerFeatures) {\n                            features.push(featureWrapper.feature);\n                        }\n                    }\n                }\n            }\n        }\n\n        return features;\n    }\n\n    queryRenderedFeatures(queryGeometry: Point[], params: QueryRenderedFeaturesOptions, transform: IReadonlyTransform): MapGeoJSONFeature[] {\n        if (params && params.filter) {\n            this._validate(validateStyle.filter, 'queryRenderedFeatures.filter', params.filter, null, params);\n        }\n\n        const includedSources = {};\n        if (params && params.layers) {\n            const isArrayOrSet = Array.isArray(params.layers) || params.layers instanceof Set;\n            if (!isArrayOrSet) {\n                this.fire(new ErrorEvent(new Error('parameters.layers must be an Array or a Set of strings')));\n                return [];\n            }\n            for (const layerId of params.layers) {\n                const layer = this._layers[layerId];\n                if (!layer) {\n                    // this layer is not in the style.layers array\n                    this.fire(new ErrorEvent(new Error(`The layer '${layerId}' does not exist in the map's style and cannot be queried for features.`)));\n                    return [];\n                }\n                includedSources[layer.source] = true;\n            }\n        }\n\n        const sourceResults: QueryRenderedFeaturesResults[] = [];\n\n        params.availableImages = this._availableImages;\n\n        // LayerSpecification is serialized StyleLayer, and this casting is safe.\n        const serializedLayers = this._serializedAllLayers() as {[_: string]: StyleLayer};\n\n        const layersAsSet = params.layers instanceof Set ? params.layers : Array.isArray(params.layers) ? new Set(params.layers) : null;\n        const paramsStrict: QueryRenderedFeaturesOptionsStrict = {\n            ...params,\n            layers: layersAsSet,\n            globalState: this._globalState\n        };\n\n        for (const id in this.tileManagers) {\n            if (params.layers && !includedSources[id]) continue;\n            sourceResults.push(\n                queryRenderedFeatures(\n                    this.tileManagers[id],\n                    this._layers,\n                    serializedLayers,\n                    queryGeometry,\n                    paramsStrict,\n                    transform,\n                    this.map.terrain ?\n                        (id: OverscaledTileID, x: number, y: number) =>\n                            this.map.terrain.getElevation(id, x, y) :\n                        undefined)\n            );\n        }\n\n        if (this.placement) {\n            // If a placement has run, query against its CollisionIndex\n            // for symbol results, and treat it as an extra source to merge\n            sourceResults.push(\n                queryRenderedSymbols(\n                    this._layers,\n                    serializedLayers,\n                    this.tileManagers,\n                    queryGeometry,\n                    paramsStrict,\n                    this.placement.collisionIndex,\n                    this.placement.retainedQueryData)\n            );\n        }\n\n        return this._flattenAndSortRenderedFeatures(sourceResults);\n    }\n\n    querySourceFeatures(\n        sourceID: string,\n        params?: QuerySourceFeatureOptions\n    ) {\n        if (params?.filter) {\n            this._validate(validateStyle.filter, 'querySourceFeatures.filter', params.filter, null, params);\n        }\n        const tileManager = this.tileManagers[sourceID];\n        return tileManager ? querySourceFeatures(tileManager, params ? {...params, globalState: this._globalState} : {globalState: this._globalState}) : [];\n    }\n\n    getLight() {\n        return this.light.getLight();\n    }\n\n    setLight(lightOptions: LightSpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const light = this.light.getLight();\n        let _update = false;\n        for (const key in lightOptions) {\n            if (!deepEqual(lightOptions[key], light[key])) {\n                _update = true;\n                break;\n            }\n        }\n        if (!_update) return;\n\n        const parameters = {\n            now: now(),\n            transition: extend({\n                duration: 300,\n                delay: 0\n            }, this.stylesheet.transition)\n        };\n\n        this.light.setLight(lightOptions, options);\n        this.light.updateTransitions(parameters);\n    }\n\n    getProjection(): ProjectionSpecification {\n        return this.stylesheet?.projection;\n    }\n\n    setProjection(projection: ProjectionSpecification) {\n        this._checkLoaded();\n        if (this.projection) {\n            if (this.projection.name === projection.type) return;\n            this.projection.destroy();\n            delete this.projection;\n        }\n        this.stylesheet.projection = projection;\n        this._setProjectionInternal(projection.type);\n    }\n\n    getSky(): SkySpecification {\n        return this.stylesheet?.sky;\n    }\n\n    setSky(skyOptions?: SkySpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n        const sky = this.getSky();\n\n        let update = false;\n        if (!skyOptions && !sky) return;\n\n        if (skyOptions && !sky) {\n            update = true;\n        } else if (!skyOptions && sky) {\n            update = true;\n        } else {\n            for (const key in skyOptions) {\n                if (!deepEqual(skyOptions[key], sky[key])) {\n                    update = true;\n                    break;\n                }\n            }\n        }\n        if (!update) return;\n\n        const parameters = {\n            now: now(),\n            transition: extend({\n                duration: 300,\n                delay: 0\n            }, this.stylesheet.transition)\n        };\n\n        this.stylesheet.sky = skyOptions;\n        this.sky.setSky(skyOptions, options);\n        this.sky.updateTransitions(parameters);\n    }\n\n    _setProjectionInternal(name: ProjectionSpecification['type']) {\n        const projectionObjects = createProjectionFromName(name, this.map.transformConstrain);\n        this.projection = projectionObjects.projection;\n        this.map.migrateProjection(projectionObjects.transform, projectionObjects.cameraHelper);\n        for (const key in this.tileManagers) {\n            this.tileManagers[key].reload();\n        }\n    }\n\n    _validate(validate: Validator, key: string, value: any, props: any, options: {\n        validate?: boolean;\n    } = {}) {\n        if (options && options.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, extend({\n            key,\n            style: this.serialize(),\n            value,\n            styleSpec\n        }, props)));\n    }\n\n    _remove(mapRemoved: boolean = true) {\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        if (this._loadStyleRequest) {\n            this._loadStyleRequest.abort();\n            this._loadStyleRequest = null;\n        }\n        if (this._spriteRequest) {\n            this._spriteRequest.abort();\n            this._spriteRequest = null;\n        }\n        rtlMainThreadPluginFactory().off(RTLPluginLoadedEventName, this._rtlPluginLoaded);\n        for (const layerId in this._layers) {\n            const layer: StyleLayer = this._layers[layerId];\n            layer.setEventedParent(null);\n        }\n        for (const id in this.tileManagers) {\n            const tileManager = this.tileManagers[id];\n            tileManager.setEventedParent(null);\n            tileManager.onRemove(this.map);\n        }\n        this.imageManager.setEventedParent(null);\n        this.setEventedParent(null);\n        if (mapRemoved) {\n            this.dispatcher.broadcast(MessageType.removeMap, undefined);\n        }\n        this.dispatcher.remove(mapRemoved);\n    }\n\n    _clearSource(id: string) {\n        this.tileManagers[id].clearTiles();\n    }\n\n    _reloadSource(id: string) {\n        this.tileManagers[id].resume();\n        this.tileManagers[id].reload();\n    }\n\n    _updateSources(transform: ITransform) {\n        for (const id in this.tileManagers) {\n            this.tileManagers[id].update(transform, this.map.terrain);\n        }\n    }\n\n    _generateCollisionBoxes() {\n        for (const id in this.tileManagers) {\n            this._reloadSource(id);\n        }\n    }\n\n    _updatePlacement(transform: ITransform, showCollisionBoxes: boolean, fadeDuration: number, crossSourceCollisions: boolean, forceFullPlacement: boolean = false) {\n        let symbolBucketsChanged = false;\n        let placementCommitted = false;\n\n        const layerTiles = {};\n\n        for (const layerID of this._order) {\n            const styleLayer = this._layers[layerID];\n            if (styleLayer.type !== 'symbol') continue;\n\n            if (!layerTiles[styleLayer.source]) {\n                const tileManager = this.tileManagers[styleLayer.source];\n                layerTiles[styleLayer.source] = tileManager.getRenderableIds(true)\n                    .map((id) => tileManager.getTileByID(id))\n                    .sort((a, b) => (b.tileID.overscaledZ - a.tileID.overscaledZ) || (a.tileID.isLessThan(b.tileID) ? -1 : 1));\n            }\n\n            const layerBucketsChanged = this.crossTileSymbolIndex.addLayer(styleLayer, layerTiles[styleLayer.source], transform.center.lng);\n            symbolBucketsChanged = symbolBucketsChanged || layerBucketsChanged;\n        }\n        this.crossTileSymbolIndex.pruneUnusedLayers(this._order);\n\n        // Anything that changes our \"in progress\" layer and tile indices requires us\n        // to start over. When we start over, we do a full placement instead of incremental\n        // to prevent starvation.\n        // We need to restart placement to keep layer indices in sync.\n        // Also force full placement when fadeDuration === 0 to ensure that newly loaded\n        // tiles will fully display symbols in their first frame\n        forceFullPlacement = forceFullPlacement || this._layerOrderChanged || fadeDuration === 0;\n\n        if (forceFullPlacement || !this.pauseablePlacement || (this.pauseablePlacement.isDone() && !this.placement.stillRecent(now(), transform.zoom))) {\n            this.pauseablePlacement = new PauseablePlacement(transform, this.map.terrain, this._order, forceFullPlacement, showCollisionBoxes, fadeDuration, crossSourceCollisions, this.placement);\n            this._layerOrderChanged = false;\n        }\n\n        if (this.pauseablePlacement.isDone()) {\n            // the last placement finished running, but the next one hasnât\n            // started yet because of the `stillRecent` check immediately\n            // above, so mark it stale to ensure that we request another\n            // render frame\n            this.placement.setStale();\n        } else {\n            this.pauseablePlacement.continuePlacement(this._order, this._layers, layerTiles);\n\n            if (this.pauseablePlacement.isDone()) {\n                this.placement = this.pauseablePlacement.commit(now());\n                placementCommitted = true;\n            }\n\n            if (symbolBucketsChanged) {\n                // since the placement gets split over multiple frames it is possible\n                // these buckets were processed before they were changed and so the\n                // placement is already stale while it is in progress\n                this.pauseablePlacement.placement.setStale();\n            }\n        }\n\n        if (placementCommitted || symbolBucketsChanged) {\n            for (const layerID of this._order) {\n                const styleLayer = this._layers[layerID];\n                if (styleLayer.type !== 'symbol') continue;\n                this.placement.updateLayerOpacities(styleLayer, layerTiles[styleLayer.source]);\n            }\n        }\n\n        // needsRender is false when we have just finished a placement that didn't change the visibility of any symbols\n        const needsRerender = !this.pauseablePlacement.isDone() || this.placement.hasTransitions(now());\n        return needsRerender;\n    }\n\n    _releaseSymbolFadeTiles() {\n        for (const id in this.tileManagers) {\n            this.tileManagers[id].releaseSymbolFadeTiles();\n        }\n    }\n\n    // Callbacks from web workers\n\n    async getImages(mapId: string | number, params: GetImagesParameters): Promise<GetImagesResponse> {\n        const images = await this.imageManager.getImages(params.icons);\n\n        // Apply queued image changes before setting the tile's dependencies so that the tile\n        // is not reloaded unnecessarily. Without this forced update the reload could happen in cases\n        // like this one:\n        // - icons contains \"my-image\"\n        // - imageManager.getImages(...) triggers `onstyleimagemissing`\n        // - the user adds \"my-image\" within the callback\n        // - addImage adds \"my-image\" to this._changedImages\n        // - the next frame triggers a reload of this tile even though it already has the latest version\n        this._updateTilesForChangedImages();\n\n        const tileManager = this.tileManagers[params.source];\n        if (tileManager) {\n            tileManager.setDependencies(params.tileID.key, params.type, params.icons);\n        }\n        return images;\n    }\n\n    async getGlyphs(mapId: string | number, params: GetGlyphsParameters): Promise<GetGlyphsResponse> {\n        const glyphs = await this.glyphManager.getGlyphs(params.stacks);\n        const tileManager = this.tileManagers[params.source];\n        if (tileManager) {\n            // we are not setting stacks as dependencies since for now\n            // we just need to know which tiles have glyph dependencies\n            tileManager.setDependencies(params.tileID.key, params.type, ['']);\n        }\n        return glyphs;\n    }\n\n    getGlyphsUrl(): string | null {\n        return this.stylesheet.glyphs || null;\n    }\n\n    setGlyphs(glyphsUrl: string | null | undefined, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        if (glyphsUrl && this._validate(validateStyle.glyphs, 'glyphs', glyphsUrl, null, options)) {\n            return;\n        }\n\n        this._glyphsDidChange = true;\n        this.stylesheet.glyphs = glyphsUrl;\n        this.glyphManager.entries = {};\n        this.glyphManager.setURL(glyphsUrl);\n    }\n\n    async getDashes(mapId: string | number, params: GetDashesParameters): Promise<GetDashesResponse> {\n        const result: GetDashesResponse = {};\n        for (const [key, dash] of Object.entries(params.dashes)) {\n            result[key] = this.lineAtlas.getDash(dash.dasharray, dash.round);\n        }\n        return result;\n    }\n\n    /**\n     * Add a sprite.\n     *\n     * @param id - The id of the desired sprite\n     * @param url - The url to load the desired sprite from\n     * @param options - The style setter options\n     * @param completion - The completion handler\n     */\n    addSprite(id: string, url: string, options: StyleSetterOptions = {}, completion?: (err: Error) => void) {\n        this._checkLoaded();\n\n        const spriteToAdd = [{id, url}];\n        const updatedSprite = [\n            ...coerceSpriteToArray(this.stylesheet.sprite),\n            ...spriteToAdd\n        ];\n\n        if (this._validate(validateStyle.sprite, 'sprite', updatedSprite, null, options)) return;\n\n        this.stylesheet.sprite = updatedSprite;\n        this._loadSprite(spriteToAdd, true, completion);\n    }\n\n    /**\n     * Remove a sprite by its id. When the last sprite is removed, the whole `this.stylesheet.sprite` object becomes\n     * `undefined`. This falsy `undefined` value later prevents attempts to load the sprite when it's absent.\n     *\n     * @param id - the id of the sprite to remove\n     */\n    removeSprite(id: string) {\n        this._checkLoaded();\n\n        const internalSpriteRepresentation = coerceSpriteToArray(this.stylesheet.sprite);\n\n        if (!internalSpriteRepresentation.find(sprite => sprite.id === id)) {\n            this.fire(new ErrorEvent(new Error(`Sprite \"${id}\" doesn't exists on this map.`)));\n            return;\n        }\n\n        if (this._spritesImagesIds[id]) {\n            for (const imageId of this._spritesImagesIds[id]) {\n                this.imageManager.removeImage(imageId);\n                this._changedImages[imageId] = true;\n            }\n        }\n\n        internalSpriteRepresentation.splice(internalSpriteRepresentation.findIndex(sprite => sprite.id === id), 1);\n        this.stylesheet.sprite = internalSpriteRepresentation.length > 0 ? internalSpriteRepresentation : undefined;\n\n        delete this._spritesImagesIds[id];\n        this._availableImages = this.imageManager.listImages();\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    /**\n     * Get the current sprite value.\n     *\n     * @returns empty array when no sprite is set; id-url pairs otherwise\n     */\n    getSprite() {\n        return coerceSpriteToArray(this.stylesheet.sprite);\n    }\n\n    /**\n     * Set a new value for the style's sprite.\n     *\n     * @param sprite - new sprite value\n     * @param options - style setter options\n     * @param completion - the completion handler\n     */\n    setSprite(sprite: SpriteSpecification, options: StyleSetterOptions = {}, completion?: (err: Error) => void) {\n        this._checkLoaded();\n\n        if (sprite && this._validate(validateStyle.sprite, 'sprite', sprite, null, options)) {\n            return;\n        }\n\n        this.stylesheet.sprite = sprite;\n\n        if (sprite) {\n            this._loadSprite(sprite, true, completion);\n        } else {\n            this._unloadSprite();\n            if (completion) {\n                completion(null);\n            }\n        }\n    }\n\n    /**\n     * Destroys all internal resources of the style (sources, images, layers, etc.)\n     */\n    destroy() {\n        // cancel any pending requests\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        if (this._loadStyleRequest) {\n            this._loadStyleRequest.abort();\n            this._loadStyleRequest = null;\n        }\n        if (this._spriteRequest) {\n            this._spriteRequest.abort();\n            this._spriteRequest = null;\n        }\n\n        // remove sourcecaches\n        for (const id in this.tileManagers) {\n            const tileManager = this.tileManagers[id];\n            tileManager.setEventedParent(null);\n            tileManager.onRemove(this.map);\n        }\n        this.tileManagers = {};\n\n        // Destroy imageManager and clear images\n        if (this.imageManager) {\n            this.imageManager.setEventedParent(null);\n            this.imageManager.destroy();\n            this._availableImages = [];\n            this._spritesImagesIds = {};\n        }\n\n        // Destroy glyphManager\n        if (this.glyphManager) {\n            this.glyphManager.destroy();\n        }\n\n        // Remove layers\n        for (const layerId in this._layers) {\n            const layer = this._layers[layerId];\n            layer.setEventedParent(null);\n            if (layer.onRemove) layer.onRemove(this.map);\n        }\n\n        // reset internal state\n        this._setInitialValues();\n\n        // Remove event listeners\n        this.setEventedParent(null);\n        this.dispatcher.unregisterMessageHandler(MessageType.getGlyphs);\n        this.dispatcher.unregisterMessageHandler(MessageType.getImages);\n        this.dispatcher.unregisterMessageHandler(MessageType.getDashes);\n        this.dispatcher.remove(true);\n        this._listeners = {};\n        this._oneTimeListeners = {};\n    }\n}\n","import {warnOnce} from '../../util/util';\nimport {MercatorProjection} from './mercator_projection';\nimport {MercatorTransform} from './mercator_transform';\nimport {MercatorCameraHelper} from './mercator_camera_helper';\nimport {GlobeProjection} from './globe_projection';\nimport {GlobeTransform} from './globe_transform';\nimport {GlobeCameraHelper} from './globe_camera_helper';\nimport {VerticalPerspectiveCameraHelper} from './vertical_perspective_camera_helper';\nimport {VerticalPerspectiveTransform} from './vertical_perspective_transform';\nimport {VerticalPerspectiveProjection} from './vertical_perspective_projection';\n\nimport type {ProjectionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Projection} from './projection';\nimport type {ITransform, TransformConstrainFunction} from '../transform_interface';\nimport type {ICameraHelper} from './camera_helper';\n\nexport function createProjectionFromName(name: ProjectionSpecification['type'], transformConstrain?: TransformConstrainFunction): {\n    projection: Projection;\n    transform: ITransform;\n    cameraHelper: ICameraHelper;\n} {\n    const transformOptions = {constrainOverride: transformConstrain};\n    if (Array.isArray(name)) {\n        const globeProjection = new GlobeProjection({type: name});\n        return {\n            projection: globeProjection,\n            transform: new GlobeTransform(transformOptions),\n            cameraHelper: new GlobeCameraHelper(globeProjection),\n        };\n    }\n    switch (name) {\n        case 'mercator':\n        {\n            return {\n                projection: new MercatorProjection(),\n                transform: new MercatorTransform(transformOptions),\n                cameraHelper: new MercatorCameraHelper(),\n            };\n        }\n        case 'globe':\n        {\n            const globeProjection = new GlobeProjection({type: [\n                'interpolate',\n                ['linear'],\n                ['zoom'],\n                11,\n                'vertical-perspective',\n                12,\n                'mercator'\n            ]});\n            return {\n                projection: globeProjection,\n                transform: new GlobeTransform(transformOptions),\n                cameraHelper: new GlobeCameraHelper(globeProjection),\n            };\n        }\n        case 'vertical-perspective':\n        {\n            return {\n                projection: new VerticalPerspectiveProjection(),\n                transform: new VerticalPerspectiveTransform(transformOptions),\n                cameraHelper: new VerticalPerspectiveCameraHelper(),\n            };\n        }\n        default:\n        {\n            warnOnce(`Unknown projection name: ${name}. Falling back to mercator projection.`);\n            return {\n                projection: new MercatorProjection(),\n                transform: new MercatorTransform(transformOptions),\n                cameraHelper: new MercatorCameraHelper(),\n            };\n        }\n    }\n}\n","import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos', type: 'Int16', components: 2},\n    {name: 'a_texture_pos', type: 'Int16', components: 2}\n]);\n","\nimport type {Program} from './program';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {Context} from '../gl/context';\n\n/**\n * @internal\n * A vertex array object used to pass data to the webgl code\n */\nexport class VertexArrayObject {\n    context: Context;\n    boundProgram: Program<any>;\n    boundLayoutVertexBuffer: VertexBuffer;\n    boundPaintVertexBuffers: Array<VertexBuffer>;\n    boundIndexBuffer: IndexBuffer;\n    boundVertexOffset: number;\n    boundDynamicVertexBuffer: VertexBuffer;\n    boundDynamicVertexBuffer2: VertexBuffer;\n    boundDynamicVertexBuffer3: VertexBuffer;\n    vao: any;\n\n    constructor() {\n        this.boundProgram = null;\n        this.boundLayoutVertexBuffer = null;\n        this.boundPaintVertexBuffers = [];\n        this.boundIndexBuffer = null;\n        this.boundVertexOffset = null;\n        this.boundDynamicVertexBuffer = null;\n        this.vao = null;\n    }\n\n    bind(context: Context,\n        program: Program<any>,\n        layoutVertexBuffer: VertexBuffer,\n        paintVertexBuffers: Array<VertexBuffer>,\n        indexBuffer?: IndexBuffer | null,\n        vertexOffset?: number | null,\n        dynamicVertexBuffer?: VertexBuffer | null,\n        dynamicVertexBuffer2?: VertexBuffer | null,\n        dynamicVertexBuffer3?: VertexBuffer | null) {\n\n        this.context = context;\n\n        let paintBuffersDiffer = this.boundPaintVertexBuffers.length !== paintVertexBuffers.length;\n        for (let i = 0; !paintBuffersDiffer && i < paintVertexBuffers.length; i++) {\n            if (this.boundPaintVertexBuffers[i] !== paintVertexBuffers[i]) {\n                paintBuffersDiffer = true;\n            }\n        }\n\n        const isFreshBindRequired = (\n            !this.vao ||\n            this.boundProgram !== program ||\n            this.boundLayoutVertexBuffer !== layoutVertexBuffer ||\n            paintBuffersDiffer ||\n            this.boundIndexBuffer !== indexBuffer ||\n            this.boundVertexOffset !== vertexOffset ||\n            this.boundDynamicVertexBuffer !== dynamicVertexBuffer ||\n            this.boundDynamicVertexBuffer2 !== dynamicVertexBuffer2 ||\n            this.boundDynamicVertexBuffer3 !== dynamicVertexBuffer3\n        );\n\n        if (isFreshBindRequired) {\n            this.freshBind(program, layoutVertexBuffer, paintVertexBuffers, indexBuffer, vertexOffset, dynamicVertexBuffer, dynamicVertexBuffer2, dynamicVertexBuffer3);\n        } else {\n            context.bindVertexArray.set(this.vao);\n\n            if (dynamicVertexBuffer) {\n                // The buffer may have been updated. Rebind to upload data.\n                dynamicVertexBuffer.bind();\n            }\n\n            if (indexBuffer && indexBuffer.dynamicDraw) {\n                indexBuffer.bind();\n            }\n\n            if (dynamicVertexBuffer2) {\n                dynamicVertexBuffer2.bind();\n            }\n\n            if (dynamicVertexBuffer3) {\n                dynamicVertexBuffer3.bind();\n            }\n        }\n    }\n\n    freshBind(program: Program<any>,\n        layoutVertexBuffer: VertexBuffer,\n        paintVertexBuffers: Array<VertexBuffer>,\n        indexBuffer?: IndexBuffer | null,\n        vertexOffset?: number | null,\n        dynamicVertexBuffer?: VertexBuffer | null,\n        dynamicVertexBuffer2?: VertexBuffer | null,\n        dynamicVertexBuffer3?: VertexBuffer | null) {\n\n        const numNextAttributes = program.numAttributes;\n\n        const context = this.context;\n        const gl = context.gl;\n\n        if (this.vao) this.destroy();\n        this.vao = context.createVertexArray();\n        context.bindVertexArray.set(this.vao);\n\n        // store the arguments so that we can verify them when the vao is bound again\n        this.boundProgram = program;\n        this.boundLayoutVertexBuffer = layoutVertexBuffer;\n        this.boundPaintVertexBuffers = paintVertexBuffers;\n        this.boundIndexBuffer = indexBuffer;\n        this.boundVertexOffset = vertexOffset;\n        this.boundDynamicVertexBuffer = dynamicVertexBuffer;\n        this.boundDynamicVertexBuffer2 = dynamicVertexBuffer2;\n        this.boundDynamicVertexBuffer3 = dynamicVertexBuffer3;\n\n        layoutVertexBuffer.enableAttributes(gl, program);\n        for (const vertexBuffer of paintVertexBuffers) {\n            vertexBuffer.enableAttributes(gl, program);\n        }\n\n        if (dynamicVertexBuffer) {\n            dynamicVertexBuffer.enableAttributes(gl, program);\n        }\n        if (dynamicVertexBuffer2) {\n            dynamicVertexBuffer2.enableAttributes(gl, program);\n        }\n        if (dynamicVertexBuffer3) {\n            dynamicVertexBuffer3.enableAttributes(gl, program);\n        }\n\n        layoutVertexBuffer.bind();\n        layoutVertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        for (const vertexBuffer of paintVertexBuffers) {\n            vertexBuffer.bind();\n            vertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n\n        if (dynamicVertexBuffer) {\n            dynamicVertexBuffer.bind();\n            dynamicVertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n        if (indexBuffer) {\n            indexBuffer.bind();\n        }\n        if (dynamicVertexBuffer2) {\n            dynamicVertexBuffer2.bind();\n            dynamicVertexBuffer2.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n        if (dynamicVertexBuffer3) {\n            dynamicVertexBuffer3.bind();\n            dynamicVertexBuffer3.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n\n        context.currentNumAttributes = numNextAttributes;\n    }\n\n    destroy() {\n        if (this.vao) {\n            this.context.deleteVertexArray(this.vao);\n            this.vao = null;\n        }\n    }\n}\n","import {\n    Uniform1i,\n    Uniform1f,\n    Uniform4f,\n    UniformMatrix4f,\n    UniformColor\n} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../../render/uniform_binding';\nimport {type Sky} from '../../style/sky';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {type mat4} from 'gl-matrix';\n\nexport type TerrainPreludeUniformsType = {\n    'u_depth': Uniform1i;\n    'u_terrain': Uniform1i;\n    'u_terrain_dim': Uniform1f;\n    'u_terrain_matrix': UniformMatrix4f;\n    'u_terrain_unpack': Uniform4f;\n    'u_terrain_exaggeration': Uniform1f;\n};\n\nexport type TerrainUniformsType = {\n    'u_texture': Uniform1i;\n    'u_ele_delta': Uniform1f;\n    'u_fog_matrix': UniformMatrix4f;\n    'u_fog_color': UniformColor;\n    'u_fog_ground_blend': Uniform1f;\n    'u_fog_ground_blend_opacity': Uniform1f;\n    'u_horizon_color': UniformColor;\n    'u_horizon_fog_blend': Uniform1f;\n    'u_is_globe_mode': Uniform1f;\n};\n\nexport type TerrainDepthUniformsType = {\n    'u_ele_delta': Uniform1f;\n};\n\nexport type TerrainCoordsUniformsType = {\n    'u_texture': Uniform1i;\n    'u_terrain_coords_id': Uniform1f;\n    'u_ele_delta': Uniform1f;\n};\n\nconst terrainPreludeUniforms = (context: Context, locations: UniformLocations): TerrainPreludeUniformsType => ({\n    'u_depth': new Uniform1i(context, locations.u_depth),\n    'u_terrain': new Uniform1i(context, locations.u_terrain),\n    'u_terrain_dim': new Uniform1f(context, locations.u_terrain_dim),\n    'u_terrain_matrix': new UniformMatrix4f(context, locations.u_terrain_matrix),\n    'u_terrain_unpack': new Uniform4f(context, locations.u_terrain_unpack),\n    'u_terrain_exaggeration': new Uniform1f(context, locations.u_terrain_exaggeration)\n});\n\nconst terrainUniforms = (context: Context, locations: UniformLocations): TerrainUniformsType => ({\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta),\n    'u_fog_matrix': new UniformMatrix4f(context, locations.u_fog_matrix),\n    'u_fog_color': new UniformColor(context, locations.u_fog_color),\n    'u_fog_ground_blend': new Uniform1f(context, locations.u_fog_ground_blend),\n    'u_fog_ground_blend_opacity': new Uniform1f(context, locations.u_fog_ground_blend_opacity),\n    'u_horizon_color': new UniformColor(context, locations.u_horizon_color),\n    'u_horizon_fog_blend': new Uniform1f(context, locations.u_horizon_fog_blend),\n    'u_is_globe_mode': new Uniform1f(context, locations.u_is_globe_mode)\n});\n\nconst terrainDepthUniforms = (context: Context, locations: UniformLocations): TerrainDepthUniformsType => ({\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta)\n});\n\nconst terrainCoordsUniforms = (context: Context, locations: UniformLocations): TerrainCoordsUniformsType => ({\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_terrain_coords_id': new Uniform1f(context, locations.u_terrain_coords_id),\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta)\n});\n\nconst terrainUniformValues = (\n    eleDelta: number,\n    fogMatrix: mat4,\n    sky: Sky,\n    pitch: number,\n    isGlobeMode: boolean): UniformValues<TerrainUniformsType> => ({\n    'u_texture': 0,\n    'u_ele_delta': eleDelta,\n    'u_fog_matrix': fogMatrix,\n    'u_fog_color': sky ? sky.properties.get('fog-color') : Color.white,\n    'u_fog_ground_blend': sky ? sky.properties.get('fog-ground-blend') : 1,\n    // Set opacity to 0 when in globe mode to disable fog\n    'u_fog_ground_blend_opacity': isGlobeMode ? 0 : (sky ? sky.calculateFogBlendOpacity(pitch) : 0),\n    'u_horizon_color': sky ? sky.properties.get('horizon-color') : Color.white,\n    'u_horizon_fog_blend': sky ? sky.properties.get('horizon-fog-blend') : 1,\n    'u_is_globe_mode': isGlobeMode ? 1 : 0\n});\n\nconst terrainDepthUniformValues = (\n    eleDelta: number\n): UniformValues<TerrainDepthUniformsType> => ({\n    'u_ele_delta': eleDelta\n});\n\nconst terrainCoordsUniformValues = (\n    coordsId: number,\n    eleDelta: number\n): UniformValues<TerrainCoordsUniformsType> => ({\n    'u_terrain_coords_id': coordsId / 255,\n    'u_texture': 0,\n    'u_ele_delta': eleDelta\n});\n\nexport {terrainUniforms, terrainDepthUniforms, terrainCoordsUniforms, terrainPreludeUniforms, terrainUniformValues, terrainDepthUniformValues, terrainCoordsUniformValues};\n","import {Uniform1f, Uniform4f, type UniformLocations, UniformMatrix4f} from '../uniform_binding';\nimport {type Context} from '../../gl/context';\n// This next import is needed for the \"@link\" in the documentation to work properly.\n\nimport type {ProjectionData} from '../../geo/projection/projection_data';\n\nexport type ProjectionPreludeUniformsType = {\n    'u_projection_matrix': UniformMatrix4f;\n    'u_projection_tile_mercator_coords': Uniform4f;\n    'u_projection_clipping_plane': Uniform4f;\n    'u_projection_transition': Uniform1f;\n    'u_projection_fallback_matrix': UniformMatrix4f;\n};\n\nexport const projectionUniforms = (context: Context, locations: UniformLocations): ProjectionPreludeUniformsType => ({\n    'u_projection_matrix': new UniformMatrix4f(context, locations.u_projection_matrix),\n    'u_projection_tile_mercator_coords': new Uniform4f(context, locations.u_projection_tile_mercator_coords),\n    'u_projection_clipping_plane': new Uniform4f(context, locations.u_projection_clipping_plane),\n    'u_projection_transition': new Uniform1f(context, locations.u_projection_transition),\n    'u_projection_fallback_matrix': new UniformMatrix4f(context, locations.u_projection_fallback_matrix),\n});\n\n/**\n * Maps a field name in {@link ProjectionData} to its corresponding uniform name in {@link ProjectionPreludeUniformsType}.\n */\nexport const projectionObjectToUniformMap: {[field in keyof ProjectionData]: keyof ProjectionPreludeUniformsType} = {\n    mainMatrix: 'u_projection_matrix',\n    tileMercatorCoords: 'u_projection_tile_mercator_coords',\n    clippingPlane: 'u_projection_clipping_plane',\n    projectionTransition: 'u_projection_transition',\n    fallbackMatrix: 'u_projection_fallback_matrix',\n};\n","import {type PreparedShader, shaders, transpileVertexShaderToWebGL1, transpileFragmentShaderToWebGL1} from '../shaders/shaders';\nimport {type ProgramConfiguration} from '../data/program_configuration';\nimport {VertexArrayObject} from './vertex_array_object';\nimport {type Context} from '../gl/context';\nimport {isWebGL2} from '../gl/webgl2';\n\nimport type {SegmentVector} from '../data/segment';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {DepthMode} from '../gl/depth_mode';\nimport type {StencilMode} from '../gl/stencil_mode';\nimport type {ColorMode} from '../gl/color_mode';\nimport type {CullFaceMode} from '../gl/cull_face_mode';\nimport type {UniformBindings, UniformValues, UniformLocations} from './uniform_binding';\nimport type {BinderUniform} from '../data/program_configuration';\nimport {terrainPreludeUniforms, type TerrainPreludeUniformsType} from './program/terrain_program';\nimport type {TerrainData} from '../render/terrain';\nimport {projectionObjectToUniformMap, type ProjectionPreludeUniformsType, projectionUniforms} from './program/projection_program';\nimport type {ProjectionData} from '../geo/projection/projection_data';\n\nexport type DrawMode = WebGLRenderingContextBase['LINES'] | WebGLRenderingContextBase['TRIANGLES'] | WebGL2RenderingContext['LINE_STRIP'];\n\nfunction getTokenizedAttributesAndUniforms(array: Array<string>): Array<string> {\n    const result = [];\n\n    for (let i = 0; i < array.length; i++) {\n        if (array[i] === null) continue;\n        const token = array[i].split(' ');\n        result.push(token.pop());\n    }\n    return result;\n}\n\n/**\n * @internal\n * A webgl program to execute in the GPU space\n */\nexport class Program<Us extends UniformBindings> {\n    program: WebGLProgram;\n    attributes: {[_: string]: number};\n    numAttributes: number;\n    fixedUniforms: Us;\n    terrainUniforms: TerrainPreludeUniformsType;\n    projectionUniforms: ProjectionPreludeUniformsType;\n    binderUniforms: Array<BinderUniform>;\n    failedToCreate: boolean;\n\n    constructor(context: Context,\n        source: PreparedShader,\n        configuration: ProgramConfiguration,\n        fixedUniforms: (b: Context, a: UniformLocations) => Us,\n        showOverdrawInspector: boolean,\n        hasTerrain: boolean,\n        projectionPrelude: PreparedShader,\n        projectionDefine: string,\n        extraDefines: Array<string> = []) {\n\n        const gl = context.gl;\n        this.program = gl.createProgram();\n\n        const staticAttrInfo = getTokenizedAttributesAndUniforms(source.staticAttributes);\n        const dynamicAttrInfo = configuration ? configuration.getBinderAttributes() : [];\n        const allAttrInfo = staticAttrInfo.concat(dynamicAttrInfo);\n\n        const preludeUniformsInfo = shaders.prelude.staticUniforms ? getTokenizedAttributesAndUniforms(shaders.prelude.staticUniforms) : [];\n        const projectionPreludeUniformsInfo = projectionPrelude.staticUniforms ? getTokenizedAttributesAndUniforms(projectionPrelude.staticUniforms) : [];\n        const staticUniformsInfo = source.staticUniforms ? getTokenizedAttributesAndUniforms(source.staticUniforms) : [];\n        const dynamicUniformsInfo = configuration ? configuration.getBinderUniforms() : [];\n        // remove duplicate uniforms\n        const uniformList = preludeUniformsInfo.concat(projectionPreludeUniformsInfo).concat(staticUniformsInfo).concat(dynamicUniformsInfo);\n        const allUniformsInfo = [];\n        for (const uniform of uniformList) {\n            if (allUniformsInfo.indexOf(uniform) < 0) allUniformsInfo.push(uniform);\n        }\n\n        const defines = configuration ? configuration.defines() : [];\n        if (isWebGL2(gl)) {\n            defines.unshift('#version 300 es');\n        }\n        if (showOverdrawInspector) {\n            defines.push('#define OVERDRAW_INSPECTOR;');\n        }\n        if (hasTerrain) {\n            defines.push('#define TERRAIN3D;');\n        }\n        if (projectionDefine) {\n            defines.push(projectionDefine);\n        }\n        if (extraDefines) {\n            defines.push(...extraDefines);\n        }\n\n        let fragmentSource = defines.concat(shaders.prelude.fragmentSource, projectionPrelude.fragmentSource, source.fragmentSource).join('\\n');\n        let vertexSource = defines.concat(shaders.prelude.vertexSource, projectionPrelude.vertexSource, source.vertexSource).join('\\n');\n\n        if (!isWebGL2(gl)) {\n            fragmentSource = transpileFragmentShaderToWebGL1(fragmentSource);\n            vertexSource = transpileVertexShaderToWebGL1(vertexSource);\n        }\n\n        const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n        if (gl.isContextLost()) {\n            this.failedToCreate = true;\n            return;\n        }\n        gl.shaderSource(fragmentShader, fragmentSource);\n        gl.compileShader(fragmentShader);\n\n        if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n            throw new Error(`Could not compile fragment shader: ${gl.getShaderInfoLog(fragmentShader)}`);\n        }\n\n        gl.attachShader(this.program, fragmentShader);\n\n        const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n        if (gl.isContextLost()) {\n            this.failedToCreate = true;\n            return;\n        }\n        gl.shaderSource(vertexShader, vertexSource);\n        gl.compileShader(vertexShader);\n\n        if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n            throw new Error(`Could not compile vertex shader: ${gl.getShaderInfoLog(vertexShader)}`);\n        }\n\n        gl.attachShader(this.program, vertexShader);\n\n        this.attributes = {};\n        const uniformLocations = {};\n\n        this.numAttributes = allAttrInfo.length;\n\n        for (let i = 0; i < this.numAttributes; i++) {\n            if (allAttrInfo[i]) {\n                gl.bindAttribLocation(this.program, i, allAttrInfo[i]);\n                this.attributes[allAttrInfo[i]] = i;\n            }\n        }\n\n        gl.linkProgram(this.program);\n\n        if (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {\n            throw new Error(`Program failed to link: ${gl.getProgramInfoLog(this.program)}`);\n        }\n\n        gl.deleteShader(vertexShader);\n        gl.deleteShader(fragmentShader);\n\n        for (let it = 0; it < allUniformsInfo.length; it++) {\n            const uniform = allUniformsInfo[it];\n            if (uniform && !uniformLocations[uniform]) {\n                const uniformLocation = gl.getUniformLocation(this.program, uniform);\n                if (uniformLocation) {\n                    uniformLocations[uniform] = uniformLocation;\n                }\n            }\n        }\n\n        this.fixedUniforms = fixedUniforms(context, uniformLocations);\n        this.terrainUniforms = terrainPreludeUniforms(context, uniformLocations);\n        this.projectionUniforms = projectionUniforms(context, uniformLocations);\n        this.binderUniforms = configuration ? configuration.getUniforms(context, uniformLocations) : [];\n    }\n\n    draw(context: Context,\n        drawMode: DrawMode,\n        depthMode: Readonly<DepthMode>,\n        stencilMode: Readonly<StencilMode>,\n        colorMode: Readonly<ColorMode>,\n        cullFaceMode: Readonly<CullFaceMode>,\n        uniformValues: UniformValues<Us>,\n        terrain: TerrainData,\n        projectionData: ProjectionData,\n        layerID: string,\n        layoutVertexBuffer: VertexBuffer,\n        indexBuffer: IndexBuffer,\n        segments: SegmentVector,\n        currentProperties?: any,\n        zoom?: number | null,\n        configuration?: ProgramConfiguration | null,\n        dynamicLayoutBuffer?: VertexBuffer | null,\n        dynamicLayoutBuffer2?: VertexBuffer | null,\n        dynamicLayoutBuffer3?: VertexBuffer | null) {\n\n        const gl = context.gl;\n\n        if (this.failedToCreate) return;\n\n        context.program.set(this.program);\n        context.setDepthMode(depthMode);\n        context.setStencilMode(stencilMode);\n        context.setColorMode(colorMode);\n        context.setCullFace(cullFaceMode);\n\n        // set variables used by the 3d functions defined in _prelude.vertex.glsl\n        if (terrain) {\n            context.activeTexture.set(gl.TEXTURE2);\n            gl.bindTexture(gl.TEXTURE_2D, terrain.depthTexture);\n            context.activeTexture.set(gl.TEXTURE3);\n            gl.bindTexture(gl.TEXTURE_2D, terrain.texture);\n            for (const name in this.terrainUniforms) {\n                this.terrainUniforms[name].set(terrain[name]);\n            }\n        }\n\n        if (projectionData) {\n            for (const fieldName in projectionData) {\n                const uniformName = projectionObjectToUniformMap[fieldName];\n                this.projectionUniforms[uniformName].set(projectionData[fieldName]);\n            }\n        }\n\n        if (uniformValues) {\n            for (const name in this.fixedUniforms) {\n                this.fixedUniforms[name].set(uniformValues[name]);\n            }\n        }\n\n        if (configuration) {\n            configuration.setUniforms(context, this.binderUniforms, currentProperties, {zoom: (zoom as any)});\n        }\n\n        let primitiveSize = 0;\n        switch (drawMode) {\n            case gl.LINES:\n                primitiveSize = 2;\n                break;\n            case gl.TRIANGLES:\n                primitiveSize = 3;\n                break;\n            case gl.LINE_STRIP:\n                primitiveSize = 1;\n                break;\n        }\n\n        for (const segment of segments.get()) {\n            const vaos = segment.vaos || (segment.vaos = {});\n            const vao: VertexArrayObject = vaos[layerID] || (vaos[layerID] = new VertexArrayObject());\n\n            vao.bind(\n                context,\n                this,\n                layoutVertexBuffer,\n                configuration ? configuration.getPaintVertexBuffers() : [],\n                indexBuffer,\n                segment.vertexOffset,\n                dynamicLayoutBuffer,\n                dynamicLayoutBuffer2,\n                dynamicLayoutBuffer3\n            );\n\n            gl.drawElements(\n                drawMode,\n                segment.primitiveLength * primitiveSize,\n                gl.UNSIGNED_SHORT,\n                segment.primitiveOffset * primitiveSize * 2);\n        }\n    }\n}\n","import {\n    type Uniform1i,\n    type Uniform1f,\n    type Uniform2f,\n    type Uniform3f\n} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Painter} from '../painter';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {CrossFaded} from '../../style/properties';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {UniformValues} from '../uniform_binding';\nimport type {Tile} from '../../tile/tile';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\n\ntype BackgroundPatternUniformsType = {\n    'u_image': Uniform1i;\n    'u_pattern_tl_a': Uniform2f;\n    'u_pattern_br_a': Uniform2f;\n    'u_pattern_tl_b': Uniform2f;\n    'u_pattern_br_b': Uniform2f;\n    'u_texsize': Uniform2f;\n    'u_mix': Uniform1f;\n    'u_pattern_size_a': Uniform2f;\n    'u_pattern_size_b': Uniform2f;\n    'u_scale_a': Uniform1f;\n    'u_scale_b': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_tile_units_to_pixels': Uniform1f;\n};\n\nexport type PatternUniformsType = {\n    // pattern uniforms:\n    'u_image': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n};\n\nfunction patternUniformValues(crossfade: CrossfadeParameters, painter: Painter, tile: Tile): UniformValues<PatternUniformsType> {\n\n    const tileRatio = 1 / pixelsToTileUnits(tile, 1, painter.transform.tileZoom);\n\n    const numTiles = Math.pow(2, tile.tileID.overscaledZ);\n    const tileSizeAtNearestZoom = tile.tileSize * Math.pow(2, painter.transform.tileZoom) / numTiles;\n\n    const pixelX = tileSizeAtNearestZoom * (tile.tileID.canonical.x + tile.tileID.wrap * numTiles);\n    const pixelY = tileSizeAtNearestZoom * tile.tileID.canonical.y;\n\n    return {\n        'u_image': 0,\n        'u_texsize': tile.imageAtlasTexture.size,\n        'u_scale': [tileRatio, crossfade.fromScale, crossfade.toScale],\n        'u_fade': crossfade.t,\n        // split the pixel coord into two pairs of 16 bit numbers. The glsl spec only guarantees 16 bits of precision.\n        'u_pixel_coord_upper': [pixelX >> 16, pixelY >> 16],\n        'u_pixel_coord_lower': [pixelX & 0xFFFF, pixelY & 0xFFFF]\n    };\n}\n\nfunction bgPatternUniformValues(\n    image: CrossFaded<ResolvedImage>,\n    crossfade: CrossfadeParameters,\n    painter: Painter,\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    }\n): UniformValues<BackgroundPatternUniformsType> {\n    const imagePosA = painter.imageManager.getPattern(image.from.toString());\n    const imagePosB = painter.imageManager.getPattern(image.to.toString());\n    const {width, height} = painter.imageManager.getPixelSize();\n\n    const numTiles = Math.pow(2, tile.tileID.overscaledZ);\n    const tileSizeAtNearestZoom = tile.tileSize * Math.pow(2, painter.transform.tileZoom) / numTiles;\n\n    const pixelX = tileSizeAtNearestZoom * (tile.tileID.canonical.x + tile.tileID.wrap * numTiles);\n    const pixelY = tileSizeAtNearestZoom * tile.tileID.canonical.y;\n\n    return {\n        'u_image': 0,\n        'u_pattern_tl_a': (imagePosA as any).tl,\n        'u_pattern_br_a': (imagePosA as any).br,\n        'u_pattern_tl_b': (imagePosB as any).tl,\n        'u_pattern_br_b': (imagePosB as any).br,\n        'u_texsize': [width, height],\n        'u_mix': crossfade.t,\n        'u_pattern_size_a': (imagePosA as any).displaySize,\n        'u_pattern_size_b': (imagePosB as any).displaySize,\n        'u_scale_a': crossfade.fromScale,\n        'u_scale_b': crossfade.toScale,\n        'u_tile_units_to_pixels': 1 / pixelsToTileUnits(tile, 1, painter.transform.tileZoom),\n        // split the pixel coord into two pairs of 16 bit numbers. The glsl spec only guarantees 16 bits of precision.\n        'u_pixel_coord_upper': [pixelX >> 16, pixelY >> 16],\n        'u_pixel_coord_lower': [pixelX & 0xFFFF, pixelY & 0xFFFF]\n    };\n}\nexport {bgPatternUniformValues, patternUniformValues};\n","import {patternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f\n} from '../uniform_binding';\n\nimport {mat3, vec3} from 'gl-matrix';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {Painter} from '../painter';\nimport type {OverscaledTileID} from '../../tile/tile_id';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../tile/tile';\n\nexport type FillExtrusionUniformsType = {\n    'u_lightpos': Uniform3f;\n    'u_lightpos_globe': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_vertical_gradient': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillExtrusionPatternUniformsType = {\n    'u_lightpos': Uniform3f;\n    'u_lightpos_globe': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_height_factor': Uniform1f;\n    'u_vertical_gradient': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_fill_translate': Uniform2f;\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n};\n\nconst fillExtrusionUniforms = (context: Context, locations: UniformLocations): FillExtrusionUniformsType => ({\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightpos_globe': new Uniform3f(context, locations.u_lightpos_globe),\n    'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),\n    'u_lightcolor': new Uniform3f(context, locations.u_lightcolor),\n    'u_vertical_gradient': new Uniform1f(context, locations.u_vertical_gradient),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate),\n});\n\nconst fillExtrusionPatternUniforms = (context: Context, locations: UniformLocations): FillExtrusionPatternUniformsType => ({\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightpos_globe': new Uniform3f(context, locations.u_lightpos_globe),\n    'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),\n    'u_lightcolor': new Uniform3f(context, locations.u_lightcolor),\n    'u_vertical_gradient': new Uniform1f(context, locations.u_vertical_gradient),\n    'u_height_factor': new Uniform1f(context, locations.u_height_factor),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate),\n    // pattern uniforms\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade)\n});\n\nconst fillExtrusionUniformValues = (\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number,\n    translate: [number, number],\n): UniformValues<FillExtrusionUniformsType> => {\n    const light = painter.style.light;\n    const _lp = light.properties.get('position');\n    const lightPos = [_lp.x, _lp.y, _lp.z] as vec3;\n    const lightMat = mat3.create();\n    if (light.properties.get('anchor') === 'viewport') {\n        mat3.fromRotation(lightMat, painter.transform.bearingInRadians);\n    }\n    vec3.transformMat3(lightPos, lightPos, lightMat);\n    const transformedLightPos = painter.transform.transformLightDirection(lightPos);\n\n    const lightColor = light.properties.get('color');\n\n    return {\n        'u_lightpos': lightPos,\n        'u_lightpos_globe': transformedLightPos,\n        'u_lightintensity': light.properties.get('intensity'),\n        'u_lightcolor': [lightColor.r, lightColor.g, lightColor.b],\n        'u_vertical_gradient': +shouldUseVerticalGradient,\n        'u_opacity': opacity,\n        'u_fill_translate': translate,\n    };\n};\n\nconst fillExtrusionPatternUniformValues = (\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number,\n    translate: [number, number],\n    coord: OverscaledTileID,\n    crossfade: CrossfadeParameters,\n    tile: Tile\n): UniformValues<FillExtrusionPatternUniformsType> => {\n    return extend(fillExtrusionUniformValues(painter, shouldUseVerticalGradient, opacity, translate),\n        patternUniformValues(crossfade, painter, tile),\n        {\n            'u_height_factor': -Math.pow(2, coord.overscaledZ) / tile.tileSize / 8\n        });\n};\n\nexport {\n    fillExtrusionUniforms,\n    fillExtrusionPatternUniforms,\n    fillExtrusionUniformValues,\n    fillExtrusionPatternUniformValues\n};\n","import {patternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../tile/tile';\n\nexport type FillUniformsType = {\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillOutlineUniformsType = {\n    'u_world': Uniform2f;\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillPatternUniformsType = {\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n    'u_fill_translate': Uniform2f;\n};\n\nexport type FillOutlinePatternUniformsType = {\n    'u_world': Uniform2f;\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n    'u_fill_translate': Uniform2f;\n};\n\nconst fillUniforms = (context: Context, locations: UniformLocations): FillUniformsType => ({\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillPatternUniforms = (context: Context, locations: UniformLocations): FillPatternUniformsType => ({\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillOutlineUniforms = (context: Context, locations: UniformLocations): FillOutlineUniformsType => ({\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillOutlinePatternUniforms = (context: Context, locations: UniformLocations): FillOutlinePatternUniformsType => ({\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade),\n    'u_fill_translate': new Uniform2f(context, locations.u_fill_translate)\n});\n\nconst fillPatternUniformValues = (\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile,\n    translate: [number, number]\n): UniformValues<FillPatternUniformsType> => extend(\n    patternUniformValues(crossfade, painter, tile),\n    {\n        'u_fill_translate': translate,\n    }\n);\n\nconst fillUniformValues = (translate: [number, number]): UniformValues<FillUniformsType> => ({\n    'u_fill_translate': translate,\n});\n\nconst fillOutlineUniformValues = (drawingBufferSize: [number, number], translate: [number, number]): UniformValues<FillOutlineUniformsType> => ({\n    'u_world': drawingBufferSize,\n    'u_fill_translate': translate,\n});\n\nconst fillOutlinePatternUniformValues = (\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile,\n    drawingBufferSize: [number, number],\n    translate: [number, number]\n): UniformValues<FillOutlinePatternUniformsType> => extend(\n    fillPatternUniformValues(painter, crossfade, tile, translate),\n    {\n        'u_world': drawingBufferSize\n    }\n);\n\nexport {\n    fillUniforms,\n    fillPatternUniforms,\n    fillOutlineUniforms,\n    fillOutlinePatternUniforms,\n    fillUniformValues,\n    fillPatternUniformValues,\n    fillOutlineUniformValues,\n    fillOutlinePatternUniformValues\n};\n","import {Uniform1i, Uniform1f, Uniform2f} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Tile} from '../../tile/tile';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer';\nimport type {Painter} from '../painter';\nimport {EXTENT} from '../../data/extent';\n\nexport type CircleUniformsType = {\n    'u_camera_to_center_distance': Uniform1f;\n    'u_scale_with_map': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_extrude_scale': Uniform2f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_globe_extrude_scale': Uniform1f;\n    'u_translate': Uniform2f;\n};\n\nconst circleUniforms = (context: Context, locations: UniformLocations): CircleUniformsType => ({\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_scale_with_map': new Uniform1i(context, locations.u_scale_with_map),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_extrude_scale': new Uniform2f(context, locations.u_extrude_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_globe_extrude_scale': new Uniform1f(context, locations.u_globe_extrude_scale),\n    'u_translate': new Uniform2f(context, locations.u_translate),\n});\n\nconst circleUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: CircleStyleLayer,\n    translate: [number, number],\n    radiusCorrectionFactor: number\n): UniformValues<CircleUniformsType> => {\n    const transform = painter.transform;\n\n    let pitchWithMap: boolean, extrudeScale: [number, number];\n    let globeExtrudeScale: number = 0;\n    if (layer.paint.get('circle-pitch-alignment') === 'map') {\n        const pixelRatio = pixelsToTileUnits(tile, 1, transform.zoom);\n        pitchWithMap = true;\n        extrudeScale = [pixelRatio, pixelRatio];\n\n        // For globe rendering we need to know how much to extrude the circle as an *angle*.\n        // The calculation: (one pixel in tile units) / (earth circumference in tile units) * (2PI radians) * radiusCorrectionFactor\n        globeExtrudeScale = pixelRatio / (EXTENT * Math.pow(2, tile.tileID.overscaledZ)) * 2.0 * Math.PI * radiusCorrectionFactor;\n    } else {\n        pitchWithMap = false;\n        extrudeScale = transform.pixelsToGLUnits;\n    }\n\n    return {\n        'u_camera_to_center_distance': transform.cameraToCenterDistance,\n        'u_scale_with_map': +(layer.paint.get('circle-pitch-scale') === 'map'),\n        'u_pitch_with_map': +(pitchWithMap),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_extrude_scale': extrudeScale,\n        'u_globe_extrude_scale': globeExtrudeScale,\n        'u_translate': translate,\n    };\n};\n\nexport {circleUniforms, circleUniformValues};\n","import {Uniform2f} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {IReadonlyTransform} from '../../geo/transform_interface';\n\nexport type CollisionUniformsType = {\n    'u_pixel_extrude_scale': Uniform2f;\n};\n\nexport type CollisionCircleUniformsType = {\n    'u_viewport_size': Uniform2f;\n};\n\nconst collisionUniforms = (context: Context, locations: UniformLocations): CollisionUniformsType => ({\n    'u_pixel_extrude_scale': new Uniform2f(context, locations.u_pixel_extrude_scale)\n});\n\nconst collisionCircleUniforms = (context: Context, locations: UniformLocations): CollisionCircleUniformsType => ({\n    'u_viewport_size': new Uniform2f(context, locations.u_viewport_size)\n});\n\nconst collisionUniformValues = (transform: {width: number; height: number}): UniformValues<CollisionUniformsType> => {\n    return {\n        'u_pixel_extrude_scale': [1.0 / transform.width, 1.0 / transform.height],\n    };\n};\n\nconst collisionCircleUniformValues = (transform: IReadonlyTransform): UniformValues<CollisionCircleUniformsType> => {\n    return {\n        'u_viewport_size': [transform.width, transform.height]\n    };\n};\n\nexport {collisionUniforms, collisionUniformValues, collisionCircleUniforms, collisionCircleUniformValues};\n","import {UniformColor, Uniform1i, Uniform1f} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Color} from '@maplibre/maplibre-gl-style-spec';\n\nexport type DebugUniformsType = {\n    'u_color': UniformColor;\n    'u_overlay': Uniform1i;\n    'u_overlay_scale': Uniform1f;\n};\n\nconst debugUniforms = (context: Context, locations: UniformLocations): DebugUniformsType => ({\n    'u_color': new UniformColor(context, locations.u_color),\n    'u_overlay': new Uniform1i(context, locations.u_overlay),\n    'u_overlay_scale': new Uniform1f(context, locations.u_overlay_scale)\n});\n\nconst debugUniformValues = (color: Color, scaleRatio: number = 1): UniformValues<DebugUniformsType> => ({\n    'u_color': color,\n    'u_overlay': 0,\n    'u_overlay_scale': scaleRatio\n});\n\nexport {debugUniforms, debugUniformValues};\n","import {mat4} from 'gl-matrix';\n\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformMatrix4f\n} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Context} from '../../gl/context';\nimport type {Tile} from '../../tile/tile';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Painter} from '../painter';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\nimport {EXTENT} from '../../data/extent';\n\nexport type HeatmapUniformsType = {\n    'u_extrude_scale': Uniform1f;\n    'u_intensity': Uniform1f;\n    'u_globe_extrude_scale': Uniform1f;\n};\n\nexport type HeatmapTextureUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_world': Uniform2f;\n    'u_image': Uniform1i;\n    'u_color_ramp': Uniform1i;\n    'u_opacity': Uniform1f;\n};\n\nconst heatmapUniforms = (context: Context, locations: UniformLocations): HeatmapUniformsType => ({\n    'u_extrude_scale': new Uniform1f(context, locations.u_extrude_scale),\n    'u_intensity': new Uniform1f(context, locations.u_intensity),\n    'u_globe_extrude_scale': new Uniform1f(context, locations.u_globe_extrude_scale)\n});\n\nconst heatmapTextureUniforms = (context: Context, locations: UniformLocations): HeatmapTextureUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_color_ramp': new Uniform1i(context, locations.u_color_ramp),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst heatmapUniformValues = (tile: Tile, zoom: number, intensity: number, radiusCorrectionFactor: number): UniformValues<HeatmapUniformsType> => {\n    const pixelRatio = pixelsToTileUnits(tile, 1, zoom);\n    // See comment in circle_program.ts\n    const globeExtrudeScale = pixelRatio / (EXTENT * Math.pow(2, tile.tileID.overscaledZ)) * 2.0 * Math.PI * radiusCorrectionFactor;\n    return {\n        'u_extrude_scale': pixelsToTileUnits(tile, 1, zoom),\n        'u_intensity': intensity,\n        'u_globe_extrude_scale': globeExtrudeScale\n    };\n};\n\nconst heatmapTextureUniformValues = (\n    painter: Painter,\n    layer: HeatmapStyleLayer,\n    textureUnit: number,\n    colorRampUnit: number\n): UniformValues<HeatmapTextureUniformsType> => {\n    const matrix = mat4.create();\n    mat4.ortho(matrix, 0, painter.width, painter.height, 0, 0, 1);\n\n    const gl = painter.context.gl;\n\n    return {\n        'u_matrix': matrix,\n        'u_world': [gl.drawingBufferWidth, gl.drawingBufferHeight],\n        'u_image': textureUnit,\n        'u_color_ramp': colorRampUnit,\n        'u_opacity': layer.paint.get('heatmap-opacity')\n    };\n};\n\nexport {\n    heatmapUniforms,\n    heatmapTextureUniforms,\n    heatmapUniformValues,\n    heatmapTextureUniformValues\n};\n","import {mat4} from 'gl-matrix';\n\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformColor,\n    UniformFloatArray,\n    UniformColorArray,\n    UniformMatrix4f,\n    Uniform4f\n} from '../uniform_binding';\nimport {EXTENT} from '../../data/extent';\nimport {MercatorCoordinate} from '../../geo/mercator_coordinate';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Tile} from '../../tile/tile';\nimport type {Painter} from '../painter';\nimport type {HillshadeStyleLayer} from '../../style/style_layer/hillshade_style_layer';\nimport type {DEMData} from '../../data/dem_data';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport type HillshadeUniformsType = {\n    'u_image': Uniform1i;\n    'u_latrange': Uniform2f;\n    'u_exaggeration': Uniform1f;\n    'u_altitudes': UniformFloatArray;\n    'u_azimuths': UniformFloatArray;\n    'u_accent': UniformColor;\n    'u_method': Uniform1i;\n    'u_shadows': UniformColorArray;\n    'u_highlights': UniformColorArray;\n};\n\nexport type HillshadePrepareUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_image': Uniform1i;\n    'u_dimension': Uniform2f;\n    'u_zoom': Uniform1f;\n    'u_unpack': Uniform4f;\n};\n\nconst hillshadeUniforms = (context: Context, locations: UniformLocations): HillshadeUniformsType => ({\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_latrange': new Uniform2f(context, locations.u_latrange),\n    'u_exaggeration': new Uniform1f(context, locations.u_exaggeration),\n    'u_altitudes': new UniformFloatArray(context, locations.u_altitudes),\n    'u_azimuths': new UniformFloatArray(context, locations.u_azimuths),\n    'u_accent': new UniformColor(context, locations.u_accent),\n    'u_method': new Uniform1i(context, locations.u_method),\n    'u_shadows': new UniformColorArray(context, locations.u_shadows),\n    'u_highlights': new UniformColorArray(context, locations.u_highlights)\n});\n\nconst hillshadePrepareUniforms = (context: Context, locations: UniformLocations): HillshadePrepareUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_dimension': new Uniform2f(context, locations.u_dimension),\n    'u_zoom': new Uniform1f(context, locations.u_zoom),\n    'u_unpack': new Uniform4f(context, locations.u_unpack)\n});\n\nconst hillshadeUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: HillshadeStyleLayer,\n): UniformValues<HillshadeUniformsType> => {\n    const accent = layer.paint.get('hillshade-accent-color');\n    let method;\n    switch (layer.paint.get('hillshade-method')) {\n        case 'basic':\n            method = 4;\n            break;\n        case 'combined':\n            method = 1;\n            break;\n        case 'igor':\n            method = 2;\n            break;\n        case 'multidirectional':\n            method = 3;\n            break;\n        case 'standard':\n        default:\n            method = 0;\n            break;\n    }\n\n    const illumination = layer.getIlluminationProperties();\n\n    for (let i = 0; i < illumination.directionRadians.length; i++) {\n        // modify azimuthal angle by map rotation if light is anchored at the viewport\n        if (layer.paint.get('hillshade-illumination-anchor') === 'viewport') {\n            illumination.directionRadians[i] += painter.transform.bearingInRadians;\n        }\n    }\n    return {\n        'u_image': 0,\n        'u_latrange': getTileLatRange(painter, tile.tileID),\n        'u_exaggeration': layer.paint.get('hillshade-exaggeration'),\n        'u_altitudes': illumination.altitudeRadians,\n        'u_azimuths': illumination.directionRadians,\n        'u_accent': accent,\n        'u_method': method,\n        'u_highlights': illumination.highlightColor,\n        'u_shadows': illumination.shadowColor\n    };\n};\n\nconst hillshadeUniformPrepareValues = (tileID: OverscaledTileID, dem: DEMData): UniformValues<HillshadePrepareUniformsType> => {\n\n    const stride = dem.stride;\n    const matrix = mat4.create();\n    // Flip rendering at y axis.\n    mat4.ortho(matrix, 0, EXTENT, -EXTENT, 0, 0, 1);\n    mat4.translate(matrix, matrix, [0, -EXTENT, 0]);\n\n    return {\n        'u_matrix': matrix,\n        'u_image': 1,\n        'u_dimension': [stride, stride],\n        'u_zoom': tileID.overscaledZ,\n        'u_unpack': dem.getUnpackVector()\n    };\n};\n\nfunction getTileLatRange(painter: Painter, tileID: OverscaledTileID) {\n    // for scaling the magnitude of a points slope by its latitude\n    const tilesAtZoom = Math.pow(2, tileID.canonical.z);\n    const y = tileID.canonical.y;\n    return [\n        new MercatorCoordinate(0, y / tilesAtZoom).toLngLat().lat,\n        new MercatorCoordinate(0, (y + 1) / tilesAtZoom).toLngLat().lat];\n}\n\nexport {\n    hillshadeUniforms,\n    hillshadePrepareUniforms,\n    hillshadeUniformValues,\n    hillshadeUniformPrepareValues\n};\n","import {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform4f\n} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {ColorReliefStyleLayer} from '../../style/style_layer/color_relief_style_layer';\nimport type {DEMData} from '../../data/dem_data';\n\nexport type ColorReliefUniformsType = {\n    'u_image': Uniform1i;\n    'u_unpack': Uniform4f;\n    'u_dimension': Uniform2f;\n    'u_elevation_stops': Uniform1i;\n    'u_color_stops': Uniform1i;\n    'u_color_ramp_size': Uniform1i;\n    'u_opacity': Uniform1f;\n};\n\nconst colorReliefUniforms = (context: Context, locations: UniformLocations): ColorReliefUniformsType => ({\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_unpack': new Uniform4f(context, locations.u_unpack),\n    'u_dimension': new Uniform2f(context, locations.u_dimension),\n    'u_elevation_stops': new Uniform1i(context, locations.u_elevation_stops),\n    'u_color_stops': new Uniform1i(context, locations.u_color_stops),\n    'u_color_ramp_size': new Uniform1i(context, locations.u_color_ramp_size),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst colorReliefUniformValues = (\n    layer: ColorReliefStyleLayer,\n    dem: DEMData,\n    colorRampSize: number = 0\n): UniformValues<ColorReliefUniformsType> => {\n\n    return {\n        'u_image': 0,\n        'u_unpack': dem.getUnpackVector(),\n        'u_dimension': [dem.stride, dem.stride],\n        'u_elevation_stops': 1,\n        'u_color_stops': 4,\n        'u_color_ramp_size': colorRampSize,\n        'u_opacity': layer.paint.get('color-relief-opacity')\n    };\n};\n\nexport {\n    colorReliefUniforms,\n    colorReliefUniformValues,\n};\n","import {Uniform1i, Uniform1f, Uniform2f, Uniform3f} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\nimport {extend, translatePosition} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {IReadonlyTransform} from '../../geo/transform_interface';\nimport type {Tile} from '../../tile/tile';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type {Painter} from '../painter';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\n\nexport type LineUniformsType = {\n    'u_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n};\n\nexport type LineGradientUniformsType = {\n    'u_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_image': Uniform1i;\n    'u_image_height': Uniform1f;\n};\n\nexport type LinePatternUniformsType = {\n    'u_translation': Uniform2f;\n    'u_texsize': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_image': Uniform1i;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n};\n\nexport type LineSDFUniformsType = {\n    'u_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_tileratio': Uniform1f;\n    'u_crossfade_from': Uniform1f;\n    'u_crossfade_to': Uniform1f;\n    'u_image': Uniform1i;\n    'u_mix': Uniform1f;\n    'u_lineatlas_width': Uniform1f;\n    'u_lineatlas_height': Uniform1f;\n};\n\nexport type LineGradientSDFUniformsType = {\n    'u_translation': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_image': Uniform1i;\n    'u_image_height': Uniform1f;\n    'u_tileratio': Uniform1f;\n    'u_crossfade_from': Uniform1f;\n    'u_crossfade_to': Uniform1f;\n    'u_image_dash': Uniform1i;\n    'u_mix': Uniform1f;\n    'u_lineatlas_width': Uniform1f;\n    'u_lineatlas_height': Uniform1f;\n};\n\nconst lineUniforms = (context: Context, locations: UniformLocations): LineUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels)\n});\n\nconst lineGradientUniforms = (context: Context, locations: UniformLocations): LineGradientUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_image_height': new Uniform1f(context, locations.u_image_height)\n});\n\nconst linePatternUniforms = (context: Context, locations: UniformLocations): LinePatternUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade)\n});\n\nconst lineSDFUniforms = (context: Context, locations: UniformLocations): LineSDFUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_mix': new Uniform1f(context, locations.u_mix),\n    'u_tileratio': new Uniform1f(context, locations.u_tileratio),\n    'u_crossfade_from': new Uniform1f(context, locations.u_crossfade_from),\n    'u_crossfade_to': new Uniform1f(context, locations.u_crossfade_to),\n    'u_lineatlas_width': new Uniform1f(context, locations.u_lineatlas_width),\n    'u_lineatlas_height': new Uniform1f(context, locations.u_lineatlas_height)\n});\n\nconst lineGradientSDFUniforms = (context: Context, locations: UniformLocations): LineGradientSDFUniformsType => ({\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_image_height': new Uniform1f(context, locations.u_image_height),\n    'u_tileratio': new Uniform1f(context, locations.u_tileratio),\n    'u_crossfade_from': new Uniform1f(context, locations.u_crossfade_from),\n    'u_crossfade_to': new Uniform1f(context, locations.u_crossfade_to),\n    'u_image_dash': new Uniform1i(context, locations.u_image_dash),\n    'u_mix': new Uniform1f(context, locations.u_mix),\n    'u_lineatlas_width': new Uniform1f(context, locations.u_lineatlas_width),\n    'u_lineatlas_height': new Uniform1f(context, locations.u_lineatlas_height)\n});\n\nconst lineUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n): UniformValues<LineUniformsType> => {\n    const transform = painter.transform;\n\n    return {\n        'u_translation': calculateTranslation(painter, tile, layer),\n        'u_ratio': ratioScale / pixelsToTileUnits(tile, 1, transform.zoom),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_units_to_pixels': [\n            1 / transform.pixelsToGLUnits[0],\n            1 / transform.pixelsToGLUnits[1]\n        ]\n    };\n};\n\nconst lineGradientUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    imageHeight: number,\n): UniformValues<LineGradientUniformsType> => {\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_image': 0,\n        'u_image_height': imageHeight,\n    });\n};\n\nconst linePatternUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    crossfade: CrossfadeParameters,\n): UniformValues<LinePatternUniformsType> => {\n    const transform = painter.transform;\n    const tileZoomRatio = calculateTileRatio(tile, transform);\n    return {\n        'u_translation': calculateTranslation(painter, tile, layer),\n        'u_texsize': tile.imageAtlasTexture.size,\n        // camera zoom ratio\n        'u_ratio': ratioScale / pixelsToTileUnits(tile, 1, transform.zoom),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_image': 0,\n        'u_scale': [tileZoomRatio, crossfade.fromScale, crossfade.toScale],\n        'u_fade': crossfade.t,\n        'u_units_to_pixels': [\n            1 / transform.pixelsToGLUnits[0],\n            1 / transform.pixelsToGLUnits[1]\n        ]\n    };\n};\n\nconst lineSDFUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    crossfade: CrossfadeParameters,\n): UniformValues<LineSDFUniformsType> => {\n    const transform = painter.transform;\n    const tileRatio = calculateTileRatio(tile, transform);\n\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_tileratio': tileRatio,\n        'u_crossfade_from': crossfade.fromScale,\n        'u_crossfade_to': crossfade.toScale,\n        'u_image': 0,\n        'u_mix': crossfade.t,\n        'u_lineatlas_width': painter.lineAtlas.width,\n        'u_lineatlas_height': painter.lineAtlas.height,\n    });\n};\n\nconst lineGradientSDFUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    ratioScale: number,\n    crossfade: CrossfadeParameters,\n    imageHeight: number,\n): UniformValues<LineGradientSDFUniformsType> => {\n    const transform = painter.transform;\n    const tileRatio = calculateTileRatio(tile, transform);\n\n    return extend(lineUniformValues(painter, tile, layer, ratioScale), {\n        'u_image': 0,\n        'u_image_height': imageHeight,\n        'u_tileratio': tileRatio,\n        'u_crossfade_from': crossfade.fromScale,\n        'u_crossfade_to': crossfade.toScale,\n        'u_image_dash': 1,\n        'u_mix': crossfade.t,\n        'u_lineatlas_width': painter.lineAtlas.width,\n        'u_lineatlas_height': painter.lineAtlas.height,\n    });\n};\n\nfunction calculateTileRatio(tile: Tile, transform: IReadonlyTransform) {\n    return 1 / pixelsToTileUnits(tile, 1, transform.tileZoom);\n}\n\nfunction calculateTranslation(painter: Painter, tile: Tile, layer: LineStyleLayer): [number, number] {\n    // Translate line points prior to any transformation\n    return translatePosition(\n        painter.transform,\n        tile,\n        layer.paint.get('line-translate'),\n        layer.paint.get('line-translate-anchor')\n    );\n}\n\nexport {\n    lineUniforms,\n    lineGradientUniforms,\n    linePatternUniforms,\n    lineSDFUniforms,\n    lineGradientSDFUniforms,\n    lineUniformValues,\n    lineGradientUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues,\n    lineGradientSDFUniformValues\n};\n","import {Uniform1i, Uniform1f, Uniform2f, Uniform3f, Uniform4f} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {RasterStyleLayer} from '../../style/style_layer/raster_style_layer';\nimport type Point from '@mapbox/point-geometry';\n\nexport type RasterUniformsType = {\n    'u_tl_parent': Uniform2f;\n    'u_scale_parent': Uniform1f;\n    'u_buffer_scale': Uniform1f;\n    'u_fade_t': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_image0': Uniform1i;\n    'u_image1': Uniform1i;\n    'u_brightness_low': Uniform1f;\n    'u_brightness_high': Uniform1f;\n    'u_saturation_factor': Uniform1f;\n    'u_contrast_factor': Uniform1f;\n    'u_spin_weights': Uniform3f;\n    'u_coords_top': Uniform4f;\n    'u_coords_bottom': Uniform4f;\n};\n\nconst rasterUniforms = (context: Context, locations: UniformLocations): RasterUniformsType => ({\n    'u_tl_parent': new Uniform2f(context, locations.u_tl_parent),\n    'u_scale_parent': new Uniform1f(context, locations.u_scale_parent),\n    'u_buffer_scale': new Uniform1f(context, locations.u_buffer_scale),\n    'u_fade_t': new Uniform1f(context, locations.u_fade_t),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_image0': new Uniform1i(context, locations.u_image0),\n    'u_image1': new Uniform1i(context, locations.u_image1),\n    'u_brightness_low': new Uniform1f(context, locations.u_brightness_low),\n    'u_brightness_high': new Uniform1f(context, locations.u_brightness_high),\n    'u_saturation_factor': new Uniform1f(context, locations.u_saturation_factor),\n    'u_contrast_factor': new Uniform1f(context, locations.u_contrast_factor),\n    'u_spin_weights': new Uniform3f(context, locations.u_spin_weights),\n    'u_coords_top': new Uniform4f(context, locations.u_coords_top),\n    'u_coords_bottom': new Uniform4f(context, locations.u_coords_bottom)\n});\n\nconst rasterUniformValues = (\n    parentTL: [number, number],\n    parentScaleBy: number,\n    fade: {\n        mix: number;\n        opacity: number;\n    },\n    layer: RasterStyleLayer,\n    cornerCoords: Array<Point>,\n): UniformValues<RasterUniformsType> => ({\n    'u_tl_parent': parentTL,\n    'u_scale_parent': parentScaleBy,\n    // If u_buffer_scale is ever something else than a constant 1,\n    // the north/south pole handling in the vertex shader might need modification\n    // so that the texture coordinares for poles always lie beyond the edge of the texture.\n    // Right now the coordinates are placed right at the texture border.\n    'u_buffer_scale': 1,\n    'u_fade_t': fade.mix,\n    'u_opacity': fade.opacity * layer.paint.get('raster-opacity'),\n    'u_image0': 0,\n    'u_image1': 1,\n    'u_brightness_low': layer.paint.get('raster-brightness-min'),\n    'u_brightness_high': layer.paint.get('raster-brightness-max'),\n    'u_saturation_factor': saturationFactor(layer.paint.get('raster-saturation')),\n    'u_contrast_factor': contrastFactor(layer.paint.get('raster-contrast')),\n    'u_spin_weights': spinWeights(layer.paint.get('raster-hue-rotate')),\n    'u_coords_top': [cornerCoords[0].x, cornerCoords[0].y, cornerCoords[1].x, cornerCoords[1].y],\n    'u_coords_bottom': [cornerCoords[3].x, cornerCoords[3].y, cornerCoords[2].x, cornerCoords[2].y]\n});\n\nfunction spinWeights(angle) {\n    angle *= Math.PI / 180;\n    const s = Math.sin(angle);\n    const c = Math.cos(angle);\n    return [\n        (2 * c + 1) / 3,\n        (-Math.sqrt(3) * s - c + 1) / 3,\n        (Math.sqrt(3) * s - c + 1) / 3\n    ];\n}\n\nfunction contrastFactor(contrast) {\n    return contrast > 0 ?\n        1 / (1 - contrast) :\n        1 + contrast;\n}\n\nfunction saturationFactor(saturation) {\n    return saturation > 0 ?\n        1 - 1 / (1.001 - saturation) :\n        -saturation;\n}\n\nexport {rasterUniforms, rasterUniformValues};\n","import {Uniform1i, Uniform1f, Uniform2f, UniformMatrix4f} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {type mat4} from 'gl-matrix';\n\nexport type SymbolIconUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nexport type SymbolSDFUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_gamma_scale': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_is_halo': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nexport type symbolTextAndIconUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texsize_icon': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_texture_icon': Uniform1i;\n    'u_gamma_scale': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_is_halo': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nconst symbolIconUniforms = (context: Context, locations: UniformLocations): SymbolIconUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolSDFUniforms = (context: Context, locations: UniformLocations): SymbolSDFUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_gamma_scale': new Uniform1f(context, locations.u_gamma_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_is_halo': new Uniform1i(context, locations.u_is_halo),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolTextAndIconUniforms = (context: Context, locations: UniformLocations): symbolTextAndIconUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texsize_icon': new Uniform2f(context, locations.u_texsize_icon),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_texture_icon': new Uniform1i(context, locations.u_texture_icon),\n    'u_gamma_scale': new Uniform1f(context, locations.u_gamma_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_is_halo': new Uniform1i(context, locations.u_is_halo),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolIconUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    isText: boolean,\n    texSize: [number, number],\n    pitchedScale: number\n): UniformValues<SymbolIconUniformsType> => {\n    const transform = painter.transform;\n\n    return {\n        'u_is_size_zoom_constant': +(functionType === 'constant' || functionType === 'source'),\n        'u_is_size_feature_constant': +(functionType === 'constant' || functionType === 'camera'),\n        'u_size_t': size ? size.uSizeT : 0,\n        'u_size': size ? size.uSize : 0,\n        'u_camera_to_center_distance': transform.cameraToCenterDistance,\n        'u_pitch': transform.pitch / 360 * 2 * Math.PI,\n        'u_rotate_symbol': +rotateInShader,\n        'u_aspect_ratio': transform.width / transform.height,\n        'u_fade_change': painter.options.fadeDuration ? painter.symbolFadeChange : 1,\n        'u_label_plane_matrix': labelPlaneMatrix,\n        'u_coord_matrix': glCoordMatrix,\n        'u_is_text': +isText,\n        'u_pitch_with_map': +pitchWithMap,\n        'u_is_along_line': isAlongLine,\n        'u_is_variable_anchor': isVariableAnchor,\n        'u_texsize': texSize,\n        'u_texture': 0,\n        'u_translation': translation,\n        'u_pitched_scale': pitchedScale\n    };\n};\n\nconst symbolSDFUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    isText: boolean,\n    texSize: [number, number],\n    isHalo: boolean,\n    pitchedScale: number\n): UniformValues<SymbolSDFUniformsType> => {\n    const transform = painter.transform;\n\n    return extend(symbolIconUniformValues(functionType, size,\n        rotateInShader, pitchWithMap, isAlongLine, isVariableAnchor, painter, labelPlaneMatrix,\n        glCoordMatrix, translation, isText, texSize, pitchedScale), {\n        'u_gamma_scale': (pitchWithMap ? Math.cos(transform.pitch * Math.PI / 180.0) * transform.cameraToCenterDistance : 1),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_is_halo': +isHalo\n    });\n};\n\nconst symbolTextAndIconUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    texSizeSDF: [number, number],\n    texSizeIcon: [number, number],\n    pitchedScale: number\n): UniformValues<SymbolIconUniformsType> => {\n    return extend(symbolSDFUniformValues(functionType, size,\n        rotateInShader, pitchWithMap, isAlongLine, isVariableAnchor, painter, labelPlaneMatrix,\n        glCoordMatrix, translation, true, texSizeSDF, true, pitchedScale), {\n        'u_texsize_icon': texSizeIcon,\n        'u_texture_icon': 1\n    });\n};\n\nexport {symbolIconUniforms, symbolSDFUniforms, symbolIconUniformValues, symbolSDFUniformValues, symbolTextAndIconUniformValues, symbolTextAndIconUniforms};\n","import {bgPatternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformColor\n} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {Color, ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {CrossFaded} from '../../style/properties';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {OverscaledTileID} from '../../tile/tile_id';\n\nexport type BackgroundUniformsType = {\n    'u_opacity': Uniform1f;\n    'u_color': UniformColor;\n};\n\nexport type BackgroundPatternUniformsType = {\n    'u_opacity': Uniform1f;\n    // pattern uniforms:\n    'u_image': Uniform1i;\n    'u_pattern_tl_a': Uniform2f;\n    'u_pattern_br_a': Uniform2f;\n    'u_pattern_tl_b': Uniform2f;\n    'u_pattern_br_b': Uniform2f;\n    'u_texsize': Uniform2f;\n    'u_mix': Uniform1f;\n    'u_pattern_size_a': Uniform2f;\n    'u_pattern_size_b': Uniform2f;\n    'u_scale_a': Uniform1f;\n    'u_scale_b': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_tile_units_to_pixels': Uniform1f;\n};\n\nconst backgroundUniforms = (context: Context, locations: UniformLocations): BackgroundUniformsType => ({\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_color': new UniformColor(context, locations.u_color)\n});\n\nconst backgroundPatternUniforms = (context: Context, locations: UniformLocations): BackgroundPatternUniformsType => ({\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_pattern_tl_a': new Uniform2f(context, locations.u_pattern_tl_a),\n    'u_pattern_br_a': new Uniform2f(context, locations.u_pattern_br_a),\n    'u_pattern_tl_b': new Uniform2f(context, locations.u_pattern_tl_b),\n    'u_pattern_br_b': new Uniform2f(context, locations.u_pattern_br_b),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_mix': new Uniform1f(context, locations.u_mix),\n    'u_pattern_size_a': new Uniform2f(context, locations.u_pattern_size_a),\n    'u_pattern_size_b': new Uniform2f(context, locations.u_pattern_size_b),\n    'u_scale_a': new Uniform1f(context, locations.u_scale_a),\n    'u_scale_b': new Uniform1f(context, locations.u_scale_b),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_tile_units_to_pixels': new Uniform1f(context, locations.u_tile_units_to_pixels)\n});\n\nconst backgroundUniformValues = (opacity: number, color: Color): UniformValues<BackgroundUniformsType> => ({\n    'u_opacity': opacity,\n    'u_color': color\n});\n\nconst backgroundPatternUniformValues = (\n    opacity: number,\n    painter: Painter,\n    image: CrossFaded<ResolvedImage>,\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    },\n    crossfade: CrossfadeParameters\n): UniformValues<BackgroundPatternUniformsType> => extend(\n    bgPatternUniformValues(image, crossfade, painter, tile),\n    {\n        'u_opacity': opacity\n    }\n);\n\nexport {\n    backgroundUniforms,\n    backgroundPatternUniforms,\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n};\n","import {fillExtrusionUniforms, fillExtrusionPatternUniforms} from './fill_extrusion_program';\nimport {fillPatternUniforms, fillOutlineUniforms, fillOutlinePatternUniforms, fillUniforms} from './fill_program';\nimport {circleUniforms} from './circle_program';\nimport {collisionUniforms, collisionCircleUniforms} from './collision_program';\nimport {debugUniforms} from './debug_program';\nimport {heatmapUniforms, heatmapTextureUniforms} from './heatmap_program';\nimport {hillshadeUniforms, hillshadePrepareUniforms} from './hillshade_program';\nimport {colorReliefUniforms} from './color_relief_program';\nimport {lineUniforms, lineGradientUniforms, linePatternUniforms, lineSDFUniforms, lineGradientSDFUniforms} from './line_program';\nimport {rasterUniforms} from './raster_program';\nimport {symbolIconUniforms, symbolSDFUniforms, symbolTextAndIconUniforms} from './symbol_program';\nimport {backgroundUniforms, backgroundPatternUniforms} from './background_program';\nimport {terrainUniforms, terrainDepthUniforms, terrainCoordsUniforms} from './terrain_program';\nimport {projectionErrorMeasurementUniforms} from './projection_error_measurement_program';\nimport {atmosphereUniforms} from './atmosphere_program';\nimport {skyUniforms} from './sky_program';\n\nconst emptyUniforms = (_: any, __: any): any => {};\n\nexport const programUniforms = {\n    fillExtrusion: fillExtrusionUniforms,\n    fillExtrusionPattern: fillExtrusionPatternUniforms,\n    fill: fillUniforms,\n    fillPattern: fillPatternUniforms,\n    fillOutline: fillOutlineUniforms,\n    fillOutlinePattern: fillOutlinePatternUniforms,\n    circle: circleUniforms,\n    collisionBox: collisionUniforms,\n    collisionCircle: collisionCircleUniforms,\n    debug: debugUniforms,\n    depth: emptyUniforms,\n    clippingMask: emptyUniforms,\n    heatmap: heatmapUniforms,\n    heatmapTexture: heatmapTextureUniforms,\n    hillshade: hillshadeUniforms,\n    hillshadePrepare: hillshadePrepareUniforms,\n    colorRelief: colorReliefUniforms,\n    line: lineUniforms,\n    lineGradient: lineGradientUniforms,\n    linePattern: linePatternUniforms,\n    lineSDF: lineSDFUniforms,\n    lineGradientSDF: lineGradientSDFUniforms,\n    raster: rasterUniforms,\n    symbolIcon: symbolIconUniforms,\n    symbolSDF: symbolSDFUniforms,\n    symbolTextAndIcon: symbolTextAndIconUniforms,\n    background: backgroundUniforms,\n    backgroundPattern: backgroundPatternUniforms,\n    terrain: terrainUniforms,\n    terrainDepth: terrainDepthUniforms,\n    terrainCoords: terrainCoordsUniforms,\n    projectionErrorMeasurement: projectionErrorMeasurementUniforms,\n    atmosphere: atmosphereUniforms,\n    sky: skyUniforms\n};\n","import type {Context} from '../../gl/context';\nimport {type UniformValues, type UniformLocations, Uniform1f, Uniform3f, UniformMatrix4f} from '../uniform_binding';\nimport {type mat4, type vec3} from 'gl-matrix';\n\nexport type atmosphereUniformsType = {\n    'u_sun_pos': Uniform3f;\n    'u_atmosphere_blend': Uniform1f;\n    'u_globe_position': Uniform3f;\n    'u_globe_radius': Uniform1f;\n    'u_inv_proj_matrix': UniformMatrix4f;\n};\n\nconst atmosphereUniforms = (context: Context, locations: UniformLocations): atmosphereUniformsType => ({\n    'u_sun_pos': new Uniform3f(context, locations.u_sun_pos),\n    'u_atmosphere_blend': new Uniform1f(context, locations.u_atmosphere_blend),\n    'u_globe_position': new Uniform3f(context, locations.u_globe_position),\n    'u_globe_radius': new Uniform1f(context, locations.u_globe_radius),\n    'u_inv_proj_matrix': new UniformMatrix4f(context, locations.u_inv_proj_matrix),\n});\n\nconst atmosphereUniformValues = (\n    sunPos: vec3,\n    atmosphereBlend: number,\n    globePosition: vec3,\n    globeRadius: number,\n    invProjMatrix: mat4,\n): UniformValues<atmosphereUniformsType> => ({\n    'u_sun_pos': sunPos,\n    'u_atmosphere_blend': atmosphereBlend,\n    'u_globe_position': globePosition,\n    'u_globe_radius': globeRadius,\n    'u_inv_proj_matrix': invProjMatrix,\n});\n\nexport {atmosphereUniforms, atmosphereUniformValues};\n","import {UniformColor, Uniform1f, Uniform2f} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {type IReadonlyTransform} from '../../geo/transform_interface';\nimport {type Sky} from '../../style/sky';\nimport {getMercatorHorizon} from '../../geo/projection/mercator_utils';\n\nexport type SkyUniformsType = {\n    'u_sky_color': UniformColor;\n    'u_horizon_color': UniformColor;\n    'u_horizon': Uniform2f;\n    'u_horizon_normal': Uniform2f;\n    'u_sky_horizon_blend': Uniform1f;\n    'u_sky_blend': Uniform1f;\n};\n\nconst skyUniforms = (context: Context, locations: UniformLocations): SkyUniformsType => ({\n    'u_sky_color': new UniformColor(context, locations.u_sky_color),\n    'u_horizon_color': new UniformColor(context, locations.u_horizon_color),\n    'u_horizon': new Uniform2f(context, locations.u_horizon),\n    'u_horizon_normal': new Uniform2f(context, locations.u_horizon_normal),\n    'u_sky_horizon_blend': new Uniform1f(context, locations.u_sky_horizon_blend),\n    'u_sky_blend': new Uniform1f(context, locations.u_sky_blend),\n});\n\nconst skyUniformValues = (sky: Sky, transform: IReadonlyTransform, pixelRatio: number): UniformValues<SkyUniformsType> => {\n    const cosRoll = Math.cos(transform.rollInRadians);\n    const sinRoll = Math.sin(transform.rollInRadians);\n    const mercatorHorizon  = getMercatorHorizon(transform);\n    const projectionData = transform.getProjectionData({overscaledTileID: null, applyGlobeMatrix: true, applyTerrainMatrix: true});\n    const skyBlend = projectionData.projectionTransition;\n    return {\n        'u_sky_color': sky.properties.get('sky-color'),\n        'u_horizon_color': sky.properties.get('horizon-color'),\n        'u_horizon': [(transform.width / 2 - mercatorHorizon * sinRoll)  * pixelRatio,\n            (transform.height / 2 + mercatorHorizon * cosRoll) * pixelRatio],\n        'u_horizon_normal': [-sinRoll, cosRoll],\n        'u_sky_horizon_blend': (sky.properties.get('sky-horizon-blend') * transform.height / 2) * pixelRatio,\n        'u_sky_blend': skyBlend,\n    };\n};\n\nexport {skyUniforms, skyUniformValues};\n","\nimport type {StructArray} from '../util/struct_array';\nimport type {TriangleIndexArray, LineIndexArray, LineStripIndexArray} from '../data/index_array_type';\nimport type {Context} from '../gl/context';\n\n/**\n * @internal\n * an index buffer class\n */\nexport class IndexBuffer {\n    context: Context;\n    buffer: WebGLBuffer;\n    dynamicDraw: boolean;\n\n    constructor(context: Context, array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean) {\n        this.context = context;\n        const gl = context.gl;\n        this.buffer = gl.createBuffer();\n        this.dynamicDraw = Boolean(dynamicDraw);\n\n        // The bound index buffer is part of vertex array object state. We don't want to\n        // modify whatever VAO happens to be currently bound, so make sure the default\n        // vertex array provided by the context is bound instead.\n        this.context.unbindVAO();\n\n        context.bindElementBuffer.set(this.buffer);\n        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, array.arrayBuffer, this.dynamicDraw ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW);\n\n        if (!this.dynamicDraw) {\n            delete array.arrayBuffer;\n        }\n    }\n\n    bind() {\n        this.context.bindElementBuffer.set(this.buffer);\n    }\n\n    updateData(array: StructArray) {\n        const gl = this.context.gl;\n        if (!this.dynamicDraw) throw new Error('Attempted to update data while not in dynamic mode.');\n        // The right VAO will get this buffer re-bound later in VertexArrayObject.bind\n        // See https://github.com/mapbox/mapbox-gl-js/issues/5620\n        this.context.unbindVAO();\n        this.bind();\n        gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, array.arrayBuffer);\n    }\n\n    destroy() {\n        const gl = this.context.gl;\n        if (this.buffer) {\n            gl.deleteBuffer(this.buffer);\n            delete this.buffer;\n        }\n    }\n}\n","\nimport type {\n    StructArray,\n    StructArrayMember\n} from '../util/struct_array';\n\nimport type {Program} from '../render/program';\nimport type {Context} from '../gl/context';\n\n/**\n * An Enum for AttributeType\n */\nconst AttributeType = {\n    Int8: 'BYTE',\n    Uint8: 'UNSIGNED_BYTE',\n    Int16: 'SHORT',\n    Uint16: 'UNSIGNED_SHORT',\n    Int32: 'INT',\n    Uint32: 'UNSIGNED_INT',\n    Float32: 'FLOAT'\n};\n\n/**\n * @internal\n * The `VertexBuffer` class turns a `StructArray` into a WebGL buffer. Each member of the StructArray's\n * Struct type is converted to a WebGL attribute.\n */\nexport class VertexBuffer {\n    length: number;\n    attributes: ReadonlyArray<StructArrayMember>;\n    itemSize: number;\n    dynamicDraw: boolean;\n    context: Context;\n    buffer: WebGLBuffer;\n\n    /**\n     * @param dynamicDraw - Whether this buffer will be repeatedly updated.\n     */\n    constructor(context: Context, array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean) {\n        this.length = array.length;\n        this.attributes = attributes;\n        this.itemSize = array.bytesPerElement;\n        this.dynamicDraw = dynamicDraw;\n\n        this.context = context;\n        const gl = context.gl;\n        this.buffer = gl.createBuffer();\n        context.bindVertexBuffer.set(this.buffer);\n        gl.bufferData(gl.ARRAY_BUFFER, array.arrayBuffer, this.dynamicDraw ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW);\n\n        if (!this.dynamicDraw) {\n            delete array.arrayBuffer;\n        }\n    }\n\n    bind() {\n        this.context.bindVertexBuffer.set(this.buffer);\n    }\n\n    updateData(array: StructArray) {\n        if (array.length !== this.length) throw new Error(`Length of new data is ${array.length}, which doesn't match current length of ${this.length}`);\n        const gl = this.context.gl;\n        this.bind();\n        gl.bufferSubData(gl.ARRAY_BUFFER, 0, array.arrayBuffer);\n    }\n\n    enableAttributes(gl: WebGLRenderingContext|WebGL2RenderingContext, program: Program<any>) {\n        for (let j = 0; j < this.attributes.length; j++) {\n            const member = this.attributes[j];\n            const attribIndex: number | void = program.attributes[member.name];\n            if (attribIndex !== undefined) {\n                gl.enableVertexAttribArray(attribIndex);\n            }\n        }\n    }\n\n    /**\n     * Set the attribute pointers in a WebGL context\n     * @param gl - The WebGL context\n     * @param program - The active WebGL program\n     * @param vertexOffset - Index of the starting vertex of the segment\n     */\n    setVertexAttribPointers(gl: WebGLRenderingContext|WebGL2RenderingContext, program: Program<any>, vertexOffset?: number | null) {\n        for (let j = 0; j < this.attributes.length; j++) {\n            const member = this.attributes[j];\n            const attribIndex: number | void = program.attributes[member.name];\n\n            if (attribIndex !== undefined) {\n                gl.vertexAttribPointer(\n                    attribIndex,\n                    member.components,\n                    gl[AttributeType[member.type]],\n                    false,\n                    this.itemSize,\n                    member.offset + (this.itemSize * (vertexOffset || 0))\n                );\n            }\n        }\n    }\n\n    /**\n     * Destroy the GL buffer bound to the given WebGL context\n     */\n    destroy() {\n        const gl = this.context.gl;\n        if (this.buffer) {\n            gl.deleteBuffer(this.buffer);\n            delete this.buffer;\n        }\n    }\n}\n","import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {isWebGL2} from './webgl2';\n\nimport type {Context} from './context';\nimport type {\n    BlendFuncType,\n    BlendEquationType,\n    ColorMaskType,\n    DepthRangeType,\n    DepthMaskType,\n    StencilFuncType,\n    StencilOpType,\n    DepthFuncType,\n    TextureUnitType,\n    ViewportType,\n    CullFaceModeType,\n    FrontFaceType,\n} from './types';\n\nexport interface IValue<T> {\n    current: T;\n    default: T;\n    dirty: boolean;\n    get(): T;\n    setDefault(): void;\n    set(value: T): void;\n}\n\nclass BaseValue<T> implements IValue<T> {\n    gl: WebGLRenderingContext|WebGL2RenderingContext;\n    current: T;\n    default: T;\n    dirty: boolean;\n\n    constructor(context: Context) {\n        this.gl = context.gl;\n        this.default = this.getDefault();\n        this.current = this.default;\n        this.dirty = false;\n    }\n\n    get(): T {\n        return this.current;\n    }\n    set(value: T) { // eslint-disable-line\n        // overridden in child classes;\n    }\n\n    getDefault(): T {\n        return this.default; // overridden in child classes\n    }\n    setDefault() {\n        this.set(this.default);\n    }\n}\n\nexport class ClearColor extends BaseValue<Color> {\n    getDefault(): Color {\n        return Color.transparent;\n    }\n    set(v: Color) {\n        const c = this.current;\n        if (v.r === c.r && v.g === c.g && v.b === c.b && v.a === c.a && !this.dirty) return;\n        this.gl.clearColor(v.r, v.g, v.b, v.a);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ClearDepth extends BaseValue<number> {\n    getDefault(): number {\n        return 1;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.clearDepth(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ClearStencil extends BaseValue<number> {\n    getDefault(): number {\n        return 0;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.clearStencil(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ColorMask extends BaseValue<ColorMaskType> {\n    getDefault(): ColorMaskType {\n        return [true, true, true, true];\n    }\n    set(v: ColorMaskType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && v[3] === c[3] && !this.dirty) return;\n        this.gl.colorMask(v[0], v[1], v[2], v[3]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthMask extends BaseValue<DepthMaskType> {\n    getDefault(): DepthMaskType {\n        return true;\n    }\n    set(v: DepthMaskType): void {\n        if (v === this.current && !this.dirty) return;\n        this.gl.depthMask(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilMask extends BaseValue<number> {\n    getDefault(): number {\n        return 0xFF;\n    }\n    set(v: number): void {\n        if (v === this.current && !this.dirty) return;\n        this.gl.stencilMask(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilFunc extends BaseValue<StencilFuncType> {\n    getDefault(): StencilFuncType {\n        return {\n            func: this.gl.ALWAYS,\n            ref: 0,\n            mask: 0xFF\n        };\n    }\n    set(v: StencilFuncType): void {\n        const c = this.current;\n        if (v.func === c.func && v.ref === c.ref && v.mask === c.mask && !this.dirty) return;\n        this.gl.stencilFunc(v.func, v.ref, v.mask);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilOp extends BaseValue<StencilOpType> {\n    getDefault(): StencilOpType {\n        const gl = this.gl;\n        return [gl.KEEP, gl.KEEP, gl.KEEP];\n    }\n    set(v: StencilOpType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && !this.dirty) return;\n        this.gl.stencilOp(v[0], v[1], v[2]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilTest extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.STENCIL_TEST);\n        } else {\n            gl.disable(gl.STENCIL_TEST);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthRange extends BaseValue<DepthRangeType> {\n    getDefault(): DepthRangeType {\n        return [0, 1];\n    }\n    set(v: DepthRangeType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && !this.dirty) return;\n        this.gl.depthRange(v[0], v[1]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthTest extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.DEPTH_TEST);\n        } else {\n            gl.disable(gl.DEPTH_TEST);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthFunc extends BaseValue<DepthFuncType> {\n    getDefault(): DepthFuncType {\n        return this.gl.LESS;\n    }\n    set(v: DepthFuncType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.depthFunc(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class Blend extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.BLEND);\n        } else {\n            gl.disable(gl.BLEND);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendFunc extends BaseValue<BlendFuncType> {\n    getDefault(): BlendFuncType {\n        const gl = this.gl;\n        return [gl.ONE, gl.ZERO];\n    }\n    set(v: BlendFuncType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && !this.dirty) return;\n        this.gl.blendFunc(v[0], v[1]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendColor extends BaseValue<Color> {\n    getDefault(): Color {\n        return Color.transparent;\n    }\n    set(v: Color) {\n        const c = this.current;\n        if (v.r === c.r && v.g === c.g && v.b === c.b && v.a === c.a && !this.dirty) return;\n        this.gl.blendColor(v.r, v.g, v.b, v.a);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendEquation extends BaseValue<BlendEquationType> {\n    getDefault(): BlendEquationType {\n        return this.gl.FUNC_ADD;\n    }\n    set(v: BlendEquationType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.blendEquation(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class CullFace extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.CULL_FACE);\n        } else {\n            gl.disable(gl.CULL_FACE);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class CullFaceSide extends BaseValue<CullFaceModeType> {\n    getDefault(): CullFaceModeType {\n        return this.gl.BACK;\n    }\n    set(v: CullFaceModeType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.cullFace(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class FrontFace extends BaseValue<FrontFaceType> {\n    getDefault(): FrontFaceType {\n        return this.gl.CCW;\n    }\n    set(v: FrontFaceType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.frontFace(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ProgramValue extends BaseValue<WebGLProgram> {\n    getDefault(): WebGLProgram {\n        return null;\n    }\n    set(v?: WebGLProgram | null) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.useProgram(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ActiveTextureUnit extends BaseValue<TextureUnitType> {\n    getDefault(): TextureUnitType {\n        return this.gl.TEXTURE0;\n    }\n    set(v: TextureUnitType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.activeTexture(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class Viewport extends BaseValue<ViewportType> {\n    getDefault(): ViewportType {\n        const gl = this.gl;\n        return [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight];\n    }\n    set(v: ViewportType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && v[3] === c[3] && !this.dirty) return;\n        this.gl.viewport(v[0], v[1], v[2], v[3]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindFramebuffer extends BaseValue<WebGLFramebuffer> {\n    getDefault(): WebGLFramebuffer {\n        return null;\n    }\n    set(v?: WebGLFramebuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindFramebuffer(gl.FRAMEBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindRenderbuffer extends BaseValue<WebGLRenderbuffer> {\n    getDefault(): WebGLRenderbuffer {\n        return null;\n    }\n    set(v?: WebGLRenderbuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindRenderbuffer(gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindTexture extends BaseValue<WebGLTexture> {\n    getDefault(): WebGLTexture {\n        return null;\n    }\n    set(v?: WebGLTexture | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindTexture(gl.TEXTURE_2D, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindVertexBuffer extends BaseValue<WebGLBuffer> {\n    getDefault(): WebGLBuffer {\n        return null;\n    }\n    set(v?: WebGLBuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindBuffer(gl.ARRAY_BUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindElementBuffer extends BaseValue<WebGLBuffer> {\n    getDefault(): WebGLBuffer {\n        return null;\n    }\n    set(v?: WebGLBuffer | null) {\n        // Always rebind\n        const gl = this.gl;\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindVertexArray extends BaseValue<WebGLVertexArrayObject | null> {\n    getDefault(): WebGLVertexArrayObject | null {\n        return null;\n    }\n    set(v: WebGLVertexArrayObject | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n\n        if (isWebGL2(gl)) {\n            gl.bindVertexArray(v);\n        } else {\n            gl.getExtension('OES_vertex_array_object')?.bindVertexArrayOES(v);\n        }\n\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpack extends BaseValue<number> {\n    getDefault(): number {\n        return 4;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_ALIGNMENT, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpackPremultiplyAlpha extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean): void {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, ((v as any)));\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpackFlipY extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean): void {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, ((v as any)));\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nclass FramebufferAttachment<T> extends BaseValue<T> {\n    parent: WebGLFramebuffer;\n    context: Context;\n\n    constructor(context: Context, parent: WebGLFramebuffer) {\n        super(context);\n        this.context = context;\n        this.parent = parent;\n    }\n    getDefault() {\n        return null;\n    }\n}\n\nexport class ColorAttachment extends FramebufferAttachment<WebGLTexture> {\n    setDirty() {\n        this.dirty = true;\n    }\n    set(v?: WebGLTexture | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a renderbuffer to the color\n        // attachment point, but thus far MBGL only uses textures for color\n        const gl = this.gl;\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, v, 0);\n\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthAttachment extends FramebufferAttachment<WebGLRenderbuffer> {\n    set(v?: WebGLRenderbuffer | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a texture to the depth attachment\n        // point, but thus far MBGL only uses renderbuffers for depth\n        const gl = this.gl;\n        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthStencilAttachment extends FramebufferAttachment<WebGLRenderbuffer> {\n    set(v?: WebGLRenderbuffer | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a texture to the depth attachment\n        // point, but thus far MBGL only uses renderbuffers for depth\n        const gl = this.gl;\n        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n","/**\n * Error message to use when framebuffer is incomplete\n */\nexport const FRAMEBUFFER_NOT_COMPLETE_ERROR = 'Framebuffer is not complete';\n\n/**\n * Check if an error is a framebuffer not complete error\n * @param error - An error object\n * @returns - true if the error is a framebuffer not complete error\n */\nexport function isFramebufferNotCompleteError(error: Error): boolean {\n    return error.message === FRAMEBUFFER_NOT_COMPLETE_ERROR;\n}\n\n/**\n * Use this when you need to create a framebuffer not complete error.\n * @returns An error object with the message \"Framebuffer is not complete\"\n */\nexport function createFramebufferNotCompleteError(): Error {\n    return new Error(FRAMEBUFFER_NOT_COMPLETE_ERROR);\n}\n","import {ColorAttachment, DepthAttachment, DepthStencilAttachment} from './value';\n\nimport type {Context} from './context';\nimport {createFramebufferNotCompleteError} from '../util/framebuffer_error';\n\n/**\n * @internal\n * A framebuffer holder object\n */\nexport class Framebuffer {\n    context: Context;\n    width: number;\n    height: number;\n    framebuffer: WebGLFramebuffer;\n    colorAttachment: ColorAttachment;\n    depthAttachment: DepthAttachment;\n\n    constructor(context: Context, width: number, height: number, hasDepth: boolean, hasStencil: boolean) {\n        this.context = context;\n        this.width = width;\n        this.height = height;\n        const gl = context.gl;\n        const fbo = this.framebuffer = gl.createFramebuffer();\n\n        this.colorAttachment = new ColorAttachment(context, fbo);\n        if (hasDepth) {\n            this.depthAttachment = hasStencil ? new DepthStencilAttachment(context, fbo) : new DepthAttachment(context, fbo);\n        } else if (hasStencil) {\n            throw new Error('Stencil cannot be set without depth');\n        }\n        if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) !== gl.FRAMEBUFFER_COMPLETE) {\n            throw createFramebufferNotCompleteError();\n        }\n    }\n\n    destroy() {\n        const gl = this.context.gl;\n\n        const texture = this.colorAttachment.get();\n        if (texture) gl.deleteTexture(texture);\n\n        if (this.depthAttachment) {\n            const renderbuffer = this.depthAttachment.get();\n            if (renderbuffer) gl.deleteRenderbuffer(renderbuffer);\n        }\n\n        gl.deleteFramebuffer(this.framebuffer);\n    }\n}\n","import {IndexBuffer} from './index_buffer';\n\nimport {VertexBuffer} from './vertex_buffer';\nimport {Framebuffer} from './framebuffer';\nimport {type DepthMode} from './depth_mode';\nimport {type StencilMode} from './stencil_mode';\nimport {ColorMode} from './color_mode';\nimport {type CullFaceMode} from './cull_face_mode';\nimport {deepEqual} from '../util/util';\nimport {ClearColor, ClearDepth, ClearStencil, ColorMask, DepthMask, StencilMask, StencilFunc, StencilOp, StencilTest, DepthRange, DepthTest, DepthFunc, Blend, BlendFunc, BlendColor, BlendEquation, CullFace, CullFaceSide, FrontFace, ProgramValue, ActiveTextureUnit, Viewport, BindFramebuffer, BindRenderbuffer, BindTexture, BindVertexBuffer, BindElementBuffer, BindVertexArray, PixelStoreUnpack, PixelStoreUnpackPremultiplyAlpha, PixelStoreUnpackFlipY} from './value';\n\nimport type {TriangleIndexArray, LineIndexArray, LineStripIndexArray} from '../data/index_array_type';\nimport type {\n    StructArray,\n    StructArrayMember\n} from '../util/struct_array';\nimport type {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {isWebGL2} from './webgl2';\n\ntype ClearArgs = {\n    color?: Color;\n    depth?: number;\n    stencil?: number;\n};\n\n/**\n * @internal\n * A webgl wrapper class to allow injection, mocking and abstaction\n */\nexport class Context {\n    gl: WebGLRenderingContext | WebGL2RenderingContext;\n\n    currentNumAttributes: number;\n    maxTextureSize: number;\n\n    clearColor: ClearColor;\n    clearDepth: ClearDepth;\n    clearStencil: ClearStencil;\n    colorMask: ColorMask;\n    depthMask: DepthMask;\n    stencilMask: StencilMask;\n    stencilFunc: StencilFunc;\n    stencilOp: StencilOp;\n    stencilTest: StencilTest;\n    depthRange: DepthRange;\n    depthTest: DepthTest;\n    depthFunc: DepthFunc;\n    blend: Blend;\n    blendFunc: BlendFunc;\n    blendColor: BlendColor;\n    blendEquation: BlendEquation;\n    cullFace: CullFace;\n    cullFaceSide: CullFaceSide;\n    frontFace: FrontFace;\n    program: ProgramValue;\n    activeTexture: ActiveTextureUnit;\n    viewport: Viewport;\n    bindFramebuffer: BindFramebuffer;\n    bindRenderbuffer: BindRenderbuffer;\n    bindTexture: BindTexture;\n    bindVertexBuffer: BindVertexBuffer;\n    bindElementBuffer: BindElementBuffer;\n    bindVertexArray: BindVertexArray;\n    pixelStoreUnpack: PixelStoreUnpack;\n    pixelStoreUnpackPremultiplyAlpha: PixelStoreUnpackPremultiplyAlpha;\n    pixelStoreUnpackFlipY: PixelStoreUnpackFlipY;\n\n    extTextureFilterAnisotropic: EXT_texture_filter_anisotropic | null;\n    extTextureFilterAnisotropicMax?: GLfloat;\n    HALF_FLOAT?: GLenum;\n    RGBA16F?: GLenum;\n    RGB16F?: GLenum;\n\n    constructor(gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        this.gl = gl;\n        this.clearColor = new ClearColor(this);\n        this.clearDepth = new ClearDepth(this);\n        this.clearStencil = new ClearStencil(this);\n        this.colorMask = new ColorMask(this);\n        this.depthMask = new DepthMask(this);\n        this.stencilMask = new StencilMask(this);\n        this.stencilFunc = new StencilFunc(this);\n        this.stencilOp = new StencilOp(this);\n        this.stencilTest = new StencilTest(this);\n        this.depthRange = new DepthRange(this);\n        this.depthTest = new DepthTest(this);\n        this.depthFunc = new DepthFunc(this);\n        this.blend = new Blend(this);\n        this.blendFunc = new BlendFunc(this);\n        this.blendColor = new BlendColor(this);\n        this.blendEquation = new BlendEquation(this);\n        this.cullFace = new CullFace(this);\n        this.cullFaceSide = new CullFaceSide(this);\n        this.frontFace = new FrontFace(this);\n        this.program = new ProgramValue(this);\n        this.activeTexture = new ActiveTextureUnit(this);\n        this.viewport = new Viewport(this);\n        this.bindFramebuffer = new BindFramebuffer(this);\n        this.bindRenderbuffer = new BindRenderbuffer(this);\n        this.bindTexture = new BindTexture(this);\n        this.bindVertexBuffer = new BindVertexBuffer(this);\n        this.bindElementBuffer = new BindElementBuffer(this);\n        this.bindVertexArray = new BindVertexArray(this);\n        this.pixelStoreUnpack = new PixelStoreUnpack(this);\n        this.pixelStoreUnpackPremultiplyAlpha = new PixelStoreUnpackPremultiplyAlpha(this);\n        this.pixelStoreUnpackFlipY = new PixelStoreUnpackFlipY(this);\n\n        this.extTextureFilterAnisotropic = (\n            gl.getExtension('EXT_texture_filter_anisotropic') ||\n            gl.getExtension('MOZ_EXT_texture_filter_anisotropic') ||\n            gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic')\n        );\n\n        if (this.extTextureFilterAnisotropic) {\n            this.extTextureFilterAnisotropicMax = gl.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n        }\n\n        this.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n\n        if (isWebGL2(gl)) {\n            this.HALF_FLOAT = gl.HALF_FLOAT;\n            const extColorBufferHalfFloat = gl.getExtension('EXT_color_buffer_half_float');\n            this.RGBA16F = gl.RGBA16F ?? extColorBufferHalfFloat?.RGBA16F_EXT;\n            this.RGB16F = gl.RGB16F ?? extColorBufferHalfFloat?.RGB16F_EXT;\n            gl.getExtension('EXT_color_buffer_float');\n        } else {\n            gl.getExtension('EXT_color_buffer_half_float');\n            gl.getExtension('OES_texture_half_float_linear');\n            const extTextureHalfFloat = gl.getExtension('OES_texture_half_float');\n            this.HALF_FLOAT = extTextureHalfFloat?.HALF_FLOAT_OES;\n        }\n    }\n\n    setDefault() {\n        this.unbindVAO();\n\n        this.clearColor.setDefault();\n        this.clearDepth.setDefault();\n        this.clearStencil.setDefault();\n        this.colorMask.setDefault();\n        this.depthMask.setDefault();\n        this.stencilMask.setDefault();\n        this.stencilFunc.setDefault();\n        this.stencilOp.setDefault();\n        this.stencilTest.setDefault();\n        this.depthRange.setDefault();\n        this.depthTest.setDefault();\n        this.depthFunc.setDefault();\n        this.blend.setDefault();\n        this.blendFunc.setDefault();\n        this.blendColor.setDefault();\n        this.blendEquation.setDefault();\n        this.cullFace.setDefault();\n        this.cullFaceSide.setDefault();\n        this.frontFace.setDefault();\n        this.program.setDefault();\n        this.activeTexture.setDefault();\n        this.bindFramebuffer.setDefault();\n        this.pixelStoreUnpack.setDefault();\n        this.pixelStoreUnpackPremultiplyAlpha.setDefault();\n        this.pixelStoreUnpackFlipY.setDefault();\n    }\n\n    setDirty() {\n        this.clearColor.dirty = true;\n        this.clearDepth.dirty = true;\n        this.clearStencil.dirty = true;\n        this.colorMask.dirty = true;\n        this.depthMask.dirty = true;\n        this.stencilMask.dirty = true;\n        this.stencilFunc.dirty = true;\n        this.stencilOp.dirty = true;\n        this.stencilTest.dirty = true;\n        this.depthRange.dirty = true;\n        this.depthTest.dirty = true;\n        this.depthFunc.dirty = true;\n        this.blend.dirty = true;\n        this.blendFunc.dirty = true;\n        this.blendColor.dirty = true;\n        this.blendEquation.dirty = true;\n        this.cullFace.dirty = true;\n        this.cullFaceSide.dirty = true;\n        this.frontFace.dirty = true;\n        this.program.dirty = true;\n        this.activeTexture.dirty = true;\n        this.viewport.dirty = true;\n        this.bindFramebuffer.dirty = true;\n        this.bindRenderbuffer.dirty = true;\n        this.bindTexture.dirty = true;\n        this.bindVertexBuffer.dirty = true;\n        this.bindElementBuffer.dirty = true;\n        this.bindVertexArray.dirty = true;\n        this.pixelStoreUnpack.dirty = true;\n        this.pixelStoreUnpackPremultiplyAlpha.dirty = true;\n        this.pixelStoreUnpackFlipY.dirty = true;\n    }\n\n    createIndexBuffer(array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean) {\n        return new IndexBuffer(this, array, dynamicDraw);\n    }\n\n    createVertexBuffer(array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean) {\n        return new VertexBuffer(this, array, attributes, dynamicDraw);\n    }\n\n    createRenderbuffer(storageFormat: number, width: number, height: number) {\n        const gl = this.gl;\n\n        const rbo = gl.createRenderbuffer();\n        this.bindRenderbuffer.set(rbo);\n        gl.renderbufferStorage(gl.RENDERBUFFER, storageFormat, width, height);\n        this.bindRenderbuffer.set(null);\n\n        return rbo;\n    }\n\n    createFramebuffer(width: number, height: number, hasDepth: boolean, hasStencil: boolean) {\n        return new Framebuffer(this, width, height, hasDepth, hasStencil);\n    }\n\n    clear({\n        color,\n        depth,\n        stencil\n    }: ClearArgs) {\n        const gl = this.gl;\n        let mask = 0;\n\n        if (color) {\n            mask |= gl.COLOR_BUFFER_BIT;\n            this.clearColor.set(color);\n            this.colorMask.set([true, true, true, true]);\n        }\n\n        if (typeof depth !== 'undefined') {\n            mask |= gl.DEPTH_BUFFER_BIT;\n\n            // Workaround for platforms where clearDepth doesn't seem to work\n            // without resetting the depthRange. See https://github.com/mapbox/mapbox-gl-js/issues/3437\n            this.depthRange.set([0, 1]);\n\n            this.clearDepth.set(depth);\n            this.depthMask.set(true);\n        }\n\n        if (typeof stencil !== 'undefined') {\n            mask |= gl.STENCIL_BUFFER_BIT;\n            this.clearStencil.set(stencil);\n            this.stencilMask.set(0xFF);\n        }\n\n        gl.clear(mask);\n    }\n\n    setCullFace(cullFaceMode: Readonly<CullFaceMode>) {\n        if (cullFaceMode.enable === false) {\n            this.cullFace.set(false);\n        } else {\n            this.cullFace.set(true);\n            this.cullFaceSide.set(cullFaceMode.mode);\n            this.frontFace.set(cullFaceMode.frontFace);\n        }\n    }\n\n    setDepthMode(depthMode: Readonly<DepthMode>) {\n        if (depthMode.func === this.gl.ALWAYS && !depthMode.mask) {\n            this.depthTest.set(false);\n        } else {\n            this.depthTest.set(true);\n            this.depthFunc.set(depthMode.func);\n            this.depthMask.set(depthMode.mask);\n            this.depthRange.set(depthMode.range);\n        }\n    }\n\n    setStencilMode(stencilMode: Readonly<StencilMode>) {\n        if (stencilMode.test.func === this.gl.ALWAYS && !stencilMode.mask) {\n            this.stencilTest.set(false);\n        } else {\n            this.stencilTest.set(true);\n            this.stencilMask.set(stencilMode.mask);\n            this.stencilOp.set([stencilMode.fail, stencilMode.depthFail, stencilMode.pass]);\n            this.stencilFunc.set({\n                func: stencilMode.test.func,\n                ref: stencilMode.ref,\n                mask: stencilMode.test.mask\n            });\n        }\n    }\n\n    setColorMode(colorMode: Readonly<ColorMode>) {\n        if (deepEqual(colorMode.blendFunction, ColorMode.Replace)) {\n            this.blend.set(false);\n        } else {\n            this.blend.set(true);\n            this.blendFunc.set(colorMode.blendFunction);\n            this.blendColor.set(colorMode.blendColor);\n        }\n\n        this.colorMask.set(colorMode.mask);\n    }\n\n    createVertexArray(): WebGLVertexArrayObject | undefined {\n        if (isWebGL2(this.gl))\n            return this.gl.createVertexArray();\n        return this.gl.getExtension('OES_vertex_array_object')?.createVertexArrayOES();\n    }\n\n    deleteVertexArray(x: WebGLVertexArrayObject | undefined) {\n        if (isWebGL2(this.gl))\n            return this.gl.deleteVertexArray(x);\n        return this.gl.getExtension('OES_vertex_array_object')?.deleteVertexArrayOES(x);\n    }\n\n    unbindVAO() {\n        // Unbinding the VAO prevents other things (custom layers, new buffer creation) from\n        // unintentionally changing the state of the last VAO used.\n        this.bindVertexArray.set(null);\n    }\n}\n","import type {Painter} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {collisionUniformValues, collisionCircleUniformValues} from './program/collision_program';\nimport {QuadTriangleArray, CollisionCircleLayoutArray} from '../data/array_types.g';\nimport {collisionCircleLayout} from '../data/bucket/symbol_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {type VertexBuffer} from '../gl/vertex_buffer';\nimport {type IndexBuffer} from '../gl/index_buffer';\n\ntype TileBatch = {\n    circleArray: Array<number>;\n    circleOffset: number;\n    coord: OverscaledTileID;\n};\n\nlet quadTriangles: QuadTriangleArray;\n\nexport function drawCollisionDebug(painter: Painter, tileManager: TileManager, layer: StyleLayer, coords: Array<OverscaledTileID>, isText: boolean) {\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n    const program = painter.useProgram('collisionBox');\n    const tileBatches: Array<TileBatch> = [];\n    let circleCount = 0;\n    let circleOffset = 0;\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n        const tile = tileManager.getTile(coord);\n        const bucket: SymbolBucket = (tile.getBucket(layer) as any);\n        if (!bucket) {\n            continue;\n        }\n        const buffers = isText ? bucket.textCollisionBox : bucket.iconCollisionBox;\n        // Get collision circle data of this bucket\n        const circleArray: Array<number> = bucket.collisionCircleArray;\n        if (circleArray.length > 0) {\n            tileBatches.push({\n                circleArray,\n                circleOffset,\n                coord\n            });\n\n            circleCount += circleArray.length / 4;  // 4 values per circle\n            circleOffset = circleCount;\n        }\n\n        // Draw collision boxes\n        if (!buffers) {\n            continue;\n        }\n\n        program.draw(context, gl.LINES,\n            DepthMode.disabled, StencilMode.disabled,\n            painter.colorModeForRenderPass(),\n            CullFaceMode.disabled,\n            collisionUniformValues(painter.transform),\n            painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord),\n            transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: true}),\n            layer.id, buffers.layoutVertexBuffer, buffers.indexBuffer,\n            buffers.segments, null, painter.transform.zoom, null, null,\n            buffers.collisionVertexBuffer);\n    }\n\n    if (!isText || !tileBatches.length) {\n        return;\n    }\n\n    // Render collision circles\n    const circleProgram = painter.useProgram('collisionCircle');\n\n    // Construct vertex data\n    const vertexData = new CollisionCircleLayoutArray();\n    vertexData.resize(circleCount * 4);\n    vertexData._trim();\n\n    let vertexOffset = 0;\n\n    for (const batch of tileBatches) {\n        for (let i = 0; i < batch.circleArray.length / 4; i++) {\n            const circleIdx = i * 4;\n            const x = batch.circleArray[circleIdx + 0];\n            const y = batch.circleArray[circleIdx + 1];\n            const radius = batch.circleArray[circleIdx + 2];\n            const collision = batch.circleArray[circleIdx + 3];\n\n            // 4 floats per vertex, 4 vertices per quad\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 0);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 1);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 2);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 3);\n        }\n    }\n    if (!quadTriangles || quadTriangles.length < circleCount * 2) {\n        quadTriangles = createQuadTriangles(circleCount);\n    }\n\n    const indexBuffer: IndexBuffer = context.createIndexBuffer(quadTriangles, true);\n    const vertexBuffer: VertexBuffer = context.createVertexBuffer(vertexData, collisionCircleLayout.members, true);\n\n    // Render batches\n    for (const batch of tileBatches) {\n        const uniforms = collisionCircleUniformValues(painter.transform);\n\n        circleProgram.draw(\n            context,\n            gl.TRIANGLES,\n            DepthMode.disabled,\n            StencilMode.disabled,\n            painter.colorModeForRenderPass(),\n            CullFaceMode.disabled,\n            uniforms,\n            painter.style.map.terrain && painter.style.map.terrain.getTerrainData(batch.coord),\n            null,\n            layer.id,\n            vertexBuffer,\n            indexBuffer,\n            SegmentVector.simpleSegment(0, batch.circleOffset * 2, batch.circleArray.length, batch.circleArray.length / 2),\n            null,\n            painter.transform.zoom,\n            null,\n            null,\n            null);\n    }\n\n    vertexBuffer.destroy();\n    indexBuffer.destroy();\n}\n\nfunction createQuadTriangles(quadCount: number): QuadTriangleArray {\n    const triCount = quadCount * 2;\n    const array = new QuadTriangleArray();\n\n    array.resize(triCount);\n    array._trim();\n\n    // Two triangles and 4 vertices per quad.\n    for (let i = 0; i < triCount; i++) {\n        const idx = i * 6;\n\n        array.uint16[idx + 0] = i * 4 + 0;\n        array.uint16[idx + 1] = i * 4 + 1;\n        array.uint16[idx + 2] = i * 4 + 2;\n        array.uint16[idx + 3] = i * 4 + 2;\n        array.uint16[idx + 4] = i * 4 + 3;\n        array.uint16[idx + 5] = i * 4 + 0;\n    }\n\n    return array;\n}\n","import Point from '@mapbox/point-geometry';\nimport {drawCollisionDebug} from './draw_collision_debug';\n\nimport {SegmentVector} from '../data/segment';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport {type EvaluatedZoomSize, evaluateSizeForFeature, evaluateSizeForZoom} from '../symbol/symbol_size';\nimport {mat4} from 'gl-matrix';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {addDynamicAttributes} from '../data/bucket/symbol_bucket';\n\nimport {getAnchorAlignment, WritingMode} from '../symbol/shaping';\nimport ONE_EM from '../symbol/one_em';\n\nimport {\n    type SymbolIconUniformsType,\n    symbolIconUniformValues,\n    symbolSDFUniformValues,\n    symbolTextAndIconUniformValues\n} from './program/symbol_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\n\nimport type {Texture, TextureFilter} from '../render/texture';\nimport type {OverscaledTileID, UnwrappedTileID} from '../tile/tile_id';\nimport type {UniformValues} from './uniform_binding';\nimport type {SymbolSDFUniformsType} from '../render/program/symbol_program';\nimport type {CrossTileID, VariableOffset} from '../symbol/placement';\nimport type {SymbolBucket, SymbolBuffers} from '../data/bucket/symbol_bucket';\nimport type {TerrainData} from '../render/terrain';\nimport type {SymbolLayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {ColorMode} from '../gl/color_mode';\nimport type {Program} from './program';\nimport type {TextAnchor} from '../style/style_layer/variable_text_anchor';\nimport {getGlCoordMatrix, getPerspectiveRatio, getPitchedLabelPlaneMatrix, hideGlyphs, projectWithMatrix, projectTileCoordinatesToClipSpace, projectTileCoordinatesToLabelPlane, type SymbolProjectionContext, updateLineLabels} from '../symbol/projection';\nimport {translatePosition} from '../util/util';\nimport type {ProjectionData} from '../geo/projection/projection_data';\n\ntype SymbolTileRenderState = {\n    segments: SegmentVector;\n    sortKey: number;\n    terrainData: TerrainData;\n    state: {\n        program: Program<any>;\n        buffers: SymbolBuffers;\n        uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>;\n        projectionData: ProjectionData;\n        atlasTexture: Texture;\n        atlasTextureIcon: Texture | null;\n        atlasInterpolation: TextureFilter;\n        atlasInterpolationIcon: TextureFilter;\n        isSDF: boolean;\n        hasHalo: boolean;\n    };\n};\n\nconst identityMat4 = mat4.identity(new Float32Array(16));\n\nexport function drawSymbols(painter: Painter, tileManager: TileManager, layer: SymbolStyleLayer, coords: Array<OverscaledTileID>, variableOffsets: {\n    [_ in CrossTileID]: VariableOffset;\n}, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\n    // Disable the stencil test so that labels aren't clipped to tile boundaries.\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n\n    // Compute variable-offsets before painting since icons and text data positioning\n    // depend on each other in this case.\n    if (hasVariablePlacement) {\n        updateVariableAnchors(coords, painter, layer, tileManager,\n            layer.layout.get('text-rotation-alignment'),\n            layer.layout.get('text-pitch-alignment'),\n            layer.paint.get('text-translate'),\n            layer.paint.get('text-translate-anchor'),\n            variableOffsets\n        );\n    }\n\n    if (layer.paint.get('icon-opacity').constantOr(1) !== 0) {\n        drawLayerSymbols(painter, tileManager, layer, coords, false,\n            layer.paint.get('icon-translate'),\n            layer.paint.get('icon-translate-anchor'),\n            layer.layout.get('icon-rotation-alignment'),\n            layer.layout.get('icon-pitch-alignment'),\n            layer.layout.get('icon-keep-upright'),\n            stencilMode, colorMode, isRenderingToTexture\n        );\n    }\n\n    if (layer.paint.get('text-opacity').constantOr(1) !== 0) {\n        drawLayerSymbols(painter, tileManager, layer, coords, true,\n            layer.paint.get('text-translate'),\n            layer.paint.get('text-translate-anchor'),\n            layer.layout.get('text-rotation-alignment'),\n            layer.layout.get('text-pitch-alignment'),\n            layer.layout.get('text-keep-upright'),\n            stencilMode, colorMode, isRenderingToTexture\n        );\n    }\n\n    if (tileManager.map.showCollisionBoxes) {\n        drawCollisionDebug(painter, tileManager, layer, coords, true);\n        drawCollisionDebug(painter, tileManager, layer, coords, false);\n    }\n}\n\nfunction calculateVariableRenderShift(\n    anchor: TextAnchor,\n    width: number,\n    height: number,\n    textOffset: [number, number],\n    textBoxScale: number,\n    renderTextSize: number): Point {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(anchor);\n    const shiftX = -(horizontalAlign - 0.5) * width;\n    const shiftY = -(verticalAlign - 0.5) * height;\n    return new Point(\n        (shiftX / textBoxScale + textOffset[0]) * renderTextSize,\n        (shiftY / textBoxScale + textOffset[1]) * renderTextSize\n    );\n}\n\nfunction updateVariableAnchors(coords: Array<OverscaledTileID>,\n    painter: Painter,\n    layer:SymbolStyleLayer, tileManager: TileManager,\n    rotationAlignment: SymbolLayerSpecification['layout']['text-rotation-alignment'],\n    pitchAlignment: SymbolLayerSpecification['layout']['text-pitch-alignment'],\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    variableOffsets: {[_ in CrossTileID]: VariableOffset}) {\n    const transform = painter.transform;\n    const terrain = painter.style.map.terrain;\n    const rotateWithMap = rotationAlignment === 'map';\n    const pitchWithMap = pitchAlignment === 'map';\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket = tile.getBucket(layer) as SymbolBucket;\n        if (!bucket || !bucket.text || !bucket.text.segments.get().length) continue;\n\n        const sizeData = bucket.textSizeData;\n        const size = evaluateSizeForZoom(sizeData, transform.zoom);\n\n        const pixelToTileScale = pixelsToTileUnits(tile, 1, painter.transform.zoom);\n        const pitchedLabelPlaneMatrix = getPitchedLabelPlaneMatrix(rotateWithMap, painter.transform, pixelToTileScale);\n        const updateTextFitIcon = layer.layout.get('icon-text-fit') !== 'none' && bucket.hasIconData();\n\n        if (size) {\n            const tileScale = Math.pow(2, transform.zoom - tile.tileID.overscaledZ);\n            const getElevation = terrain ? (x: number, y: number) => terrain.getElevation(coord, x, y) : null;\n            const translation = translatePosition(transform, tile, translate, translateAnchor);\n            updateVariableAnchorsForBucket(bucket, rotateWithMap, pitchWithMap, variableOffsets,\n                transform, pitchedLabelPlaneMatrix, tileScale, size, updateTextFitIcon, translation, coord.toUnwrapped(), getElevation);\n        }\n    }\n}\n\nfunction getShiftedAnchor(projectedAnchorPoint: Point, projectionContext: SymbolProjectionContext, rotateWithMap, shift: Point, transformAngle: number, pitchedTextShiftCorrection: number) {\n    // Usual case is that we take the projected anchor and add the pixel-based shift\n    // calculated earlier. In the (somewhat weird) case of pitch-aligned text, we add an equivalent\n    // tile-unit based shift to the anchor before projecting to the label plane.\n    const translatedAnchor = projectionContext.tileAnchorPoint.add(new Point(projectionContext.translation[0], projectionContext.translation[1]));\n    if (projectionContext.pitchWithMap) {\n        let adjustedShift = shift.mult(pitchedTextShiftCorrection);\n        if (!rotateWithMap) {\n            adjustedShift = adjustedShift.rotate(-transformAngle);\n        }\n        const tileAnchorShifted = translatedAnchor.add(adjustedShift);\n        return projectWithMatrix(tileAnchorShifted.x, tileAnchorShifted.y, projectionContext.pitchedLabelPlaneMatrix, projectionContext.getElevation).point;\n    } else {\n        if (rotateWithMap) {\n            // Compute the angle with which to rotate the anchor, so that it is aligned with\n            // the map's actual east-west axis. Very similar to what is done in the shader.\n            // Note that the label plane must be screen pixels here.\n            const projectedAnchorRight = projectTileCoordinatesToLabelPlane(projectionContext.tileAnchorPoint.x + 1, projectionContext.tileAnchorPoint.y, projectionContext);\n            const east = projectedAnchorRight.point.sub(projectedAnchorPoint);\n            const angle = Math.atan(east.y / east.x) + (east.x < 0 ? Math.PI : 0);\n            return projectedAnchorPoint.add(shift.rotate(angle));\n        } else {\n            return projectedAnchorPoint.add(shift);\n        }\n    }\n}\n\nfunction updateVariableAnchorsForBucket(\n    bucket: SymbolBucket,\n    rotateWithMap: boolean,\n    pitchWithMap: boolean,\n    variableOffsets: {[_ in CrossTileID]: VariableOffset},\n    transform: IReadonlyTransform,\n    pitchedLabelPlaneMatrix: mat4,\n    tileScale: number,\n    size: EvaluatedZoomSize,\n    updateTextFitIcon: boolean,\n    translation: [number, number],\n    unwrappedTileID: UnwrappedTileID,\n    getElevation: (x: number, y: number) => number) {\n    const placedSymbols = bucket.text.placedSymbolArray;\n    const dynamicTextLayoutVertexArray = bucket.text.dynamicLayoutVertexArray;\n    const dynamicIconLayoutVertexArray = bucket.icon.dynamicLayoutVertexArray;\n    const placedTextShifts = {};\n\n    dynamicTextLayoutVertexArray.clear();\n    for (let s = 0; s < placedSymbols.length; s++) {\n        const symbol = placedSymbols.get(s);\n        const skipOrientation = bucket.allowVerticalPlacement && !symbol.placedOrientation;\n        const variableOffset = (!symbol.hidden && symbol.crossTileID && !skipOrientation) ? variableOffsets[symbol.crossTileID] : null;\n\n        if (!variableOffset) {\n            // These symbols are from a justification that is not being used, or a label that wasn't placed\n            // so we don't need to do the extra math to figure out what incremental shift to apply.\n            hideGlyphs(symbol.numGlyphs, dynamicTextLayoutVertexArray);\n        } else  {\n            const tileAnchor = new Point(symbol.anchorX, symbol.anchorY);\n            const projectionContext: SymbolProjectionContext = {\n                getElevation,\n                width: transform.width,\n                height: transform.height,\n                pitchedLabelPlaneMatrix,\n                lineVertexArray: null,\n                pitchWithMap,\n                transform,\n                projectionCache: null,\n                tileAnchorPoint: tileAnchor,\n                translation,\n                unwrappedTileID\n            };\n            const projectedAnchor = pitchWithMap ?\n                projectTileCoordinatesToClipSpace(tileAnchor.x, tileAnchor.y, projectionContext) :\n                projectTileCoordinatesToLabelPlane(tileAnchor.x, tileAnchor.y, projectionContext);\n            const perspectiveRatio = getPerspectiveRatio(transform.cameraToCenterDistance, projectedAnchor.signedDistanceFromCamera);\n            let renderTextSize = evaluateSizeForFeature(bucket.textSizeData, size, symbol) * perspectiveRatio / ONE_EM;\n            if (pitchWithMap) {\n                // Go from size in pixels to equivalent size in tile units\n                renderTextSize *= bucket.tilePixelRatio / tileScale;\n            }\n\n            const {width, height, anchor, textOffset, textBoxScale} = variableOffset;\n            const shift = calculateVariableRenderShift(anchor, width, height, textOffset, textBoxScale, renderTextSize);\n\n            const pitchedTextCorrection = transform.getPitchedTextCorrection(tileAnchor.x + translation[0], tileAnchor.y + translation[1], unwrappedTileID);\n            const shiftedAnchor = getShiftedAnchor(projectedAnchor.point, projectionContext, rotateWithMap, shift, -transform.bearingInRadians, pitchedTextCorrection);\n\n            const angle = (bucket.allowVerticalPlacement && symbol.placedOrientation === WritingMode.vertical) ? Math.PI / 2 : 0;\n            for (let g = 0; g < symbol.numGlyphs; g++) {\n                addDynamicAttributes(dynamicTextLayoutVertexArray, shiftedAnchor, angle);\n            }\n            //Only offset horizontal text icons\n            if (updateTextFitIcon && symbol.associatedIconIndex >= 0) {\n                placedTextShifts[symbol.associatedIconIndex] = {shiftedAnchor, angle};\n            }\n        }\n    }\n\n    if (updateTextFitIcon) {\n        dynamicIconLayoutVertexArray.clear();\n        const placedIcons = bucket.icon.placedSymbolArray;\n        for (let i = 0; i < placedIcons.length; i++) {\n            const placedIcon = placedIcons.get(i);\n            if (placedIcon.hidden) {\n                hideGlyphs(placedIcon.numGlyphs, dynamicIconLayoutVertexArray);\n            } else {\n                const shift = placedTextShifts[i];\n                if (!shift) {\n                    hideGlyphs(placedIcon.numGlyphs, dynamicIconLayoutVertexArray);\n                } else {\n                    for (let g = 0; g < placedIcon.numGlyphs; g++) {\n                        addDynamicAttributes(dynamicIconLayoutVertexArray, shift.shiftedAnchor, shift.angle);\n                    }\n                }\n            }\n        }\n        bucket.icon.dynamicLayoutVertexBuffer.updateData(dynamicIconLayoutVertexArray);\n    }\n    bucket.text.dynamicLayoutVertexBuffer.updateData(dynamicTextLayoutVertexArray);\n}\n\nfunction getSymbolProgramName(isSDF: boolean, isText: boolean, bucket: SymbolBucket) {\n    if (bucket.iconsInText && isText) {\n        return 'symbolTextAndIcon';\n    } else if (isSDF) {\n        return 'symbolSDF';\n    } else {\n        return 'symbolIcon';\n    }\n}\n\nfunction drawLayerSymbols(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: SymbolStyleLayer,\n    coords: Array<OverscaledTileID>,\n    isText: boolean,\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    rotationAlignment: SymbolLayerSpecification['layout']['text-rotation-alignment'],\n    pitchAlignment: SymbolLayerSpecification['layout']['text-pitch-alignment'],\n    keepUpright: boolean,\n    stencilMode: StencilMode,\n    colorMode: Readonly<ColorMode>, \n    isRenderingToTexture: boolean) {\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    const rotateWithMap = rotationAlignment === 'map';\n    const pitchWithMap = pitchAlignment === 'map';\n    const alongLine = rotationAlignment !== 'viewport' && layer.layout.get('symbol-placement') !== 'point';\n    // Line label rotation happens in `updateLineLabels`\n    // Pitched point labels are automatically rotated by the pitchedLabelPlaneMatrix projection\n    // Unpitched point labels need to have their rotation applied after projection\n    const rotateInShader = rotateWithMap && !pitchWithMap && !alongLine;\n\n    const hasSortKey = !layer.layout.get('symbol-sort-key').isConstant();\n    let sortFeaturesByKey = false;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n\n    const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n\n    const tileRenderState: Array<SymbolTileRenderState> = [];\n\n    const pitchedTextRescaling = transform.getCircleRadiusCorrection();\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket = tile.getBucket(layer) as SymbolBucket;\n        if (!bucket) continue;\n        const buffers = isText ? bucket.text : bucket.icon;\n\n        if (!buffers || !buffers.segments.get().length || !buffers.hasVisibleVertices) continue;\n        const programConfiguration = buffers.programConfigurations.get(layer.id);\n\n        const isSDF = isText || bucket.sdfIcons;\n\n        const sizeData = isText ? bucket.textSizeData : bucket.iconSizeData;\n        const transformed = pitchWithMap || transform.pitch !== 0;\n\n        const program = painter.useProgram(getSymbolProgramName(isSDF, isText, bucket), programConfiguration);\n        const size = evaluateSizeForZoom(sizeData, transform.zoom);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n        let texSize: [number, number];\n        let texSizeIcon: [number, number] = [0, 0];\n        let atlasTexture: Texture;\n        let atlasInterpolation: TextureFilter;\n        let atlasTextureIcon = null;\n        let atlasInterpolationIcon: TextureFilter;\n        if (isText) {\n            atlasTexture = tile.glyphAtlasTexture;\n            atlasInterpolation = gl.LINEAR;\n            texSize = tile.glyphAtlasTexture.size;\n            if (bucket.iconsInText) {\n                texSizeIcon = tile.imageAtlasTexture.size;\n                atlasTextureIcon = tile.imageAtlasTexture;\n                const zoomDependentSize = sizeData.kind === 'composite' || sizeData.kind === 'camera';\n                atlasInterpolationIcon = transformed || painter.options.rotating || painter.options.zooming || zoomDependentSize ? gl.LINEAR : gl.NEAREST;\n            }\n        } else {\n            const iconScaled = layer.layout.get('icon-size').constantOr(0) !== 1 || bucket.iconsNeedLinear;\n            atlasTexture = tile.imageAtlasTexture;\n            atlasInterpolation = isSDF || painter.options.rotating || painter.options.zooming || iconScaled || transformed ?\n                gl.LINEAR :\n                gl.NEAREST;\n            texSize = tile.imageAtlasTexture.size;\n        }\n\n        // See the comment at the beginning of src/symbol/projection.ts for an overview of the symbol projection process\n        const s = pixelsToTileUnits(tile, 1, painter.transform.zoom);\n        const pitchedLabelPlaneMatrix = getPitchedLabelPlaneMatrix(rotateWithMap, painter.transform, s);\n        const pitchedLabelPlaneMatrixInverse = mat4.create();\n        mat4.invert(pitchedLabelPlaneMatrixInverse, pitchedLabelPlaneMatrix);\n        const glCoordMatrixForShader = getGlCoordMatrix(pitchWithMap, rotateWithMap, painter.transform, s);\n\n        const translation = translatePosition(transform, tile, translate, translateAnchor);\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n\n        const hasVariableAnchors = hasVariablePlacement && bucket.hasTextData();\n        const updateTextFitIcon = layer.layout.get('icon-text-fit') !== 'none' &&\n            hasVariableAnchors &&\n            bucket.hasIconData();\n\n        if (alongLine) {\n            const getElevation = painter.style.map.terrain ? (x: number, y: number) => painter.style.map.terrain.getElevation(coord, x, y) : null;\n            const rotateToLine = layer.layout.get('text-rotation-alignment') === 'map';\n            updateLineLabels(bucket, painter, isText, pitchedLabelPlaneMatrix, pitchedLabelPlaneMatrixInverse, pitchWithMap, keepUpright, rotateToLine, coord.toUnwrapped(), transform.width, transform.height, translation, getElevation);\n        }\n\n        const shaderVariableAnchor = (isText && hasVariablePlacement) || updateTextFitIcon;\n\n        // If the label plane matrix is used, it transforms either map-pitch-aligned pixels, or to screenspace pixels\n        const combinedLabelPlaneMatrix = pitchWithMap ? pitchedLabelPlaneMatrix : painter.transform.clipSpaceToPixelsMatrix;\n        // Label plane matrix is unused in the shader if variable anchors are used or the text is placed along a line\n        const noLabelPlane = (alongLine || shaderVariableAnchor);\n        const uLabelPlaneMatrix = noLabelPlane ? identityMat4 : combinedLabelPlaneMatrix;\n\n        const hasHalo = isSDF && layer.paint.get(isText ? 'text-halo-width' : 'icon-halo-width').constantOr(1) !== 0;\n\n        let uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>;\n        if (isSDF) {\n            if (!bucket.iconsInText) {\n                uniformValues = symbolSDFUniformValues(sizeData.kind,\n                    size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter,\n                    uLabelPlaneMatrix, glCoordMatrixForShader, translation, isText, texSize, true, pitchedTextRescaling);\n            } else {\n                uniformValues = symbolTextAndIconUniformValues(sizeData.kind,\n                    size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter,\n                    uLabelPlaneMatrix, glCoordMatrixForShader, translation, texSize, texSizeIcon, pitchedTextRescaling);\n            }\n        } else {\n            uniformValues = symbolIconUniformValues(sizeData.kind,\n                size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter,\n                uLabelPlaneMatrix, glCoordMatrixForShader, translation, isText, texSize, pitchedTextRescaling);\n        }\n\n        const state = {\n            program,\n            buffers,\n            uniformValues,\n            projectionData,\n            atlasTexture,\n            atlasTextureIcon,\n            atlasInterpolation,\n            atlasInterpolationIcon,\n            isSDF,\n            hasHalo\n        };\n\n        if (hasSortKey && bucket.canOverlap) {\n            sortFeaturesByKey = true;\n            const oldSegments = buffers.segments.get();\n            for (const segment of oldSegments) {\n                tileRenderState.push({\n                    segments: new SegmentVector([segment]),\n                    sortKey: segment.sortKey,\n                    state,\n                    terrainData\n                });\n            }\n        } else {\n            tileRenderState.push({\n                segments: buffers.segments,\n                sortKey: 0,\n                state,\n                terrainData\n            });\n        }\n    }\n\n    if (sortFeaturesByKey) {\n        tileRenderState.sort((a, b) => a.sortKey - b.sortKey);\n    }\n\n    for (const segmentState of tileRenderState) {\n        const state = segmentState.state;\n\n        context.activeTexture.set(gl.TEXTURE0);\n        state.atlasTexture.bind(state.atlasInterpolation, gl.CLAMP_TO_EDGE);\n        if (state.atlasTextureIcon) {\n            context.activeTexture.set(gl.TEXTURE1);\n            if (state.atlasTextureIcon) {\n                state.atlasTextureIcon.bind(state.atlasInterpolationIcon, gl.CLAMP_TO_EDGE);\n            }\n        }\n\n        if (state.isSDF) {\n            const uniformValues = state.uniformValues;\n            if (state.hasHalo) {\n                uniformValues['u_is_halo'] = 1;\n                drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, uniformValues, state.projectionData, segmentState.terrainData);\n            }\n            uniformValues['u_is_halo'] = 0;\n        }\n        drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, state.uniformValues, state.projectionData, segmentState.terrainData);\n    }\n}\n\nfunction drawSymbolElements(\n    buffers: SymbolBuffers,\n    segments: SegmentVector,\n    layer: SymbolStyleLayer,\n    painter: Painter,\n    program: Program<any>,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: StencilMode,\n    colorMode: Readonly<ColorMode>,\n    uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>,\n    projectionData: ProjectionData,\n    terrainData: TerrainData) {\n    const context = painter.context;\n    const gl = context.gl;\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n        uniformValues, terrainData, projectionData, layer.id, buffers.layoutVertexBuffer,\n        buffers.indexBuffer, segments, layer.paint,\n        painter.transform.zoom, buffers.programConfigurations.get(layer.id),\n        buffers.dynamicLayoutVertexBuffer, buffers.opacityVertexBuffer);\n}\n","import {Texture} from './texture';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {type Context} from '../gl/context';\nimport {type Framebuffer} from '../gl/framebuffer';\nimport {type Tile} from '../tile/tile';\nimport {\n    heatmapUniformValues,\n    heatmapTextureUniformValues\n} from './program/heatmap_program';\nimport {HEATMAP_FULL_RENDER_FBO_KEY} from '../style/style_layer/heatmap_style_layer';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {HeatmapStyleLayer} from '../style/style_layer/heatmap_style_layer';\nimport type {HeatmapBucket} from '../data/bucket/heatmap_bucket';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nexport function drawHeatmap(painter: Painter, tileManager: TileManager, layer: HeatmapStyleLayer, tileIDs: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (layer.paint.get('heatmap-opacity') === 0) {\n        return;\n    }\n    const context = painter.context;\n    const {isRenderingToTexture, isRenderingGlobe} = renderOptions;\n\n    if (painter.style.map.terrain) {\n        for (const coord of tileIDs) {\n            const tile = tileManager.getTile(coord);\n            // Skip tiles that have uncovered parents to avoid flickering; we don't need\n            // to use complex tile masking here because the change between zoom levels is subtle,\n            // so it's fine to simply render the parent until all its 4 children are loaded\n            if (tileManager.hasRenderableParent(coord)) continue;\n            if (painter.renderPass === 'offscreen') {\n                prepareHeatmapTerrain(painter, tile, layer, coord, isRenderingGlobe);\n            } else if (painter.renderPass === 'translucent') {\n                renderHeatmapTerrain(painter, layer, coord, isRenderingToTexture, isRenderingGlobe);\n            }\n        }\n        context.viewport.set([0, 0, painter.width, painter.height]);\n    } else {\n        if (painter.renderPass === 'offscreen') {\n            prepareHeatmapFlat(painter, tileManager, layer, tileIDs);\n        } else if (painter.renderPass === 'translucent') {\n            renderHeatmapFlat(painter, layer);\n        }\n\n    }\n}\n\nfunction prepareHeatmapFlat(painter: Painter, tileManager: TileManager, layer: HeatmapStyleLayer, coords: Array<OverscaledTileID>) {\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    // Allow kernels to be drawn across boundaries, so that\n    // large kernels are not clipped to tiles\n    const stencilMode = StencilMode.disabled;\n    // Turn on additive blending for kernels, which is a key aspect of kernel density estimation formula\n    const colorMode = new ColorMode([gl.ONE, gl.ONE], Color.transparent, [true, true, true, true]);\n\n    bindFramebuffer(context, painter, layer);\n\n    context.clear({color: Color.transparent});\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n\n        // Skip tiles that have uncovered parents to avoid flickering; we don't need\n        // to use complex tile masking here because the change between zoom levels is subtle,\n        // so it's fine to simply render the parent until all its 4 children are loaded\n        if (tileManager.hasRenderableParent(coord)) continue;\n\n        const tile = tileManager.getTile(coord);\n        const bucket: HeatmapBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram('heatmap', programConfiguration);\n\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: false});\n\n        const radiusCorrectionFactor = transform.getCircleRadiusCorrection();\n\n        program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.backCCW,\n            heatmapUniformValues(tile, transform.zoom, layer.paint.get('heatmap-intensity'), radiusCorrectionFactor),\n            null, projectionData,\n            layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n            bucket.segments, layer.paint, transform.zoom,\n            programConfiguration);\n    }\n\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\nfunction renderHeatmapFlat(painter: Painter, layer: HeatmapStyleLayer) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    context.setColorMode(painter.colorModeForRenderPass());\n\n    // Here we bind two different textures from which we'll sample in drawing\n    // heatmaps: the kernel texture, prepared in the offscreen pass, and a\n    // color ramp texture.\n    const fbo = layer.heatmapFbos.get(HEATMAP_FULL_RENDER_FBO_KEY);\n    if (!fbo) return;\n    context.activeTexture.set(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n    context.activeTexture.set(gl.TEXTURE1);\n    const colorRampTexture = getColorRampTexture(context, layer);\n    colorRampTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    painter.useProgram('heatmapTexture').draw(context, gl.TRIANGLES,\n        DepthMode.disabled, StencilMode.disabled, painter.colorModeForRenderPass(), CullFaceMode.disabled,\n        heatmapTextureUniformValues(painter, layer, 0, 1), null, null,\n        layer.id, painter.viewportBuffer, painter.quadTriangleIndexBuffer,\n        painter.viewportSegments, layer.paint, painter.transform.zoom);\n}\n\nfunction prepareHeatmapTerrain(painter: Painter, tile: Tile, layer: HeatmapStyleLayer, coord: OverscaledTileID, isRenderingGlobe: boolean) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const stencilMode = StencilMode.disabled;\n    // Turn on additive blending for kernels, which is a key aspect of kernel density estimation formula\n    const colorMode = new ColorMode([gl.ONE, gl.ONE], Color.transparent, [true, true, true, true]);\n\n    const bucket: HeatmapBucket = (tile.getBucket(layer) as any);\n    if (!bucket) return;\n\n    const tileKey = coord.key;\n    let fbo = layer.heatmapFbos.get(tileKey);\n    if (!fbo) {\n        fbo = createHeatmapFbo(context, tile.tileSize, tile.tileSize);\n        layer.heatmapFbos.set(tileKey, fbo);\n    }\n\n    context.bindFramebuffer.set(fbo.framebuffer);\n    context.viewport.set([0, 0, tile.tileSize, tile.tileSize]);\n\n    context.clear({color: Color.transparent});\n\n    const programConfiguration = bucket.programConfigurations.get(layer.id);\n    const program = painter.useProgram('heatmap', programConfiguration, !isRenderingGlobe);\n\n    const projectionData = painter.transform.getProjectionData({overscaledTileID: tile.tileID, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n    const terrainData = painter.style.map.terrain.getTerrainData(coord);\n    program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.disabled,\n        heatmapUniformValues(tile, painter.transform.zoom, layer.paint.get('heatmap-intensity'), 1.0), terrainData, projectionData,\n        layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n        bucket.segments, layer.paint, painter.transform.zoom,\n        programConfiguration);\n}\n\nfunction renderHeatmapTerrain(painter: Painter, layer: HeatmapStyleLayer, coord: OverscaledTileID, isRenderingToTexture: boolean, isRenderingGlobe: boolean) {\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    context.setColorMode(painter.colorModeForRenderPass());\n\n    const colorRampTexture = getColorRampTexture(context, layer);\n\n    // Here we bind two different textures from which we'll sample in drawing\n    // heatmaps: the kernel texture, prepared in the offscreen pass, and a\n    // color ramp texture.\n    const tileKey = coord.key;\n    const fbo = layer.heatmapFbos.get(tileKey);\n    if (!fbo) return;\n\n    context.activeTexture.set(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n    context.activeTexture.set(gl.TEXTURE1);\n    colorRampTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    const projectionData = transform.getProjectionData({overscaledTileID: coord, applyTerrainMatrix: isRenderingGlobe, applyGlobeMatrix: !isRenderingToTexture});\n\n    painter.useProgram('heatmapTexture').draw(context, gl.TRIANGLES,\n        DepthMode.disabled, StencilMode.disabled, painter.colorModeForRenderPass(), CullFaceMode.disabled,\n        heatmapTextureUniformValues(painter, layer, 0, 1), null, projectionData,\n        layer.id, painter.rasterBoundsBuffer, painter.quadTriangleIndexBuffer,\n        painter.rasterBoundsSegments, layer.paint, transform.zoom);\n\n    // destroy the FBO after rendering\n    fbo.destroy();\n    layer.heatmapFbos.delete(tileKey);\n}\n\nfunction bindFramebuffer(context: Context, painter: Painter, layer: HeatmapStyleLayer) {\n    const gl = context.gl;\n    context.activeTexture.set(gl.TEXTURE1);\n\n    // Use a 4x downscaled screen texture for better performance\n    context.viewport.set([0, 0, painter.width / 4, painter.height / 4]);\n\n    let fbo = layer.heatmapFbos.get(HEATMAP_FULL_RENDER_FBO_KEY);\n\n    if (!fbo) {\n        fbo = createHeatmapFbo(context, painter.width / 4, painter.height / 4);\n        layer.heatmapFbos.set(HEATMAP_FULL_RENDER_FBO_KEY, fbo);\n    } else {\n        gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n        context.bindFramebuffer.set(fbo.framebuffer);\n    }\n}\n\nfunction createHeatmapFbo(context: Context, width: number, height: number): Framebuffer {\n    const gl = context.gl;\n    const texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\n    // Use the higher precision half-float texture where available (producing much smoother looking heatmaps);\n    // Otherwise, fall back to a low precision texture\n    const numType = context.HALF_FLOAT ?? gl.UNSIGNED_BYTE;\n    const internalFormat = context.RGBA16F ?? gl.RGBA;\n\n    gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, width, height, 0, gl.RGBA, numType, null);\n\n    const fbo = context.createFramebuffer(width, height, false, false);\n    fbo.colorAttachment.set(texture);\n\n    return fbo;\n}\n\nfunction getColorRampTexture(context: Context, layer: HeatmapStyleLayer): Texture {\n    if (!layer.colorRampTexture) {\n        layer.colorRampTexture = new Texture(context, layer.colorRamp, context.gl.RGBA);\n    }\n    return layer.colorRampTexture;\n}\n","import {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Texture} from './texture';\nimport {\n    lineUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues,\n    lineGradientUniformValues,\n    lineGradientSDFUniformValues\n} from './program/line_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {LineStyleLayer} from '../style/style_layer/line_style_layer';\nimport type {LineBucket} from '../data/bucket/line_bucket';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Tile} from '../tile/tile';\nimport type {Context} from '../gl/context';\nimport type {ProgramConfiguration} from '../data/program_configuration';\nimport {clamp, nextPowerOfTwo} from '../util/util';\nimport {renderColorRamp} from '../util/color_ramp';\nimport {EXTENT} from '../data/extent';\nimport type {RGBAImage} from '../util/image';\n\ntype GradientTexture = {\n    texture?: Texture;\n    gradient?: RGBAImage;\n    version?: number;\n};\n\nfunction updateGradientTexture(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID,\n    layerGradient: GradientTexture\n): Texture {\n    let textureResolution = 256;\n    if (layer.stepInterpolant) {\n        const sourceMaxZoom = tileManager.getSource().maxzoom;\n        const potentialOverzoom = coord.canonical.z === sourceMaxZoom ?\n            Math.ceil(1 << (painter.transform.maxZoom - coord.canonical.z)) : 1;\n        const lineLength = bucket.maxLineLength / EXTENT;\n        // Logical pixel tile size is 512px, and 1024px right before current zoom + 1\n        const maxTilePixelSize = 1024;\n        // Maximum possible texture coverage heuristic, bound by hardware max texture size\n        const maxTextureCoverage = lineLength * maxTilePixelSize * potentialOverzoom;\n        textureResolution = clamp(nextPowerOfTwo(maxTextureCoverage), 256, context.maxTextureSize);\n    }\n    layerGradient.gradient = renderColorRamp({\n        expression: layer.gradientExpression(),\n        evaluationKey: 'lineProgress',\n        resolution: textureResolution,\n        image: layerGradient.gradient || undefined,\n        clips: bucket.lineClipsArray\n    });\n    if (layerGradient.texture) {\n        layerGradient.texture.update(layerGradient.gradient);\n    } else {\n        layerGradient.texture = new Texture(context, layerGradient.gradient, gl.RGBA);\n    }\n    layerGradient.version = layer.gradientVersion;\n    return layerGradient.texture;\n}\n\nfunction bindImagePatternTextures(\n    context: Context,\n    gl: WebGLRenderingContext,\n    tile: Tile,\n    programConfiguration: ProgramConfiguration,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    context.activeTexture.set(gl.TEXTURE0);\n    tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nfunction bindDasharrayTextures(\n    painter: Painter,\n    context: Context,\n    gl: WebGLRenderingContext,\n    programConfiguration: ProgramConfiguration,\n    programChanged: boolean,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    if (programChanged || painter.lineAtlas.dirty) {\n        context.activeTexture.set(gl.TEXTURE0);\n        painter.lineAtlas.bind(context);\n    }\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nfunction bindGradientTextures(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID\n) {\n    const layerGradient = bucket.gradients[layer.id];\n    let gradientTexture = layerGradient.texture;\n    if (layer.gradientVersion !== layerGradient.version) {\n        gradientTexture = updateGradientTexture(painter, tileManager, context, gl, layer, bucket, coord, layerGradient);\n    }\n    context.activeTexture.set(gl.TEXTURE0);\n    gradientTexture.bind(layer.stepInterpolant ? gl.NEAREST : gl.LINEAR, gl.CLAMP_TO_EDGE);\n}\n\nfunction bindGradientAndDashTextures(\n    painter: Painter,\n    tileManager: TileManager,\n    context: Context,\n    gl: WebGLRenderingContext,\n    layer: LineStyleLayer,\n    bucket: LineBucket,\n    coord: OverscaledTileID,\n    programConfiguration: ProgramConfiguration,\n    crossfade: ReturnType<LineStyleLayer['getCrossfadeParameters']>\n) {\n    // Bind gradient texture to TEXTURE0\n    const layerGradient = bucket.gradients[layer.id];\n    let gradientTexture = layerGradient.texture;\n    if (layer.gradientVersion !== layerGradient.version) {\n        gradientTexture = updateGradientTexture(painter, tileManager, context, gl, layer, bucket, coord, layerGradient);\n    }\n    context.activeTexture.set(gl.TEXTURE0);\n    gradientTexture.bind(layer.stepInterpolant ? gl.NEAREST : gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    // Bind dash atlas to TEXTURE1\n    context.activeTexture.set(gl.TEXTURE1);\n    painter.lineAtlas.bind(context);\n\n    programConfiguration.updatePaintBuffers(crossfade);\n}\n\nexport function drawLine(painter: Painter, tileManager: TileManager, layer: LineStyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\n\n    const opacity = layer.paint.get('line-opacity');\n    const width = layer.paint.get('line-width');\n    if (opacity.constantOr(1) === 0 || width.constantOr(1) === 0) return;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    const dasharrayProperty = layer.paint.get('line-dasharray');\n    const dasharray = dasharrayProperty.constantOr(1 as any);\n    const patternProperty = layer.paint.get('line-pattern');\n    const image = patternProperty.constantOr(1 as any);\n\n    const gradient = layer.paint.get('line-gradient');\n    const crossfade = layer.getCrossfadeParameters();\n\n    let programId: string;\n    if (image) programId = 'linePattern';\n    else if (dasharray && gradient) programId = 'lineGradientSDF';\n    else if (dasharray) programId = 'lineSDF';\n    else if (gradient) programId = 'lineGradient';\n    else programId = 'line';\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    let firstTile = true;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n\n        if (image && !tile.patternsLoaded()) continue;\n\n        const bucket: LineBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const prevProgram = painter.context.program.get();\n        const program = painter.useProgram(programId, programConfiguration);\n        const programChanged = firstTile || program.program !== prevProgram;\n        const terrainData = painter.style.map.terrain &&  painter.style.map.terrain.getTerrainData(coord);\n\n        const constantPattern = patternProperty.constantOr(null);\n        const constantDasharray = dasharrayProperty && dasharrayProperty.constantOr(null);\n\n        if (constantPattern && tile.imageAtlas) {\n            const atlas = tile.imageAtlas;\n            const posTo = atlas.patternPositions[constantPattern.to.toString()];\n            const posFrom = atlas.patternPositions[constantPattern.from.toString()];\n            if (posTo && posFrom) programConfiguration.setConstantPatternPositions(posTo, posFrom);\n\n        } else if (constantDasharray) {\n            const round = layer.layout.get('line-cap') === 'round';\n            const dashTo = painter.lineAtlas.getDash(constantDasharray.to, round);\n            const dashFrom = painter.lineAtlas.getDash(constantDasharray.from, round);\n            programConfiguration.setConstantDashPositions(dashTo, dashFrom);\n        }\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const pixelRatio = transform.getPixelScale();\n\n        let uniformValues;\n        if (image) {\n            uniformValues = linePatternUniformValues(painter, tile, layer, pixelRatio, crossfade);\n            bindImagePatternTextures(context, gl, tile, programConfiguration, crossfade);\n        } else if (dasharray && gradient) {\n            uniformValues = lineGradientSDFUniformValues(painter, tile, layer, pixelRatio, crossfade, bucket.lineClipsArray.length);\n            bindGradientAndDashTextures(painter, tileManager, context, gl, layer, bucket, coord, programConfiguration, crossfade);\n        } else if (dasharray) {\n            uniformValues = lineSDFUniformValues(painter, tile, layer, pixelRatio, crossfade);\n            bindDasharrayTextures(painter, context, gl, programConfiguration, programChanged, crossfade);\n        } else if (gradient) {\n            uniformValues = lineGradientUniformValues(painter, tile, layer, pixelRatio, bucket.lineClipsArray.length);\n            bindGradientTextures(painter, tileManager, context, gl, layer, bucket, coord);\n        } else {\n            uniformValues = lineUniformValues(painter, tile, layer, pixelRatio);\n        }\n\n        const stencil = painter.stencilModeForClipping(coord);\n\n        program.draw(context, gl.TRIANGLES, depthMode,\n            stencil, colorMode, CullFaceMode.disabled, uniformValues, terrainData, projectionData,\n            layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer, bucket.segments,\n            layer.paint, painter.transform.zoom, programConfiguration, bucket.layoutVertexBuffer2);\n\n        firstTile = false;\n        // once refactored so that bound texture state is managed, we'll also be able to remove this firstTile/programChanged logic\n    }\n}\n","import type {CrossFaded} from '../style/properties';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {Tile} from '../tile/tile';\nimport type {ProgramConfiguration} from '../data/program_configuration';\nimport type {FillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport type {FillStyleLayer} from '../style/style_layer/fill_style_layer';\n\n/**\n * A simple helper shared by draw_fill and draw_fill_extrusions to find the correct pattern positions AND update program.\n * For transitionable properties, especially 'fill-pattern' and 'fill-extrusion-pattern', while rendering certain frames\n * tile.imageAtlas has been updated by worker to hold the new pattern only, but rendering code is still looking for the previous image.\n * The mismatch was causing setConstantPatternPositions method not being called and pixelRatio was always the\n * default of 1, instead of actual values set by original map.addImage.\n *\n * @param programConfiguration - to be used to set pattern position and device pixel ratio.\n * @param propertyName - 'fill-pattern' or 'fill-extrusion-pattern' property key\n * @param constantPattern - either 'fill-pattern' or 'fill-extrusion-pattern' property value\n * @param tile - current tile being drawn\n * @param layer - current layer being rendered\n */\nexport function updatePatternPositionsInProgram(\n    programConfiguration: ProgramConfiguration,\n    propertyName: 'fill-pattern' | 'fill-extrusion-pattern',\n    constantPattern: CrossFaded<ResolvedImage>,\n    tile: Tile,\n    layer: FillStyleLayer | FillExtrusionStyleLayer): void {\n\n    if (!constantPattern || !tile || !tile.imageAtlas) {\n        return;\n    }\n\n    const patternPositions = tile.imageAtlas.patternPositions;\n    let posTo = patternPositions[constantPattern.to.toString()];\n    let posFrom = patternPositions[constantPattern.from.toString()];\n\n    // https://github.com/maplibre/maplibre-gl-js/issues/3377\n    if (!posTo && posFrom) posTo = posFrom;\n    if (!posFrom && posTo) posFrom = posTo;\n\n    // try again in case patternPositions has been updated by worker\n    if (!posTo || !posFrom) {\n        const transitioned = layer.getPaintProperty(propertyName) as string;\n        posTo = patternPositions[transitioned];\n        posFrom = patternPositions[transitioned];\n    }\n\n    if (posTo && posFrom) {\n        programConfiguration.setConstantPatternPositions(posTo, posFrom);\n    }\n}\n","import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {type ColorMode} from '../gl/color_mode';\nimport {\n    fillUniformValues,\n    fillPatternUniformValues,\n    fillOutlineUniformValues,\n    fillOutlinePatternUniformValues\n} from './program/fill_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {FillStyleLayer} from '../style/style_layer/fill_style_layer';\nimport type {FillBucket} from '../data/bucket/fill_bucket';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport {updatePatternPositionsInProgram} from './update_pattern_positions_in_program';\nimport {translatePosition} from '../util/util';\n\nexport function drawFill(painter: Painter, tileManager: TileManager, layer: FillStyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    const color = layer.paint.get('fill-color');\n    const opacity = layer.paint.get('fill-opacity');\n\n    if (opacity.constantOr(1) === 0) {\n        return;\n    }\n\n    const {isRenderingToTexture} = renderOptions;\n    const colorMode = painter.colorModeForRenderPass();\n    const pattern = layer.paint.get('fill-pattern');\n    const pass = painter.opaquePassEnabledForLayer() &&\n        (!pattern.constantOr(1 as any) &&\n            color.constantOr(Color.transparent).a === 1 &&\n            opacity.constantOr(0) === 1) ? 'opaque' : 'translucent';\n\n    // Draw fill\n    if (painter.renderPass === pass) {\n        const depthMode = painter.getDepthModeForSublayer(\n            1, painter.renderPass === 'opaque' ? DepthMode.ReadWrite : DepthMode.ReadOnly);\n        drawFillTiles(painter, tileManager, layer, coords, depthMode, colorMode, false, isRenderingToTexture);\n    }\n\n    // Draw stroke\n    if (painter.renderPass === 'translucent' && layer.paint.get('fill-antialias')) {\n\n        // If we defined a different color for the fill outline, we are\n        // going to ignore the bits in 0x07 and just care about the global\n        // clipping mask.\n        // Otherwise, we only want to drawFill the antialiased parts that are\n        // *outside* the current shape. This is important in case the fill\n        // or stroke color is translucent. If we wouldn't clip to outside\n        // the current shape, some pixels from the outline stroke overlapped\n        // the (non-antialiased) fill.\n        const depthMode = painter.getDepthModeForSublayer(\n            layer.getPaintProperty('fill-outline-color') ? 2 : 0, DepthMode.ReadOnly);\n        drawFillTiles(painter, tileManager, layer, coords, depthMode, colorMode, true, isRenderingToTexture);\n    }\n}\n\nfunction drawFillTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: FillStyleLayer,\n    coords: Array<OverscaledTileID>,\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    isOutline: boolean,\n    isRenderingToTexture: boolean) {\n    const gl = painter.context.gl;\n    const fillPropertyName = 'fill-pattern';\n    const patternProperty = layer.paint.get(fillPropertyName);\n    const image = patternProperty && patternProperty.constantOr(1 as any);\n    const crossfade = layer.getCrossfadeParameters();\n    let drawMode, programName, uniformValues, indexBuffer, segments;\n\n    const transform = painter.transform;\n\n    const propertyFillTranslate = layer.paint.get('fill-translate');\n    const propertyFillTranslateAnchor = layer.paint.get('fill-translate-anchor');\n\n    if (!isOutline) {\n        programName = image ? 'fillPattern' : 'fill';\n        drawMode = gl.TRIANGLES;\n    } else {\n        programName = image && !layer.getPaintProperty('fill-outline-color') ? 'fillOutlinePattern' : 'fillOutline';\n        drawMode = gl.LINES;\n    }\n\n    const constantPattern = patternProperty.constantOr(null);\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        if (image && !tile.patternsLoaded()) continue;\n\n        const bucket: FillBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram(programName, programConfiguration);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n        if (image) {\n            painter.context.activeTexture.set(gl.TEXTURE0);\n            tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            programConfiguration.updatePaintBuffers(crossfade);\n        }\n\n        updatePatternPositionsInProgram(programConfiguration, fillPropertyName, constantPattern, tile, layer);\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const translateForUniforms = translatePosition(transform, tile, propertyFillTranslate, propertyFillTranslateAnchor);\n\n        if (!isOutline) {\n            indexBuffer = bucket.indexBuffer;\n            segments = bucket.segments;\n            uniformValues = image ? fillPatternUniformValues(painter, crossfade, tile, translateForUniforms) : fillUniformValues(translateForUniforms);\n        } else {\n            indexBuffer = bucket.indexBuffer2;\n            segments = bucket.segments2;\n            const drawingBufferSize = [gl.drawingBufferWidth, gl.drawingBufferHeight] as [number, number];\n            uniformValues = (programName === 'fillOutlinePattern' && image) ?\n                fillOutlinePatternUniformValues(painter, crossfade, tile, drawingBufferSize, translateForUniforms) :\n                fillOutlineUniformValues(drawingBufferSize, translateForUniforms);\n        }\n\n        const stencil = painter.stencilModeForClipping(coord);\n\n        program.draw(painter.context, drawMode, depthMode,\n            stencil, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData,\n            layer.id, bucket.layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n","import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {\n    fillExtrusionUniformValues,\n    fillExtrusionPatternUniformValues,\n} from './program/fill_extrusion_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {FillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport type {FillExtrusionBucket} from '../data/bucket/fill_extrusion_bucket';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nimport {updatePatternPositionsInProgram} from './update_pattern_positions_in_program';\nimport {translatePosition} from '../util/util';\n\nexport function drawFillExtrusion(painter: Painter, tileManager: TileManager, layer: FillExtrusionStyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    const opacity = layer.paint.get('fill-extrusion-opacity');\n    if (opacity === 0) {\n        return;\n    }\n\n    const {isRenderingToTexture} = renderOptions;\n    if (painter.renderPass === 'translucent') {\n        const depthMode = new DepthMode(painter.context.gl.LEQUAL, DepthMode.ReadWrite, painter.depthRangeFor3D);\n\n        if (opacity === 1 && !layer.paint.get('fill-extrusion-pattern').constantOr(1 as any)) {\n            const colorMode = painter.colorModeForRenderPass();\n            drawExtrusionTiles(painter, tileManager, layer, coords, depthMode, StencilMode.disabled, colorMode, isRenderingToTexture);\n\n        } else {\n            // Draw transparent buildings in two passes so that only the closest surface is drawn.\n            // First draw all the extrusions into only the depth buffer. No colors are drawn.\n            drawExtrusionTiles(painter, tileManager, layer, coords, depthMode,\n                StencilMode.disabled,\n                ColorMode.disabled, isRenderingToTexture);\n\n            // Then draw all the extrusions a second type, only coloring fragments if they have the\n            // same depth value as the closest fragment in the previous pass. Use the stencil buffer\n            // to prevent the second draw in cases where we have coincident polygons.\n            drawExtrusionTiles(painter, tileManager, layer, coords, depthMode,\n                painter.stencilModeFor3D(),\n                painter.colorModeForRenderPass(), isRenderingToTexture);\n        }\n    }\n}\n\nfunction drawExtrusionTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: FillExtrusionStyleLayer,\n    coords: OverscaledTileID[],\n    depthMode: DepthMode,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>,\n    isRenderingToTexture: boolean) {\n    const context = painter.context;\n    const gl = context.gl;\n    const fillPropertyName = 'fill-extrusion-pattern';\n    const patternProperty = layer.paint.get(fillPropertyName);\n    const image = patternProperty.constantOr(1 as any);\n    const crossfade = layer.getCrossfadeParameters();\n    const opacity = layer.paint.get('fill-extrusion-opacity');\n    const constantPattern = patternProperty.constantOr(null);\n    const transform = painter.transform;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const bucket: FillExtrusionBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram(image ? 'fillExtrusionPattern' : 'fillExtrusion', programConfiguration);\n\n        if (image) {\n            painter.context.activeTexture.set(gl.TEXTURE0);\n            tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            programConfiguration.updatePaintBuffers(crossfade);\n        }\n\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n        updatePatternPositionsInProgram(programConfiguration, fillPropertyName, constantPattern, tile, layer);\n\n        const translate = translatePosition(\n            transform,\n            tile,\n            layer.paint.get('fill-extrusion-translate'),\n            layer.paint.get('fill-extrusion-translate-anchor')\n        );\n\n        const shouldUseVerticalGradient = layer.paint.get('fill-extrusion-vertical-gradient');\n        const uniformValues = image ?\n            fillExtrusionPatternUniformValues(painter, shouldUseVerticalGradient, opacity, translate, coord, crossfade, tile) :\n            fillExtrusionUniformValues(painter, shouldUseVerticalGradient, opacity, translate);\n\n        program.draw(context, context.gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n            bucket.segments, layer.paint, painter.transform.zoom,\n            programConfiguration, painter.style.map.terrain && bucket.centroidVertexBuffer);\n    }\n}\n","import {Texture} from './texture';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {type ColorMode} from '../gl/color_mode';\nimport {\n    hillshadeUniformValues,\n    hillshadeUniformPrepareValues\n} from './program/hillshade_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {HillshadeStyleLayer} from '../style/style_layer/hillshade_style_layer';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nexport function drawHillshade(painter: Painter, tileManager: TileManager, layer: HillshadeStyleLayer, tileIDs: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'offscreen' && painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const context = painter.context;\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    if (painter.renderPass === 'offscreen') {\n        // Prepare tiles\n        prepareHillshade(painter, tileManager, tileIDs, layer, depthMode, StencilMode.disabled, colorMode);\n        context.viewport.set([0, 0, painter.width, painter.height]);\n    } else if (painter.renderPass === 'translucent') {\n        // Globe (or any projection with subdivision) needs two-pass rendering to avoid artifacts when rendering texture tiles.\n        // See comments in draw_raster.ts for more details.\n        if (useSubdivision) {\n            // Two-pass rendering\n            const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n            renderHillshade(painter, tileManager, layer, coords, stencilBorderless, depthMode, colorMode, false, isRenderingToTexture); // draw without borders\n            renderHillshade(painter, tileManager, layer, coords, stencilBorders, depthMode, colorMode, true, isRenderingToTexture); // draw with borders\n        } else {\n            // Simple rendering\n            const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n            renderHillshade(painter, tileManager, layer, coords, stencil, depthMode, colorMode, false, isRenderingToTexture);\n        }\n    }\n}\n\nfunction renderHillshade(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: HillshadeStyleLayer,\n    coords: Array<OverscaledTileID>,\n    stencilModes: {[_: number]: Readonly<StencilMode>},\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    useBorder: boolean,\n    isRenderingToTexture: boolean\n) {\n    const projection = painter.style.projection;\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n\n    const defines = [`#define NUM_ILLUMINATION_SOURCES ${layer.paint.get('hillshade-highlight-color').values.length}`];\n    const program = painter.useProgram('hillshade', null, false, defines);\n    const align = !painter.options.moving;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const fbo = tile.fbo;\n        if (!fbo) {\n            continue;\n        }\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, true, 'raster');\n\n        const terrainData = painter.style.map.terrain?.getTerrainData(coord);\n\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            aligned: align,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilModes[coord.overscaledZ], colorMode, CullFaceMode.backCCW,\n            hillshadeUniformValues(painter, tile, layer), terrainData, projectionData, layer.id, mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n\n// hillshade rendering is done in two steps. the prepare step first calculates the slope of the terrain in the x and y\n// directions for each pixel, and saves those values to a framebuffer texture in the r and g channels.\nfunction prepareHillshade(\n    painter: Painter,\n    tileManager: TileManager,\n    tileIDs: Array<OverscaledTileID>,\n    layer: HillshadeStyleLayer,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>) {\n\n    const context = painter.context;\n    const gl = context.gl;\n\n    for (const coord of tileIDs) {\n        const tile = tileManager.getTile(coord);\n        const dem = tile.dem;\n\n        if (!dem || !dem.data) {\n            continue;\n        }\n\n        if (!tile.needsHillshadePrepare) {\n            continue;\n        }\n\n        const tileSize = dem.dim;\n        const textureStride = dem.stride;\n\n        const pixelData = dem.getPixels();\n        context.activeTexture.set(gl.TEXTURE1);\n\n        context.pixelStoreUnpackPremultiplyAlpha.set(false);\n        tile.demTexture = tile.demTexture || painter.getTileTexture(textureStride);\n        if (tile.demTexture) {\n            const demTexture = tile.demTexture;\n            demTexture.update(pixelData, {premultiply: false});\n            demTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n        } else {\n            tile.demTexture = new Texture(context, pixelData, gl.RGBA, {premultiply: false});\n            tile.demTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n        }\n\n        context.activeTexture.set(gl.TEXTURE0);\n\n        let fbo = tile.fbo;\n\n        if (!fbo) {\n            const renderTexture = new Texture(context, {width: tileSize, height: tileSize, data: null}, gl.RGBA);\n            renderTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n            fbo = tile.fbo = context.createFramebuffer(tileSize, tileSize, true, false);\n            fbo.colorAttachment.set(renderTexture.texture);\n        }\n\n        context.bindFramebuffer.set(fbo.framebuffer);\n        context.viewport.set([0, 0, tileSize, tileSize]);\n\n        painter.useProgram('hillshadePrepare').draw(context, gl.TRIANGLES,\n            depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n            hillshadeUniformPrepareValues(tile.tileID, dem),\n            null, null, layer.id, painter.rasterBoundsBuffer,\n            painter.quadTriangleIndexBuffer, painter.rasterBoundsSegments);\n\n        tile.needsHillshadePrepare = false;\n    }\n}\n","import {Texture} from './texture';\nimport type {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {type ColorMode} from '../gl/color_mode';\nimport {\n    colorReliefUniformValues\n} from './program/color_relief_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {ColorReliefStyleLayer} from '../style/style_layer/color_relief_style_layer';\nimport type {OverscaledTileID} from '../tile/tile_id';\n\nexport function drawColorRelief(painter: Painter, tileManager: TileManager, layer: ColorReliefStyleLayer, tileIDs: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n    if (!tileIDs.length) return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    // Globe (or any projection with subdivision) needs two-pass rendering to avoid artifacts when rendering texture tiles.\n    // See comments in draw_raster.ts for more details.\n    if (useSubdivision) {\n        // Two-pass rendering\n        const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n        renderColorRelief(painter, tileManager, layer, coords, stencilBorderless, depthMode, colorMode, false, isRenderingToTexture); // draw without borders\n        renderColorRelief(painter, tileManager, layer, coords, stencilBorders, depthMode, colorMode, true, isRenderingToTexture); // draw with borders\n    } else {\n        // Simple rendering\n        const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n        renderColorRelief(painter, tileManager, layer, coords, stencil, depthMode, colorMode, false, isRenderingToTexture);\n    }\n}\n\nfunction renderColorRelief(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: ColorReliefStyleLayer,\n    coords: Array<OverscaledTileID>,\n    stencilModes: {[_: number]: Readonly<StencilMode>},\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    useBorder: boolean,\n    isRenderingToTexture: boolean\n) {\n    const projection = painter.style.projection;\n    const context = painter.context;\n    const transform = painter.transform;\n    const gl = context.gl;\n    const program = painter.useProgram('colorRelief');\n    const align = !painter.options.moving;\n\n    let firstTile = true;\n    let colorRampSize = 0;\n\n    for (const coord of coords) {\n        const tile = tileManager.getTile(coord);\n        const dem = tile.dem;\n        if(firstTile) {\n            const maxLength = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n            const {elevationTexture, colorTexture} = layer.getColorRampTextures(context, maxLength, dem.getUnpackVector());\n            context.activeTexture.set(gl.TEXTURE1);\n            elevationTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n            context.activeTexture.set(gl.TEXTURE4);\n            colorTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            firstTile = false;\n            colorRampSize = elevationTexture.size[0];\n        }\n\n        if (!dem || !dem.data) {\n            continue;\n        }\n\n        const textureStride = dem.stride;\n\n        const pixelData = dem.getPixels();\n        context.activeTexture.set(gl.TEXTURE0);\n\n        context.pixelStoreUnpackPremultiplyAlpha.set(false);\n        tile.demTexture = tile.demTexture || painter.getTileTexture(textureStride);\n        if (tile.demTexture) {\n            const demTexture = tile.demTexture;\n            demTexture.update(pixelData, {premultiply: false});\n            demTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        } else {\n            tile.demTexture = new Texture(context, pixelData, gl.RGBA, {premultiply: false});\n            tile.demTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        }\n\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, true, 'raster');\n\n        const terrainData = painter.style.map.terrain?.getTerrainData(coord);\n\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: coord,\n            aligned: align,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilModes[coord.overscaledZ], colorMode, CullFaceMode.backCCW,\n            colorReliefUniformValues(layer, tile.dem, colorRampSize), terrainData, projectionData, layer.id, mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n","import {clamp} from '../util/util';\n\nimport {ImageSource} from '../source/image_source';\nimport {now} from '../util/time_control';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {rasterUniformValues} from './program/raster_program';\nimport {EXTENT} from '../data/extent';\nimport {FadingDirections} from '../tile/tile';\nimport Point from '@mapbox/point-geometry';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {RasterStyleLayer} from '../style/style_layer/raster_style_layer';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport type {Tile} from '../tile/tile';\n\ntype FadeProperties = {\n    parentTile: Tile;\n    parentScaleBy: number;\n    parentTopLeft: [number, number];\n    fadeValues: FadeValues;\n};\n\ntype FadeValues = {\n    tileOpacity: number;\n    parentTileOpacity?: number;\n    fadeMix: {opacity: number; mix: number};\n};\n\nconst cornerCoords = [\n    new Point(0, 0),\n    new Point(EXTENT, 0),\n    new Point(EXTENT, EXTENT),\n    new Point(0, EXTENT),\n];\n\nexport function drawRaster(painter: Painter, tileManager: TileManager, layer: RasterStyleLayer, tileIDs: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n    if (layer.paint.get('raster-opacity') === 0) return;\n    if (!tileIDs.length) return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const source = tileManager.getSource();\n\n    const projection = painter.style.projection;\n    const useSubdivision = projection.useSubdivision;\n\n    // When rendering globe (or any other subdivided projection), two passes are needed.\n    // Subdivided tiles with different granularities might have tiny gaps between them.\n    // To combat this, tile meshes for globe have a slight border region.\n    // However tiles borders will overlap, and a part of a tile often\n    // gets hidden by its neighbour's border, which displays an ugly stretched texture.\n    // To both hide the border stretch and avoid tiny gaps, tiles are first drawn without borders (with gaps),\n    // and then any missing pixels (gaps, not marked in stencil) get overdrawn with tile borders.\n    // This approach also avoids pixel shader overdraw, as any pixel is drawn at most once.\n\n    // Stencil mask and two-pass is not used for ImageSource sources regardless of projection.\n    if (source instanceof ImageSource) {\n        // Image source - no stencil is used\n        drawTiles(painter, tileManager, layer, tileIDs, null, false, false, source.tileCoords, source.flippedWindingOrder, isRenderingToTexture);\n    } else if (useSubdivision) {\n        // Two-pass rendering\n        const [stencilBorderless, stencilBorders, coords] = painter.stencilConfigForOverlapTwoPass(tileIDs);\n        drawTiles(painter, tileManager, layer, coords, stencilBorderless, false, true, cornerCoords, false, isRenderingToTexture); // draw without borders\n        drawTiles(painter, tileManager, layer, coords, stencilBorders, true, true, cornerCoords, false, isRenderingToTexture); // draw with borders\n    } else {\n        // Simple rendering\n        const [stencil, coords] = painter.getStencilConfigForOverlapAndUpdateStencilID(tileIDs);\n        drawTiles(painter, tileManager, layer, coords, stencil, false, true, cornerCoords, false, isRenderingToTexture);\n    }\n}\n\nfunction drawTiles(\n    painter: Painter,\n    tileManager: TileManager,\n    layer: RasterStyleLayer,\n    coords: Array<OverscaledTileID>,\n    stencilModes: {[_: number]: Readonly<StencilMode>} | null,\n    useBorder: boolean,\n    allowPoles: boolean,\n    corners: Array<Point>,\n    flipCullfaceMode: boolean = false,\n    isRenderingToTexture: boolean = false) {\n    const minTileZ = coords[coords.length - 1].overscaledZ;\n\n    const context = painter.context;\n    const gl = context.gl;\n    const program = painter.useProgram('raster');\n    const transform = painter.transform;\n\n    const projection = painter.style.projection;\n\n    const colorMode = painter.colorModeForRenderPass();\n    const align = !painter.options.moving;\n    const rasterOpacity = layer.paint.get('raster-opacity');\n    const rasterResampling = layer.paint.get('raster-resampling');\n    const fadeDuration = layer.paint.get('raster-fade-duration');\n    const isTerrain = !!painter.style.map.terrain;\n\n    // Draw all tiles\n    for (const coord of coords) {\n        // Set the lower zoom level to sublayer 0, and higher zoom levels to higher sublayers\n        // Use gl.LESS to prevent double drawing in areas where tiles overlap.\n        const depthMode = painter.getDepthModeForSublayer(coord.overscaledZ - minTileZ,\n            rasterOpacity === 1 ? DepthMode.ReadWrite : DepthMode.ReadOnly, gl.LESS);\n\n        const tile = tileManager.getTile(coord);\n        const textureFilter = rasterResampling === 'nearest' ?  gl.NEAREST : gl.LINEAR;\n\n        // create and bind first texture\n        context.activeTexture.set(gl.TEXTURE0);\n        tile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n\n        // create second texture - use either the current tile or fade tile to bind second texture below\n        context.activeTexture.set(gl.TEXTURE1);\n        const {parentTile, parentScaleBy, parentTopLeft, fadeValues} = getFadeProperties(tile, tileManager, fadeDuration, isTerrain);\n        tile.fadeOpacity = fadeValues.tileOpacity;\n        if (parentTile) {\n            parentTile.fadeOpacity = fadeValues.parentTileOpacity;\n            parentTile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n        } else {\n            tile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n        }\n\n        // Enable anisotropic filtering only when the pitch is greater than 20 degrees\n        // to preserve image sharpness on flat or slightly tilted maps.\n        if (tile.texture.useMipmap && context.extTextureFilterAnisotropic && painter.transform.pitch > 20) {\n            gl.texParameterf(gl.TEXTURE_2D, context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n                context.extTextureFilterAnisotropicMax);\n        }\n\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, aligned: align, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n        const uniformValues = rasterUniformValues(parentTopLeft, parentScaleBy, fadeValues.fadeMix, layer, corners);\n\n        const mesh = projection.getMeshFromTileID(context, coord.canonical, useBorder, allowPoles, 'raster');\n        const stencilMode = stencilModes ? stencilModes[coord.overscaledZ] : StencilMode.disabled;\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, flipCullfaceMode ? CullFaceMode.frontCCW : CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id, mesh.vertexBuffer,\n            mesh.indexBuffer, mesh.segments);\n    }\n}\n\n/**\n * Get fade properties for current tile - either cross-fading or self-fading properties.\n */\nfunction getFadeProperties(tile: Tile, tileManager: TileManager, fadeDuration: number, isTerrain: boolean): FadeProperties {\n    const defaults: FadeProperties = {\n        parentTile: null,\n        parentScaleBy: 1,\n        parentTopLeft: [0, 0],\n        fadeValues: {tileOpacity: 1, parentTileOpacity: 1, fadeMix: {opacity: 1, mix: 0}}\n    };\n\n    if (fadeDuration === 0 || isTerrain) return defaults;\n\n    // cross-fade with parent first if available\n    if (tile.fadingParentID) {\n        const parentTile = tileManager.getLoadedTile(tile.fadingParentID);\n        if (!parentTile) return defaults;\n\n        const parentScaleBy = Math.pow(2, parentTile.tileID.overscaledZ - tile.tileID.overscaledZ);\n        const parentTopLeft: [number, number] = [\n            (tile.tileID.canonical.x * parentScaleBy) % 1,\n            (tile.tileID.canonical.y * parentScaleBy) % 1\n        ];\n\n        const fadeValues = getCrossFadeValues(tile, parentTile, fadeDuration);\n        return {parentTile, parentScaleBy, parentTopLeft, fadeValues};\n    }\n\n    // self-fade for edge tiles\n    if (tile.selfFading) {\n        const fadeValues = getSelfFadeValues(tile, fadeDuration);\n        return {parentTile: null, parentScaleBy: 1, parentTopLeft: [0, 0], fadeValues};\n    }\n\n    return defaults;\n}\n\n/**\n * Cross-fade values for a base tile with a parent tile (for zooming in/out)\n */\nfunction getCrossFadeValues(tile: Tile, parentTile: Tile, fadeDuration: number): FadeValues {\n    const currentTime = now();\n\n    const timeSinceTile = (currentTime - tile.timeAdded) / fadeDuration;\n    const timeSinceParent = (currentTime - parentTile.timeAdded) / fadeDuration;\n\n    // get fading opacity based on current fade direction\n    const doFadeIn = (tile.fadingDirection === FadingDirections.Incoming);\n    const opacity1 = clamp(timeSinceTile, 0, 1);\n    const opacity2 = clamp(1 - timeSinceParent, 0, 1);\n\n    const tileOpacity = doFadeIn ? opacity1 : opacity2;\n    const parentTileOpacity = doFadeIn ? opacity2 : opacity1;\n    const fadeMix = {\n        opacity: 1,\n        mix: 1 - tileOpacity\n    };\n\n    return {tileOpacity, parentTileOpacity, fadeMix};\n}\n\n/**\n * Simple fade-in values for tile without a parent (i.e. edge tiles)\n */\nfunction getSelfFadeValues(tile: Tile, fadeDuration: number): FadeValues {\n    const currentTime = now();\n\n    const timeSinceTile = (currentTime - tile.timeAdded) / fadeDuration;\n    const tileOpacity = clamp(timeSinceTile, 0, 1);\n    const fadeMix = {\n        opacity: tileOpacity,\n        mix: 0\n    };\n\n    return {tileOpacity, fadeMix};\n}\n","import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {debugUniformValues} from './program/debug_program';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../gl/color_mode';\n\nimport type {Painter} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {OverscaledTileID} from '../tile/tile_id';\nimport {type Style} from '../style/style';\n\nconst topColor = new Color(1, 0, 0, 1);\nconst btmColor = new Color(0, 1, 0, 1);\nconst leftColor = new Color(0, 0, 1, 1);\nconst rightColor = new Color(1, 0, 1, 1);\nconst centerColor = new Color(0, 1, 1, 1);\n\nexport function drawDebugPadding(painter: Painter) {\n    const padding = painter.transform.padding;\n    const lineWidth = 3;\n    // Top\n    drawHorizontalLine(painter, painter.transform.height - (padding.top || 0), lineWidth, topColor);\n    // Bottom\n    drawHorizontalLine(painter, padding.bottom || 0, lineWidth, btmColor);\n    // Left\n    drawVerticalLine(painter, padding.left || 0, lineWidth, leftColor);\n    // Right\n    drawVerticalLine(painter, painter.transform.width - (padding.right || 0), lineWidth, rightColor);\n    // Center\n    const center = painter.transform.centerPoint;\n    drawCrosshair(painter, center.x, painter.transform.height - center.y, centerColor);\n}\n\nfunction drawCrosshair(painter: Painter, x: number, y: number, color: Color) {\n    const size = 20;\n    const lineWidth = 2;\n    //Vertical line\n    drawDebugSSRect(painter, x - lineWidth / 2, y - size / 2, lineWidth, size, color);\n    //Horizontal line\n    drawDebugSSRect(painter, x - size / 2, y - lineWidth / 2, size, lineWidth, color);\n}\n\nfunction drawHorizontalLine(painter: Painter, y: number, lineWidth: number, color: Color) {\n    drawDebugSSRect(painter, 0, y  + lineWidth / 2, painter.transform.width,  lineWidth, color);\n}\n\nfunction drawVerticalLine(painter: Painter, x: number, lineWidth: number, color: Color) {\n    drawDebugSSRect(painter, x - lineWidth / 2, 0, lineWidth,  painter.transform.height, color);\n}\n\nfunction drawDebugSSRect(painter: Painter, x: number, y: number, width: number, height: number, color: Color) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    gl.enable(gl.SCISSOR_TEST);\n    gl.scissor(x * painter.pixelRatio, y * painter.pixelRatio, width * painter.pixelRatio, height * painter.pixelRatio);\n    context.clear({color});\n    gl.disable(gl.SCISSOR_TEST);\n}\n\nexport function drawDebug(painter: Painter, tileManager: TileManager, coords: Array<OverscaledTileID>) {\n    for (let i = 0; i < coords.length; i++) {\n        drawDebugTile(painter, tileManager, coords[i]);\n    }\n}\n\nfunction drawDebugTile(painter: Painter, tileManager: TileManager, coord: OverscaledTileID) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const program = painter.useProgram('debug');\n\n    const depthMode = DepthMode.disabled;\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const id = '$debug';\n    const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n    context.activeTexture.set(gl.TEXTURE0);\n\n    const tileRawData = tileManager.getTileByID(coord.key).latestRawTileData;\n    const tileByteLength = (tileRawData && tileRawData.byteLength) || 0;\n    const tileSizeKb = Math.floor(tileByteLength / 1024);\n    const tileSize = tileManager.getTile(coord).tileSize;\n    const scaleRatio = (512 / Math.min(tileSize, 512) * (coord.overscaledZ / painter.transform.zoom)) * 0.5;\n    let tileIdText = coord.canonical.toString();\n    if (coord.overscaledZ !== coord.canonical.z) {\n        tileIdText += ` => ${coord.overscaledZ}`;\n    }\n    const tileLabel = `${tileIdText} ${tileSizeKb}kB`;\n    drawTextToOverlay(painter, tileLabel);\n\n    const projectionData = painter.transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, ColorMode.alphaBlended, CullFaceMode.disabled,\n        debugUniformValues(Color.transparent, scaleRatio), null, projectionData, id,\n        painter.debugBuffer, painter.quadTriangleIndexBuffer, painter.debugSegments);\n    program.draw(context, gl.LINE_STRIP, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n        debugUniformValues(Color.red), terrainData, projectionData, id,\n        painter.debugBuffer, painter.tileBorderIndexBuffer, painter.debugSegments);\n}\n\nfunction drawTextToOverlay(painter: Painter, text: string) {\n    painter.initDebugOverlayCanvas();\n    const canvas = painter.debugOverlayCanvas;\n    const gl = painter.context.gl;\n    const ctx2d = painter.debugOverlayCanvas.getContext('2d');\n    ctx2d.clearRect(0, 0, canvas.width, canvas.height);\n\n    ctx2d.shadowColor = 'white';\n    ctx2d.shadowBlur = 2;\n    ctx2d.lineWidth = 1.5;\n    ctx2d.strokeStyle = 'white';\n    ctx2d.textBaseline = 'top';\n    ctx2d.font = `bold ${36}px Open Sans, sans-serif`;\n    ctx2d.fillText(text, 5, 5);\n    ctx2d.strokeText(text, 5, 5);\n\n    painter.debugOverlayTexture.update(canvas);\n    painter.debugOverlayTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n}\n\nexport function selectDebugSource(style: Style, zoom: number): TileManager | null {\n    // Use vector source with highest maxzoom\n    // Else use source with highest maxzoom of any type\n    let selectedSource: TileManager = null;\n    const layers = Object.values(style._layers);\n    const sources = layers.flatMap((layer) => {\n        if (layer.source && !layer.isHidden(zoom)) {\n            const tileManager = style.tileManagers[layer.source];\n            return [tileManager];\n        } else {\n            return [];\n        }\n    });\n    const vectorSources = sources.filter((source) => source.getSource().type === 'vector');\n    const otherSources = sources.filter((source) => source.getSource().type !== 'vector');\n    const considerSource = (source: TileManager) => {\n        if (!selectedSource || (selectedSource.getSource().maxzoom < source.getSource().maxzoom)) {\n            selectedSource = source;\n        }\n    };\n    vectorSources.forEach((source) => considerSource(source));\n    if (!selectedSource) {\n        otherSources.forEach((source) => considerSource(source));\n    }\n    return selectedSource;\n}\n","import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {terrainUniformValues, terrainDepthUniformValues, terrainCoordsUniformValues} from './program/terrain_program';\nimport type {Painter, RenderOptions} from './painter';\nimport type {Tile} from '../tile/tile';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../gl/color_mode';\nimport {type Terrain} from './terrain';\n\n/**\n * Redraw the Depth Framebuffer\n * @param painter - the painter\n * @param terrain - the terrain\n */\nfunction drawDepth(painter: Painter, terrain: Terrain) {\n    const context = painter.context;\n    const gl = context.gl;\n    const tr = painter.transform;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const tiles = terrain.tileManager.getRenderableTiles();\n    const program = painter.useProgram('terrainDepth');\n    context.bindFramebuffer.set(terrain.getFramebuffer('depth').framebuffer);\n    context.viewport.set([0, 0, painter.width  / devicePixelRatio, painter.height / devicePixelRatio]);\n    context.clear({color: Color.transparent, depth: 1});\n    for (const tile of tiles) {\n        const mesh = terrain.getTerrainMesh(tile.tileID);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        const uniformValues = terrainDepthUniformValues(terrain.getMeshFrameDelta(tr.zoom));\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\n/**\n * Redraw the Coords Framebuffers\n * @param painter - the painter\n * @param terrain - the terrain\n */\nfunction drawCoords(painter: Painter, terrain: Terrain) {\n    const context = painter.context;\n    const gl = context.gl;\n    const tr = painter.transform;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const coords = terrain.getCoordsTexture();\n    const tiles = terrain.tileManager.getRenderableTiles();\n\n    // draw tile-coords into framebuffer\n    const program = painter.useProgram('terrainCoords');\n    context.bindFramebuffer.set(terrain.getFramebuffer('coords').framebuffer);\n    context.viewport.set([0, 0, painter.width  / devicePixelRatio, painter.height / devicePixelRatio]);\n    context.clear({color: Color.transparent, depth: 1});\n    terrain.coordsIndex = [];\n    for (const tile of tiles) {\n        const mesh = terrain.getTerrainMesh(tile.tileID);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, coords.texture);\n        const uniformValues = terrainCoordsUniformValues(255 - terrain.coordsIndex.length, terrain.getMeshFrameDelta(tr.zoom));\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n        terrain.coordsIndex.push(tile.tileID.key);\n    }\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\nfunction drawTerrain(painter: Painter, terrain: Terrain, tiles: Array<Tile>, renderOptions: RenderOptions) {\n    const {isRenderingGlobe} = renderOptions;\n    const context = painter.context;\n    const gl = context.gl;\n    const tr = painter.transform;\n    const colorMode = painter.colorModeForRenderPass();\n    const depthMode = painter.getDepthModeFor3D();\n    const program = painter.useProgram('terrain');\n\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n\n    for (const tile of tiles) {\n        const mesh = terrain.getTerrainMesh(tile.tileID);\n        const texture = painter.renderToTexture.getTexture(tile);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, texture.texture);\n        const eleDelta = terrain.getMeshFrameDelta(tr.zoom);\n        const fogMatrix = tr.calculateFogMatrix(tile.tileID.toUnwrapped());\n        const uniformValues = terrainUniformValues(eleDelta, fogMatrix, painter.style.sky, tr.pitch, isRenderingGlobe);\n        const projectionData = tr.getProjectionData({overscaledTileID: tile.tileID, applyTerrainMatrix: false, applyGlobeMatrix: true});\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, projectionData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n\nexport {\n    drawTerrain,\n    drawDepth,\n    drawCoords\n};\n","import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {PosArray, TriangleIndexArray} from '../data/array_types.g';\nimport posAttributes from '../data/pos_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {skyUniformValues} from './program/sky_program';\nimport {atmosphereUniformValues} from './program/atmosphere_program';\nimport {type Sky} from '../style/sky';\nimport {type Light} from '../style/light';\nimport {Mesh} from './mesh';\nimport {mat4, vec3, vec4} from 'gl-matrix';\nimport {type IReadonlyTransform} from '../geo/transform_interface';\nimport {ColorMode} from '../gl/color_mode';\nimport type {Painter} from './painter';\nimport {type Context} from '../gl/context';\nimport {getGlobeRadiusPixels} from '../geo/projection/globe_utils';\n\nfunction getMesh(context: Context, sky: Sky): Mesh {\n    // Create the Sky mesh the first time we need it\n    if (!sky.mesh) {\n        const vertexArray = new PosArray();\n        vertexArray.emplaceBack(-1, -1);\n        vertexArray.emplaceBack(1, -1);\n        vertexArray.emplaceBack(1, 1);\n        vertexArray.emplaceBack(-1, 1);\n\n        const indexArray = new TriangleIndexArray();\n        indexArray.emplaceBack(0, 1, 2);\n        indexArray.emplaceBack(0, 2, 3);\n\n        sky.mesh = new Mesh(\n            context.createVertexBuffer(vertexArray, posAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n    }\n\n    return sky.mesh;\n}\n\nexport function drawSky(painter: Painter, sky: Sky) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const skyUniforms = skyUniformValues(sky, painter.style.map.transform, painter.pixelRatio);\n\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const program = painter.useProgram('sky');\n\n    const mesh = getMesh(context, sky);\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode,\n        CullFaceMode.disabled, skyUniforms, null, undefined, 'sky', mesh.vertexBuffer,\n        mesh.indexBuffer, mesh.segments);\n}\n\nfunction getSunPos(light: Light, transform: IReadonlyTransform): vec3 {\n    const _lp = light.properties.get('position');\n    const lightPos = [-_lp.x, -_lp.y, -_lp.z] as vec3;\n\n    const lightMat = mat4.identity(new Float64Array(16) as any);\n\n    if (light.properties.get('anchor') === 'map') {\n        mat4.rotateZ(lightMat, lightMat, transform.rollInRadians);\n        mat4.rotateX(lightMat, lightMat, -transform.pitchInRadians);\n        mat4.rotateZ(lightMat, lightMat, transform.bearingInRadians);\n        mat4.rotateX(lightMat, lightMat, transform.center.lat * Math.PI / 180.0);\n        mat4.rotateY(lightMat, lightMat, -transform.center.lng * Math.PI / 180.0);\n    }\n\n    vec3.transformMat4(lightPos, lightPos, lightMat);\n\n    return lightPos;\n}\n\nexport function drawAtmosphere(painter: Painter, sky: Sky, light: Light) {\n    const context = painter.context;\n    const gl = context.gl;\n    const program = painter.useProgram('atmosphere');\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadOnly, [0, 1]);\n    const transform = painter.transform;\n\n    const sunPos = getSunPos(light, painter.transform);\n\n    const projectionData = transform.getProjectionData({overscaledTileID: null, applyGlobeMatrix: true, applyTerrainMatrix: true});\n    const atmosphereBlend = sky.properties.get('atmosphere-blend') * projectionData.projectionTransition;\n\n    if (atmosphereBlend === 0) {\n        // Don't draw anything if atmosphere is fully transparent\n        return;\n    }\n\n    const globeRadius = getGlobeRadiusPixels(transform.worldSize, transform.center.lat);\n    const invProjMatrix = transform.inverseProjectionMatrix;\n    const vec = new Float64Array(4) as any as vec4;\n    vec[3] = 1;\n    vec4.transformMat4(vec, vec, transform.modelViewProjectionMatrix);\n    vec[0] /= vec[3];\n    vec[1] /= vec[3];\n    vec[2] /= vec[3];\n    vec[3] = 1;\n    vec4.transformMat4(vec, vec, invProjMatrix);\n    vec[0] /= vec[3];\n    vec[1] /= vec[3];\n    vec[2] /= vec[3];\n    vec[3] = 1;\n    const globePosition = [vec[0], vec[1], vec[2]] as vec3;\n\n    const uniformValues = atmosphereUniformValues(sunPos, atmosphereBlend, globePosition, globeRadius, invProjMatrix);\n\n    const mesh = getMesh(context, sky);\n\n    program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, ColorMode.alphaBlended, CullFaceMode.disabled, uniformValues, null, null, 'atmosphere', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n}\n","import {now} from '../util/time_control';\nimport {mat4} from 'gl-matrix';\nimport {TileManager} from '../tile/tile_manager';\nimport {EXTENT} from '../data/extent';\nimport {SegmentVector} from '../data/segment';\nimport {RasterBoundsArray, PosArray, TriangleIndexArray, LineStripIndexArray} from '../data/array_types.g';\nimport rasterBoundsAttributes from '../data/raster_bounds_attributes';\nimport posAttributes from '../data/pos_attributes';\nimport {type ProgramConfiguration} from '../data/program_configuration';\nimport {CrossTileSymbolIndex} from '../symbol/cross_tile_symbol_index';\nimport {shaders} from '../shaders/shaders';\nimport {Program} from './program';\nimport {programUniforms} from './program/program_uniforms';\nimport {Context} from '../gl/context';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Texture} from './texture';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {drawSymbols} from './draw_symbol';\nimport {drawCircles} from './draw_circle';\nimport {drawHeatmap} from './draw_heatmap';\nimport {drawLine} from './draw_line';\nimport {drawFill} from './draw_fill';\nimport {drawFillExtrusion} from './draw_fill_extrusion';\nimport {drawHillshade} from './draw_hillshade';\nimport {drawColorRelief} from './draw_color_relief';\nimport {drawRaster} from './draw_raster';\nimport {drawBackground} from './draw_background';\nimport {drawDebug, drawDebugPadding, selectDebugSource} from './draw_debug';\nimport {drawCustom} from './draw_custom';\nimport {drawDepth, drawCoords} from './draw_terrain';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport {drawSky, drawAtmosphere} from './draw_sky';\nimport {Mesh} from './mesh';\nimport {MercatorShaderDefine, MercatorShaderVariantKey} from '../geo/projection/mercator_projection';\n\nimport type {IReadonlyTransform} from '../geo/transform_interface';\nimport type {Style} from '../style/style';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CrossFaded} from '../style/properties';\nimport type {LineAtlas} from './line_atlas';\nimport type {ImageManager} from './image_manager';\nimport type {GlyphManager} from './glyph_manager';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {DepthRangeType, DepthMaskType, DepthFuncType} from '../gl/types';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {RenderToTexture} from './render_to_texture';\nimport type {ProjectionData} from '../geo/projection/projection_data';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport {isSymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport {isCircleStyleLayer} from '../style/style_layer/circle_style_layer';\nimport {isHeatmapStyleLayer} from '../style/style_layer/heatmap_style_layer';\nimport {isLineStyleLayer} from '../style/style_layer/line_style_layer';\nimport {isFillStyleLayer} from '../style/style_layer/fill_style_layer';\nimport {isFillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport {isHillshadeStyleLayer} from '../style/style_layer/hillshade_style_layer';\nimport {isColorReliefStyleLayer} from '../style/style_layer/color_relief_style_layer';\nimport {isRasterStyleLayer} from '../style/style_layer/raster_style_layer';\nimport {isBackgroundStyleLayer} from '../style/style_layer/background_style_layer';\nimport {isCustomStyleLayer} from '../style/style_layer/custom_style_layer';\n\nexport type RenderPass = 'offscreen' | 'opaque' | 'translucent';\n\ntype PainterOptions = {\n    showOverdrawInspector: boolean;\n    showTileBoundaries: boolean;\n    showPadding: boolean;\n    rotating: boolean;\n    zooming: boolean;\n    moving: boolean;\n    fadeDuration: number;\n};\n\nexport type RenderOptions = {\n    isRenderingToTexture: boolean;\n    isRenderingGlobe: boolean;\n};\n\n/**\n * @internal\n * Initialize a new painter object.\n */\nexport class Painter {\n    context: Context;\n    transform: IReadonlyTransform;\n    renderToTexture: RenderToTexture;\n    _tileTextures: {\n        [_: number]: Array<Texture>;\n    };\n    numSublayers: number;\n    depthEpsilon: number;\n    emptyProgramConfiguration: ProgramConfiguration;\n    width: number;\n    height: number;\n    pixelRatio: number;\n    tileExtentBuffer: VertexBuffer;\n    tileExtentSegments: SegmentVector;\n    tileExtentMesh: Mesh;\n\n    debugBuffer: VertexBuffer;\n    debugSegments: SegmentVector;\n    rasterBoundsBuffer: VertexBuffer;\n    rasterBoundsSegments: SegmentVector;\n    rasterBoundsBufferPosOnly: VertexBuffer;\n    rasterBoundsSegmentsPosOnly: SegmentVector;\n    viewportBuffer: VertexBuffer;\n    viewportSegments: SegmentVector;\n    quadTriangleIndexBuffer: IndexBuffer;\n    tileBorderIndexBuffer: IndexBuffer;\n    _tileClippingMaskIDs: {[_: string]: number};\n    stencilClearMode: StencilMode;\n    style: Style;\n    options: PainterOptions;\n    lineAtlas: LineAtlas;\n    imageManager: ImageManager;\n    glyphManager: GlyphManager;\n    depthRangeFor3D: DepthRangeType;\n    opaquePassCutoff: number;\n    renderPass: RenderPass;\n    currentLayer: number;\n    currentStencilSource: string;\n    nextStencilID: number;\n    id: string;\n    _showOverdrawInspector: boolean;\n    cache: {[_: string]: Program<any>};\n    crossTileSymbolIndex: CrossTileSymbolIndex;\n    symbolFadeChange: number;\n    debugOverlayTexture: Texture;\n    debugOverlayCanvas: HTMLCanvasElement;\n    // this object stores the current camera-matrix and the last render time\n    // of the terrain-facilitators. e.g. depth & coords framebuffers\n    // every time the camera-matrix changes the terrain-facilitators will be redrawn.\n    terrainFacilitator: {dirty: boolean; matrix: mat4; renderTime: number};\n\n    constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, transform: IReadonlyTransform) {\n        this.context = new Context(gl);\n        this.transform = transform;\n        this._tileTextures = {};\n        this.terrainFacilitator = {dirty: true, matrix: mat4.identity(new Float64Array(16) as any), renderTime: 0};\n\n        this.setup();\n\n        // Within each layer there are multiple distinct z-planes that can be drawn to.\n        // This is implemented using the WebGL depth buffer.\n        this.numSublayers = TileManager.maxOverzooming + TileManager.maxUnderzooming + 1;\n        this.depthEpsilon = 1 / Math.pow(2, 16);\n\n        this.crossTileSymbolIndex = new CrossTileSymbolIndex();\n    }\n\n    /*\n     * Update the GL viewport, projection matrix, and transforms to compensate\n     * for a new width and height value.\n     */\n    resize(width: number, height: number, pixelRatio: number) {\n        this.width = Math.floor(width * pixelRatio);\n        this.height = Math.floor(height * pixelRatio);\n        this.pixelRatio = pixelRatio;\n        this.context.viewport.set([0, 0, this.width, this.height]);\n\n        if (this.style) {\n            for (const layerId of this.style._order) {\n                this.style._layers[layerId].resize();\n            }\n        }\n    }\n\n    setup() {\n        const context = this.context;\n\n        const tileExtentArray = new PosArray();\n        tileExtentArray.emplaceBack(0, 0);\n        tileExtentArray.emplaceBack(EXTENT, 0);\n        tileExtentArray.emplaceBack(0, EXTENT);\n        tileExtentArray.emplaceBack(EXTENT, EXTENT);\n        this.tileExtentBuffer = context.createVertexBuffer(tileExtentArray, posAttributes.members);\n        this.tileExtentSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const debugArray = new PosArray();\n        debugArray.emplaceBack(0, 0);\n        debugArray.emplaceBack(EXTENT, 0);\n        debugArray.emplaceBack(0, EXTENT);\n        debugArray.emplaceBack(EXTENT, EXTENT);\n        this.debugBuffer = context.createVertexBuffer(debugArray, posAttributes.members);\n        this.debugSegments = SegmentVector.simpleSegment(0, 0, 4, 5);\n\n        const rasterBoundsArray = new RasterBoundsArray();\n        rasterBoundsArray.emplaceBack(0, 0, 0, 0);\n        rasterBoundsArray.emplaceBack(EXTENT, 0, EXTENT, 0);\n        rasterBoundsArray.emplaceBack(0, EXTENT, 0, EXTENT);\n        rasterBoundsArray.emplaceBack(EXTENT, EXTENT, EXTENT, EXTENT);\n        this.rasterBoundsBuffer = context.createVertexBuffer(rasterBoundsArray, rasterBoundsAttributes.members);\n        this.rasterBoundsSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const rasterBoundsArrayPosOnly = new PosArray();\n        rasterBoundsArrayPosOnly.emplaceBack(0, 0);\n        rasterBoundsArrayPosOnly.emplaceBack(EXTENT, 0);\n        rasterBoundsArrayPosOnly.emplaceBack(0, EXTENT);\n        rasterBoundsArrayPosOnly.emplaceBack(EXTENT, EXTENT);\n        this.rasterBoundsBufferPosOnly = context.createVertexBuffer(rasterBoundsArrayPosOnly, posAttributes.members);\n        this.rasterBoundsSegmentsPosOnly = SegmentVector.simpleSegment(0, 0, 4, 5);\n\n        const viewportArray = new PosArray();\n        viewportArray.emplaceBack(0, 0);\n        viewportArray.emplaceBack(1, 0);\n        viewportArray.emplaceBack(0, 1);\n        viewportArray.emplaceBack(1, 1);\n        this.viewportBuffer = context.createVertexBuffer(viewportArray, posAttributes.members);\n        this.viewportSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const tileLineStripIndices = new LineStripIndexArray();\n        tileLineStripIndices.emplaceBack(0);\n        tileLineStripIndices.emplaceBack(1);\n        tileLineStripIndices.emplaceBack(3);\n        tileLineStripIndices.emplaceBack(2);\n        tileLineStripIndices.emplaceBack(0);\n        this.tileBorderIndexBuffer = context.createIndexBuffer(tileLineStripIndices);\n\n        const quadTriangleIndices = new TriangleIndexArray();\n        quadTriangleIndices.emplaceBack(1, 0, 2);\n        quadTriangleIndices.emplaceBack(1, 2, 3);\n        this.quadTriangleIndexBuffer = context.createIndexBuffer(quadTriangleIndices);\n\n        const gl = this.context.gl;\n        this.stencilClearMode = new StencilMode({func: gl.ALWAYS, mask: 0}, 0x0, 0xFF, gl.ZERO, gl.ZERO, gl.ZERO);\n\n        this.tileExtentMesh = new Mesh(this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments);\n    }\n\n    /*\n     * Reset the drawing canvas by clearing the stencil buffer so that we can draw\n     * new tiles at the same location, while retaining previously drawn pixels.\n     */\n    clearStencil() {\n        const context = this.context;\n        const gl = context.gl;\n\n        this.nextStencilID = 1;\n        this.currentStencilSource = undefined;\n\n        // As a temporary workaround for https://github.com/mapbox/mapbox-gl-js/issues/5490,\n        // pending an upstream fix, we draw a fullscreen stencil=0 clipping mask here,\n        // effectively clearing the stencil buffer: once an upstream patch lands, remove\n        // this function in favor of context.clear({ stencil: 0x0 })\n\n        const matrix = mat4.create();\n        mat4.ortho(matrix, 0, this.width, this.height, 0, 0, 1);\n        mat4.scale(matrix, matrix, [gl.drawingBufferWidth, gl.drawingBufferHeight, 0]);\n\n        const projectionData: ProjectionData = {\n            mainMatrix: matrix,\n            tileMercatorCoords: [0, 0, 1, 1],\n            clippingPlane: [0, 0, 0, 0],\n            projectionTransition: 0.0,\n            fallbackMatrix: matrix,\n        };\n\n        // Note: we force a simple mercator projection for the shader, since we want to draw a fullscreen quad.\n        this.useProgram('clippingMask', null, true).draw(context, gl.TRIANGLES,\n            DepthMode.disabled, this.stencilClearMode, ColorMode.disabled, CullFaceMode.disabled,\n            null, null, projectionData,\n            '$clipping', this.viewportBuffer,\n            this.quadTriangleIndexBuffer, this.viewportSegments);\n    }\n\n    _renderTileClippingMasks(layer: StyleLayer, tileIDs: Array<OverscaledTileID>, renderToTexture: boolean) {\n        if (this.currentStencilSource === layer.source || !layer.isTileClipped() || !tileIDs || !tileIDs.length) {\n            return;\n        }\n\n        this.currentStencilSource = layer.source;\n\n        if (this.nextStencilID + tileIDs.length > 256) {\n            // we'll run out of fresh IDs so we need to clear and start from scratch\n            this.clearStencil();\n        }\n\n        const context = this.context;\n        context.setColorMode(ColorMode.disabled);\n        context.setDepthMode(DepthMode.disabled);\n\n        const stencilRefs = {};\n\n        // Set stencil ref values for all tiles\n        for (const tileID of tileIDs) {\n            stencilRefs[tileID.key] = this.nextStencilID++;\n        }\n\n        // A two-pass approach is needed. See comment in draw_raster.ts for more details.\n        // However, we use a simpler approach because we don't care about overdraw here.\n\n        // First pass - draw tiles with borders and with GL_ALWAYS\n        this._renderTileMasks(stencilRefs, tileIDs, renderToTexture, true);\n        // Second pass - draw borderless tiles with GL_ALWAYS\n        this._renderTileMasks(stencilRefs, tileIDs, renderToTexture, false);\n\n        this._tileClippingMaskIDs = stencilRefs;\n    }\n\n    _renderTileMasks(tileStencilRefs: {[_: string]: number}, tileIDs: Array<OverscaledTileID>, renderToTexture: boolean, useBorders: boolean) {\n        const context = this.context;\n        const gl = context.gl;\n        const projection = this.style.projection;\n        const transform = this.transform;\n\n        const program = this.useProgram('clippingMask');\n\n        // tiles are usually supplied in ascending order of z, then y, then x\n        for (const tileID of tileIDs) {\n            const stencilRef = tileStencilRefs[tileID.key];\n            const terrainData = this.style.map.terrain && this.style.map.terrain.getTerrainData(tileID);\n\n            const mesh = projection.getMeshFromTileID(this.context, tileID.canonical, useBorders, true, 'stencil');\n\n            const projectionData = transform.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix: !renderToTexture, applyTerrainMatrix: true});\n\n            program.draw(context, gl.TRIANGLES, DepthMode.disabled,\n                // Tests will always pass, and ref value will be written to stencil buffer.\n                new StencilMode({func: gl.ALWAYS, mask: 0}, stencilRef, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE),\n                ColorMode.disabled, renderToTexture ? CullFaceMode.disabled : CullFaceMode.backCCW, null,\n                terrainData, projectionData, '$clipping', mesh.vertexBuffer,\n                mesh.indexBuffer, mesh.segments);\n        }\n    }\n\n    /**\n     * Fills the depth buffer with the geometry of all supplied tiles.\n     * Does not change the color buffer or the stencil buffer.\n     */\n    _renderTilesDepthBuffer() {\n        const context = this.context;\n        const gl = context.gl;\n        const projection = this.style.projection;\n        const transform = this.transform;\n\n        const program = this.useProgram('depth');\n        const depthMode = this.getDepthModeFor3D();\n        const tileIDs = coveringTiles(transform, {tileSize: transform.tileSize});\n\n        // tiles are usually supplied in ascending order of z, then y, then x\n        for (const tileID of tileIDs) {\n            const terrainData = this.style.map.terrain && this.style.map.terrain.getTerrainData(tileID);\n            const mesh = projection.getMeshFromTileID(this.context, tileID.canonical, true, true, 'raster');\n\n            const projectionData = transform.getProjectionData({overscaledTileID: tileID, applyGlobeMatrix: true, applyTerrainMatrix: true});\n\n            program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled,\n                ColorMode.disabled, CullFaceMode.backCCW, null,\n                terrainData, projectionData, '$clipping', mesh.vertexBuffer,\n                mesh.indexBuffer, mesh.segments);\n        }\n    }\n\n    stencilModeFor3D(): StencilMode {\n        this.currentStencilSource = undefined;\n\n        if (this.nextStencilID + 1 > 256) {\n            this.clearStencil();\n        }\n\n        const id = this.nextStencilID++;\n        const gl = this.context.gl;\n        return new StencilMode({func: gl.NOTEQUAL, mask: 0xFF}, id, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n    }\n\n    stencilModeForClipping(tileID: OverscaledTileID): StencilMode {\n        const gl = this.context.gl;\n        return new StencilMode({func: gl.EQUAL, mask: 0xFF}, this._tileClippingMaskIDs[tileID.key], 0x00, gl.KEEP, gl.KEEP, gl.REPLACE);\n    }\n\n    /*\n     * Sort coordinates by Z as drawing tiles is done in Z-descending order.\n     * All children with the same Z write the same stencil value.  Children\n     * stencil values are greater than parent's.  This is used only for raster\n     * and raster-dem tiles, which are already clipped to tile boundaries, to\n     * mask area of tile overlapped by children tiles.\n     * Stencil ref values continue range used in _tileClippingMaskIDs.\n     *\n     * Attention: This function changes this.nextStencilID even if the result of it\n     * is not used, which might cause problems when rendering due to invalid stencil\n     * values.\n     * Returns [StencilMode for tile overscaleZ map, sortedCoords].\n     */\n    getStencilConfigForOverlapAndUpdateStencilID(tileIDs: Array<OverscaledTileID>): [{\n        [_: number]: Readonly<StencilMode>;\n    }, Array<OverscaledTileID>] {\n        const gl = this.context.gl;\n        const coords = tileIDs.sort((a, b) => b.overscaledZ - a.overscaledZ);\n        const minTileZ = coords[coords.length - 1].overscaledZ;\n        const stencilValues = coords[0].overscaledZ - minTileZ + 1;\n        if (stencilValues > 1) {\n            this.currentStencilSource = undefined;\n            if (this.nextStencilID + stencilValues > 256) {\n                this.clearStencil();\n            }\n            const zToStencilMode = {};\n            for (let i = 0; i < stencilValues; i++) {\n                zToStencilMode[i + minTileZ] = new StencilMode({func: gl.GEQUAL, mask: 0xFF}, i + this.nextStencilID, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n            }\n            this.nextStencilID += stencilValues;\n            return [zToStencilMode, coords];\n        }\n        return [{[minTileZ]: StencilMode.disabled}, coords];\n    }\n\n    stencilConfigForOverlapTwoPass(tileIDs: Array<OverscaledTileID>): [\n        { [_: number]: Readonly<StencilMode> }, // borderless tiles - high priority & high stencil values\n        { [_: number]: Readonly<StencilMode> }, // tiles with border - low priority\n        Array<OverscaledTileID>\n    ] {\n        const gl = this.context.gl;\n        const coords = tileIDs.sort((a, b) => b.overscaledZ - a.overscaledZ);\n        const minTileZ = coords[coords.length - 1].overscaledZ;\n        const stencilValues = coords[0].overscaledZ - minTileZ + 1;\n\n        this.clearStencil();\n\n        if (stencilValues > 1) {\n            const zToStencilModeHigh = {};\n            const zToStencilModeLow = {};\n            for (let i = 0; i < stencilValues; i++) {\n                zToStencilModeHigh[i + minTileZ] = new StencilMode({func: gl.GREATER, mask: 0xFF}, stencilValues + 1 + i, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n                zToStencilModeLow[i + minTileZ] = new StencilMode({func: gl.GREATER, mask: 0xFF}, 1 + i, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n            }\n            this.nextStencilID = stencilValues * 2 + 1;\n            return [\n                zToStencilModeHigh,\n                zToStencilModeLow,\n                coords\n            ];\n        } else {\n            this.nextStencilID = 3;\n            return [\n                {[minTileZ]: new StencilMode({func: gl.GREATER, mask: 0xFF}, 2, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE)},\n                {[minTileZ]: new StencilMode({func: gl.GREATER, mask: 0xFF}, 1, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE)},\n                coords\n            ];\n        }\n    }\n\n    colorModeForRenderPass(): Readonly<ColorMode> {\n        const gl = this.context.gl;\n        if (this._showOverdrawInspector) {\n            const numOverdrawSteps = 8;\n            const a = 1 / numOverdrawSteps;\n\n            return new ColorMode([gl.CONSTANT_COLOR, gl.ONE], new Color(a, a, a, 0), [true, true, true, true]);\n        } else if (this.renderPass === 'opaque') {\n            return ColorMode.unblended;\n        } else {\n            return ColorMode.alphaBlended;\n        }\n    }\n\n    getDepthModeForSublayer(n: number, mask: DepthMaskType, func?: DepthFuncType | null): Readonly<DepthMode> {\n        if (!this.opaquePassEnabledForLayer()) return DepthMode.disabled;\n        const depth = 1 - ((1 + this.currentLayer) * this.numSublayers + n) * this.depthEpsilon;\n        return new DepthMode(func || this.context.gl.LEQUAL, mask, [depth, depth]);\n    }\n\n    getDepthModeFor3D(): Readonly<DepthMode> {\n        return new DepthMode(this.context.gl.LEQUAL, DepthMode.ReadWrite, this.depthRangeFor3D);\n    }\n\n    /*\n     * The opaque pass and 3D layers both use the depth buffer.\n     * Layers drawn above 3D layers need to be drawn using the\n     * painter's algorithm so that they appear above 3D features.\n     * This returns true for layers that can be drawn using the\n     * opaque pass.\n     */\n    opaquePassEnabledForLayer() {\n        return this.currentLayer < this.opaquePassCutoff;\n    }\n\n    render(style: Style, options: PainterOptions) {\n        this.style = style;\n        this.options = options;\n\n        this.lineAtlas = style.lineAtlas;\n        this.imageManager = style.imageManager;\n        this.glyphManager = style.glyphManager;\n\n        this.symbolFadeChange = style.placement.symbolFadeChange(now());\n\n        this.imageManager.beginFrame();\n\n        const layerIds = this.style._order;\n        const tileManagers = this.style.tileManagers;\n\n        const coordsAscending: {[_: string]: Array<OverscaledTileID>} = {};\n        const coordsDescending: {[_: string]: Array<OverscaledTileID>} = {};\n        const coordsDescendingSymbol: {[_: string]: Array<OverscaledTileID>} = {};\n        const renderOptions: RenderOptions = {isRenderingToTexture: false, isRenderingGlobe: style.projection?.transitionState > 0};\n\n        for (const id in tileManagers) {\n            const tileManager = tileManagers[id];\n            if (tileManager.used) {\n                tileManager.prepare(this.context);\n            }\n\n            coordsAscending[id] = tileManager.getVisibleCoordinates(false);\n            coordsDescending[id] = coordsAscending[id].slice().reverse();\n            coordsDescendingSymbol[id] = tileManager.getVisibleCoordinates(true).reverse();\n        }\n\n        this.opaquePassCutoff = Infinity;\n        for (let i = 0; i < layerIds.length; i++) {\n            const layerId = layerIds[i];\n            if (this.style._layers[layerId].is3D()) {\n                this.opaquePassCutoff = i;\n                break;\n            }\n        }\n\n        this.maybeDrawDepthAndCoords(false);\n\n        if (this.renderToTexture) {\n            this.renderToTexture.prepareForRender(this.style, this.transform.zoom);\n            // this is disabled, because render-to-texture is rendering all layers from bottom to top.\n            this.opaquePassCutoff = 0;\n        }\n\n        // Offscreen pass ===============================================\n        // We first do all rendering that requires rendering to a separate\n        // framebuffer, and then save those for rendering back to the map\n        // later: in doing this we avoid doing expensive framebuffer restores.\n        this.renderPass = 'offscreen';\n\n        for (const layerId of layerIds) {\n            const layer = this.style._layers[layerId];\n            if (!layer.hasOffscreenPass() || layer.isHidden(this.transform.zoom)) continue;\n\n            const coords = coordsDescending[layer.source];\n            if (layer.type !== 'custom' && !coords.length) continue;\n\n            this.renderLayer(this, tileManagers[layer.source], layer, coords, renderOptions);\n        }\n\n        // Execute offscreen GPU tasks of the projection manager\n        this.style.projection?.updateGPUdependent({\n            context: this.context,\n            useProgram: (name: string) => this.useProgram(name)\n        });\n\n        // Rebind the main framebuffer now that all offscreen layers have been rendered:\n        this.context.viewport.set([0, 0, this.width, this.height]);\n        this.context.bindFramebuffer.set(null);\n\n        // Clear buffers in preparation for drawing to the main framebuffer\n        this.context.clear({color: options.showOverdrawInspector ? Color.black : Color.transparent, depth: 1});\n        this.clearStencil();\n\n        // draw sky first to not overwrite symbols\n        if (this.style.sky) drawSky(this, this.style.sky);\n\n        this._showOverdrawInspector = options.showOverdrawInspector;\n        this.depthRangeFor3D = [0, 1 - ((style._order.length + 2) * this.numSublayers * this.depthEpsilon)];\n\n        // Opaque pass ===============================================\n        // Draw opaque layers top-to-bottom first.\n        if (!this.renderToTexture) {\n            this.renderPass = 'opaque';\n\n            for (this.currentLayer = layerIds.length - 1; this.currentLayer >= 0; this.currentLayer--) {\n                const layer = this.style._layers[layerIds[this.currentLayer]];\n                const tileManager = tileManagers[layer.source];\n                const coords = coordsAscending[layer.source];\n\n                this._renderTileClippingMasks(layer, coords, false);\n                this.renderLayer(this, tileManager, layer, coords, renderOptions);\n            }\n        }\n\n        // Translucent pass ===============================================\n        // Draw all other layers bottom-to-top.\n        this.renderPass = 'translucent';\n\n        let globeDepthRendered = false;\n\n        for (this.currentLayer = 0; this.currentLayer < layerIds.length; this.currentLayer++) {\n            const layer = this.style._layers[layerIds[this.currentLayer]];\n            const tileManager = tileManagers[layer.source];\n\n            if (this.renderToTexture && this.renderToTexture.renderLayer(layer, renderOptions)) continue;\n\n            if (!this.opaquePassEnabledForLayer() && !globeDepthRendered) {\n                globeDepthRendered = true;\n                // Render the globe sphere into the depth buffer - but only if globe is enabled and terrain is disabled.\n                // There should be no need for explicitly writing tile depths when terrain is enabled.\n                if (renderOptions.isRenderingGlobe && !this.style.map.terrain) {\n                    this._renderTilesDepthBuffer();\n                }\n            }\n\n            // For symbol layers in the translucent pass, we add extra tiles to the renderable set\n            // for cross-tile symbol fading. Symbol layers don't use tile clipping, so no need to render\n            // separate clipping masks\n            const coords = (layer.type === 'symbol' ? coordsDescendingSymbol : coordsDescending)[layer.source];\n\n            this._renderTileClippingMasks(layer, coordsAscending[layer.source], !!this.renderToTexture);\n            this.renderLayer(this, tileManager, layer, coords, renderOptions);\n        }\n\n        // Render atmosphere, only for Globe projection\n        if (renderOptions.isRenderingGlobe) {\n            drawAtmosphere(this, this.style.sky, this.style.light);\n        }\n\n        if (this.options.showTileBoundaries) {\n            const selectedSource = selectDebugSource(this.style, this.transform.zoom);\n            if (selectedSource) {\n                drawDebug(this, selectedSource, selectedSource.getVisibleCoordinates());\n            }\n        }\n\n        if (this.options.showPadding) {\n            drawDebugPadding(this);\n        }\n\n        // Set defaults for most GL values so that anyone using the state after the render\n        // encounters more expected values.\n        this.context.setDefault();\n    }\n\n    /**\n     * Update the depth and coords framebuffers, if the contents of those frame buffers is out of date.\n     * If requireExact is false, then the contents of those frame buffers is not updated if it is close\n     * to accurate (that is, the camera has not moved much since it was updated last).\n     */\n    maybeDrawDepthAndCoords(requireExact: boolean) {\n        if (!this.style || !this.style.map || !this.style.map.terrain) {\n            return;\n        }\n        const prevMatrix = this.terrainFacilitator.matrix;\n        const currMatrix = this.transform.modelViewProjectionMatrix;\n\n        // Update coords/depth-framebuffer on camera movement, or tile reloading\n        let doUpdate = this.terrainFacilitator.dirty;\n        doUpdate ||= requireExact ? !mat4.exactEquals(prevMatrix, currMatrix) : !mat4.equals(prevMatrix, currMatrix);\n        doUpdate ||= this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime);\n\n        if (!doUpdate) {\n            return;\n        }\n\n        mat4.copy(prevMatrix, currMatrix);\n        this.terrainFacilitator.renderTime = Date.now();\n        this.terrainFacilitator.dirty = false;\n        drawDepth(this, this.style.map.terrain);\n        drawCoords(this, this.style.map.terrain);\n    }\n\n    renderLayer(painter: Painter, tileManager: TileManager, layer: StyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n        if (layer.isHidden(this.transform.zoom)) return;\n        if (layer.type !== 'background' && layer.type !== 'custom' && !(coords || []).length) return;\n        this.id = layer.id;\n\n        if (isSymbolStyleLayer(layer)) {\n            drawSymbols(painter, tileManager, layer, coords, this.style.placement.variableOffsets, renderOptions);\n        } else if (isCircleStyleLayer(layer)) {\n            drawCircles(painter, tileManager, layer, coords, renderOptions);\n        } else if (isHeatmapStyleLayer(layer)) {\n            drawHeatmap(painter, tileManager, layer, coords, renderOptions);\n        } else if (isLineStyleLayer(layer)) {\n            drawLine(painter, tileManager, layer, coords, renderOptions);\n        } else if (isFillStyleLayer(layer)) {\n            drawFill(painter, tileManager, layer, coords, renderOptions);\n        } else if (isFillExtrusionStyleLayer(layer)) {\n            drawFillExtrusion(painter, tileManager, layer, coords, renderOptions);\n        } else if (isHillshadeStyleLayer(layer)) {\n            drawHillshade(painter, tileManager, layer, coords, renderOptions);\n        } else if (isColorReliefStyleLayer(layer)) {\n            drawColorRelief(painter, tileManager, layer, coords, renderOptions);\n        } else if (isRasterStyleLayer(layer)) {\n            drawRaster(painter, tileManager, layer, coords, renderOptions);\n        } else if (isBackgroundStyleLayer(layer)) {\n            drawBackground(painter, tileManager, layer, coords, renderOptions);\n        } else if (isCustomStyleLayer(layer)) {\n            drawCustom(painter, tileManager, layer, renderOptions);\n        }\n    }\n\n    saveTileTexture(texture: Texture) {\n        const textures = this._tileTextures[texture.size[0]];\n        if (!textures) {\n            this._tileTextures[texture.size[0]] = [texture];\n        } else {\n            textures.push(texture);\n        }\n    }\n\n    getTileTexture(size: number) {\n        const textures = this._tileTextures[size];\n        return textures && textures.length > 0 ? textures.pop() : null;\n    }\n\n    /**\n     * Checks whether a pattern image is needed, and if it is, whether it is not loaded.\n     *\n     * @returns true if a needed image is missing and rendering needs to be skipped.\n     */\n    isPatternMissing(image?: CrossFaded<ResolvedImage> | null): boolean {\n        if (!image) return false;\n        if (!image.from || !image.to) return true;\n        const imagePosA = this.imageManager.getPattern(image.from.toString());\n        const imagePosB = this.imageManager.getPattern(image.to.toString());\n        return !imagePosA || !imagePosB;\n    }\n\n    /**\n     * Finds the required shader and its variant (base/terrain/globe, etc.) and binds it, compiling a new shader if required.\n     * @param name - Name of the desired shader.\n     * @param programConfiguration - Configuration of shader's inputs.\n     * @param forceSimpleProjection - Whether to force the use of a shader variant with simple mercator projection vertex shader.\n     * @param defines - Additional macros to be injected at the beginning of the shader. Expected format is `['#define XYZ']`, etc.\n     * False by default. Use true when drawing with a simple projection matrix is desired, eg. when drawing a fullscreen quad.\n     * @returns\n     */\n    useProgram(name: string, programConfiguration?: ProgramConfiguration | null, forceSimpleProjection: boolean = false, defines: Array<string> = []): Program<any> {\n        this.cache = this.cache || {};\n        const useTerrain = !!this.style.map.terrain;\n\n        const projection = this.style.projection;\n\n        const projectionPrelude = forceSimpleProjection ? shaders.projectionMercator : projection.shaderPreludeCode;\n        const projectionDefine = forceSimpleProjection ? MercatorShaderDefine : projection.shaderDefine;\n        const projectionKey = `/${forceSimpleProjection ? MercatorShaderVariantKey : projection.shaderVariantName}`;\n\n        const configurationKey = (programConfiguration ? programConfiguration.cacheKey : '');\n        const overdrawKey = (this._showOverdrawInspector ? '/overdraw' : '');\n        const terrainKey = (useTerrain ? '/terrain' : '');\n        const definesKey = (defines ? `/${defines.join('/')}` : '');\n\n        const key = name + configurationKey + projectionKey + overdrawKey + terrainKey + definesKey;\n\n        if (!this.cache[key]) {\n            this.cache[key] = new Program(\n                this.context,\n                shaders[name],\n                programConfiguration,\n                programUniforms[name],\n                this._showOverdrawInspector,\n                useTerrain,\n                projectionPrelude,\n                projectionDefine,\n                defines\n            );\n        }\n        return this.cache[key];\n    }\n\n    /*\n     * Reset some GL state to default values to avoid hard-to-debug bugs\n     * in custom layers.\n     */\n    setCustomLayerDefaults() {\n        // Prevent custom layers from unintentionally modify the last VAO used.\n        // All other state is state is restored on it's own, but for VAOs it's\n        // simpler to unbind so that we don't have to track the state of VAOs.\n        this.context.unbindVAO();\n\n        // The default values for this state is meaningful and often expected.\n        // Leaving this state dirty could cause a lot of confusion for users.\n        this.context.cullFace.setDefault();\n        this.context.activeTexture.setDefault();\n        this.context.pixelStoreUnpack.setDefault();\n        this.context.pixelStoreUnpackPremultiplyAlpha.setDefault();\n        this.context.pixelStoreUnpackFlipY.setDefault();\n    }\n\n    /*\n     * Set GL state that is shared by all layers.\n     */\n    setBaseState() {\n        const gl = this.context.gl;\n        this.context.cullFace.set(false);\n        this.context.viewport.set([0, 0, this.width, this.height]);\n        this.context.blendEquation.set(gl.FUNC_ADD);\n    }\n\n    initDebugOverlayCanvas() {\n        if (this.debugOverlayCanvas == null) {\n            this.debugOverlayCanvas = document.createElement('canvas');\n            this.debugOverlayCanvas.width = 512;\n            this.debugOverlayCanvas.height = 512;\n            const gl = this.context.gl;\n            this.debugOverlayTexture = new Texture(this.context, this.debugOverlayCanvas, gl.RGBA);\n        }\n    }\n\n    destroy() {\n        if (this._tileTextures) {\n            for (const size in this._tileTextures) {\n                const textures = this._tileTextures[size];\n                if (textures) {\n                    for (const texture of textures) {\n                        texture.destroy();\n                    }\n                }\n            }\n            this._tileTextures = {};\n        }\n\n        if (this.tileExtentBuffer) this.tileExtentBuffer.destroy();\n        if (this.debugBuffer) this.debugBuffer.destroy();\n        if (this.rasterBoundsBuffer) this.rasterBoundsBuffer.destroy();\n        if (this.rasterBoundsBufferPosOnly) this.rasterBoundsBufferPosOnly.destroy();\n        if (this.viewportBuffer) this.viewportBuffer.destroy();\n        if (this.tileBorderIndexBuffer) this.tileBorderIndexBuffer.destroy();\n        if (this.quadTriangleIndexBuffer) this.quadTriangleIndexBuffer.destroy();\n        if (this.tileExtentMesh) this.tileExtentMesh.vertexBuffer?.destroy();\n        if (this.tileExtentMesh) this.tileExtentMesh.indexBuffer?.destroy();\n\n        if (this.debugOverlayTexture) {\n            this.debugOverlayTexture.destroy();\n        }\n\n        if (this.cache) {\n            for (const key in this.cache) {\n                const program = this.cache[key];\n                if (program && program.program) {\n                    this.context.gl.deleteProgram(program.program);\n                }\n            }\n            this.cache = {};\n        }\n\n        if (this.context) {\n            this.context.setDefault();\n        }\n    }\n\n    /*\n     * Return true if drawing buffer size is != from requested size.\n     * That means that we've reached GL limits somehow.\n     * Note: drawing buffer size changes only when canvas size changes\n     */\n    overLimit() {\n        const {drawingBufferWidth, drawingBufferHeight} = this.context.gl;\n        return this.width !== drawingBufferWidth || this.height !== drawingBufferHeight;\n    }\n}\n","import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {type Program} from './program';\nimport {circleUniformValues} from './program/circle_program';\nimport {SegmentVector} from '../data/segment';\nimport {type OverscaledTileID} from '../tile/tile_id';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {CircleStyleLayer} from '../style/style_layer/circle_style_layer';\nimport type {CircleBucket} from '../data/bucket/circle_bucket';\nimport type {ProgramConfiguration} from '../data/program_configuration';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {UniformValues} from './uniform_binding';\nimport type {CircleUniformsType} from './program/circle_program';\nimport type {TerrainData} from '../render/terrain';\nimport {translatePosition} from '../util/util';\nimport type {ProjectionData} from '../geo/projection/projection_data';\n\ntype TileRenderState = {\n    programConfiguration: ProgramConfiguration;\n    program: Program<any>;\n    layoutVertexBuffer: VertexBuffer;\n    indexBuffer: IndexBuffer;\n    uniformValues: UniformValues<CircleUniformsType>;\n    terrainData: TerrainData;\n    projectionData: ProjectionData;\n};\n\ntype SegmentsTileRenderState = {\n    segments: SegmentVector;\n    sortKey: number;\n    state: TileRenderState;\n};\n\nexport function drawCircles(painter: Painter, tileManager: TileManager, layer: CircleStyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const opacity = layer.paint.get('circle-opacity');\n    const strokeWidth = layer.paint.get('circle-stroke-width');\n    const strokeOpacity = layer.paint.get('circle-stroke-opacity');\n    const sortFeaturesByKey = !layer.layout.get('circle-sort-key').isConstant();\n\n    if (opacity.constantOr(1) === 0 && (strokeWidth.constantOr(1) === 0 || strokeOpacity.constantOr(1) === 0)) {\n        return;\n    }\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n\n    const depthMode = painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n    // Turn off stencil testing to allow circles to be drawn across boundaries,\n    // so that large circles are not clipped to tiles\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n\n    const segmentsRenderStates: Array<SegmentsTileRenderState> = [];\n\n    // Note: due to how the shader is written, this value only has effect when globe rendering is enabled and `circle-pitch-alignment` is set to 'map'.\n    const radiusCorrectionFactor = transform.getCircleRadiusCorrection();\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n\n        const tile = tileManager.getTile(coord);\n        const bucket: CircleBucket<any> = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const styleTranslate = layer.paint.get('circle-translate');\n        const styleTranslateAnchor = layer.paint.get('circle-translate-anchor');\n        const translateForUniforms = translatePosition(transform, tile, styleTranslate, styleTranslateAnchor);\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram('circle', programConfiguration);\n        const layoutVertexBuffer = bucket.layoutVertexBuffer;\n        const indexBuffer = bucket.indexBuffer;\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const uniformValues = circleUniformValues(painter, tile, layer, translateForUniforms, radiusCorrectionFactor);\n\n        const projectionData = transform.getProjectionData({overscaledTileID: coord, applyGlobeMatrix: !isRenderingToTexture, applyTerrainMatrix: true});\n\n        const state: TileRenderState = {\n            programConfiguration,\n            program,\n            layoutVertexBuffer,\n            indexBuffer,\n            uniformValues,\n            terrainData,\n            projectionData\n        };\n\n        if (sortFeaturesByKey) {\n            const oldSegments = bucket.segments.get();\n            for (const segment of oldSegments) {\n                segmentsRenderStates.push({\n                    segments: new SegmentVector([segment]),\n                    sortKey: (segment.sortKey as any as number),\n                    state\n                });\n            }\n        } else {\n            segmentsRenderStates.push({\n                segments: bucket.segments,\n                sortKey: 0,\n                state\n            });\n        }\n\n    }\n\n    if (sortFeaturesByKey) {\n        segmentsRenderStates.sort((a, b) => a.sortKey - b.sortKey);\n    }\n\n    for (const segmentsState of segmentsRenderStates) {\n        const {programConfiguration, program, layoutVertexBuffer, indexBuffer, uniformValues, terrainData, projectionData} = segmentsState.state;\n        const segments = segmentsState.segments;\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id,\n            layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n","import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n} from './program/background_program';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {BackgroundStyleLayer} from '../style/style_layer/background_style_layer';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\n\nexport function drawBackground(painter: Painter, tileManager: TileManager, layer: BackgroundStyleLayer, coords: Array<OverscaledTileID>, renderOptions: RenderOptions) {\n    const color = layer.paint.get('background-color');\n    const opacity = layer.paint.get('background-opacity');\n\n    if (opacity === 0) return;\n\n    const {isRenderingToTexture} = renderOptions;\n    const context = painter.context;\n    const gl = context.gl;\n    const projection = painter.style.projection;\n    const transform = painter.transform;\n    const tileSize = transform.tileSize;\n    const image = layer.paint.get('background-pattern');\n\n    if (painter.isPatternMissing(image)) return;\n\n    const pass = (!image && color.a === 1 && opacity === 1 && painter.opaquePassEnabledForLayer()) ? 'opaque' : 'translucent';\n    if (painter.renderPass !== pass) return;\n\n    const stencilMode = StencilMode.disabled;\n    const depthMode = painter.getDepthModeForSublayer(0, pass === 'opaque' ? DepthMode.ReadWrite : DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n    const program = painter.useProgram(image ? 'backgroundPattern' : 'background');\n    const tileIDs = coords ? coords : coveringTiles(transform, {tileSize, terrain: painter.style.map.terrain});\n\n    if (image) {\n        context.activeTexture.set(gl.TEXTURE0);\n        painter.imageManager.bind(painter.context);\n    }\n\n    const crossfade = layer.getCrossfadeParameters();\n    \n    for (const tileID of tileIDs) {\n        const projectionData = transform.getProjectionData({\n            overscaledTileID: tileID,\n            applyGlobeMatrix: !isRenderingToTexture,\n            applyTerrainMatrix: true\n        });\n\n        const uniformValues = image ?\n            backgroundPatternUniformValues(opacity, painter, image, {tileID, tileSize}, crossfade) :\n            backgroundUniformValues(opacity, color);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(tileID);\n\n        // For globe rendering, background uses tile meshes *without* borders and no stencil clipping.\n        // This works assuming the tileIDs list contains only tiles of the same zoom level.\n        // This seems to always be the case for background layers, but I'm leaving this comment\n        // here in case this assumption is false in the future.\n\n        // In case background starts having tiny holes at tile boundaries, switch to meshes with borders\n        // and also enable stencil clipping. Make sure to render a proper tile clipping mask into stencil\n        // first though, as that doesn't seem to happen for background layers as of writing this.\n\n        const mesh = projection.getMeshFromTileID(context, tileID.canonical, false, true, 'raster');\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, projectionData, layer.id,\n            mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n}\n","import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\n\nimport type {Painter, RenderOptions} from './painter';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {CustomRenderMethodInput, CustomStyleLayer} from '../style/style_layer/custom_style_layer';\n\nexport function drawCustom(painter: Painter, tileManager: TileManager, layer: CustomStyleLayer, renderOptions: RenderOptions) {\n\n    const {isRenderingGlobe} = renderOptions;\n    const context = painter.context;\n    const implementation = layer.implementation;\n    const projection = painter.style.projection;\n    const transform = painter.transform;\n\n    const projectionData = transform.getProjectionDataForCustomLayer(isRenderingGlobe);\n\n    const customLayerArgs: CustomRenderMethodInput = {\n        farZ: transform.farZ,\n        nearZ: transform.nearZ,\n        fov: transform.fov * Math.PI / 180, // fov converted to radians\n        modelViewProjectionMatrix: transform.modelViewProjectionMatrix,\n        projectionMatrix: transform.projectionMatrix,\n        shaderData: {\n            variantName: projection.shaderVariantName,\n            vertexShaderPrelude: `const float PI = 3.141592653589793;\\nuniform mat4 u_projection_matrix;\\n${projection.shaderPreludeCode.vertexSource}`,\n            define: projection.shaderDefine,\n        },\n        defaultProjectionData: projectionData,\n    };\n\n    const renderingMode = implementation.renderingMode ? implementation.renderingMode : '2d';\n\n    if (painter.renderPass === 'offscreen') {\n        const prerender = implementation.prerender;\n        if (prerender) {\n            painter.setCustomLayerDefaults();\n            context.setColorMode(painter.colorModeForRenderPass());\n\n            prerender.call(implementation, context.gl, customLayerArgs);\n\n            context.setDirty();\n            painter.setBaseState();\n        }\n    } else if (painter.renderPass === 'translucent') {\n\n        painter.setCustomLayerDefaults();\n\n        context.setColorMode(painter.colorModeForRenderPass());\n        context.setStencilMode(StencilMode.disabled);\n\n        const depthMode = renderingMode === '3d' ?\n            painter.getDepthModeFor3D() :\n            painter.getDepthModeForSublayer(0, DepthMode.ReadOnly);\n\n        context.setDepthMode(depthMode);\n\n        implementation.render(context.gl, customLayerArgs);\n\n        context.setDirty();\n        painter.setBaseState();\n        context.bindFramebuffer.set(null);\n    }\n}\n","/**\n * Throttle the given function to run at most every `period` milliseconds.\n */\nexport function throttle<T extends (...args: any) => void>(fn: T, time: number): (...args: Parameters<T>) => ReturnType<typeof setTimeout> {\n    let pending = false;\n    let timerId: ReturnType<typeof setTimeout> = null;\n    let lastCallContext = null;\n    let lastCallArgs: Parameters<T>;\n\n    const later = () => {\n        timerId = null;\n        if (pending) {\n            fn.apply(lastCallContext, lastCallArgs);\n            timerId = setTimeout(later, time);\n            pending = false;\n        }\n    };\n\n    return (...args: Parameters<T>) => {\n        pending = true;\n        lastCallContext = this;\n        lastCallArgs = args;\n        if (!timerId) {\n            later();\n        }\n        return timerId;\n    };\n}\n","import {throttle} from '../util/throttle';\nimport {LngLat} from '../geo/lng_lat';\n\nimport type {Map} from './map';\n\n/**\n * Adds the map's position to its page's location hash.\n * Passed as an option to the map object.\n *\n * @group Markers and Controls\n */\nexport class Hash {\n    _map: Map;\n    _hashName: string;\n\n    constructor(hashName?: string | null) {\n        this._hashName = hashName && encodeURIComponent(hashName);\n    }\n\n    /**\n     * Map element to listen for coordinate changes\n     *\n     * @param map - The map object\n     */\n    addTo(map: Map) {\n        this._map = map;\n        addEventListener('hashchange', this._onHashChange, false);\n        this._map.on('moveend', this._updateHash);\n        return this;\n    }\n\n    /**\n     * Removes hash\n     */\n    remove() {\n        removeEventListener('hashchange', this._onHashChange, false);\n        this._map.off('moveend', this._updateHash);\n        clearTimeout(this._updateHash());\n        this._removeHash();\n\n        delete this._map;\n        return this;\n    }\n\n    getHashString(mapFeedback?: boolean) {\n        const center = this._map.getCenter(),\n            zoom = Math.round(this._map.getZoom() * 100) / 100,\n            // derived from equation: 512px * 2^z / 360 / 10^d < 0.5px\n            precision = Math.ceil((zoom * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10),\n            m = Math.pow(10, precision),\n            lng = Math.round(center.lng * m) / m,\n            lat = Math.round(center.lat * m) / m,\n            bearing = this._map.getBearing(),\n            pitch = this._map.getPitch();\n        let hash = '';\n        if (mapFeedback) {\n            // new map feedback site has some constraints that don't allow\n            // us to use the same hash format as we do for the Map hash option.\n            hash += `/${lng}/${lat}/${zoom}`;\n        } else {\n            hash += `${zoom}/${lat}/${lng}`;\n        }\n\n        if (bearing || pitch) hash += (`/${Math.round(bearing * 10) / 10}`);\n        if (pitch) hash += (`/${Math.round(pitch)}`);\n\n        if (this._hashName) {\n            const hashName = this._hashName;\n            let found = false;\n            const parts = window.location.hash.slice(1).split('&').map(part => {\n                const key = part.split('=')[0];\n                if (key === hashName) {\n                    found = true;\n                    return `${key}=${hash}`;\n                }\n                return part;\n            }).filter(a => a);\n            if (!found) {\n                parts.push(`${hashName}=${hash}`);\n            }\n            return `#${parts.join('&')}`;\n        }\n\n        return `#${hash}`;\n    }\n\n    _getCurrentHash = () => {\n        // Get the current hash from location, stripped from its number sign\n        const hash = window.location.hash.replace('#', '');\n        if (this._hashName) {\n            // Split the parameter-styled hash into parts and find the value we need\n            let keyval;\n            hash.split('&').map(\n                part => part.split('=')\n            ).forEach(part => {\n                if (part[0] === this._hashName) {\n                    keyval = part;\n                }\n            });\n            return (keyval ? keyval[1] || '' : '').split('/');\n        }\n        return hash.split('/');\n    };\n\n    _onHashChange = () => {\n        const hash = this._getCurrentHash();\n\n        if (!this._isValidHash(hash)) {\n            return false;\n        }\n\n        const bearing = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(hash[3] || 0) : this._map.getBearing();\n        this._map.jumpTo({\n            center: [+hash[2], +hash[1]],\n            zoom: +hash[0],\n            bearing,\n            pitch: +(hash[4] || 0)\n        });\n\n        return true;\n    };\n\n    _updateHashUnthrottled = () => {\n        // Replace if already present, else append the updated hash string\n        const location = window.location.href.replace(/(#.*)?$/, this.getHashString());\n        window.history.replaceState(window.history.state, null, location);\n    };\n\n    _removeHash = () => {\n        const currentHash = this._getCurrentHash();\n        if (currentHash.length === 0) {\n            return;\n        }\n        const baseHash = currentHash.join('/');\n        let targetHash = baseHash;\n        if (targetHash.split('&').length > 0) {\n            targetHash = targetHash.split('&')[0]; // #3/1/2&foo=bar -> #3/1/2\n        }\n        if (this._hashName) {\n            targetHash = `${this._hashName}=${baseHash}`;\n        }\n        let replaceString = window.location.hash.replace(targetHash, '');\n        if (replaceString.startsWith('#&')) {\n            replaceString = replaceString.slice(0, 1) + replaceString.slice(2);\n        } else if (replaceString === '#') {\n            replaceString = '';\n        }\n        let location = window.location.href.replace(/(#.+)?$/, replaceString);\n        location = location.replace('&&', '&');\n        window.history.replaceState(window.history.state, null, location);\n    };\n\n    /**\n     * Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.\n     */\n    _updateHash: () => ReturnType<typeof setTimeout> = throttle(this._updateHashUnthrottled, 30 * 1000 / 100);\n\n    _isValidHash(hash: number[]) {\n        if (hash.length < 3 || hash.some(isNaN)) {\n            return false;\n        }\n\n        // LngLat() throws error if latitude is out of range, and it's valid if it succeeds.\n        try {\n            new LngLat(+hash[2], +hash[1]);\n        } catch {\n            return false;\n        }\n\n        const zoom = +hash[0];\n        const bearing = +(hash[3] || 0);\n        const pitch = +(hash[4] || 0);\n\n        return zoom >= this._map.getMinZoom() && zoom <= this._map.getMaxZoom() &&\n            bearing >= -180 && bearing <= 180 &&\n            pitch >= this._map.getMinPitch() && pitch <= this._map.getMaxPitch();\n    };\n}\n","import {now} from '../util/time_control';\nimport type {Map} from './map';\nimport {bezier, clamp, extend, evaluateZoomSnap} from '../util/util';\nimport Point from '@mapbox/point-geometry';\nimport type {DragPanOptions} from './handler/shim/drag_pan';\nimport {type EaseToOptions} from './camera';\n\nconst defaultInertiaOptions = {\n    linearity: 0.3,\n    easing: bezier(0, 0, 0.3, 1),\n};\n\nconst defaultPanInertiaOptions = extend({\n    deceleration: 2500,\n    maxSpeed: 1400\n}, defaultInertiaOptions);\n\nconst defaultZoomInertiaOptions = extend({\n    deceleration: 20,\n    maxSpeed: 1400\n}, defaultInertiaOptions);\n\nconst defaultBearingInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 360\n}, defaultInertiaOptions);\n\nconst defaultPitchInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 90\n}, defaultInertiaOptions);\n\nconst defaultRollInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 360\n}, defaultInertiaOptions);\n\nexport type InertiaOptions = {\n    linearity: number;\n    easing: (t: number) => number;\n    deceleration: number;\n    maxSpeed: number;\n};\n\nexport class HandlerInertia {\n    _map: Map;\n    _inertiaBuffer: Array<{\n        time: number;\n        settings: any;\n    }>;\n\n    constructor(map: Map) {\n        this._map = map;\n        this.clear();\n    }\n\n    clear() {\n        this._inertiaBuffer = [];\n    }\n\n    record(settings: any) {\n        this._drainInertiaBuffer();\n        this._inertiaBuffer.push({time: now(), settings});\n    }\n\n    _drainInertiaBuffer() {\n        const inertia = this._inertiaBuffer,\n            currentTime = now(),\n            cutoff = 160;   //msec\n\n        while (inertia.length > 0 && currentTime - inertia[0].time > cutoff)\n            inertia.shift();\n    }\n\n    _onMoveEnd(panInertiaOptions?: DragPanOptions | boolean): EaseToOptions {\n        this._drainInertiaBuffer();\n        if (this._inertiaBuffer.length < 2) {\n            return;\n        }\n\n        const deltas = {\n            zoom: 0,\n            bearing: 0,\n            pitch: 0,\n            roll: 0,\n            pan: new Point(0, 0),\n            pinchAround: undefined,\n            around: undefined\n        };\n\n        for (const {settings} of this._inertiaBuffer) {\n            deltas.zoom += settings.zoomDelta || 0;\n            deltas.bearing += settings.bearingDelta || 0;\n            deltas.pitch += settings.pitchDelta || 0;\n            deltas.roll += settings.rollDelta || 0;\n            if (settings.panDelta) deltas.pan._add(settings.panDelta);\n            if (settings.around) deltas.around = settings.around;\n            if (settings.pinchAround) deltas.pinchAround = settings.pinchAround;\n        }\n\n        const lastEntry = this._inertiaBuffer[this._inertiaBuffer.length - 1];\n        const duration = (lastEntry.time - this._inertiaBuffer[0].time);\n\n        const easeOptions = {} as any;\n\n        if (deltas.pan.mag()) {\n            const result = calculateEasing(deltas.pan.mag(), duration, extend({}, defaultPanInertiaOptions, panInertiaOptions || {}));\n            const finalPan = deltas.pan.mult(result.amount / deltas.pan.mag());\n            const computedEaseOptions = this._map.cameraHelper.handlePanInertia(finalPan, this._map.transform);\n            easeOptions.center = computedEaseOptions.easingCenter;\n            easeOptions.offset = computedEaseOptions.easingOffset;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.zoom) {\n            const result = calculateEasing(deltas.zoom, duration, defaultZoomInertiaOptions);\n            const zoom = evaluateZoomSnap(this._map.transform.zoom + result.amount, this._map.getZoomSnap(), result.amount);\n            easeOptions.zoom = zoom;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.bearing) {\n            const result = calculateEasing(deltas.bearing, duration, defaultBearingInertiaOptions);\n            easeOptions.bearing = this._map.transform.bearing + clamp(result.amount, -179, 179);\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.pitch) {\n            const result = calculateEasing(deltas.pitch, duration, defaultPitchInertiaOptions);\n            easeOptions.pitch = this._map.transform.pitch + result.amount;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.roll) {\n            const result = calculateEasing(deltas.roll, duration, defaultRollInertiaOptions);\n            easeOptions.roll = this._map.transform.roll + clamp(result.amount, -179, 179);\n            extendDuration(easeOptions, result);\n        }\n\n        if (easeOptions.zoom || easeOptions.bearing) {\n            const last = deltas.pinchAround === undefined ? deltas.around : deltas.pinchAround;\n            easeOptions.around = last ? this._map.unproject(last) : this._map.getCenter();\n        }\n\n        this.clear();\n        return extend(easeOptions, {\n            noMoveStart: true\n        });\n\n    }\n}\n\n// Unfortunately zoom, bearing, etc can't have different durations and easings so\n// we need to choose one. We use the longest duration and it's corresponding easing.\nfunction extendDuration(easeOptions, result) {\n    if (!easeOptions.duration || easeOptions.duration < result.duration) {\n        easeOptions.duration = result.duration;\n        easeOptions.easing = result.easing;\n    }\n}\n\nfunction calculateEasing(amount, inertiaDuration: number, inertiaOptions) {\n    const {maxSpeed, linearity, deceleration} = inertiaOptions;\n    const speed = clamp(\n        amount * linearity / (inertiaDuration / 1000),\n        -maxSpeed,\n        maxSpeed);\n    const duration = Math.abs(speed) / (deceleration * linearity);\n    return {\n        easing: inertiaOptions.easing,\n        duration: duration * 1000,\n        amount: speed * (duration / 2)\n    };\n}\n","import {Event} from '../util/evented';\n\nimport {DOM} from '../util/dom';\nimport Point from '@mapbox/point-geometry';\nimport {extend} from '../util/util';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\n\nimport type {Map} from './map';\nimport type {LngLat} from '../geo/lng_lat';\nimport type {ProjectionSpecification, SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {type GeoJSONSourceShouldReloadTileOptions} from '../source/geojson_source';\n\n/**\n * An event from the mouse relevant to a specific layer.\n *\n * @group Event Related\n */\nexport type MapLayerMouseEvent = MapMouseEvent & { features?: MapGeoJSONFeature[] };\n\n/**\n * An event from a touch device relevant to a specific layer.\n *\n * @group Event Related\n */\nexport type MapLayerTouchEvent = MapTouchEvent & { features?: MapGeoJSONFeature[] };\n\n/**\n * The source event data type\n */\nexport type MapSourceDataType = 'content' | 'metadata' | 'visibility' | 'idle';\n\n/**\n * `MapLayerEventType` - a mapping between the event name and the event.\n * !!! note\n *     These events are compatible with the optional `layerId` parameter.\n * If `layerId` is included as the second argument in {@link Map.on}, the event listener will fire only when the\n * event action contains a visible portion of the specified layer.\n * The following example can be used for all the events.\n *\n * @group Event Related\n * @example\n * ```ts\n * // Initialize the map\n * let map = new Map({ // map options });\n * // Set an event listener for a specific layer\n * map.on('the-event-name', 'poi-label', (e) => {\n *   console.log('An event has occurred on a visible portion of the poi-label layer');\n * });\n * ```\n */\nexport type MapLayerEventType = {\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released contains a visible portion of the specified layer.\n     *\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     */\n    click: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released twice contains a visible portion of the specified layer.\n     *\n     * !!! note\n     *     Under normal conditions, this event will be preceded by two `click` events.\n     */\n    dblclick: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed while inside a visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    mousedown: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is released while inside a visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    mouseup: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved while the cursor is inside a visible portion of the specified layer.\n     * As you move the cursor across the layer, the event will fire every time the cursor changes position within that layer.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Animate symbol to follow the mouse](https://maplibre.org/maplibre-gl-js/docs/examples/animate-symbol-to-follow-the-mouse/)\n     */\n    mousemove: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from\n     * outside that layer or outside the map canvas.\n     *\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     */\n    mouseenter: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves\n     * the map canvas.\n     *\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     */\n    mouseleave: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved inside a visible portion of the specified layer.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     */\n    mouseover: MapLayerMouseEvent;\n    /**\n     * Fired when a point device (usually a mouse) leaves the visible portion of the specified layer.\n     */\n    mouseout: MapLayerMouseEvent;\n    /**\n     * Fired when the right button of the mouse is clicked or the context menu key is pressed within visible portion of the specified layer.\n     */\n    contextmenu: MapLayerMouseEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchstart: MapLayerTouchEvent;\n    /**\n     * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchend: MapLayerTouchEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchcancel: MapLayerTouchEvent;\n};\n\n/**\n * `MapEventType` - a mapping between the event name and the event value.\n * These events are used with the {@link Map.on} method.\n * When using a `layerId` with {@link Map.on} method, please refer to {@link MapLayerEventType}.\n * The following example can be used for all the events.\n *\n * @group Event Related\n * @example\n * ```ts\n * // Initialize the map\n * let map = new Map({ // map options });\n * // Set an event listener\n * map.on('the-event-name', () => {\n *   console.log('An event has occurred!');\n * });\n * ```\n */\nexport interface MapEventType {\n    /**\n     * Fired when an error occurs. This is GL JS's primary error reporting\n     * mechanism. We use an event instead of `throw` to better accommodate\n     * asynchronous operations. If no listeners are bound to the `error` event, the\n     * error will be printed to the console.\n     */\n    error: ErrorEvent;\n    /**\n     * Fired immediately after all necessary resources have been downloaded\n     * and the first visually complete rendering of the map has occurred.\n     *\n     * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js/docs/examples/draw-geojson-points/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-point/)\n     */\n    load: MapLibreEvent;\n    /**\n     * Fired after the last frame rendered before the map enters an\n     * \"idle\" state:\n     *\n     * - No camera transitions are in progress\n     * - All currently requested tiles have loaded\n     * - All fade/transition animations have completed\n     */\n    idle: MapLibreEvent;\n    /**\n     * Fired immediately after the map has been removed with {@link Map.remove}.\n     */\n    remove: MapLibreEvent;\n    /**\n     * Fired whenever the map is drawn to the screen, as the result of\n     *\n     * - a change to the map's position, zoom, pitch, or bearing\n     * - a change to the map's style\n     * - a change to a GeoJSON source\n     * - the loading of a vector tile, GeoJSON file, glyph, or sprite\n     */\n    render: MapLibreEvent;\n    /**\n     * Fired immediately after the map has been resized.\n     */\n    resize: MapLibreEvent;\n    /**\n     * Fired when the WebGL context is lost.\n     */\n    webglcontextlost: MapContextEvent;\n    /**\n     * Fired when the WebGL context is restored.\n     */\n    webglcontextrestored: MapContextEvent;\n    /**\n     * Fired when any map data (style, source, tile, etc) begins loading or\n     * changing asynchronously. All `dataloading` events are followed by a `data`,\n     * `dataabort` or `error` event.\n     */\n    dataloading: MapDataEvent;\n    /**\n     * Fired when any map data loads or changes. See {@link MapDataEvent} for more information.\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/display-html-clusters-with-custom-properties/)\n     */\n    data: MapDataEvent;\n    tiledataloading: MapDataEvent;\n    /**\n     * Fired when one of the map's sources begins loading or changing asynchronously.\n     * All `sourcedataloading` events are followed by a `sourcedata`, `sourcedataabort` or `error` event.\n     */\n    sourcedataloading: MapSourceDataEvent;\n    /**\n     * Fired when the map's style begins loading or changing asynchronously.\n     * All `styledataloading` events are followed by a `styledata`\n     * or `error` event.\n     */\n    styledataloading: MapStyleDataEvent;\n    /**\n     * Fired when one of the map's sources loads or changes, including if a tile belonging\n     * to a source loads or changes.\n     */\n    sourcedata: MapSourceDataEvent;\n    /**\n     * Fired when the map's style loads or changes.\n     */\n    styledata: MapStyleDataEvent;\n    /**\n     * Fired when an icon or pattern needed by the style is missing. The missing image can\n     * be added with {@link Map.addImage} within this event listener callback to prevent the image from\n     * being skipped. This event can be used to dynamically generate icons and patterns.\n     * @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/generate-and-add-a-missing-icon-to-the-map/)\n     */\n    styleimagemissing: MapStyleImageMissingEvent;\n    /**\n     * Fired when a request for one of the map's sources' tiles or data is aborted.\n     */\n    dataabort: MapDataEvent;\n    /**\n     * Fired when a request for one of the map's sources' data is aborted.\n     */\n    sourcedataabort: MapSourceDataEvent;\n    /**\n     * Fired when the user cancels a \"box zoom\" interaction, or when the bounding box does not meet the minimum size threshold.\n     * See {@link BoxZoomHandler}.\n     */\n    boxzoomcancel: MapLibreZoomEvent;\n    /**\n     * Fired when a \"box zoom\" interaction starts. See {@link BoxZoomHandler}.\n     */\n    boxzoomstart: MapLibreZoomEvent;\n    /**\n     * Fired when a \"box zoom\" interaction ends.  See {@link BoxZoomHandler}.\n     */\n    boxzoomend: MapLibreZoomEvent;\n    /**\n     * Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.\n     */\n    touchcancel: MapTouchEvent;\n    /**\n     * Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchmove: MapTouchEvent;\n    /**\n     * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchend: MapTouchEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    touchstart: MapTouchEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.\n     *\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     */\n    click: MapMouseEvent;\n    /**\n     * Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.\n     */\n    contextmenu: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on the map in rapid succession.\n     *\n     * !!! note\n     *     Under normal conditions, this event will be preceded by two `click` events.\n     */\n    dblclick: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.\n     * As you move the cursor across the map, the event will fire every time the cursor changes position within the map.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     */\n    mousemove: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is released within the map.\n     *\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    mouseup: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed within the map.\n     *\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    mousedown: MapMouseEvent;\n    /**\n     * Fired when a point device (usually a mouse) leaves the map's canvas.\n     */\n    mouseout: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved within the map.\n     * As you move the cursor across a web page containing a map,\n     * the event will fire each time it enters the map or any child elements.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-coordinates-of-the-mouse-pointer/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     */\n    mouseover: MapMouseEvent;\n    /**\n     * Fired just before the map begins a transition from one\n     * view to another, as the result of either user interaction or methods such as {@link Map.jumpTo}.\n     *\n     */\n    movestart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired repeatedly during an animated transition from one view to\n     * another, as the result of either user interaction or methods such as {@link Map.flyTo}.\n     *\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/display-html-clusters-with-custom-properties/)\n     */\n    move: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just after the map completes a transition from one\n     * view to another, as the result of either user interaction or methods such as {@link Map.jumpTo}.\n     *\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/display-html-clusters-with-custom-properties/)\n     */\n    moveend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just before the map begins a transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map.flyTo}.\n     */\n    zoomstart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired repeatedly during an animated transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map.flyTo}.\n     */\n    zoom: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just after the map completes a transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map.flyTo}.\n     */\n    zoomend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired when a \"drag to rotate\" interaction starts. See {@link DragRotateHandler}.\n     */\n    rotatestart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during a \"drag to rotate\" interaction. See {@link DragRotateHandler}.\n     */\n    rotate: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to rotate\" interaction ends. See {@link DragRotateHandler}.\n     */\n    rotateend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to pan\" interaction starts. See {@link DragPanHandler}.\n     */\n    dragstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during a \"drag to pan\" interaction. See {@link DragPanHandler}.\n     */\n    drag: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to pan\" interaction ends. See {@link DragPanHandler}.\n     * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-marker/)\n     */\n    dragend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired whenever the map's pitch (tilt) begins a change as\n     * the result of either user interaction or methods such as {@link Map.flyTo} .\n     */\n    pitchstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during the map's pitch (tilt) animation between\n     * one state and another as the result of either user interaction\n     * or methods such as {@link Map.flyTo}.\n     */\n    pitch: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired immediately after the map's pitch (tilt) finishes changing as\n     * the result of either user interaction or methods such as {@link Map.flyTo}.\n     */\n    pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.\n     */\n    wheel: MapWheelEvent;\n    /**\n     * Fired when terrain is changed\n     */\n    terrain: MapTerrainEvent;\n    /**\n     * Fired whenever the cooperativeGestures option prevents a gesture from being handled by the map.\n     * This is useful for showing your own UI when this happens.\n     */\n    cooperativegestureprevented: MapLibreEvent<WheelEvent | TouchEvent> & {\n        gestureType: 'wheel_zoom' | 'touch_pan';\n    };\n    /**\n     * Fired when map's projection is modified in other ways than by map being moved.\n     */\n    projectiontransition: MapProjectionEvent;\n};\n\n/**\n * The base event for MapLibre\n *\n * @group Event Related\n */\nexport type MapLibreEvent<TOrig = unknown> = {\n    type: keyof MapEventType | keyof MapLayerEventType;\n    target: Map;\n    originalEvent: TOrig;\n};\n\n/**\n * The style data event\n *\n * @group Event Related\n */\nexport type MapStyleDataEvent = MapLibreEvent & {\n    dataType: 'style';\n};\n\n/**\n * The source data event interface\n *\n * @group Event Related\n */\nexport type MapSourceDataEvent = MapLibreEvent & {\n    dataType: 'source';\n    /**\n     * True if the event has a `dataType` of `source` and the source has no outstanding network requests.\n     */\n    isSourceLoaded: boolean;\n    /**\n     * The [style spec representation of the source](https://maplibre.org/maplibre-style-spec/#sources) if the event has a `dataType` of `source`.\n     */\n    source: SourceSpecification;\n    sourceId: string;\n    sourceDataType: MapSourceDataType;\n    sourceDataChanged?: boolean;\n    /**\n     * The tile being loaded or changed, if the event has a `dataType` of `source` and\n     * the event is related to loading of a tile.\n     */\n    tile: any;\n\n    /**\n     * Options to determine whether a tile should be reloaded.\n     * @internal\n     */\n    shouldReloadTileOptions: GeoJSONSourceShouldReloadTileOptions;\n};\n/**\n * `MapMouseEvent` is the event type for mouse-related map events.\n *\n * @group Event Related\n *\n * @example\n * ```ts\n * // The `click` event is an example of a `MapMouseEvent`.\n * // Set up an event listener on the map.\n * map.on('click', (e) => {\n *   // The event object (e) contains information like the\n *   // coordinates of the point on the map that was clicked.\n *   console.log('A click event has occurred at ' + e.lngLat);\n * });\n * ```\n */\nexport class MapMouseEvent extends Event implements MapLibreEvent<MouseEvent> {\n    /**\n     * The event type\n     */\n    type: 'mousedown' | 'mouseup' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseenter' | 'mouseleave' | 'mouseout' | 'contextmenu';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: MouseEvent;\n\n    /**\n     * The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.\n     */\n    point: Point;\n\n    /**\n     * The geographic location on the map of the mouse cursor.\n     */\n    lngLat: LngLat;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the following default map behaviors:\n     *\n     *   * On `mousedown` events, the behavior of {@link DragPanHandler}\n     *   * On `mousedown` events, the behavior of {@link DragRotateHandler}\n     *   * On `mousedown` events, the behavior of {@link BoxZoomHandler}\n     *   * On `dblclick` events, the behavior of {@link DoubleClickZoomHandler}\n     *\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    constructor(type: string, map: Map, originalEvent: MouseEvent, data: any = {}) {\n        originalEvent = originalEvent instanceof MouseEvent ? originalEvent : new MouseEvent(type, originalEvent);\n        const point = DOM.mousePos(map.getCanvas(), originalEvent);\n        const lngLat = map.unproject(point);\n        super(type, extend({point, lngLat, originalEvent}, data));\n        this._defaultPrevented = false;\n        this.target = map;\n    }\n}\n\n/**\n * `MapTouchEvent` is the event type for touch-related map events.\n *\n * @group Event Related\n */\nexport class MapTouchEvent extends Event implements MapLibreEvent<TouchEvent> {\n    /**\n     * The event type.\n     */\n    type: 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: TouchEvent;\n\n    /**\n     * The geographic location on the map of the center of the touch event points.\n     */\n    lngLat: LngLat;\n\n    /**\n     * The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left\n     * corner.\n     */\n    point: Point;\n\n    /**\n     * The array of pixel coordinates corresponding to a\n     * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.\n     */\n    points: Array<Point>;\n\n    /**\n     * The geographical locations on the map corresponding to a\n     * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.\n     */\n    lngLats: Array<LngLat>;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the following default map behaviors:\n     *\n     *   * On `touchstart` events, the behavior of {@link DragPanHandler}\n     *   * On `touchstart` events, the behavior of {@link TwoFingersTouchZoomRotateHandler}\n     *\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    constructor(type: string, map: Map, originalEvent: TouchEvent) {\n        const touches = type === 'touchend' ? originalEvent.changedTouches : originalEvent.touches;\n        const points = DOM.touchPos(map.getCanvasContainer(), touches);\n        const lngLats = points.map((t) => map.unproject(t));\n        const point = points.reduce((prev, curr, i, arr) => {\n            return prev.add(curr.div(arr.length));\n        }, new Point(0, 0));\n        const lngLat = map.unproject(point);\n        super(type, {points, point, lngLats, lngLat, originalEvent});\n        this._defaultPrevented = false;\n    }\n}\n\n/**\n * `MapWheelEvent` is the event type for the `wheel` map event.\n *\n * @group Event Related\n */\nexport class MapWheelEvent extends Event {\n    /**\n     * The event type.\n     */\n    type: 'wheel';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: WheelEvent;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the behavior of {@link ScrollZoomHandler}.\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    /** */\n    constructor(type: string, map: Map, originalEvent: WheelEvent) {\n        super(type, {originalEvent});\n        this._defaultPrevented = false;\n    }\n}\n\n/**\n * A `MapLibreZoomEvent` is the event type for the boxzoom-related map events emitted by the {@link BoxZoomHandler}.\n *\n * @group Event Related\n */\nexport type MapLibreZoomEvent = {\n    /**\n     * The type of boxzoom event. One of `boxzoomstart`, `boxzoomend` or `boxzoomcancel`\n     */\n    type: 'boxzoomstart' | 'boxzoomend' | 'boxzoomcancel';\n    /**\n     * The `Map` instance that triggered the event\n     */\n    target: Map;\n    /**\n     * The DOM event that triggered the boxzoom event. Can be a `MouseEvent` or `KeyboardEvent`\n     */\n    originalEvent: MouseEvent;\n};\n\n/**\n * A `MapDataEvent` object is emitted with the `data`\n * and `dataloading` events. Possible values for\n * `dataType`s are:\n *\n * - `'source'`: The non-tile data associated with any source\n * - `'style'`: The [style](https://maplibre.org/maplibre-style-spec/) used by the map\n *\n * Possible values for `sourceDataType`s are:\n *\n * - `'metadata'`: indicates that any necessary source metadata has been loaded (such as TileJSON) and it is ok to start loading tiles\n * - `'content'`: indicates the source data has changed (such as when source.setData() has been called on GeoJSONSource)\n * - `'visibility'`: send when the source becomes used when at least one of its layers becomes visible in style sense (inside the layer's zoom range and with layout.visibility set to 'visible')\n * - `'idle'`: indicates that no new source data has been fetched (but the source has done loading)\n *\n * @group Event Related\n *\n * @example\n * ```ts\n * // The sourcedata event is an example of MapDataEvent.\n * // Set up an event listener on the map.\n * map.on('sourcedata', (e) => {\n *    if (e.isSourceLoaded) {\n *        // Do something when the source has finished loading\n *    }\n * });\n * ```\n */\nexport type MapDataEvent = {\n    /**\n     * The event type.\n     */\n    type: string;\n    /**\n     * The type of data that has changed. One of `'source'`, `'style'`.\n     */\n    dataType: string;\n    /**\n     *  Included if the event has a `dataType` of `source` and the event signals that internal data has been received or changed. Possible values are `metadata`, `content`, `visibility` and `idle`.\n     */\n    sourceDataType: MapSourceDataType;\n};\n\n/**\n * The terrain event\n *\n * @group Event Related\n */\nexport type MapTerrainEvent = {\n    type: 'terrain';\n};\n\n/**\n * The map projection event\n *\n * @group Event Related\n */\nexport type MapProjectionEvent = {\n    type: 'projectiontransition';\n    /**\n     * Specifies the name of the new projection.\n     * For example:\n     *\n     *  - `globe` to describe globe that has internally switched to mercator\n     *  - `vertical-perspective` to describe a globe that doesn't change to mercator\n     *  - `mercator` to describe mercator projection\n     */\n    newProjection: ProjectionSpecification['type'];\n};\n\n/**\n * An event related to the web gl context\n *\n * @group Event Related\n */\nexport type MapContextEvent = {\n    type: 'webglcontextlost' | 'webglcontextrestored';\n    originalEvent: WebGLContextEvent;\n};\n\n/**\n * The style image missing event\n *\n * @group Event Related\n *\n * @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/generate-and-add-a-missing-icon-to-the-map/)\n */\nexport type MapStyleImageMissingEvent = MapLibreEvent & {\n    type: 'styleimagemissing';\n    id: string;\n};\n","import {MapMouseEvent, MapTouchEvent, MapWheelEvent} from '../events';\nimport {type Handler} from '../handler_manager';\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\n\nexport class MapEventHandler implements Handler {\n\n    _mousedownPos: Point;\n    _clickTolerance: number;\n    _map: Map;\n\n    constructor(map: Map, options: {\n        clickTolerance: number;\n    }) {\n        this._map = map;\n        this._clickTolerance = options.clickTolerance;\n    }\n\n    reset() {\n        delete this._mousedownPos;\n    }\n\n    wheel(e: WheelEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - ScrollZoom\n        return this._firePreventable(new MapWheelEvent(e.type, this._map, e));\n    }\n\n    mousedown(e: MouseEvent, point: Point) {\n        this._mousedownPos = point;\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - MousePan\n        // - MouseRotate\n        // - MousePitch\n        // - DblclickHandler\n        return this._firePreventable(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseup(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    click(e: MouseEvent, point: Point) {\n        if (this._mousedownPos && this._mousedownPos.dist(point) >= this._clickTolerance) return;\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    dblclick(e: MouseEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - DblClickZoom\n        return this._firePreventable(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseover(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseout(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    touchstart(e: TouchEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - TouchPan\n        // - TouchZoom\n        // - TouchRotate\n        // - TouchPitch\n        // - TapZoom\n        // - SwipeZoom\n        return this._firePreventable(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchmove(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchend(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchcancel(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    _firePreventable(mapEvent: MapMouseEvent | MapTouchEvent | MapWheelEvent) {\n        this._map.fire(mapEvent);\n        if (mapEvent.defaultPrevented) {\n            // returning an object marks the handler as active and resets other handlers\n            return {};\n        }\n    }\n\n    isEnabled() {\n        return true;\n    }\n\n    isActive() {\n        return false;\n    }\n    enable() {}\n    disable() {}\n}\n\nexport class BlockableMapEventHandler {\n    _map: Map;\n    _delayContextMenu: boolean;\n    _ignoreContextMenu: boolean;\n    _contextMenuEvent: MouseEvent;\n\n    constructor(map: Map) {\n        this._map = map;\n    }\n\n    reset() {\n        this._delayContextMenu = false;\n        this._ignoreContextMenu = true;\n        delete this._contextMenuEvent;\n    }\n\n    mousemove(e: MouseEvent) {\n        // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mousedown() {\n        this._delayContextMenu = true;\n        this._ignoreContextMenu = false;\n    }\n\n    mouseup() {\n        this._delayContextMenu = false;\n        if (this._contextMenuEvent) {\n            this._map.fire(new MapMouseEvent('contextmenu', this._map, this._contextMenuEvent));\n            delete this._contextMenuEvent;\n        }\n    }\n    contextmenu(e: MouseEvent) {\n        if (this._delayContextMenu) {\n            // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake\n            this._contextMenuEvent = e;\n        } else if (!this._ignoreContextMenu) {\n            // Windows: contextmenu fired on mouseup, so fire event now\n            this._map.fire(new MapMouseEvent(e.type, this._map, e));\n        }\n\n        // prevent browser context menu when necessary\n        if (this._map.listens('contextmenu')) {\n            e.preventDefault();\n        }\n    }\n\n    isEnabled() {\n        return true;\n    }\n\n    isActive() {\n        return false;\n    }\n    enable() {}\n    disable() {}\n}\n","import type {Map} from '../map';\nimport type {PointLike} from '../camera';\nimport type {IReadonlyTransform} from '../../geo/transform_interface';\nimport Point from '@mapbox/point-geometry';\nimport {type LngLat} from '../../geo/lng_lat';\n\n/**\n * @internal\n * Shared utilities for the Handler classes to access the correct camera state.\n * If Camera.transformCameraUpdate is specified or terrain is enabled, the\n * \"desired state\" of camera may differ from the state used for rendering. The\n * handlers need the \"desired state\" to track accumulated changes.\n */\nexport class TransformProvider {\n    _map: Map;\n\n    constructor(map: Map) {\n        this._map = map;\n    }\n\n    get transform(): IReadonlyTransform {\n        return this._map._requestedCameraState || this._map.transform;\n    }\n\n    get center() {\n        return {lng: this.transform.center.lng, lat: this.transform.center.lat};\n    }\n\n    get zoom() {\n        return this.transform.zoom;\n    }\n\n    get pitch() {\n        return this.transform.pitch;\n    }\n\n    get bearing() {\n        return this.transform.bearing;\n    }\n\n    unproject(point: PointLike): LngLat {\n        return this.transform.screenPointToLocation(Point.convert(point), this._map.terrain);\n    }\n}\n","import {DOM} from '../../util/dom';\n\nimport {Event} from '../../util/evented';\nimport {TransformProvider} from './transform-provider';\n\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\nimport {type Handler} from '../handler_manager';\n\n/**\n * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.\n * The bounding box is defined by clicking and holding `shift` while dragging the cursor.\n *\n * @group Handlers\n */\nexport class BoxZoomHandler implements Handler {\n    _map: Map;\n    _tr: TransformProvider;\n    _el: HTMLElement;\n    _container: HTMLElement;\n    _enabled: boolean;\n    _active: boolean;\n    _startPos: Point;\n    _lastPos: Point;\n    _box: HTMLElement;\n    _clickTolerance: number;\n\n    /** @internal */\n    constructor(map: Map, options: {\n        clickTolerance: number;\n    }) {\n        this._map = map;\n        this._tr = new TransformProvider(map);\n        this._el = map.getCanvasContainer();\n        this._container = map.getContainer();\n        this._clickTolerance = options.clickTolerance || 1;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"box zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"box zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return !!this._enabled;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"box zoom\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"box zoom\" interaction is active.\n     */\n    isActive() {\n        return !!this._active;\n    }\n\n    /**\n     * Enables the \"box zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.boxZoom.enable();\n     * ```\n     */\n    enable() {\n        if (this.isEnabled()) return;\n        this._enabled = true;\n    }\n\n    /**\n     * Disables the \"box zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.boxZoom.disable();\n     * ```\n     */\n    disable() {\n        if (!this.isEnabled()) return;\n        this._enabled = false;\n    }\n\n    mousedown(e: MouseEvent, point: Point) {\n        if (!this.isEnabled()) return;\n        if (!(e.shiftKey && e.button === 0)) return;\n\n        DOM.disableDrag();\n        this._startPos = this._lastPos = point;\n        this._active = true;\n    }\n\n    mousemoveWindow(e: MouseEvent, point: Point) {\n        if (!this._active) return;\n\n        const pos = point;\n\n        if (this._lastPos.equals(pos) || (!this._box && pos.dist(this._startPos) < this._clickTolerance)) {\n            return;\n        }\n\n        const p0 = this._startPos;\n        this._lastPos = pos;\n\n        if (!this._box) {\n            this._box = DOM.create('div', 'maplibregl-boxzoom', this._container);\n            this._container.classList.add('maplibregl-crosshair');\n            this._fireEvent('boxzoomstart', e);\n        }\n\n        const minX = Math.min(p0.x, pos.x),\n            maxX = Math.max(p0.x, pos.x),\n            minY = Math.min(p0.y, pos.y),\n            maxY = Math.max(p0.y, pos.y);\n\n        DOM.setTransform(this._box, `translate(${minX}px,${minY}px)`);\n\n        this._box.style.width = `${maxX - minX}px`;\n        this._box.style.height = `${maxY - minY}px`;\n    }\n\n    mouseupWindow(e: MouseEvent, point: Point) {\n        if (!this._active) return;\n\n        if (e.button !== 0) return;\n\n        const p0 = this._startPos,\n            p1 = point;\n\n        this.reset();\n\n        DOM.suppressClick();\n\n        if (p0.x === p1.x && p0.y === p1.y) {\n            this._fireEvent('boxzoomcancel', e);\n        } else {\n            this._map.fire(new Event('boxzoomend', {originalEvent: e}));\n            return {\n                cameraAnimation: map => map.fitScreenCoordinates(p0, p1, this._tr.bearing, {linear: true})\n            };\n        }\n    }\n\n    keydown(e: KeyboardEvent) {\n        if (!this._active) return;\n\n        if (e.keyCode === 27) {\n            this.reset();\n            this._fireEvent('boxzoomcancel', e);\n        }\n    }\n\n    reset() {\n        this._active = false;\n\n        this._container.classList.remove('maplibregl-crosshair');\n\n        if (this._box) {\n            DOM.remove(this._box);\n            this._box = null;\n        }\n\n        DOM.enableDrag();\n\n        delete this._startPos;\n        delete this._lastPos;\n    }\n\n    _fireEvent(type: string, e: any) {\n        return this._map.fire(new Event(type, {originalEvent: e}));\n    }\n}\n","import type Point from '@mapbox/point-geometry';\n\nexport function indexTouches(touches: Array<Touch>, points: Array<Point>) {\n    if (touches.length !== points.length) throw new Error(`The number of touches and points are not equal - touches ${touches.length}, points ${points.length}`);\n    const obj = {};\n    for (let i = 0; i < touches.length; i++) {\n        obj[touches[i].identifier] = points[i];\n    }\n    return obj;\n}\n","import Point from '@mapbox/point-geometry';\nimport {indexTouches} from './handler_util';\n\nfunction getCentroid(points: Array<Point>) {\n    const sum = new Point(0, 0);\n    for (const point of points) {\n        sum._add(point);\n    }\n    return sum.div(points.length);\n}\n\nexport const MAX_TAP_INTERVAL = 500;\nconst MAX_TOUCH_TIME = 500;\nexport const MAX_DIST = 30;\n\nexport class SingleTapRecognizer {\n\n    numTouches: number;\n    centroid: Point;\n    startTime: number;\n    aborted: boolean;\n    touches: {\n        [k in number | string]: Point;\n    };\n\n    constructor(options: {\n        numTouches: number;\n    }) {\n        this.reset();\n        this.numTouches = options.numTouches;\n    }\n\n    reset() {\n        delete this.centroid;\n        delete this.startTime;\n        delete this.touches;\n        this.aborted = false;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n\n        if (this.centroid || mapTouches.length > this.numTouches) {\n            this.aborted = true;\n        }\n        if (this.aborted) {\n            return;\n        }\n\n        if (this.startTime === undefined) {\n            this.startTime = e.timeStamp;\n        }\n\n        if (mapTouches.length === this.numTouches) {\n            this.centroid = getCentroid(points);\n            this.touches = indexTouches(mapTouches, points);\n        }\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (this.aborted || !this.centroid) return;\n\n        const newTouches = indexTouches(mapTouches, points);\n        for (const id in this.touches) {\n            const prevPos = this.touches[id];\n            const pos = newTouches[id];\n            if (!pos || pos.dist(prevPos) > MAX_DIST) {\n                this.aborted = true;\n            }\n        }\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {\n            this.aborted = true;\n        }\n\n        if (mapTouches.length === 0) {\n            const centroid = !this.aborted && this.centroid;\n            this.reset();\n            if (centroid) return centroid;\n        }\n    }\n\n}\n\nexport class TapRecognizer {\n\n    singleTap: SingleTapRecognizer;\n    numTaps: number;\n    lastTime: number;\n    lastTap: Point;\n    count: number;\n\n    constructor(options: {\n        numTaps: number;\n        numTouches: number;\n    }) {\n        this.singleTap = new SingleTapRecognizer(options);\n        this.numTaps = options.numTaps;\n        this.reset();\n    }\n\n    reset() {\n        this.lastTime = Infinity;\n        delete this.lastTap;\n        this.count = 0;\n        this.singleTap.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this.singleTap.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this.singleTap.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        const tap = this.singleTap.touchend(e, points, mapTouches);\n        if (tap) {\n            const soonEnough = e.timeStamp - this.lastTime < MAX_TAP_INTERVAL;\n            const closeEnough = !this.lastTap || this.lastTap.dist(tap) < MAX_DIST;\n\n            if (!soonEnough || !closeEnough) {\n                this.reset();\n            }\n\n            this.count++;\n            this.lastTime = e.timeStamp;\n            this.lastTap = tap;\n\n            if (this.count === this.numTaps) {\n                this.reset();\n                return tap;\n            }\n        }\n    }\n}\n","import {TapRecognizer} from './tap_recognizer';\nimport type Point from '@mapbox/point-geometry';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {type Handler} from '../handler_manager';\nimport {evaluateZoomSnap} from '../../util/util';\n\n/**\n * A `TapZoomHandler` allows the user to zoom the map at a point by double tapping\n */\nexport class TapZoomHandler implements Handler {\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _zoomIn: TapRecognizer;\n    _zoomOut: TapRecognizer;\n\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        this._zoomIn = new TapRecognizer({\n            numTouches: 1,\n            numTaps: 2\n        });\n\n        this._zoomOut = new TapRecognizer({\n            numTouches: 2,\n            numTaps: 1\n        });\n\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        this._zoomIn.reset();\n        this._zoomOut.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._zoomIn.touchstart(e, points, mapTouches);\n        this._zoomOut.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._zoomIn.touchmove(e, points, mapTouches);\n        this._zoomOut.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        const zoomInPoint = this._zoomIn.touchend(e, points, mapTouches);\n        const zoomOutPoint = this._zoomOut.touchend(e, points, mapTouches);\n        const tr = this._tr;\n\n        if (zoomInPoint) {\n            this._active = true;\n            e.preventDefault();\n            setTimeout(() => this.reset(), 0);\n            return {\n                cameraAnimation: (map: Map) => map.easeTo({\n                    duration: 300,\n                    zoom: evaluateZoomSnap(tr.zoom + 1, map.getZoomSnap()),\n                    around: tr.unproject(zoomInPoint)\n                }, {originalEvent: e})\n            };\n        } else if (zoomOutPoint) {\n            this._active = true;\n            e.preventDefault();\n            setTimeout(() => this.reset(), 0);\n            return {\n                cameraAnimation: (map: Map) => map.easeTo({\n                    duration: 300,\n                    zoom: evaluateZoomSnap(tr.zoom - 1, map.getZoomSnap()),\n                    around: tr.unproject(zoomOutPoint)\n                }, {originalEvent: e})\n            };\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n","import {DOM} from '../../util/dom';\nimport type Point from '@mapbox/point-geometry';\nimport {type DragMoveStateManager} from './drag_move_state_manager';\nimport {type Handler} from '../handler_manager';\n\ninterface DragMovementResult {\n    bearingDelta?: number;\n    pitchDelta?: number;\n    rollDelta?: number;\n    around?: Point;\n    panDelta?: Point;\n}\n\nexport interface DragPanResult extends DragMovementResult {\n    around: Point;\n    panDelta: Point;\n}\n\nexport interface DragRotateResult extends DragMovementResult {\n    bearingDelta: number;\n}\n\nexport interface DragPitchResult extends DragMovementResult {\n    pitchDelta: number;\n}\n\nexport interface DragRollResult extends DragMovementResult {\n    rollDelta: number;\n}\n\ntype DragMoveFunction<T extends DragMovementResult> = (lastPoint: Point, currnetPoint: Point) => T;\n\nexport interface DragMoveHandler<T extends DragMovementResult, E extends Event> extends Handler {\n    dragStart: (e: E, point: Point) => void;\n    dragMove: (e: E, point: Point) => T | void;\n    dragEnd: (e: E) => void;\n}\n\nexport type DragMoveHandlerOptions<T, E extends Event> = {\n    /**\n     * If the movement is shorter than this value, consider it a click.\n     */\n    clickTolerance: number;\n    /**\n     * The move function to run on a valid movement.\n     */\n    move: DragMoveFunction<T>;\n    /**\n     * A class used to manage the state of the drag event - start, checking valid moves, end. See the class documentation for more details.\n     */\n    moveStateManager: DragMoveStateManager<E>;\n    /**\n     * A method used to assign the dragStart, dragMove, and dragEnd methods to the relevant event handlers, as well as assigning the contextmenu handler\n     * @param handler - the handler\n     */\n    assignEvents: (handler: DragMoveHandler<T, E>) => void;\n    /**\n     * Should the move start on the \"start\" event, or should it start on the first valid move.\n     */\n    activateOnStart?: boolean;\n    /**\n     * If true, handler will be enabled during construction\n     */\n    enable?: boolean;\n};\n\n/**\n * A generic class to create handlers for drag events, from both mouse and touch events.\n */\nexport class DragHandler<T extends DragMovementResult, E extends Event> implements DragMoveHandler<T, E> {\n    // Event handlers that may be assigned by the implementations of this class\n    contextmenu?: Handler['contextmenu'];\n    mousedown?: Handler['mousedown'];\n    mousemoveWindow?: Handler['mousemoveWindow'];\n    mouseup?: Handler['mouseup'];\n    touchstart?: Handler['touchstart'];\n    touchmoveWindow?: Handler['touchmoveWindow'];\n    touchend?: Handler['touchend'];\n\n    _clickTolerance: number;\n    _moveFunction: DragMoveFunction<T>;\n    _activateOnStart: boolean;\n    _active: boolean;\n    _enabled: boolean;\n    _moved: boolean;\n    _lastPoint: Point | null;\n    _moveStateManager: DragMoveStateManager<E>;\n\n    constructor(options: DragMoveHandlerOptions<T, E>) {\n        this._enabled = !!options.enable;\n        this._moveStateManager = options.moveStateManager;\n        this._clickTolerance = options.clickTolerance || 1;\n        this._moveFunction = options.move;\n        this._activateOnStart = !!options.activateOnStart;\n\n        options.assignEvents(this);\n\n        this.reset();\n    }\n\n    reset(e?: E) {\n        this._active = false;\n        this._moved = false;\n        delete this._lastPoint;\n        this._moveStateManager.endMove(e);\n    }\n\n    _move(...params: Parameters<DragMoveFunction<T>>) {\n        const move = this._moveFunction(...params);\n        if (move.bearingDelta || move.pitchDelta || move.rollDelta || move.around || move.panDelta) {\n            this._active = true;\n            return move;\n        }\n    }\n\n    dragStart(e: E, point: Point);\n    dragStart(e: E, point: Point[]);\n    dragStart(e: E, point: Point | Point[]) {\n        if (!this.isEnabled() || this._lastPoint) return;\n\n        if (!this._moveStateManager.isValidStartEvent(e)) return;\n        this._moveStateManager.startMove(e);\n\n        this._lastPoint = Array.isArray(point) ? point[0] : point;\n\n        if (this._activateOnStart && this._lastPoint) this._active = true;\n    }\n\n    dragMove(e: E, point: Point);\n    dragMove(e: E, point: Point[]);\n    dragMove(e: E, point: Point | Point[]) {\n        if (!this.isEnabled()) return;\n        const lastPoint = this._lastPoint;\n        if (!lastPoint) return;\n        e.preventDefault();\n\n        if (!this._moveStateManager.isValidMoveEvent(e)) {\n            this.reset(e);\n            return;\n        }\n\n        const movePoint = Array.isArray(point) ? point[0] : point;\n\n        if (!this._moved && movePoint.dist(lastPoint) < this._clickTolerance) return;\n        this._moved = true;\n        this._lastPoint = movePoint;\n\n        return this._move(lastPoint, movePoint);\n    }\n\n    dragEnd(e: E) {\n        if (!this.isEnabled() || !this._lastPoint) return;\n        if (!this._moveStateManager.isValidEndEvent(e)) return;\n        if (this._moved) DOM.suppressClick();\n        this.reset(e);\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n\n    getClickTolerance() {\n        return this._clickTolerance;\n    }\n}\n","import {DOM} from '../../util/dom';\n\nconst LEFT_BUTTON = 0;\nconst RIGHT_BUTTON = 2;\n\n// the values for each button in MouseEvent.buttons\nconst BUTTONS_FLAGS = {\n    [LEFT_BUTTON]: 1,\n    [RIGHT_BUTTON]: 2\n};\n\nfunction buttonNoLongerPressed(e: MouseEvent, button: number) {\n    const flag = BUTTONS_FLAGS[button];\n    return e.buttons === undefined || (e.buttons & flag) !== flag;\n}\n\n/*\n * Drag events are initiated by specific interaction which needs to be tracked until it ends.\n * This requires some state management:\n * 1. registering the initiating event,\n * 2. tracking that it was not canceled / not confusing it with another event firing.\n * 3. recognizing the ending event and cleaning up any internal state\n *\n * Concretely, we implement two state managers:\n * 1. MouseMoveStateManager\n *      Receives a functions that is used to recognize mouse events that should be registered as the\n *      relevant drag interactions - i.e. dragging with the right mouse button, or while CTRL is pressed.\n * 2. OneFingerTouchMoveStateManager\n *      Checks if a drag event is using one finger, and continuously tracking that this is the same event\n *      (i.e. to make sure not additional finger has started interacting with the screen before raising\n *      the first finger).\n */\nexport interface DragMoveStateManager<E extends Event> {\n    startMove: (e: E) => void;\n    endMove: (e?: E) => void;\n    isValidStartEvent: (e: E) => boolean;\n    isValidMoveEvent: (e: E) => boolean;\n    isValidEndEvent: (e?: E) => boolean;\n}\n\nexport class MouseMoveStateManager implements DragMoveStateManager<MouseEvent> {\n    _eventButton: number | undefined;\n    _correctEvent: (e: MouseEvent) => boolean;\n\n    constructor(options: {\n        checkCorrectEvent: (e: MouseEvent) => boolean;\n    }) {\n        this._correctEvent = options.checkCorrectEvent;\n    }\n\n    startMove(e: MouseEvent) {\n        const eventButton = DOM.mouseButton(e);\n        this._eventButton = eventButton;\n    }\n\n    endMove(_e?: MouseEvent) {\n        delete this._eventButton;\n    }\n\n    isValidStartEvent(e: MouseEvent) {\n        return this._correctEvent(e);\n    }\n\n    isValidMoveEvent(e: MouseEvent) {\n        // Some browsers don't fire a `mouseup` when the mouseup occurs outside\n        // the window or iframe:\n        // https://github.com/mapbox/mapbox-gl-js/issues/4622\n        //\n        // If the button is no longer pressed during this `mousemove` it may have\n        // been released outside of the window or iframe.\n        return !buttonNoLongerPressed(e, this._eventButton);\n    }\n\n    isValidEndEvent(e: MouseEvent) {\n        const eventButton = DOM.mouseButton(e);\n        return eventButton === this._eventButton;\n    }\n}\n\nexport class OneFingerTouchMoveStateManager implements DragMoveStateManager<TouchEvent> {\n    _firstTouch: number | undefined;\n\n    constructor() {\n        this._firstTouch = undefined;\n    }\n\n    _isOneFingerTouch(e: TouchEvent) {\n        return e.targetTouches.length === 1;\n    }\n\n    _isSameTouchEvent(e: TouchEvent) {\n        return e.targetTouches[0].identifier === this._firstTouch;\n    }\n\n    startMove(e: TouchEvent) {\n        const firstTouch = e.targetTouches[0].identifier;\n        this._firstTouch = firstTouch;\n    }\n\n    endMove(_e?: TouchEvent) {\n        delete this._firstTouch;\n    }\n\n    isValidStartEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e);\n    }\n\n    isValidMoveEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e) && this._isSameTouchEvent(e);\n    }\n\n    isValidEndEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e) && this._isSameTouchEvent(e);\n    }\n}\n\nexport class MouseOrTouchMoveStateManager implements DragMoveStateManager<MouseEvent | TouchEvent> {\n    constructor(\n        private mouseMoveStateManager = new MouseMoveStateManager({checkCorrectEvent: () => true}), \n        private oneFingerTouchMoveStateManager = new OneFingerTouchMoveStateManager()\n    ) {}\n\n    _executeRelevantHandler(e: MouseEvent | TouchEvent, onMouseEvent: (MouseEvent) => any, onTouchEvent: (TouchEvent) => any) {\n        if (e instanceof MouseEvent) return onMouseEvent(e);\n        if (typeof TouchEvent !== 'undefined' && e instanceof TouchEvent) return onTouchEvent(e);\n    }\n\n    startMove(e: MouseEvent | TouchEvent) {\n        this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.startMove(e),\n            e => this.oneFingerTouchMoveStateManager.startMove(e));\n    }\n\n    endMove(e?: MouseEvent | TouchEvent) {\n        this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.endMove(e),\n            e => this.oneFingerTouchMoveStateManager.endMove(e));\n    }\n\n    isValidStartEvent(e: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidStartEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidStartEvent(e));\n    }\n\n    isValidMoveEvent(e: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidMoveEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidMoveEvent(e));\n    }\n\n    isValidEndEvent(e?: MouseEvent | TouchEvent) {\n        return this._executeRelevantHandler(e,\n            e => this.mouseMoveStateManager.isValidEndEvent(e),\n            e => this.oneFingerTouchMoveStateManager.isValidEndEvent(e));\n    }\n}\n","import Point from '@mapbox/point-geometry';\n\nimport {DOM} from '../../util/dom';\nimport {type DragMoveHandler, type DragPanResult, type DragRotateResult, type DragPitchResult, DragHandler, type DragRollResult} from './drag_handler';\nimport {MouseMoveStateManager} from './drag_move_state_manager';\nimport {getAngleDelta} from '../../util/util';\n\n/**\n * `MousePanHandler` allows the user to pan the map by clicking and dragging\n */\nexport interface MousePanHandler extends DragMoveHandler<DragPanResult, MouseEvent> {}\n/**\n * `MouseRotateHandler` allows the user to rotate the map by clicking and dragging\n */\nexport interface MouseRotateHandler extends DragMoveHandler<DragRotateResult, MouseEvent> {}\n/**\n * `MousePitchHandler` allows the user to zoom the map by pitching\n */\nexport interface MousePitchHandler extends DragMoveHandler<DragPitchResult, MouseEvent> {}\n/**\n * `MouseRollHandler` allows the user to roll the camera by holding `Ctrl`, right-clicking and dragging\n */\nexport interface MouseRollHandler extends DragMoveHandler<DragRollResult, MouseEvent> {}\n\nconst LEFT_BUTTON = 0;\nconst RIGHT_BUTTON = 2;\n\nconst assignEvents = (handler: DragHandler<DragPanResult, MouseEvent>) => {\n    handler.mousedown = handler.dragStart;\n    handler.mousemoveWindow = handler.dragMove;\n    handler.mouseup = handler.dragEnd;\n    handler.contextmenu = (e: MouseEvent) => {\n        e.preventDefault();\n    };\n};\n\nexport function generateMousePanHandler({enable, clickTolerance}: {\n    clickTolerance: number;\n    enable?: boolean;\n}): MousePanHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent) => DOM.mouseButton(e) === LEFT_BUTTON && !e.ctrlKey,\n    });\n    return new DragHandler<DragPanResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({around: point, panDelta: point.sub(lastPoint)}),\n        activateOnStart: true,\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport function generateMouseRotationHandler({enable, clickTolerance, aroundCenter = true, minPixelCenterThreshold = 100, rotateDegreesPerPixelMoved = 0.8}: {\n    clickTolerance: number;\n    enable?: boolean;\n    aroundCenter?: boolean;\n    minPixelCenterThreshold?: number;\n    rotateDegreesPerPixelMoved?: number;\n}, getCenter: () => Point): MouseRotateHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (DOM.mouseButton(e) === LEFT_BUTTON && e.ctrlKey) ||\n            (DOM.mouseButton(e) === RIGHT_BUTTON && !e.ctrlKey),\n    });\n    return new DragHandler<DragRotateResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, currentPoint: Point) => {\n            const center = getCenter();\n            if (aroundCenter && Math.abs(center.y - lastPoint.y) > minPixelCenterThreshold) {\n                // Avoid rotation related to y axis since it is \"saved\" for pitch\n                return {bearingDelta: getAngleDelta(new Point(lastPoint.x, currentPoint.y), currentPoint, center)};\n            }\n            let bearingDelta = (currentPoint.x - lastPoint.x) * rotateDegreesPerPixelMoved;\n            if (aroundCenter && currentPoint.y < center.y) {\n                bearingDelta = -bearingDelta;\n            }\n            return {bearingDelta};\n        },\n        // prevent browser context menu when necessary; we don't allow it with rotation\n        // because we can't discern rotation gesture start from contextmenu on Mac\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport function generateMousePitchHandler({enable, clickTolerance, pitchDegreesPerPixelMoved = -0.5}: {\n    clickTolerance: number;\n    pitchDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}): MousePitchHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (DOM.mouseButton(e) === LEFT_BUTTON && e.ctrlKey) ||\n            (DOM.mouseButton(e) === RIGHT_BUTTON),\n    });\n    return new DragHandler<DragPitchResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) => \n            ({pitchDelta: (point.y - lastPoint.y) * pitchDegreesPerPixelMoved}),\n        // prevent browser context menu when necessary; we don't allow it with rotation\n        // because we can't discern rotation gesture start from contextmenu on Mac\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport function generateMouseRollHandler({enable, clickTolerance, rollDegreesPerPixelMoved = 0.3}: {\n    clickTolerance: number;\n    rollDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}, getCenter: () => Point): MouseRollHandler {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (DOM.mouseButton(e) === RIGHT_BUTTON && e.ctrlKey),\n    });\n    return new DragHandler<DragRollResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, currentPoint: Point) => {\n            const center = getCenter();\n            let rollDelta = (currentPoint.x - lastPoint.x) * rollDegreesPerPixelMoved;\n            if (currentPoint.y < center.y) {\n                rollDelta = -rollDelta;\n            }\n            return {rollDelta};\n        },\n        // prevent browser context menu when necessary; we don't allow it with roll\n        // because we can't discern roll gesture start from contextmenu on Mac\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n","import Point from '@mapbox/point-geometry';\nimport {indexTouches} from './handler_util';\nimport {type Handler} from '../handler_manager';\nimport type {Map} from '../map';\n\n/**\n * A `TouchPanHandler` allows the user to pan the map using touch gestures.\n */\nexport class TouchPanHandler implements Handler {\n\n    _enabled: boolean;\n    _active: boolean;\n    _touches: {\n        [k in string | number]: Point;\n    };\n    _clickTolerance: number;\n    _sum: Point;\n    _map: Map;\n\n    constructor(options: {clickTolerance: number}, map: Map) {\n        this._clickTolerance = options.clickTolerance || 1;\n        this._map = map;\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        this._touches = {};\n        this._sum = new Point(0, 0);\n    }\n\n    _shouldBePrevented(touchesCount: number) {\n        const minTouches = this._map.cooperativeGestures.isEnabled() ? 2 : 1;\n        return touchesCount < minTouches;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        return this._calculateTransform(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._active) return;\n        if (this._shouldBePrevented(mapTouches.length)) {\n            this._map.cooperativeGestures.notifyGestureBlocked('touch_pan', e);\n            return;\n        }\n        e.preventDefault();\n        return this._calculateTransform(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._calculateTransform(e, points, mapTouches);\n\n        if (this._active && this._shouldBePrevented(mapTouches.length)) {\n            this.reset();\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    _calculateTransform(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (mapTouches.length > 0) this._active = true;\n\n        const touches = indexTouches(mapTouches, points);\n\n        const touchPointSum = new Point(0, 0);\n        const touchDeltaSum = new Point(0, 0);\n        let touchDeltaCount = 0;\n\n        for (const identifier in touches) {\n            const point = touches[identifier];\n            const prevPoint = this._touches[identifier];\n            if (prevPoint) {\n                touchPointSum._add(point);\n                touchDeltaSum._add(point.sub(prevPoint));\n                touchDeltaCount++;\n                touches[identifier] = point;\n            }\n        }\n\n        this._touches = touches;\n\n        if (this._shouldBePrevented(touchDeltaCount) || !touchDeltaSum.mag()) return;\n\n        const panDelta = touchDeltaSum.div(touchDeltaCount);\n        this._sum._add(panDelta);\n        if (this._sum.mag() < this._clickTolerance) return;\n\n        const around = touchPointSum.div(touchDeltaCount);\n\n        return {\n            around,\n            panDelta\n        };\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n","import type Point from '@mapbox/point-geometry';\nimport {DOM} from '../../util/dom';\nimport type {Map} from '../map';\nimport {type Handler, type HandlerResult} from '../handler_manager';\n\n/**\n * An options object sent to the enable function of some of the handlers\n */\nexport type AroundCenterOptions = {\n    /**\n     * If \"center\" is passed, map will zoom around the center of map\n     */\n    around: 'center';\n};\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to zoom, pitch and rotate the map using two fingers\n *\n */\nabstract class TwoFingersTouchHandler implements Handler {\n\n    _enabled?: boolean;\n    _active?: boolean;\n    _firstTwoTouches?: [number, number];\n    _vector?: Point;\n    _startVector?: Point;\n    _aroundCenter?: boolean;\n\n    /** @internal */\n    constructor() {\n        this.reset();\n    }\n\n    reset(): void {\n        this._active = false;\n        delete this._firstTwoTouches;\n    }\n\n    abstract _start(points: [Point, Point]): void;\n    abstract _move(points: [Point, Point], pinchAround: Point | null, e: TouchEvent): HandlerResult | void;\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        if (this._firstTwoTouches || mapTouches.length < 2) return;\n\n        this._firstTwoTouches = [\n            mapTouches[0].identifier,\n            mapTouches[1].identifier\n        ];\n\n        // implemented by child classes\n        this._start([points[0], points[1]]);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): HandlerResult | void {\n        if (!this._firstTwoTouches) return;\n\n        e.preventDefault();\n\n        const [idA, idB] = this._firstTwoTouches;\n        const a = getTouchById(mapTouches, points, idA);\n        const b = getTouchById(mapTouches, points, idB);\n        if (!a || !b) return;\n        const pinchAround = this._aroundCenter ? null : a.add(b).div(2);\n\n        // implemented by child classes\n        return this._move([a, b], pinchAround, e);\n\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        if (!this._firstTwoTouches) return;\n\n        const [idA, idB] = this._firstTwoTouches;\n        const a = getTouchById(mapTouches, points, idA);\n        const b = getTouchById(mapTouches, points, idB);\n        if (a && b) return;\n\n        if (this._active) DOM.suppressClick();\n\n        this.reset();\n    }\n\n    touchcancel(): void {\n        this.reset();\n    }\n\n    /**\n     * Enables the \"drag to pitch\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchPitch.enable();\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean | null): void {\n        this._enabled = true;\n        this._aroundCenter = !!options && (options as AroundCenterOptions).around === 'center';\n    }\n\n    /**\n     * Disables the \"drag to pitch\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchPitch.disable();\n     * ```\n     */\n    disable(): void {\n        this._enabled = false;\n        this.reset();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pitch\" interaction is enabled.\n     *\n     * @returns  `true` if the \"drag to pitch\" interaction is enabled.\n     */\n    isEnabled(): boolean {\n        return !!this._enabled;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pitch\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to pitch\" interaction is active.\n     */\n    isActive(): boolean {\n        return !!this._active;\n    }\n}\n\nfunction getTouchById(mapTouches: Array<Touch>, points: Array<Point>, identifier: number): Point | undefined {\n    for (let i = 0; i < mapTouches.length; i++) {\n        if (mapTouches[i].identifier === identifier) return points[i];\n    }\n    return undefined;\n}\n\n/* ZOOM */\n\nconst ZOOM_THRESHOLD = 0.1;\n\nfunction getZoomDelta(distance: number, lastDistance: number): number {\n    return Math.log(distance / lastDistance) / Math.LN2;\n}\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to zoom the map two fingers\n *\n * @group Handlers\n */\nexport class TwoFingersTouchZoomHandler extends TwoFingersTouchHandler {\n\n    _distance?: number;\n    _startDistance?: number;\n\n    reset() {\n        super.reset();\n        delete this._distance;\n        delete this._startDistance;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._startDistance = this._distance = points[0].dist(points[1]);\n    }\n\n    _move(points: [Point, Point], pinchAround: Point | null): HandlerResult | void {\n        const lastDistance = this._distance!;\n        this._distance = points[0].dist(points[1]);\n        if (!this._active && Math.abs(getZoomDelta(this._distance, this._startDistance!)) < ZOOM_THRESHOLD) return;\n        this._active = true;\n        return {\n            zoomDelta: getZoomDelta(this._distance, lastDistance),\n            pinchAround\n        };\n    }\n}\n\n/* ROTATE */\n\nconst ROTATION_THRESHOLD = 25; // pixels along circumference of touch circle\n\nfunction getBearingDelta(a: Point, b: Point): number {\n    return a.angleWith(b) * 180 / Math.PI;\n}\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to rotate the map two fingers\n *\n * @group Handlers\n */\nexport class TwoFingersTouchRotateHandler extends TwoFingersTouchHandler {\n    _minDiameter?: number;\n\n    reset(): void {\n        super.reset();\n        delete this._minDiameter;\n        delete this._startVector;\n        delete this._vector;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._startVector = this._vector = points[0].sub(points[1]);\n        this._minDiameter = points[0].dist(points[1]);\n    }\n\n    _move(points: [Point, Point], pinchAround: Point | null, _e: TouchEvent): HandlerResult | void {\n        const lastVector = this._vector!;\n        this._vector = points[0].sub(points[1]);\n\n        if (!this._active && this._isBelowThreshold(this._vector)) return;\n        this._active = true;\n\n        return {\n            bearingDelta: getBearingDelta(this._vector, lastVector),\n            pinchAround\n        };\n    }\n\n    _isBelowThreshold(vector: Point): boolean {\n        /*\n         * The threshold before a rotation actually happens is configured in\n         * pixels along the circumference of the circle formed by the two fingers.\n         * This makes the threshold in degrees larger when the fingers are close\n         * together and smaller when the fingers are far apart.\n         *\n         * Use the smallest diameter from the whole gesture to reduce sensitivity\n         * when pinching in and out.\n         */\n\n        this._minDiameter = Math.min(this._minDiameter!, vector.mag());\n        const circumference = Math.PI * this._minDiameter;\n        const threshold = ROTATION_THRESHOLD / circumference * 360;\n\n        const bearingDeltaSinceStart = getBearingDelta(vector, this._startVector!);\n        return Math.abs(bearingDeltaSinceStart) < threshold;\n    }\n}\n\n/* PITCH */\n\nfunction isVertical(vector: Point): boolean {\n    return Math.abs(vector.y) > Math.abs(vector.x);\n}\n\nconst ALLOWED_SINGLE_TOUCH_TIME = 100;\n\n/**\n * The `TwoFingersTouchPitchHandler` allows the user to pitch the map by dragging up and down with two fingers.\n *\n * @group Handlers\n */\nexport class TwoFingersTouchPitchHandler extends TwoFingersTouchHandler {\n\n    _valid?: boolean;\n    _firstMove?: number;\n    _lastPoints?: [Point, Point];\n    _map: Map;\n    _currentTouchCount: number = 0;\n\n    constructor(map: Map) {\n        super();\n        this._map = map;\n    }\n\n    reset(): void {\n        super.reset();\n        this._valid = undefined;\n        delete this._firstMove;\n        delete this._lastPoints;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        super.touchstart(e, points, mapTouches);\n        this._currentTouchCount = mapTouches.length;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._lastPoints = points;\n        if (isVertical(points[0].sub(points[1]))) {\n            // fingers are more horizontal than vertical\n            this._valid = false;\n        }\n    }\n\n    _move(points: [Point, Point], center: Point | null, e: TouchEvent): HandlerResult | void {\n        // If cooperative gestures is enabled, we need a 3-finger minimum for this gesture to register\n        if (this._map.cooperativeGestures.isEnabled() && this._currentTouchCount < 3) {\n            return;\n        }\n\n        const vectorA = points[0].sub(this._lastPoints![0]);\n        const vectorB = points[1].sub(this._lastPoints![1]);\n\n        this._valid = this.gestureBeginsVertically(vectorA, vectorB, e.timeStamp);\n        if (!this._valid) return;\n\n        this._lastPoints = points;\n        this._active = true;\n        const yDeltaAverage = (vectorA.y + vectorB.y) / 2;\n        const degreesPerPixelMoved = -0.5;\n        return {\n            pitchDelta: yDeltaAverage * degreesPerPixelMoved\n        };\n    }\n\n    gestureBeginsVertically(vectorA: Point, vectorB: Point, timeStamp: number): boolean | undefined {\n        if (this._valid !== undefined) return this._valid;\n\n        const threshold = 2;\n        const movedA = vectorA.mag() >= threshold;\n        const movedB = vectorB.mag() >= threshold;\n\n        // neither finger has moved a meaningful amount, wait\n        if (!movedA && !movedB) return;\n\n        // One finger has moved and the other has not.\n        // If enough time has passed, decide it is not a pitch.\n        if (!movedA || !movedB) {\n            if (this._firstMove === undefined) {\n                this._firstMove = timeStamp;\n            }\n\n            if (timeStamp - this._firstMove < ALLOWED_SINGLE_TOUCH_TIME) {\n                // still waiting for a movement from the second finger\n                return undefined;\n            } else {\n                return false;\n            }\n        }\n\n        const isSameDirection = vectorA.y > 0 === vectorB.y > 0;\n        return isVertical(vectorA) && isVertical(vectorB) && isSameDirection;\n    }\n}\n","import {type Handler} from '../handler_manager';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {evaluateZoomSnap} from '../../util/util';\n\nconst defaultOptions = {\n    panStep: 100,\n    bearingStep: 15,\n    pitchStep: 10\n};\n\n/**\n * The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using\n * the following keyboard shortcuts:\n *\n * - `=` / `+`: Increase the zoom level by 1.\n * - `Shift-=` / `Shift-+`: Increase the zoom level by 2.\n * - `-`: Decrease the zoom level by 1.\n * - `Shift--`: Decrease the zoom level by 2.\n * - Arrow keys: Pan by 100 pixels.\n * - `Shift+â¢`: Increase the rotation by 15 degrees.\n * - `Shift+â `: Decrease the rotation by 15 degrees.\n * - `Shift+â¡`: Increase the pitch by 10 degrees.\n * - `Shift+â£`: Decrease the pitch by 10 degrees.\n *\n * @group Handlers\n */\nexport class KeyboardHandler implements Handler {\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _panStep: number;\n    _bearingStep: number;\n    _pitchStep: number;\n    _rotationDisabled: boolean;\n\n    /** @internal */\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        const stepOptions = defaultOptions;\n        this._panStep = stepOptions.panStep;\n        this._bearingStep = stepOptions.bearingStep;\n        this._pitchStep = stepOptions.pitchStep;\n        this._rotationDisabled = false;\n    }\n\n    reset() {\n        this._active = false;\n    }\n\n    keydown(e: KeyboardEvent) {\n        if (e.altKey || e.ctrlKey || e.metaKey) return;\n\n        let zoomDir = 0;\n        let bearingDir = 0;\n        let pitchDir = 0;\n        let xDir = 0;\n        let yDir = 0;\n\n        switch (e.keyCode) {\n            case 61:\n            case 107:\n            case 171:\n            case 187:\n                zoomDir = 1;\n                break;\n\n            case 189:\n            case 109:\n            case 173:\n                zoomDir = -1;\n                break;\n\n            case 37:\n                if (e.shiftKey) {\n                    bearingDir = -1;\n                } else {\n                    e.preventDefault();\n                    xDir = -1;\n                }\n                break;\n\n            case 39:\n                if (e.shiftKey) {\n                    bearingDir = 1;\n                } else {\n                    e.preventDefault();\n                    xDir = 1;\n                }\n                break;\n\n            case 38:\n                if (e.shiftKey) {\n                    pitchDir = 1;\n                } else {\n                    e.preventDefault();\n                    yDir = -1;\n                }\n                break;\n\n            case 40:\n                if (e.shiftKey) {\n                    pitchDir = -1;\n                } else {\n                    e.preventDefault();\n                    yDir = 1;\n                }\n                break;\n\n            default:\n                return;\n        }\n\n        if (this._rotationDisabled) {\n            bearingDir = 0;\n            pitchDir = 0;\n        }\n\n        return {\n            cameraAnimation: (map: Map) => {\n                const tr = this._tr;\n                map.easeTo({\n                    duration: 300,\n                    easeId: 'keyboardHandler',\n                    easing: easeOut,\n\n                    zoom: zoomDir ? evaluateZoomSnap(tr.zoom + zoomDir * (e.shiftKey ? 2 : 1), map.getZoomSnap()) : tr.zoom,\n                    bearing: tr.bearing + bearingDir * this._bearingStep,\n                    pitch: tr.pitch + pitchDir * this._pitchStep,\n                    offset: [-xDir * this._panStep, -yDir * this._panStep],\n                    center: tr.center\n                }, {originalEvent: e});\n            }\n        };\n    }\n\n    /**\n     * Enables the \"keyboard rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.enable();\n     * ```\n     */\n    enable() {\n        this._enabled = true;\n    }\n\n    /**\n     * Disables the \"keyboard rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.disable();\n     * ```\n     */\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"keyboard rotate and zoom\"\n     * interaction is enabled.\n     *\n     * @returns `true` if the \"keyboard rotate and zoom\"\n     * interaction is enabled.\n     */\n    isEnabled() {\n        return this._enabled;\n    }\n\n    /**\n     * Returns true if the handler is enabled and has detected the start of a\n     * zoom/rotate gesture.\n     *\n     * @returns `true` if the handler is enabled and has detected the\n     * start of a zoom/rotate gesture.\n     */\n    isActive() {\n        return this._active;\n    }\n\n    /**\n     * Disables the \"keyboard pan/rotate\" interaction, leaving the\n     * \"keyboard zoom\" interaction enabled.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.disableRotation();\n     * ```\n     */\n    disableRotation() {\n        this._rotationDisabled = true;\n    }\n\n    /**\n     * Enables the \"keyboard pan/rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.enable();\n     * map.keyboard.enableRotation();\n     * ```\n     */\n    enableRotation() {\n        this._rotationDisabled = false;\n    }\n}\n\nfunction easeOut(t: number) {\n    return t * (2 - t);\n}\n","import {DOM} from '../../util/dom';\n\nimport {defaultEasing, bezier, zoomScale, scaleZoom, evaluateZoomSnap} from '../../util/util';\nimport {now} from '../../util/time_control';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {LngLat} from '../../geo/lng_lat';\nimport {TransformProvider} from './transform-provider';\n\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\nimport type {AroundCenterOptions} from './two_fingers_touch';\nimport type {Handler} from '../handler_manager';\n\n// deltaY value for mouse scroll wheel identification\nconst wheelZoomDelta = 4.000244140625;\n\n// These magic numbers control the rate of zoom. Trackpad events fire at a greater\n// frequency than mouse scroll wheel, so reduce the zoom rate per wheel tick\nconst defaultZoomRate = 1 / 100;\nconst wheelZoomRate = 1 / 450;\n\n// upper bound on how much we scale the map in any single render frame; this\n// is used to limit zoom rate in the case of very fast scrolling\nconst maxScalePerFrame = 2;\n\n// Minimum time difference value to be used for calculating zoom easing in renderFrame();\n// this is used to normalise very fast (typically 0 to 0.3ms) repeating lastWheelEventTimeDiff\n// values generated by Chromium based browsers during fast scrolling wheel events.\nconst wheelEventTimeDiffAdjustment = 5;\n\n/**\n * The `ScrollZoomHandler` allows the user to zoom the map by scrolling.\n *\n * @group Handlers\n */\nexport class ScrollZoomHandler implements Handler {\n    _map: Map;\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _zooming: boolean;\n    _aroundCenter: boolean;\n    _aroundPoint: Point;\n    _type: 'wheel' | 'trackpad' | null;\n    _lastValue: number;\n    _timeout: ReturnType<typeof setTimeout>; // used for delayed-handling of a single wheel movement\n    _finishTimeout: ReturnType<typeof setTimeout>; // used to delay final '{move,zoom}end' events\n\n    _lastWheelEvent: any;\n    _lastWheelEventTime: number;\n\n    _lastExpectedZoom: number;\n    _startZoom: number;\n    _targetZoom: number;\n    _delta: number;\n    _easing: ((a: number) => number);\n    _prevEase: {\n        start: number;\n        duration: number;\n        easing: (_: number) => number;\n    };\n\n    _frameId: boolean;\n    _triggerRenderFrame: () => void;\n\n    _defaultZoomRate: number;\n    _wheelZoomRate: number;\n\n    /** @internal */\n    constructor(map: Map, triggerRenderFrame: () => void) {\n        this._map = map;\n        this._tr = new TransformProvider(map);\n        this._triggerRenderFrame = triggerRenderFrame;\n\n        this._delta = 0;\n\n        this._defaultZoomRate = defaultZoomRate;\n        this._wheelZoomRate = wheelZoomRate;\n    }\n\n    /**\n     * Set the zoom rate of a trackpad\n     * @param zoomRate - 1/100 The rate used to scale trackpad movement to a zoom value.\n     * @example\n     * Speed up trackpad zoom\n     * ```ts\n     * map.scrollZoom.setZoomRate(1/25);\n     * ```\n     */\n    setZoomRate(zoomRate: number) {\n        this._defaultZoomRate = zoomRate;\n    }\n\n    /**\n     * Set the zoom rate of a mouse wheel\n     * @param wheelZoomRate - 1/450 The rate used to scale mouse wheel movement to a zoom value.\n     * @example\n     * Slow down zoom of mouse wheel\n     * ```ts\n     * map.scrollZoom.setWheelZoomRate(1/600);\n     * ```\n     */\n    setWheelZoomRate(wheelZoomRate: number) {\n        this._wheelZoomRate = wheelZoomRate;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"scroll to zoom\" interaction is enabled.\n     * @returns `true` if the \"scroll to zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return !!this._enabled;\n    }\n\n    /*\n    * Active state is turned on and off with every scroll wheel event and is set back to false before the map\n    * render is called, so _active is not a good candidate for determining if a scroll zoom animation is in\n    * progress.\n    */\n    isActive() {\n        return !!this._active || this._finishTimeout !== undefined;\n    }\n\n    isZooming() {\n        return !!this._zooming;\n    }\n\n    /**\n     * Enables the \"scroll to zoom\" interaction.\n     *\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.scrollZoom.enable();\n     * map.scrollZoom.enable({ around: 'center' })\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean) {\n        if (this.isEnabled()) return;\n        this._enabled = true;\n        this._aroundCenter = !!options && (options as AroundCenterOptions).around === 'center';\n    }\n\n    /**\n     * Disables the \"scroll to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.scrollZoom.disable();\n     * ```\n     */\n    disable() {\n        if (!this.isEnabled()) return;\n        this._enabled = false;\n    }\n\n    /**\n     * Determines whether or not the gesture is blocked due to cooperativeGestures.\n     */\n    _shouldBePrevented(e: WheelEvent) {\n        if (!this._map.cooperativeGestures.isEnabled()) {\n            return false;\n        }\n\n        const isTrackpadPinch = e.ctrlKey;\n        const isBypassed = isTrackpadPinch || this._map.cooperativeGestures.isBypassed(e);\n\n        return !isBypassed;\n    }\n\n    wheel(e: WheelEvent) {\n        if (!this.isEnabled()) return;\n        if (this._shouldBePrevented(e)) {\n            this._map.cooperativeGestures.notifyGestureBlocked('wheel_zoom', e);\n            return;\n        }\n        let value = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? e.deltaY * 40 : e.deltaY;\n        const currentTime = now(),\n            timeDelta = currentTime - (this._lastWheelEventTime || 0);\n\n        this._lastWheelEventTime = currentTime;\n\n        if (value !== 0 && (value % wheelZoomDelta) === 0) {\n            // This one is definitely a mouse wheel event.\n            this._type = 'wheel';\n\n        } else if (value !== 0 && Math.abs(value) < 4) {\n            // This one is definitely a trackpad event because it is so small.\n            this._type = 'trackpad';\n\n        } else if (timeDelta > 400) {\n            // This is likely a new scroll action.\n            this._type = null;\n            this._lastValue = value;\n\n            // Start a timeout in case this was a singular event, and delay it by up to 40ms.\n            this._timeout = setTimeout(this._onTimeout, 40, e);\n\n        } else if (!this._type) {\n            // This is a repeating event, but we don't know the type of event just yet.\n            // If the delta per time is small, we assume it's a fast trackpad; otherwise we switch into wheel mode.\n            this._type = (Math.abs(timeDelta * value) < 200) ? 'trackpad' : 'wheel';\n\n            // Make sure our delayed event isn't fired again, because we accumulate\n            // the previous event (which was less than 40ms ago) into this event.\n            if (this._timeout) {\n                clearTimeout(this._timeout);\n                this._timeout = null;\n                value += this._lastValue;\n            }\n        }\n\n        // Slow down zoom if shift key is held for more precise zooming\n        if (e.shiftKey && value) value = value / 4;\n\n        // Only fire the callback if we actually know what type of scrolling device the user uses.\n        if (this._type) {\n            this._lastWheelEvent = e;\n            this._delta -= value;\n            if (!this._active) {\n                this._start(e);\n            }\n        }\n\n        e.preventDefault();\n    }\n\n    _onTimeout = (initialEvent: MouseEvent) => {\n        this._type = 'wheel';\n        this._delta -= this._lastValue;\n        if (!this._active) {\n            this._start(initialEvent);\n        }\n    };\n\n    _start(e: MouseEvent) {\n        if (!this._delta) return;\n\n        if (this._frameId) {\n            this._frameId = null;\n        }\n\n        this._active = true;\n        if (!this.isZooming()) {\n            this._zooming = true;\n        }\n\n        if (this._finishTimeout) {\n            clearTimeout(this._finishTimeout);\n            delete this._finishTimeout;\n        }\n\n        const pos = DOM.mousePos(this._map.getCanvas(), e);\n        const tr = this._tr;\n\n        // Whether aroundPoint is actually unprojectable is not a problem to be solved here, but in handler_manager.ts instead.\n        if (this._aroundCenter) {\n            this._aroundPoint = tr.transform.locationToScreenPoint(LngLat.convert(tr.center));\n        } else {\n            this._aroundPoint = pos;\n        }\n\n        if (!this._frameId) {\n            this._frameId = true;\n            this._triggerRenderFrame();\n        }\n    }\n\n    renderFrame() {\n        if (!this._frameId) return;\n        this._frameId = null;\n\n        if (!this.isActive()) return;\n        const tr = this._tr.transform;\n\n        // When globe is enabled zoom might be modified by the map center latitude being changes (either by panning or by zoom moving the map)\n        if (typeof this._lastExpectedZoom === 'number') {\n            const externalZoomChange = tr.zoom - this._lastExpectedZoom;\n            if (typeof this._startZoom === 'number') {\n                this._startZoom += externalZoomChange;\n            }\n            if (typeof this._targetZoom === 'number') {\n                this._targetZoom += externalZoomChange;\n            }\n        }\n\n        // if we've had scroll events since the last render frame, consume the\n        // accumulated delta, and update the target zoom level accordingly\n        if (this._delta !== 0) {\n            // For trackpad events and single mouse wheel ticks, use the default zoom rate\n            const zoomRate = (this._type === 'wheel' && Math.abs(this._delta) > wheelZoomDelta) ? this._wheelZoomRate : this._defaultZoomRate;\n            // Scale by sigmoid of scroll wheel delta so the map responds to small scrolls and compresses large scrolls\n            let scale = maxScalePerFrame / (1 + Math.exp(-Math.abs(this._delta * zoomRate)));\n\n            if (this._delta < 0 && scale !== 0) {\n                scale = 1 / scale;\n            }\n\n            const fromScale = typeof this._targetZoom !== 'number' ? tr.scale : zoomScale(this._targetZoom);\n            const target = tr.applyConstrain(tr.getCameraLngLat(), scaleZoom(fromScale * scale)).zoom;\n            const zoomSnap = this._map.getZoomSnap();\n\n            if (this._type === 'wheel' && zoomSnap > 0) {\n                const currentSnapped = evaluateZoomSnap(tr.zoom, zoomSnap);\n                this._targetZoom = evaluateZoomSnap(target, zoomSnap, target - currentSnapped);\n            } else {\n                this._targetZoom = target;\n            }\n\n            // if this is a mouse wheel, refresh the starting zoom and easing\n            // function we're using to smooth out the zooming between wheel\n            // events\n            if (this._type === 'wheel') {\n                this._startZoom = tr.zoom;\n                this._easing = this._smoothOutEasing(200);\n            }\n\n            this._delta = 0;\n        }\n\n        const targetZoom = typeof this._targetZoom !== 'number' ? tr.zoom : this._targetZoom;\n        const startZoom = this._startZoom;\n        const easing = this._easing;\n\n        let finished = false;\n        let zoom;\n\n        if (this._type === 'wheel' && startZoom && easing) {\n            const lastWheelEventTimeDiff = now() - this._lastWheelEventTime;\n\n            const t = Math.min((lastWheelEventTimeDiff + wheelEventTimeDiffAdjustment) / 200, 1);\n\n            const k = easing(t);\n            zoom = interpolates.number(startZoom, targetZoom, k);\n            if (t < 1) {\n                if (!this._frameId) {\n                    this._frameId = true;\n                }\n            } else {\n                finished = true;\n            }\n        } else {\n            zoom = targetZoom;\n            finished = true;\n        }\n\n        this._active = true;\n\n        if (finished) {\n            this._active = false;\n            this._finishTimeout = setTimeout(() => {\n                this._zooming = false;\n                this._triggerRenderFrame();\n                delete this._targetZoom;\n                delete this._lastExpectedZoom;\n                delete this._finishTimeout;\n            }, 200);\n        }\n\n        this._lastExpectedZoom = zoom;\n\n        return {\n            noInertia: true,\n            needsRenderFrame: !finished,\n            zoomDelta: zoom - tr.zoom,\n            around: this._aroundPoint,\n            originalEvent: this._lastWheelEvent\n        };\n    }\n\n    _smoothOutEasing(duration: number) {\n        let easing = defaultEasing;\n\n        if (this._prevEase) {\n            const currentEase = this._prevEase;\n            const t = (now() - currentEase.start) / currentEase.duration;\n            const speed = currentEase.easing(t + 0.01) - currentEase.easing(t);\n\n            // Quick hack to make new bezier that is continuous with last\n            const x = 0.27 / Math.sqrt(speed * speed + 0.0001) * 0.01;\n            const y = Math.sqrt(0.27 * 0.27 - x * x);\n\n            easing = bezier(x, y, 0.25, 1);\n        }\n\n        this._prevEase = {\n            start: now(),\n            duration,\n            easing\n        };\n\n        return easing;\n    }\n\n    reset() {\n        this._active = false;\n        this._zooming = false;\n        delete this._targetZoom;\n        delete this._lastExpectedZoom;\n        if (this._finishTimeout) {\n            clearTimeout(this._finishTimeout);\n            delete this._finishTimeout;\n        }\n    }\n}\n","import type {ClickZoomHandler} from '../click_zoom';\nimport type {TapZoomHandler} from './../tap_zoom';\n\n/**\n * The `DoubleClickZoomHandler` allows the user to zoom the map at a point by\n * double clicking or double tapping.\n *\n * @group Handlers\n */\nexport class DoubleClickZoomHandler {\n\n    _clickZoom: ClickZoomHandler;\n    _tapZoom: TapZoomHandler;\n\n    /** @internal */\n    constructor(clickZoom: ClickZoomHandler, TapZoom: TapZoomHandler) {\n        this._clickZoom = clickZoom;\n        this._tapZoom = TapZoom;\n    }\n\n    /**\n     * Enables the \"double click to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.doubleClickZoom.enable();\n     * ```\n     */\n    enable() {\n        this._clickZoom.enable();\n        this._tapZoom.enable();\n    }\n\n    /**\n     * Disables the \"double click to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.doubleClickZoom.disable();\n     * ```\n     */\n    disable() {\n        this._clickZoom.disable();\n        this._tapZoom.disable();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"double click to zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"double click to zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._clickZoom.isEnabled() && this._tapZoom.isEnabled();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"double click to zoom\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"double click to zoom\" interaction is active.\n     */\n    isActive() {\n        return this._clickZoom.isActive() || this._tapZoom.isActive();\n    }\n}\n","import type Point from '@mapbox/point-geometry';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {type Handler} from '../handler_manager';\nimport {evaluateZoomSnap} from '../../util/util';\n\n/**\n * The `ClickZoomHandler` allows the user to zoom the map at a point by double clicking\n * It is used by other handlers\n */\nexport class ClickZoomHandler implements Handler {\n\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n\n    /** @internal */\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n    }\n\n    dblclick(e: MouseEvent, point: Point) {\n        e.preventDefault();\n        return {\n            cameraAnimation: (map: Map) => {\n                map.easeTo({\n                    duration: 300,\n                    zoom: evaluateZoomSnap(this._tr.zoom + (e.shiftKey ? -1 : 1), map.getZoomSnap()),\n                    around: this._tr.unproject(point)\n                }, {originalEvent: e});\n            }\n        };\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n","import {type Handler} from '../handler_manager';\nimport {TapRecognizer, MAX_TAP_INTERVAL, MAX_DIST} from './tap_recognizer';\nimport type Point from '@mapbox/point-geometry';\n\n/**\n * A `TapDragZoomHandler` allows the user to zoom the map at a point by double tapping. It also allows the user pan the map by dragging.\n */\nexport class TapDragZoomHandler implements Handler {\n\n    _enabled: boolean;\n    _active: boolean;\n    _swipePoint: Point;\n    _swipeTouch: number;\n    _tapTime: number;\n    _tapPoint: Point;\n    _tap: TapRecognizer;\n\n    constructor() {\n\n        this._tap = new TapRecognizer({\n            numTouches: 1,\n            numTaps: 1\n        });\n\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        delete this._swipePoint;\n        delete this._swipeTouch;\n        delete this._tapTime;\n        delete this._tapPoint;\n        this._tap.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (this._swipePoint) return;\n\n        if (!this._tapTime) {\n            this._tap.touchstart(e, points, mapTouches);\n        } else {\n            const swipePoint = points[0];\n\n            const soonEnough = e.timeStamp - this._tapTime < MAX_TAP_INTERVAL;\n            const closeEnough =  this._tapPoint.dist(swipePoint) < MAX_DIST;\n\n            if (!soonEnough || !closeEnough) {\n                this.reset();\n            } else if (mapTouches.length > 0) {\n                this._swipePoint = swipePoint;\n                this._swipeTouch = mapTouches[0].identifier;\n            }\n        }\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._tapTime) {\n            this._tap.touchmove(e, points, mapTouches);\n        } else if (this._swipePoint) {\n            if (mapTouches[0].identifier !== this._swipeTouch) {\n                return;\n            }\n\n            const newSwipePoint = points[0];\n            const dist = newSwipePoint.y - this._swipePoint.y;\n            this._swipePoint = newSwipePoint;\n\n            e.preventDefault();\n            this._active = true;\n\n            return {\n                zoomDelta: dist / 128\n            };\n        }\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._tapTime) {\n            const point = this._tap.touchend(e, points, mapTouches);\n            if (point) {\n                this._tapTime = e.timeStamp;\n                this._tapPoint = point;\n            }\n        } else if (this._swipePoint) {\n            if (mapTouches.length === 0) {\n                this.reset();\n            }\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n","import type {MousePanHandler} from '../mouse';\nimport type {TouchPanHandler} from './../touch_pan';\n\n/**\n * A {@link DragPanHandler} options object\n */\nexport type DragPanOptions = {\n    /**\n     * factor used to scale the drag velocity\n     * @defaultValue 0\n     */\n    linearity?: number;\n    /**\n     * easing function applied to `map.panTo` when applying the drag.\n     * @param t - the easing function\n     * @defaultValue bezier(0, 0, 0.3, 1)\n     */\n    easing?: (t: number) => number;\n    /**\n     * the maximum value of the drag velocity.\n     * @defaultValue 1400\n     */\n    deceleration?: number;\n    /**\n     * the rate at which the speed reduces after the pan ends.\n     * @defaultValue 2500\n     */\n    maxSpeed?: number;\n};\n\n/**\n * The `DragPanHandler` allows the user to pan the map by clicking and dragging\n * the cursor.\n *\n * @group Handlers\n */\nexport class DragPanHandler {\n\n    _el: HTMLElement;\n    _mousePan: MousePanHandler;\n    _touchPan: TouchPanHandler;\n    _inertiaOptions: DragPanOptions | boolean;\n\n    /** @internal */\n    constructor(el: HTMLElement, mousePan: MousePanHandler, touchPan: TouchPanHandler) {\n        this._el = el;\n        this._mousePan = mousePan;\n        this._touchPan = touchPan;\n    }\n\n    /**\n     * Enables the \"drag to pan\" interaction.\n     *\n     * @param options - Options object\n     * @example\n     * ```ts\n     *   map.dragPan.enable();\n     *   map.dragPan.enable({\n     *      linearity: 0.3,\n     *      easing: bezier(0, 0, 0.3, 1),\n     *      maxSpeed: 1400,\n     *      deceleration: 2500,\n     *   });\n     * ```\n     */\n    enable(options?: DragPanOptions | boolean) {\n        this._inertiaOptions = options || {};\n        this._mousePan.enable();\n        this._touchPan.enable();\n        this._el.classList.add('maplibregl-touch-drag-pan');\n    }\n\n    /**\n     * Disables the \"drag to pan\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragPan.disable();\n     * ```\n     */\n    disable() {\n        this._mousePan.disable();\n        this._touchPan.disable();\n        this._el.classList.remove('maplibregl-touch-drag-pan');\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pan\" interaction is enabled.\n     *\n     * @returns `true` if the \"drag to pan\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._mousePan.isEnabled() && this._touchPan.isEnabled();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pan\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to pan\" interaction is active.\n     */\n    isActive() {\n        return this._mousePan.isActive() || this._touchPan.isActive();\n    }\n}\n","import type {MousePitchHandler, MouseRollHandler, MouseRotateHandler} from '../mouse';\n\n/**\n * Options object for `DragRotateHandler`.\n */\nexport type DragRotateHandlerOptions = {\n    /**\n     * Control the map pitch in addition to the bearing\n     * @defaultValue true\n     */\n    pitchWithRotate: boolean;\n    /**\n     * Control the map roll in addition to the bearing\n     * @defaultValue false\n     */\n    rollEnabled: boolean;\n};\n\n/**\n * The `DragRotateHandler` allows the user to rotate the map by clicking and\n * dragging the cursor while holding the right mouse button or `ctrl` key.\n *\n * @group Handlers\n */\nexport class DragRotateHandler {\n\n    _mouseRotate: MouseRotateHandler;\n    _mousePitch: MousePitchHandler;\n    _mouseRoll: MouseRollHandler;\n    _pitchWithRotate: boolean;\n    _rollEnabled: boolean;\n\n    /** @internal */\n    constructor(options: DragRotateHandlerOptions, mouseRotate: MouseRotateHandler, mousePitch: MousePitchHandler, mouseRoll: MouseRollHandler) {\n        this._pitchWithRotate = options.pitchWithRotate;\n        this._rollEnabled = options.rollEnabled;\n        this._mouseRotate = mouseRotate;\n        this._mousePitch = mousePitch;\n        this._mouseRoll = mouseRoll;\n    }\n\n    /**\n     * Enables the \"drag to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragRotate.enable();\n     * ```\n     */\n    enable() {\n        this._mouseRotate.enable();\n        if (this._pitchWithRotate) this._mousePitch.enable();\n        if (this._rollEnabled) this._mouseRoll.enable();\n    }\n\n    /**\n     * Disables the \"drag to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragRotate.disable();\n     * ```\n     */\n    disable() {\n        this._mouseRotate.disable();\n        this._mousePitch.disable();\n        this._mouseRoll.disable();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to rotate\" interaction is enabled.\n     *\n     * @returns `true` if the \"drag to rotate\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled()) && (!this._rollEnabled || this._mouseRoll.isEnabled());\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to rotate\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to rotate\" interaction is active.\n     */\n    isActive() {\n        return this._mouseRotate.isActive() || this._mousePitch.isActive() || this._mouseRoll.isActive();\n    }\n}\n","import type {TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, AroundCenterOptions} from '../two_fingers_touch';\nimport type {TapDragZoomHandler} from '../tap_drag_zoom';\n\n/**\n * The `TwoFingersTouchZoomRotateHandler` allows the user to zoom and rotate the map by\n * pinching on a touchscreen.\n *\n * They can zoom with one finger by double tapping and dragging. On the second tap,\n * hold the finger down and drag up or down to zoom in or out.\n *\n * @group Handlers\n */\nexport class TwoFingersTouchZoomRotateHandler {\n\n    _el: HTMLElement;\n    _touchZoom: TwoFingersTouchZoomHandler;\n    _touchRotate: TwoFingersTouchRotateHandler;\n    _tapDragZoom: TapDragZoomHandler;\n    _rotationDisabled: boolean;\n    _enabled: boolean;\n\n    /** @internal */\n    constructor(el: HTMLElement, touchZoom: TwoFingersTouchZoomHandler, touchRotate: TwoFingersTouchRotateHandler, tapDragZoom: TapDragZoomHandler) {\n        this._el = el;\n        this._touchZoom = touchZoom;\n        this._touchRotate = touchRotate;\n        this._tapDragZoom = tapDragZoom;\n        this._rotationDisabled = false;\n        this._enabled = true;\n    }\n\n    /**\n     * Enables the \"pinch to rotate and zoom\" interaction.\n     *\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.enable();\n     * map.touchZoomRotate.enable({ around: 'center' });\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean | null) {\n        this._touchZoom.enable(options);\n        if (!this._rotationDisabled) this._touchRotate.enable(options);\n        this._tapDragZoom.enable();\n        this._el.classList.add('maplibregl-touch-zoom-rotate');\n    }\n\n    /**\n     * Disables the \"pinch to rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.disable();\n     * ```\n     */\n    disable() {\n        this._touchZoom.disable();\n        this._touchRotate.disable();\n        this._tapDragZoom.disable();\n        this._el.classList.remove('maplibregl-touch-zoom-rotate');\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"pinch to rotate and zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"pinch to rotate and zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._touchZoom.isEnabled() &&\n            (this._rotationDisabled || this._touchRotate.isEnabled()) &&\n            this._tapDragZoom.isEnabled();\n    }\n\n    /**\n     * Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.\n     *\n     * @returns `true` if the handler is active, `false` otherwise\n     */\n    isActive() {\n        return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive();\n    }\n\n    /**\n     * Disables the \"pinch to rotate\" interaction, leaving the \"pinch to zoom\"\n     * interaction enabled.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.disableRotation();\n     * ```\n     */\n    disableRotation() {\n        this._rotationDisabled = true;\n        this._touchRotate.disable();\n    }\n\n    /**\n     * Enables the \"pinch to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.enable();\n     * map.touchZoomRotate.enableRotation();\n     * ```\n     */\n    enableRotation() {\n        this._rotationDisabled = false;\n        if (this._touchZoom.isEnabled()) this._touchRotate.enable();\n    }\n}\n","import {DOM} from '../../util/dom';\nimport {Event} from '../../util/evented';\nimport {type Handler} from '../handler_manager';\n\nimport type {Map} from '../map';\n\n/**\n * The {@link CooperativeGesturesHandler} options object for the gesture settings\n */\nexport type GestureOptions = boolean;\n\n/**\n * A `CooperativeGestureHandler` is a control that adds cooperative gesture info when user tries to zoom in/out.\n *\n * When the CooperativeGestureHandler blocks a gesture, it will emit a `cooperativegestureprevented` event.\n *\n * @group Handlers\n *\n * @example\n * ```ts\n * const map = new Map({\n *   cooperativeGestures: true\n * });\n * ```\n * @see [Example: cooperative gestures](https://maplibre.org/maplibre-gl-js/docs/examples/cooperative-gestures/)\n **/\nexport class CooperativeGesturesHandler implements Handler {\n    _options: GestureOptions;\n    _map: Map;\n    _container: HTMLElement;\n    /**\n     * This is the key that will allow to bypass the cooperative gesture protection\n     */\n    _bypassKey: 'metaKey' | 'ctrlKey' = navigator.userAgent.indexOf('Mac') !== -1 ? 'metaKey' : 'ctrlKey';\n    _enabled: boolean;\n\n    constructor(map: Map, options: GestureOptions) {\n        this._map = map;\n        this._options = options;\n        this._enabled = false;\n    }\n    isActive(): boolean {\n        return false;\n    }\n    reset(): void {}\n\n    _setupUI() {\n        if (this._container) return;\n        const mapCanvasContainer = this._map.getCanvasContainer();\n        // Add a cooperative gestures class (enable touch-action: pan-x pan-y;)\n        mapCanvasContainer.classList.add('maplibregl-cooperative-gestures');\n        this._container = DOM.create('div', 'maplibregl-cooperative-gesture-screen', mapCanvasContainer);\n        let desktopMessage = this._map._getUIString('CooperativeGesturesHandler.WindowsHelpText');\n        if (this._bypassKey === 'metaKey') {\n            desktopMessage = this._map._getUIString('CooperativeGesturesHandler.MacHelpText');\n        }\n        const mobileMessage = this._map._getUIString('CooperativeGesturesHandler.MobileHelpText');\n        // Create and append the desktop message div\n        const desktopDiv = document.createElement('div');\n        desktopDiv.className = 'maplibregl-desktop-message';\n        desktopDiv.textContent = desktopMessage;\n        this._container.appendChild(desktopDiv);\n        // Create and append the mobile message div\n        const mobileDiv = document.createElement('div');\n        mobileDiv.className = 'maplibregl-mobile-message';\n        mobileDiv.textContent = mobileMessage;\n        this._container.appendChild(mobileDiv);\n        // Remove cooperative gesture screen from the accessibility tree since screenreaders cannot interact with the map using gestures\n        this._container.setAttribute('aria-hidden', 'true');\n    }\n\n    _destroyUI() {\n        if (this._container) {\n            DOM.remove(this._container);\n            const mapCanvasContainer = this._map.getCanvasContainer();\n            mapCanvasContainer.classList.remove('maplibregl-cooperative-gestures');\n        }\n        delete this._container;\n    }\n\n    enable() {\n        this._setupUI();\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this._destroyUI();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isBypassed(event: MouseEvent | WheelEvent | PointerEvent) {\n        return event[this._bypassKey];\n    }\n\n    notifyGestureBlocked(gestureType: 'wheel_zoom' | 'touch_pan', originalEvent: Event) {\n        if (!this._enabled) return;\n\n        // notify subscribers that a cooperative gesture was prevented\n        this._map.fire(new Event('cooperativegestureprevented', {gestureType, originalEvent}));\n\n        // Alert user how to scroll/pan\n        this._container.classList.add('maplibregl-show');\n        setTimeout(() => {\n            this._container.classList.remove('maplibregl-show');\n        }, 100);\n    }\n}\n","import {Event} from '../util/evented';\nimport {DOM} from '../util/dom';\nimport {type Map, type CompleteMapOptions} from './map';\nimport {HandlerInertia} from './handler_inertia';\nimport {MapEventHandler, BlockableMapEventHandler} from './handler/map_event';\nimport {BoxZoomHandler} from './handler/box_zoom';\nimport {TapZoomHandler} from './handler/tap_zoom';\nimport {generateMouseRotationHandler, generateMousePitchHandler, generateMousePanHandler, generateMouseRollHandler} from './handler/mouse';\nimport {TouchPanHandler} from './handler/touch_pan';\nimport {TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, TwoFingersTouchPitchHandler} from './handler/two_fingers_touch';\nimport {KeyboardHandler} from './handler/keyboard';\nimport {ScrollZoomHandler} from './handler/scroll_zoom';\nimport {DoubleClickZoomHandler} from './handler/shim/dblclick_zoom';\nimport {ClickZoomHandler} from './handler/click_zoom';\nimport {TapDragZoomHandler} from './handler/tap_drag_zoom';\nimport {DragPanHandler} from './handler/shim/drag_pan';\nimport {DragRotateHandler} from './handler/shim/drag_rotate';\nimport {TwoFingersTouchZoomRotateHandler} from './handler/shim/two_fingers_touch';\nimport {CooperativeGesturesHandler} from './handler/cooperative_gestures';\nimport {extend, isPointableEvent, isTouchableEvent, isTouchableOrPointableType} from '../util/util';\nimport {browser} from '../util/browser';\nimport Point from '@mapbox/point-geometry';\nimport {type MapControlsDeltas} from '../geo/projection/camera_helper';\nimport type {LngLat} from '../geo/lng_lat';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {Terrain} from '../render/terrain';\n\nconst isMoving = (p: EventsInProgress) => p.zoom || p.drag || p.roll || p.pitch || p.rotate;\n\nclass RenderFrameEvent extends Event {\n    type: 'renderFrame';\n    timeStamp: number;\n}\n\n/**\n * Handlers interpret dom events and return camera changes that should be\n * applied to the map (`HandlerResult`s). The camera changes are all deltas.\n * The handler itself should have no knowledge of the map's current state.\n * This makes it easier to merge multiple results and keeps handlers simpler.\n * For example, if there is a mousedown and mousemove, the mousePan handler\n * would return a `panDelta` on the mousemove.\n */\nexport interface Handler {\n    enable(): void;\n    disable(): void;\n    isEnabled(): boolean;\n    /**\n     * This is used to indicate if the handler is currently active or not.\n     * In case a handler is active, it will block other handlers from getting the relevant events.\n     * There is an allow list of handlers that can be active at the same time, which is configured when adding a handler.\n     */\n    isActive(): boolean;\n    /**\n     * `reset` can be called by the manager at any time and must reset everything to it's original state\n     */\n    reset(): void;\n    // Handlers can optionally implement these methods.\n    // They are called with dom events whenever those dom evens are received.\n    readonly touchstart?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchmove?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchmoveWindow?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchend?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchcancel?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly mousedown?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mousemove?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mousemoveWindow?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mouseup?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mouseupWindow?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly dblclick?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly contextmenu?: (e: MouseEvent) => HandlerResult | void;\n    readonly wheel?: (e: WheelEvent, point: Point) => HandlerResult | void;\n    readonly keydown?: (e: KeyboardEvent) => HandlerResult | void;\n    readonly keyup?: (e: KeyboardEvent) => HandlerResult | void;\n    /**\n     * `renderFrame` is the only non-dom event. It is called during render\n     * frames and can be used to smooth camera changes (see scroll handler).\n     */\n    readonly renderFrame?: () => HandlerResult | void;\n}\n\n/**\n * All handler methods that are called with events can optionally return a `HandlerResult`.\n */\nexport type HandlerResult = {\n    panDelta?: Point;\n    zoomDelta?: number;\n    bearingDelta?: number;\n    pitchDelta?: number;\n    rollDelta?: number;\n    /**\n     * the point to not move when changing the camera\n     */\n    around?: Point | null;\n    /**\n     * same as above, except for pinch actions, which are given higher priority\n     */\n    pinchAround?: Point | null;\n    /**\n     * A method that can fire a one-off easing by directly changing the map's camera.\n     */\n    cameraAnimation?: (map: Map) => any;\n    /**\n     * The last three properties are needed by only one handler: scrollzoom.\n     * The DOM event to be used as the `originalEvent` on any camera change events.\n     */\n    originalEvent?: Event;\n    /**\n     * Makes the manager trigger a frame, allowing the handler to return multiple results over time (see scrollzoom).\n     */\n    needsRenderFrame?: boolean;\n    /**\n     * The camera changes won't get recorded for inertial zooming.\n     */\n    noInertia?: boolean;\n};\n\nexport type EventInProgress = {\n    handlerName: string;\n    originalEvent: Event;\n};\n\nexport type EventsInProgress = {\n    zoom?: EventInProgress;\n    roll?: EventInProgress;\n    pitch?: EventInProgress;\n    rotate?: EventInProgress;\n    drag?: EventInProgress;\n};\n\nexport type MapControlsScenarioOptions = {\n    terrain?: Terrain | null;\n    tr: ITransform;\n    deltasForHelper: MapControlsDeltas;\n    preZoomAroundLoc: LngLat;\n    combinedEventsInProgress: EventsInProgress;\n    panDelta?: Point;\n};\n\nfunction hasChange(result: HandlerResult) {\n    return (result.panDelta && result.panDelta.mag()) || result.zoomDelta || result.bearingDelta || result.pitchDelta || result.rollDelta;\n}\n\nexport class HandlerManager {\n    _map: Map;\n    _el: HTMLElement;\n    _handlers: Array<{\n        handlerName: string;\n        handler: Handler;\n        allowed: Array<string>;\n    }>;\n    _eventsInProgress: EventsInProgress;\n    _frameId: number;\n    _inertia: HandlerInertia;\n    _bearingSnap: number;\n    _handlersById: {[x: string]: Handler};\n    _updatingCamera: boolean;\n    _changes: Array<[HandlerResult, EventsInProgress, {[handlerName: string]: Event}]>;\n    _terrainMovement: boolean;\n    _zoom: {handlerName: string};\n    _previousActiveHandlers: {[x: string]: Handler};\n    _listeners: Array<[Window | Document | HTMLElement, string, {\n        passive?: boolean;\n        capture?: boolean;\n    } | undefined]>;\n\n    /**\n     * @internal\n     * The document that contains the map container element, for cross-window support.\n     */\n    get _ownerDocument(): Document {\n        return this._el?.ownerDocument || document;\n    }\n\n    /**\n     * @internal\n     * The window that contains the map container element, for cross-window support.\n     */\n    get _ownerWindow(): Window {\n        return this._el?.ownerDocument?.defaultView || window;\n    }\n\n    constructor(map: Map, options: CompleteMapOptions) {\n        this._map = map;\n        this._el = this._map.getCanvasContainer();\n        this._handlers = [];\n        this._handlersById = {};\n        this._changes = [];\n\n        this._inertia = new HandlerInertia(map);\n        this._bearingSnap = options.bearingSnap;\n        this._previousActiveHandlers = {};\n\n        // Track whether map is currently moving, to compute start/move/end events\n        this._eventsInProgress = {};\n\n        this._addDefaultHandlers(options);\n\n        const el = this._el;\n\n        this._listeners = [\n            // This needs to be `passive: true` so that a double tap fires two\n            // pairs of touchstart/end events in iOS Safari 13. If this is set to\n            // `passive: false` then the second pair of events is only fired if\n            // preventDefault() is called on the first touchstart. Calling preventDefault()\n            // undesirably prevents click events.\n            [el, 'touchstart', {passive: true}],\n            // This needs to be `passive: false` so that scrolls and pinches can be\n            // prevented in browsers that don't support `touch-actions: none`, for example iOS Safari 12.\n            [el, 'touchmove', {passive: false}],\n            [el, 'touchend', undefined],\n            [el, 'touchcancel', undefined],\n\n            [el, 'mousedown', undefined],\n            [el, 'mousemove', undefined],\n            [el, 'mouseup', undefined],\n\n            // Bind window-level event listeners for move and up/end events. In the absence of\n            // the pointer capture API, which is not supported by all necessary platforms,\n            // window-level event listeners give us the best shot at capturing events that\n            // fall outside the map canvas element. Use `{capture: true}` for the move event\n            // to prevent map move events from being fired during a drag.\n            [this._ownerDocument, 'mousemove', {capture: true}],\n            [this._ownerDocument, 'mouseup', undefined],\n\n            [el, 'mouseover', undefined],\n            [el, 'mouseout', undefined],\n            [el, 'dblclick', undefined],\n            [el, 'click', undefined],\n\n            [el, 'keydown', {capture: false}],\n            [el, 'keyup', undefined],\n\n            [el, 'wheel', {passive: false}],\n            [el, 'contextmenu', undefined],\n\n            [this._ownerWindow, 'blur', undefined]\n        ];\n\n        for (const [target, type, listenerOptions] of this._listeners) {\n            DOM.addEventListener(target, type, target === this._ownerDocument ? this.handleWindowEvent : this.handleEvent, listenerOptions);\n        }\n    }\n\n    destroy() {\n        for (const [target, type, listenerOptions] of this._listeners) {\n            DOM.removeEventListener(target, type, target === this._ownerDocument ? this.handleWindowEvent : this.handleEvent, listenerOptions);\n        }\n    }\n\n    _addDefaultHandlers(options: CompleteMapOptions) {\n        const map = this._map;\n        const el = map.getCanvasContainer();\n        this._add('mapEvent', new MapEventHandler(map, options));\n\n        const boxZoom = map.boxZoom = new BoxZoomHandler(map, options);\n        this._add('boxZoom', boxZoom);\n        if (options.interactive && options.boxZoom) {\n            boxZoom.enable();\n        }\n\n        const cooperativeGestures = map.cooperativeGestures = new CooperativeGesturesHandler(map, options.cooperativeGestures);\n        this._add('cooperativeGestures', cooperativeGestures);\n        if (options.cooperativeGestures) {\n            cooperativeGestures.enable();\n        }\n\n        const tapZoom = new TapZoomHandler(map);\n        const clickZoom = new ClickZoomHandler(map);\n        map.doubleClickZoom = new DoubleClickZoomHandler(clickZoom, tapZoom);\n        this._add('tapZoom', tapZoom);\n        this._add('clickZoom', clickZoom);\n        if (options.interactive && options.doubleClickZoom) {\n            map.doubleClickZoom.enable();\n        }\n\n        const tapDragZoom = new TapDragZoomHandler();\n        this._add('tapDragZoom', tapDragZoom);\n\n        const touchPitch = map.touchPitch = new TwoFingersTouchPitchHandler(map);\n        this._add('touchPitch', touchPitch);\n        if (options.interactive && options.touchPitch) {\n            map.touchPitch.enable(options.touchPitch);\n        }\n        const getCenter = () => map.project(map.getCenter());\n        const mouseRotate = generateMouseRotationHandler(options, getCenter);\n        const mousePitch = generateMousePitchHandler(options);\n        const mouseRoll = generateMouseRollHandler(options, getCenter);\n        map.dragRotate = new DragRotateHandler(options, mouseRotate, mousePitch, mouseRoll);\n        this._add('mouseRotate', mouseRotate, ['mousePitch']);\n        this._add('mousePitch', mousePitch, ['mouseRotate', 'mouseRoll']);\n        this._add('mouseRoll', mouseRoll, ['mousePitch']);\n        if (options.interactive && options.dragRotate) {\n            map.dragRotate.enable();\n        }\n\n        const mousePan = generateMousePanHandler(options);\n        const touchPan = new TouchPanHandler(options, map);\n        map.dragPan = new DragPanHandler(el, mousePan, touchPan);\n        this._add('mousePan', mousePan);\n        this._add('touchPan', touchPan, ['touchZoom', 'touchRotate']);\n        if (options.interactive && options.dragPan) {\n            map.dragPan.enable(options.dragPan);\n        }\n\n        const touchRotate = new TwoFingersTouchRotateHandler();\n        const touchZoom = new TwoFingersTouchZoomHandler();\n        map.touchZoomRotate = new TwoFingersTouchZoomRotateHandler(el, touchZoom, touchRotate, tapDragZoom);\n        this._add('touchRotate', touchRotate, ['touchPan', 'touchZoom']);\n        this._add('touchZoom', touchZoom, ['touchPan', 'touchRotate']);\n        if (options.interactive && options.touchZoomRotate) {\n            map.touchZoomRotate.enable(options.touchZoomRotate);\n        }\n\n        this._add('blockableMapEvent', new BlockableMapEventHandler(map));\n\n        const scrollZoom = map.scrollZoom = new ScrollZoomHandler(map, () => this._triggerRenderFrame());\n        this._add('scrollZoom', scrollZoom, ['mousePan']);\n        if (options.interactive && options.scrollZoom) {\n            map.scrollZoom.enable(options.scrollZoom);\n        }\n\n        const keyboard = map.keyboard = new KeyboardHandler(map);\n        this._add('keyboard', keyboard);\n        if (options.interactive && options.keyboard) {\n            map.keyboard.enable();\n        }\n    }\n\n    _add(handlerName: string, handler: Handler, allowed?: Array<string>) {\n        this._handlers.push({handlerName, handler, allowed});\n        this._handlersById[handlerName] = handler;\n    }\n\n    stop(allowEndAnimation: boolean) {\n        // do nothing if this method was triggered by a gesture update\n        if (this._updatingCamera) return;\n\n        for (const {handler} of this._handlers) {\n            handler.reset();\n        }\n        this._inertia.clear();\n        this._fireEvents({}, {}, allowEndAnimation);\n        this._changes = [];\n    }\n\n    isActive() {\n        for (const {handler} of this._handlers) {\n            if (handler.isActive()) return true;\n        }\n        return false;\n    }\n\n    isZooming() {\n        return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming();\n    }\n    isRotating() {\n        return !!this._eventsInProgress.rotate;\n    }\n\n    isMoving() {\n        return Boolean(isMoving(this._eventsInProgress)) || this.isZooming();\n    }\n\n    _blockedByActive(activeHandlers: {[x: string]: Handler}, allowed: Array<string>, myName: string) {\n        for (const name in activeHandlers) {\n            if (name === myName) continue;\n            if (!allowed || allowed.indexOf(name) < 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    handleWindowEvent = (e: { type: 'mousemove' | 'mouseup' | 'touchmove'}) => {\n        this.handleEvent(e, `${e.type}Window`);\n    };\n\n    _getMapTouches(touches: TouchList) {\n        const mapTouches = [];\n        for (const t of touches) {\n            const target = (t.target as any as Node);\n            if (this._el.contains(target)) {\n                mapTouches.push(t);\n            }\n        }\n        return mapTouches as any as TouchList;\n    }\n\n    handleEvent = (e: Event, eventName?: keyof Handler) => {\n\n        if (e.type === 'blur') {\n            this.stop(true);\n            return;\n        }\n\n        this._updatingCamera = true;\n\n        const inputEvent = e.type === 'renderFrame' ? undefined : e as UIEvent;\n\n        /*\n         * We don't call e.preventDefault() for any events by default.\n         * Handlers are responsible for calling it where necessary.\n         */\n\n        const mergedHandlerResult: HandlerResult = {needsRenderFrame: false};\n        const eventsInProgress: EventsInProgress = {};\n        const activeHandlers = {};\n\n        for (const {handlerName, handler, allowed} of this._handlers) {\n            if (!handler.isEnabled()) continue;\n\n            let data: HandlerResult;\n            if (this._blockedByActive(activeHandlers, allowed, handlerName)) {\n                handler.reset();\n\n            } else {\n                if (handler[eventName || e.type]) {\n                    if (isPointableEvent(e, eventName || e.type)){\n                        const point = DOM.mousePos(this._map.getCanvas(), e);\n                        data = handler[eventName || e.type](e, point);\n                    } else if (isTouchableEvent(e, eventName || e.type)) {\n                        const eventTouches = e.touches;\n                        const mapTouches = this._getMapTouches(eventTouches);\n                        const points = DOM.touchPos(this._map.getCanvas(), mapTouches);\n                        data = handler[eventName || e.type](e, points, mapTouches);\n                    } else if (!isTouchableOrPointableType(eventName || e.type)) {\n                        data = handler[eventName || e.type](e);\n                    }\n                    this.mergeHandlerResult(mergedHandlerResult, eventsInProgress, data, handlerName, inputEvent);\n                    if (data && data.needsRenderFrame) {\n                        this._triggerRenderFrame();\n                    }\n                }\n            }\n\n            if (data || handler.isActive()) {\n                activeHandlers[handlerName] = handler;\n            }\n        }\n\n        const deactivatedHandlers: {[handlerName: string]: Event} = {};\n        for (const name in this._previousActiveHandlers) {\n            if (!activeHandlers[name]) {\n                deactivatedHandlers[name] = inputEvent;\n            }\n        }\n        this._previousActiveHandlers = activeHandlers;\n\n        if (Object.keys(deactivatedHandlers).length || hasChange(mergedHandlerResult)) {\n            this._changes.push([mergedHandlerResult, eventsInProgress, deactivatedHandlers]);\n            this._triggerRenderFrame();\n        }\n\n        if (Object.keys(activeHandlers).length || hasChange(mergedHandlerResult)) {\n            this._map._stop(true);\n        }\n\n        this._updatingCamera = false;\n\n        const {cameraAnimation} = mergedHandlerResult;\n        if (cameraAnimation) {\n            this._inertia.clear();\n            this._fireEvents({}, {}, true);\n            this._changes = [];\n            cameraAnimation(this._map);\n        }\n    };\n\n    mergeHandlerResult(mergedHandlerResult: HandlerResult,\n        eventsInProgress: EventsInProgress,\n        handlerResult: HandlerResult,\n        name: string,\n        e?: UIEvent) {\n        if (!handlerResult) return;\n\n        extend(mergedHandlerResult, handlerResult);\n\n        const eventData = {handlerName: name, originalEvent: handlerResult.originalEvent || e};\n\n        // track which handler changed which camera property\n        if (handlerResult.zoomDelta !== undefined) {\n            eventsInProgress.zoom = eventData;\n        }\n        if (handlerResult.panDelta !== undefined) {\n            eventsInProgress.drag = eventData;\n        }\n        if (handlerResult.rollDelta !== undefined) {\n            eventsInProgress.roll = eventData;\n        }\n        if (handlerResult.pitchDelta !== undefined) {\n            eventsInProgress.pitch = eventData;\n        }\n        if (handlerResult.bearingDelta !== undefined) {\n            eventsInProgress.rotate = eventData;\n        }\n\n    }\n\n    _applyChanges() {\n        const combined: HandlerResult = {};\n        const combinedEventsInProgress: EventsInProgress = {};\n        const combinedDeactivatedHandlers = {};\n\n        for (const [change, eventsInProgress, deactivatedHandlers] of this._changes) {\n\n            if (change.panDelta) combined.panDelta = (combined.panDelta || new Point(0, 0))._add(change.panDelta);\n            if (change.zoomDelta) combined.zoomDelta = (combined.zoomDelta || 0) + change.zoomDelta;\n            if (change.bearingDelta) combined.bearingDelta = (combined.bearingDelta || 0) + change.bearingDelta;\n            if (change.pitchDelta) combined.pitchDelta = (combined.pitchDelta || 0) + change.pitchDelta;\n            if (change.rollDelta) combined.rollDelta = (combined.rollDelta || 0) + change.rollDelta;\n            if (change.around !== undefined) combined.around = change.around;\n            if (change.pinchAround !== undefined) combined.pinchAround = change.pinchAround;\n            if (change.noInertia) combined.noInertia = change.noInertia;\n\n            extend(combinedEventsInProgress, eventsInProgress);\n            extend(combinedDeactivatedHandlers, deactivatedHandlers);\n        }\n\n        this._updateMapTransform(combined, combinedEventsInProgress, combinedDeactivatedHandlers);\n        this._changes = [];\n    }\n\n    _updateMapTransform(combinedResult: HandlerResult,\n        combinedEventsInProgress: EventsInProgress,\n        deactivatedHandlers: {[handlerName: string]: Event}) {\n        const map = this._map;\n        const tr = map._getTransformForUpdate();\n        const terrain = map.terrain;\n\n        if (!hasChange(combinedResult) && !(terrain && this._terrainMovement)) {\n            return this._fireEvents(combinedEventsInProgress, deactivatedHandlers, true);\n        }\n\n        // stop any ongoing camera animations (easeTo, flyTo)\n        map._stop(true);\n\n        let {panDelta, zoomDelta, bearingDelta, pitchDelta, rollDelta, around, pinchAround} = combinedResult;\n\n        if (pinchAround !== undefined) {\n            around = pinchAround;\n        }\n\n        around = around || map.transform.centerPoint;\n\n        if (terrain && !tr.isPointOnMapSurface(around)) {\n            around = tr.centerPoint;\n        }\n\n        const deltasForHelper: MapControlsDeltas = {\n            panDelta,\n            zoomDelta,\n            rollDelta,\n            pitchDelta,\n            bearingDelta,\n            around,\n        };\n\n        // Pre-zoom location under the mouse cursor is required for accurate mercator panning and zooming\n        if (this._map.cameraHelper.useGlobeControls && !tr.isPointOnMapSurface(around)) {\n            around = tr.centerPoint;\n        }\n        // If we are rotating about the center point, avoid numerical issues near the horizon by using the transform's\n        // center directly, instead of computing it from the screen point\n        const preZoomAroundLoc = around.distSqr(tr.centerPoint) < 1.0e-2 ?\n            tr.center :\n            tr.screenPointToLocation(panDelta ? around.sub(panDelta) : around);\n\n        this._handleMapControls({\n            terrain,\n            tr,\n            deltasForHelper,\n            preZoomAroundLoc,\n            combinedEventsInProgress,\n            panDelta,\n        });\n\n        map._applyUpdatedTransform(tr);\n\n        this._map._update();\n        if (!combinedResult.noInertia) this._inertia.record(combinedResult);\n        this._fireEvents(combinedEventsInProgress, deactivatedHandlers, true);\n\n    }\n\n    _handleMapControls({\n        terrain,\n        tr,\n        deltasForHelper,\n        preZoomAroundLoc,\n        combinedEventsInProgress,\n        panDelta}: MapControlsScenarioOptions) {\n\n        const cameraHelper = this._map.cameraHelper;\n\n        cameraHelper.handleMapControlsRollPitchBearingZoom(deltasForHelper, tr);\n\n        if (!terrain) {\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (cameraHelper.useGlobeControls) {\n            if (!this._terrainMovement && (combinedEventsInProgress.drag || combinedEventsInProgress.zoom)) {\n                this._terrainMovement = true;\n                this._map._elevationFreeze = true;\n            }\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (!this._terrainMovement && (combinedEventsInProgress.drag || combinedEventsInProgress.zoom)) {\n            this._terrainMovement = true;\n            this._map._elevationFreeze = true;\n            cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n            return;\n        }\n\n        if (combinedEventsInProgress.drag && this._terrainMovement && panDelta) {\n            tr.setCenter(tr.screenPointToLocation(tr.centerPoint.sub(panDelta)));\n            return;\n        }\n\n        cameraHelper.handleMapControlsPan(deltasForHelper, tr, preZoomAroundLoc);\n    }\n\n    _fireEvents(newEventsInProgress: EventsInProgress, deactivatedHandlers: {[handlerName: string]: Event}, allowEndAnimation: boolean) {\n\n        const wasMoving = isMoving(this._eventsInProgress);\n        const nowMoving = isMoving(newEventsInProgress);\n\n        const startEvents = {};\n\n        for (const eventName in newEventsInProgress) {\n            const {originalEvent} = newEventsInProgress[eventName];\n            if (!this._eventsInProgress[eventName]) {\n                startEvents[`${eventName}start`] = originalEvent;\n            }\n            this._eventsInProgress[eventName] = newEventsInProgress[eventName];\n        }\n\n        // fire start events only after this._eventsInProgress has been updated\n        if (!wasMoving && nowMoving) {\n            this._fireEvent('movestart', nowMoving.originalEvent);\n        }\n\n        for (const name in startEvents) {\n            this._fireEvent(name, startEvents[name]);\n        }\n\n        if (nowMoving) {\n            this._fireEvent('move', nowMoving.originalEvent);\n        }\n\n        for (const eventName in newEventsInProgress) {\n            const {originalEvent} = newEventsInProgress[eventName];\n            this._fireEvent(eventName, originalEvent);\n        }\n\n        const endEvents = {};\n\n        let originalEndEvent;\n        for (const eventName in this._eventsInProgress) {\n            const {handlerName, originalEvent} = this._eventsInProgress[eventName];\n            if (!this._handlersById[handlerName].isActive()) {\n                delete this._eventsInProgress[eventName];\n                originalEndEvent = deactivatedHandlers[handlerName] || originalEvent;\n                endEvents[`${eventName}end`] = originalEndEvent;\n            }\n        }\n\n        for (const name in endEvents) {\n            this._fireEvent(name, endEvents[name]);\n        }\n\n        const stillMoving = isMoving(this._eventsInProgress);\n        const finishedMoving = (wasMoving || nowMoving) && !stillMoving;\n        if (finishedMoving && this._terrainMovement) {\n            this._map._elevationFreeze = false;\n            this._terrainMovement = false;\n            const tr = this._map._getTransformForUpdate();\n            if (this._map.getCenterClampedToGround()) {\n                tr.recalculateZoomAndCenter(this._map.terrain);\n            }\n            this._map._applyUpdatedTransform(tr);\n        }\n        if (allowEndAnimation && finishedMoving) {\n            this._updatingCamera = true;\n            const inertialEase = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions);\n\n            const shouldSnapToNorth = bearing => bearing !== 0 && -this._bearingSnap < bearing && bearing < this._bearingSnap;\n\n            if (inertialEase && (inertialEase.essential || !browser.prefersReducedMotion)) {\n                if (shouldSnapToNorth(inertialEase.bearing || this._map.getBearing())) {\n                    inertialEase.bearing = 0;\n                }\n                inertialEase.freezeElevation = true;\n                this._map.easeTo(inertialEase, {originalEvent: originalEndEvent});\n            } else {\n                this._map.fire(new Event('moveend', {originalEvent: originalEndEvent}));\n                if (shouldSnapToNorth(this._map.getBearing())) {\n                    this._map.resetNorth();\n                }\n            }\n            this._updatingCamera = false;\n        }\n\n    }\n\n    _fireEvent(type: string, e?: Event) {\n        this._map.fire(new Event(type, e ? {originalEvent: e} : {}));\n    }\n\n    _requestFrame() {\n        this._map.triggerRepaint();\n        return this._map._renderTaskQueue.add(timeStamp => {\n            delete this._frameId;\n            this.handleEvent(new RenderFrameEvent('renderFrame', {timeStamp}));\n            this._applyChanges();\n        });\n    }\n\n    _triggerRenderFrame() {\n        if (this._frameId === undefined) {\n            this._frameId = this._requestFrame();\n        }\n    }\n}\n","import {extend, wrap, defaultEasing, pick, scaleZoom, evaluateZoomSnap} from '../util/util';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {browser} from '../util/browser';\nimport {now} from '../util/time_control';\nimport {LngLat} from '../geo/lng_lat';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {Event, Evented} from '../util/evented';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\nimport type {Terrain} from '../render/terrain';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport type {TaskID} from '../util/task_queue';\nimport type {PaddingOptions} from '../geo/edge_insets';\nimport type {HandlerManager} from './handler_manager';\nimport type {ICameraHelper} from '../geo/projection/camera_helper';\n\n/**\n * A [Point](https://github.com/mapbox/point-geometry) or an array of two numbers representing `x` and `y` screen coordinates in pixels.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let p1 = new Point(-77, 38); // a PointLike which is a Point\n * let p2 = [-77, 38]; // a PointLike which is an array of two numbers\n * ```\n */\nexport type PointLike = Point | [number, number];\n\n/**\n * Options common to {@link Map.jumpTo}, {@link Map.easeTo}, and {@link Map.flyTo}, controlling the desired location,\n * zoom, bearing, pitch, and roll of the camera. All properties are optional, and when a property is omitted, the current\n * camera value for that property will remain unchanged.\n *\n * @example\n * Set the map's initial perspective with CameraOptions\n * ```ts\n * let map = new Map({\n *   container: 'map',\n *   style: 'https://demotiles.maplibre.org/style.json',\n *   center: [-73.5804, 45.53483],\n *   pitch: 60,\n *   bearing: -60,\n *   zoom: 10\n * });\n * ```\n * @see [Set pitch and bearing](https://maplibre.org/maplibre-gl-js/docs/examples/set-pitch-and-bearing/)\n * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to-a-series-of-locations/)\n * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/fly-to-a-location/)\n * @see [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/display-buildings-in-3d/)\n */\nexport type CameraOptions = CenterZoomBearing & {\n    /**\n     * The desired pitch in degrees. The pitch is the angle towards the horizon\n     * measured in degrees with a range between 0 and 60 degrees. For example, pitch: 0 provides the appearance\n     * of looking straight down at the map, while pitch: 60 tilts the user's perspective towards the horizon.\n     * Increasing the pitch value is often used to display 3D objects.\n     */\n    pitch?: number;\n    /**\n     * The desired roll in degrees. The roll is the angle about the camera boresight.\n     */\n    roll?: number;\n    /**\n     * The elevation of the center point in meters above sea level.\n     */\n    elevation?: number;\n};\n\n/**\n * Holds center, zoom and bearing properties\n */\nexport type CenterZoomBearing = {\n    /**\n     * The desired center.\n     */\n    center?: LngLatLike;\n    /**\n     * The desired mercator zoom level.\n     */\n    zoom?: number;\n    /**\n     * The desired bearing in degrees. The bearing is the compass direction that\n     * is \"up\". For example, `bearing: 90` orients the map so that east is up.\n     */\n    bearing?: number;\n};\n\n/**\n * The options object related to the {@link Map.jumpTo} method\n */\nexport type JumpToOptions = CameraOptions & {\n    /**\n     * Dimensions in pixels applied on each side of the viewport for shifting the vanishing point.\n     */\n    padding?: PaddingOptions;\n};\n\n/**\n * A options object for the {@link Map.cameraForBounds} method\n */\nexport type CameraForBoundsOptions = CameraOptions & {\n    /**\n     * The amount of padding in pixels to add to the given bounds.\n     */\n    padding?: number | PaddingOptions;\n    /**\n     * The center of the given bounds relative to the map's center, measured in pixels.\n     * @defaultValue [0, 0]\n     */\n    offset?: PointLike;\n    /**\n     * The maximum zoom level to allow when the camera would transition to the specified bounds.\n     */\n    maxZoom?: number;\n};\n\n/**\n * The {@link Map.flyTo} options object\n */\nexport type FlyToOptions = AnimationOptions & CameraOptions & {\n    /**\n     * The zooming \"curve\" that will occur along the\n     * flight path. A high value maximizes zooming for an exaggerated animation, while a low\n     * value minimizes zooming for an effect closer to {@link Map.easeTo}. 1.42 is the average\n     * value selected by participants in the user study discussed in\n     * [van Wijk (2003)](https://www.win.tue.nl/~vanwijk/zoompan.pdf). A value of\n     * `Math.pow(6, 0.25)` would be equivalent to the root mean squared average velocity. A\n     * value of 1 would produce a circular motion.\n     * @defaultValue 1.42\n     */\n    curve?: number;\n    /**\n     * The zero-based zoom level at the peak of the flight path. If\n     * `options.curve` is specified, this option is ignored.\n     */\n    minZoom?: number;\n    /**\n     * The average speed of the animation defined in relation to\n     * `options.curve`. A speed of 1.2 means that the map appears to move along the flight path\n     * by 1.2 times `options.curve` screenfulls every second. A _screenfull_ is the map's visible span.\n     * It does not correspond to a fixed physical distance, but varies by zoom level.\n     * @defaultValue 1.2\n     */\n    speed?: number;\n    /**\n     * The average speed of the animation measured in screenfulls\n     * per second, assuming a linear timing curve. If `options.speed` is specified, this option is ignored.\n     */\n    screenSpeed?: number;\n    /**\n     * The animation's maximum duration, measured in milliseconds.\n     * If duration exceeds maximum duration, it resets to 0.\n     */\n    maxDuration?: number;\n    /**\n     * The amount of padding in pixels to add to the given bounds.\n     */\n    padding?: number | PaddingOptions;\n};\n\n/**\n * The {@link Map.easeTo} options object\n */\nexport type EaseToOptions = AnimationOptions & CameraOptions & {\n    delayEndEvents?: number;\n    padding?: number | PaddingOptions;\n    /**\n     * If `zoom` is specified, `around` determines the point around which the zoom is centered.\n     */\n    around?: LngLatLike;\n    easeId?: string;\n    noMoveStart?: boolean;\n};\n\n/**\n * Options for {@link Map.fitBounds} method\n */\nexport type FitBoundsOptions = FlyToOptions & {\n    /**\n     * If `true`, the map transitions using {@link Map.easeTo}. If `false`, the map transitions using {@link Map.flyTo}.\n     * See those functions and {@link AnimationOptions} for information about options available.\n     * @defaultValue false\n     */\n    linear?: boolean;\n    /**\n     * The center of the given bounds relative to the map's center, measured in pixels.\n     * @defaultValue [0, 0]\n     */\n    offset?: PointLike;\n    /**\n     * The maximum zoom level to allow when the map view transitions to the specified bounds.\n     */\n    maxZoom?: number;\n};\n\n/**\n * Options common to map movement methods that involve animation, such as {@link Map.panBy} and\n * {@link Map.easeTo}, controlling the duration and easing function of the animation. All properties\n * are optional.\n *\n */\nexport type AnimationOptions = {\n    /**\n     * The animation's duration, measured in milliseconds.\n     */\n    duration?: number;\n    /**\n     * A function taking a time in the range 0..1 and returning a number where 0 is\n     * the initial state and 1 is the final state.\n     */\n    easing?: (_: number) => number;\n    /**\n     * of the target center relative to real map container center at the end of animation.\n     */\n    offset?: PointLike;\n    /**\n     * If `false`, no animation will occur.\n     */\n    animate?: boolean;\n    /**\n     * If `true`, then the animation is considered essential and will not be affected by\n     * [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/\\@media/prefers-reduced-motion).\n     */\n    essential?: boolean;\n    /**\n     * Default false. Needed in 3D maps to let the camera stay in a constant\n     * height based on sea-level. After the animation finished the zoom-level will be recalculated in respect of\n     * the distance from the camera to the center-coordinate-altitude.\n     */\n    freezeElevation?: boolean;\n};\n\n/**\n * A callback hook that allows manipulating the camera and being notified about camera updates before they happen\n */\nexport type CameraUpdateTransformFunction =  (next: {\n    center: LngLat;\n    zoom: number;\n    roll: number;\n    pitch: number;\n    bearing: number;\n    elevation: number;\n}) => {\n    center?: LngLat;\n    zoom?: number;\n    roll?: number;\n    pitch?: number;\n    bearing?: number;\n    elevation?: number;\n};\n\nexport abstract class Camera extends Evented {\n    transform: ITransform;\n    cameraHelper: ICameraHelper;\n    terrain: Terrain;\n    handlers: HandlerManager;\n\n    _moving: boolean;\n    _zooming: boolean;\n    _rotating: boolean;\n    _pitching: boolean;\n    _rolling: boolean;\n    _padding: boolean;\n\n    _bearingSnap: number;\n    _zoomSnap: number;\n    _easeStart: number;\n    _easeOptions: {\n        duration?: number;\n        easing?: (_: number) => number;\n    };\n    _easeId: string | void;\n\n    _onEaseFrame: (_: number) => void;\n    _onEaseEnd: (easeId?: string) => void;\n    _easeFrameId: TaskID;\n\n    /**\n     * @internal\n     * holds the geographical coordinate of the target\n     */\n    _elevationCenter: LngLat;\n    /**\n     * @internal\n     * holds the targ altitude value, = center elevation of the target.\n     * This value may changes during flight, because new terrain-tiles loads during flight.\n     */\n    _elevationTarget: number;\n    /**\n     * @internal\n     * holds the start altitude value, = center elevation before animation begins\n     * this value will recalculated during flight in respect of changing _elevationTarget values,\n     * so the linear interpolation between start and target keeps smooth and without jumps.\n     */\n    _elevationStart: number;\n    /**\n     * @internal\n     * Saves the current state of the elevation freeze - this is used during map movement to prevent \"rocky\" camera movement.\n     */\n    _elevationFreeze: boolean;\n    /**\n     * @internal\n     * Used to track accumulated changes during continuous interaction\n     */\n    _requestedCameraState?: ITransform;\n    /**\n     * A callback used to defer camera updates or apply arbitrary constraints.\n     * If specified, this Camera instance can be used as a stateless component in React etc.\n     */\n    transformCameraUpdate: CameraUpdateTransformFunction | null;\n\n    /**\n     * @internal\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    _centerClampedToGround: boolean;\n\n    abstract _requestRenderFrame(a: () => void): TaskID;\n    abstract _cancelRenderFrame(_: TaskID): void;\n\n    constructor(transform: ITransform, cameraHelper: ICameraHelper, options: {\n        bearingSnap: number;\n        zoomSnap: number;\n    }) {\n        super();\n        this._moving = false;\n        this._zooming = false;\n        this.transform = transform;\n        this._bearingSnap = options.bearingSnap;\n        this._zoomSnap = options.zoomSnap;\n        this.cameraHelper = cameraHelper;\n\n        this.on('moveend', () => {\n            delete this._requestedCameraState;\n        });\n    }\n\n    /**\n     * @internal\n     * Creates a new specialized transform instance from a projection instance and migrates\n     * to this new transform, carrying over all the properties of the old transform (center, pitch, etc.).\n     * When the style's projection is changed (or first set), this function should be called.\n     */\n    migrateProjection(newTransform: ITransform, newCameraHelper: ICameraHelper) {\n        newTransform.apply(this.transform, true);\n        this.transform = newTransform;\n        this.cameraHelper = newCameraHelper;\n    }\n\n    /**\n     * Returns the map's geographical centerpoint.\n     *\n     * @returns The map's geographical centerpoint.\n     * @example\n     * Return a LngLat object such as `{lng: 0, lat: 0}`\n     * ```ts\n     * let center = map.getCenter();\n     * // access longitude and latitude values directly\n     * let {lng, lat} = map.getCenter();\n     * ```\n     */\n    getCenter(): LngLat { return new LngLat(this.transform.center.lng, this.transform.center.lat); }\n\n    /**\n     * Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param center - The centerpoint to set.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * map.setCenter([-74, 38]);\n     * ```\n     */\n    setCenter(center: LngLatLike, eventData?: any) {\n        return this.jumpTo({center}, eventData);\n    }\n\n    /**\n     * Returns the elevation of the map's center point.\n     *\n     * @returns The elevation of the map's center point, in meters above sea level.\n     */\n    getCenterElevation(): number { return this.transform.elevation; }\n\n    /**\n     * Sets the elevation of the map's center point, in meters above sea level. Equivalent to `jumpTo({elevation: elevation})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param elevation - The elevation to set, in meters above sea level.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setCenterElevation(elevation: number, eventData?: any): this {\n        this.jumpTo({elevation}, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the value of `centerClampedToGround`.\n     *\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    getCenterClampedToGround(): boolean { return this._centerClampedToGround; }\n\n    /**\n     * Sets the value of `centerClampedToGround`.\n     *\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    setCenterClampedToGround(centerClampedToGround: boolean): void {\n        this._centerClampedToGround = centerClampedToGround;\n    }\n\n    /**\n     * Pans the map by the specified offset.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param offset - `x` and `y` coordinates by which to pan the map.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigate-the-map-with-game-like-controls/)\n     */\n    panBy(offset: PointLike, options?: EaseToOptions, eventData?: any): this {\n        offset = Point.convert(offset).mult(-1);\n        return this.panTo(this.transform.center, extend({offset}, options), eventData);\n    }\n\n    /**\n     * Pans the map to the specified location with an animated transition.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param lnglat - The location to pan the map to.\n     * @param options - Options describing the destination and animation of the transition.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * map.panTo([-74, 38]);\n     * // Specify that the panTo animation should last 5000 milliseconds.\n     * map.panTo([-74, 38], {duration: 5000});\n     * ```\n     * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/update-a-feature-in-realtime/)\n     */\n    panTo(lnglat: LngLatLike, options?: EaseToOptions, eventData?: any): this {\n        return this.easeTo(extend({\n            center: lnglat\n        }, options), eventData);\n    }\n\n    /**\n     * Returns the map's current zoom level.\n     *\n     * @returns The map's current zoom level.\n     * @example\n     * ```ts\n     * map.getZoom();\n     * ```\n     */\n    getZoom(): number { return this.transform.zoom; }\n\n    /**\n     * Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param zoom - The zoom level to set (0-20).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom to the zoom level 5 without an animated transition\n     * ```ts\n     * map.setZoom(5);\n     * ```\n     */\n    setZoom(zoom: number, eventData?: any): this {\n        this.jumpTo({zoom}, eventData);\n        return this;\n    }\n\n    /**\n     * Zooms the map to the specified zoom level, with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param zoom - The zoom level to transition to.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // Zoom to the zoom level 5 without an animated transition\n     * map.zoomTo(5);\n     * // Zoom to the zoom level 8 with an animated transition\n     * map.zoomTo(8, {\n     *   duration: 2000,\n     *   offset: [100, 50]\n     * });\n     * ```\n     */\n    zoomTo(zoom: number, options?: EaseToOptions | null, eventData?: any): this {\n        return this.easeTo(extend({\n            zoom\n        }, options), eventData);\n    }\n\n    /**\n     * Incrementally increases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom the map in one level with a custom animation duration\n     * ```ts\n     * map.zoomIn({duration: 1000});\n     * ```\n     */\n    zoomIn(options?: AnimationOptions, eventData?: any): this {\n        this.zoomTo(evaluateZoomSnap(this.getZoom() + 1, this._zoomSnap), options, eventData);\n        return this;\n    }\n\n    /**\n     * Decreases the map's zoom level by 1, first snapping to the nearest `zoomSnap` increment.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom the map out one level with a custom animation offset\n     * ```ts\n     * map.zoomOut({offset: [80, 60]});\n     * ```\n     */\n    zoomOut(options?: AnimationOptions, eventData?: any): this {\n        this.zoomTo(evaluateZoomSnap(this.getZoom() - 1, this._zoomSnap), options, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the map's current vertical field of view, in degrees.\n     *\n     * @returns The map's current vertical field of view.\n     * @defaultValue 36.87\n     * @example\n     * ```ts\n     * const verticalFieldOfView = map.getVerticalFieldOfView();\n     * ```\n     */\n    getVerticalFieldOfView(): number { return this.transform.fov; }\n\n    /**\n     * Sets the map's vertical field of view, in degrees.\n     *\n     * Triggers the following events: `movestart`, `move`, and `moveend`.\n     *\n     * @param fov - The vertical field of view to set, in degrees (0-180).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @defaultValue 36.87\n     * @example\n     * Change vertical field of view to 30 degrees\n     * ```ts\n     * map.setVerticalFieldOfView(30);\n     * ```\n     */\n    setVerticalFieldOfView(fov: number, eventData?: any): this {\n        if (fov != this.transform.fov) {\n            this.transform.setFov(fov);\n            this.fire(new Event('movestart', eventData))\n                .fire(new Event('move', eventData))\n                .fire(new Event('moveend', eventData));\n        }\n        return this;\n    }\n\n    /**\n     * Returns the map's current bearing. The bearing is the compass direction that is \"up\"; for example, a bearing\n     * of 90Â° orients the map so that east is up.\n     *\n     * @returns The map's current bearing.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigate-the-map-with-game-like-controls/)\n     */\n    getBearing(): number { return this.transform.bearing; }\n\n    /**\n     * Sets the map's zoom snap level.\n     *\n     * @param snap - The zoom snap level to set.\n     */\n    setZoomSnap(snap: number): this {\n        this._zoomSnap = snap;\n        return this;\n    }\n\n    /**\n     * Returns the map's current zoom snap level.\n     *\n     * @returns The map's current zoom snap level.\n     */\n    getZoomSnap(): number {\n        return this._zoomSnap;\n    }\n\n    /**\n     * Sets the map's bearing (rotation). The bearing is the compass direction that is \"up\"; for example, a bearing\n     * of 90Â° orients the map so that east is up.\n     *\n     * Equivalent to `jumpTo({bearing: bearing})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param bearing - The desired bearing.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Rotate the map to 90 degrees\n     * ```ts\n     * map.setBearing(90);\n     * ```\n     */\n    setBearing(bearing: number, eventData?: any): this {\n        this.jumpTo({bearing}, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the current padding applied around the map viewport.\n     *\n     * @returns The current padding around the map viewport.\n     */\n    getPadding(): PaddingOptions { return this.transform.padding; }\n\n    /**\n     * Sets the padding in pixels around the viewport.\n     *\n     * Equivalent to `jumpTo({padding: padding})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param padding - The desired padding.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Sets a left padding of 300px, and a top padding of 50px\n     * ```ts\n     * map.setPadding({ left: 300, top: 50 });\n     * ```\n     */\n    setPadding(padding: PaddingOptions, eventData?: any): this {\n        this.jumpTo({padding}, eventData);\n        return this;\n    }\n\n    /**\n     * Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction\n     * that is \"up\"; for example, a bearing of 90Â° orients the map so that east is up.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param bearing - The desired bearing.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    rotateTo(bearing: number, options?: EaseToOptions, eventData?: any): this {\n        return this.easeTo(extend({\n            bearing\n        }, options), eventData);\n    }\n\n    /**\n     * Rotates the map so that north is up (0Â° bearing), with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    resetNorth(options?: AnimationOptions, eventData?: any): this {\n        this.rotateTo(0, extend({duration: 1000}, options), eventData);\n        return this;\n    }\n\n    /**\n     * Rotates and pitches the map so that north is up (0Â° bearing) and pitch and roll are 0Â°, with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, `rollstart`, `roll`, `rollend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    resetNorthPitch(options?: AnimationOptions, eventData?: any): this {\n        this.easeTo(extend({\n            bearing: 0,\n            pitch: 0,\n            roll: 0,\n            duration: 1000\n        }, options), eventData);\n        return this;\n    }\n\n    /**\n     * Snaps the map so that north is up (0Â° bearing), if the current bearing is close enough to it (i.e. within the\n     * `bearingSnap` threshold).\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    snapToNorth(options?: AnimationOptions, eventData?: any): this {\n        if (Math.abs(this.getBearing()) < this._bearingSnap) {\n            return this.resetNorth(options, eventData);\n        }\n        return this;\n    }\n\n    /**\n     * Returns the map's current pitch (tilt).\n     *\n     * @returns The map's current pitch, measured in degrees away from the plane of the screen.\n     */\n    getPitch(): number { return this.transform.pitch; }\n\n    /**\n     * Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.\n     *\n     * @param pitch - The pitch to set, measured in degrees away from the plane of the screen (0-60).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setPitch(pitch: number, eventData?: any): this {\n        this.jumpTo({pitch}, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the map's current roll angle.\n     *\n     * @returns The map's current roll, measured in degrees about the camera boresight.\n     */\n    getRoll(): number { return this.transform.roll; }\n\n    /**\n     * Sets the map's roll angle. Equivalent to `jumpTo({roll: roll})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, `rollstart`, and `rollend`.\n     *\n     * @param roll - The roll to set, measured in degrees about the camera boresight\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setRoll(roll: number, eventData?: any): this {\n        this.jumpTo({roll}, eventData);\n        return this;\n    }\n\n    /**\n     * @param bounds - Calculate the center for these bounds in the viewport and use\n     * the highest zoom level up to and including {@link Map.getMaxZoom} that fits\n     * in the viewport. LngLatBounds represent a box that is always axis-aligned with bearing 0.\n     * Bounds will be taken in [sw, ne] order. Southwest point will always be to the left of the northeast point.\n     * @param options - Options object\n     * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.\n     * If map is unable to fit, method will warn and return undefined.\n     * @example\n     * ```ts\n     * let bbox = [[-79, 43], [-73, 45]];\n     * let newCameraTransform = map.cameraForBounds(bbox, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     */\n    cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing | undefined {\n        bounds = LngLatBounds.convert(bounds).adjustAntiMeridian();\n        const bearing = options && options.bearing || 0;\n\n        return this._cameraForBoxAndBearing(bounds.getNorthWest(), bounds.getSouthEast(), bearing, options);\n    }\n\n    /**\n     * @internal\n     * Calculate the center of these two points in the viewport and use\n     * the highest zoom level up to and including {@link Map.getMaxZoom} that fits\n     * the AABB defined by these points in the viewport at the specified bearing.\n     * @param p0 - First point\n     * @param p1 - Second point\n     * @param bearing - Desired map bearing at end of animation, in degrees\n     * @param options - the camera options\n     * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.\n     *      If map is unable to fit, method will warn and return undefined.\n     * @example\n     * ```ts\n     * let p0 = [-79, 43];\n     * let p1 = [-73, 45];\n     * let bearing = 90;\n     * let newCameraTransform = map._cameraForBoxAndBearing(p0, p1, bearing, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     */\n    _cameraForBoxAndBearing(p0: LngLatLike, p1: LngLatLike, bearing: number, options?: CameraForBoundsOptions): CenterZoomBearing | undefined {\n        const defaultPadding = {\n            top: 0,\n            bottom: 0,\n            right: 0,\n            left: 0\n        };\n        options = extend({\n            padding: defaultPadding,\n            offset: [0, 0],\n            maxZoom: this.transform.maxZoom\n        }, options);\n\n        if (typeof options.padding === 'number') {\n            const p = options.padding;\n            options.padding = {\n                top: p,\n                bottom: p,\n                right: p,\n                left: p\n            };\n        }\n\n        const padding = extend(defaultPadding, options.padding) as PaddingOptions;\n        options.padding = padding;\n        const tr = this.transform;\n        const bounds = new LngLatBounds(p0, p1);\n\n        return this.cameraHelper.cameraForBoxAndBearing(options, padding, bounds, bearing, tr);\n    }\n\n    /**\n     * Pans and zooms the map to contain its visible area within the specified geographical bounds.\n     * This function will also reset the map's bearing to 0 if bearing is nonzero.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param bounds - Center these bounds in the viewport and use the highest\n     * zoom level up to and including {@link Map.getMaxZoom} that fits them in the viewport.\n     * Bounds will be taken in [sw, ne] order. Southwest point will always be to the left of the northeast point.\n     * @param options - Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * let bbox = [[-79, 43], [-73, 45]];\n     * map.fitBounds(bbox, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     * @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fit-a-map-to-a-bounding-box/)\n     */\n    fitBounds(bounds: LngLatBoundsLike, options?: FitBoundsOptions, eventData?: any): this {\n        return this._fitInternal(\n            this.cameraForBounds(bounds, options),\n            options,\n            eventData);\n    }\n\n    /**\n     * Pans, rotates and zooms the map to to fit the box made by points p0 and p1\n     * once the map is rotated to the specified bearing. To zoom without rotating,\n     * pass in the current map bearing.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.\n     *\n     * @param p0 - First point on screen, in pixel coordinates\n     * @param p1 - Second point on screen, in pixel coordinates\n     * @param bearing - Desired map bearing at end of animation, in degrees\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * let p0 = [220, 400];\n     * let p1 = [500, 900];\n     * map.fitScreenCoordinates(p0, p1, map.getBearing(), {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     * @see Used by {@link BoxZoomHandler}\n     */\n    fitScreenCoordinates(p0: PointLike, p1: PointLike, bearing: number, options?: FitBoundsOptions, eventData?: any): this {\n        return this._fitInternal(\n            this._cameraForBoxAndBearing(\n                this.transform.screenPointToLocation(Point.convert(p0)),\n                this.transform.screenPointToLocation(Point.convert(p1)),\n                bearing,\n                options),\n            options,\n            eventData);\n    }\n\n    _fitInternal(calculatedOptions?: CenterZoomBearing, options?: FitBoundsOptions, eventData?: any): this {\n        // cameraForBounds warns + returns undefined if unable to fit:\n        if (!calculatedOptions) return this;\n\n        options = extend(calculatedOptions, options);\n        // Explicitly remove the padding field because, calculatedOptions already accounts for padding by setting zoom and center accordingly.\n        delete options.padding;\n\n        return options.linear ?\n            this.easeTo(options, eventData) :\n            this.flyTo(options, eventData);\n    }\n\n    /**\n     * Changes any combination of center, zoom, bearing, pitch, and roll, without\n     * an animated transition. The map will retain its current values for any\n     * details not specified in `options`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, `rollstart`, `roll`, `rollend` and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // jump to coordinates at current zoom\n     * map.jumpTo({center: [0, 0]});\n     * // jump with zoom, pitch, and bearing options\n     * map.jumpTo({\n     *   center: [0, 0],\n     *   zoom: 8,\n     *   pitch: 45,\n     *   bearing: 90\n     * });\n     * ```\n     * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to-a-series-of-locations/)\n     * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/update-a-feature-in-realtime/)\n     */\n    jumpTo(options: JumpToOptions, eventData?: any): this {\n        this.stop();\n\n        const tr = this._getTransformForUpdate();\n        let bearingChanged = false,\n            pitchChanged = false;\n        let rollChanged = false;\n\n        const oldZoom = tr.zoom;\n\n        this.cameraHelper.handleJumpToCenterZoom(tr, options);\n\n        const zoomChanged = tr.zoom !== oldZoom;\n\n        if ('elevation' in options && tr.elevation !== +options.elevation) {\n            tr.setElevation(+options.elevation);\n        }\n\n        if ('bearing' in options && tr.bearing !== +options.bearing) {\n            bearingChanged = true;\n            tr.setBearing(+options.bearing);\n        }\n\n        if ('pitch' in options && tr.pitch !== +options.pitch) {\n            pitchChanged = true;\n            tr.setPitch(+options.pitch);\n        }\n\n        if ('roll' in options && tr.roll !== +options.roll) {\n            rollChanged = true;\n            tr.setRoll(+options.roll);\n        }\n\n        if (options.padding != null && !tr.isPaddingEqual(options.padding)) {\n            tr.setPadding(options.padding);\n        }\n        this._applyUpdatedTransform(tr);\n\n        this.fire(new Event('movestart', eventData))\n            .fire(new Event('move', eventData));\n\n        if (zoomChanged) {\n            this.fire(new Event('zoomstart', eventData))\n                .fire(new Event('zoom', eventData))\n                .fire(new Event('zoomend', eventData));\n        }\n\n        if (bearingChanged) {\n            this.fire(new Event('rotatestart', eventData))\n                .fire(new Event('rotate', eventData))\n                .fire(new Event('rotateend', eventData));\n        }\n\n        if (pitchChanged) {\n            this.fire(new Event('pitchstart', eventData))\n                .fire(new Event('pitch', eventData))\n                .fire(new Event('pitchend', eventData));\n        }\n\n        if (rollChanged) {\n            this.fire(new Event('rollstart', eventData))\n                .fire(new Event('roll', eventData))\n                .fire(new Event('rollend', eventData));\n        }\n\n        return this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Given a camera 'from' position and a position to look at (`to`), calculates zoom and camera rotation and returns them as {@link CameraOptions}.\n     * @param from - The camera to look from\n     * @param altitudeFrom - The altitude of the camera to look from\n     * @param to - The center to look at\n     * @param altitudeTo - Optional altitude of the center to look at. If none given the ground height will be used.\n     * @returns the calculated camera options\n     * @example\n     * ```ts\n     * // Calculate options to look from (1Â°, 0Â°, 1000m) to (1Â°, 1Â°, 0m)\n     * const cameraLngLat = new LngLat(1, 0);\n     * const cameraAltitude = 1000;\n     * const targetLngLat = new LngLat(1, 1);\n     * const targetAltitude = 0;\n     * const cameraOptions = map.calculateCameraOptionsFromTo(cameraLngLat, cameraAltitude, targetLngLat, targetAltitude);\n     * // Apply calculated options\n     * map.jumpTo(cameraOptions);\n     * ```\n     */\n    calculateCameraOptionsFromTo(from: LngLatLike, altitudeFrom: number, to: LngLatLike, altitudeTo: number = 0): CameraOptions {\n        const fromMercator = MercatorCoordinate.fromLngLat(from, altitudeFrom);\n        const toMercator = MercatorCoordinate.fromLngLat(to, altitudeTo);\n        const dx = toMercator.x - fromMercator.x;\n        const dy = toMercator.y - fromMercator.y;\n        const dz = toMercator.z - fromMercator.z;\n\n        const distance3D = Math.hypot(dx, dy, dz);\n        if (distance3D === 0) throw new Error('Can\\'t calculate camera options with same From and To');\n\n        const groundDistance = Math.hypot(dx, dy);\n\n        const zoom = scaleZoom(this.transform.cameraToCenterDistance / distance3D / this.transform.tileSize);\n        const bearing = (Math.atan2(dx, -dy) * 180) / Math.PI;\n        let pitch = (Math.acos(groundDistance / distance3D) * 180) / Math.PI;\n        pitch = dz < 0 ? 90 - pitch : 90 + pitch;\n\n        return {\n            center: toMercator.toLngLat(),\n            elevation: altitudeTo,\n            zoom,\n            pitch,\n            bearing\n        };\n    }\n\n    /**\n     * Given a camera position and rotation, calculates zoom and center point and returns them as {@link CameraOptions}.\n     * @param cameraLngLat - The lng, lat of the camera to look from\n     * @param cameraAlt - The altitude of the camera to look from, in meters above sea level\n     * @param bearing - Bearing of the camera, in degrees\n     * @param pitch - Pitch of the camera, in degrees\n     * @param roll - Roll of the camera, in degrees\n     * @returns the calculated camera options\n     * @example\n     * ```ts\n     * // Calculate options to look from camera position(1Â°, 0Â°, 1000m) with bearing = 90Â°, pitch = 30Â°, and roll = 45Â°\n     * const cameraLngLat = new LngLat(1, 0);\n     * const cameraAltitude = 1000;\n     * const bearing = 90;\n     * const pitch = 30;\n     * const roll = 45;\n     * const cameraOptions = map.calculateCameraOptionsFromCameraLngLatAltRotation(cameraLngLat, cameraAltitude, bearing, pitch, roll);\n     * // Apply calculated options\n     * map.jumpTo(cameraOptions);\n     * ```\n     */\n    calculateCameraOptionsFromCameraLngLatAltRotation(cameraLngLat: LngLatLike, cameraAlt: number, bearing: number, pitch: number, roll?: number): CameraOptions {\n        const centerInfo = this.transform.calculateCenterFromCameraLngLatAlt(cameraLngLat, cameraAlt, bearing, pitch);\n        return {\n            center: centerInfo.center,\n            elevation: centerInfo.elevation,\n            zoom: centerInfo.zoom,\n            bearing,\n            pitch,\n            roll\n        };\n    }\n\n    /**\n     * Changes any combination of `center`, `zoom`, `bearing`, `pitch`, `roll`, and `padding` with an animated transition\n     * between old and new values. The map will retain its current values for any\n     * details not specified in `options`.\n     *\n     * !!! note \"Reduced Motion\"\n     *     The transition will happen instantly if the user has enabled\n     *     the `reduced motion` accessibility feature enabled in their operating system,\n     *     unless `options` includes `essential: true`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, `rollstart`, `roll`, `rollend`, and `rotate`.\n     *\n     * @param options - Options describing the destination and animation of the transition.\n     * Accepts {@link CameraOptions} and {@link AnimationOptions}.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigate-the-map-with-game-like-controls/)\n     */\n    easeTo(options: EaseToOptions, eventData?: any): this {\n        this._stop(false, options.easeId);\n\n        options = extend({\n            offset: [0, 0],\n            duration: 500,\n            easing: defaultEasing\n        }, options);\n\n        if (options.animate === false || (!options.essential && browser.prefersReducedMotion)) {\n            options.duration = 0;\n        }\n\n        const tr = this._getTransformForUpdate();\n        const startBearing = this.getBearing(),\n            startPitch = tr.pitch,\n            startRoll = tr.roll,\n            bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing,\n            pitch = 'pitch' in options ? +options.pitch : startPitch,\n            roll = 'roll' in options ? this._normalizeBearing(options.roll, startRoll) : startRoll,\n            padding = ('padding' in options ? options.padding : tr.padding) as PaddingOptions;\n        const offsetAsPoint = Point.convert(options.offset);\n\n        let around, aroundPoint;\n\n        if (options.around) {\n            around = LngLat.convert(options.around);\n            aroundPoint = tr.locationToScreenPoint(around);\n        }\n\n        const currently = {\n            moving: this._moving,\n            zooming: this._zooming,\n            rotating: this._rotating,\n            pitching: this._pitching,\n            rolling: this._rolling\n        };\n\n        const easeHandler = this.cameraHelper.handleEaseTo(tr, {\n            bearing,\n            pitch,\n            roll,\n            padding,\n            around,\n            aroundPoint,\n            offsetAsPoint,\n            offset: options.offset,\n            zoom: options.zoom,\n            center: options.center,\n        });\n\n        this._rotating = this._rotating || (startBearing !== bearing);\n        this._pitching = this._pitching || (pitch !== startPitch);\n        this._rolling = this._rolling || (roll !== startRoll);\n        this._padding = !tr.isPaddingEqual(padding);\n        this._zooming = this._zooming || easeHandler.isZooming;\n        this._easeId = options.easeId;\n        this._prepareEase(eventData, options.noMoveStart, currently);\n\n        if (this.terrain) {\n            this._prepareElevation(easeHandler.elevationCenter);\n        }\n\n        this._ease((k) => {\n            easeHandler.easeFunc(k);\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n            this._applyUpdatedTransform(tr);\n            this._fireMoveEvents(eventData);\n\n        }, (interruptingEaseId?: string) => {\n            if (this.terrain && options.freezeElevation) this._finalizeElevation();\n            this._afterEase(eventData, interruptingEaseId);\n        }, options as any);\n\n        return this;\n    }\n\n    _prepareEase(eventData: any, noMoveStart: boolean,\n        currently: { moving?: boolean; zooming?: boolean; rotating?: boolean; pitching?: boolean; rolling?: boolean} = {}) {\n        this._moving = true;\n        if (!noMoveStart && !currently.moving) {\n            this.fire(new Event('movestart', eventData));\n        }\n        if (this._zooming && !currently.zooming) {\n            this.fire(new Event('zoomstart', eventData));\n        }\n        if (this._rotating && !currently.rotating) {\n            this.fire(new Event('rotatestart', eventData));\n        }\n        if (this._pitching && !currently.pitching) {\n            this.fire(new Event('pitchstart', eventData));\n        }\n        if (this._rolling && !currently.rolling) {\n            this.fire(new Event('rollstart', eventData));\n        }\n    }\n\n    _prepareElevation(center: LngLat) {\n        this._elevationCenter = center;\n        this._elevationStart = this.transform.elevation;\n        this._elevationTarget = this.terrain.getElevationForLngLatZoom(center, this.transform.tileZoom);\n        this._elevationFreeze = true;\n    }\n\n    _updateElevation(k: number) {\n\n        if (this._elevationStart === undefined || this._elevationCenter === undefined) {\n            this._prepareElevation(this.transform.center);\n        }\n\n        this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter, this.transform.tileZoom));\n        const elevation = this.terrain.getElevationForLngLatZoom(this._elevationCenter, this.transform.tileZoom);\n        // target terrain updated during flight, slowly move camera to new height\n        if (k < 1 && elevation !== this._elevationTarget) {\n            const pitch1 = this._elevationTarget - this._elevationStart;\n            const pitch2 = (elevation - (pitch1 * k + this._elevationStart)) / (1 - k);\n            this._elevationStart += k * (pitch1 - pitch2);\n            this._elevationTarget = elevation;\n        }\n        this.transform.setElevation(interpolates.number(this._elevationStart, this._elevationTarget, k));\n    }\n\n    _finalizeElevation() {\n        this._elevationFreeze = false;\n        if (this.getCenterClampedToGround()) {\n            this.transform.recalculateZoomAndCenter(this.terrain);\n        }\n    }\n\n    /**\n     * @internal\n     * Called when the camera is about to be manipulated.\n     * If `transformCameraUpdate` is specified or terrain is enabled, a copy of\n     * the current transform is created to track the accumulated changes.\n     * This underlying transform represents the \"desired state\" proposed by input handlers / animations / UI controls.\n     * It may differ from the state used for rendering (`this.transform`).\n     * @returns Transform to apply changes to\n     */\n    _getTransformForUpdate(): ITransform {\n        if (!this.transformCameraUpdate && !this.terrain) return this.transform;\n\n        if (!this._requestedCameraState) {\n            this._requestedCameraState = this.transform.clone();\n        }\n        return this._requestedCameraState;\n    }\n\n    /**\n     * @internal\n     * Checks the given transform for the camera being below terrain surface and\n     * returns new pitch and zoom to fix that.\n     *\n     * With the new pitch and zoom, the camera will be at the same ground\n     * position but at higher altitude. It will still point to the same spot on\n     * the map.\n     *\n     * @param tr - The transform to check.\n     */\n    _elevateCameraIfInsideTerrain(tr: ITransform) : { pitch?: number; zoom?: number } {\n        if (!this.terrain && tr.elevation >= 0 && tr.pitch <= 90) {\n            return {};\n        }\n        const cameraLngLat = tr.getCameraLngLat();\n        const cameraAltitude = tr.getCameraAltitude();\n        const minAltitude = this.terrain ? this.terrain.getElevationForLngLatZoom(cameraLngLat, tr.zoom) : 0;\n        if (cameraAltitude < minAltitude) {\n            const newCamera = this.calculateCameraOptionsFromTo(\n                cameraLngLat, minAltitude, tr.center, tr.elevation);\n            return {\n                pitch: newCamera.pitch,\n                zoom: newCamera.zoom,\n            };\n        }\n        return {};\n    }\n\n    /**\n     * @internal\n     * Called after the camera is done being manipulated.\n     * @param tr - the requested camera end state\n     * If the camera is inside terrain, it gets elevated.\n     * Call `transformCameraUpdate` if present, and then apply the \"approved\" changes.\n     */\n    _applyUpdatedTransform(tr: ITransform) {\n        const modifiers : ((tr: ITransform) => ReturnType<CameraUpdateTransformFunction>)[] = [];\n        modifiers.push(tr => this._elevateCameraIfInsideTerrain(tr));\n        if (this.transformCameraUpdate) {\n            modifiers.push(tr => this.transformCameraUpdate(tr));\n        }\n        if (!modifiers.length) {\n            return;\n        }\n        const finalTransform = tr.clone();\n        for (const modifier of modifiers) {\n            const nextTransform = finalTransform.clone();\n            const {\n                center,\n                zoom,\n                roll,\n                pitch,\n                bearing,\n                elevation\n            } = modifier(nextTransform);\n            if (center) nextTransform.setCenter(center);\n            if (elevation !== undefined) nextTransform.setElevation(elevation);\n            if (zoom !== undefined) nextTransform.setZoom(zoom);\n            if (roll !== undefined) nextTransform.setRoll(roll);\n            if (pitch !== undefined) nextTransform.setPitch(pitch);\n            if (bearing !== undefined) nextTransform.setBearing(bearing);\n            finalTransform.apply(nextTransform, false);\n        }\n        this.transform.apply(finalTransform, false);\n    }\n\n    _fireMoveEvents(eventData?: any) {\n        this.fire(new Event('move', eventData));\n        if (this._zooming) {\n            this.fire(new Event('zoom', eventData));\n        }\n        if (this._rotating) {\n            this.fire(new Event('rotate', eventData));\n        }\n        if (this._pitching) {\n            this.fire(new Event('pitch', eventData));\n        }\n        if (this._rolling) {\n            this.fire(new Event('roll', eventData));\n        }\n    }\n\n    _afterEase(eventData?: any, easeId?: string) {\n        // if this easing is being stopped to start another easing with\n        // the same id then don't fire any events to avoid extra start/stop events\n        if (this._easeId && easeId && this._easeId === easeId) {\n            return;\n        }\n        delete this._easeId;\n\n        const wasZooming = this._zooming;\n        const wasRotating = this._rotating;\n        const wasPitching = this._pitching;\n        const wasRolling = this._rolling;\n        this._moving = false;\n        this._zooming = false;\n        this._rotating = false;\n        this._pitching = false;\n        this._rolling = false;\n        this._padding = false;\n\n        if (wasZooming) {\n            this.fire(new Event('zoomend', eventData));\n        }\n        if (wasRotating) {\n            this.fire(new Event('rotateend', eventData));\n        }\n        if (wasPitching) {\n            this.fire(new Event('pitchend', eventData));\n        }\n        if (wasRolling) {\n            this.fire(new Event('rollend', eventData));\n        }\n        this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Changes any combination of center, zoom, bearing, pitch, and roll, animating the transition along a curve that\n     * evokes flight. The animation seamlessly incorporates zooming and panning to help\n     * the user maintain her bearings even after traversing a great distance.\n     *\n     * !!! note \"Reduced Motion\"\n     *     The animation will be skipped, and this will behave equivalently to `jumpTo`\n     *     if the user has the `reduced motion` accessibility feature enabled in their operating system,\n     *     unless 'options' includes `essential: true`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, `rollstart`, `roll`, `rollend`, and `rotate`.\n     *\n     * @param options - Options describing the destination and animation of the transition.\n     * Accepts {@link CameraOptions}, {@link AnimationOptions},\n     * and the following additional options.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // fly with default options to null island\n     * map.flyTo({center: [0, 0], zoom: 9});\n     * // using flyTo options\n     * map.flyTo({\n     *   center: [0, 0],\n     *   zoom: 9,\n     *   speed: 0.2,\n     *   curve: 1,\n     *   easing(t) {\n     *     return t;\n     *   }\n     * });\n     * ```\n     * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/fly-to-a-location/)\n     * @see [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/slowly-fly-to-a-location/)\n     * @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js/docs/examples/fly-to-a-location-based-on-scroll-position/)\n     */\n    flyTo(options: FlyToOptions, eventData?: any): this {\n        // Fall through to jumpTo if user has set prefers-reduced-motion\n        if (!options.essential && browser.prefersReducedMotion) {\n            const coercedOptions = pick(options, ['center', 'zoom', 'bearing', 'pitch', 'roll', 'elevation', 'padding']) as JumpToOptions;\n            return this.jumpTo(coercedOptions, eventData);\n        }\n\n        // This method implements an âoptimal pathâ animation, as detailed in:\n        //\n        // Van Wijk, Jarke J.; Nuij, Wim A. A. âSmooth and efficient zooming and panning.â INFOVIS\n        //   â03. pp. 15â22. <https://www.win.tue.nl/~vanwijk/zoompan.pdf#page=5>.\n        //\n        // Where applicable, local variable documentation begins with the associated variable or\n        // function in van Wijk (2003).\n\n        this.stop();\n\n        options = extend({\n            offset: [0, 0],\n            speed: 1.2,\n            curve: 1.42,\n            easing: defaultEasing\n        }, options);\n\n        const tr = this._getTransformForUpdate(),\n            startBearing = tr.bearing,\n            startPitch = tr.pitch,\n            startRoll = tr.roll,\n            startPadding = tr.padding;\n\n        const bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing;\n        const pitch = 'pitch' in options ? +options.pitch : startPitch;\n        const roll = 'roll' in options ? this._normalizeBearing(options.roll, startRoll) : startRoll;\n        const padding = ('padding' in options ? options.padding : tr.padding) as PaddingOptions;\n\n        const offsetAsPoint = Point.convert(options.offset);\n        let pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n        const locationAtOffset = tr.screenPointToLocation(pointAtOffset);\n\n        const flyToHandler = this.cameraHelper.handleFlyTo(tr, {\n            bearing,\n            pitch,\n            roll,\n            padding,\n            locationAtOffset,\n            offsetAsPoint,\n            center: options.center,\n            minZoom: options.minZoom,\n            zoom: options.zoom,\n        });\n\n        let rho = options.curve;\n\n        // wâ: Initial visible span, measured in pixels at the initial scale.\n        const w0 = Math.max(tr.width, tr.height);\n        // wâ: Final visible span, measured in pixels with respect to the initial scale.\n        const w1 = w0 / flyToHandler.scaleOfZoom;\n        // Length of the flight path as projected onto the ground plane, measured in pixels from\n        // the world image origin at the initial scale.\n        const u1 = flyToHandler.pixelPathLength;\n\n        if (typeof flyToHandler.scaleOfMinZoom === 'number') {\n            // w<sub>m</sub>: Maximum visible span, measured in pixels with respect to the initial\n            // scale.\n            const wMax = w0 / flyToHandler.scaleOfMinZoom;\n            rho = Math.sqrt(wMax / u1 * 2);\n        }\n\n        // ÏÂ²\n        const rho2 = rho * rho;\n\n        /**\n         * ráµ¢: Returns the zoom-out factor at one end of the animation.\n         *\n         * @param descent - `true` for the descent, `false` for the ascent\n         */\n        function zoomOutFactor(descent: boolean) {\n            const b = (w1 * w1 - w0 * w0 + (descent ? -1 : 1) * rho2 * rho2 * u1 * u1) / (2 * (descent ? w1 : w0) * rho2 * u1);\n            return Math.log(Math.sqrt(b * b + 1) - b);\n        }\n\n        function sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\n        function cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\n        function tanh(n) { return sinh(n) / cosh(n); }\n\n        // râ: Zoom-out factor during ascent.\n        const r0 = zoomOutFactor(false);\n\n        // w(s): Returns the visible span on the ground, measured in pixels with respect to the\n        // initial scale. Uses the current vertical field of view setting.\n        let w: (_: number) => number = function (s) {\n            return (cosh(r0) / cosh(r0 + rho * s));\n        };\n\n        // u(s): Returns the distance along the flight path as projected onto the ground plane,\n        // measured in pixels from the world image origin at the initial scale.\n        let u: (_: number) => number = function (s) {\n            return w0 * ((cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2) / u1;\n        };\n\n        // S: Total length of the flight path, measured in Ï-screenfulls.\n        let S = (zoomOutFactor(true) - r0) / rho;\n\n        // When uâ = uâ, the optimal path doesnât require both ascent and descent.\n        if (Math.abs(u1) < 0.000002 || !isFinite(S)) {\n            // Perform a more or less instantaneous transition if the path is too short.\n            if (Math.abs(w0 - w1) < 0.000001) return this.easeTo(options, eventData);\n\n            const k = w1 < w0 ? -1 : 1;\n            S = Math.abs(Math.log(w1 / w0)) / rho;\n\n            u = () => 0;\n            w = (s) => Math.exp(k * rho * s);\n        }\n\n        if ('duration' in options) {\n            options.duration = +options.duration;\n        } else {\n            const V = 'screenSpeed' in options ? +options.screenSpeed / rho : +options.speed;\n            options.duration = 1000 * S / V;\n        }\n\n        if (options.maxDuration && options.duration > options.maxDuration) {\n            options.duration = 0;\n        }\n\n        this._zooming = true;\n        this._rotating = (startBearing !== bearing);\n        this._pitching = (pitch !== startPitch);\n        this._rolling = (roll !== startRoll);\n        this._padding = !tr.isPaddingEqual(padding as PaddingOptions);\n\n        this._prepareEase(eventData, false);\n        if (this.terrain) this._prepareElevation(flyToHandler.targetCenter);\n\n        this._ease((k) => {\n            // s: The distance traveled along the flight path, measured in Ï-screenfulls.\n            const s = k * S;\n            const scale = 1 / w(s);\n            const centerFactor = u(s);\n            if (this._rotating) {\n                tr.setBearing(interpolates.number(startBearing, bearing, k));\n            }\n            if (this._pitching) {\n                tr.setPitch(interpolates.number(startPitch, pitch, k));\n            }\n            if (this._rolling) {\n                tr.setRoll(interpolates.number(startRoll, roll, k));\n            }\n            if (this._padding) {\n                tr.interpolatePadding(startPadding, padding as PaddingOptions, k);\n                // When padding is being applied, Transform.centerPoint is changing continuously,\n                // thus we need to recalculate offsetPoint every frame\n                pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n            }\n\n            flyToHandler.easeFunc(k, scale, centerFactor, pointAtOffset);\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n            this._applyUpdatedTransform(tr);\n            this._fireMoveEvents(eventData);\n        }, () => {\n            if (this.terrain && options.freezeElevation) this._finalizeElevation();\n            this._afterEase(eventData);\n        }, options);\n\n        return this;\n    }\n\n    isEasing() {\n        return !!this._easeFrameId;\n    }\n\n    /**\n     * Stops any animated transition underway.\n     */\n    stop(): this {\n        return this._stop();\n    }\n\n    _stop(allowGestures?: boolean, easeId?: string): this {\n        if (this._easeFrameId) {\n            this._cancelRenderFrame(this._easeFrameId);\n            delete this._easeFrameId;\n            delete this._onEaseFrame;\n        }\n\n        if (this._onEaseEnd) {\n            // The _onEaseEnd function might emit events which trigger new\n            // animation, which sets a new _onEaseEnd. Ensure we don't delete\n            // it unintentionally.\n            const onEaseEnd = this._onEaseEnd;\n            delete this._onEaseEnd;\n            onEaseEnd.call(this, easeId);\n        }\n        if (!allowGestures) {\n            this.handlers?.stop(false);\n        }\n        return this;\n    }\n\n    _ease(frame: (_: number) => void,\n        finish: () => void,\n        options: {\n            animate?: boolean;\n            duration?: number;\n            easing?: (_: number) => number;\n        }) {\n        if (options.animate === false || options.duration === 0) {\n            frame(1);\n            finish();\n        } else {\n            this._easeStart = now();\n            this._easeOptions = options;\n            this._onEaseFrame = frame;\n            this._onEaseEnd = finish;\n            this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback);\n        }\n    }\n\n    // Callback for map._requestRenderFrame\n    _renderFrameCallback = () => {\n        const t = Math.min((now() - this._easeStart) / this._easeOptions.duration, 1);\n        this._onEaseFrame(this._easeOptions.easing(t));\n\n        // if _stop is called during _onEaseFrame from _fireMoveEvents we should avoid a new _requestRenderFrame, checking it by ensuring _easeFrameId was not deleted\n        if (t < 1 && this._easeFrameId) {\n            this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback);\n        } else {\n            this.stop();\n        }\n    };\n\n    // convert bearing so that it's numerically close to the current one so that it interpolates properly\n    _normalizeBearing(bearing: number, currentBearing: number) {\n        bearing = wrap(bearing, -180, 180);\n        const diff = Math.abs(bearing - currentBearing);\n        if (Math.abs(bearing - 360 - currentBearing) < diff) bearing -= 360;\n        if (Math.abs(bearing + 360 - currentBearing) < diff) bearing += 360;\n        return bearing;\n    }\n\n    /**\n     * Gets the elevation at a given location, in meters above sea level.\n     * Returns null if terrain is not enabled.\n     * If terrain is enabled with some exaggeration value, the value returned here will be reflective of (multiplied by) that exaggeration value.\n     * This method should be used for proper positioning of custom 3d objects, as explained [here](https://maplibre.org/maplibre-gl-js/docs/examples/adding-3d-models-using-threejs-on-terrain/)\n     * @param lngLatLike - [x,y] or LngLat coordinates of the location\n     * @returns elevation in meters\n     */\n    queryTerrainElevation(lngLatLike: LngLatLike): number | null {\n        if (!this.terrain) {\n            return null;\n        }\n        return this.terrain.getElevationForLngLat(LngLat.convert(lngLatLike), this.transform);\n    }\n}\n","import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\nimport type {MapDataEvent} from '../events';\nimport type {StyleSpecification} from '@maplibre/maplibre-gl-style-spec';\n/**\n * The {@link AttributionControl} options object\n */\nexport type AttributionControlOptions = {\n    /**\n     * If `true`, the attribution control will always collapse when moving the map. If `false`,\n     * force the expanded attribution control. The default is a responsive attribution that collapses when the user moves the map on maps less than 640 pixels wide.\n     * **Attribution should not be collapsed if it can comfortably fit on the map. `compact` should only be used to modify default attribution when map size makes it impossible to fit default attribution and when the automatic compact resizing for default settings are not sufficient.**\n     */\n    compact?: boolean;\n    /**\n     * Attributions to show in addition to any other attributions.\n     */\n    customAttribution?: string | Array<string>;\n};\n\nexport const defaultAttributionControlOptions: AttributionControlOptions = {\n    compact: true,\n    customAttribution: '<a href=\"https://maplibre.org/\" target=\"_blank\">MapLibre</a>'\n};\n\n/**\n * An `AttributionControl` control presents the map's attribution information. By default, the attribution control is expanded (regardless of map width).\n * @group Markers and Controls\n * @example\n * ```ts\n * let map = new Map({attributionControl: false})\n *     .addControl(new AttributionControl({\n *         compact: true\n *     }));\n * ```\n */\nexport class AttributionControl implements IControl {\n    options: AttributionControlOptions;\n    _map: Map;\n    _compact: boolean | undefined;\n    _container: HTMLElement;\n    _innerContainer: HTMLElement;\n    _compactButton: HTMLElement;\n    _editLink: HTMLAnchorElement;\n    _attribHTML: string;\n    styleId: string;\n    styleOwner: string;\n\n    /**\n     * @param options - the attribution options\n     */\n    constructor(options: AttributionControlOptions = defaultAttributionControlOptions) {\n        this.options = options;\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-right';\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._compact = this.options.compact;\n        this._container = DOM.create('details', 'maplibregl-ctrl maplibregl-ctrl-attrib');\n        this._compactButton = DOM.create('summary', 'maplibregl-ctrl-attrib-button', this._container);\n        this._compactButton.addEventListener('click', this._toggleAttribution);\n        this._setElementTitle(this._compactButton, 'ToggleAttribution');\n        this._innerContainer = DOM.create('div', 'maplibregl-ctrl-attrib-inner', this._container);\n\n        this._updateAttributions();\n        this._updateCompact();\n\n        this._map.on('styledata', this._updateData);\n        this._map.on('sourcedata', this._updateData);\n        this._map.on('terrain', this._updateData);\n        this._map.on('resize', this._updateCompact);\n        this._map.on('drag', this._updateCompactMinimize);\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n\n        this._map.off('styledata', this._updateData);\n        this._map.off('sourcedata', this._updateData);\n        this._map.off('terrain', this._updateData);\n        this._map.off('resize', this._updateCompact);\n        this._map.off('drag', this._updateCompactMinimize);\n\n        this._map = undefined;\n        this._compact = undefined;\n        this._attribHTML = undefined;\n    }\n\n    _setElementTitle(element: HTMLElement, title: 'ToggleAttribution' | 'MapFeedback') {\n        const str = this._map._getUIString(`AttributionControl.${title}`);\n        element.title = str;\n        element.setAttribute('aria-label', str);\n    }\n\n    _toggleAttribution = () => {\n        if (this._container.classList.contains('maplibregl-compact')) {\n            if (this._container.classList.contains('maplibregl-compact-show')) {\n                this._container.setAttribute('open', '');\n                this._container.classList.remove('maplibregl-compact-show');\n            } else {\n                this._container.classList.add('maplibregl-compact-show');\n                this._container.removeAttribute('open');\n            }\n        }\n    };\n\n    _updateData = (e: MapDataEvent) => {\n        if (e && (e.sourceDataType === 'metadata' || e.sourceDataType === 'visibility' || e.dataType === 'style' || e.type === 'terrain')) {\n            this._updateAttributions();\n        }\n    };\n\n    _updateAttributions() {\n        if (!this._map.style) return;\n        let attributions: Array<string> = [];\n        if (this.options.customAttribution) {\n            if (Array.isArray(this.options.customAttribution)) {\n                attributions = attributions.concat(\n                    this.options.customAttribution.map(attribution => {\n                        if (typeof attribution !== 'string') return '';\n                        return attribution;\n                    })\n                );\n            } else if (typeof this.options.customAttribution === 'string') {\n                attributions.push(this.options.customAttribution);\n            }\n        }\n\n        if (this._map.style.stylesheet) {\n            const stylesheet = this._map.style.stylesheet as StyleSpecification & { owner: string; id: string };\n            this.styleOwner = stylesheet.owner;\n            this.styleId = stylesheet.id;\n        }\n\n        const tileManagers = this._map.style.tileManagers;\n        for (const id in tileManagers) {\n            const tileManager = tileManagers[id];\n            if (tileManager.used || tileManager.usedForTerrain) {\n                const source = tileManager.getSource();\n                if (source.attribution && attributions.indexOf(source.attribution) < 0) {\n                    attributions.push(source.attribution);\n                }\n            }\n        }\n\n        // remove any entries that are whitespace\n        attributions = attributions.filter(e => String(e).trim());\n\n        // remove any entries that are substrings of another entry.\n        // first sort by length so that substrings come first\n        attributions.sort((a, b) => a.length - b.length);\n        attributions = attributions.filter((attrib, i) => {\n            for (let j = i + 1; j < attributions.length; j++) {\n                if (attributions[j].indexOf(attrib) >= 0) { return false; }\n            }\n            return true;\n        });\n\n        // check if attribution string is different to minimize DOM changes\n        const attribHTML = attributions.join(' | ');\n        if (attribHTML === this._attribHTML) return;\n\n        this._attribHTML = attribHTML;\n\n        if (attributions.length) {\n            this._innerContainer.innerHTML = DOM.sanitize(attribHTML);\n            this._container.classList.remove('maplibregl-attrib-empty');\n        } else {\n            this._container.classList.add('maplibregl-attrib-empty');\n        }\n        this._updateCompact();\n        // remove old DOM node from _editLink\n        this._editLink = null;\n    }\n\n    _updateCompact = () => {\n        if (this._map.getCanvasContainer().offsetWidth <= 640 || this._compact) {\n            if (this._compact === false) {\n                this._container.setAttribute('open', '');\n            } else if (!this._container.classList.contains('maplibregl-compact') && !this._container.classList.contains('maplibregl-attrib-empty')) {\n                this._container.setAttribute('open', '');\n                this._container.classList.add('maplibregl-compact', 'maplibregl-compact-show');\n            }\n        } else {\n            this._container.setAttribute('open', '');\n            if (this._container.classList.contains('maplibregl-compact')) {\n                this._container.classList.remove('maplibregl-compact', 'maplibregl-compact-show');\n            }\n        }\n    };\n\n    _updateCompactMinimize = () => {\n        if (this._container.classList.contains('maplibregl-compact')) {\n            if (this._container.classList.contains('maplibregl-compact-show')) {\n                this._container.classList.remove('maplibregl-compact-show');\n            }\n        }\n    };\n}\n","import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\n\n/**\n * The {@link LogoControl} options object\n */\nexport type LogoControlOptions = {\n    /**\n     * If `true`, force a compact logo.\n     * If `false`, force the full logo. The default is a responsive logo that collapses when the map is less than 640 pixels wide.\n     */\n    compact?: boolean;\n};\n\n/**\n * A `LogoControl` is a control that adds the watermark.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * map.addControl(new LogoControl({compact: false}));\n * ```\n **/\nexport class LogoControl implements IControl {\n    options: LogoControlOptions;\n    _map: Map;\n    _compact: boolean;\n    _container: HTMLElement;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: LogoControlOptions = {}) {\n        this.options = options;\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-left';\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._compact = this.options && this.options.compact;\n        this._container = DOM.create('div', 'maplibregl-ctrl');\n        const anchor = DOM.create('a', 'maplibregl-ctrl-logo');\n        anchor.target = '_blank';\n        anchor.rel = 'noopener nofollow';\n        anchor.href = 'https://maplibre.org/';\n        anchor.setAttribute('aria-label', this._map._getUIString('LogoControl.Title'));\n        anchor.setAttribute('rel', 'noopener nofollow');\n        this._container.appendChild(anchor);\n        this._container.style.display = 'block';\n\n        this._map.on('resize', this._updateCompact);\n        this._updateCompact();\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('resize', this._updateCompact);\n        this._map = undefined;\n        this._compact = undefined;\n    }\n\n    _updateCompact = () => {\n        const containerChildren = this._container.children;\n        if (containerChildren.length) {\n            const anchor = containerChildren[0];\n            if (this._map.getCanvasContainer().offsetWidth <= 640 || this._compact) {\n                if (this._compact !== false) {\n                    anchor.classList.add('maplibregl-compact');\n                }\n            } else {\n                anchor.classList.remove('maplibregl-compact');\n            }\n        }\n    };\n\n}\n","export type TaskID = number;\n\ntype Task = {\n    callback: (timeStamp: number) => void;\n    id: TaskID;\n    cancelled: boolean;\n};\n\nexport class TaskQueue {\n    _queue: Array<Task>;\n    _id: TaskID;\n    _cleared: boolean;\n    _currentlyRunning: Array<Task> | false;\n\n    constructor()  {\n        this._queue = [];\n        this._id = 0;\n        this._cleared = false;\n        this._currentlyRunning = false;\n    }\n\n    add(callback: (timeStamp: number) => void): TaskID {\n        const id = ++this._id;\n        const queue = this._queue;\n        queue.push({callback, id, cancelled: false});\n        return id;\n    }\n\n    remove(id: TaskID) {\n        const running = this._currentlyRunning;\n        const queue = running ? this._queue.concat(running) : this._queue;\n        for (const task of queue) {\n            if (task.id === id) {\n                task.cancelled = true;\n                return;\n            }\n        }\n    }\n\n    run(timeStamp: number = 0) {\n        if (this._currentlyRunning) throw new Error('Attempting to run(), but is already running.');\n        const queue = this._currentlyRunning = this._queue;\n\n        // Tasks queued by callbacks in the current queue should be executed\n        // on the next run, not the current run.\n        this._queue = [];\n\n        for (const task of queue) {\n            if (task.cancelled) continue;\n            task.callback(timeStamp);\n            if (this._cleared) break;\n        }\n\n        this._cleared = false;\n        this._currentlyRunning = false;\n    }\n\n    clear() {\n        if (this._currentlyRunning) {\n            this._cleared = true;\n        }\n        this._queue = [];\n    }\n}\n","import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos3d', type: 'Int16', components: 3}\n]);\n","import {type OverscaledTileID} from './tile_id';\nimport {Tile} from './tile';\nimport {EXTENT} from '../data/extent';\nimport {mat4} from 'gl-matrix';\nimport {Evented} from '../util/evented';\nimport type {ITransform} from '../geo/transform_interface';\nimport type {TileManager} from './tile_manager';\nimport type {Source} from '../source/source';\nimport {type Terrain} from '../render/terrain';\nimport {now} from '../util/time_control';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport {createMat4f64} from '../util/util';\nimport {type CanonicalTileRange} from '../source/image_source';\n\n/**\n * @internal\n * This class is a helper for the Terrain-class, it:\n *\n * - loads raster-dem tiles\n * - manages all renderToTexture tiles.\n * - caches previous rendered tiles.\n * - finds all necessary renderToTexture tiles for a OverscaledTileID area\n * - finds the corresponding raster-dem tile for OverscaledTileID\n */\nexport class TerrainTileManager extends Evented {\n    /**\n     * tile manager for the raster-dem source.\n     */\n    tileManager: TileManager;\n    /**\n     * stores all render-to-texture tiles.\n     */\n    _tiles: {[_: string]: Tile};\n    /**\n     * contains a list of tileID-keys for the current scene. (only for performance)\n     */\n    _renderableTilesKeys: Array<string>;\n    /**\n     * raster-dem-tile for a TileID cache.\n     */\n    _sourceTileCache: {[_: string]: string};\n    /**\n     * minimum zoomlevel to render the terrain.\n     */\n    minzoom: number;\n    /**\n     * maximum zoomlevel to render the terrain.\n     */\n    maxzoom: number;\n    /**\n     * render-to-texture tileSize in scene.\n     */\n    tileSize: number;\n    /**\n     * raster-dem tiles will load for performance the actualZoom - deltaZoom zoom-level.\n     */\n    deltaZoom: number;\n    /**\n     * used to determine whether depth & coord framebuffers need updating\n     */\n    _lastTilesetChange: number = now();\n\n    constructor(tileManager: TileManager) {\n        super();\n        this.tileManager = tileManager;\n        this._tiles = {};\n        this._renderableTilesKeys = [];\n        this._sourceTileCache = {};\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.deltaZoom = 1;\n        this.tileSize = tileManager._source.tileSize * 2 ** this.deltaZoom;\n        tileManager.usedForTerrain = true;\n        tileManager.tileSize = this.tileSize;\n    }\n\n    destruct() {\n        this.tileManager.usedForTerrain = false;\n        this.tileManager.tileSize = null;\n    }\n\n    getSource(): Source {\n        return this.tileManager._source;\n    }\n\n    /**\n     * Load Terrain Tiles, create internal render-to-texture tiles, free GPU memory.\n     * @param transform - the operation to do\n     * @param terrain - the terrain\n     */\n    update(transform: ITransform, terrain: Terrain): void {\n        // load raster-dem tiles for the current scene.\n        this.tileManager.update(transform, terrain);\n        // create internal render-to-texture tiles for the current scene.\n        this._renderableTilesKeys = [];\n        const keys = {};\n        for (const tileID of coveringTiles(transform, {\n            tileSize: this.tileSize,\n            minzoom: this.minzoom,\n            maxzoom: this.maxzoom,\n            reparseOverscaled: false,\n            terrain,\n            calculateTileZoom: this.tileManager._source.calculateTileZoom\n        })) {\n            keys[tileID.key] = true;\n            this._renderableTilesKeys.push(tileID.key);\n            if (!this._tiles[tileID.key]) {\n                tileID.terrainRttPosMatrix32f = new Float64Array(16) as any;\n                mat4.ortho(tileID.terrainRttPosMatrix32f, 0, EXTENT, EXTENT, 0, 0, 1);\n                this._tiles[tileID.key] = new Tile(tileID, this.tileSize);\n                this._lastTilesetChange = now();\n            }\n        }\n        // free unused tiles\n        for (const key in this._tiles) {\n            if (!keys[key]) delete this._tiles[key];\n        }\n    }\n\n    /**\n     * Free render to texture cache\n     * @param tileID - optional, free only corresponding to tileID.\n     */\n    freeRtt(tileID?: OverscaledTileID) {\n        for (const key in this._tiles) {\n            const tile = this._tiles[key];\n            if (!tileID || tile.tileID.equals(tileID) || tile.tileID.isChildOf(tileID) || tileID.isChildOf(tile.tileID))\n                tile.rtt = [];\n        }\n    }\n\n    /**\n     * get a list of tiles, which are loaded and should be rendered in the current scene\n     * @returns the renderable tiles\n     */\n    getRenderableTiles(): Array<Tile> {\n        return this._renderableTilesKeys.map(key => this.getTileByID(key));\n    }\n\n    /**\n     * get terrain tile by the TileID key\n     * @param id - the tile id\n     * @returns the tile\n     */\n    getTileByID(id: string): Tile {\n        return this._tiles[id];\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    getTerrainCoords(\n        tileID: OverscaledTileID,\n        terrainTileRanges?: {[zoom: string]: CanonicalTileRange}\n    ): Record<string, OverscaledTileID> {\n        if (terrainTileRanges) {\n            return this._getTerrainCoordsForTileRanges(tileID, terrainTileRanges);\n        } else {\n            return this._getTerrainCoordsForRegularTile(tileID);\n        }\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles.\n     * Includes terrain tiles that are either:\n     * - the same as the tileID\n     * - a parent of the tileID\n     * - a child of the tileID\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    _getTerrainCoordsForRegularTile(tileID: OverscaledTileID): Record<string, OverscaledTileID> {\n        const coords: Record<string, OverscaledTileID> = {};\n        for (const key of this._renderableTilesKeys) {\n            const terrainTileID = this._tiles[key].tileID;\n            const coord = tileID.clone();\n            const mat = createMat4f64();\n            if (terrainTileID.canonical.equals(tileID.canonical)) {\n                mat4.ortho(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n            } else if (terrainTileID.canonical.isChildOf(tileID.canonical)) {\n                const dz = terrainTileID.canonical.z - tileID.canonical.z;\n                const dx = terrainTileID.canonical.x - (terrainTileID.canonical.x >> dz << dz);\n                const dy = terrainTileID.canonical.y - (terrainTileID.canonical.y >> dz << dz);\n                const size = EXTENT >> dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1); // Note: we are using `size` instead of `EXTENT` here\n                mat4.translate(mat, mat, [-dx * size, -dy * size, 0]);\n            } else if (tileID.canonical.isChildOf(terrainTileID.canonical)) {\n                const dz = tileID.canonical.z - terrainTileID.canonical.z;\n                const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz);\n                const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n                const size = EXTENT >> dz;\n                mat4.ortho(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * size, dy * size, 0]);\n                mat4.scale(mat, mat, [1 / (2 ** dz), 1 / (2 ** dz), 0]);\n            } else {\n                continue;\n            }\n            coord.terrainRttPosMatrix32f = new Float32Array(mat);\n            coords[key] = coord;\n        }\n        return coords;\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles.\n     * Includes terrain tiles that are within terrain tile ranges.\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    _getTerrainCoordsForTileRanges(\n        tileID: OverscaledTileID,\n        terrainTileRanges: {[zoom: string]: CanonicalTileRange}\n    ): Record<string, OverscaledTileID> {\n        const coords: Record<string, OverscaledTileID> = {};\n        for (const key of this._renderableTilesKeys) {\n            const terrainTileID = this._tiles[key].tileID;\n            if (!this._isWithinTileRanges(terrainTileID, terrainTileRanges)) {\n                continue;\n            }\n\n            const coord = tileID.clone();\n            const mat = createMat4f64();\n            if (terrainTileID.canonical.z === tileID.canonical.z) {\n                const dx = tileID.canonical.x - terrainTileID.canonical.x\n                    + tileID.wrap * (1 << tileID.canonical.z); // include wrap shift\n                const dy = tileID.canonical.y - terrainTileID.canonical.y;\n                mat4.ortho(mat, 0, EXTENT, EXTENT, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * EXTENT, dy * EXTENT, 0]);\n            } else if (terrainTileID.canonical.z > tileID.canonical.z) {\n                const dz = terrainTileID.canonical.z - tileID.canonical.z;\n                // this translation is needed to project tileID to terrainTileID zoom level\n                const dx = terrainTileID.canonical.x - (terrainTileID.canonical.x >> dz << dz)\n                    + tileID.wrap * (1 << terrainTileID.canonical.z); // include wrap shift\n                const dy = terrainTileID.canonical.y - (terrainTileID.canonical.y >> dz << dz);\n                // this translation is needed if terrainTileID is not a parent of tileID\n                const dx2 = tileID.canonical.x - (terrainTileID.canonical.x >> dz);\n                const dy2 = tileID.canonical.y - (terrainTileID.canonical.y >> dz);\n\n                const size = EXTENT >> dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1);\n                mat4.translate(mat, mat, [-dx * size + dx2 * EXTENT, -dy * size + dy2 * EXTENT, 0]);\n            } else { // terrainTileID.canonical.z < tileID.canonical.z\n                const dz = tileID.canonical.z - terrainTileID.canonical.z;\n                // this translation is needed to project tileID to terrainTileID zoom level\n                const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz)\n                    + tileID.wrap * (1 << tileID.canonical.z); // include wrap shift\n                const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n                // this translation is needed if terrainTileID is not a parent of tileID\n                const dx2 = (tileID.canonical.x >> dz) - terrainTileID.canonical.x;\n                const dy2 = (tileID.canonical.y >> dz) - terrainTileID.canonical.y;\n\n                const size = EXTENT << dz;\n                mat4.ortho(mat, 0, size, size, 0, 0, 1);\n                mat4.translate(mat, mat, [dx * EXTENT + dx2 * size, dy * EXTENT + dy2 * size, 0]);\n            }\n            coord.terrainRttPosMatrix32f = new Float32Array(mat);\n            coords[key] = coord;\n        }\n        return coords;\n    }\n\n    /**\n     * find the covering raster-dem tile\n     * @param tileID - the tile to look for\n     * @param searchForDEM - Optional parameter to search for (parent) source tiles with loaded dem.\n     * @returns the tile\n     */\n    getSourceTile(tileID: OverscaledTileID, searchForDEM?: boolean): Tile | undefined {\n        const source = this.tileManager._source;\n        let z = tileID.overscaledZ - this.deltaZoom;\n        if (z > source.maxzoom) z = source.maxzoom;\n        if (z < source.minzoom) return undefined;\n        // cache for tileID to terrain-tileID\n        if (!this._sourceTileCache[tileID.key])\n            this._sourceTileCache[tileID.key] = tileID.scaledTo(z).key;\n        let tile = this.findTileInCaches(this._sourceTileCache[tileID.key]);\n        // during tile-loading phase look if parent tiles (with loaded dem) are available.\n        if (!tile?.dem && searchForDEM) {\n            while (z >= source.minzoom && !tile?.dem)\n                tile = this.findTileInCaches(tileID.scaledTo(z--).key);\n        }\n        return tile;\n    }\n\n    findTileInCaches(key: string): Tile | undefined {\n        let tile = this.tileManager.getTileByID(key);\n        if (tile) {\n            return tile;\n        }\n        tile = this.tileManager._outOfViewCache.getByKey(key);\n        return tile;\n    }\n\n    /**\n     * gets whether any tiles were loaded after a specific time. This is used to update depth & coords framebuffers.\n     * @param time - the time\n     * @returns true if any tiles came into view at or after the specified time\n     */\n    anyTilesAfterTime(time = Date.now()): boolean {\n        return this._lastTilesetChange >= time;\n    }\n\n    /**\n     * Checks whether a tile is within the canonical tile ranges.\n     * @param tileID - Tile to check\n     * @param canonicalTileRanges - Canonical tile ranges\n     * @returns\n     */\n    private _isWithinTileRanges(\n        tileID: OverscaledTileID,\n        canonicalTileRanges: {[zoom: string]: CanonicalTileRange}\n    ): boolean {\n        const range = canonicalTileRanges[tileID.canonical.z];\n\n        return !!range && (\n            tileID.wrap > range.minWrap || tileID.wrap < range.maxWrap ||\n            tileID.canonical.x >= range.minTileXWrapped &&\n            tileID.canonical.x <= range.maxTileXWrapped &&\n            tileID.canonical.y >= range.minTileY &&\n            tileID.canonical.y <= range.maxTileY\n        );\n    }\n}\n","\nimport {mat4, vec2} from 'gl-matrix';\nimport {OverscaledTileID} from '../tile/tile_id';\nimport {RGBAImage} from '../util/image';\nimport {warnOnce} from '../util/util';\nimport {Pos3dArray, TriangleIndexArray} from '../data/array_types.g';\nimport pos3dAttributes from '../data/pos3d_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {Texture} from '../render/texture';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {TerrainTileManager} from '../tile/terrain_tile_manager';\nimport {EXTENT} from '../data/extent';\nimport {type LngLat, earthRadius} from '../geo/lng_lat';\nimport {Mesh} from './mesh';\nimport {isInBoundsForZoomLngLat} from '../util/world_bounds';\nimport {NORTH_POLE_Y, SOUTH_POLE_Y} from './subdivision';\nimport {coveringTiles} from '../geo/projection/covering_tiles';\nimport type Point from '@mapbox/point-geometry';\nimport type {Tile} from '../tile/tile';\nimport type {Framebuffer} from '../gl/framebuffer';\nimport type {TileManager} from '../tile/tile_manager';\nimport type {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Painter} from './painter';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\n\n/**\n * @internal\n * A terrain GPU related object\n */\nexport type TerrainData = {\n    'u_depth': number;\n    'u_terrain': number;\n    'u_terrain_dim': number;\n    'u_terrain_matrix': mat4;\n    'u_terrain_unpack': number[];\n    'u_terrain_exaggeration': number;\n    texture: WebGLTexture;\n    depthTexture: WebGLTexture;\n    tile: Tile;\n};\n\n/**\n * @internal\n * This is the main class which handles most of the 3D Terrain logic. It has the following topics:\n *\n * 1. loads raster-dem tiles via the internal tileManager this.tileManager\n * 2. creates a depth-framebuffer, which is used to calculate the visibility of coordinates\n * 3. creates a coords-framebuffer, which is used the get to tile-coordinate for a screen-pixel\n * 4. stores all render-to-texture tiles in the this.tileManager._tiles\n * 5. calculates the elevation for a specific tile-coordinate\n * 6. creates a terrain-mesh\n *\n * A note about the GPU resource-usage:\n *\n * Framebuffers:\n *\n * - one for the depth & coords framebuffer with the size of the map-div.\n * - one for rendering a tile to texture with the size of tileSize (= 512x512).\n *\n * Textures:\n *\n * - one texture for an empty raster-dem tile with size 1x1\n * - one texture for an empty depth-buffer, when terrain is disabled with size 1x1\n * - one texture for an each loaded raster-dem with size of the source.tileSize\n * - one texture for the coords-framebuffer with the size of the map-div.\n * - one texture for the depth-framebuffer with the size of the map-div.\n * - one texture for the encoded tile-coords with the size 2*tileSize (=1024x1024)\n * - finally for each render-to-texture tile (= this._tiles) a set of textures\n * for each render stack (The stack-concept is documented in painter.ts).\n *\n * Normally there exists 1-3 Textures per tile, depending on the stylesheet.\n * Each Textures has the size 2*tileSize (= 1024x1024). Also there exists a\n * cache of the last 150 newest rendered tiles.\n *\n */\nexport class Terrain {\n    /**\n     * The style this terrain corresponds to\n     */\n    painter: Painter;\n    /**\n     * the tilemanager this terrain is based on\n     */\n    tileManager: TerrainTileManager;\n    /**\n     * the TerrainSpecification object passed to this instance\n     */\n    options: TerrainSpecification;\n    /**\n     * define the meshSize per tile.\n     */\n    meshSize: number;\n    /**\n     * multiplicator for the elevation. Used to make terrain more \"extreme\".\n     */\n    exaggeration: number;\n    /**\n     * to not see pixels in the render-to-texture tiles it is good to render them bigger\n     * this number is the multiplicator (must be a power of 2) for the current tileSize.\n     * So to get good results with not too much memory footprint a value of 2 should be fine.\n     */\n    qualityFactor: number;\n    /**\n     * holds the framebuffer object in size of the screen to render the coords & depth into a texture.\n     */\n    _fbo: Framebuffer;\n    _fboCoordsTexture: Texture;\n    _fboDepthTexture: Texture;\n    _emptyDepthTexture: Texture;\n    /**\n     * GL Objects for the terrain-mesh\n     * The mesh is a regular mesh, which has the advantage that it can be reused for all tiles.\n     */\n    _meshCache: { [key: string]: Mesh } = {};\n    /**\n     * coords index contains a list of tileID.keys. This index is used to identify\n     * the tile via the alpha-cannel in the coords-texture.\n     * As the alpha-channel has 1 Byte a max of 255 tiles can rendered without an error.\n     */\n    coordsIndex: Array<string>;\n    /**\n     * tile-coords encoded in the rgb channel, _coordsIndex is in the alpha-channel.\n     */\n    _coordsTexture: Texture;\n    /**\n     * accuracy of the coords. 2 * tileSize should be enough.\n     */\n    _coordsTextureSize: number;\n    /**\n     * variables for an empty dem texture, which is used while the raster-dem tile is loading.\n     */\n    _emptyDemUnpack: number[];\n    _emptyDemTexture: Texture;\n    _emptyDemMatrix: mat4;\n    /**\n     * as of overzooming of raster-dem tiles in high zoomlevels, this cache contains\n     * matrices to transform from vector-tile coords to raster-dem-tile coords.\n     */\n    _demMatrixCache: {[_: string]: { matrix: mat4; coord: OverscaledTileID }};\n\n    constructor(painter: Painter, tileManager: TileManager, options: TerrainSpecification) {\n        this.painter = painter;\n        this.tileManager = new TerrainTileManager(tileManager);\n        this.options = options;\n        this.exaggeration = typeof options.exaggeration === 'number' ? options.exaggeration : 1.0;\n        this.qualityFactor = 2;\n        this.meshSize = 128;\n        this._demMatrixCache = {};\n        this.coordsIndex = [];\n        this._coordsTextureSize = 1024;\n    }\n\n    /**\n     * get the elevation-value from original dem-data for a given tile-coordinate\n     * @param tileID - the tile to get elevation for\n     * @param x - between 0 .. EXTENT\n     * @param y - between 0 .. EXTENT\n     * @param extent - optional, default 8192\n     * @returns the elevation\n     */\n    getDEMElevation(tileID: OverscaledTileID, x: number, y: number, extent: number = EXTENT): number {\n        if (!(x >= 0 && x < extent && y >= 0 && y < extent)) return 0;\n        const terrain = this.getTerrainData(tileID);\n        const dem = terrain.tile?.dem;\n        if (!dem) return 0;\n\n        const pos = vec2.transformMat4([] as any, [x / extent * EXTENT, y / extent * EXTENT], terrain.u_terrain_matrix);\n        const coord = [pos[0] * dem.dim, pos[1] * dem.dim];\n\n        // bilinear interpolation\n        const cx = Math.floor(coord[0]),\n            cy = Math.floor(coord[1]),\n            tx = coord[0] - cx,\n            ty = coord[1] - cy;\n        return (\n            dem.get(cx, cy) * (1 - tx) * (1 - ty) +\n            dem.get(cx + 1, cy) * (tx) * (1 - ty) +\n            dem.get(cx, cy + 1) * (1 - tx) * (ty) +\n            dem.get(cx + 1, cy + 1) * (tx) * (ty)\n        );\n    }\n\n    /**\n     * Get the elevation for given {@link LngLat} in respect of exaggeration.\n     * @param lnglat - the location\n     * @param zoom - the zoom, use {@link getElevationForLngLat} if you don't want a specific zoom level, but more accurate results.\n     * @returns the elevation\n     */\n    getElevationForLngLatZoom(lnglat: LngLat, zoom: number) {\n        if (!isInBoundsForZoomLngLat(zoom, lnglat.wrap())) return 0;\n        const {tileID, mercatorX, mercatorY} = this._getOverscaledTileIDFromLngLatZoom(lnglat, zoom);\n        return this.getElevation(tileID, mercatorX % EXTENT, mercatorY % EXTENT, EXTENT);\n    }\n\n    /**\n     * Get the elevation for given {@link LngLat} in respect of exaggeration.\n     * This will traverse up the zoom levels to find the first tile with data to return.\n     * @param lnglat - the location\n     * @returns the elevation\n     */\n    getElevationForLngLat(lnglat: LngLat, transform: IReadonlyTransform) {\n        const terrainCoveringTiles = coveringTiles(transform, {maxzoom: this.tileManager.maxzoom, minzoom: this.tileManager.minzoom, tileSize: 512, terrain: this});\n        let zoom = 0;\n        for (const tile of terrainCoveringTiles) {\n            if (tile.canonical.z > zoom) {\n                zoom = Math.min(tile.canonical.z, this.tileManager.maxzoom);\n            }\n        }\n        return this.getElevationForLngLatZoom(lnglat, zoom);\n    }\n\n    /**\n     * Get the elevation for given coordinate in respect of exaggeration.\n     * @param tileID - the tile id\n     * @param x - between 0 .. EXTENT\n     * @param y - between 0 .. EXTENT\n     * @param extent - optional, default 8192\n     * @returns the elevation\n     */\n    getElevation(tileID: OverscaledTileID, x: number, y: number, extent: number = EXTENT): number {\n        return this.getDEMElevation(tileID, x, y, extent) * this.exaggeration;\n    }\n\n    /**\n     * returns a Terrain Object for a tile. Unless the tile corresponds to data (e.g. tile is loading), return a flat dem object\n     * @param tileID - the tile to get the terrain for\n     * @returns the terrain data to use in the program\n     */\n    getTerrainData(tileID: OverscaledTileID): TerrainData {\n        // create empty DEM Objects, which will used while raster-dem tiles are loading.\n        // creates an empty depth-buffer texture which is needed, during the initialization process of the 3d mesh..\n        if (!this._emptyDemTexture) {\n            const context = this.painter.context;\n            const image = new RGBAImage({width: 1, height: 1}, new Uint8Array(1 * 4));\n            this._emptyDepthTexture = new Texture(context, image, context.gl.RGBA, {premultiply: false});\n            this._emptyDemUnpack = [0, 0, 0, 0];\n            this._emptyDemTexture = new Texture(context, new RGBAImage({width: 1, height: 1}), context.gl.RGBA, {premultiply: false});\n            this._emptyDemTexture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n            this._emptyDemMatrix = mat4.identity([] as any);\n        }\n        // find covering dem tile and prepare demTexture\n        const sourceTile = this.tileManager.getSourceTile(tileID, true);\n        if (sourceTile && sourceTile.dem && (!sourceTile.demTexture || sourceTile.needsTerrainPrepare)) {\n            const context = this.painter.context;\n            sourceTile.demTexture = this.painter.getTileTexture(sourceTile.dem.stride);\n            if (sourceTile.demTexture) sourceTile.demTexture.update(sourceTile.dem.getPixels(), {premultiply: false});\n            else sourceTile.demTexture = new Texture(context, sourceTile.dem.getPixels(), context.gl.RGBA, {premultiply: false});\n            sourceTile.demTexture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n            sourceTile.needsTerrainPrepare = false;\n        }\n        // create matrix for lookup in dem data\n        const matrixKey = sourceTile && sourceTile.toString() + sourceTile.tileID.key + tileID.key;\n        if (matrixKey && !this._demMatrixCache[matrixKey]) {\n            const maxzoom = this.tileManager.getSource().maxzoom;\n            let dz = tileID.canonical.z - sourceTile.tileID.canonical.z;\n            if (tileID.overscaledZ > tileID.canonical.z) {\n                if (tileID.canonical.z >= maxzoom) dz =  tileID.canonical.z - maxzoom;\n                else warnOnce('cannot calculate elevation if elevation maxzoom > source.maxzoom');\n            }\n            const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz);\n            const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n            const demMatrix = mat4.fromScaling(new Float64Array(16) as any, [1 / (EXTENT << dz), 1 / (EXTENT << dz), 0]);\n            mat4.translate(demMatrix, demMatrix, [dx * EXTENT, dy * EXTENT, 0]);\n            this._demMatrixCache[tileID.key] = {matrix: demMatrix, coord: tileID};\n        }\n        // return uniform values & textures\n        return {\n            'u_depth': 2,\n            'u_terrain': 3,\n            'u_terrain_dim': sourceTile && sourceTile.dem && sourceTile.dem.dim || 1,\n            'u_terrain_matrix': matrixKey ? this._demMatrixCache[tileID.key].matrix : this._emptyDemMatrix,\n            'u_terrain_unpack': sourceTile && sourceTile.dem && sourceTile.dem.getUnpackVector() || this._emptyDemUnpack,\n            'u_terrain_exaggeration': this.exaggeration,\n            texture: (sourceTile && sourceTile.demTexture || this._emptyDemTexture).texture,\n            depthTexture: (this._fboDepthTexture || this._emptyDepthTexture).texture,\n            tile: sourceTile\n        };\n    }\n\n    /**\n     * get a framebuffer as big as the map-div, which will be used to render depth & coords into a texture\n     * @param texture - the texture\n     * @returns the frame buffer\n     */\n    getFramebuffer(texture: string): Framebuffer {\n        const painter = this.painter;\n        const width = painter.width / devicePixelRatio;\n        const height = painter.height / devicePixelRatio;\n        if (this._fbo && (this._fbo.width !== width || this._fbo.height !== height)) {\n            this._fbo.destroy();\n            this._fboCoordsTexture.destroy();\n            this._fboDepthTexture.destroy();\n            delete this._fbo;\n            delete this._fboDepthTexture;\n            delete this._fboCoordsTexture;\n        }\n        if (!this._fboCoordsTexture) {\n            this._fboCoordsTexture = new Texture(painter.context, {width, height, data: null}, painter.context.gl.RGBA, {premultiply: false});\n            this._fboCoordsTexture.bind(painter.context.gl.NEAREST, painter.context.gl.CLAMP_TO_EDGE);\n        }\n        if (!this._fboDepthTexture) {\n            this._fboDepthTexture = new Texture(painter.context, {width, height, data: null}, painter.context.gl.RGBA, {premultiply: false});\n            this._fboDepthTexture.bind(painter.context.gl.NEAREST, painter.context.gl.CLAMP_TO_EDGE);\n        }\n        if (!this._fbo) {\n            this._fbo = painter.context.createFramebuffer(width, height, true, false);\n            this._fbo.depthAttachment.set(painter.context.createRenderbuffer(painter.context.gl.DEPTH_COMPONENT16, width, height));\n        }\n        this._fbo.colorAttachment.set(texture === 'coords' ? this._fboCoordsTexture.texture : this._fboDepthTexture.texture);\n        return this._fbo;\n    }\n\n    /**\n     * create coords texture, needed to grab coordinates from canvas\n     * encode coords coordinate into 4 bytes:\n     *   - 8 lower bits for x\n     *   - 8 lower bits for y\n     *   - 4 higher bits for x\n     *   - 4 higher bits for y\n     *   - 8 bits for coordsIndex (1 .. 255) (= number of terraintile), is later setted in draw_terrain uniform value\n     * @returns the texture\n     */\n    getCoordsTexture(): Texture {\n        const context = this.painter.context;\n        if (this._coordsTexture) return this._coordsTexture;\n        const data = new Uint8Array(this._coordsTextureSize * this._coordsTextureSize * 4);\n        for (let y = 0, i = 0; y < this._coordsTextureSize; y++) for (let x = 0; x < this._coordsTextureSize; x++, i += 4) {\n            data[i + 0] = x & 255;\n            data[i + 1] = y & 255;\n            data[i + 2] = ((x >> 8) << 4) | (y >> 8);\n            data[i + 3] = 0;\n        }\n        const image = new RGBAImage({width: this._coordsTextureSize, height: this._coordsTextureSize}, new Uint8Array(data.buffer));\n        const texture = new Texture(context, image, context.gl.RGBA, {premultiply: false});\n        texture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n        this._coordsTexture = texture;\n        return texture;\n    }\n\n    /**\n     * Reads a pixel from the coords-framebuffer and translate this to mercator, or null, if the pixel doesn't lie on the terrain's surface (but the sky instead).\n     * @param p - Screen-Coordinate\n     * @returns Mercator coordinate for a screen pixel, or null, if the pixel is not covered by terrain (is in the sky).\n     */\n    pointCoordinate(p: Point): MercatorCoordinate {\n        // First, ensure the coords framebuffer is up to date.\n        this.painter.maybeDrawDepthAndCoords(true);\n\n        const rgba = new Uint8Array(4);\n        const context = this.painter.context, gl = context.gl;\n        const px = Math.round(p.x * this.painter.pixelRatio / devicePixelRatio);\n        const py = Math.round(p.y * this.painter.pixelRatio / devicePixelRatio);\n        const fbHeight = Math.round(this.painter.height / devicePixelRatio);\n        // grab coordinate pixel from coordinates framebuffer\n        context.bindFramebuffer.set(this.getFramebuffer('coords').framebuffer);\n        gl.readPixels(px, fbHeight - py - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);\n        context.bindFramebuffer.set(null);\n        // decode coordinates (encoding see getCoordsTexture)\n        const x = rgba[0] + ((rgba[2] >> 4) << 8);\n        const y = rgba[1] + ((rgba[2] & 15) << 8);\n        const tileID = this.coordsIndex[255 - rgba[3]];\n        const tile = tileID && this.tileManager.getTileByID(tileID);\n\n        if (!tile) {\n            return null;\n        }\n\n        const coordsSize = this._coordsTextureSize;\n        const worldSize = (1 << tile.tileID.canonical.z) * coordsSize;\n        return new MercatorCoordinate(\n            (tile.tileID.canonical.x * coordsSize + x) / worldSize + tile.tileID.wrap,\n            (tile.tileID.canonical.y * coordsSize + y) / worldSize,\n            this.getElevation(tile.tileID, x, y, coordsSize)\n        );\n    }\n\n    /**\n     * Reads the depth value from the depth-framebuffer at a given screen pixel\n     * @param p - Screen coordinate\n     * @returns depth value in clip space (between 0 and 1)\n     */\n\n    depthAtPoint(p: Point): number {\n        const rgba = new Uint8Array(4);\n        const context = this.painter.context, gl = context.gl;\n        context.bindFramebuffer.set(this.getFramebuffer('depth').framebuffer);\n        gl.readPixels(p.x, this.painter.height / devicePixelRatio - p.y - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);\n        context.bindFramebuffer.set(null);\n        // decode coordinates (encoding see terran_depth.fragment.glsl)\n        const depthValue = (rgba[0] / (256 * 256 * 256) + rgba[1] / (256 * 256) + rgba[2] / 256 + rgba[3]) / 256;\n        return depthValue;\n    }\n\n    /**\n     * create a regular mesh which will be used by all terrain-tiles\n     * @returns the created regular mesh\n     */\n    getTerrainMesh(tileId: OverscaledTileID): Mesh {\n        const globeEnabled = this.painter.style.projection?.transitionState > 0;\n        const northPole = globeEnabled && tileId.canonical.y === 0;\n        const southPole = globeEnabled && tileId.canonical.y === (1 << tileId.canonical.z) - 1;\n        const key = `m_${northPole ? 'n' : ''}_${southPole ? 's' : ''}`;\n        if (this._meshCache[key]) {\n            return this._meshCache[key];\n        }\n        const context = this.painter.context;\n\n        const vertexArray = new Pos3dArray();\n        const indexArray = new TriangleIndexArray();\n        const meshSize = this.meshSize;\n        const delta = EXTENT / meshSize;\n        const meshSize2 = meshSize * meshSize;\n        for (let y = 0; y <= meshSize; y++) for (let x = 0; x <= meshSize; x++) {\n            vertexArray.emplaceBack(x * delta, y * delta, 0);\n        }\n        for (let y = 0; y < meshSize2; y += meshSize + 1) for (let x = 0; x < meshSize; x++) {\n            indexArray.emplaceBack(x + y, meshSize + x + y + 1, meshSize + x + y + 2);\n            indexArray.emplaceBack(x + y, meshSize + x + y + 2, x + y + 1);\n        }\n        // add an extra frame around the mesh to avoid stitching on tile boundaries with different zoomlevels\n        // top-bottom frame + pole vertices, if needed\n        const offsetTop = vertexArray.length;\n        const offsetTopEdge = 0;\n        const offsetBottom = offsetTop + (meshSize + 1);\n        const offsetBottomEdge = (meshSize + 1) * meshSize;\n        const northY = northPole ? NORTH_POLE_Y : 0;\n        const northZ = northPole ? 0 : 1;\n        const southY = southPole ? SOUTH_POLE_Y : EXTENT;\n        const southZ = southPole ? 0 : 1;\n        for (let x = 0; x <= meshSize; x++) {\n            vertexArray.emplaceBack(x * delta, northY, northZ);\n        }\n        for (let x = 0; x <= meshSize; x++) {\n            vertexArray.emplaceBack(x * delta, southY, southZ);\n        }\n        for (let x = 0; x < meshSize; x++) {\n            indexArray.emplaceBack(offsetBottomEdge + x, offsetBottom + x, offsetBottom + x + 1);\n            indexArray.emplaceBack(offsetBottomEdge + x, offsetBottom + x + 1, offsetBottomEdge + x + 1);\n            indexArray.emplaceBack(offsetTopEdge + x, offsetTop + x + 1, offsetTop + x);\n            indexArray.emplaceBack(offsetTopEdge + x, offsetTopEdge + x + 1, offsetTop + x + 1);\n        }\n        // left-right frame\n        const offsetLeft = vertexArray.length;\n        const offsetRight = offsetLeft + (meshSize + 1) * 2;\n        for (const x of [0, 1]) for (let y = 0; y <= meshSize; y++) for (const z of [0, 1]) {\n            vertexArray.emplaceBack(x * EXTENT, y * delta, z);\n        }\n        for (let y = 0; y < meshSize * 2; y += 2) {\n            indexArray.emplaceBack(offsetLeft + y, offsetLeft + y + 1, offsetLeft + y + 3);\n            indexArray.emplaceBack(offsetLeft + y, offsetLeft + y + 3, offsetLeft + y + 2);\n            indexArray.emplaceBack(offsetRight + y, offsetRight + y + 3, offsetRight + y + 1);\n            indexArray.emplaceBack(offsetRight + y, offsetRight + y + 2, offsetRight + y + 3);\n        }\n\n        const mesh = new Mesh(\n            context.createVertexBuffer(vertexArray, pos3dAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n        this._meshCache[key] = mesh;\n        return mesh;\n    }\n\n    /**\n     * Calculates a height of the frame around the terrain-mesh to avoid stitching between\n     * tile boundaries in different zoomlevels.\n     * @param zoom - current zoomlevel\n     * @returns the elevation delta in meters\n     */\n    getMeshFrameDelta(zoom: number): number {\n        // divide by 5 is evaluated by trial & error to get a frame in the right height\n        return 2 * Math.PI * earthRadius / Math.pow(2, Math.max(zoom, 0)) / 5;\n    }\n\n    getMinTileElevationForLngLatZoom(lnglat: LngLat, zoom: number) {\n        if (!isInBoundsForZoomLngLat(zoom, lnglat.wrap())) return 0;\n        const {tileID} = this._getOverscaledTileIDFromLngLatZoom(lnglat, zoom);\n        return this.getMinMaxElevation(tileID).minElevation ?? 0;\n    }\n\n    /**\n     * Get the minimum and maximum elevation contained in a tile. This includes any\n     * exaggeration included in the terrain.\n     *\n     * @param tileID - ID of the tile to be used as a source for the min/max elevation\n     * @returns the minimum and maximum elevation found in the tile, including the terrain's\n     * exaggeration\n     */\n    getMinMaxElevation(tileID: OverscaledTileID): {minElevation: number | null; maxElevation: number | null} {\n        const tile = this.getTerrainData(tileID).tile;\n        const minMax = {minElevation: null, maxElevation: null};\n        if (tile && tile.dem) {\n            minMax.minElevation = tile.dem.min * this.exaggeration;\n            minMax.maxElevation = tile.dem.max * this.exaggeration;\n        }\n        return minMax;\n    }\n\n    _getOverscaledTileIDFromLngLatZoom(lnglat: LngLat, zoom: number): { tileID: OverscaledTileID; mercatorX: number; mercatorY: number} {\n        const mercatorCoordinate = MercatorCoordinate.fromLngLat(lnglat.wrap());\n        const worldSize = (1 << zoom) * EXTENT;\n        const mercatorX = mercatorCoordinate.x * worldSize;\n        const mercatorY = mercatorCoordinate.y * worldSize;\n        const tileX = Math.floor(mercatorX / EXTENT), tileY = Math.floor(mercatorY / EXTENT);\n        const tileID = new OverscaledTileID(zoom, 0, zoom, tileX, tileY);\n        return {\n            tileID,\n            mercatorX,\n            mercatorY\n        };\n    }\n}\n","import {Texture} from '../render/texture';\nimport {type Context} from './context';\nimport {type Framebuffer} from './framebuffer';\n\nexport type PoolObject = {\n    id: number;\n    fbo: Framebuffer;\n    texture: Texture;\n    stamp: number;\n    inUse: boolean;\n};\n/**\n * @internal\n * `RenderPool` is a resource pool for textures and framebuffers\n */\nexport class RenderPool {\n    private _objects: Array<PoolObject>;\n    /**\n     * An index array of recently used pool objects.\n     * Items that are used recently are last in the array\n     */\n    private _recentlyUsed: Array<number>;\n    private _stamp: number;\n\n    constructor(\n        private readonly _context: Context,\n        private readonly _size: number,\n        private readonly _tileSize: number) {\n        this._objects = [];\n        this._recentlyUsed = [];\n        this._stamp = 0;\n    }\n\n    public destruct() {\n        for (const obj of this._objects) {\n            obj.texture.destroy();\n            obj.fbo.destroy();\n        }\n    }\n\n    private _createObject(id: number): PoolObject {\n        const fbo = this._context.createFramebuffer(this._tileSize, this._tileSize, true, true);\n        const texture = new Texture(this._context, {width: this._tileSize, height: this._tileSize, data: null}, this._context.gl.RGBA);\n        texture.bind(this._context.gl.LINEAR, this._context.gl.CLAMP_TO_EDGE);\n        if (this._context.extTextureFilterAnisotropic) {\n            this._context.gl.texParameterf(this._context.gl.TEXTURE_2D, this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, this._context.extTextureFilterAnisotropicMax);\n        }\n        fbo.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL, this._tileSize, this._tileSize));\n        fbo.colorAttachment.set(texture.texture);\n        return {id, fbo, texture, stamp: -1, inUse: false};\n    }\n\n    public getObjectForId(id: number): PoolObject {\n        return this._objects[id];\n    }\n\n    public useObject(obj: PoolObject) {\n        obj.inUse = true;\n        this._recentlyUsed = this._recentlyUsed.filter(id => obj.id !== id);\n        this._recentlyUsed.push(obj.id);\n    }\n\n    public stampObject(obj: PoolObject) {\n        obj.stamp = ++this._stamp;\n    }\n\n    public getOrCreateFreeObject(): PoolObject {\n        // check for free existing object\n        for (const id of this._recentlyUsed) {\n            if (!this._objects[id].inUse)\n                return this._objects[id];\n        }\n        if (this._objects.length >= this._size)\n            throw new Error('No free RenderPool available, call freeAllObjects() required!');\n        // create new object\n        const obj = this._createObject(this._objects.length);\n        this._objects.push(obj);\n        return obj;\n    }\n\n    public freeObject(obj: PoolObject) {\n        obj.inUse = false;\n    }\n\n    public freeAllObjects() {\n        for (const obj of this._objects)\n            this.freeObject(obj);\n    }\n\n    public isFull(): boolean {\n        if (this._objects.length < this._size) {\n            return false;\n        }\n        return this._objects.some(o => !o.inUse) === false;\n    }\n}\n","import {type Painter, type RenderOptions} from './painter';\nimport {type Tile} from '../tile/tile';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {type OverscaledTileID} from '../tile/tile_id';\nimport {drawTerrain} from './draw_terrain';\nimport {type Style} from '../style/style';\nimport {type Terrain} from './terrain';\nimport {RenderPool} from '../gl/render_pool';\nimport {type Texture} from './texture';\nimport type {StyleLayer} from '../style/style_layer';\nimport {ImageSource} from '../source/image_source';\n\n/**\n * lookup table which layers should rendered to texture\n */\nconst LAYERS: { [keyof in StyleLayer['type']]?: boolean } = {\n    background: true,\n    fill: true,\n    line: true,\n    raster: true,\n    hillshade: true,\n    'color-relief': true\n};\n\n/**\n * @internal\n * A helper class to help define what should be rendered to texture and how\n */\nexport class RenderToTexture {\n    painter: Painter;\n    terrain: Terrain;\n    pool: RenderPool;\n    /**\n     * coordsAscending contains a list of all tiles which should be rendered for one render-to-texture tile\n     * e.g. render 4 raster-tiles with size 256px to the 512px render-to-texture tile\n     */\n    _coordsAscending: {[_: string]: {[_:string]: Array<OverscaledTileID>}};\n    /**\n     * create a string representation of all to tiles rendered to render-to-texture tiles\n     * this string representation is used to check if tile should be re-rendered.\n     */\n    _coordsAscendingStr: {[_: string]: {[_:string]: string}};\n    /**\n     * store for render-stacks\n     * a render stack is a set of layers which should be rendered into one texture\n     * every stylesheet can have multiple stacks. A new stack is created if layers which should\n     * not rendered to texture sit between layers which should rendered to texture. e.g. hillshading or symbols\n     */\n    _stacks: Array<Array<string>>;\n    /**\n     * remember the previous processed layer to check if a new stack is needed\n     */\n    _prevType: string;\n    /**\n     * a list of tiles that can potentially rendered\n     */\n    _renderableTiles: Array<Tile>;\n    /**\n     * a list of tiles that should be rendered to screen in the next render-call\n     */\n    _rttTiles: Array<Tile>;\n    /**\n     * a list of all layer-ids which should be rendered\n     */\n    _renderableLayerIds: Array<string>;\n\n    constructor(painter: Painter, terrain: Terrain) {\n        this.painter = painter;\n        this.terrain = terrain;\n        this.pool = new RenderPool(painter.context, 30, terrain.tileManager.tileSize * terrain.qualityFactor);\n    }\n\n    destruct() {\n        this.pool.destruct();\n    }\n\n    getTexture(tile: Tile): Texture {\n        return this.pool.getObjectForId(tile.rtt[this._stacks.length - 1].id).texture;\n    }\n\n    prepareForRender(style: Style, zoom: number) {\n        this._stacks = [];\n        this._prevType = null;\n        this._rttTiles = [];\n        this._renderableTiles = this.terrain.tileManager.getRenderableTiles();\n        this._renderableLayerIds = style._order.filter(id => !style._layers[id].isHidden(zoom));\n\n        this._coordsAscending = {};\n        for (const id in style.tileManagers) {\n            this._coordsAscending[id] = {};\n            const tileIDs = style.tileManagers[id].getVisibleCoordinates();\n            const source = style.tileManagers[id].getSource();\n            const terrainTileRanges = source instanceof ImageSource ? source.terrainTileRanges : null;\n            for (const tileID of tileIDs) {\n                const keys = this.terrain.tileManager.getTerrainCoords(tileID, terrainTileRanges);\n                for (const key in keys) {\n                    if (!this._coordsAscending[id][key]) this._coordsAscending[id][key] = [];\n                    this._coordsAscending[id][key].push(keys[key]);\n                }\n            }\n        }\n\n        this._coordsAscendingStr = {};\n        for (const id of style._order) {\n            const layer = style._layers[id], source = layer.source;\n            if (LAYERS[layer.type]) {\n                if (!this._coordsAscendingStr[source]) {\n                    this._coordsAscendingStr[source] = {};\n                    for (const key in this._coordsAscending[source])\n                        this._coordsAscendingStr[source][key] = this._coordsAscending[source][key].map(c => c.key).sort().join();\n                }\n            }\n        }\n\n        // check tiles to render\n        for (const tile of this._renderableTiles) {\n            for (const source in this._coordsAscendingStr) {\n                // rerender if there are more coords to render than in the last rendering\n                const coords = this._coordsAscendingStr[source][tile.tileID.key];\n                if (coords && coords !== tile.rttCoords[source]) tile.rtt = [];\n            }\n        }\n    }\n\n    /**\n     * due that switching textures is relatively slow, the render\n     * layer-by-layer context is not practicable. To bypass this problem\n     * this lines of code stack all layers and later render all at once.\n     * Because of the stylesheet possibility to mixing render-to-texture layers\n     * and 'live'-layers (f.e. symbols) it is necessary to create more stacks. For example\n     * a symbol-layer is in between of fill-layers.\n     * @param layer - the layer to render\n     * @param renderOptions - flags describing how to render the layer\n     * @returns if true layer is rendered to texture, otherwise false\n     */\n    renderLayer(layer: StyleLayer, renderOptions: RenderOptions): boolean {\n        if (layer.isHidden(this.painter.transform.zoom)) return false;\n\n        const options: RenderOptions = {...renderOptions, isRenderingToTexture: true};\n        const type = layer.type;\n        const painter = this.painter;\n        const isLastLayer = this._renderableLayerIds[this._renderableLayerIds.length - 1] === layer.id;\n\n        // remember background, fill, line & raster layer to render into a stack\n        if (LAYERS[type]) {\n            // create a new stack if previous layer was not rendered to texture (f.e. symbols)\n            if (!this._prevType || !LAYERS[this._prevType]) this._stacks.push([]);\n            // push current render-to-texture layer to render-stack\n            this._prevType = type;\n            this._stacks[this._stacks.length - 1].push(layer.id);\n            // rendering is done later, all in once\n            if (!isLastLayer) return true;\n        }\n\n        // in case a stack is finished render all collected stack-layers into a texture\n        if (LAYERS[this._prevType] || (LAYERS[type] && isLastLayer)) {\n            this._prevType = type;\n            const stack = this._stacks.length - 1, layers = this._stacks[stack] || [];\n            for (const tile of this._renderableTiles) {\n                // if render pool is full draw current tiles to screen and free pool\n                if (this.pool.isFull()) {\n                    drawTerrain(this.painter, this.terrain, this._rttTiles, options);\n                    this._rttTiles = [];\n                    this.pool.freeAllObjects();\n                }\n                this._rttTiles.push(tile);\n                // check for cached PoolObject\n                if (tile.rtt[stack]) {\n                    const obj = this.pool.getObjectForId(tile.rtt[stack].id);\n                    if (obj.stamp === tile.rtt[stack].stamp) {\n                        this.pool.useObject(obj);\n                        continue;\n                    }\n                }\n                // get free PoolObject\n                const obj = this.pool.getOrCreateFreeObject();\n                this.pool.useObject(obj);\n                this.pool.stampObject(obj);\n                tile.rtt[stack] = {id: obj.id, stamp: obj.stamp};\n                // prepare PoolObject for rendering\n                painter.context.bindFramebuffer.set(obj.fbo.framebuffer);\n                painter.context.clear({color: Color.transparent, stencil: 0});\n                painter.currentStencilSource = undefined;\n                for (let l = 0; l < layers.length; l++) {\n                    const layer = painter.style._layers[layers[l]];\n                    const coords = layer.source ? this._coordsAscending[layer.source][tile.tileID.key] : [tile.tileID];\n                    painter.context.viewport.set([0, 0, obj.fbo.width, obj.fbo.height]);\n                    painter._renderTileClippingMasks(layer, coords, true);\n                    painter.renderLayer(painter, painter.style.tileManagers[layer.source], layer, coords, options);\n                    if (layer.source) tile.rttCoords[layer.source] = this._coordsAscendingStr[layer.source][tile.tileID.key];\n                }\n            }\n            drawTerrain(this.painter, this.terrain, this._rttTiles, options);\n            this._rttTiles = [];\n            this.pool.freeAllObjects();\n\n            return LAYERS[type];\n        }\n\n        return false;\n    }\n\n}\n","export const defaultLocale = {\n    'AttributionControl.ToggleAttribution': 'Toggle attribution',\n    'AttributionControl.MapFeedback': 'Map feedback',\n    'FullscreenControl.Enter': 'Enter fullscreen',\n    'FullscreenControl.Exit': 'Exit fullscreen',\n    'GeolocateControl.FindMyLocation': 'Find my location',\n    'GeolocateControl.LocationNotAvailable': 'Location not available',\n    'LogoControl.Title': 'MapLibre logo',\n    'Map.Title': 'Map',\n    'Marker.Title': 'Map marker',\n    'NavigationControl.ResetBearing': 'Reset bearing to north',\n    'NavigationControl.ZoomIn': 'Zoom in',\n    'NavigationControl.ZoomOut': 'Zoom out',\n    'Popup.Close': 'Close popup',\n    'ScaleControl.Feet': 'ft',\n    'ScaleControl.Meters': 'm',\n    'ScaleControl.Kilometers': 'km',\n    'ScaleControl.Miles': 'mi',\n    'ScaleControl.NauticalMiles': 'nm',\n    'GlobeControl.Enable': 'Enable globe',\n    'GlobeControl.Disable': 'Disable globe',\n    'TerrainControl.Enable': 'Enable terrain',\n    'TerrainControl.Disable': 'Disable terrain',\n    'CooperativeGesturesHandler.WindowsHelpText': 'Use Ctrl + scroll to zoom the map',\n    'CooperativeGesturesHandler.MacHelpText': 'Use â + scroll to zoom the map',\n    'CooperativeGesturesHandler.MobileHelpText': 'Use two fingers to move the map',\n};\n","import {extend, warnOnce, uniqueId, isImageBitmap, type Complete, pick, type Subscription} from '../util/util';\nimport {browser} from '../util/browser';\nimport {now} from '../util/time_control';\nimport {DOM} from '../util/dom';\nimport packageJSON from '../../package.json' with {type: 'json'};\nimport {type GetResourceResponse, getJSON} from '../util/ajax';\nimport {ImageRequest} from '../util/image_request';\nimport {RequestManager, ResourceType} from '../util/request_manager';\nimport {Style, type StyleSwapOptions} from '../style/style';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {Painter} from '../render/painter';\nimport {Hash} from './hash';\nimport {HandlerManager} from './handler_manager';\nimport {Camera, type CameraOptions, type CameraUpdateTransformFunction, type FitBoundsOptions} from './camera';\nimport {LngLat} from '../geo/lng_lat';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {AttributionControl, type AttributionControlOptions, defaultAttributionControlOptions} from './control/attribution_control';\nimport {LogoControl} from './control/logo_control';\nimport {RGBAImage} from '../util/image';\nimport {Event, ErrorEvent, type Listener} from '../util/evented';\nimport {type MapEventType, type MapLayerEventType, MapMouseEvent, type MapSourceDataEvent, type MapStyleDataEvent} from './events';\nimport {TaskQueue} from '../util/task_queue';\nimport {throttle} from '../util/throttle';\nimport {webpSupported} from '../util/webp_supported';\nimport {PerformanceMarkers, PerformanceUtils} from '../util/performance';\nimport {type Source} from '../source/source';\nimport {type StyleLayer} from '../style/style_layer';\nimport {Terrain} from '../render/terrain';\nimport {RenderToTexture} from '../render/render_to_texture';\nimport {config} from '../util/config';\nimport {defaultLocale} from './default_locale';\nimport {MercatorTransform} from '../geo/projection/mercator_transform';\nimport {MercatorCameraHelper} from '../geo/projection/mercator_camera_helper';\nimport {isAbortError} from '../util/abort_error';\nimport {isFramebufferNotCompleteError} from '../util/framebuffer_error';\nimport {coveringTiles, type CoveringTilesOptions, createCalculateTileZoomFunction} from '../geo/projection/covering_tiles';\nimport {CanonicalTileID, type OverscaledTileID} from '../tile/tile_id';\n\nimport type {RequestTransformFunction} from '../util/request_manager';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport type {AddLayerObject, FeatureIdentifier, StyleOptions, StyleSetterOptions} from '../style/style';\nimport type {MapDataEvent} from './events';\nimport type {StyleImage, StyleImageInterface, StyleImageMetadata} from '../style/style_image';\nimport type {PointLike} from './camera';\nimport type {ScrollZoomHandler} from './handler/scroll_zoom';\nimport type {BoxZoomHandler} from './handler/box_zoom';\nimport type {AroundCenterOptions, TwoFingersTouchPitchHandler} from './handler/two_fingers_touch';\nimport type {DragRotateHandler} from './handler/shim/drag_rotate';\nimport type {DragPanHandler, DragPanOptions} from './handler/shim/drag_pan';\nimport type {CooperativeGesturesHandler, GestureOptions} from './handler/cooperative_gestures';\nimport type {KeyboardHandler} from './handler/keyboard';\nimport type {DoubleClickZoomHandler} from './handler/shim/dblclick_zoom';\nimport type {TwoFingersTouchZoomRotateHandler} from './handler/shim/two_fingers_touch';\nimport type {TaskID} from '../util/task_queue';\nimport type {\n    FilterSpecification,\n    StyleSpecification,\n    LightSpecification,\n    SourceSpecification,\n    TerrainSpecification,\n    ProjectionSpecification,\n    SkySpecification,\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {GeoJSONFeature, MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {ControlPosition, IControl} from './control/control';\nimport type {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions} from '../source/query_features';\nimport type {ITransform, TransformConstrainFunction} from '../geo/transform_interface';\nimport type {ICameraHelper} from '../geo/projection/camera_helper';\n\nconst version = packageJSON.version;\n\nexport type WebGLSupportedVersions = 'webgl2' | 'webgl' | undefined;\nexport type WebGLContextAttributesWithType = WebGLContextAttributes & {contextType?: WebGLSupportedVersions};\n\n/**\n * The {@link Map} options object.\n */\nexport type MapOptions = {\n    /**\n     * If `true`, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL.\n     * For example, `http://path/to/my/page.html#2.59/39.26/53.07/-24.1/60`.\n     * An additional string may optionally be provided to indicate a parameter-styled hash,\n     * e.g. http://path/to/my/page.html#map=2.59/39.26/53.07/-24.1/60&foo=bar, where foo\n     * is a custom parameter and bar is an arbitrary hash distinct from the map hash.\n     * @defaultValue false\n     */\n    hash?: boolean | string;\n    /**\n     * If `false`, no mouse, touch, or keyboard listeners will be attached to the map, so it will not respond to interaction.\n     * @defaultValue true\n     */\n    interactive?: boolean;\n    /**\n     * The HTML element in which MapLibre GL JS will render the map, or the element's string `id`. The specified element must have no children.\n     */\n    container: HTMLElement | string;\n    /**\n     * The threshold, measured in degrees, that determines when the map's\n     * bearing will snap to north. For example, with a `bearingSnap` of 7, if the user rotates\n     * the map within 7 degrees of north, the map will automatically snap to exact north.\n     * @defaultValue 7\n     */\n    bearingSnap?: number;\n    /**\n     * The step increment the zoom level will snap to.\n     * For example, if `zoomSnap` is 1, the map will snap to whole integers during discrete zoom operations.\n     * If set to 0, zooming is continuous.\n     * @defaultValue 0\n     */\n    zoomSnap?: number;\n    /**\n     * If set, an {@link AttributionControl} will be added to the map with the provided options.\n     * To disable the attribution control, pass `false`.\n     * !!! note\n     *     Showing the logo of MapLibre is not required for using MapLibre.\n     * @defaultValue compact: true, customAttribution: \"MapLibre ...\".\n     */\n    attributionControl?: false | AttributionControlOptions;\n    /**\n     * If `true`, the MapLibre logo will be shown.\n     */\n    maplibreLogo?: boolean;\n    /**\n     * A string representing the position of the MapLibre wordmark on the map. Valid options are `top-left`,`top-right`, `bottom-left`, or `bottom-right`.\n     * @defaultValue 'bottom-left'\n     */\n    logoPosition?: ControlPosition;\n    /**\n     * Set of WebGLContextAttributes that are applied to the WebGL context of the map.\n     * See https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext for more details.\n     * `contextType` can be set to `webgl2` or `webgl` to force a WebGL version. Not setting it, Maplibre will do it's best to get a suitable context.\n     * @defaultValue antialias: false, powerPreference: 'high-performance', preserveDrawingBuffer: false, failIfMajorPerformanceCaveat: false, desynchronized: false, contextType: 'webgl2withfallback'\n     */\n    canvasContextAttributes?: WebGLContextAttributesWithType;\n    /**\n     * If `false`, the map won't attempt to re-request tiles once they expire per their HTTP `cacheControl`/`expires` headers.\n     * @defaultValue true\n     */\n    refreshExpiredTiles?: boolean;\n    /**\n     * If set, the map will be constrained to the given bounds.\n     */\n    maxBounds?: LngLatBoundsLike;\n    /**\n     * If `true`, the \"scroll to zoom\" interaction is enabled. {@link AroundCenterOptions} are passed as options to {@link ScrollZoomHandler.enable}.\n     * @defaultValue true\n     */\n    scrollZoom?: boolean | AroundCenterOptions;\n    /**\n     * The minimum zoom level of the map (0-24).\n     * @defaultValue 0\n     */\n    minZoom?: number | null;\n    /**\n     * The maximum zoom level of the map (0-24).\n     * @defaultValue 22\n     */\n    maxZoom?: number | null;\n    /**\n     * The minimum pitch of the map (0-180).\n     * @defaultValue 0\n     */\n    minPitch?: number | null;\n    /**\n     * The maximum pitch of the map (0-180).\n     * @defaultValue 60\n     */\n    maxPitch?: number | null;\n    /**\n     * If `true`, the \"box zoom\" interaction is enabled (see {@link BoxZoomHandler}).\n     * @defaultValue true\n     */\n    boxZoom?: boolean;\n    /**\n     * If `true`, the \"drag to rotate\" interaction is enabled (see {@link DragRotateHandler}).\n     * @defaultValue true\n     */\n    dragRotate?: boolean;\n    /**\n     * If `true`, the \"drag to pan\" interaction is enabled. An `Object` value is passed as options to {@link DragPanHandler.enable}.\n     * @defaultValue true\n     */\n    dragPan?: boolean | DragPanOptions;\n    /**\n     * If `true`, keyboard shortcuts are enabled (see {@link KeyboardHandler}).\n     * @defaultValue true\n     */\n    keyboard?: boolean;\n    /**\n     * If `true`, the \"double click to zoom\" interaction is enabled (see {@link DoubleClickZoomHandler}).\n     * @defaultValue true\n     */\n    doubleClickZoom?: boolean;\n    /**\n     * If `true`, the \"pinch to rotate and zoom\" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchZoomRotateHandler.enable}.\n     * @defaultValue true\n     */\n    touchZoomRotate?: boolean | AroundCenterOptions;\n    /**\n     * If `true`, the \"drag to pitch\" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchPitchHandler.enable}.\n     * @defaultValue true\n     */\n    touchPitch?: boolean | AroundCenterOptions;\n    /**\n     * If `true` or set to an options object, the map is only accessible on desktop while holding Command/Ctrl and only accessible on mobile with two fingers. Interacting with the map using normal gestures will trigger an informational screen. With this option enabled, \"drag to pitch\" requires a three-finger gesture. Cooperative gestures are disabled when a map enters fullscreen using {@link FullscreenControl}.\n     * @defaultValue false\n     */\n    cooperativeGestures?: GestureOptions;\n    /**\n     * If `true`, the map will automatically resize when the browser window resizes.\n     * @defaultValue true\n     */\n    trackResize?: boolean;\n    /**\n     * The initial geographical centerpoint of the map. If `center` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `[0, 0]`\n     * !!! note\n     *     MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match GeoJSON.\n     * @defaultValue [0, 0]\n     */\n    center?: LngLatLike;\n    /**\n     * The elevation of the initial geographical centerpoint of the map, in meters above sea level. If `elevation` is not specified in the constructor options, it will default to `0`.\n     * @defaultValue 0\n     */\n    elevation?: number;\n    /**\n     * The initial zoom level of the map. If `zoom` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.\n     * @defaultValue 0\n     */\n    zoom?: number;\n    /**\n     * The initial bearing (rotation) of the map, measured in degrees counter-clockwise from north. If `bearing` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.\n     * @defaultValue 0\n     */\n    bearing?: number;\n    /**\n     * The initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-85). If `pitch` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`. Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * @defaultValue 0\n     */\n    pitch?: number;\n    /**\n     * The initial roll angle of the map, measured in degrees counter-clockwise about the camera boresight. If `roll` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.\n     * @defaultValue 0\n     */\n    roll?: number;\n    /**\n     * If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     * @defaultValue true\n     */\n    renderWorldCopies?: boolean;\n    /**\n     * The maximum number of tiles stored in the tile cache for a given source. If omitted, the cache will be dynamically sized based on the current viewport which can be set using `maxTileCacheZoomLevels` constructor options.\n     * @defaultValue null\n     */\n    maxTileCacheSize?: number | null;\n    /**\n     * The maximum number of zoom levels for which to store tiles for a given source. Tile cache dynamic size is calculated by multiplying `maxTileCacheZoomLevels` with the approximate number of tiles in the viewport for a given source.\n     * @defaultValue 5\n     */\n    maxTileCacheZoomLevels?: number;\n    /**\n     * A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.\n     * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties.\n     * @defaultValue null\n     */\n    transformRequest?: RequestTransformFunction | null;\n    /**\n     * A callback run before the map's camera is moved due to user input or animation. The callback can be used to modify the new center, zoom, pitch and bearing.\n     * Expected to return an object containing center, zoom, pitch or bearing values to overwrite.\n     * @defaultValue null\n     */\n    transformCameraUpdate?: CameraUpdateTransformFunction | null;\n    /**\n     * A callback that overrides how the map constrains the viewport's lnglat and zoom to respect the longitude and latitude bounds.\n     * @see [Customize the map transform constrain](https://maplibre.org/maplibre-gl-js/docs/examples/customize-the-map-transform-constrain/)\n     * Expected to return an object containing center and zoom.\n     * @defaultValue null\n     */\n    transformConstrain?: TransformConstrainFunction | null;\n    /**\n     * A patch to apply to the default localization table for UI strings, e.g. control tooltips. The `locale` object maps namespaced UI string IDs to translated strings in the target language; see `src/ui/default_locale.js` for an example with all supported string IDs. The object may specify all UI strings (thereby adding support for a new translation) or only a subset of strings (thereby patching the default translation table).\n     * For an example, see https://maplibre.org/maplibre-gl-js/docs/examples/locale-switching/\n     * Alternatively, search the official plugins page for plugins related to localization.\n     * @defaultValue null\n     */\n    locale?: Record<string, string>;\n    /**\n     * Controls the duration of the fade-in/fade-out animation for label collisions after initial map load, in milliseconds. This setting affects all symbol layers. This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.\n     * @defaultValue 300\n     */\n    fadeDuration?: number;\n    /**\n     * If `true`, symbols from multiple sources can collide with each other during collision detection. If `false`, collision detection is run separately for the symbols in each source.\n     * @defaultValue true\n     */\n    crossSourceCollisions?: boolean;\n    /**\n     * If `true`, Resource Timing API information will be collected for requests made by GeoJSON and Vector Tile web workers (this information is normally inaccessible from the main Javascript thread). Information will be returned in a `resourceTiming` property of relevant `data` events.\n     * @defaultValue false\n     */\n    collectResourceTiming?: boolean;\n    /**\n     * The max number of pixels a user can shift the mouse pointer during a click for it to be considered a valid click (as opposed to a mouse drag).\n     * @defaultValue 3\n     */\n    clickTolerance?: number;\n    /**\n     * The initial bounds of the map. If `bounds` is specified, it overrides `center` and `zoom` constructor options.\n     */\n    bounds?: LngLatBoundsLike;\n    /**\n     * A {@link FitBoundsOptions} options object to use _only_ when fitting the initial `bounds` provided above.\n     */\n    fitBoundsOptions?: FitBoundsOptions;\n    /**\n     * Defines a CSS\n     * font-family for locally overriding generation of Chinese, Japanese, and Korean characters.\n     * For these characters, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).\n     * Set to `false`, to enable font settings from the map's style for these glyph ranges.\n     * The purpose of this option is to avoid bandwidth-intensive glyph server requests.\n     * @see [Use locally generated ideographs](https://maplibre.org/maplibre-gl-js/docs/examples/use-locally-generated-ideographs/)\n     * @defaultValue 'sans-serif'\n     */\n    localIdeographFontFamily?: string | false;\n    /**\n     * The map's MapLibre style. This must be a JSON object conforming to\n     * the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/),\n     * or a URL to such JSON.\n     * When the style is not specified, calling {@link Map.setStyle} is required to render the map.\n     */\n    style?: StyleSpecification | string;\n    /**\n     * If `false`, the map's pitch (tilt) control with \"drag to rotate\" interaction will be disabled.\n     * @defaultValue true\n     */\n    pitchWithRotate?: boolean;\n    /**\n     * If `false`, the map's roll control with \"drag to rotate\" interaction will be disabled.\n     * @defaultValue false\n     */\n    rollEnabled?: boolean;\n    /**\n     * If `true`, gesture inertia (such as panning) is disabled. If not provided, gesture inertia defaults to the user's device settings.\n     * @defaultValue undefined\n     */\n    reduceMotion?: boolean | undefined;\n    /**\n     * The pixel ratio.\n     * The canvas' `width` attribute will be `container.clientWidth * pixelRatio` and its `height` attribute will be `container.clientHeight * pixelRatio`. Defaults to `devicePixelRatio` if not specified.\n     */\n    pixelRatio?: number;\n    /**\n     * If false, style validation will be skipped. Useful in production environment.\n     * @defaultValue true\n     */\n    validateStyle?: boolean;\n    /**\n     * The canvas' `width` and `height` max size. The values are passed as an array where the first element is max width and the second element is max height.\n     * You shouldn't set this above WebGl `MAX_TEXTURE_SIZE`.\n     * @defaultValue [4096, 4096].\n     */\n    maxCanvasSize?: [number, number];\n    /**\n     * Determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.\n     * * If `true`, when zooming in, tiles which didn't manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom.\n     * * If `false`, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.\n     * @defaultValue true\n     */\n    cancelPendingTileRequestsWhileZooming?: boolean;\n    /**\n     * If true, the elevation of the center point will automatically be set to the terrain elevation\n     * (or zero if terrain is not enabled). If false, the elevation of the center point will default\n     * to sea level and will not automatically update. Defaults to true. Needs to be set to false to\n     * keep the camera above ground when pitch \\> 90 degrees.\n     */\n    centerClampedToGround?: boolean;\n    /**\n     * Allows overzooming by splitting vector tiles after max zoom.\n     * Defines the number of zoom level that will overscale from map's max zoom and below.\n     * For example if the map's max zoom is 20 and this is set to 3, the zoom levels of 20, 19 and 18 will be overscaled\n     * and the rest will be split.\n     * When undefined, all zoom levels after source's max zoom will be overscaled.\n     * This can help in reducing the size of the overscaling and improve performance in high zoom levels.\n     * The drawback is that it changes rendering for polygon centered labels and changes the results of query rendered features.\n     * @defaultValue undefined\n     * @experimental\n     */\n    experimentalZoomLevelsToOverscale?: number;\n    /**\n     * Determines the rotation interaction model:\n     * - When true: Uses \"Orbital\" logic where rotation is relative to the pivot center. \n     *   Dragging right at the top rotates clockwise, while dragging right at the bottom\n     *   rotates counter-clockwise (like spinning a physical globe).\n     * - When false: Uses \"Linear\" logic where horizontal mouse movement translates directly\n     *   to bearing change regardless of cursor position.\n     */\n    aroundCenter?: boolean;\n};\n\nexport type AddImageOptions = {\n\n};\n\n// This type is used inside map since all properties are assigned a default value.\nexport type CompleteMapOptions = Complete<MapOptions>;\n\ntype DelegatedListener = {\n    layers: string[];\n    listener: Listener;\n    delegates: {[E in keyof MapEventType]?: Delegate<MapEventType[E]>};\n};\n\ntype Delegate<E extends Event = Event> = (e: E) => void;\n\ntype LostContextStyle = {\n    style: StyleSpecification | null;\n    images: {[_: string]: StyleImage} | null;\n};\n\nconst defaultMinZoom = -2;\nconst defaultMaxZoom = 22;\n\n// the default values, but also the valid range\nconst defaultMinPitch = 0;\nconst defaultMaxPitch = 60;\n\n// use this variable to check maxPitch for validity\nconst maxPitchThreshold = 180;\n\nconst defaultOptions: Readonly<Partial<MapOptions>> = {\n    hash: false,\n    interactive: true,\n    bearingSnap: 7,\n    zoomSnap: 0,\n    attributionControl: defaultAttributionControlOptions,\n    maplibreLogo: false,\n    refreshExpiredTiles: true,\n\n    canvasContextAttributes: {\n        antialias: false,\n        preserveDrawingBuffer: false,\n        powerPreference: 'high-performance',\n        failIfMajorPerformanceCaveat: false,\n        desynchronized: false,\n        contextType: undefined\n    },\n\n    scrollZoom: true,\n    minZoom: defaultMinZoom,\n    maxZoom: defaultMaxZoom,\n    minPitch: defaultMinPitch,\n    maxPitch: defaultMaxPitch,\n\n    boxZoom: true,\n    dragRotate: true,\n    dragPan: true,\n    keyboard: true,\n    doubleClickZoom: true,\n    touchZoomRotate: true,\n    touchPitch: true,\n    cooperativeGestures: false,\n\n    trackResize: true,\n\n    center: [0, 0],\n    elevation: 0,\n    zoom: 0,\n    bearing: 0,\n    pitch: 0,\n    roll: 0,\n\n    renderWorldCopies: true,\n    maxTileCacheSize: null,\n    maxTileCacheZoomLevels: config.MAX_TILE_CACHE_ZOOM_LEVELS,\n    transformRequest: null,\n    transformCameraUpdate: null,\n    transformConstrain: null,\n    fadeDuration: 300,\n    crossSourceCollisions: true,\n    clickTolerance: 3,\n    localIdeographFontFamily: 'sans-serif',\n    pitchWithRotate: true,\n    rollEnabled: false,\n    reduceMotion: undefined,\n    validateStyle: true,\n    /**Because GL MAX_TEXTURE_SIZE is usually at least 4096px. */\n    maxCanvasSize: [4096, 4096],\n    cancelPendingTileRequestsWhileZooming: true,\n    centerClampedToGround: true,\n    experimentalZoomLevelsToOverscale: undefined\n};\n\n/**\n * The `Map` object represents the map on your page. It exposes methods\n * and properties that enable you to programmatically change the map,\n * and fires events as users interact with it.\n *\n * You create a `Map` by specifying a `container` and other options, see {@link MapOptions} for the full list.\n * Then MapLibre GL JS initializes the map on the page and returns your `Map` object.\n *\n * @group Main\n *\n * @example\n * ```ts\n * let map = new Map({\n *   container: 'map',\n *   center: [-122.420679, 37.772537],\n *   zoom: 13,\n *   style: style_object,\n *   hash: true,\n *   transformRequest: (url, resourceType)=> {\n *     if(resourceType === 'Source' && url.startsWith('http://myHost')) {\n *       return {\n *        url: url.replace('http', 'https'),\n *        headers: { 'my-custom-header': true},\n *        credentials: 'include'  // Include cookies for cross-origin requests\n *      }\n *     }\n *   }\n * });\n * ```\n * @see [Display a map](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-map/)\n */\nexport class Map extends Camera {\n    style: Style;\n    painter: Painter;\n    handlers: HandlerManager;\n\n    _container: HTMLElement;\n    _canvasContainer: HTMLElement;\n    _controlContainer: HTMLElement;\n    _controlPositions: Partial<Record<ControlPosition, HTMLElement>>;\n    _interactive: boolean;\n    _showTileBoundaries: boolean;\n    _showCollisionBoxes: boolean;\n    _showPadding: boolean;\n    _showOverdrawInspector: boolean;\n    _repaint: boolean;\n    _vertices: boolean;\n    _canvas: HTMLCanvasElement;\n    _maxTileCacheSize: number | null;\n    _maxTileCacheZoomLevels: number;\n    _frameRequest: AbortController;\n    _styleDirty: boolean;\n    _sourcesDirty: boolean;\n    _placementDirty: boolean;\n\n    _loaded: boolean;\n    _idleTriggered = false;\n    // accounts for placement finishing as well\n    _fullyLoaded: boolean;\n    _trackResize: boolean;\n    _resizeObserver: ResizeObserver;\n    _canvasContextAttributes: WebGLContextAttributesWithType;\n    _refreshExpiredTiles: boolean;\n    _hash: Hash;\n    _delegatedListeners: Record<string, DelegatedListener[]>;\n    _fadeDuration: number;\n    _crossSourceCollisions: boolean;\n    _crossFadingFactor = 1;\n    _collectResourceTiming: boolean;\n    _renderTaskQueue = new TaskQueue();\n    _controls: Array<IControl> = [];\n    _mapId = uniqueId();\n    _localIdeographFontFamily: string | false;\n    _validateStyle: boolean;\n    _requestManager: RequestManager;\n    _locale: Record<string, string>;\n    _removed: boolean;\n    _clickTolerance: number;\n    _overridePixelRatio: number | null | undefined;\n    _maxCanvasSize: [number, number];\n    _terrainDataCallback: (e: MapStyleDataEvent | MapSourceDataEvent) => void;\n    /** @internal */\n    _zoomLevelsToOverscale: number | undefined;\n\n    /**\n     * @internal\n     * The window that owns the map container element, for cross-window support.\n     * Returns `typeof window` to include global constructors like ResizeObserver.\n     */\n    get _ownerWindow(): typeof window {\n        return this._container?.ownerDocument?.defaultView || window;\n    }\n\n    /**\n     * @internal\n     * image queue throttling handle. To be used later when clean up\n     */\n    _imageQueueHandle: number;\n\n    /**\n     * @internal\n     * Used to store the previous style and images when a context loss occurs, so they can be restored.\n     */\n    _lostContextStyle: LostContextStyle = {\n        style: null,\n        images: null\n    };\n\n    /**\n     * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.\n     * Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section.\n     */\n    scrollZoom: ScrollZoomHandler;\n\n    /**\n     * The map's {@link BoxZoomHandler}, which implements zooming using a drag gesture with the Shift key pressed.\n     * Find more details and examples using `boxZoom` in the {@link BoxZoomHandler} section.\n     */\n    boxZoom: BoxZoomHandler;\n\n    /**\n     * The map's {@link DragRotateHandler}, which implements rotating the map while dragging with the right\n     * mouse button or with the Control key pressed. Find more details and examples using `dragRotate`\n     * in the {@link DragRotateHandler} section.\n     */\n    dragRotate: DragRotateHandler;\n\n    /**\n     * The map's {@link DragPanHandler}, which implements dragging the map with a mouse or touch gesture.\n     * Find more details and examples using `dragPan` in the {@link DragPanHandler} section.\n     */\n    dragPan: DragPanHandler;\n\n    /**\n     * The map's {@link KeyboardHandler}, which allows the user to zoom, rotate, and pan the map using keyboard\n     * shortcuts. Find more details and examples using `keyboard` in the {@link KeyboardHandler} section.\n     */\n    keyboard: KeyboardHandler;\n\n    /**\n     * The map's {@link DoubleClickZoomHandler}, which allows the user to zoom by double clicking.\n     * Find more details and examples using `doubleClickZoom` in the {@link DoubleClickZoomHandler} section.\n     */\n    doubleClickZoom: DoubleClickZoomHandler;\n\n    /**\n     * The map's {@link TwoFingersTouchZoomRotateHandler}, which allows the user to zoom or rotate the map with touch gestures.\n     * Find more details and examples using `touchZoomRotate` in the {@link TwoFingersTouchZoomRotateHandler} section.\n     */\n    touchZoomRotate: TwoFingersTouchZoomRotateHandler;\n\n    /**\n     * The map's {@link TwoFingersTouchPitchHandler}, which allows the user to pitch the map with touch gestures.\n     * Find more details and examples using `touchPitch` in the {@link TwoFingersTouchPitchHandler} section.\n     */\n    touchPitch: TwoFingersTouchPitchHandler;\n\n    /**\n     * The map's {@link CooperativeGesturesHandler}, which allows the user to see cooperative gesture info when user tries to zoom in/out.\n     * Find more details and examples using `cooperativeGestures` in the {@link CooperativeGesturesHandler} section.\n     */\n    cooperativeGestures: CooperativeGesturesHandler;\n\n    /**\n     * The map's property which determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.\n     * * If `true`, when zooming in, tiles which didn't manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom.\n     * * If `false`, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.\n     * @defaultValue true\n     */\n    cancelPendingTileRequestsWhileZooming: boolean;\n\n    /**\n     * The map transform's callback that overrides the default constrain function.\n     * @defaultValue null\n     */\n    transformConstrain: TransformConstrainFunction | null;\n\n    constructor(options: MapOptions) {\n        PerformanceUtils.mark(PerformanceMarkers.create);\n\n        const resolvedOptions = {...defaultOptions, ...options, canvasContextAttributes: {\n            ...defaultOptions.canvasContextAttributes,\n            ...options.canvasContextAttributes\n        }} as CompleteMapOptions;\n\n        if (resolvedOptions.minZoom != null && resolvedOptions.maxZoom != null && resolvedOptions.minZoom > resolvedOptions.maxZoom) {\n            throw new Error('maxZoom must be greater than or equal to minZoom');\n        }\n\n        if (resolvedOptions.minPitch != null && resolvedOptions.maxPitch != null && resolvedOptions.minPitch > resolvedOptions.maxPitch) {\n            throw new Error('maxPitch must be greater than or equal to minPitch');\n        }\n\n        if (resolvedOptions.minPitch != null && resolvedOptions.minPitch < defaultMinPitch) {\n            throw new Error(`minPitch must be greater than or equal to ${defaultMinPitch}`);\n        }\n\n        if (resolvedOptions.maxPitch != null && resolvedOptions.maxPitch > maxPitchThreshold) {\n            throw new Error(`maxPitch must be less than or equal to ${maxPitchThreshold}`);\n        }\n\n        // For now we will use a temporary MercatorTransform instance.\n        // Transform specialization will later be set by style when it creates its projection instance.\n        // When this happens, the new transform will inherit all properties of this temporary transform.\n        const transform = new MercatorTransform();\n        const cameraHelper = new MercatorCameraHelper();\n        if (resolvedOptions.minZoom !== undefined) {\n            transform.setMinZoom(resolvedOptions.minZoom);\n        }\n        if (resolvedOptions.maxZoom !== undefined) {\n            transform.setMaxZoom(resolvedOptions.maxZoom);\n        }\n        if (resolvedOptions.minPitch !== undefined) {\n            transform.setMinPitch(resolvedOptions.minPitch);\n        }\n        if (resolvedOptions.maxPitch !== undefined) {\n            transform.setMaxPitch(resolvedOptions.maxPitch);\n        }\n        if (resolvedOptions.renderWorldCopies !== undefined) {\n            transform.setRenderWorldCopies(resolvedOptions.renderWorldCopies);\n        }\n        if (resolvedOptions.transformConstrain !== null) {\n            transform.setConstrainOverride(resolvedOptions.transformConstrain);\n        }\n\n        super(transform, cameraHelper, {\n            bearingSnap: resolvedOptions.bearingSnap,\n            zoomSnap: resolvedOptions.zoomSnap\n        });\n\n        this._interactive = resolvedOptions.interactive;\n        this._maxTileCacheSize = resolvedOptions.maxTileCacheSize;\n        this._maxTileCacheZoomLevels = resolvedOptions.maxTileCacheZoomLevels;\n        this._canvasContextAttributes = {...resolvedOptions.canvasContextAttributes};\n        this._trackResize = resolvedOptions.trackResize === true;\n        this._bearingSnap = resolvedOptions.bearingSnap;\n        this._zoomSnap = resolvedOptions.zoomSnap;\n        this._centerClampedToGround = resolvedOptions.centerClampedToGround;\n        this._refreshExpiredTiles = resolvedOptions.refreshExpiredTiles === true;\n        this._fadeDuration = resolvedOptions.fadeDuration;\n        this._crossSourceCollisions = resolvedOptions.crossSourceCollisions === true;\n        this._collectResourceTiming = resolvedOptions.collectResourceTiming === true;\n        this._locale = {...defaultLocale, ...resolvedOptions.locale};\n        this._clickTolerance = resolvedOptions.clickTolerance;\n        this._overridePixelRatio = resolvedOptions.pixelRatio;\n        this._maxCanvasSize = resolvedOptions.maxCanvasSize;\n        this._zoomLevelsToOverscale = resolvedOptions.experimentalZoomLevelsToOverscale;\n        this.transformCameraUpdate = resolvedOptions.transformCameraUpdate;\n        this.transformConstrain = resolvedOptions.transformConstrain;\n        this.cancelPendingTileRequestsWhileZooming = resolvedOptions.cancelPendingTileRequestsWhileZooming === true;\n\n        if (resolvedOptions.reduceMotion !== undefined) {\n            browser.prefersReducedMotion = resolvedOptions.reduceMotion;\n        }\n\n        this._imageQueueHandle = ImageRequest.addThrottleControl(() => this.isMoving());\n\n        this._requestManager = new RequestManager(resolvedOptions.transformRequest);\n\n        this._container = this._resolveContainer(resolvedOptions.container);\n\n        if (resolvedOptions.maxBounds) {\n            this.setMaxBounds(resolvedOptions.maxBounds);\n        }\n\n        this._setupContainer();\n        this._setupPainter();\n\n        this.on('move', () => this._update(false));\n        this.on('moveend', () => this._update(false));\n        this.on('zoom', () => this._update(true));\n        this.on('terrain', () => {\n            this.painter.terrainFacilitator.dirty = true;\n            this._update(true);\n        });\n        this.once('idle', () => { this._idleTriggered = true; });\n\n        if (typeof window !== 'undefined') {\n            this._ownerWindow.addEventListener('online', this._onWindowOnline, false);\n            this._setupResizeObserver();\n        }\n\n        this.handlers = new HandlerManager(this, resolvedOptions);\n\n        const hashName = (typeof resolvedOptions.hash === 'string' && resolvedOptions.hash) || undefined;\n        this._hash = resolvedOptions.hash && (new Hash(hashName)).addTo(this);\n        // don't set position from options if set through hash\n        if (!this._hash || !this._hash._onHashChange()) {\n            this.jumpTo({\n                center: resolvedOptions.center,\n                elevation: resolvedOptions.elevation,\n                zoom: resolvedOptions.zoom,\n                bearing: resolvedOptions.bearing,\n                pitch: resolvedOptions.pitch,\n                roll: resolvedOptions.roll\n            });\n\n            if (resolvedOptions.bounds) {\n                this.resize();\n                this.fitBounds(resolvedOptions.bounds, extend({}, resolvedOptions.fitBoundsOptions, {duration: 0}));\n            }\n        }\n\n        // When no style is set or it's using something other than the globe projection, we can constrain the camera.\n        // When a style is set with other projections though, we can't constrain the camera until the style is loaded\n        // and the correct transform is used. Otherwise, valid points in the desired projection could be rejected\n        const shouldConstrainUsingMercatorTransform = typeof resolvedOptions.style === 'string' || !(resolvedOptions.style?.projection?.type === 'globe');\n        this.resize(null, shouldConstrainUsingMercatorTransform);\n\n        this._localIdeographFontFamily = resolvedOptions.localIdeographFontFamily;\n        this._validateStyle = resolvedOptions.validateStyle;\n\n        if (resolvedOptions.style) this.setStyle(resolvedOptions.style, {localIdeographFontFamily: resolvedOptions.localIdeographFontFamily});\n\n        if (resolvedOptions.attributionControl)\n            this.addControl(new AttributionControl(typeof resolvedOptions.attributionControl === 'boolean' ? undefined : resolvedOptions.attributionControl));\n\n        if (resolvedOptions.maplibreLogo)\n            this.addControl(new LogoControl(), resolvedOptions.logoPosition);\n\n        this.on('style.load', () => {\n            // If we didn't constrain the camera before, we do it now\n            if (!shouldConstrainUsingMercatorTransform) this._resizeTransform();\n            if (this.transform.unmodified) {\n                const coercedOptions = pick(this.style.stylesheet, ['center', 'zoom', 'bearing', 'pitch', 'roll']) as CameraOptions;\n                this.jumpTo(coercedOptions);\n            }\n        });\n        this.on('data', (event: MapDataEvent) => {\n            this._update(event.dataType === 'style');\n            this.fire(new Event(`${event.dataType}data`, event));\n        });\n        this.on('dataloading', (event: MapDataEvent) => {\n            this.fire(new Event(`${event.dataType}dataloading`, event));\n        });\n        this.on('dataabort', (event: MapDataEvent) => {\n            this.fire(new Event('sourcedataabort', event));\n        });\n    }\n\n    /**\n     * @internal\n     * Returns a unique number for this map instance which is used for the MapLoadEvent\n     * to make sure we only fire one event per instantiated map object.\n     * @returns the uniq map ID\n     */\n    _getMapId() {\n        return this._mapId;\n    }\n\n    /**\n     * Sets a global state property that can be retrieved with the [`global-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#global-state).\n     * If the value is null, it resets the property to its default value defined in the [`state` style property](https://maplibre.org/maplibre-style-spec/root/#state).\n     *\n     * @param propertyName - The name of the state property to set.\n     * @param value - The value of the state property to set.\n     */\n    setGlobalStateProperty(propertyName: string, value: any) {\n        this.style.setGlobalStateProperty(propertyName, value);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the global map state\n     *\n     * @returns The map state object.\n    */\n    getGlobalState(): Record<string, any> {\n        return this.style.getGlobalState();\n    }\n\n    /**\n     * Adds an {@link IControl} to the map, calling `control.onAdd(this)`.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invalid.\n     *\n     * @param control - The {@link IControl} to add.\n     * @param position - position on the map to which the control will be added.\n     * Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.\n     * @example\n     * Add zoom and rotation controls to the map.\n     * ```ts\n     * map.addControl(new NavigationControl());\n     * ```\n     * @see [Display map navigation controls](https://maplibre.org/maplibre-gl-js/docs/examples/display-map-navigation-controls/)\n     */\n    addControl(control: IControl, position?: ControlPosition): Map {\n        if (position === undefined) {\n            if (control.getDefaultPosition) {\n                position = control.getDefaultPosition();\n            } else {\n                position = 'top-right';\n            }\n        }\n        if (!control || !control.onAdd) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.')));\n        }\n        const controlElement = control.onAdd(this);\n        this._controls.push(control);\n\n        const positionContainer = this._controlPositions[position];\n        if (position.indexOf('bottom') !== -1) {\n            positionContainer.insertBefore(controlElement, positionContainer.firstChild);\n        } else {\n            positionContainer.appendChild(controlElement);\n        }\n        return this;\n    }\n\n    /**\n     * Removes the control from the map.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invalid.\n     *\n     * @param control - The {@link IControl} to remove.\n     * @example\n     * ```ts\n     * // Define a new navigation control.\n     * let navigation = new NavigationControl();\n     * // Add zoom and rotation controls to the map.\n     * map.addControl(navigation);\n     * // Remove zoom and rotation controls from the map.\n     * map.removeControl(navigation);\n     * ```\n     */\n    removeControl(control: IControl): Map {\n        if (!control || !control.onRemove) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.')));\n        }\n        const ci = this._controls.indexOf(control);\n        if (ci > -1) this._controls.splice(ci, 1);\n        control.onRemove(this);\n        return this;\n    }\n\n    /**\n     * Checks if a control exists on the map.\n     *\n     * @param control - The {@link IControl} to check.\n     * @returns true if map contains control.\n     * @example\n     * ```ts\n     * // Define a new navigation control.\n     * let navigation = new NavigationControl();\n     * // Add zoom and rotation controls to the map.\n     * map.addControl(navigation);\n     * // Check that the navigation control exists on the map.\n     * map.hasControl(navigation);\n     * ```\n     */\n    hasControl(control: IControl): boolean {\n        return this._controls.indexOf(control) > -1;\n    }\n\n    /**\n    * Returns an array of `OverscaledTileID` objects that cover the current viewport for a given tile size.\n    * This method is useful for determining which tiles are visible in the current viewport.\n    *\n    * @param options - Options for calculating the covering tiles.\n    * @returns An array of `OverscaledTileID` objects.\n    * @example\n    * ```ts\n    * // Get the tiles to cover the view for a 512x512px tile source\n    * const tiles = map.coveringTiles({tileSize: 512});\n    * ```\n    */\n    coveringTiles(options: CoveringTilesOptions): OverscaledTileID[] {\n        return coveringTiles(this.transform, options);\n    }\n\n    calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo?: number): CameraOptions {\n        if (altitudeTo == null && this.terrain) {\n            altitudeTo = this.terrain.getElevationForLngLat(to, this.transform);\n        }\n        return super.calculateCameraOptionsFromTo(from, altitudeFrom, to, altitudeTo);\n    }\n\n    /**\n     * Resizes the map according to the dimensions of its\n     * `container` element.\n     *\n     * Checks if the map container size changed and updates the map if it has changed.\n     * This method must be called after the map's `container` is resized programmatically\n     * or when the map is shown after being initially hidden with CSS.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.\n     *\n     * @param eventData - Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`\n     * events that get triggered as a result of resize. This can be useful for differentiating the\n     * source of an event (for example, user-initiated or programmatically-triggered events).\n     * @example\n     * Resize the map when the map container is shown after being initially hidden with CSS.\n     * ```ts\n     * let mapDiv = document.getElementById('map');\n     * if (mapDiv.style.visibility === true) map.resize();\n     * ```\n     */\n    resize(eventData?: any, constrainTransform = true): Map {\n        // Early out if the context is lost\n        // causes a blank map otherwise\n        const isContextLost = this._lostContextStyle.style !== null;\n        if (isContextLost) return this;\n        this._resizeInternal(constrainTransform);\n\n        const fireMoving = !this._moving;\n        if (fireMoving) {\n            this.stop();\n            this.fire(new Event('movestart', eventData))\n                .fire(new Event('move', eventData));\n        }\n\n        this.fire(new Event('resize', eventData));\n\n        if (fireMoving) this.fire(new Event('moveend', eventData));\n\n        return this;\n    }\n\n    /**\n     * Resizes the map according to the dimensions of its\n     * `container` element.\n     *\n     * It does not trigger any events, and does not check for context loss.\n     *\n     * It is used internally and by {@link Map.resize}.\n     *\n     * @internal\n     *\n     * @param constrainTransform - whether to constrain the transform after resizing.\n     */\n    _resizeInternal(constrainTransform = true) {\n        const [width, height] = this._containerDimensions();\n\n        const clampedPixelRatio = this._getClampedPixelRatio(width, height);\n        this._resizeCanvas(width, height, clampedPixelRatio);\n        this.painter.resize(width, height, clampedPixelRatio);\n\n        // check if we've reached GL limits, in that case further clamps pixelRatio\n        if (this.painter.overLimit()) {\n            const gl = this.painter.context.gl;\n            // store updated _maxCanvasSize value\n            this._maxCanvasSize = [gl.drawingBufferWidth, gl.drawingBufferHeight];\n            const clampedPixelRatio = this._getClampedPixelRatio(width, height);\n            this._resizeCanvas(width, height, clampedPixelRatio);\n            this.painter.resize(width, height, clampedPixelRatio);\n        }\n\n        this._resizeTransform(constrainTransform);\n    }\n\n    _resizeTransform(constrainTransform = true) {\n        const [width, height] = this._containerDimensions();\n\n        this.transform.resize(width, height, constrainTransform);\n        this._requestedCameraState?.resize(width, height, constrainTransform);\n    }\n\n    /**\n     * @internal\n     * Return the map's pixel ratio eventually scaled down to respect maxCanvasSize.\n     * Internally you should use this and not getPixelRatio().\n     */\n    _getClampedPixelRatio(width: number, height: number): number {\n        const {0: maxCanvasWidth, 1: maxCanvasHeight} = this._maxCanvasSize;\n        const pixelRatio = this.getPixelRatio();\n\n        const canvasWidth = width * pixelRatio;\n        const canvasHeight = height * pixelRatio;\n\n        const widthScaleFactor = canvasWidth > maxCanvasWidth ? (maxCanvasWidth / canvasWidth) : 1;\n        const heightScaleFactor = canvasHeight > maxCanvasHeight ? (maxCanvasHeight / canvasHeight) : 1;\n\n        return Math.min(widthScaleFactor, heightScaleFactor) * pixelRatio;\n    }\n\n    /**\n     * Returns the map's pixel ratio.\n     * Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.\n     * @returns The pixel ratio.\n     */\n    getPixelRatio(): number {\n        return this._overridePixelRatio ?? devicePixelRatio;\n    }\n\n    /**\n     * Sets the map's pixel ratio. This allows to override `devicePixelRatio`.\n     * After this call, the canvas' `width` attribute will be `container.clientWidth * pixelRatio`\n     * and its height attribute will be `container.clientHeight * pixelRatio`.\n     * Set this to null to disable `devicePixelRatio` override.\n     * Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.\n     * @param pixelRatio - The pixel ratio.\n     */\n    setPixelRatio(pixelRatio: number) {\n        this._overridePixelRatio = pixelRatio;\n        this.resize();\n    }\n\n    /**\n     * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not\n     * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.\n     * @returns The geographical bounds of the map as {@link LngLatBounds}.\n     * @example\n     * ```ts\n     * let bounds = map.getBounds();\n     * ```\n     */\n    getBounds(): LngLatBounds {\n        return this.transform.getBounds();\n    }\n\n    /**\n     * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.\n     * @returns The map object.\n     * @example\n     * ```ts\n     * let maxBounds = map.getMaxBounds();\n     * ```\n     */\n    getMaxBounds(): LngLatBounds | null {\n        return this.transform.getMaxBounds();\n    }\n\n    /**\n     * Sets or clears the map's geographical bounds.\n     *\n     * Pan and zoom operations are constrained within these bounds.\n     * If a pan or zoom is performed that would\n     * display regions outside these bounds, the map will\n     * instead display a position and zoom level\n     * as close as possible to the operation's request while still\n     * remaining within the bounds.\n     *\n     * @param bounds - The maximum bounds to set. If `null` or `undefined` is provided, the function removes the map's maximum bounds.\n     * @example\n     * Define bounds that conform to the `LngLatBoundsLike` object as set the max bounds.\n     * ```ts\n     * let bounds = [\n     *   [-74.04728, 40.68392], // [west, south]\n     *   [-73.91058, 40.87764]  // [east, north]\n     * ];\n     * map.setMaxBounds(bounds);\n     * ```\n     */\n    setMaxBounds(bounds?: LngLatBoundsLike | null): Map {\n        this.transform.setMaxBounds(LngLatBounds.convert(bounds));\n        return this._update();\n    }\n\n    /**\n     * Sets or clears the map's minimum zoom level.\n     * If the map's current zoom level is lower than the new minimum,\n     * the map will zoom to the new minimum and trigger the following events:\n     * `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * It is not always possible to zoom out and reach the set `minZoom`.\n     * Other factors such as map height may restrict zooming. For example,\n     * if the map is 512px tall it will not be possible to zoom below zoom 0\n     * no matter what the `minZoom` is set to.\n     *\n     * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.\n     *\n     * @param minZoom - The minimum zoom level to set (-2 - 24).\n     * If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).\n     * @example\n     * ```ts\n     * map.setMinZoom(12.25);\n     * ```\n     */\n    setMinZoom(minZoom?: number | null): Map {\n\n        minZoom = minZoom === null || minZoom === undefined ? defaultMinZoom : minZoom;\n\n        if (minZoom >= defaultMinZoom && minZoom <= this.transform.maxZoom) {\n            const zoomBefore = this.transform.zoom;\n            const tr = this._getTransformForUpdate();\n            tr.setMinZoom(minZoom);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (zoomBefore !== this.transform.zoom) {\n                this.fire(new Event('zoomstart'))\n                    .fire(new Event('zoom'))\n                    .fire(new Event('zoomend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\n\n            return this;\n\n        } else throw new Error(`minZoom must be between ${defaultMinZoom} and the current maxZoom, inclusive`);\n    }\n\n    /**\n     * Returns the map's minimum allowable zoom level.\n     *\n     * @returns minZoom\n     * @example\n     * ```ts\n     * let minZoom = map.getMinZoom();\n     * ```\n     */\n    getMinZoom(): number { return this.transform.minZoom; }\n\n    /**\n     * Sets or clears the map's maximum zoom level.\n     * If the map's current zoom level is higher than the new maximum,\n     * the map will zoom to the new maximum and trigger the following events:\n     * `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.\n     *\n     * @param maxZoom - The maximum zoom level to set.\n     * If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).\n     * @example\n     * ```ts\n     * map.setMaxZoom(18.75);\n     * ```\n     */\n    setMaxZoom(maxZoom?: number | null): Map {\n\n        maxZoom = maxZoom === null || maxZoom === undefined ? defaultMaxZoom : maxZoom;\n\n        if (maxZoom >= this.transform.minZoom) {\n            const zoomBefore = this.transform.zoom;\n            const tr = this._getTransformForUpdate();\n            tr.setMaxZoom(maxZoom);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (zoomBefore !== this.transform.zoom) {\n                this.fire(new Event('zoomstart'))\n                    .fire(new Event('zoom'))\n                    .fire(new Event('zoomend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\n\n            return this;\n\n        } else throw new Error('maxZoom must be greater than the current minZoom');\n    }\n\n    /**\n     * Returns the map's maximum allowable zoom level.\n     *\n     * @returns The maxZoom\n     * @example\n     * ```ts\n     * let maxZoom = map.getMaxZoom();\n     * ```\n     */\n    getMaxZoom(): number { return this.transform.maxZoom; }\n\n    /**\n     * Sets or clears the map's minimum pitch.\n     * If the map's current pitch is lower than the new minimum,\n     * the map will pitch to the new minimum and trigger the following events:\n     * `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.\n     *\n     * A {@link ErrorEvent} event will be fired if minPitch is out of bounds.\n     *\n     * @param minPitch - The minimum pitch to set (0-180). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).\n     */\n    setMinPitch(minPitch?: number | null): Map {\n\n        minPitch = minPitch === null || minPitch === undefined ? defaultMinPitch : minPitch;\n\n        if (minPitch < defaultMinPitch) {\n            throw new Error(`minPitch must be greater than or equal to ${defaultMinPitch}`);\n        }\n\n        if (minPitch >= defaultMinPitch && minPitch <= this.transform.maxPitch) {\n            const pitchBefore = this.transform.pitch;\n            const tr = this._getTransformForUpdate();\n            tr.setMinPitch(minPitch);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (pitchBefore !== this.transform.pitch) {\n                this.fire(new Event('pitchstart'))\n                    .fire(new Event('pitch'))\n                    .fire(new Event('pitchend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\n\n            return this;\n\n        } else throw new Error(`minPitch must be between ${defaultMinPitch} and the current maxPitch, inclusive`);\n    }\n\n    /**\n     * Returns the map's minimum allowable pitch.\n     *\n     * @returns The minPitch\n     */\n    getMinPitch(): number { return this.transform.minPitch; }\n\n    /**\n     * Sets or clears the map's maximum pitch.\n     * If the map's current pitch is higher than the new maximum,\n     * the map will pitch to the new maximum and trigger the following events:\n     * `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, and `pitchend`.\n     *\n     * A {@link ErrorEvent} event will be fired if maxPitch is out of bounds.\n     *\n     * @param maxPitch - The maximum pitch to set (0-180). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).\n     */\n    setMaxPitch(maxPitch?: number | null): Map {\n\n        maxPitch = maxPitch === null || maxPitch === undefined ? defaultMaxPitch : maxPitch;\n\n        if (maxPitch > maxPitchThreshold) {\n            throw new Error(`maxPitch must be less than or equal to ${maxPitchThreshold}`);\n        }\n\n        if (maxPitch >= this.transform.minPitch) {\n            const pitchBefore = this.transform.pitch;\n            const tr = this._getTransformForUpdate();\n            tr.setMaxPitch(maxPitch);\n            this._applyUpdatedTransform(tr);\n            this._update();\n            if (pitchBefore !== this.transform.pitch) {\n                this.fire(new Event('pitchstart'))\n                    .fire(new Event('pitch'))\n                    .fire(new Event('pitchend'))\n                    .fire(new Event('movestart'))\n                    .fire(new Event('move'))\n                    .fire(new Event('moveend'));\n            }\n\n            return this;\n\n        } else throw new Error('maxPitch must be greater than the current minPitch');\n    }\n\n    /**\n     * Returns the map's maximum allowable pitch.\n     *\n     * @returns The maxPitch\n     */\n    getMaxPitch(): number { return this.transform.maxPitch; }\n\n    /**\n     * Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     * @returns The renderWorldCopies\n     * @example\n     * ```ts\n     * let worldCopiesRendered = map.getRenderWorldCopies();\n     * ```\n     * @see [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)\n     */\n    getRenderWorldCopies(): boolean { return this.transform.renderWorldCopies; }\n\n    /**\n     * Sets the state of `renderWorldCopies`.\n     *\n     * @param renderWorldCopies - If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     *\n     * `undefined` is treated as `true`, `null` is treated as `false`.\n     * @example\n     * ```ts\n     * map.setRenderWorldCopies(true);\n     * ```\n     * @see [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)\n     */\n    setRenderWorldCopies(renderWorldCopies?: boolean | null): Map {\n        this.transform.setRenderWorldCopies(renderWorldCopies);\n        return this._update();\n    }\n\n    /** Sets or clears the callback overriding how the map constrains the viewport's lnglat and zoom to respect the longitude and latitude bounds.\n     *\n     * @param constrain - A {@link TransformConstrainFunction} callback defining how the viewport should respect the bounds.\n     *\n     * `null` clears the callback and reverts the constrain to the map transform's default constrain function.\n     * @example\n     * ```ts\n     * function customTransformConstrain(lngLat, zoom) {\n     *   return {center: lngLat, zoom: zoom ?? 0};\n     * };\n     * map.setTransformConstrain(customTransformConstrain);\n     * ```\n     * @see [Customize the map transform constrain](https://maplibre.org/maplibre-gl-js/docs/examples/customize-the-map-transform-constrain/)\n     */\n    setTransformConstrain(constrain?: TransformConstrainFunction | null): Map {\n        this.transform.setConstrainOverride(constrain);\n        return this._update();\n    }\n\n    /**\n     * Returns a [Point](https://github.com/mapbox/point-geometry) representing pixel coordinates, relative to the map's `container`,\n     * that correspond to the specified geographical location.\n     *\n     * @param lnglat - The geographical location to project.\n     * @returns The [Point](https://github.com/mapbox/point-geometry) corresponding to `lnglat`, relative to the map's `container`.\n     * @example\n     * ```ts\n     * let coordinate = [-122.420679, 37.772537];\n     * let point = map.project(coordinate);\n     * ```\n     */\n    project(lnglat: LngLatLike): Point {\n        return this.transform.locationToScreenPoint(LngLat.convert(lnglat), this.style && this.terrain);\n    }\n\n    /**\n     * Returns a {@link LngLat} representing geographical coordinates that correspond\n     * to the specified pixel coordinates.\n     *\n     * @param point - The pixel coordinates to unproject.\n     * @returns The {@link LngLat} corresponding to `point`.\n     * @example\n     * ```ts\n     * map.on('click', (e) => {\n     *   // When the map is clicked, get the geographic coordinate.\n     *   let coordinate = map.unproject(e.point);\n     * });\n     * ```\n     */\n    unproject(point: PointLike): LngLat {\n        return this.transform.screenPointToLocation(Point.convert(point), this.terrain);\n    }\n\n    /**\n     * Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.\n     * @returns true if the map is moving.\n     * @example\n     * ```ts\n     * let isMoving = map.isMoving();\n     * ```\n     */\n    isMoving(): boolean {\n        return this._moving || this.handlers?.isMoving();\n    }\n\n    /**\n     * Returns true if the map is zooming due to a camera animation or user gesture.\n     * @returns true if the map is zooming.\n     * @example\n     * ```ts\n     * let isZooming = map.isZooming();\n     * ```\n     */\n    isZooming(): boolean {\n        return this._zooming || this.handlers?.isZooming();\n    }\n\n    /**\n     * Returns true if the map is rotating due to a camera animation or user gesture.\n     * @returns true if the map is rotating.\n     * @example\n     * ```ts\n     * map.isRotating();\n     * ```\n     */\n    isRotating(): boolean {\n        return this._rotating || this.handlers?.isRotating();\n    }\n\n    _createDelegatedListener(type: keyof MapEventType | string, layerIds: string[], listener: Listener): DelegatedListener {\n        if (type === 'mouseenter' || type === 'mouseover') {\n            let mousein = false;\n            const mousemove = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (!features.length) {\n                    mousein = false;\n                } else if (!mousein) {\n                    mousein = true;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent, {features}));\n                }\n            };\n            const mouseout = () => {\n                mousein = false;\n            };\n            return {layers: layerIds, listener, delegates: {mousemove, mouseout}};\n        } else if (type === 'mouseleave' || type === 'mouseout') {\n            let mousein = false;\n            const mousemove = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (features.length) {\n                    mousein = true;\n                } else if (mousein) {\n                    mousein = false;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent));\n                }\n            };\n            const mouseout = (e) => {\n                if (mousein) {\n                    mousein = false;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent));\n                }\n            };\n            return {layers: layerIds, listener, delegates: {mousemove, mouseout}};\n        } else {\n            const delegate = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (features.length) {\n                    // Here we need to mutate the original event, so that preventDefault works as expected.\n                    e.features = features;\n                    listener.call(this, e);\n                    delete e.features;\n                }\n            };\n            return {layers: layerIds, listener, delegates: {[type]: delegate}};\n        }\n    }\n\n    _saveDelegatedListener(type: keyof MapEventType | string, delegatedListener: DelegatedListener): void {\n        this._delegatedListeners = this._delegatedListeners || {};\n        this._delegatedListeners[type] = this._delegatedListeners[type] || [];\n        this._delegatedListeners[type].push(delegatedListener);\n    }\n\n    _removeDelegatedListener(type: string, layerIds: string[], listener: Listener) {\n        if (!this._delegatedListeners || !this._delegatedListeners[type]) {\n            return;\n        }\n\n        const listeners = this._delegatedListeners[type];\n        for (let i = 0; i < listeners.length; i++) {\n            const delegatedListener = listeners[i];\n            if (\n                delegatedListener.listener === listener &&\n                delegatedListener.layers.length === layerIds.length &&\n                delegatedListener.layers.every((layerId: string) => layerIds.includes(layerId))\n            ) {\n                for (const event in delegatedListener.delegates) {\n                    this.off(event, delegatedListener.delegates[event]);\n                }\n                listeners.splice(i, 1);\n                return;\n            }\n        }\n    }\n\n    /**\n     * @event\n     * Adds a listener for events of a specified type, optionally limited to features in a specified style layer(s).\n     * See {@link MapEventType} and {@link MapLayerEventType} for a full list of events and their description.\n     *\n     * | Event                  | Compatible with `layerId` |\n     * |------------------------|---------------------------|\n     * | `mousedown`            | yes                       |\n     * | `mouseup`              | yes                       |\n     * | `mouseover`            | yes                       |\n     * | `mouseout`             | yes                       |\n     * | `mousemove`            | yes                       |\n     * | `mouseenter`           | yes (required)            |\n     * | `mouseleave`           | yes (required)            |\n     * | `click`                | yes                       |\n     * | `dblclick`             | yes                       |\n     * | `contextmenu`          | yes                       |\n     * | `touchstart`           | yes                       |\n     * | `touchend`             | yes                       |\n     * | `touchcancel`          | yes                       |\n     * | `wheel`                |                           |\n     * | `resize`               |                           |\n     * | `remove`               |                           |\n     * | `touchmove`            |                           |\n     * | `movestart`            |                           |\n     * | `move`                 |                           |\n     * | `moveend`              |                           |\n     * | `dragstart`            |                           |\n     * | `drag`                 |                           |\n     * | `dragend`              |                           |\n     * | `zoomstart`            |                           |\n     * | `zoom`                 |                           |\n     * | `zoomend`              |                           |\n     * | `rotatestart`          |                           |\n     * | `rotate`               |                           |\n     * | `rotateend`            |                           |\n     * | `pitchstart`           |                           |\n     * | `pitch`                |                           |\n     * | `pitchend`             |                           |\n     * | `boxzoomstart`         |                           |\n     * | `boxzoomend`           |                           |\n     * | `boxzoomcancel`        |                           |\n     * | `webglcontextlost`     |                           |\n     * | `webglcontextrestored` |                           |\n     * | `load`                 |                           |\n     * | `render`               |                           |\n     * | `idle`                 |                           |\n     * | `error`                |                           |\n     * | `data`                 |                           |\n     * | `styledata`            |                           |\n     * | `sourcedata`           |                           |\n     * | `dataloading`          |                           |\n     * | `styledataloading`     |                           |\n     * | `sourcedataloading`    |                           |\n     * | `styleimagemissing`    |                           |\n     * | `dataabort`            |                           |\n     * | `sourcedataabort`      |                           |\n     *\n     * @param type - The event type to listen for. Events compatible with the optional `layerId` parameter are triggered\n     * when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.\n     * @param layer - The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location\n     * is within a visible feature in this layer. The event will have a `features` property containing\n     * an array of the matching features. If `layer` is not supplied, the event will not have a `features` property.\n     * Please note that many event types are not compatible with the optional `layer` parameter.\n     * @param listener - The function to be called when the event is fired.\n     * @example\n     * ```ts\n     * // Set an event listener that will fire\n     * // when the map has finished loading\n     * map.on('load', () => {\n     *   // Once the map has finished loading,\n     *   // add a new layer\n     *   map.addLayer({\n     *     id: 'points-of-interest',\n     *     source: {\n     *       type: 'vector',\n     *       url: 'https://maplibre.org/maplibre-style-spec/'\n     *     },\n     *     'source-layer': 'poi_label',\n     *     type: 'circle',\n     *     paint: {\n     *       // MapLibre Style Specification paint properties\n     *     },\n     *     layout: {\n     *       // MapLibre Style Specification layout properties\n     *     }\n     *   });\n     * });\n     * ```\n     * @example\n     * ```ts\n     * // Set an event listener that will fire\n     * // when a feature on the countries layer of the map is clicked\n     * map.on('click', 'countries', (e) => {\n     *   new Popup()\n     *     .setLngLat(e.lngLat)\n     *     .setHTML(`Country name: ${e.features[0].properties.name}`)\n     *     .addTo(map);\n     * });\n     * ```\n     * @see [Display popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    on<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): Subscription;\n    /**\n     * Overload of the `on` method that allows to listen to events specifying multiple layers.\n     * @event\n     * @param type - The type of the event.\n     * @param layerIds - The array of style layer IDs.\n     * @param listener - The listener callback.\n     */\n    on<T extends keyof MapLayerEventType>(\n        type: T,\n        layerIds: string[],\n        listener: (ev: MapLayerEventType[T] & Object) => void\n    ): Subscription;\n    /**\n     * Overload of the `on` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): Subscription;\n    /**\n     * Overload of the `on` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    on(type: keyof MapEventType | string, listener: Listener): Subscription;\n    on(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): Subscription {\n        if (listener === undefined) {\n            return super.on(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n\n        const delegatedListener = this._createDelegatedListener(type, layerIds, listener);\n\n        this._saveDelegatedListener(type, delegatedListener);\n\n        for (const event in delegatedListener.delegates) {\n            this.on(event, delegatedListener.delegates[event]);\n        }\n\n        return {\n            unsubscribe: () => {\n                this._removeDelegatedListener(type, layerIds, listener);\n            }\n        };\n    }\n\n    /**\n     * Adds a listener that will be called only once to a specified event type, optionally limited to features in a specified style layer.\n     *\n     * @event\n     * @param type - The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`,\n     * `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`,\n     * `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters\n     * a visible portion of the specified layer from outside that layer or outside the map canvas. `mouseleave`\n     * and `mouseout` events are triggered when the cursor leaves a visible portion of the specified layer, or leaves\n     * the map canvas.\n     * @param layer - The ID of a style layer or a listener if no ID is provided. Only events whose location is within a visible\n     * feature in this layer will trigger the listener. The event will have a `features` property containing\n     * an array of the matching features.\n     * @param listener - The function to be called when the event is fired.\n     * @returns `this` if listener is provided, promise otherwise to allow easier usage of async/await\n     */\n    once<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener?: (ev: MapLayerEventType[T] & Object) => void,\n    ): this | Promise<MapLayerEventType[T] & Object>;\n    /**\n     * Overload of the `once` method that allows to listen to events specifying multiple layers.\n     * @event\n     * @param type - The type of the event.\n     * @param layerIds - The array of style layer IDs.\n     * @param listener - The listener callback.\n     */\n    once<T extends keyof MapLayerEventType>(\n        type: T,\n        layerIds: string[],\n        listener?: (ev: MapLayerEventType[T] & Object) => void\n    ): this | Promise<any>;\n    /**\n     * Overload of the `once` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    once<T extends keyof MapEventType>(type: T, listener?: (ev: MapEventType[T] & Object) => void): this | Promise<any>;\n    /**\n     * Overload of the `once` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;\n    once(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): this | Promise<any> {\n        if (listener === undefined) {\n            return super.once(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n\n        const delegatedListener = this._createDelegatedListener(type, layerIds, listener);\n\n        for (const key in delegatedListener.delegates) {\n            const delegate: Delegate = delegatedListener.delegates[key];\n            delegatedListener.delegates[key] = (...args: Parameters<Delegate>) => {\n                this._removeDelegatedListener(type, layerIds, listener);\n                delegate(...args);\n            };\n        }\n\n        this._saveDelegatedListener(type, delegatedListener);\n\n        for (const event in delegatedListener.delegates) {\n            this.once(event, delegatedListener.delegates[event]);\n        }\n\n        return this;\n    }\n\n    /**\n     * Removes an event listener for events previously added with `{@link Map.on}`.\n     *\n     * @event\n     * @param type - The event type previously used to install the listener.\n     * @param layer - The layer ID or listener previously used to install the listener.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created with multiple layers.\n     * Provide the same layer IDs as to `on` or `once`, when the listener was registered.\n     * @event\n     * @param type - The type of the event.\n     * @param layers - The layer IDs previously used to install the listener.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapLayerEventType>(\n        type: T,\n        layers: string[],\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The function previously installed as a listener.\n     */\n    off(type: keyof MapEventType | string, listener: Listener): this;\n    off(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): this {\n        if (listener === undefined) {\n            return super.off(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n        this._removeDelegatedListener(type, layerIds, listener);\n\n        return this;\n    }\n\n    /**\n     * Returns an array of MapGeoJSONFeature objects\n     * representing visible features that satisfy the query parameters.\n     *\n     * @param geometryOrOptions - (optional) The geometry of the query region in pixel points within the map viewport:\n     * either a single pixel point or a pair of top-left and bottom-right pixel points describing a bounding box.\n     * The origin of the pixel points is at the top-left of the map viewport.\n     * Omitting this parameter (i.e. calling {@link Map.queryRenderedFeatures} with zero arguments,\n     * or with only a `options` argument) is equivalent to passing a bounding box encompassing the entire\n     * map viewport.\n     * The geometryOrOptions can receive a {@link QueryRenderedFeaturesOptions} only to support a situation where the function receives only one parameter which is the options parameter.\n     * @param options - (optional) Options object.\n     *\n     * @returns An array of MapGeoJSONFeature objects.\n     *\n     * The `properties` value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only\n     * string and numeric property values are supported (i.e. `null`, `Array`, and `Object` values are not supported).\n     *\n     * Each feature includes top-level `layer`, `source`, and `sourceLayer` properties. The `layer` property is an object\n     * representing the style layer to  which the feature belongs. Layout and paint properties in this object contain values\n     * which are fully evaluated for the given zoom level and feature.\n     *\n     * Only features that are currently rendered are included. Some features will **not** be included, like:\n     *\n     * - Features from layers whose `visibility` property is `\"none\"`.\n     * - Features from layers whose zoom range excludes the current zoom level.\n     * - Symbol features that have been hidden due to text or icon collision.\n     *\n     * Features from all other layers are included, including features that may have no visible\n     * contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to\n     * 0.\n     *\n     * The topmost rendered feature appears first in the returned array, and subsequent features are sorted by\n     * descending z-order. Features that are rendered multiple times (due to wrapping across the antemeridian at low\n     * zoom levels) are returned only once (though subject to the following caveat).\n     *\n     * Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature\n     * geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple\n     * times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.\n     * The results of the query will be those parts of the highway that lie within the map tiles covering the bounding\n     * rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile\n     * will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple\n     * tiles due to tile buffering.\n     *\n     * @example\n     * Find all features at a point\n     * ```ts\n     * let features = map.queryRenderedFeatures(\n     *   [20, 35],\n     *   { layers: ['my-layer-name'] }\n     * );\n     * ```\n     *\n     * @example\n     * Find all features within a static bounding box\n     * ```ts\n     * let features = map.queryRenderedFeatures(\n     *   [[10, 20], [30, 50]],\n     *   { layers: ['my-layer-name'] }\n     * );\n     * ```\n     *\n     * @example\n     * Find all features within a bounding box around a point\n     * ```ts\n     * let width = 10;\n     * let height = 20;\n     * let features = map.queryRenderedFeatures([\n     *   [point.x - width / 2, point.y - height / 2],\n     *   [point.x + width / 2, point.y + height / 2]\n     * ], { layers: ['my-layer-name'] });\n     * ```\n     *\n     * @example\n     * Query all rendered features from a single layer\n     * ```ts\n     * let features = map.queryRenderedFeatures({ layers: ['my-layer-name'] });\n     * ```\n     * @see [Get features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/get-features-under-the-mouse-pointer/)\n     */\n    queryRenderedFeatures(geometryOrOptions?: PointLike | [PointLike, PointLike] | QueryRenderedFeaturesOptions, options?: QueryRenderedFeaturesOptions): MapGeoJSONFeature[] {\n        if (!this.style) {\n            return [];\n        }\n        let queryGeometry: Point[];\n        const isGeometry = geometryOrOptions instanceof Point || Array.isArray(geometryOrOptions);\n        const geometry = isGeometry ? geometryOrOptions : [[0, 0], [this.transform.width, this.transform.height]];\n        options = options || (isGeometry ? {} : geometryOrOptions) || {};\n\n        if (geometry instanceof Point || typeof geometry[0] === 'number') {\n            queryGeometry = [Point.convert(geometry as PointLike)];\n        } else {\n            const tl = Point.convert(geometry[0] as PointLike);\n            const br = Point.convert(geometry[1] as PointLike);\n            queryGeometry = [tl, new Point(br.x, tl.y), br, new Point(tl.x, br.y), tl];\n        }\n\n        return this.style.queryRenderedFeatures(queryGeometry, options, this.transform);\n    }\n\n    /**\n     * Returns an array of MapGeoJSONFeature objects\n     * representing features within the specified vector tile or GeoJSON source that satisfy the query parameters.\n     *\n     * @param sourceId - The ID of the vector tile or GeoJSON source to query.\n     * @param parameters - The options object.\n     * @returns An array of MapGeoJSONFeature objects.\n     *\n     * In contrast to {@link Map.queryRenderedFeatures}, this function returns all features matching the query parameters,\n     * whether or not they are rendered by the current style (i.e. visible). The domain of the query includes all currently-loaded\n     * vector tiles and GeoJSON source tiles: this function does not check tiles outside the currently\n     * visible viewport.\n     *\n     * Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature\n     * geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple\n     * times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.\n     * The results of the query will be those parts of the highway that lie within the map tiles covering the bounding\n     * rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile\n     * will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple\n     * tiles due to tile buffering.\n     *\n     * @example\n     * Find all features in one source layer in a vector source\n     * ```ts\n     * let features = map.querySourceFeatures('your-source-id', {\n     *   sourceLayer: 'your-source-layer'\n     * });\n     * ```\n     *\n     */\n    querySourceFeatures(sourceId: string, parameters?: QuerySourceFeatureOptions | null): GeoJSONFeature[] {\n        return this.style.querySourceFeatures(sourceId, parameters);\n    }\n\n    /**\n     * Updates the map's MapLibre style object with a new value.\n     *\n     * If a style is already set when this is used and options.diff is set to true, the map renderer will attempt to compare the given style\n     * against the map's current state and perform only the changes necessary to make the map style match the desired state. Changes in sprites\n     * (images used for icons and patterns) and glyphs (fonts for label text) **cannot** be diffed. If the sprites or fonts used in the current\n     * style and the given style are different in any way, the map renderer will force a full update, removing the current style and building\n     * the given one from scratch.\n     *\n     *\n     * @param style - A JSON object conforming to the schema described in the\n     * [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL to such JSON.\n     * @param options - The options object.\n     *\n     * @example\n     * ```ts\n     * map.setStyle(\"https://demotiles.maplibre.org/style.json\");\n     *\n     * map.setStyle('https://demotiles.maplibre.org/style.json', {\n     *   transformStyle: (previousStyle, nextStyle) => ({\n     *       ...nextStyle,\n     *       sources: {\n     *           ...nextStyle.sources,\n     *           // copy a source from previous style\n     *           'osm': previousStyle.sources.osm\n     *       },\n     *       layers: [\n     *           // background layer\n     *           nextStyle.layers[0],\n     *           // copy a layer from previous style\n     *           previousStyle.layers[0],\n     *           // other layers from the next style\n     *           ...nextStyle.layers.slice(1).map(layer => {\n     *               // hide the layers we don't need from demotiles style\n     *               if (layer.id.startsWith('geolines')) {\n     *                   layer.layout = {...layer.layout || {}, visibility: 'none'};\n     *               // filter out US polygons\n     *               } else if (layer.id.startsWith('coastline') || layer.id.startsWith('countries')) {\n     *                   layer.filter = ['!=', ['get', 'ADM0_A3'], 'USA'];\n     *               }\n     *               return layer;\n     *           })\n     *       ]\n     *   })\n     * });\n     * ```\n     */\n    setStyle(style: StyleSpecification | string | null, options?: StyleSwapOptions & StyleOptions): this {\n        options = extend({},\n            {\n                localIdeographFontFamily: this._localIdeographFontFamily,\n                validate: this._validateStyle\n            }, options);\n\n        if ((options.diff !== false && options.localIdeographFontFamily === this._localIdeographFontFamily) && this.style && style) {\n            this._diffStyle(style, options);\n            return this;\n        } else {\n            this._localIdeographFontFamily = options.localIdeographFontFamily;\n            return this._updateStyle(style, options);\n        }\n    }\n\n    /**\n     *  Updates the requestManager's transform request with a new function\n     *\n     * @param transformRequest - A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.\n     * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties\n     *\n     * @example\n     * ```ts\n     * map.setTransformRequest((url: string, resourceType: string) => {});\n     * ```\n     */\n    setTransformRequest(transformRequest: RequestTransformFunction | null): this {\n        this._requestManager.setTransformRequest(transformRequest);\n        return this;\n    }\n\n    _getUIString(key: keyof typeof defaultLocale) {\n        const str = this._locale[key];\n        if (str == null) {\n            throw new Error(`Missing UI string '${key}'`);\n        }\n\n        return str;\n    }\n\n    _updateStyle(style: StyleSpecification | string | null, options?: StyleSwapOptions & StyleOptions) {\n        // transformStyle relies on having previous style serialized, if it is not loaded yet, delay _updateStyle until previous style is loaded\n        if (options.transformStyle && this.style && !this.style._loaded) {\n            this.style.once('style.load', () => this._updateStyle(style, options));\n            return;\n        }\n\n        const previousStyle = this.style && options.transformStyle ? this.style.serialize() : undefined;\n        if (this.style) {\n            this.style.setEventedParent(null);\n\n            // Only release workers when map is getting disposed\n            this.style._remove(!style);\n        }\n\n        if (!style) {\n            this.style?.projection?.destroy();\n            delete this.style;\n            return this;\n        } else {\n            this.style = new Style(this, options || {});\n        }\n\n        this.style.setEventedParent(this, {style: this.style});\n\n        if (typeof style === 'string') {\n            this.style.loadURL(style, options, previousStyle);\n        } else {\n            this.style.loadJSON(style, options, previousStyle);\n        }\n\n        return this;\n    }\n\n    _lazyInitEmptyStyle() {\n        if (!this.style) {\n            this.style = new Style(this, {});\n            this.style.setEventedParent(this, {style: this.style});\n            this.style.loadEmpty();\n        }\n    }\n\n    _diffStyle(style: StyleSpecification | string, options?: StyleSwapOptions & StyleOptions) {\n        if (typeof style === 'string') {\n            const url = style;\n            const request = this._requestManager.transformRequest(url, ResourceType.Style);\n            getJSON<StyleSpecification>(request, new AbortController()).then((response) => {\n                this._updateDiff(response.data, options);\n            }).catch((error) => {\n                if (error) {\n                    this.fire(new ErrorEvent(error));\n                }\n            });\n        } else if (typeof style === 'object') {\n            this._updateDiff(style, options);\n        }\n    }\n\n    _updateDiff(style: StyleSpecification, options?: StyleSwapOptions & StyleOptions) {\n        try {\n            if (this.style.setState(style, options)) {\n                this._update(true);\n            }\n        } catch (e) {\n            warnOnce(\n                `Unable to perform style diff: ${e.message || e.error || e}.  Rebuilding the style from scratch.`\n            );\n            this._updateStyle(style, options);\n        }\n    }\n\n    /**\n     * Returns the map's MapLibre style object, a JSON object which can be used to recreate the map's style.\n     *\n     * @returns The map's style JSON object.\n     *\n     * @example\n     * ```ts\n     * let styleJson = map.getStyle();\n     * ```\n     *\n     */\n    getStyle(): StyleSpecification {\n        if (this.style) {\n            return this.style.serialize();\n        }\n    }\n\n    /**\n     * @internal\n     * Returns the map's style and cloned images to restore context.\n     * @returns An object containing the style and images.\n     */\n    _getStyleAndImages(): LostContextStyle {\n        if (this.style) {\n            return {\n                style: this.style.serialize(),\n                images: this.style.imageManager.cloneImages()\n            };\n        }\n        return {style: null, images: {}};\n    }\n\n    /**\n     * Returns a Boolean indicating whether the map's style is fully loaded.\n     *\n     * @returns A Boolean indicating whether the style is fully loaded.\n     *\n     * @example\n     * ```ts\n     * let styleLoadStatus = map.isStyleLoaded();\n     * ```\n     */\n    isStyleLoaded(): boolean | void {\n        if (!this.style) return warnOnce('There is no style added to the map.');\n        return this.style.loaded();\n    }\n\n    /**\n     * Adds a source to the map's style.\n     *\n     * Events triggered:\n     *\n     * Triggers the `source.add` event.\n     *\n     * @param id - The ID of the source to add. Must not conflict with existing sources.\n     * @param source - The source object, conforming to the\n     * MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/sources) or\n     * {@link CanvasSourceSpecification}.\n     * @example\n     * ```ts\n     * map.addSource('my-data', {\n     *   type: 'vector',\n     *   url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n     * });\n     * ```\n     * @example\n     * ```ts\n     * map.addSource('my-data', {\n     *   \"type\": \"geojson\",\n     *   \"data\": {\n     *     \"type\": \"Feature\",\n     *     \"geometry\": {\n     *       \"type\": \"Point\",\n     *       \"coordinates\": [-77.0323, 38.9131]\n     *     },\n     *     \"properties\": {\n     *       \"title\": \"Mapbox DC\",\n     *       \"marker-symbol\": \"monument\"\n     *     }\n     *   }\n     * });\n     * ```\n     * @see GeoJSON source: [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)\n     */\n    addSource(id: string, source: SourceSpecification | CanvasSourceSpecification): this {\n        this._lazyInitEmptyStyle();\n        this.style.addSource(id, source);\n        return this._update(true);\n    }\n\n    /**\n     * Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with\n     * the given ID in the map's style has no outstanding network requests, otherwise `false`.\n     *\n     * A {@link ErrorEvent} event will be fired if there is no source wit the specified ID.\n     *\n     * @param id - The ID of the source to be checked.\n     * @returns A Boolean indicating whether the source is loaded.\n     * @example\n     * ```ts\n     * let sourceLoaded = map.isSourceLoaded('bathymetry-data');\n     * ```\n     */\n    isSourceLoaded(id: string): boolean {\n        const tileManager = this.style && this.style.tileManagers[id];\n        if (tileManager === undefined) {\n            this.fire(new ErrorEvent(new Error(`There is no tile manager with ID '${id}'`)));\n            return;\n        }\n        return tileManager.loaded();\n    }\n\n    /**\n     * Loads a 3D terrain mesh, based on a \"raster-dem\" source.\n     *\n     * Triggers the `terrain` event.\n     *\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setTerrain({ source: 'terrain' });\n     * ```\n     */\n    setTerrain(options: TerrainSpecification | null): this {\n        this.style._checkLoaded();\n\n        // clear event handlers\n        if (this._terrainDataCallback) this.style.off('data', this._terrainDataCallback);\n\n        if (!options) {\n            // remove terrain\n            if (this.terrain) this.terrain.tileManager.destruct();\n            this.terrain = null;\n            if (this.painter.renderToTexture) this.painter.renderToTexture.destruct();\n            this.painter.renderToTexture = null;\n            this.transform.setMinElevationForCurrentTile(0);\n            if (this._centerClampedToGround) {\n                this.transform.setElevation(0);\n            }\n        } else {\n            // add terrain\n            const tileManager = this.style.tileManagers[options.source];\n            if (!tileManager) throw new Error(`cannot load terrain, because there exists no source with ID: ${options.source}`);\n            // Update terrain tiles when adding new terrain\n            if (this.terrain === null) tileManager.reload();\n            // Warn once if user is using the same source for hillshade/color-relief and terrain\n            for (const index in this.style._layers) {\n                const thisLayer = this.style._layers[index];\n                if (thisLayer.type === 'hillshade' && thisLayer.source === options.source) {\n                    warnOnce('You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.');\n                }\n                if (thisLayer.type === 'color-relief' && thisLayer.source === options.source) {\n                    warnOnce('You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.');\n                }\n            }\n            this.terrain = new Terrain(this.painter, tileManager, options);\n            this.painter.renderToTexture = new RenderToTexture(this.painter, this.terrain);\n            this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            this._terrainDataCallback = e => {\n                if (e.dataType === 'style') {\n                    this.terrain.tileManager.freeRtt();\n                } else if (e.dataType === 'source' && e.tile) {\n                    if (e.sourceId === options.source && !this._elevationFreeze) {\n                        this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n                        if (this._centerClampedToGround) {\n                            this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n                        }\n                    }\n\n                    if (e.source?.type === 'image') {\n                        this.terrain.tileManager.freeRtt();\n                    } else {\n                        this.terrain.tileManager.freeRtt(e.tile.tileID);\n                    }\n                }\n            };\n            this.style.on('data', this._terrainDataCallback);\n        }\n\n        this.fire(new Event('terrain', {terrain: options}));\n        return this;\n    }\n\n    /**\n     * Get the terrain-options if terrain is loaded\n     * @returns the TerrainSpecification passed to setTerrain\n     * @example\n     * ```ts\n     * map.getTerrain(); // { source: 'terrain' };\n     * ```\n     */\n    getTerrain(): TerrainSpecification | null {\n        return this.terrain?.options ?? null;\n    }\n\n    /**\n     * Returns a Boolean indicating whether all tiles in the viewport from all sources on\n     * the style are loaded.\n     *\n     * @returns A Boolean indicating whether all tiles are loaded.\n     * @example\n     * ```ts\n     * let tilesLoaded = map.areTilesLoaded();\n     * ```\n     */\n    areTilesLoaded(): boolean {\n        const tileManagers = this.style && this.style.tileManagers;\n        for (const tileManager of Object.values(tileManagers)) {\n            if (!tileManager.areTilesLoaded()) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * Removes a source from the map's style.\n     *\n     * @param id - The ID of the source to remove.\n     * @example\n     * ```ts\n     * map.removeSource('bathymetry-data');\n     * ```\n     */\n    removeSource(id: string): Map {\n        this.style.removeSource(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the source with the specified ID in the map's style.\n     *\n     * This method is often used to update a source using the instance members for the relevant\n     * source type as defined in classes that derive from {@link Source}.\n     * For example, setting the `data` for a GeoJSON source or updating the `url` and `coordinates`\n     * of an image source.\n     *\n     * @param id - The ID of the source to get.\n     * @returns The style source with the specified ID or `undefined` if the ID\n     * corresponds to no existing sources.\n     * The shape of the object varies by source type.\n     * A list of options for each source type is available on the MapLibre Style Specification's\n     * [Sources](https://maplibre.org/maplibre-style-spec/sources/) page.\n     * @example\n     * ```ts\n     * let sourceObject = map.getSource('points');\n     * ```\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-a-point/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/add-live-realtime-data/)\n     */\n    getSource<TSource extends Source>(id: string): TSource | undefined {\n        return this.style.getSource(id) as TSource;\n    }\n\n    /**\n     * Change the tile Level of Detail behavior of the specified source. These parameters have no effect when\n     * pitch == 0, and the largest effect when the horizon is visible on screen.\n     *\n     * @param maxZoomLevelsOnScreen - The maximum number of distinct zoom levels allowed on screen at a time.\n     * There will generally be fewer zoom levels on the screen, the maximum can only be reached when the horizon\n     * is at the top of the screen. Increasing the maximum number of zoom levels causes the zoom level to decay\n     * faster toward the horizon.\n     * @param tileCountMaxMinRatio - The ratio of the maximum number of tiles loaded (at high pitch) to the minimum\n     * number of tiles loaded. Increasing this ratio allows more tiles to be loaded at high pitch angles. If the ratio\n     * would otherwise be exceeded, the zoom level is reduced uniformly to keep the number of tiles within the limit.\n     * @param sourceId - The ID of the source to set tile LOD parameters for. All sources will be updated if unspecified.\n     * If `sourceId` is specified but a corresponding source does not exist, an error is thrown.\n     * @example\n     * ```ts\n     * map.setSourceTileLodParams(4.0, 3.0, 'terrain');\n     * ```\n     * @see [Modify Level of Detail behavior](https://maplibre.org/maplibre-gl-js/docs/examples/level-of-detail-control/)\n\n     */\n    setSourceTileLodParams(maxZoomLevelsOnScreen: number, tileCountMaxMinRatio: number, sourceId?: string) : this {\n        if (sourceId) {\n            const source = this.getSource(sourceId);\n            if(!source) {\n                throw new Error(`There is no source with ID \"${sourceId}\", cannot set LOD parameters`);\n            }\n            source.calculateTileZoom = createCalculateTileZoomFunction(Math.max(1, maxZoomLevelsOnScreen), Math.max(1, tileCountMaxMinRatio));\n        } else {\n            for (const id in this.style.tileManagers) {\n                this.style.tileManagers[id].getSource().calculateTileZoom = createCalculateTileZoomFunction(Math.max(1, maxZoomLevelsOnScreen), Math.max(1, tileCountMaxMinRatio));\n            }\n        }\n        this._update(true);\n        return this;\n    }\n\n    /**\n     * Triggers a reload of the selected tiles\n     *\n     * @param sourceId - The ID of the source\n     * @param tileIds - An array of tile IDs to be reloaded. If not defined, all tiles will be reloaded.\n     * @example\n     * ```ts\n     * map.refreshTiles('satellite', [{x:1024, y: 1023, z: 11}, {x:1023, y: 1023, z: 11}]);\n     * ```\n     */\n    refreshTiles(sourceId: string, tileIds?: Array<{x: number; y: number; z: number}>) {\n        const tileManager = this.style.tileManagers[sourceId];\n        if(!tileManager) {\n            throw new Error(`There is no tile manager with ID \"${sourceId}\", cannot refresh tile`);\n        }\n        if (tileIds === undefined) {\n            tileManager.reload(true);\n        } else {\n            tileManager.refreshTiles(tileIds.map((tileId) => {return new CanonicalTileID(tileId.z, tileId.x, tileId.y);}));\n        }\n    }\n\n    /**\n     * Add an image to the style. This image can be displayed on the map like any other icon in the style's\n     * sprite using the image's ID with\n     * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),\n     * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),\n     * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),\n     * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).\n     *\n     * A {@link ErrorEvent} event will be fired if the image parameter is invalid or there is not enough space in the sprite to add this image.\n     *\n     * @param id - The ID of the image.\n     * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`\n     * properties with the same format as `ImageData`.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * // If the style's sprite does not already contain an image with ID 'cat',\n     * // add the image 'cat-icon.png' to the style's sprite with the ID 'cat'.\n     * const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/400px-Cat_silhouette.svg.png');\n     * if (!map.hasImage('cat')) map.addImage('cat', image.data);\n     *\n     * // Add a stretchable image that can be used with `icon-text-fit`\n     * // In this example, the image is 600px wide by 400px high.\n     * const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/8/89/Black_and_White_Boxed_%28bordered%29.png');\n     * if (map.hasImage('border-image')) return;\n     * map.addImage('border-image', image.data, {\n     *     content: [16, 16, 300, 384], // place text over left half of image, avoiding the 16px border\n     *     stretchX: [[16, 584]], // stretch everything horizontally except the 16px border\n     *     stretchY: [[16, 384]], // stretch everything vertically except the 16px border\n     * });\n     * ```\n     * @see Use `HTMLImageElement`: [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-icon-to-the-map/)\n     * @see Use `ImageData`: [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-generated-icon-to-the-map/)\n     */\n    addImage(id: string,\n        image: HTMLImageElement | ImageBitmap | ImageData | {\n            width: number;\n            height: number;\n            data: Uint8Array | Uint8ClampedArray;\n        } | StyleImageInterface,\n        options: Partial<StyleImageMetadata> = {}): this {\n        const {\n            pixelRatio = 1,\n            sdf = false,\n            stretchX,\n            stretchY,\n            content,\n            textFitWidth,\n            textFitHeight\n        } = options;\n        this._lazyInitEmptyStyle();\n        const version = 0;\n\n        if (image instanceof HTMLImageElement || isImageBitmap(image)) {\n            const {width, height, data} = browser.getImageData(image);\n            this.style.addImage(id, {data: new RGBAImage({width, height}, data), pixelRatio, stretchX, stretchY, content, textFitWidth, textFitHeight, sdf, version});\n        } else if (image.width === undefined || image.height === undefined) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, ' +\n                'or object with `width`, `height`, and `data` properties with the same format as `ImageData`')));\n        } else {\n            const {width, height, data} = image as ImageData;\n            const userImage = (image as any as StyleImageInterface);\n\n            this.style.addImage(id, {\n                data: new RGBAImage({width, height}, new Uint8Array(data)),\n                pixelRatio,\n                stretchX,\n                stretchY,\n                content,\n                textFitWidth,\n                textFitHeight,\n                sdf,\n                version,\n                userImage\n            });\n\n            if (userImage.onAdd) {\n                userImage.onAdd(this, id);\n            }\n            return this;\n        }\n    }\n\n    /**\n     * Update an existing image in a style. This image can be displayed on the map like any other icon in the style's\n     * sprite using the image's ID with\n     * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),\n     * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),\n     * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),\n     * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invalid.\n     *\n     * @param id - The ID of the image.\n     * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`\n     * properties with the same format as `ImageData`.\n     * @example\n     * ```ts\n     * // If an image with the ID 'cat' already exists in the style's sprite,\n     * // replace that image with a new image, 'other-cat-icon.png'.\n     * if (map.hasImage('cat')) map.updateImage('cat', './other-cat-icon.png');\n     * ```\n     */\n    updateImage(id: string,\n        image: HTMLImageElement | ImageBitmap | ImageData | {\n            width: number;\n            height: number;\n            data: Uint8Array | Uint8ClampedArray;\n        } | StyleImageInterface): this {\n\n        const existingImage = this.style.getImage(id);\n        if (!existingImage) {\n            return this.fire(new ErrorEvent(new Error(\n                'The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.')));\n        }\n        const imageData = (image instanceof HTMLImageElement || isImageBitmap(image)) ?\n            browser.getImageData(image) :\n            image;\n        const {width, height, data} = imageData;\n\n        if (width === undefined || height === undefined) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, ' +\n                'or object with `width`, `height`, and `data` properties with the same format as `ImageData`')));\n        }\n\n        if (width !== existingImage.data.width || height !== existingImage.data.height) {\n            return this.fire(new ErrorEvent(new Error(\n                'The width and height of the updated image must be that same as the previous version of the image')));\n        }\n\n        const copy = !(image instanceof HTMLImageElement || isImageBitmap(image));\n        existingImage.data.replace(data, copy);\n\n        this.style.updateImage(id, existingImage);\n        return this;\n    }\n\n    /**\n     * Returns an image, specified by ID, currently available in the map.\n     * This includes both images from the style's original sprite\n     * and any images that have been added at runtime using {@link Map.addImage}.\n     *\n     * @param id - The ID of the image.\n     * @returns An image in the map with the specified ID.\n     *\n     * @example\n     * ```ts\n     * let coffeeShopIcon = map.getImage(\"coffee_cup\");\n     * ```\n     */\n    getImage(id: string): StyleImage {\n        return this.style.getImage(id);\n    }\n\n    /**\n     * Check whether or not an image with a specific ID exists in the style. This checks both images\n     * in the style's original sprite and any images\n     * that have been added at runtime using {@link Map.addImage}.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invalid.\n     *\n     * @param id - The ID of the image.\n     *\n     * @returns A Boolean indicating whether the image exists.\n     * @example\n     * Check if an image with the ID 'cat' exists in the style's sprite.\n     * ```ts\n     * let catIconExists = map.hasImage('cat');\n     * ```\n     */\n    hasImage(id: string): boolean {\n        if (!id) {\n            this.fire(new ErrorEvent(new Error('Missing required image id')));\n            return false;\n        }\n\n        return !!this.style.getImage(id);\n    }\n\n    /**\n     * Remove an image from a style. This can be an image from the style's original\n     * sprite or any images\n     * that have been added at runtime using {@link Map.addImage}.\n     *\n     * @param id - The ID of the image.\n     *\n     * @example\n     * ```ts\n     * // If an image with the ID 'cat' exists in\n     * // the style's sprite, remove it.\n     * if (map.hasImage('cat')) map.removeImage('cat');\n     * ```\n     */\n    removeImage(id: string) {\n        this.style.removeImage(id);\n    }\n\n    /**\n     * Load an image from an external URL to be used with {@link Map.addImage}. External\n     * domains must support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS).\n     *\n     * @param url - The URL of the image file. Image file must be in png, webp, or jpg format.\n     * @returns a promise that is resolved when the image is loaded\n     *\n     * @example\n     * Load an image from an external URL.\n     * ```ts\n     * const response = await map.loadImage('https://picsum.photos/50/50');\n     * // Add the loaded image to the style's sprite with the ID 'photo'.\n     * map.addImage('photo', response.data);\n     * ```\n     * @see [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-icon-to-the-map/)\n     */\n    loadImage(url: string): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>> {\n        return ImageRequest.getImage(this._requestManager.transformRequest(url, ResourceType.Image), new AbortController());\n    }\n\n    /**\n     * Returns an Array of strings containing the IDs of all images currently available in the map.\n     * This includes both images from the style's original sprite\n     * and any images that have been added at runtime using {@link Map.addImage}.\n     *\n     * @returns An Array of strings containing the names of all sprites/images currently available in the map.\n     *\n     * @example\n     * ```ts\n     * let allImages = map.listImages();\n     * ```\n     */\n    listImages(): Array<string> {\n        return this.style.listImages();\n    }\n\n    /**\n     * Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)\n     * to the map's style.\n     *\n     * A layer defines how data from a specified source will be styled. Read more about layer types\n     * and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).\n     *\n     * @param layer - The layer to add,\n     * conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,\n     * less commonly, the {@link CustomLayerInterface} specification. Can also be a layer definition with an embedded source definition.\n     * The MapLibre Style Specification's layer definition is appropriate for most layers.\n     *\n     * @param beforeId - The ID of an existing layer to insert the new layer before,\n     * resulting in the new layer appearing visually beneath the existing layer.\n     * If this argument is not specified, the layer will be appended to the end of the layers array\n     * and appear visually above all other layers.\n     *\n     * @example\n     * Add a circle layer with a vector source\n     * ```ts\n     * map.addLayer({\n     *   id: 'points-of-interest',\n     *   source: {\n     *     type: 'vector',\n     *     url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n     *   },\n     *   'source-layer': 'poi_label',\n     *   type: 'circle',\n     *   paint: {\n     *     // MapLibre Style Specification paint properties\n     *   },\n     *   layout: {\n     *     // MapLibre Style Specification layout properties\n     *   }\n     * });\n     * ```\n     *\n     * @example\n     * Define a source before using it to create a new layer\n     * ```ts\n     * map.addSource('state-data', {\n     *   type: 'geojson',\n     *   data: 'path/to/data.geojson'\n     * });\n     *\n     * map.addLayer({\n     *   id: 'states',\n     *   // References the GeoJSON source defined above\n     *   // and does not require a `source-layer`\n     *   source: 'state-data',\n     *   type: 'symbol',\n     *   layout: {\n     *     // Set the label content to the\n     *     // feature's `name` property\n     *     text-field: ['get', 'name']\n     *   }\n     * });\n     * ```\n     *\n     * @example\n     * Add a new symbol layer before an existing layer\n     * ```ts\n     * map.addLayer({\n     *   id: 'states',\n     *   // References a source that's already been defined\n     *   source: 'state-data',\n     *   type: 'symbol',\n     *   layout: {\n     *     // Set the label content to the\n     *     // feature's `name` property\n     *     text-field: ['get', 'name']\n     *   }\n     * // Add the layer before the existing `cities` layer\n     * }, 'cities');\n     * ```\n     * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/create-and-style-clusters/)\n     * @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-vector-tile-source/)\n     * @see [Add a WMS source](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-wms-source/)\n     */\n    addLayer(layer: AddLayerObject, beforeId?: string) {\n        this._lazyInitEmptyStyle();\n        this.style.addLayer(layer, beforeId);\n        return this._update(true);\n    }\n\n    /**\n     * Moves a layer to a different z-position.\n     *\n     * @param id - The ID of the layer to move.\n     * @param beforeId - The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.\n     *\n     * @example\n     * Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.\n     * ```ts\n     * map.moveLayer('polygon', 'country-label');\n     * ```\n     */\n    moveLayer(id: string, beforeId?: string): this {\n        this.style.moveLayer(id, beforeId);\n        return this._update(true);\n    }\n\n    /**\n     * Removes the layer with the given ID from the map's style.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invalid.\n     *\n     * @param id - The ID of the layer to remove\n     *\n     * @example\n     * If a layer with ID 'state-data' exists, remove it.\n     * ```ts\n     * if (map.getLayer('state-data')) map.removeLayer('state-data');\n     * ```\n     */\n    removeLayer(id: string): this {\n        this.style.removeLayer(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the layer with the specified ID in the map's style.\n     *\n     * @param id - The ID of the layer to get.\n     * @returns The layer with the specified ID, or `undefined`\n     * if the ID corresponds to no existing layers.\n     *\n     * @example\n     * ```ts\n     * let stateDataLayer = map.getLayer('state-data');\n     * ```\n     * @see [Filter symbols by toggling a list](https://maplibre.org/maplibre-gl-js/docs/examples/filter-symbols-by-toggling-a-list/)\n     * @see [Filter symbols by text input](https://maplibre.org/maplibre-gl-js/docs/examples/filter-symbols-by-text-input/)\n     */\n    getLayer(id: string): StyleLayer | undefined {\n        return this.style.getLayer(id);\n    }\n\n    /**\n     * Return the ids of all layers currently in the style, including custom layers, in order.\n     *\n     * @returns ids of layers, in order\n     *\n     * @example\n     * ```ts\n     * const orderedLayerIds = map.getLayersOrder();\n     * ```\n     */\n    getLayersOrder(): string[] {\n        return this.style.getLayersOrder();\n    }\n\n    /**\n     * Sets the zoom extent for the specified style layer. The zoom extent includes the\n     * [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)\n     * and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))\n     * at which the layer will be rendered.\n     *\n     * !!! note\n     *     For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the\n     *     minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum\n     *     zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style\n     *     layer will not be rendered at all zoom levels in the zoom range.\n     *\n     * @param layerId - The ID of the layer to which the zoom extent will be applied.\n     * @param minzoom - The minimum zoom to set (0-24).\n     * @param maxzoom - The maximum zoom to set (0-24).\n     *\n     * @example\n     * ```ts\n     * map.setLayerZoomRange('my-layer', 2, 5);\n     * ```\n     */\n    setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this {\n        this.style.setLayerZoomRange(layerId, minzoom, maxzoom);\n        return this._update(true);\n    }\n\n    /**\n     * Sets the filter for the specified style layer.\n     *\n     * Filters control which features a style layer renders from its source.\n     * Any feature for which the filter expression evaluates to `true` will be\n     * rendered on the map. Those that are false will be hidden.\n     *\n     * Use `setFilter` to show a subset of your source data.\n     *\n     * To clear the filter, pass `null` or `undefined` as the second parameter.\n     *\n     * @param layerId - The ID of the layer to which the filter will be applied.\n     * @param filter - The filter, conforming to the MapLibre Style Specification's\n     * [filter definition](https://maplibre.org/maplibre-style-spec/layers/#filter).  If `null` or `undefined` is provided, the function removes any existing filter from the layer.\n     * @param options - Options object.\n     *\n     * @example\n     * Display only features with the 'name' property 'USA'\n     * ```ts\n     * map.setFilter('my-layer', ['==', ['get', 'name'], 'USA']);\n     * ```\n     * @example\n     * Display only features with five or more 'available-spots'\n     * ```ts\n     * map.setFilter('bike-docks', ['>=', ['get', 'available-spots'], 5]);\n     * ```\n     * @example\n     * Remove the filter for the 'bike-docks' style layer\n     * ```ts\n     * map.setFilter('bike-docks', null);\n     * ```\n     * @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-time-slider/)\n     */\n    setFilter(layerId: string, filter?: FilterSpecification | null, options: StyleSetterOptions = {}) {\n        this.style.setFilter(layerId, filter, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the filter applied to the specified style layer.\n     *\n     * @param layerId - The ID of the style layer whose filter to get.\n     * @returns The layer's filter.\n     */\n    getFilter(layerId: string): FilterSpecification | void {\n        return this.style.getFilter(layerId);\n    }\n\n    /**\n     * Sets the value of a paint property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to set the paint property in.\n     * @param name - The name of the paint property to set.\n     * @param value - The value of the paint property to set.\n     * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).\n     * Pass `null` to unset the existing value.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setPaintProperty('my-layer', 'fill-color', '#faafee');\n     * ```\n     * @see [Change a layer's color with buttons](https://maplibre.org/maplibre-gl-js/docs/examples/change-a-layers-color-with-buttons/)\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    setPaintProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}): this {\n        this.style.setPaintProperty(layerId, name, value, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of a paint property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to get the paint property from.\n     * @param name - The name of a paint property to get.\n     * @returns The value of the specified paint property.\n     */\n    getPaintProperty(layerId: string, name: string) {\n        return this.style.getPaintProperty(layerId, name);\n    }\n\n    /**\n     * Sets the value of a layout property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to set the layout property in.\n     * @param name - The name of the layout property to set.\n     * @param value - The value of the layout property. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).\n     * @param options - The options object.\n     * @example\n     * ```ts\n     * map.setLayoutProperty('my-layer', 'visibility', 'none');\n     * ```\n     */\n    setLayoutProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}): this {\n        this.style.setLayoutProperty(layerId, name, value, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of a layout property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to get the layout property from.\n     * @param name - The name of the layout property to get.\n     * @returns The value of the specified layout property.\n     */\n    getLayoutProperty(layerId: string, name: string) {\n        return this.style.getLayoutProperty(layerId, name);\n    }\n\n    /**\n    * Sets the value of the style's glyphs property. Pass a falsy value (null or undefined)\n    * to unset glyphs.\n     *\n     * @param glyphsUrl - Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');\n     * ```\n     */\n    setGlyphs(glyphsUrl: string | null | undefined, options: StyleSetterOptions = {}): this {\n        this._lazyInitEmptyStyle();\n        this.style.setGlyphs(glyphsUrl, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the style's glyphs URL\n     *\n     * @returns glyphs Style's glyphs url, or `null` if glyphs are unset.\n     */\n    getGlyphs(): string | null {\n        return this.style.getGlyphsUrl();\n    }\n\n    /**\n     * Adds a sprite to the map's style. Fires the `style` event.\n     *\n     * @param id - The ID of the sprite to add. Must not conflict with existing sprites.\n     * @param url - The URL to load the sprite from\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.addSprite('sprite-two', 'http://example.com/sprite-two');\n     * ```\n     */\n    addSprite(id: string, url: string, options: StyleSetterOptions = {}): this {\n        this._lazyInitEmptyStyle();\n        this.style.addSprite(id, url, options, (err) => {\n            if (!err) {\n                this._update(true);\n            }\n        });\n        return this;\n    }\n\n    /**\n     * Removes the sprite from the map's style. Fires the `style` event.\n     *\n     * @param id - The ID of the sprite to remove. If the sprite is declared as a single URL, the ID must be \"default\".\n     * @example\n     * ```ts\n     * map.removeSprite('sprite-two');\n     * map.removeSprite('default');\n     * ```\n     */\n    removeSprite(id: string) {\n        this._lazyInitEmptyStyle();\n        this.style.removeSprite(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the as-is value of the style's sprite.\n     *\n     * @returns style's sprite list of id-url pairs\n     */\n    getSprite(): {id: string; url: string}[] {\n        return this.style.getSprite();\n    }\n\n    /**\n     * Sets the value of the style's sprite property.\n     *\n     * @param spriteUrl - Sprite URL to set.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setSprite('YOUR_SPRITE_URL');\n     * ```\n     */\n    setSprite(spriteUrl: string | null, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setSprite(spriteUrl, options, (err) => {\n            if (!err) {\n                this._update(true);\n            }\n        });\n        return this;\n    }\n\n    /**\n     * Sets the any combination of light values.\n     *\n     * @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/light).\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * let layerVisibility = map.getLayoutProperty('my-layer', 'visibility');\n     * ```\n     */\n    setLight(light: LightSpecification, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setLight(light, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the light object.\n     *\n     * @returns light Light properties of the style.\n     */\n    getLight(): LightSpecification {\n        return this.style.getLight();\n    }\n\n    /**\n     * Sets the value of style's sky properties.\n     *\n     * @param sky - Sky properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/sky/).\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * map.setSky({'atmosphere-blend': 1.0});\n     * ```\n     */\n    setSky(sky: SkySpecification, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setSky(sky, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the style's sky.\n     *\n     * @returns the sky properties of the style.\n     * @example\n     * ```ts\n     * map.getSky();\n     * ```\n     */\n    getSky(): SkySpecification {\n        return this.style.getSky();\n    }\n\n    /**\n     * Sets the `state` of a feature.\n     * A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.\n     * When using this method, the `state` object is merged with any existing key-value pairs in the feature's state.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * This method can only be used with sources that have a `feature.id` attribute. The `feature.id` attribute can be defined in three ways:\n     *\n     * - For vector or GeoJSON sources, including an `id` attribute in the original data file.\n     * - For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-style-spec/sources/#promoteid) option at the time the source is defined.\n     * - For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#generateid) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.\n     *\n     * !!! note\n     *     You can use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state) to access the values in a feature's state object for the purposes of styling.\n     *\n     * @param feature - Feature identifier. Feature objects returned from\n     * {@link Map.queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @param state - A set of key-value pairs. The values should be valid JSON types.\n     *\n     * @example\n     * ```ts\n     * // When the mouse moves over the `my-layer` layer, update\n     * // the feature state for the feature under the mouse\n     * map.on('mousemove', 'my-layer', (e) => {\n     *   if (e.features.length > 0) {\n     *     map.setFeatureState({\n     *       source: 'my-source',\n     *       sourceLayer: 'my-source-layer',\n     *       id: e.features[0].id,\n     *     }, {\n     *       hover: true\n     *     });\n     *   }\n     * });\n     * ```\n     * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-hover-effect/)\n     */\n    setFeatureState(feature: FeatureIdentifier, state: any): this {\n        this.style.setFeatureState(feature, state);\n        return this._update();\n    }\n\n    /**\n     * Removes the `state` of a feature, setting it back to the default behavior.\n     * If only a `target.source` is specified, it will remove the state for all features from that source.\n     * If `target.id` is also specified, it will remove all keys for that feature's state.\n     * If `key` is also specified, it removes only that key from that feature's state.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * @param target - Identifier of where to remove state. It can be a source, a feature, or a specific key of feature.\n     * Feature objects returned from {@link Map.queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @param key - (optional) The key in the feature state to reset.\n     * @example\n     * Reset the entire state object for all features in the `my-source` source\n     * ```ts\n     * map.removeFeatureState({\n     *   source: 'my-source'\n     * });\n     * ```\n     *\n     * @example\n     * When the mouse leaves the `my-layer` layer,\n     * reset the entire state object for the\n     * feature under the mouse\n     * ```ts\n     * map.on('mouseleave', 'my-layer', (e) => {\n     *   map.removeFeatureState({\n     *     source: 'my-source',\n     *     sourceLayer: 'my-source-layer',\n     *     id: e.features[0].id\n     *   });\n     * });\n     * ```\n     *\n     * @example\n     * When the mouse leaves the `my-layer` layer,\n     * reset only the `hover` key-value pair in the\n     * state for the feature under the mouse\n     * ```ts\n     * map.on('mouseleave', 'my-layer', (e) => {\n     *   map.removeFeatureState({\n     *     source: 'my-source',\n     *     sourceLayer: 'my-source-layer',\n     *     id: e.features[0].id\n     *   }, 'hover');\n     * });\n     * ```\n     */\n    removeFeatureState(target: FeatureIdentifier, key?: string): this {\n        this.style.removeFeatureState(target, key);\n        return this._update();\n    }\n\n    /**\n     * Gets the `state` of a feature.\n     * A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * !!! note\n     *     To access the values in a feature's state object for the purposes of styling the feature, use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state).\n     *\n     * @param feature - Feature identifier. Feature objects returned from\n     * {@link Map.queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @returns The state of the feature: a set of key-value pairs that was assigned to the feature at runtime.\n     *\n     * @example\n     * When the mouse moves over the `my-layer` layer,\n     * get the feature state for the feature under the mouse\n     * ```ts\n     * map.on('mousemove', 'my-layer', (e) => {\n     *   if (e.features.length > 0) {\n     *     map.getFeatureState({\n     *       source: 'my-source',\n     *       sourceLayer: 'my-source-layer',\n     *       id: e.features[0].id\n     *     });\n     *   }\n     * });\n     * ```\n     */\n    getFeatureState(feature: FeatureIdentifier): any {\n        return this.style.getFeatureState(feature);\n    }\n\n    /**\n     * Returns the map's containing HTML element.\n     *\n     * @returns The map's container.\n     */\n    getContainer(): HTMLElement {\n        return this._container;\n    }\n\n    /**\n     * Returns the HTML element containing the map's `<canvas>` element.\n     *\n     * If you want to add non-GL overlays to the map, you should append them to this element.\n     *\n     * This is the element to which event bindings for map interactivity (such as panning and zooming) are\n     * attached. It will receive bubbled events from child elements such as the `<canvas>`, but not from\n     * map controls.\n     *\n     * @returns The container of the map's `<canvas>`.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-point/)\n     */\n    getCanvasContainer(): HTMLElement {\n        return this._canvasContainer;\n    }\n\n    /**\n     * Returns the map's `<canvas>` element.\n     *\n     * @returns The map's `<canvas>` element.\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-the-map-on-a-clicked-symbol/)\n     */\n    getCanvas(): HTMLCanvasElement {\n        return this._canvas;\n    }\n\n    _containerDimensions() {\n        let width = 0;\n        let height = 0;\n\n        if (this._container) {\n            width = this._container.clientWidth || 400;\n            height = this._container.clientHeight || 300;\n        }\n\n        return [width, height];\n    }\n\n    /**\n     * @internal\n     * Sets up the ResizeObserver to track container size changes.\n     * Uses the owning window's ResizeObserver for cross-window support.\n     */\n    private _setupResizeObserver() {\n        let initialResizeEventCaptured = false;\n        const throttledResizeCallback = throttle((entries: ResizeObserverEntry[]) => {\n            if (this._trackResize && !this._removed) {\n                this.resize(entries);\n                this.redraw();\n            }\n        }, 50);\n        // Use owning window's ResizeObserver for cross-window support\n        const ResizeObserverClass = this._ownerWindow.ResizeObserver ?? ResizeObserver;\n        this._resizeObserver = new ResizeObserverClass((entries: ResizeObserverEntry[]) => {\n            if (!initialResizeEventCaptured) {\n                initialResizeEventCaptured = true;\n                return;\n            }\n            throttledResizeCallback(entries);\n        });\n        this._resizeObserver.observe(this._container);\n    }\n\n    /**\n     * @internal\n     * Resolves the container option to an HTMLElement.\n     * Supports string ID, HTMLElement, or cross-window elements (using nodeType check).\n     */\n    private _resolveContainer(container: string | HTMLElement): HTMLElement {\n        if (typeof container === 'string') {\n            const element = document.getElementById(container);\n            if (!element) {\n                throw new Error(`Container '${container}' not found.`);\n            }\n            return element;\n        }\n        if (container instanceof HTMLElement) {\n            return container;\n        }\n        // Cross-window support: use nodeType check as instanceof fails across windows\n        if (container && typeof container === 'object' && (container as Node).nodeType === 1) {\n            return container as HTMLElement;\n        }\n        throw new Error('Invalid type: \\'container\\' must be a String or HTMLElement.');\n    }\n\n    _setupContainer() {\n        const container = this._container;\n        container.classList.add('maplibregl-map');\n\n        const canvasContainer = this._canvasContainer = DOM.create('div', 'maplibregl-canvas-container', container);\n        if (this._interactive) {\n            canvasContainer.classList.add('maplibregl-interactive');\n        }\n\n        this._canvas = DOM.create('canvas', 'maplibregl-canvas', canvasContainer);\n        this._canvas.addEventListener('webglcontextlost', this._contextLost, false);\n        this._canvas.addEventListener('webglcontextrestored', this._contextRestored, false);\n        this._canvas.setAttribute('tabindex', this._interactive ? '0' : '-1');\n        this._canvas.setAttribute('aria-label', this._getUIString('Map.Title'));\n        this._canvas.setAttribute('role', 'region');\n\n        const dimensions = this._containerDimensions();\n        const clampedPixelRatio = this._getClampedPixelRatio(dimensions[0], dimensions[1]);\n        this._resizeCanvas(dimensions[0], dimensions[1], clampedPixelRatio);\n\n        const controlContainer = this._controlContainer = DOM.create('div', 'maplibregl-control-container', container);\n        const positions = this._controlPositions = {};\n        ['top-left', 'top-right', 'bottom-left', 'bottom-right'].forEach((positionName) => {\n            positions[positionName] = DOM.create('div', `maplibregl-ctrl-${positionName} `, controlContainer);\n        });\n\n        this._container.addEventListener('scroll', this._onMapScroll, false);\n    }\n\n    _resizeCanvas(width: number, height: number, pixelRatio: number) {\n        // Request the required canvas size taking the pixelratio into account.\n        this._canvas.width = Math.floor(pixelRatio * width);\n        this._canvas.height = Math.floor(pixelRatio * height);\n\n        // Maintain the same canvas size, potentially downscaling it for HiDPI displays\n        this._canvas.style.width = `${width}px`;\n        this._canvas.style.height = `${height}px`;\n    }\n\n    _setupPainter() {\n\n        // Maplibre WebGL context requires alpha, depth and stencil buffers. It also forces premultipliedAlpha: true.\n        // We use the values provided in the map constructor for the rest of context attributes\n        const attributes = {\n            ...this._canvasContextAttributes,\n            alpha: true,\n            depth: true,\n            stencil: true,\n            premultipliedAlpha: true\n        };\n\n        let webglcontextcreationerrorDetailObject: any = null;\n        this._canvas.addEventListener('webglcontextcreationerror', (args: WebGLContextEvent) => {\n            webglcontextcreationerrorDetailObject = {requestedAttributes: attributes};\n            if (args) {\n                webglcontextcreationerrorDetailObject.statusMessage = args.statusMessage;\n                webglcontextcreationerrorDetailObject.type = args.type;\n            }\n        }, {once: true});\n\n        let gl: WebGL2RenderingContext | WebGLRenderingContext | null = null;\n        if (this._canvasContextAttributes.contextType) {\n            gl = this._canvas.getContext(this._canvasContextAttributes.contextType, attributes) as WebGL2RenderingContext | WebGLRenderingContext;\n        } else {\n            gl = this._canvas.getContext('webgl2', attributes) as WebGL2RenderingContext || this._canvas.getContext('webgl', attributes) as WebGLRenderingContext;\n        }\n\n        if (!gl) {\n            const msg = 'Failed to initialize WebGL';\n            if (webglcontextcreationerrorDetailObject) {\n                webglcontextcreationerrorDetailObject.message = msg;\n                throw new Error(JSON.stringify(webglcontextcreationerrorDetailObject));\n            } else {\n                throw new Error(msg);\n            }\n        }\n\n        this.painter = new Painter(gl, this.transform);\n\n        webpSupported.testSupport(gl);\n    }\n\n    override migrateProjection(newTransform: ITransform, newCameraHelper: ICameraHelper) {\n        super.migrateProjection(newTransform, newCameraHelper);\n        this.painter.transform = newTransform;\n        this.fire(new Event('projectiontransition', {\n            newProjection: this.style.projection.name,\n        }));\n    }\n\n    _contextLost = (event: any) => {\n        event.preventDefault();\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        this.painter.destroy();\n\n        // check if style contains custom layers to warn user that they can't be restored automatically\n        for (const layer of Object.values(this.style._layers)) {\n            if (layer.type === 'custom') {\n                console.warn(`Custom layer with id '${layer.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`);\n            }\n\n            if (layer._listeners) {\n                for (const [event] of Object.entries(layer._listeners)) {\n                    console.warn(`Custom layer with id '${layer.id}' had event listeners for event '${event}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);\n                }\n            }\n        }\n\n        this._lostContextStyle = this._getStyleAndImages();\n        this.style.destroy();\n        this.style = null;\n        this.fire(new Event('webglcontextlost', {originalEvent: event}));\n    };\n\n    _contextRestored = (event: any) => {\n        if (this._lostContextStyle.style) {\n            this.setStyle(this._lostContextStyle.style, {diff: false});\n        }\n\n        if (this._lostContextStyle.images) {\n            this.style.imageManager.images = this._lostContextStyle.images;\n        }\n\n        this._lostContextStyle = {style: null, images: null};\n\n        this._setupPainter();\n        this.resize();\n        this._update();\n        this._resizeInternal();\n        this.fire(new Event('webglcontextrestored', {originalEvent: event}));\n    };\n\n    _onMapScroll = (event: any) => {\n        if (event.target !== this._container) return;\n\n        // Revert any scroll which would move the canvas outside of the view\n        this._container.scrollTop = 0;\n        this._container.scrollLeft = 0;\n        return false;\n    };\n\n    /**\n     * Returns a Boolean indicating whether the map is fully loaded.\n     *\n     * Returns `false` if the style is not yet fully loaded,\n     * or if there has been a change to the sources or style that\n     * has not yet fully loaded.\n     *\n     * @returns A Boolean indicating whether the map is fully loaded.\n     */\n    loaded(): boolean {\n        return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded();\n    }\n\n    /**\n     * @internal\n     * Update this map's style and sources, and re-render the map.\n     *\n     * @param updateStyle - mark the map's style for reprocessing as\n     * well as its sources\n     */\n    _update(updateStyle?: boolean) {\n        if (!this.style || !this.style._loaded) return this;\n\n        this._styleDirty = this._styleDirty || updateStyle;\n        this._sourcesDirty = true;\n        this.triggerRepaint();\n\n        return this;\n    }\n\n    /**\n     * @internal\n     * Request that the given callback be executed during the next render\n     * frame.  Schedule a render frame if one is not already scheduled.\n     *\n     * @returns An id that can be used to cancel the callback\n     */\n    _requestRenderFrame(callback: () => void): TaskID {\n        this._update();\n        return this._renderTaskQueue.add(callback);\n    }\n\n    _cancelRenderFrame(id: TaskID) {\n        this._renderTaskQueue.remove(id);\n    }\n\n    /**\n     * @internal\n     * Call when a (re-)render of the map is required:\n     *\n     * - The style has changed (`setPaintProperty()`, etc.)\n     * - Source data has changed (e.g. tiles have finished loading)\n     * - The map has is moving (or just finished moving)\n     * - A transition is in progress\n     *\n     * @param paintStartTimeStamp - The time when the animation frame began executing.\n     */\n    _render(paintStartTimeStamp: number) {\n        const fadeDuration = this._idleTriggered ? this._fadeDuration : 0;\n\n        const isGlobeRendering = this.style.projection?.transitionState > 0;\n\n        // A custom layer may have used the context asynchronously. Mark the state as dirty.\n        this.painter.context.setDirty();\n        this.painter.setBaseState();\n\n        this._renderTaskQueue.run(paintStartTimeStamp);\n        // A task queue callback may have fired a user event which may have removed the map\n        if (this._removed) return;\n\n        let crossFading = false;\n\n        // If the style has changed, the map is being zoomed, or a transition or fade is in progress:\n        //  - Apply style changes (in a batch)\n        //  - Recalculate paint properties.\n        if (this.style && this._styleDirty) {\n            this._styleDirty = false;\n\n            const zoom = this.transform.zoom;\n            const currentTime = now();\n            this.style.zoomHistory.update(zoom, currentTime);\n\n            const parameters = new EvaluationParameters(zoom, {\n                now: currentTime,\n                fadeDuration,\n                zoomHistory: this.style.zoomHistory,\n                transition: this.style.getTransition()\n            });\n\n            const factor = parameters.crossFadingFactor();\n            if (factor !== 1 || factor !== this._crossFadingFactor) {\n                crossFading = true;\n                this._crossFadingFactor = factor;\n            }\n\n            this.style.update(parameters);\n        }\n\n        const globeRenderingChanged = this.style.projection?.transitionState > 0 !== isGlobeRendering;\n        this.style.projection?.setErrorQueryLatitudeDegrees(this.transform.center.lat);\n        this.transform.setTransitionState(this.style.projection?.transitionState, this.style.projection?.latitudeErrorCorrectionRadians);\n\n        // If we are in _render for any reason other than an in-progress paint\n        // transition, update tile managers to check for and load any tiles we\n        // need for the current transform\n        if (this.style && (this._sourcesDirty || globeRenderingChanged)) {\n            this._sourcesDirty = false;\n            this.style._updateSources(this.transform);\n        }\n\n        // update terrain stuff\n        if (this.terrain) {\n            this.terrain.tileManager.update(this.transform, this.terrain);\n            this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            if (!this._elevationFreeze && this._centerClampedToGround) {\n                this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom));\n            }\n        } else {\n            this.transform.setMinElevationForCurrentTile(0);\n            if (this._centerClampedToGround) {\n                this.transform.setElevation(0);\n            }\n        }\n\n        this._placementDirty = this.style && this.style._updatePlacement(this.transform, this.showCollisionBoxes, fadeDuration, this._crossSourceCollisions, globeRenderingChanged);\n\n        // Actually draw\n        this.painter.render(this.style, {\n            showTileBoundaries: this.showTileBoundaries,\n            showOverdrawInspector: this._showOverdrawInspector,\n            rotating: this.isRotating(),\n            zooming: this.isZooming(),\n            moving: this.isMoving(),\n            fadeDuration,\n            showPadding: this.showPadding,\n        });\n\n        this.fire(new Event('render'));\n\n        if (this.loaded() && !this._loaded) {\n            this._loaded = true;\n            PerformanceUtils.mark(PerformanceMarkers.load);\n            this.fire(new Event('load'));\n        }\n\n        if (this.style && (this.style.hasTransitions() || crossFading)) {\n            this._styleDirty = true;\n        }\n\n        if (this.style && !this._placementDirty) {\n            // Since no fade operations are in progress, we can release\n            // all tiles held for fading. If we didn't do this, the tiles\n            // would just sit in the TileManagers until the next render\n            this.style._releaseSymbolFadeTiles();\n        }\n\n        // Schedule another render frame if it's needed.\n        //\n        // Even though `_styleDirty` and `_sourcesDirty` are reset in this\n        // method, synchronous events fired during Style.update or\n        // Style._updateSources could have caused them to be set again.\n        const somethingDirty = this._sourcesDirty || this._styleDirty || this._placementDirty;\n        if (somethingDirty || this._repaint) {\n            this.triggerRepaint();\n        } else if (!this.isMoving() && this.loaded()) {\n            this.fire(new Event('idle'));\n        }\n\n        if (this._loaded && !this._fullyLoaded && !somethingDirty) {\n            this._fullyLoaded = true;\n            PerformanceUtils.mark(PerformanceMarkers.fullLoad);\n        }\n\n        return this;\n    }\n\n    /**\n     * Force a synchronous redraw of the map.\n     * @example\n     * ```ts\n     * map.redraw();\n     * ```\n     */\n    redraw(): this {\n        if (this.style) {\n            // cancel the scheduled update\n            if (this._frameRequest) {\n                this._frameRequest.abort();\n                this._frameRequest = null;\n            }\n            this._render(0);\n        }\n        return this;\n    }\n\n    /**\n     * Clean up and release all internal resources associated with this map.\n     *\n     * This includes DOM elements, event bindings, web workers, and WebGL resources.\n     *\n     * Use this method when you are done using the map and wish to ensure that it no\n     * longer consumes browser resources. Afterwards, you must not call any other\n     * methods on the map.\n     */\n    remove() {\n        if (this._hash) this._hash.remove();\n\n        for (const control of this._controls) control.onRemove(this);\n        this._controls = [];\n\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        this._renderTaskQueue.clear();\n        this.painter.destroy();\n        this.handlers.destroy();\n        delete this.handlers;\n        this.setStyle(null);\n        if (typeof window !== 'undefined') {\n            this._ownerWindow.removeEventListener('online', this._onWindowOnline, false);\n        }\n\n        ImageRequest.removeThrottleControl(this._imageQueueHandle);\n\n        this._resizeObserver?.disconnect();\n        const extension = this.painter.context.gl.getExtension('WEBGL_lose_context');\n        if (extension?.loseContext) extension.loseContext();\n        this._canvas.removeEventListener('webglcontextrestored', this._contextRestored, false);\n        this._canvas.removeEventListener('webglcontextlost', this._contextLost, false);\n        DOM.remove(this._canvasContainer);\n        DOM.remove(this._controlContainer);\n        this._container.removeEventListener('scroll', this._onMapScroll, false);\n        this._container.classList.remove('maplibregl-map');\n\n        PerformanceUtils.clearMetrics();\n\n        this._removed = true;\n        this.fire(new Event('remove'));\n    }\n\n    /**\n     * Trigger the rendering of a single frame. Use this method with custom layers to\n     * repaint the map when the layer changes. Calling this multiple times before the\n     * next frame is rendered will still result in only a single frame being rendered.\n     * @example\n     * ```ts\n     * map.triggerRepaint();\n     * ```\n     * @see [Add a 3D model](https://maplibre.org/maplibre-gl-js/docs/examples/add-a-3d-model-using-threejs/)\n     * @see [Add an animated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-an-animated-icon-to-the-map/)\n     */\n    triggerRepaint() {\n        if (this.style && !this._frameRequest) {\n            this._frameRequest = new AbortController();\n            browser.frame(\n                this._frameRequest,\n                (paintStartTimeStamp) => {\n                    PerformanceUtils.frame(paintStartTimeStamp);\n                    this._frameRequest = null;\n                    try {\n                        this._render(paintStartTimeStamp);\n                    } catch(error) {\n                        if (!isAbortError(error) && !isFramebufferNotCompleteError(error)) {\n                            throw error;\n                        }\n                    }\n                },\n                () => {},\n                this._ownerWindow\n            );\n        }\n    }\n\n    _onWindowOnline = () => {\n        this._update();\n    };\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will render an outline\n     * around each tile and the tile ID. These tile boundaries are useful for\n     * debugging.\n     *\n     * The uncompressed file size of the first vector source is drawn in the top left\n     * corner of each tile, next to the tile ID.\n     *\n     * @example\n     * ```ts\n     * map.showTileBoundaries = true;\n     * ```\n     */\n    get showTileBoundaries(): boolean { return !!this._showTileBoundaries; }\n    set showTileBoundaries(value: boolean) {\n        if (this._showTileBoundaries === value) return;\n        this._showTileBoundaries = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will visualize\n     * the padding offsets.\n     */\n    get showPadding(): boolean { return !!this._showPadding; }\n    set showPadding(value: boolean) {\n        if (this._showPadding === value) return;\n        this._showPadding = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will render boxes\n     * around all symbols in the data source, revealing which symbols\n     * were rendered or which were hidden due to collisions.\n     * This information is useful for debugging.\n     */\n    get showCollisionBoxes(): boolean { return !!this._showCollisionBoxes; }\n    set showCollisionBoxes(value: boolean) {\n        if (this._showCollisionBoxes === value) return;\n        this._showCollisionBoxes = value;\n        if (value) {\n            // When we turn collision boxes on we have to generate them for existing tiles\n            // When we turn them off, there's no cost to leaving existing boxes in place\n            this.style._generateCollisionBoxes();\n        } else {\n            // Otherwise, call an update to remove collision boxes\n            this._update();\n        }\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map should color-code\n     * each fragment to show how many times it has been shaded.\n     * White fragments have been shaded 8 or more times.\n     * Black fragments have been shaded 0 times.\n     * This information is useful for debugging.\n     */\n    get showOverdrawInspector(): boolean { return !!this._showOverdrawInspector; }\n    set showOverdrawInspector(value: boolean) {\n        if (this._showOverdrawInspector === value) return;\n        this._showOverdrawInspector = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will\n     * continuously repaint. This information is useful for analyzing performance.\n     */\n    get repaint(): boolean { return !!this._repaint; }\n    set repaint(value: boolean) {\n        if (this._repaint !== value) {\n            this._repaint = value;\n            this.triggerRepaint();\n        }\n    }\n    // show vertices\n    get vertices(): boolean { return !!this._vertices; }\n    set vertices(value: boolean) { this._vertices = value; this._update(); }\n\n    /**\n     * Returns the package version of the library\n     * @returns Package version of the library\n     */\n    get version(): string {\n        return version;\n    }\n\n    /**\n     * Returns the elevation for the point where the camera is looking.\n     * This value corresponds to:\n     * \"meters above sea level\" * \"exaggeration\"\n     * @returns The elevation.\n     */\n    getCameraTargetElevation(): number {\n        return this.transform.elevation;\n    }\n\n    /**\n     * Gets the {@link ProjectionSpecification}.\n     * @returns the projection specification.\n     * @example\n     * ```ts\n     * let projection = map.getProjection();\n     * ```\n     */\n    getProjection(): ProjectionSpecification { return this.style.getProjection(); }\n\n    /**\n     * Sets the {@link ProjectionSpecification}.\n     * @param projection - the projection specification to set\n     * @returns\n     */\n    setProjection(projection: ProjectionSpecification) {\n        this._lazyInitEmptyStyle();\n        this.style.setProjection(projection);\n        return this._update(true);\n    }\n}\n","import Point from '@mapbox/point-geometry';\n\nimport {DOM} from '../../util/dom';\nimport {extend, getAngleDelta} from '../../util/util';\nimport {DragHandler, type DragMoveHandler, type DragRotateResult} from '../handler/drag_handler';\nimport {MouseOrTouchMoveStateManager} from '../handler/drag_move_state_manager';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * The {@link NavigationControl} options object\n */\nexport type NavigationControlOptions = {\n    /**\n     * If `true` the compass button is included.\n     */\n    showCompass?: boolean;\n    /**\n     * If `true` the zoom-in and zoom-out buttons are included.\n     */\n    showZoom?: boolean;\n    /**\n     * If `true` the pitch is visualized by rotating X-axis of compass.\n     */\n    visualizePitch?: boolean;\n    /**\n     * If `true` the roll is visualized by rotating the compass.\n     */\n    visualizeRoll?: boolean;\n};\n\nconst defaultOptions: NavigationControlOptions = {\n    showCompass: true,\n    showZoom: true,\n    visualizePitch: false,\n    visualizeRoll: true\n};\n\n/**\n * A `NavigationControl` control contains zoom buttons and a compass.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let nav = new NavigationControl();\n * map.addControl(nav, 'top-left');\n * ```\n * @see [Display map navigation controls](https://maplibre.org/maplibre-gl-js/docs/examples/display-map-navigation-controls/)\n */\nexport class NavigationControl implements IControl {\n    _map: Map;\n    options: NavigationControlOptions;\n    _container: HTMLElement;\n    _zoomInButton: HTMLButtonElement;\n    _zoomOutButton: HTMLButtonElement;\n    _compass: HTMLButtonElement;\n    _compassIcon: HTMLElement;\n    _handler: MouseRotateWrapper;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options?: NavigationControlOptions) {\n        this.options = extend({}, defaultOptions, options);\n\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._container.addEventListener('contextmenu', (e) => e.preventDefault());\n\n        if (this.options.showZoom) {\n            this._zoomInButton = this._createButton('maplibregl-ctrl-zoom-in', (e) => this._map.zoomIn({}, {originalEvent: e}));\n            DOM.create('span', 'maplibregl-ctrl-icon', this._zoomInButton).setAttribute('aria-hidden', 'true');\n            this._zoomOutButton = this._createButton('maplibregl-ctrl-zoom-out', (e) => this._map.zoomOut({}, {originalEvent: e}));\n            DOM.create('span', 'maplibregl-ctrl-icon', this._zoomOutButton).setAttribute('aria-hidden', 'true');\n        }\n        if (this.options.showCompass) {\n            this._compass = this._createButton('maplibregl-ctrl-compass', (e) => {\n                if (this.options.visualizePitch) {\n                    this._map.resetNorthPitch({}, {originalEvent: e});\n                } else {\n                    this._map.resetNorth({}, {originalEvent: e});\n                }\n            });\n            this._compassIcon = DOM.create('span', 'maplibregl-ctrl-icon', this._compass);\n            this._compassIcon.setAttribute('aria-hidden', 'true');\n        }\n    }\n\n    _updateZoomButtons = () => {\n        const zoom = this._map.getZoom();\n        const isMax = zoom === this._map.getMaxZoom();\n        const isMin = zoom === this._map.getMinZoom();\n        this._zoomInButton.disabled = isMax;\n        this._zoomOutButton.disabled = isMin;\n        this._zoomInButton.setAttribute('aria-disabled', isMax.toString());\n        this._zoomOutButton.setAttribute('aria-disabled', isMin.toString());\n    };\n\n    _rotateCompassArrow = () => {\n        if (this.options.visualizePitch && this.options.visualizeRoll) {\n            this._compassIcon.style.transform = `scale(${1 / Math.pow(Math.cos(this._map.transform.pitchInRadians), 0.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`;\n            return;\n        }\n        if (this.options.visualizePitch) {\n            this._compassIcon.style.transform = `scale(${1 / Math.pow(Math.cos(this._map.transform.pitchInRadians), 0.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`;\n            return;\n        }\n        if (this.options.visualizeRoll) {\n            this._compassIcon.style.transform = `rotate(${-this._map.transform.bearing - this._map.transform.roll}deg)`;\n            return;\n        }\n        this._compassIcon.style.transform = `rotate(${-this._map.transform.bearing}deg)`;\n    };\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        if (this.options.showZoom) {\n            this._setButtonTitle(this._zoomInButton, 'ZoomIn');\n            this._setButtonTitle(this._zoomOutButton, 'ZoomOut');\n            this._map.on('zoom', this._updateZoomButtons);\n            this._updateZoomButtons();\n        }\n        if (this.options.showCompass) {\n            this._setButtonTitle(this._compass, 'ResetBearing');\n            if (this.options.visualizePitch) {\n                this._map.on('pitch', this._rotateCompassArrow);\n            }\n            if (this.options.visualizeRoll) {\n                this._map.on('roll', this._rotateCompassArrow);\n            }\n            this._map.on('rotate', this._rotateCompassArrow);\n            this._rotateCompassArrow();\n            this._handler = new MouseRotateWrapper(this._map, this._compass, this.options.visualizePitch);\n        }\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        if (this.options.showZoom) {\n            this._map.off('zoom', this._updateZoomButtons);\n        }\n        if (this.options.showCompass) {\n            if (this.options.visualizePitch) {\n                this._map.off('pitch', this._rotateCompassArrow);\n            }\n            if (this.options.visualizeRoll) {\n                this._map.off('roll', this._rotateCompassArrow);\n            }\n            this._map.off('rotate', this._rotateCompassArrow);\n            this._handler.off();\n            delete this._handler;\n        }\n\n        delete this._map;\n    }\n\n    _createButton(className: string, fn: (e?: any) => unknown) {\n        const a = DOM.create('button', className, this._container) as HTMLButtonElement;\n        a.type = 'button';\n        a.addEventListener('click', fn);\n        return a;\n    }\n\n    _setButtonTitle = (button: HTMLButtonElement, title: 'ZoomIn' | 'ZoomOut' | 'ResetBearing') => {\n        const str = this._map._getUIString(`NavigationControl.${title}`);\n        button.title = str;\n        button.setAttribute('aria-label', str);\n    };\n}\n\nclass MouseRotateWrapper {\n\n    map: Map;\n    _clickTolerance: number;\n    element: HTMLElement;\n    _rotatePitchHandler: DragMoveHandler<DragRotateResult, MouseEvent | TouchEvent>;\n    _startPos: Point;\n    _lastPos: Point;\n\n    constructor(map: Map, element: HTMLElement, pitch: boolean = false) {\n        this._clickTolerance = 10;\n        this.element = element;\n        \n        const moveStateManager = new MouseOrTouchMoveStateManager();\n        this._rotatePitchHandler = new DragHandler<DragRotateResult, MouseEvent | TouchEvent>({\n            clickTolerance: 3,\n            move: (lastPoint: Point, currentPoint: Point) => {\n                const rect = element.getBoundingClientRect();\n                const center = new Point((rect.bottom - rect.top) / 2, (rect.right - rect.left) / 2);\n                const bearingDelta = getAngleDelta(new Point(lastPoint.x, currentPoint.y), currentPoint, center);\n                const pitchDelta = pitch ? (currentPoint.y - lastPoint.y) * -0.5 : undefined;\n                return {bearingDelta, pitchDelta};\n            },\n            moveStateManager,\n            enable: true,\n            assignEvents: () => {},\n        });\n        this.map = map;\n\n        DOM.addEventListener(element, 'mousedown', this.mousedown);\n        DOM.addEventListener(element, 'touchstart', this.touchstart, {passive: false});\n        DOM.addEventListener(element, 'touchcancel', this.reset);\n    }\n\n    startMove(e: MouseEvent | TouchEvent, point: Point) {\n        this._rotatePitchHandler.dragStart(e, point);\n        DOM.disableDrag();\n    }\n\n    move(e: MouseEvent | TouchEvent, point: Point) {\n        const map = this.map;\n        const {bearingDelta, pitchDelta} = this._rotatePitchHandler.dragMove(e, point) || {};\n        if (bearingDelta) map.setBearing(map.getBearing() + bearingDelta);\n        if (pitchDelta) map.setPitch(map.getPitch() + pitchDelta);\n    }\n\n    off() {\n        const element = this.element;\n        DOM.removeEventListener(element, 'mousedown', this.mousedown);\n        DOM.removeEventListener(element, 'touchstart', this.touchstart, {passive: false});\n        DOM.removeEventListener(window, 'touchmove', this.touchmove, {passive: false});\n        DOM.removeEventListener(window, 'touchend', this.touchend);\n        DOM.removeEventListener(element, 'touchcancel', this.reset);\n        this.offTemp();\n    }\n\n    offTemp() {\n        DOM.enableDrag();\n        DOM.removeEventListener(window, 'mousemove', this.mousemove);\n        DOM.removeEventListener(window, 'mouseup', this.mouseup);\n        DOM.removeEventListener(window, 'touchmove', this.touchmove, {passive: false});\n        DOM.removeEventListener(window, 'touchend', this.touchend);\n    }\n\n    mousedown = (e: MouseEvent) => {\n        this.startMove(e, DOM.mousePos(this.element, e));\n        DOM.addEventListener(window, 'mousemove', this.mousemove);\n        DOM.addEventListener(window, 'mouseup', this.mouseup);\n    };\n\n    mousemove = (e: MouseEvent) => {\n        this.move(e, DOM.mousePos(this.element, e));\n    };\n\n    mouseup = (e: MouseEvent) => {\n        this._rotatePitchHandler.dragEnd(e);\n        this.offTemp();\n    };\n\n    touchstart = (e: TouchEvent) => {\n        if (e.targetTouches.length !== 1) {\n            this.reset();\n        } else {\n            this._startPos = this._lastPos = DOM.touchPos(this.element, e.targetTouches)[0];\n            this.startMove(e, this._startPos);\n            DOM.addEventListener(window, 'touchmove', this.touchmove, {passive: false});\n            DOM.addEventListener(window, 'touchend', this.touchend);\n        }\n    };\n\n    touchmove = (e: TouchEvent) => {\n        if (e.targetTouches.length !== 1) {\n            this.reset();\n        } else {\n            this._lastPos = DOM.touchPos(this.element, e.targetTouches)[0];\n            this.move(e, this._lastPos);\n        }\n    };\n\n    touchend = (e: TouchEvent) => {\n        if (e.targetTouches.length === 0 &&\n            this._startPos &&\n            this._lastPos &&\n            this._startPos.dist(this._lastPos) < this._clickTolerance) {\n            this.element.click();\n        }\n        delete this._startPos;\n        delete this._lastPos;\n        this.offTemp();\n    };\n\n    reset = () => {\n        this._rotatePitchHandler.reset();\n        delete this._startPos;\n        delete this._lastPos;\n        this.offTemp();\n    };\n}\n","let supportsGeolocation;\n\nexport async function checkGeolocationSupport(forceRecalculation = false): Promise<boolean> {\n    if (supportsGeolocation !== undefined && !forceRecalculation) {\n        return supportsGeolocation;\n    }\n    if (window.navigator.permissions === undefined) {\n        supportsGeolocation = !!window.navigator.geolocation;\n        return supportsGeolocation;\n    }\n    // navigator.permissions has incomplete browser support\n    // https://caniuse.com/#feat=permissions-api\n    // Test for the case where a browser disables Geolocation because of an\n    // insecure origin\n    try {\n        const permissions = await window.navigator.permissions.query({name: 'geolocation'});\n        supportsGeolocation = permissions.state !== 'denied';\n    } catch {\n        // Fix for iOS16 which rejects query but still supports geolocation\n        supportsGeolocation = !!window.navigator.geolocation;\n    }\n    return supportsGeolocation;\n}\n","import {LngLat} from '../geo/lng_lat';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {IReadonlyTransform} from '../geo/transform_interface';\n\n/**\n * Given a LngLat, prior projected position, and a transform, return a new LngLat shifted\n * n Ã 360Â° east or west for some n â¥ 0 such that:\n *\n * * the projected location of the result is on screen, if possible, and secondarily:\n * * the difference between the projected location of the result and the prior position\n *   is minimized.\n *\n * The object is to preserve perceived object constancy for Popups and Markers as much as\n * possible; they should avoid shifting large distances across the screen, even when the\n * map center changes by Â±360Â° due to automatic wrapping, and when about to go off screen,\n * should wrap just enough to avoid doing so.\n */\nexport function smartWrap(lngLat: LngLat, priorPos: Point, transform: IReadonlyTransform, useNormalWrap: boolean = false): LngLat {\n    if (useNormalWrap || !transform.getCoveringTilesDetailsProvider().allowWorldCopies()) {\n        return lngLat?.wrap();\n    }\n    const originalLngLat = new LngLat(lngLat.lng, lngLat.lat);\n    lngLat = new LngLat(lngLat.lng, lngLat.lat);\n\n    // First, try shifting one world in either direction, and see if either is closer to the\n    // prior position. This preserves object constancy when the map center is auto-wrapped\n    // during animations.\n    if (priorPos) {\n        const left  = new LngLat(lngLat.lng - 360, lngLat.lat);\n        const right = new LngLat(lngLat.lng + 360, lngLat.lat);\n        const delta = transform.locationToScreenPoint(lngLat).distSqr(priorPos);\n        if (transform.locationToScreenPoint(left).distSqr(priorPos) < delta) {\n            lngLat = left;\n        } else if (transform.locationToScreenPoint(right).distSqr(priorPos) < delta) {\n            lngLat = right;\n        }\n    }\n\n    // Second, wrap toward the center until the new position is on screen, or we can't get\n    // any closer.\n    while (Math.abs(lngLat.lng - transform.center.lng) > 180) {\n        const pos = transform.locationToScreenPoint(lngLat);\n        if (pos.x >= 0 && pos.y >= 0 && pos.x <= transform.width && pos.y <= transform.height) {\n            break;\n        }\n        if (lngLat.lng > transform.center.lng) {\n            lngLat.lng -= 360;\n        } else {\n            lngLat.lng += 360;\n        }\n    }\n\n    // Apply the change only if new coord is below horizon\n    if (lngLat.lng !== originalLngLat.lng && transform.isPointOnMapSurface(transform.locationToScreenPoint(lngLat))) {\n        return lngLat;\n    }\n\n    return originalLngLat;\n}\n","/**\n * Where to position the anchor.\n * Used by a popup and a marker.\n */\nexport type PositionAnchor = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\nexport const anchorTranslate: {\n    [_ in PositionAnchor]: string;\n} = {\n    'center': 'translate(-50%,-50%)',\n    'top': 'translate(-50%,0)',\n    'top-left': 'translate(0,0)',\n    'top-right': 'translate(-100%,0)',\n    'bottom': 'translate(-50%,-100%)',\n    'bottom-left': 'translate(0,-100%)',\n    'bottom-right': 'translate(-100%,-100%)',\n    'left': 'translate(0,-50%)',\n    'right': 'translate(-100%,-50%)'\n};\n\nexport function applyAnchorClass(element: HTMLElement, anchor: PositionAnchor, prefix: string) {\n    const classList = element.classList;\n    for (const key in anchorTranslate) {\n        classList.remove(`maplibregl-${prefix}-anchor-${key}`);\n    }\n    classList.add(`maplibregl-${prefix}-anchor-${anchor}`);\n}\n","import {DOM} from '../util/dom';\nimport {browser} from '../util/browser';\nimport {LngLat} from '../geo/lng_lat';\nimport Point from '@mapbox/point-geometry';\nimport {smartWrap} from '../util/smart_wrap';\nimport {anchorTranslate, applyAnchorClass} from './anchor';\nimport type {PositionAnchor} from './anchor';\nimport {Event, Evented} from '../util/evented';\nimport type {Map} from './map';\nimport {type Popup, type Offset} from './popup';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {MapMouseEvent, MapTouchEvent} from './events';\nimport type {PointLike} from './camera';\n\n/**\n * Alignment options of rotation and pitch\n */\nexport type Alignment = 'map' | 'viewport' | 'auto';\n\n/**\n * The {@link Marker} options object\n */\nexport type MarkerOptions = {\n    /**\n     * DOM element to use as a marker. The default is a light blue, droplet-shaped SVG marker.\n     */\n    element?: HTMLElement;\n    /**\n     * Space-separated CSS class names to add to marker element.\n     */\n    className?: string;\n    /**\n     * The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.\n     */\n    offset?: PointLike;\n    /**\n     * A string indicating the part of the Marker that should be positioned closest to the coordinate set via {@link Marker.setLngLat}.\n     * Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`.\n     * @defaultValue 'center'\n     * */\n    anchor?: PositionAnchor;\n    /**\n     * The color to use for the default marker if options.element is not provided. The default is light blue.\n     * @defaultValue '#3FB1CE'\n     */\n    color?: string;\n    /**\n     * The scale to use for the default marker if options.element is not provided. The default scale corresponds to a height of `41px` and a width of `27px`.\n     * @defaultValue 1\n     */\n    scale?: number;\n    /**\n     * A boolean indicating whether or not a marker is able to be dragged to a new position on the map.\n     * @defaultValue false\n     */\n    draggable?: boolean;\n    /**\n     * The max number of pixels a user can shift the mouse pointer during a click on the marker for it to be considered a valid click (as opposed to a marker drag). The default is to inherit map's clickTolerance.\n     * @defaultValue 0\n     */\n    clickTolerance?: number;\n    /**\n     * The rotation angle of the marker in degrees, relative to its respective `rotationAlignment` setting. A positive value will rotate the marker clockwise.\n     * @defaultValue 0\n     */\n    rotation?: number;\n    /**\n     * `map` aligns the `Marker`'s rotation relative to the map, maintaining a bearing as the map rotates. `viewport` aligns the `Marker`'s rotation relative to the viewport, agnostic to map rotations. `auto` is equivalent to `viewport`.\n     * @defaultValue 'auto'\n     */\n    rotationAlignment?: Alignment;\n    /**\n     * `map` aligns the `Marker` to the plane of the map. `viewport` aligns the `Marker` to the plane of the viewport. `auto` automatically matches the value of `rotationAlignment`.\n     * @defaultValue 'auto'\n     */\n    pitchAlignment?: Alignment;\n    /**\n     * Marker's opacity when it's in clear view (not behind 3d terrain)\n     * @defaultValue 1\n     */\n    opacity?: string;\n    /**\n     * Marker's opacity when it's behind 3d terrain\n     * @defaultValue 0.2\n     */\n    opacityWhenCovered?: string;\n    /**\n      * If `true`, rounding is disabled for placement of the marker, allowing for\n      * subpixel positioning and smoother movement when the marker is translated.\n      * @defaultValue false\n      */\n    subpixelPositioning?: boolean;\n};\n\n/**\n * Creates a marker component\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let marker = new Marker()\n *   .setLngLat([30.5, 50.5])\n *   .addTo(map);\n * ```\n *\n * @example\n * Set options\n * ```ts\n * let marker = new Marker({\n *     color: \"#FFFFFF\",\n *     draggable: true\n *   }).setLngLat([30.5, 50.5])\n *   .addTo(map);\n * ```\n * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/add-custom-icons-with-markers/)\n * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-marker/)\n *\n * ## Events\n *\n * **Event** `dragstart` of type {@link Event} will be fired when dragging starts.\n *\n * **Event** `drag` of type {@link Event} will be fired while dragging.\n *\n * **Event** `dragend` of type {@link Event} will be fired when the marker is finished being dragged.\n */\nexport class Marker extends Evented {\n    _map: Map;\n    _anchor: PositionAnchor;\n    _offset: Point;\n    _element: HTMLElement;\n    _popup: Popup;\n    _lngLat: LngLat;\n    _pos: Point;\n    _flatPos: Point;\n    _color: string;\n    _scale: number;\n    _defaultMarker: boolean;\n    _draggable: boolean;\n    _clickTolerance: number;\n    _isDragging: boolean;\n    _state: 'inactive' | 'pending' | 'active'; // used for handling drag events\n    _positionDelta: Point;\n    _pointerdownPos: Point;\n    _rotation: number;\n    _pitchAlignment: Alignment;\n    _rotationAlignment: Alignment;\n    _originalTabIndex: string; // original tabindex of _element\n    _opacity: string;\n    _opacityWhenCovered: string;\n    _opacityTimeout: ReturnType<typeof setTimeout>;\n    _subpixelPositioning: boolean;\n\n    /**\n     * @param options - the options\n     */\n    constructor(options?: MarkerOptions) {\n        super();\n\n        this._anchor = options && options.anchor || 'center';\n        this._color = options && options.color || '#3FB1CE';\n        this._scale = options && options.scale || 1;\n        this._draggable = options && options.draggable || false;\n        this._clickTolerance = options && options.clickTolerance || 0;\n        this._subpixelPositioning = options && options.subpixelPositioning || false;\n        this._isDragging = false;\n        this._state = 'inactive';\n        this._rotation = options && options.rotation || 0;\n        this._rotationAlignment = options && options.rotationAlignment || 'auto';\n        this._pitchAlignment = options && options.pitchAlignment && options.pitchAlignment !== 'auto' ?  options.pitchAlignment : this._rotationAlignment;\n        this.setOpacity(options?.opacity, options?.opacityWhenCovered);\n\n        if (!options || !options.element) {\n            this._defaultMarker = true;\n            this._element = DOM.create('div');\n\n            // create default map marker SVG\n            const svg = DOM.createNS('http://www.w3.org/2000/svg', 'svg');\n            const defaultHeight = 41;\n            const defaultWidth = 27;\n            svg.setAttributeNS(null, 'display', 'block');\n            svg.setAttributeNS(null, 'height', `${defaultHeight}px`);\n            svg.setAttributeNS(null, 'width', `${defaultWidth}px`);\n            svg.setAttributeNS(null, 'viewBox', `0 0 ${defaultWidth} ${defaultHeight}`);\n\n            const markerLarge = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            markerLarge.setAttributeNS(null, 'stroke', 'none');\n            markerLarge.setAttributeNS(null, 'stroke-width', '1');\n            markerLarge.setAttributeNS(null, 'fill', 'none');\n            markerLarge.setAttributeNS(null, 'fill-rule', 'evenodd');\n\n            const page1 = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            page1.setAttributeNS(null, 'fill-rule', 'nonzero');\n\n            const shadow = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            shadow.setAttributeNS(null, 'transform', 'translate(3.0, 29.0)');\n            shadow.setAttributeNS(null, 'fill', '#000000');\n\n            const ellipses = [\n                {'rx': '10.5', 'ry': '5.25002273'},\n                {'rx': '10.5', 'ry': '5.25002273'},\n                {'rx': '9.5', 'ry': '4.77275007'},\n                {'rx': '8.5', 'ry': '4.29549936'},\n                {'rx': '7.5', 'ry': '3.81822308'},\n                {'rx': '6.5', 'ry': '3.34094679'},\n                {'rx': '5.5', 'ry': '2.86367051'},\n                {'rx': '4.5', 'ry': '2.38636864'}\n            ];\n\n            for (const data of ellipses) {\n                const ellipse = DOM.createNS('http://www.w3.org/2000/svg', 'ellipse');\n                ellipse.setAttributeNS(null, 'opacity', '0.04');\n                ellipse.setAttributeNS(null, 'cx', '10.5');\n                ellipse.setAttributeNS(null, 'cy', '5.80029008');\n                ellipse.setAttributeNS(null, 'rx', data['rx']);\n                ellipse.setAttributeNS(null, 'ry', data['ry']);\n                shadow.appendChild(ellipse);\n            }\n\n            const background = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            background.setAttributeNS(null, 'fill', this._color);\n\n            const bgPath = DOM.createNS('http://www.w3.org/2000/svg', 'path');\n            bgPath.setAttributeNS(null, 'd', 'M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z');\n\n            background.appendChild(bgPath);\n\n            const border = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            border.setAttributeNS(null, 'opacity', '0.25');\n            border.setAttributeNS(null, 'fill', '#000000');\n\n            const borderPath = DOM.createNS('http://www.w3.org/2000/svg', 'path');\n            borderPath.setAttributeNS(null, 'd', 'M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z');\n\n            border.appendChild(borderPath);\n\n            const maki = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            maki.setAttributeNS(null, 'transform', 'translate(6.0, 7.0)');\n            maki.setAttributeNS(null, 'fill', '#FFFFFF');\n\n            const circleContainer = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            circleContainer.setAttributeNS(null, 'transform', 'translate(8.0, 8.0)');\n\n            const circle1 = DOM.createNS('http://www.w3.org/2000/svg', 'circle');\n            circle1.setAttributeNS(null, 'fill', '#000000');\n            circle1.setAttributeNS(null, 'opacity', '0.25');\n            circle1.setAttributeNS(null, 'cx', '5.5');\n            circle1.setAttributeNS(null, 'cy', '5.5');\n            circle1.setAttributeNS(null, 'r', '5.4999962');\n\n            const circle2 = DOM.createNS('http://www.w3.org/2000/svg', 'circle');\n            circle2.setAttributeNS(null, 'fill', '#FFFFFF');\n            circle2.setAttributeNS(null, 'cx', '5.5');\n            circle2.setAttributeNS(null, 'cy', '5.5');\n            circle2.setAttributeNS(null, 'r', '5.4999962');\n\n            circleContainer.appendChild(circle1);\n            circleContainer.appendChild(circle2);\n\n            page1.appendChild(shadow);\n            page1.appendChild(background);\n            page1.appendChild(border);\n            page1.appendChild(maki);\n            page1.appendChild(circleContainer);\n\n            svg.appendChild(page1);\n\n            svg.setAttributeNS(null, 'height', `${defaultHeight * this._scale}px`);\n            svg.setAttributeNS(null, 'width', `${defaultWidth * this._scale}px`);\n\n            this._element.appendChild(svg);\n\n            // if no element and no offset option given apply an offset for the default marker\n            // the -14 as the y value of the default marker offset was determined as follows\n            //\n            // the marker tip is at the center of the shadow ellipse from the default svg\n            // the y value of the center of the shadow ellipse relative to the svg top left is \"shadow transform translate-y (29.0) + ellipse cy (5.80029008)\"\n            // offset to the svg center \"height (41 / 2)\" gives (29.0 + 5.80029008) - (41 / 2) and rounded for an integer pixel offset gives 14\n            // negative is used to move the marker up from the center so the tip is at the Marker lngLat\n            this._offset = Point.convert(options && options.offset || [0, -14]);\n        } else {\n            this._element = options.element;\n            this._offset = Point.convert(options && options.offset || [0, 0]);\n        }\n\n        this._element.classList.add('maplibregl-marker');\n        this._element.addEventListener('dragstart', (e: DragEvent) => {\n            e.preventDefault();\n        });\n        this._element.addEventListener('mousedown', (e: MouseEvent) => {\n            // prevent focusing on click\n            e.preventDefault();\n        });\n        applyAnchorClass(this._element, this._anchor, 'marker');\n\n        if (options && options.className) {\n            for (const name of options.className.split(' ')) {\n                this._element.classList.add(name);\n            }\n        }\n\n        this._popup = null;\n    }\n\n    /**\n     * Attaches the `Marker` to a `Map` object.\n     * @param map - The MapLibre GL JS map to add the marker to.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *   .setLngLat([30.5, 50.5])\n     *   .addTo(map); // add the marker to the map\n     * ```\n     */\n    addTo(map: Map): this {\n        this.remove();\n        this._map = map;\n\n        if (!this._element.hasAttribute('aria-label')) {\n            this._element.setAttribute('aria-label', map._getUIString('Marker.Title'));\n        }\n\n        // aria-label is set either by user or above default, so set role\n        // since div is interactive and cannot have aria-label without a role\n        if (!this._element.hasAttribute('role')) {\n            this._element.setAttribute('role', 'button');\n        }\n\n        map.getCanvasContainer().appendChild(this._element);\n        map.on('move', this._update);\n        map.on('moveend', this._update);\n        map.on('terrain', this._update);\n        map.on('projectiontransition', this._update);\n\n        this.setDraggable(this._draggable);\n        this._update();\n\n        // If we attached the `click` listener to the marker element, the popup\n        // would close once the event propagated to `map` due to the\n        // `Popup._onClickClose` listener.\n        this._map.on('click', this._onMapClick);\n\n        return this;\n    }\n\n    /**\n     * Removes the marker from a map\n     * @example\n     * ```ts\n     * let marker = new Marker().addTo(map);\n     * marker.remove();\n     * ```\n     */\n    remove(): this {\n        if (this._opacityTimeout) {\n            clearTimeout(this._opacityTimeout);\n            delete this._opacityTimeout;\n        }\n        if (this._map) {\n            this._map.off('click', this._onMapClick);\n            this._map.off('move', this._update);\n            this._map.off('moveend', this._update);\n            this._map.off('terrain', this._update);\n            this._map.off('projectiontransition', this._update);\n            this._map.off('mousedown', this._addDragHandler);\n            this._map.off('touchstart', this._addDragHandler);\n            this._map.off('mouseup', this._onUp);\n            this._map.off('touchend', this._onUp);\n            this._map.off('mousemove', this._onMove);\n            this._map.off('touchmove', this._onMove);\n            delete this._map;\n        }\n        DOM.remove(this._element);\n        if (this._popup) this._popup.remove();\n        return this;\n    }\n\n    /**\n     * Get the marker's geographical location.\n     *\n     * The longitude of the result may differ by a multiple of 360 degrees from the longitude previously\n     * set by `setLngLat` because `Marker` wraps the anchor longitude across copies of the world to keep\n     * the marker on screen.\n     *\n     * @returns A {@link LngLat} describing the marker's location.\n     * @example\n     * ```ts\n     * // Store the marker's longitude and latitude coordinates in a variable\n     * let lngLat = marker.getLngLat();\n     * // Print the marker's longitude and latitude values in the console\n     * console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )\n     * ```\n     * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-marker/)\n     */\n    getLngLat(): LngLat {\n        return this._lngLat;\n    }\n\n    /**\n     * Set the marker's geographical position and move it.\n     * @param lnglat - A {@link LngLat} describing where the marker should be located.\n     * @example\n     * Create a new marker, set the longitude and latitude, and add it to the map\n     * ```ts\n     * new Marker()\n     *   .setLngLat([-65.017, -16.457])\n     *   .addTo(map);\n     * ```\n     * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/add-custom-icons-with-markers/)\n     * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/create-a-draggable-marker/)\n     */\n    setLngLat(lnglat: LngLatLike): this {\n        this._lngLat = LngLat.convert(lnglat);\n        this._pos = null;\n        if (this._popup) this._popup.setLngLat(this._lngLat);\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the `Marker`'s HTML element.\n     * @returns element\n     */\n    getElement(): HTMLElement {\n        return this._element;\n    }\n\n    /**\n     * Binds a {@link Popup} to the {@link Marker}.\n     * @param popup - An instance of the {@link Popup} class. If undefined or null, any popup\n     * set on this {@link Marker} instance is unset.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\")) // add popup\n     *  .addTo(map);\n     * ```\n     * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\n     */\n    setPopup(popup?: Popup | null): this {\n        if (this._popup) {\n            this._popup.remove();\n            this._popup = null;\n            this._element.removeEventListener('keypress', this._onKeyPress);\n\n            if (!this._originalTabIndex) {\n                this._element.removeAttribute('tabindex');\n            }\n        }\n\n        if (popup) {\n            if (!('offset' in popup.options)) {\n                const markerHeight = 41 - (5.8 / 2);\n                const markerRadius = 13.5;\n                const linearOffset = Math.abs(markerRadius) / Math.SQRT2;\n                popup.options.offset = this._defaultMarker ? {\n                    'top': [0, 0],\n                    'top-left': [0, 0],\n                    'top-right': [0, 0],\n                    'bottom': [0, -markerHeight],\n                    'bottom-left': [linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n                    'bottom-right': [-linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n                    'left': [markerRadius, (markerHeight - markerRadius) * -1],\n                    'right': [-markerRadius, (markerHeight - markerRadius) * -1]\n                } as Offset : this._offset;\n            }\n            this._popup = popup;\n\n            this._originalTabIndex = this._element.getAttribute('tabindex');\n            if (!this._originalTabIndex) {\n                this._element.setAttribute('tabindex', '0');\n            }\n            this._element.addEventListener('keypress', this._onKeyPress);\n        }\n\n        return this;\n    }\n\n    /**\n      * Set the option to allow subpixel positioning of the marker by passing a boolean\n      *\n      * @param value - when set to `true`, subpixel positioning is enabled for the marker.\n      *\n      * @example\n      * ```ts\n      * let marker = new Marker()\n      * marker.setSubpixelPositioning(true);\n      * ```\n      */\n    setSubpixelPositioning(value: boolean) {\n        this._subpixelPositioning = value;\n        return this;\n    }\n\n    _onKeyPress = (e: KeyboardEvent) => {\n        const code = e.code;\n        const legacyCode = e.charCode || e.keyCode;\n\n        if (\n            (code === 'Space') || (code === 'Enter') ||\n            (legacyCode === 32) || (legacyCode === 13) // space or enter\n        ) {\n            this.togglePopup();\n        }\n    };\n\n    _onMapClick = (e: MapMouseEvent) => {\n        const targetElement = e.originalEvent.target;\n        const element = this._element;\n\n        if (this._popup && (targetElement === element || element.contains(targetElement as any))) {\n            this.togglePopup();\n        }\n    };\n\n    /**\n     * Returns the {@link Popup} instance that is bound to the {@link Marker}.\n     * @returns popup\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\"))\n     *  .addTo(map);\n     *\n     * console.log(marker.getPopup()); // return the popup instance\n     * ```\n     */\n    getPopup(): Popup {\n        return this._popup;\n    }\n\n    /**\n     * Opens or closes the {@link Popup} instance that is bound to the {@link Marker}, depending on the current state of the {@link Popup}.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\"))\n     *  .addTo(map);\n     *\n     * marker.togglePopup(); // toggle popup open or closed\n     * ```\n     */\n    togglePopup(): this {\n        const popup = this._popup;\n\n        if (this._element.style.opacity === this._opacityWhenCovered) return this;\n\n        if (!popup) return this;\n        else if (popup.isOpen()) popup.remove();\n        else {\n            popup.setLngLat(this._lngLat);\n            popup.addTo(this._map);\n        }\n        return this;\n    }\n\n    _updateOpacity(force: boolean = false) {\n        const terrain = this._map?.terrain;\n        const occluded = this._map.transform.isLocationOccluded(this._lngLat);\n        if (!terrain || occluded) {\n            const targetOpacity = occluded ? this._opacityWhenCovered : this._opacity;\n            if (this._element.style.opacity !== targetOpacity) { this._element.style.opacity = targetOpacity; }\n            return;\n        }\n        if (force) {\n            this._opacityTimeout = null;\n        } else {\n            if (this._opacityTimeout) { return; }\n            this._opacityTimeout = setTimeout(() => {\n                this._opacityTimeout = null;\n            }, 100);\n        }\n\n        const map = this._map;\n\n        // Read depth framebuffer, getting position of terrain in line of sight to marker\n        const terrainDistance = map.terrain.depthAtPoint(this._pos);\n        // Transform marker position to clip space\n        const elevation = map.terrain.getElevationForLngLat(this._lngLat, map.transform);\n        const markerDistance = map.transform.lngLatToCameraDepth(this._lngLat, elevation);\n        const forgiveness = .006;\n        if (markerDistance - terrainDistance < forgiveness) {\n            this._element.style.opacity = this._opacity;\n            return;\n        }\n        // If the base is obscured, use the offset to check if the marker's center is obscured.\n        const metersToCenter = -this._offset.y / map.transform.pixelsPerMeter;\n        const elevationToCenter = Math.sin(map.getPitch() * Math.PI / 180) * metersToCenter;\n        const terrainDistanceCenter = map.terrain.depthAtPoint(new Point(this._pos.x, this._pos.y - this._offset.y));\n        const markerDistanceCenter = map.transform.lngLatToCameraDepth(this._lngLat, elevation + elevationToCenter);\n        // Display at full opacity if center is visible.\n        const centerIsInvisible = markerDistanceCenter - terrainDistanceCenter > forgiveness;\n\n        if (this._popup?.isOpen() && centerIsInvisible) this._popup.remove();\n        this._element.style.opacity = centerIsInvisible ? this._opacityWhenCovered : this._opacity;\n    }\n\n    _update = (e?: { type: 'move' | 'moveend' | 'terrain' | 'render' }) => {\n        if (!this._map) return;\n\n        const isFullyLoaded = this._map.loaded() && !this._map.isMoving();\n        if (e?.type === 'terrain' || (e?.type === 'render' && !isFullyLoaded)) {\n            this._map.once('render', this._update);\n        }\n\n        this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);\n\n        this._flatPos = this._pos = this._map.project(this._lngLat)._add(this._offset);\n        if (this._map.terrain) {\n            // flat position is saved because smartWrap needs non-elevated points\n            this._flatPos = this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset);\n        }\n\n        let rotation = '';\n        if (this._rotationAlignment === 'viewport' || this._rotationAlignment === 'auto') {\n            rotation = `rotateZ(${this._rotation}deg)`;\n        } else if (this._rotationAlignment === 'map') {\n            rotation = `rotateZ(${this._rotation - this._map.getBearing()}deg)`;\n        }\n\n        let pitch = '';\n        if (this._pitchAlignment === 'viewport' || this._pitchAlignment === 'auto') {\n            pitch = 'rotateX(0deg)';\n        } else if (this._pitchAlignment === 'map') {\n            pitch = `rotateX(${this._map.getPitch()}deg)`;\n        }\n\n        // because rounding the coordinates at every `move` event causes stuttered zooming\n        // we only round them when _update is called with `moveend` or when its called with\n        // no arguments (when the Marker is initialized or Marker.setLngLat is invoked).\n        if (!this._subpixelPositioning && (!e || e.type === 'moveend')) {\n            this._pos = this._pos.round();\n        }\n\n        DOM.setTransform(this._element, `${anchorTranslate[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${pitch} ${rotation}`);\n\n        browser.frameAsync(new AbortController(), this._map._ownerWindow).then(() => { // Run _updateOpacity only after painter.render and drawDepth\n            this._updateOpacity(e && e.type === 'moveend');\n        }).catch(() => {});\n    };\n\n    /**\n     * Get the marker's offset.\n     * @returns The marker's screen coordinates in pixels.\n     */\n    getOffset(): Point {\n        return this._offset;\n    }\n\n    /**\n     * Sets the offset of the marker\n     * @param offset - The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.\n     */\n    setOffset(offset: PointLike): this {\n        this._offset = Point.convert(offset);\n        this._update();\n        return this;\n    }\n\n    /**\n     * Adds a CSS class to the marker element.\n     *\n     * @param className - on-empty string with CSS class name to add to marker element\n     *\n     * @example\n     * ```\n     * let marker = new Marker()\n     * marker.addClassName('some-class')\n     * ```\n     */\n    addClassName(className: string) {\n        this._element.classList.add(className);\n    }\n\n    /**\n     * Removes a CSS class from the marker element.\n     *\n     * @param className - Non-empty string with CSS class name to remove from marker element\n     *\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     * marker.removeClassName('some-class')\n     * ```\n     */\n    removeClassName(className: string) {\n        this._element.classList.remove(className);\n    }\n\n    /**\n     * Add or remove the given CSS class on the marker element, depending on whether the element currently has that class.\n     *\n     * @param className - Non-empty string with CSS class name to add/remove\n     *\n     * @returns if the class was removed return false, if class was added, then return true\n     *\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     * marker.toggleClassName('toggleClass')\n     * ```\n     */\n    toggleClassName(className: string): boolean {\n        return this._element.classList.toggle(className);\n    }\n\n    _onMove = (e: MapMouseEvent | MapTouchEvent) => {\n        if (!this._isDragging) {\n            const clickTolerance = this._clickTolerance || this._map._clickTolerance;\n            this._isDragging = e.point.dist(this._pointerdownPos) >= clickTolerance;\n        }\n        if (!this._isDragging) return;\n\n        this._pos = e.point.sub(this._positionDelta);\n        this._lngLat = this._map.unproject(this._pos);\n        this.setLngLat(this._lngLat);\n        // suppress click event so that popups don't toggle on drag\n        this._element.style.pointerEvents = 'none';\n\n        // make sure dragstart only fires on the first move event after mousedown.\n        // this can't be on mousedown because that event doesn't necessarily\n        // imply that a drag is about to happen.\n        if (this._state === 'pending') {\n            this._state = 'active';\n            this.fire(new Event('dragstart'));\n        }\n        this.fire(new Event('drag'));\n    };\n\n    _onUp = () => {\n        // revert to normal pointer event handling\n        this._element.style.pointerEvents = 'auto';\n        this._positionDelta = null;\n        this._pointerdownPos = null;\n        this._isDragging = false;\n        this._map.off('mousemove', this._onMove);\n        this._map.off('touchmove', this._onMove);\n\n        // only fire dragend if it was preceded by at least one drag event\n        if (this._state === 'active') {\n            this.fire(new Event('dragend'));\n        }\n\n        this._state = 'inactive';\n    };\n\n    _addDragHandler = (e: MapMouseEvent | MapTouchEvent) => {\n        if (this._element.contains(e.originalEvent.target as any)) {\n            e.preventDefault();\n\n            // We need to calculate the pixel distance between the click point\n            // and the marker position, with the offset accounted for. Then we\n            // can subtract this distance from the mousemove event's position\n            // to calculate the new marker position.\n            // If we don't do this, the marker 'jumps' to the click position\n            // creating a jarring UX effect.\n            this._positionDelta = e.point.sub(this._pos).add(this._offset);\n\n            this._pointerdownPos = e.point;\n\n            this._state = 'pending';\n            this._map.on('mousemove', this._onMove);\n            this._map.on('touchmove', this._onMove);\n            this._map.once('mouseup', this._onUp);\n            this._map.once('touchend', this._onUp);\n        }\n    };\n\n    /**\n     * Sets the `draggable` property and functionality of the marker\n     * @param shouldBeDraggable - Turns drag functionality on/off\n     */\n    setDraggable(shouldBeDraggable?: boolean): this {\n        this._draggable = !!shouldBeDraggable; // convert possible undefined value to false\n\n        // handle case where map may not exist yet\n        // e.g. when setDraggable is called before addTo\n        if (this._map) {\n            if (shouldBeDraggable) {\n                this._map.on('mousedown', this._addDragHandler);\n                this._map.on('touchstart', this._addDragHandler);\n            } else {\n                this._map.off('mousedown', this._addDragHandler);\n                this._map.off('touchstart', this._addDragHandler);\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns true if the marker can be dragged\n     * @returns True if the marker is draggable.\n     */\n    isDraggable(): boolean {\n        return this._draggable;\n    }\n\n    /**\n     * Sets the `rotation` property of the marker.\n     * @param rotation - The rotation angle of the marker (clockwise, in degrees), relative to its respective {@link Marker.setRotationAlignment} setting.\n     */\n    setRotation(rotation?: number): this {\n        this._rotation = rotation || 0;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current rotation angle of the marker (in degrees).\n     * @returns The current rotation angle of the marker.\n     */\n    getRotation(): number {\n        return this._rotation;\n    }\n\n    /**\n     * Sets the `rotationAlignment` property of the marker.\n     * @param alignment - Sets the `rotationAlignment` property of the marker. defaults to 'auto'\n     */\n    setRotationAlignment(alignment?: Alignment): this {\n        this._rotationAlignment = alignment || 'auto';\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current `rotationAlignment` property of the marker.\n     * @returns The current rotational alignment of the marker.\n     */\n    getRotationAlignment(): Alignment {\n        return this._rotationAlignment;\n    }\n\n    /**\n     * Sets the `pitchAlignment` property of the marker.\n     * @param alignment - Sets the `pitchAlignment` property of the marker. If alignment is 'auto', it will automatically match `rotationAlignment`.\n     */\n    setPitchAlignment(alignment?: Alignment): this {\n        this._pitchAlignment = alignment && alignment !== 'auto' ? alignment : this._rotationAlignment;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current `pitchAlignment` property of the marker.\n     * @returns The current pitch alignment of the marker in degrees.\n     */\n    getPitchAlignment(): Alignment {\n        return this._pitchAlignment;\n    }\n\n    /**\n     * Sets the `opacity` and `opacityWhenCovered` properties of the marker.\n     * When called without arguments, resets opacity and opacityWhenCovered to defaults\n     * @param opacity - Sets the `opacity` property of the marker.\n     * @param opacityWhenCovered - Sets the `opacityWhenCovered` property of the marker.\n     */\n    setOpacity(opacity?: string, opacityWhenCovered?: string): this {\n        // Reset opacity when called without params or from constructor\n        if (this._opacity === undefined || (opacity === undefined && opacityWhenCovered === undefined)) {\n            this._opacity = '1';\n            this._opacityWhenCovered = '0.2';\n        }\n\n        if (opacity !== undefined) {\n            this._opacity = opacity;\n        }\n        if (opacityWhenCovered !== undefined) {\n            this._opacityWhenCovered = opacityWhenCovered;\n        }\n\n        if (this._map) {\n            this._updateOpacity(true);\n        }\n        return this;\n    }\n}\n","import {Event, Evented} from '../../util/evented';\nimport {DOM} from '../../util/dom';\nimport {extend, warnOnce} from '../../util/util';\nimport {checkGeolocationSupport} from '../../util/geolocation_support';\nimport {LngLat} from '../../geo/lng_lat';\nimport {Marker} from '../marker';\n\nimport type {Map} from '../map';\nimport type {FitBoundsOptions} from '../camera';\nimport type {IControl} from './control';\nimport {LngLatBounds} from '../../geo/lng_lat_bounds';\n\n/**\n * The {@link GeolocateControl} options object\n */\nexport type GeolocateControlOptions = {\n    /**\n     * A Geolocation API [PositionOptions](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions) object.\n     * @defaultValue `{enableHighAccuracy: false, timeout: 6000}`\n     */\n    positionOptions?: PositionOptions;\n    /**\n     * A options object to use when the map is panned and zoomed to the user's location. The default is to use a `maxZoom` of 15 to limit how far the map will zoom in for very accurate locations.\n     */\n    fitBoundsOptions?: FitBoundsOptions;\n    /**\n     * If `true` the `GeolocateControl` becomes a toggle button and when active the map will receive updates to the user's location as it changes.\n     * @defaultValue false\n     */\n    trackUserLocation?: boolean;\n    /**\n     * By default, if `showUserLocation` is `true`, a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to `false` to disable. Always disabled when `showUserLocation` is `false`.\n     * @defaultValue true\n     */\n    showAccuracyCircle?: boolean;\n    /**\n     * By default a dot will be shown on the map at the user's location. Set to `false` to disable.\n     * @defaultValue true\n     */\n    showUserLocation?: boolean;\n};\n\nconst defaultOptions: GeolocateControlOptions = {\n    positionOptions: {\n        enableHighAccuracy: false,\n        maximumAge: 0,\n        timeout: 6000 /* 6 sec */\n    },\n    fitBoundsOptions: {\n        maxZoom: 15\n    },\n    trackUserLocation: false,\n    showAccuracyCircle: true,\n    showUserLocation: true\n};\n\nlet numberOfWatches = 0;\nlet noTimeout = false;\n\n/**\n * A `GeolocateControl` control provides a button that uses the browser's geolocation\n * API to locate the user on the map.\n *\n * Not all browsers support geolocation,\n * and some users may disable the feature. Geolocation support for modern\n * browsers including Chrome requires sites to be served over HTTPS. If\n * geolocation support is not available, the `GeolocateControl` will show\n * as disabled.\n *\n * The zoom level applied will depend on the accuracy of the geolocation provided by the device.\n *\n * The `GeolocateControl` has two modes. If `trackUserLocation` is `false` (default) the control acts as a button, which when pressed will set the map's camera to target the user location. If the user moves, the map won't update. This is most suited for the desktop. If `trackUserLocation` is `true` the control acts as a toggle button that when active the user's location is actively monitored for changes. In this mode the `GeolocateControl` has three interaction states:\n * * active - the map's camera automatically updates as the user's location changes, keeping the location dot in the center. Initial state and upon clicking the `GeolocateControl` button.\n * * passive - the user's location dot automatically updates, but the map's camera does not. Occurs upon the user initiating a map movement.\n * * disabled - occurs if Geolocation is not available, disabled or denied.\n *\n * These interaction states can't be controlled programmatically, rather they are set based on user interactions.\n *\n * ## State Diagram\n * ![GeolocateControl state diagram](https://github.com/maplibre/maplibre-gl-js/assets/3269297/78e720e5-d781-4da8-9803-a7a0e6aaaa9f)\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * map.addControl(new GeolocateControl({\n *     positionOptions: {\n *         enableHighAccuracy: true\n *     },\n *     trackUserLocation: true\n * }));\n * ```\n * @see [Locate the user](https://maplibre.org/maplibre-gl-js/docs/examples/locate-the-user/)\n *\n * ## Events\n *\n * **Event** `trackuserlocationend` of type {@link Event} will be fired when the `GeolocateControl` changes to the background state, which happens when a user changes the camera during an active position lock. This only applies when `trackUserLocation` is `true`. In the background state, the dot on the map will update with location updates but the camera will not.\n *\n * **Event** `trackuserlocationstart` of type {@link Event} will be fired when the `GeolocateControl` changes to the active lock state, which happens either upon first obtaining a successful Geolocation API position for the user (a `geolocate` event will follow), or the user clicks the geolocate button when in the background state which uses the last known position to recenter the map and enter active lock state (no `geolocate` event will follow unless the users's location changes).\n *\n * **Event** `userlocationlostfocus` of type {@link Event} will be fired when the `GeolocateControl` changes to the background state, which happens when a user changes the camera during an active position lock. This only applies when `trackUserLocation` is `true`. In the background state, the dot on the map will update with location updates but the camera will not.\n *\n * **Event** `userlocationfocus` of type {@link Event} will be fired when the `GeolocateControl` changes to the active lock state, which happens upon the user clicks the geolocate button when in the background state which uses the last known position to recenter the map and enter active lock state.\n *\n * **Event** `geolocate` of type {@link Event} will be fired on each Geolocation API position update which returned as success.\n * `data` - The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * **Event** `error` of type {@link Event} will be fired on each Geolocation API position update which returned as an error.\n * `data` - The returned [PositionError](https://developer.mozilla.org/en-US/docs/Web/API/PositionError) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * **Event** `outofmaxbounds` of type {@link Event} will be fired on each Geolocation API position update which returned as success but user position is out of map `maxBounds`.\n * `data` - The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a trackuserlocationend event occurs.\n * geolocate.on('trackuserlocationend', () => {\n *   console.log('A trackuserlocationend event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a trackuserlocationstart event occurs.\n * geolocate.on('trackuserlocationstart', () => {\n *   console.log('A trackuserlocationstart event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an userlocationlostfocus event occurs.\n * geolocate.on('userlocationlostfocus', function() {\n *   console.log('An userlocationlostfocus event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an userlocationfocus event occurs.\n * geolocate.on('userlocationfocus', function() {\n *   console.log('An userlocationfocus event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a geolocate event occurs.\n * geolocate.on('geolocate', () => {\n *   console.log('A geolocate event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an error event occurs.\n * geolocate.on('error', () => {\n *   console.log('An error event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an outofmaxbounds event occurs.\n * geolocate.on('outofmaxbounds', () => {\n *   console.log('An outofmaxbounds event has occurred.')\n * });\n * ```\n */\nexport class GeolocateControl extends Evented implements IControl {\n    _map: Map;\n    options: GeolocateControlOptions;\n    _container: HTMLElement;\n    _dotElement: HTMLElement;\n    _circleElement: HTMLElement;\n    _geolocateButton: HTMLButtonElement;\n    _geolocationWatchID: number;\n    _timeoutId: ReturnType<typeof setTimeout>;\n    /* Geolocate Control Watch States\n     * This is the private state of the control.\n     *\n     * OFF\n     *    off/inactive\n     * WAITING_ACTIVE\n     *    Geolocate Control was clicked but still waiting for Geolocation API response with user location\n     * ACTIVE_LOCK\n     *    Showing the user location as a dot AND tracking the camera to be fixed to their location. If their location changes the map moves to follow.\n     * ACTIVE_ERROR\n     *    There was en error from the Geolocation API while trying to show and track the user location.\n     * BACKGROUND\n     *    Showing the user location as a dot but the camera doesn't follow their location as it changes.\n     * BACKGROUND_ERROR\n     *    There was an error from the Geolocation API while trying to show (but not track) the user location.\n     */\n    _watchState: 'OFF' | 'ACTIVE_LOCK' | 'WAITING_ACTIVE' | 'ACTIVE_ERROR' | 'BACKGROUND' | 'BACKGROUND_ERROR';\n    _lastKnownPosition: any;\n    _userLocationDotMarker: Marker;\n    _accuracyCircleMarker: Marker;\n    _accuracy: number;\n    _setup: boolean; // set to true once the control has been setup\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: GeolocateControlOptions) {\n        super();\n        this.options = extend({}, defaultOptions, options);\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._setupUI();\n        checkGeolocationSupport().then((supported) => this._finishSetupUI(supported));\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        // clear the geolocation watch if exists\n        if (this._geolocationWatchID !== undefined) {\n            window.navigator.geolocation.clearWatch(this._geolocationWatchID);\n            this._geolocationWatchID = undefined;\n        }\n\n        // clear the markers from the map\n        if (this.options.showUserLocation && this._userLocationDotMarker) {\n            this._userLocationDotMarker.remove();\n        }\n        if (this.options.showAccuracyCircle && this._accuracyCircleMarker) {\n            this._accuracyCircleMarker.remove();\n        }\n\n        DOM.remove(this._container);\n        this._map.off('zoom', this._onUpdate);\n        this._map.off('move', this._onUpdate);\n        this._map.off('rotate', this._onUpdate);\n        this._map.off('pitch', this._onUpdate);\n        this._map = undefined;\n        numberOfWatches = 0;\n        noTimeout = false;\n    }\n\n    /**\n     * Check if the Geolocation API Position is outside the map's `maxBounds`.\n     *\n     * @param position - the Geolocation API Position\n     * @returns `true` if position is outside the map's `maxBounds`, otherwise returns `false`.\n     */\n    _isOutOfMapMaxBounds(position: GeolocationPosition) {\n        const bounds = this._map.getMaxBounds();\n        const coordinates = position.coords;\n\n        return bounds && (\n            coordinates.longitude < bounds.getWest() ||\n            coordinates.longitude > bounds.getEast() ||\n            coordinates.latitude < bounds.getSouth() ||\n            coordinates.latitude > bounds.getNorth()\n        );\n    }\n\n    _setErrorState() {\n        switch (this._watchState) {\n            case 'WAITING_ACTIVE':\n                this._watchState = 'ACTIVE_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active-error');\n                break;\n            case 'ACTIVE_LOCK':\n                this._watchState = 'ACTIVE_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active-error');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                // turn marker grey\n                break;\n            case 'BACKGROUND':\n                this._watchState = 'BACKGROUND_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background-error');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                // turn marker grey\n                break;\n            case 'ACTIVE_ERROR':\n            case 'BACKGROUND_ERROR':\n                // already in error state\n                break;\n            case 'OFF':\n            case undefined:\n                // when trackUserLocation is false, watchState is undefined\n                // when trackUserLocation is true but not activated, watchState is 'OFF'\n                // in both cases, no error state transition is needed\n                break;\n            default:\n                throw new Error(`Unexpected watchState ${this._watchState}`);\n        }\n    }\n\n    /**\n     * When the Geolocation API returns a new location, update the `GeolocateControl`.\n     *\n     * @param position - the Geolocation API Position\n     */\n    _onSuccess = (position: GeolocationPosition) => {\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (this._isOutOfMapMaxBounds(position)) {\n            this._setErrorState();\n\n            this.fire(new Event('outofmaxbounds', position));\n            this._updateMarker();\n            this._finish();\n\n            return;\n        }\n\n        if (this.options.trackUserLocation) {\n            // keep a record of the position so that if the state is BACKGROUND and the user\n            // clicks the button, we can move to ACTIVE_LOCK immediately without waiting for\n            // watchPosition to trigger _onSuccess\n            this._lastKnownPosition = position;\n\n            switch (this._watchState) {\n                case 'WAITING_ACTIVE':\n                case 'ACTIVE_LOCK':\n                case 'ACTIVE_ERROR':\n                    this._watchState = 'ACTIVE_LOCK';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'BACKGROUND':\n                case 'BACKGROUND_ERROR':\n                    this._watchState = 'BACKGROUND';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background');\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n        }\n\n        // if showUserLocation and the watch state isn't off then update the marker location\n        if (this.options.showUserLocation && this._watchState !== 'OFF') {\n            this._updateMarker(position);\n        }\n\n        // if in normal mode (not watch mode), or if in watch mode and the state is active watch\n        // then update the camera\n        if (!this.options.trackUserLocation || this._watchState === 'ACTIVE_LOCK') {\n            this._updateCamera(position);\n        }\n\n        if (this.options.showUserLocation) {\n            this._dotElement.classList.remove('maplibregl-user-location-dot-stale');\n        }\n\n        this.fire(new Event('geolocate', position));\n        this._finish();\n    };\n\n    /**\n     * Update the camera location to center on the current position\n     *\n     * @param position - the Geolocation API Position\n     */\n    _updateCamera = (position: GeolocationPosition) => {\n        const center = new LngLat(position.coords.longitude, position.coords.latitude);\n        const radius = position.coords.accuracy;\n        const bearing = this._map.getBearing();\n        const options = extend({bearing}, this.options.fitBoundsOptions);\n        const newBounds = LngLatBounds.fromLngLat(center, radius);\n\n        this._map.fitBounds(newBounds, options, {\n            geolocateSource: true // tag this camera change so it won't cause the control to change to background state\n        });\n    };\n\n    /**\n     * Update the user location dot Marker to the current position\n     *\n     * @param position - the Geolocation API Position\n     */\n    _updateMarker = (position?: GeolocationPosition | null) => {\n        if (position) {\n            const center = new LngLat(position.coords.longitude, position.coords.latitude);\n            this._accuracyCircleMarker.setLngLat(center).addTo(this._map);\n            this._userLocationDotMarker.setLngLat(center).addTo(this._map);\n            this._accuracy = position.coords.accuracy;\n            this._updateCircleRadiusIfNeeded();\n        } else {\n            this._userLocationDotMarker.remove();\n            this._accuracyCircleMarker.remove();\n        }\n    };\n\n    _updateCircleRadiusIfNeeded() {\n        const userLocation = this._userLocationDotMarker.getLngLat();\n        if (!this.options.showUserLocation || !this.options.showAccuracyCircle || !this._accuracy || !userLocation) {\n            return;\n        }\n        const screenPosition = this._map.project(userLocation);\n        const userLocationWith100Px = this._map.unproject([screenPosition.x + 100, screenPosition.y]);\n        const pixelsToMeters = userLocation.distanceTo(userLocationWith100Px) / 100;\n        const circleDiameter = 2 * this._accuracy / pixelsToMeters;\n        this._circleElement.style.width = `${circleDiameter.toFixed(2)}px`;\n        this._circleElement.style.height = `${circleDiameter.toFixed(2)}px`;\n    }\n\n    _onUpdate = () => {\n        this._updateCircleRadiusIfNeeded();\n    };\n\n    _onError = (error: GeolocationPositionError) => {\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (error.code === 1) {\n            // PERMISSION_DENIED\n            this._watchState = 'OFF';\n            this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n            this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n            this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n            this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n            this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n            this._geolocateButton.disabled = true;\n            const title = this._map._getUIString('GeolocateControl.LocationNotAvailable');\n            this._geolocateButton.title = title;\n            this._geolocateButton.setAttribute('aria-label', title);\n\n            if (this._geolocationWatchID !== undefined) {\n                this._clearWatch();\n            }\n        } else if (error.code === 3 && noTimeout) {\n            // this represents a forced error state\n            // this was triggered to force immediate geolocation when a watch is already present\n            // see https://github.com/mapbox/mapbox-gl-js/issues/8214\n            // and https://w3c.github.io/geolocation-api/#example-5-forcing-the-user-agent-to-return-a-fresh-cached-position\n            return;\n        } else {\n            this._setErrorState();\n        }\n\n        if (this._watchState !== 'OFF' && this.options.showUserLocation) {\n            this._dotElement.classList.add('maplibregl-user-location-dot-stale');\n        }\n\n        this.fire(new Event('error', error));\n\n        this._finish();\n    };\n\n    _finish = () => {\n        if (this._timeoutId) { clearTimeout(this._timeoutId); }\n        this._timeoutId = undefined;\n    };\n\n    _setupUI = () => {\n        // the control could have been removed before reaching here\n        if (!this._map) {\n            return;\n        }\n\n        this._container.addEventListener('contextmenu', (e: MouseEvent) => e.preventDefault());\n        this._geolocateButton = DOM.create('button', 'maplibregl-ctrl-geolocate', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._geolocateButton).setAttribute('aria-hidden', 'true');\n        this._geolocateButton.type = 'button';\n        this._geolocateButton.disabled = true;\n    };\n\n    _finishSetupUI = (supported: boolean) => {\n        // this method is called asynchronously during onAdd\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (supported === false) {\n            warnOnce('Geolocation support is not available so the GeolocateControl will be disabled.');\n            const title = this._map._getUIString('GeolocateControl.LocationNotAvailable');\n            this._geolocateButton.disabled = true;\n            this._geolocateButton.title = title;\n            this._geolocateButton.setAttribute('aria-label', title);\n        } else {\n            const title = this._map._getUIString('GeolocateControl.FindMyLocation');\n            this._geolocateButton.disabled = false;\n            this._geolocateButton.title = title;\n            this._geolocateButton.setAttribute('aria-label', title);\n        }\n\n        if (this.options.trackUserLocation) {\n            this._geolocateButton.setAttribute('aria-pressed', 'false');\n            this._watchState = 'OFF';\n        }\n\n        // when showUserLocation is enabled, keep the Geolocate button disabled until the device location marker is setup on the map\n        if (this.options.showUserLocation) {\n            this._dotElement = DOM.create('div', 'maplibregl-user-location-dot');\n\n            this._userLocationDotMarker = new Marker({element: this._dotElement});\n\n            this._circleElement = DOM.create('div', 'maplibregl-user-location-accuracy-circle');\n            this._accuracyCircleMarker = new Marker({element: this._circleElement, pitchAlignment: 'map'});\n\n            if (this.options.trackUserLocation) this._watchState = 'OFF';\n\n            this._map.on('zoom', this._onUpdate);\n            this._map.on('move', this._onUpdate);\n            this._map.on('rotate', this._onUpdate);\n            this._map.on('pitch', this._onUpdate);\n        }\n\n        this._geolocateButton.addEventListener('click', () => this.trigger());\n\n        this._setup = true;\n\n        // when the camera is changed (and it's not as a result of the Geolocation Control) change\n        // the watch mode to background watch, so that the marker is updated but not the camera.\n        if (this.options.trackUserLocation) {\n            this._map.on('movestart', (event: any) => {\n                const fromResize = event?.[0] instanceof ResizeObserverEntry;\n                if (!event.geolocateSource && this._watchState === 'ACTIVE_LOCK' && !fromResize && !this._map.isZooming()) {\n                    this._watchState = 'BACKGROUND';\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n\n                    this.fire(new Event('trackuserlocationend'));\n                    this.fire(new Event('userlocationlostfocus'));\n                }\n            });\n        }\n    };\n\n    /**\n     * Programmatically request and move the map to the user's location.\n     *\n     * @returns `false` if called before control was added to a map, otherwise returns `true`.\n     * @example\n     * ```ts\n     * // Initialize the geolocate control.\n     * let geolocate = new GeolocateControl({\n     *  positionOptions: {\n     *    enableHighAccuracy: true\n     *  },\n     *  trackUserLocation: true\n     * });\n     * // Add the control to the map.\n     * map.addControl(geolocate);\n     * map.on('load', () => {\n     *   geolocate.trigger();\n     * });\n     * ```\n     */\n    trigger(): boolean {\n        if (!this._setup) {\n            warnOnce('Geolocate control triggered before added to a map');\n            return false;\n        }\n        if (this.options.trackUserLocation) {\n            // update watchState and do any outgoing state cleanup\n            switch (this._watchState) {\n                case 'OFF':\n                // turn on the Geolocate Control\n                    this._watchState = 'WAITING_ACTIVE';\n\n                    this.fire(new Event('trackuserlocationstart'));\n                    break;\n                case 'WAITING_ACTIVE':\n                case 'ACTIVE_LOCK':\n                case 'ACTIVE_ERROR':\n                case 'BACKGROUND_ERROR':\n                // turn off the Geolocate Control\n                    numberOfWatches--;\n                    noTimeout = false;\n                    this._watchState = 'OFF';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n\n                    this.fire(new Event('trackuserlocationend'));\n                    break;\n                case 'BACKGROUND':\n                    this._watchState = 'ACTIVE_LOCK';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                    // set camera to last known location\n                    if (this._lastKnownPosition) this._updateCamera(this._lastKnownPosition);\n\n                    this.fire(new Event('trackuserlocationstart'));\n                    this.fire(new Event('userlocationfocus'));\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n\n            // incoming state setup\n            switch (this._watchState) {\n                case 'WAITING_ACTIVE':\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'ACTIVE_LOCK':\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'OFF':\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n\n            // manage geolocation.watchPosition / geolocation.clearWatch\n            if (this._watchState === 'OFF' && this._geolocationWatchID !== undefined) {\n                // clear watchPosition as we've changed to an OFF state\n                this._clearWatch();\n            } else if (this._geolocationWatchID === undefined) {\n                // enable watchPosition since watchState is not OFF and there is no watchPosition already running\n\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                this._geolocateButton.setAttribute('aria-pressed', 'true');\n\n                numberOfWatches++;\n                let positionOptions;\n                if (numberOfWatches > 1) {\n                    positionOptions = {maximumAge: 600000, timeout: 0};\n                    noTimeout = true;\n                } else {\n                    positionOptions = this.options.positionOptions;\n                    noTimeout = false;\n                }\n\n                this._geolocationWatchID = window.navigator.geolocation.watchPosition(\n                    this._onSuccess, this._onError, positionOptions);\n            }\n        } else {\n            window.navigator.geolocation.getCurrentPosition(\n                this._onSuccess, this._onError, this.options.positionOptions);\n\n            // This timeout ensures that we still call finish() even if\n            // the user declines to share their location in Firefox\n            this._timeoutId = setTimeout(this._finish, 10000 /* 10sec */);\n        }\n\n        return true;\n    }\n\n    _clearWatch() {\n        window.navigator.geolocation.clearWatch(this._geolocationWatchID);\n\n        this._geolocationWatchID = undefined;\n        this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n        this._geolocateButton.setAttribute('aria-pressed', 'false');\n\n        if (this.options.showUserLocation) {\n            this._updateMarker(null);\n        }\n    }\n}\n","import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\n\n/**\n * The unit type for length to use for the {@link ScaleControl}\n */\nexport type Unit = 'imperial' | 'metric' | 'nautical';\n\n/**\n * The {@link ScaleControl} options object\n */\nexport type ScaleControlOptions = {\n    /**\n     * The maximum length of the scale control in pixels.\n     * @defaultValue 100\n     */\n    maxWidth?: number;\n    /**\n     * Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).\n     * @defaultValue 'metric'\n     */\n    unit?: Unit;\n};\n\nconst defaultOptions: ScaleControlOptions = {\n    maxWidth: 100,\n    unit: 'metric'\n};\n\n/**\n * A `ScaleControl` control displays the ratio of a distance on the map to the corresponding distance on the ground.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let scale = new ScaleControl({\n *     maxWidth: 80,\n *     unit: 'imperial'\n * });\n * map.addControl(scale);\n *\n * scale.setUnit('metric');\n * ```\n */\nexport class ScaleControl implements IControl {\n    _map: Map;\n    _container: HTMLElement;\n    options: ScaleControlOptions;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options?: ScaleControlOptions) {\n        this.options = {...defaultOptions, ...options};\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-left';\n    }\n\n    _onMove = () => {\n        updateScale(this._map, this._container, this.options);\n    };\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-scale', map.getContainer());\n\n        this._map.on('move', this._onMove);\n        this._onMove();\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('move', this._onMove);\n        this._map = undefined;\n    }\n\n    /**\n     * Set the scale's unit of the distance\n     *\n     * @param unit - Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).\n     */\n    setUnit = (unit: Unit) => {\n        this.options.unit = unit;\n        updateScale(this._map, this._container, this.options);\n    };\n}\n\nfunction updateScale(map: Map, container: HTMLElement, options: ScaleControlOptions) {\n    // A horizontal scale is imagined to be present at center of the map\n    // container with maximum length (Default) as 100px.\n    // Using spherical law of cosines approximation, the real distance is\n    // found between the two coordinates.\n    // Minimum maxWidth is calculated for the scale box.\n    const optWidth = options && options.maxWidth || 100;\n    const y = map._container.clientHeight / 2;\n    const x = map._container.clientWidth / 2;\n    const left = map.unproject([x - optWidth / 2, y]);\n    const right = map.unproject([x + optWidth / 2, y]);\n\n    const globeWidth = Math.round(map.project(right).x - map.project(left).x);\n    const maxWidth = Math.min(optWidth, globeWidth, map._container.clientWidth);\n\n    const maxMeters = left.distanceTo(right);\n    // The real distance corresponding to 100px scale length is rounded off to\n    // near pretty number and the scale length for the same is found out.\n    // Default unit of the scale is based on User's locale.\n    if (options && options.unit === 'imperial') {\n        const maxFeet = 3.2808 * maxMeters;\n        if (maxFeet > 5280) {\n            const maxMiles = maxFeet / 5280;\n            setScale(container, maxWidth, maxMiles, map._getUIString('ScaleControl.Miles'));\n        } else {\n            setScale(container, maxWidth, maxFeet, map._getUIString('ScaleControl.Feet'));\n        }\n    } else if (options && options.unit === 'nautical') {\n        const maxNauticals = maxMeters / 1852;\n        setScale(container, maxWidth, maxNauticals, map._getUIString('ScaleControl.NauticalMiles'));\n    } else if (maxMeters >= 1000) {\n        setScale(container, maxWidth, maxMeters / 1000, map._getUIString('ScaleControl.Kilometers'));\n    } else {\n        setScale(container, maxWidth, maxMeters, map._getUIString('ScaleControl.Meters'));\n    }\n}\n\nfunction setScale(container: HTMLElement, maxWidth: number, maxDistance: number, unit: string) {\n    const distance = getRoundNum(maxDistance);\n    const ratio = distance / maxDistance;\n    container.style.width = `${maxWidth * ratio}px`;\n    container.innerHTML = `${distance}&nbsp;${unit}`;\n}\n\nfunction getDecimalRoundNum(d) {\n    const multiplier = Math.pow(10, Math.ceil(-Math.log(d) / Math.LN10));\n    return Math.round(d * multiplier) / multiplier;\n}\n\nfunction getRoundNum(num) {\n    const pow10 = Math.pow(10, (`${Math.floor(num)}`).length - 1);\n    let d = num / pow10;\n\n    d = d >= 10 ? 10 :\n        d >= 5 ? 5 :\n            d >= 3 ? 3 :\n                d >= 2 ? 2 :\n                    d >= 1 ? 1 : getDecimalRoundNum(d);\n\n    return pow10 * d;\n}\n","import {extend} from '../util/util';\nimport {Event, Evented} from '../util/evented';\nimport {type MapMouseEvent} from './events';\nimport {DOM} from '../util/dom';\nimport {LngLat} from '../geo/lng_lat';\nimport Point from '@mapbox/point-geometry';\nimport {smartWrap} from '../util/smart_wrap';\nimport {anchorTranslate, applyAnchorClass} from './anchor';\n\nimport type {PositionAnchor} from './anchor';\nimport type {Map} from './map';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {PointLike} from './camera';\nimport type {PaddingOptions} from '../geo/edge_insets';\n\nconst defaultOptions = {\n    closeButton: true,\n    closeOnClick: true,\n    focusAfterOpen: true,\n    className: '',\n    maxWidth: '240px',\n    subpixelPositioning: false,\n    locationOccludedOpacity: undefined,\n    padding: undefined,\n};\n\n/**\n * A pixel offset specified as:\n *\n * - A single number specifying a distance from the location\n * - A {@link PointLike} specifying a constant offset\n * - An object of {@link PointLike}s specifying an offset for each anchor position\n *\n * Negative offsets indicate left and up.\n */\nexport type Offset = number | PointLike | {\n    [_ in PositionAnchor]: PointLike;\n};\n\n/**\n * The {@link Popup} options object\n */\nexport type PopupOptions = {\n    /**\n     * If `true`, a close button will appear in the top right corner of the popup.\n     * @defaultValue true\n     */\n    closeButton?: boolean;\n    /**\n     * If `true`, the popup will closed when the map is clicked.\n     * @defaultValue true\n     */\n    closeOnClick?: boolean;\n    /**\n     * If `true`, the popup will closed when the map moves.\n     * @defaultValue false\n     */\n    closeOnMove?: boolean;\n    /**\n     * If `true`, the popup will try to focus the first focusable element inside the popup.\n     * @defaultValue true\n     */\n    focusAfterOpen?: boolean;\n    /**\n     * A string indicating the part of the Popup that should\n     * be positioned closest to the coordinate set via {@link Popup.setLngLat}.\n     * Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`,\n     * `'top-right'`, `'bottom-left'`, and `'bottom-right'`. If unset the anchor will be\n     * dynamically set to ensure the popup falls within the map container with a preference\n     * for `'bottom'`.\n     */\n    anchor?: PositionAnchor;\n    /**\n     * A pixel offset applied to the popup's location\n     */\n    offset?: Offset;\n    /**\n     * Space-separated CSS class names to add to popup container\n     */\n    className?: string;\n    /**\n     * A string that sets the CSS property of the popup's maximum width, eg `'300px'`.\n     * To ensure the popup resizes to fit its content, set this property to `'none'`.\n     * Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n     * @defaultValue '240px'\n     */\n    maxWidth?: string;\n    /**\n     * If `true`, rounding is disabled for placement of the popup, allowing for\n     * subpixel positioning and smoother movement when the popup is translated.\n     * @defaultValue false\n     */\n    subpixelPositioning?: boolean;\n    /**\n     * Optional opacity when the location is behind the globe.\n     * Note that if a number is provided, it will be converted to a string.\n     * @defaultValue undefined\n     */\n    locationOccludedOpacity?: number | string;\n    /**\n     * A pixel padding applied to the popup's positioning constraints.\n     * The popup will be positioned to avoid being placed within this padding area\n     * from the edges of the map container.\n     * @defaultValue undefined\n     */\n    padding?: PaddingOptions;\n};\n\nconst focusQuerySelector = [\n    'a[href]',\n    '[tabindex]:not([tabindex=\\'-1\\'])',\n    '[contenteditable]:not([contenteditable=\\'false\\'])',\n    'button:not([disabled])',\n    'input:not([disabled])',\n    'select:not([disabled])',\n    'textarea:not([disabled])',\n].join(', ');\n\n/**\n * A popup component.\n *\n * @group Markers and Controls\n *\n *\n * @example\n * Create a popup\n * ```ts\n * let popup = new Popup();\n * // Set an event listener that will fire\n * // any time the popup is opened\n * popup.on('open', () => {\n *   console.log('popup was opened');\n * });\n * ```\n *\n * @example\n * Create a popup\n * ```ts\n * let popup = new Popup();\n * // Set an event listener that will fire\n * // any time the popup is closed\n * popup.on('close', () => {\n *   console.log('popup was closed');\n * });\n * ```\n *\n * @example\n * ```ts\n * let markerHeight = 50, markerRadius = 10, linearOffset = 25;\n * let popupOffsets = {\n *  'top': [0, 0],\n *  'top-left': [0,0],\n *  'top-right': [0,0],\n *  'bottom': [0, -markerHeight],\n *  'bottom-left': [linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n *  'bottom-right': [-linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n *  'left': [markerRadius, (markerHeight - markerRadius) * -1],\n *  'right': [-markerRadius, (markerHeight - markerRadius) * -1]\n *  };\n * let popup = new Popup({offset: popupOffsets, className: 'my-class'})\n *   .setLngLat(e.lngLat)\n *   .setHTML(\"<h1>Hello World!</h1>\")\n *   .setMaxWidth(\"300px\")\n *   .addTo(map);\n * ```\n * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup/)\n * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\n *\n * ## Events\n *\n * **Event** `open` of type {@link Event} will be fired when the popup is opened manually or programmatically.\n *\n * **Event** `close` of type {@link Event} will be fired when the popup is closed manually or programmatically.\n */\nexport class Popup extends Evented {\n    _map: Map;\n    options: PopupOptions;\n    _content: HTMLElement;\n    _container: HTMLElement;\n    _closeButton: HTMLButtonElement;\n    _tip: HTMLElement;\n    _lngLat: LngLat;\n    _trackPointer: boolean;\n    _pos: Point;\n    _flatPos: Point;\n\n    /**\n     * @param options - the options\n     */\n    constructor(options?: PopupOptions) {\n        super();\n        this.options = extend(Object.create(defaultOptions), options);\n    }\n\n    /**\n     * Adds the popup to a map.\n     *\n     * @param map - The MapLibre GL JS map to add the popup to.\n     * @example\n     * ```ts\n     * new Popup()\n     *   .setLngLat([0, 0])\n     *   .setHTML(\"<h1>Null Island</h1>\")\n     *   .addTo(map);\n     * ```\n     * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     * @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js/docs/examples/show-polygon-information-on-click/)\n     */\n    addTo(map: Map): this {\n        if (this._map) this.remove();\n\n        this._map = map;\n        if (this.options.closeOnClick) {\n            this._map.on('click', this._onClose);\n        }\n\n        if (this.options.closeOnMove) {\n            this._map.on('move', this._onClose);\n        }\n\n        this._map.on('remove', this.remove);\n        this._update();\n        this._focusFirstElement();\n\n        if (this._trackPointer) {\n            this._map.on('mousemove', this._onMouseMove);\n            this._map.on('mouseup', this._onMouseUp);\n            if (this._container) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.add('maplibregl-track-pointer');\n        } else {\n            this._map.on('move', this._update);\n        }\n\n        this.fire(new Event('open'));\n\n        return this;\n    }\n\n    /**\n     * Add opacity to popup if in globe projection and location is behind view\n     */\n    _updateOpacity = () => {\n        if (this.options.locationOccludedOpacity === undefined) {\n            return;\n        }\n        if (this._map.transform.isLocationOccluded(this.getLngLat())) {\n            this._container.style.opacity = `${this.options.locationOccludedOpacity}`;\n        } else {\n            this._container.style.opacity = '';\n        }\n    };\n\n    /**\n     * @returns `true` if the popup is open, `false` if it is closed.\n     */\n    isOpen() {\n        return !!this._map;\n    }\n\n    /**\n     * Removes the popup from the map it has been added to.\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup().addTo(map);\n     * popup.remove();\n     * ```\n     */\n    remove = (): this => {\n        if (this._content) {\n            DOM.remove(this._content);\n        }\n\n        if (this._container) {\n            DOM.remove(this._container);\n            delete this._container;\n        }\n\n        if (this._map) {\n            this._map.off('move', this._update);\n            this._map.off('move', this._onClose);\n            this._map.off('click', this._onClose);\n            this._map.off('remove', this.remove);\n            this._map.off('mousemove', this._onMouseMove);\n            this._map.off('mouseup', this._onMouseUp);\n            this._map.off('drag', this._onDrag);\n            this._map._canvasContainer.classList.remove('maplibregl-track-pointer');\n            delete this._map;\n            this.fire(new Event('close'));\n        }\n\n        return this;\n    };\n\n    /**\n     * Returns the geographical location of the popup's anchor.\n     *\n     * The longitude of the result may differ by a multiple of 360 degrees from the longitude previously\n     * set by `setLngLat` because `Popup` wraps the anchor longitude across copies of the world to keep\n     * the popup on screen.\n     *\n     * @returns The geographical location of the popup's anchor.\n     */\n    getLngLat(): LngLat {\n        return this._lngLat;\n    }\n\n    /**\n     * Sets the geographical location of the popup's anchor, and moves the popup to it. Replaces trackPointer() behavior.\n     *\n     * @param lnglat - The geographical location to set as the popup's anchor.\n     */\n    setLngLat(lnglat: LngLatLike): this {\n        this._lngLat = LngLat.convert(lnglat);\n        this._pos = null;\n        this._flatPos = null;\n\n        this._trackPointer = false;\n\n        this._update();\n\n        if (this._map) {\n            this._map.on('move', this._update);\n            this._map.off('mousemove', this._onMouseMove);\n            if (this._container) {\n                this._container.classList.remove('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.remove('maplibregl-track-pointer');\n        }\n\n        return this;\n    }\n\n    /**\n     * Tracks the popup anchor to the cursor position on screens with a pointer device (it will be hidden on touchscreens). Replaces the `setLngLat` behavior.\n     * For most use cases, set `closeOnClick` and `closeButton` to `false`.\n     * @example\n     * ```ts\n     * let popup = new Popup({ closeOnClick: false, closeButton: false })\n     *   .setHTML(\"<h1>Hello World!</h1>\")\n     *   .trackPointer()\n     *   .addTo(map);\n     * ```\n     */\n    trackPointer(): this {\n        this._trackPointer = true;\n        this._pos = null;\n        this._flatPos = null;\n        this._update();\n        if (this._map) {\n            this._map.off('move', this._update);\n            this._map.on('mousemove', this._onMouseMove);\n            this._map.on('drag', this._onDrag);\n            if (this._container) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.add('maplibregl-track-pointer');\n        }\n\n        return this;\n\n    }\n\n    /**\n     * Returns the `Popup`'s HTML element.\n     * @example\n     * Change the `Popup` element's font size\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat([-96, 37.8])\n     *   .setHTML(\"<p>Hello World!</p>\")\n     *   .addTo(map);\n     * let popupElem = popup.getElement();\n     * popupElem.style.fontSize = \"25px\";\n     * ```\n     * @returns element\n     */\n    getElement(): HTMLElement {\n        return this._container;\n    }\n\n    /**\n     * Sets the popup's content to a string of text.\n     *\n     * This function creates a [Text](https://developer.mozilla.org/en-US/docs/Web/API/Text) node in the DOM,\n     * so it cannot insert raw HTML. Use this method for security against XSS\n     * if the popup content is user-provided.\n     *\n     * @param text - Textual content for the popup.\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setText('Hello, world!')\n     *   .addTo(map);\n     * ```\n     */\n    setText(text: string): this {\n        return this.setDOMContent(document.createTextNode(text));\n    }\n\n    /**\n     * Sets the popup's content to the HTML provided as a string.\n     *\n     * This method does not perform HTML filtering or sanitization, and must be\n     * used only with trusted content. Consider {@link Popup.setText} if\n     * the content is an untrusted text string.\n     *\n     * @param html - A string representing HTML content for the popup.\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setHTML(\"<h1>Hello World!</h1>\")\n     *   .addTo(map);\n     * ```\n     * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-popup-on-click/)\n     * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/attach-a-popup-to-a-marker-instance/)\n     */\n    setHTML(html: string): this {\n        const frag = document.createDocumentFragment();\n        const temp = document.createElement('body');\n        let child: ChildNode;\n        temp.innerHTML = html;\n        while (true) {\n            child = temp.firstChild;\n            if (!child) break;\n            frag.appendChild(child);\n        }\n\n        return this.setDOMContent(frag);\n    }\n\n    /**\n     * Returns the popup's maximum width.\n     *\n     * @returns The maximum width of the popup.\n     */\n    getMaxWidth(): string {\n        return this._container?.style.maxWidth;\n    }\n\n    /**\n     * Sets the popup's maximum width. This is setting the CSS property `max-width`.\n     * Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n     *\n     * @param maxWidth - A string representing the value for the maximum width.\n     */\n    setMaxWidth(maxWidth: string): this {\n        this.options.maxWidth = maxWidth;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Sets the popup's content to the element provided as a DOM node.\n     *\n     * @param htmlNode - A DOM node to be used as content for the popup.\n     * @example\n     * Create an element with the popup content\n     * ```ts\n     * let div = document.createElement('div');\n     * div.innerHTML = 'Hello, world!';\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setDOMContent(div)\n     *   .addTo(map);\n     * ```\n     */\n    setDOMContent(htmlNode: Node): this {\n        if (this._content) {\n            // Clear out children first.\n            while (this._content.hasChildNodes()) {\n                if (this._content.firstChild) {\n                    this._content.removeChild(this._content.firstChild);\n                }\n            }\n        } else {\n            this._content = DOM.create('div', 'maplibregl-popup-content', this._container);\n        }\n\n        // The close button should be the last tabbable element inside the popup for a good keyboard UX.\n        this._content.appendChild(htmlNode);\n        this._createCloseButton();\n        this._update();\n        this._focusFirstElement();\n        return this;\n    }\n\n    /**\n     * Adds a CSS class to the popup container element.\n     *\n     * @param className - Non-empty string with CSS class name to add to popup container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.addClassName('some-class')\n     * ```\n     */\n    addClassName(className: string) {\n        if (this._container) {\n            this._container.classList.add(className);\n        }\n        return this;\n    }\n\n    /**\n     * Removes a CSS class from the popup container element.\n     *\n     * @param className - Non-empty string with CSS class name to remove from popup container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.removeClassName('some-class')\n     * ```\n     */\n    removeClassName(className: string) {\n        if (this._container) {\n            this._container.classList.remove(className);\n        }\n        return this;\n    }\n\n    /**\n     * Sets the popup's offset.\n     *\n     * @param offset - Sets the popup's offset.\n     */\n    setOffset (offset?: Offset): this {\n        this.options.offset = offset;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Add or remove the given CSS class on the popup container, depending on whether the container currently has that class.\n     *\n     * @param className - Non-empty string with CSS class name to add/remove\n     *\n     * @returns if the class was removed return false, if class was added, then return true, undefined if there is no container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.toggleClassName('toggleClass')\n     * ```\n     */\n    toggleClassName(className: string): boolean | undefined {\n        if (this._container) {\n            return this._container.classList.toggle(className);\n        }\n    }\n\n    /**\n     * Set the option to allow subpixel positioning of the popup by passing a boolean\n     *\n     * @param value - When boolean is true, subpixel positioning is enabled for the popup.\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.setSubpixelPositioning(true);\n     * ```\n     */\n    setSubpixelPositioning(value: boolean) {\n        this.options.subpixelPositioning = value;\n    }\n\n    /**\n     * Sets the popup's padding constraints for positioning.\n     *\n     * @param padding - The padding to apply as a {@link PaddingOptions} object.\n     * @example\n     * ```ts\n     * popup.setPadding({ top: 10, right: 20, bottom: 30, left: 40 });\n     * ```\n     */\n    setPadding(padding?: PaddingOptions) {\n        this.options.padding = padding;\n        this._update();\n    }\n\n    _createCloseButton() {\n        if (this.options.closeButton) {\n            this._closeButton = DOM.create('button', 'maplibregl-popup-close-button', this._content);\n            this._closeButton.type = 'button';\n            this._closeButton.innerHTML = '&#215;';\n            this._closeButton.addEventListener('click', this._onClose);\n        }\n    }\n\n    _onMouseUp = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _onMouseMove = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _onDrag = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _update = (cursor?: Point) => {\n        const hasPosition = this._lngLat || this._trackPointer;\n\n        if (!this._map || !hasPosition || !this._content) { return; }\n\n        if (!this._container) {\n            this._container = DOM.create('div', 'maplibregl-popup', this._map.getContainer());\n            this._tip       = DOM.create('div', 'maplibregl-popup-tip', this._container);\n            this._container.appendChild(this._content);\n            if (this.options.className) {\n                for (const name of this.options.className.split(' ')) {\n                    this._container.classList.add(name);\n                }\n            }\n\n            if (this._closeButton) {\n                this._closeButton.setAttribute('aria-label', this._map._getUIString('Popup.Close'));\n            }\n\n            if (this._trackPointer) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n        }\n\n        if (this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth) {\n            this._container.style.maxWidth = this.options.maxWidth;\n        }\n\n        this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform, this._trackPointer);\n\n        if (this._trackPointer && !cursor) return;\n\n        const pos = this._flatPos = this._pos = this._trackPointer && cursor ? cursor : this._map.project(this._lngLat);\n        if (this._map.terrain) {\n            // flat position is saved because smartWrap needs non-elevated points\n            this._flatPos = this._trackPointer && cursor ? cursor : this._map.transform.locationToScreenPoint(this._lngLat);\n        }\n\n        let anchor = this.options.anchor;\n        const offset = normalizeOffset(this.options.offset);\n\n        if (!anchor) {\n            const width = this._container.offsetWidth;\n            const height = this._container.offsetHeight;\n            const padding = normalizePadding(this.options.padding);\n            let anchorComponents;\n\n            if (pos.y + offset.bottom.y < height + padding.top) {\n                anchorComponents = ['top'];\n            } else if (pos.y > this._map.transform.height - height - padding.bottom) {\n                anchorComponents = ['bottom'];\n            } else {\n                anchorComponents = [];\n            }\n\n            if (pos.x < width / 2 + padding.left) {\n                anchorComponents.push('left');\n            } else if (pos.x > this._map.transform.width - width / 2 - padding.right) {\n                anchorComponents.push('right');\n            }\n\n            if (anchorComponents.length === 0) {\n                anchor = 'bottom';\n            } else {\n                anchor = (anchorComponents.join('-') as any);\n            }\n        }\n\n        let offsetedPos = pos.add(offset[anchor]);\n\n        if (!this.options.subpixelPositioning) {\n            offsetedPos = offsetedPos.round();\n        }\n\n        DOM.setTransform(this._container, `${anchorTranslate[anchor]} translate(${offsetedPos.x}px,${offsetedPos.y}px)`);\n        applyAnchorClass(this._container, anchor, 'popup');\n\n        this._updateOpacity();\n    };\n\n    _focusFirstElement() {\n        if (!this.options.focusAfterOpen || !this._container) return;\n\n        const firstFocusable = this._container.querySelector(focusQuerySelector) as HTMLElement;\n\n        if (firstFocusable) firstFocusable.focus();\n    }\n\n    _onClose = () => {\n        this.remove();\n    };\n}\n\nfunction normalizeOffset(offset?: Offset | null) {\n    if (!offset) {\n        return normalizeOffset(new Point(0, 0));\n\n    } else if (typeof offset === 'number') {\n        // input specifies a radius from which to calculate offsets at all positions\n        const cornerOffset = Math.round(Math.abs(offset) / Math.SQRT2);\n        return {\n            'center': new Point(0, 0),\n            'top': new Point(0, offset),\n            'top-left': new Point(cornerOffset, cornerOffset),\n            'top-right': new Point(-cornerOffset, cornerOffset),\n            'bottom': new Point(0, -offset),\n            'bottom-left': new Point(cornerOffset, -cornerOffset),\n            'bottom-right': new Point(-cornerOffset, -cornerOffset),\n            'left': new Point(offset, 0),\n            'right': new Point(-offset, 0)\n        };\n\n    } else if (offset instanceof Point || Array.isArray(offset)) {\n        // input specifies a single offset to be applied to all positions\n        const convertedOffset = Point.convert(offset);\n        return {\n            'center': convertedOffset,\n            'top': convertedOffset,\n            'top-left': convertedOffset,\n            'top-right': convertedOffset,\n            'bottom': convertedOffset,\n            'bottom-left': convertedOffset,\n            'bottom-right': convertedOffset,\n            'left': convertedOffset,\n            'right': convertedOffset\n        };\n\n    } else {\n        // input specifies an offset per position\n        return {\n            'center': Point.convert(offset['center'] || [0, 0]),\n            'top': Point.convert(offset['top'] || [0, 0]),\n            'top-left': Point.convert(offset['top-left'] || [0, 0]),\n            'top-right': Point.convert(offset['top-right'] || [0, 0]),\n            'bottom': Point.convert(offset['bottom'] || [0, 0]),\n            'bottom-left': Point.convert(offset['bottom-left'] || [0, 0]),\n            'bottom-right': Point.convert(offset['bottom-right'] || [0, 0]),\n            'left': Point.convert(offset['left'] || [0, 0]),\n            'right': Point.convert(offset['right'] || [0, 0])\n        };\n    }\n}\n\nfunction normalizePadding(padding?: PaddingOptions | null): {top: number; right: number; bottom: number; left: number} {\n    if (!padding) {\n        return {top: 0, right: 0, bottom: 0, left: 0};\n    }\n\n    return {\n        top: padding.top ?? 0,\n        right: padding.right ?? 0,\n        bottom: padding.bottom ?? 0,\n        left: padding.left ?? 0\n    };\n}\n","import packageJSON from '../package.json' with {type: 'json'};\nimport {Map, type MapOptions, type WebGLContextAttributesWithType} from './ui/map';\nimport {NavigationControl, type NavigationControlOptions} from './ui/control/navigation_control';\nimport {GeolocateControl, type GeolocateControlOptions} from './ui/control/geolocate_control';\nimport {AttributionControl, type AttributionControlOptions} from './ui/control/attribution_control';\nimport {LogoControl, type LogoControlOptions} from './ui/control/logo_control';\nimport {ScaleControl, type ScaleControlOptions, type Unit} from './ui/control/scale_control';\nimport {FullscreenControl, type FullscreenControlOptions} from './ui/control/fullscreen_control';\nimport {TerrainControl} from './ui/control/terrain_control';\nimport {GlobeControl} from './ui/control/globe_control';\nimport {type Offset, Popup, type PopupOptions} from './ui/popup';\nimport {type Alignment, Marker, type MarkerOptions} from './ui/marker';\nimport {type AddLayerObject, type FeatureIdentifier, Style, type StyleOptions, type StyleSetterOptions, type StyleSwapOptions, type TransformStyleFunction} from './style/style';\nimport {LngLat, type LngLatLike} from './geo/lng_lat';\nimport {LngLatBounds, type LngLatBoundsLike} from './geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from './geo/mercator_coordinate';\nimport {Evented, type ErrorEvent, Event, type Listener} from './util/evented';\nimport {type AddProtocolAction, config} from './util/config';\nimport {rtlMainThreadPluginFactory} from './source/rtl_text_plugin_main_thread';\nimport {now, setNow, restoreNow, isTimeFrozen} from './util/time_control';\nimport {WorkerPool} from './util/worker_pool';\nimport {prewarm, clearPrewarmedResources} from './util/global_worker_pool';\nimport {AJAXError, type ExpiryData, type GetResourceResponse, type RequestParameters} from './util/ajax';\nimport {GeoJSONSource, type SetClusterOptions} from './source/geojson_source';\nimport {CanvasSource, type CanvasSourceSpecification} from './source/canvas_source';\nimport {type CanonicalTileRange, type Coordinates, ImageSource, type UpdateImageOptions} from './source/image_source';\nimport {RasterDEMTileSource} from './source/raster_dem_tile_source';\nimport {RasterTileSource} from './source/raster_tile_source';\nimport {VectorTileSource} from './source/vector_tile_source';\nimport {VideoSource} from './source/video_source';\nimport {type Source, type SourceClass, addSourceType} from './source/source';\nimport {addProtocol, removeProtocol} from './source/protocol_crud';\nimport {type Dispatcher, getGlobalDispatcher} from './util/dispatcher';\nimport {EdgeInsets, type PaddingOptions} from './geo/edge_insets';\nimport {type MapTerrainEvent, type MapStyleImageMissingEvent, type MapStyleDataEvent, type MapSourceDataEvent, type MapLibreZoomEvent, type MapLibreEvent, type MapLayerTouchEvent, type MapLayerMouseEvent, type MapLayerEventType, type MapEventType, type MapDataEvent, type MapContextEvent, MapWheelEvent, MapTouchEvent, MapMouseEvent, type MapSourceDataType, type MapProjectionEvent} from './ui/events';\nimport {BoxZoomHandler} from './ui/handler/box_zoom';\nimport {DragRotateHandler} from './ui/handler/shim/drag_rotate';\nimport {DragPanHandler, type DragPanOptions} from './ui/handler/shim/drag_pan';\nimport {ScrollZoomHandler} from './ui/handler/scroll_zoom';\nimport {TwoFingersTouchZoomRotateHandler} from './ui/handler/shim/two_fingers_touch';\nimport {Hash} from './ui/hash';\nimport {CooperativeGesturesHandler, type GestureOptions} from './ui/handler/cooperative_gestures';\nimport {DoubleClickZoomHandler} from './ui/handler/shim/dblclick_zoom';\nimport {KeyboardHandler} from './ui/handler/keyboard';\nimport {TwoFingersTouchPitchHandler, TwoFingersTouchRotateHandler, TwoFingersTouchZoomHandler, type AroundCenterOptions} from './ui/handler/two_fingers_touch';\nimport {MessageType, type ActorMessage, type RequestResponseMessageMap} from './util/actor_messages';\nimport {createTileMesh, type CreateTileMeshOptions, type IndicesType, type TileMesh} from './util/create_tile_mesh';\nimport type {ControlPosition, IControl} from './ui/control/control';\nimport type {CustomRenderMethod, CustomLayerInterface, CustomRenderMethodInput} from './style/style_layer/custom_style_layer';\nimport type {AnimationOptions, CameraForBoundsOptions, CameraOptions, CameraUpdateTransformFunction, CenterZoomBearing, EaseToOptions, FitBoundsOptions, FlyToOptions, JumpToOptions, PointLike} from './ui/camera';\nimport type {DistributiveKeys, DistributiveOmit, GeoJSONFeature, MapGeoJSONFeature} from './util/vectortile_to_geojson';\nimport type {Handler, HandlerResult} from './ui/handler_manager';\nimport type {Complete, RequireAtLeastOne, Subscription} from './util/util';\nimport type {CalculateTileZoomFunction, CoveringTilesOptions} from './geo/projection/covering_tiles';\nimport type {TransformConstrainFunction} from './geo/transform_interface';\nimport type {StyleImage, StyleImageData, StyleImageInterface, StyleImageMetadata, TextFit} from './style/style_image';\nimport type {StyleLayer} from './style/style_layer';\nimport type {Tile} from './tile/tile';\nimport type {GeoJSONFeatureDiff, GeoJSONFeatureId, GeoJSONSourceDiff} from './source/geojson_source_diff';\nimport type {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions} from './source/query_features';\nimport type {RequestTransformFunction, ResourceType} from './util/request_manager';\nimport type {OverscaledTileID} from './tile/tile_id';\nimport type {PositionAnchor} from './ui/anchor';\nimport type {ProjectionData} from './geo/projection/projection_data';\nimport type {WorkerTileResult} from './source/worker_source';\nimport type {Actor, IActor} from './util/actor';\nimport type {Bucket} from './data/bucket';\nimport type {CollisionBoxArray} from './data/array_types.g';\nimport type {AlphaImage} from './util/image';\nimport type {GlyphPosition, GlyphPositions} from './render/glyph_atlas';\nimport type {ImageAtlas} from './render/image_atlas';\nimport type {StyleGlyph} from './style/style_glyph';\nimport type {FeatureIndex} from './data/feature_index';\nimport type {DashEntry} from './render/line_atlas';\nconst version = packageJSON.version;\n\nexport type * from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).\n * Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.\n *\n * @param pluginURL - URL pointing to the Mapbox RTL text plugin source.\n * @param lazy - If set to `true`, maplibre will defer loading the plugin until rtl text is encountered,\n * rtl text will then be rendered only after the plugin finishes loading.\n * @example\n * ```ts\n * setRTLTextPlugin('https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js', false);\n * ```\n * @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js/docs/examples/mapbox-gl-rtl-text/)\n */\nfunction setRTLTextPlugin(pluginURL: string, lazy: boolean): Promise<void> {\n    return rtlMainThreadPluginFactory().setRTLTextPlugin(pluginURL, lazy);\n}\n/**\n * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.\n * The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.\n * If the status is `loaded` and the plugin is requested again, an error will be thrown.\n *\n * @example\n * ```ts\n * const pluginStatus = getRTLTextPluginStatus();\n * ```\n */\nfunction getRTLTextPluginStatus(): string {\n    return rtlMainThreadPluginFactory().getRTLTextPluginStatus();\n}\n/**\n * Returns the package version of the library\n * @returns Package version of the library\n */\nfunction getVersion() { return version; }\n/**\n * Gets the number of web workers instantiated on a page with GL JS maps.\n * By default, workerCount is 1 except for Safari browser where it is set to half the number of CPU cores (capped at 3).\n * Make sure to set this property before creating any map instances for it to have effect.\n *\n * @returns Number of workers currently configured.\n * @example\n * ```ts\n * const workerCount = getWorkerCount()\n * ```\n */\nfunction getWorkerCount() { return WorkerPool.workerCount; }\n/**\n * Sets the number of web workers instantiated on a page with GL JS maps.\n * By default, workerCount is 1 except for Safari browser where it is set to half the number of CPU cores (capped at 3).\n * Make sure to set this property before creating any map instances for it to have effect.\n *\n * @example\n * ```ts\n * setWorkerCount(2);\n * ```\n */\nfunction setWorkerCount(count: number) { WorkerPool.workerCount = count; }\n/**\n * Gets and sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,\n * which affects performance in raster-heavy maps. 16 by default.\n *\n * @returns Number of parallel requests currently configured.\n * @example\n * ```ts\n * getMaxParallelImageRequests();\n * ```\n */\nfunction getMaxParallelImageRequests() { return config.MAX_PARALLEL_IMAGE_REQUESTS; }\n/**\n * Sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,\n * which affects performance in raster-heavy maps. 16 by default.\n *\n * @example\n * ```ts\n * setMaxParallelImageRequests(10);\n * ```\n */\nfunction setMaxParallelImageRequests(numRequests: number) { config.MAX_PARALLEL_IMAGE_REQUESTS = numRequests; }\n/**\n * Gets the worker url\n * @returns The worker url\n */\nfunction getWorkerUrl() { return config.WORKER_URL; }\n/**\n * Sets the worker url\n */\nfunction setWorkerUrl(value: string) { config.WORKER_URL = value; }\n/**\n * Allows loading javascript code in the worker thread.\n * *Note* that since this is using some very internal classes and flows it is considered experimental and can break at any point.\n *\n * It can be useful for the following examples:\n * 1. Using `self.addProtocol` in the worker thread - note that you might need to also register the protocol on the main thread.\n * 2. Using `self.registerWorkerSource(workerSource: WorkerSource)` to register a worker source, which should come with `addSourceType` usually.\n * 3. using `self.actor.registerMessageHandler` to override some internal worker operations\n * @param workerUrl - the worker url e.g. a url of a javascript file to load in the worker\n * @returns\n *\n * @example\n * ```ts\n * // below is an example of sending a js file to the worker to load the method there\n * // Note that you'll need to call the global function `addProtocol` in the worker to register the protocol there.\n * // add-protocol-worker.js\n * async function loadFn(params, abortController) {\n *     const t = await fetch(`https://${params.url.split(\"://\")[1]}`);\n *     if (t.status == 200) {\n *         const buffer = await t.arrayBuffer();\n *         return {data: buffer}\n *     } else {\n *         throw new Error(`Tile fetch error: ${t.statusText}`);\n *     }\n * }\n * self.addProtocol('custom', loadFn);\n *\n * // main.js\n * importScriptInWorkers('add-protocol-worker.js');\n * ```\n */\nfunction importScriptInWorkers(workerUrl: string) { return getGlobalDispatcher().broadcast(MessageType.importScript, workerUrl); }\n\nexport {\n    Map,\n    NavigationControl,\n    GeolocateControl,\n    AttributionControl,\n    LogoControl,\n    ScaleControl,\n    FullscreenControl,\n    TerrainControl,\n    GlobeControl,\n    Hash,\n    Popup,\n    Marker,\n    Style,\n    LngLat,\n    LngLatBounds,\n    Point,\n    MercatorCoordinate,\n    Evented,\n    Event,\n    AJAXError,\n    config,\n    CanvasSource,\n    GeoJSONSource,\n    ImageSource,\n    RasterDEMTileSource,\n    RasterTileSource,\n    VectorTileSource,\n    VideoSource,\n    EdgeInsets,\n    BoxZoomHandler,\n    DragRotateHandler,\n    DragPanHandler,\n    ScrollZoomHandler,\n    TwoFingersTouchZoomRotateHandler,\n    CooperativeGesturesHandler,\n    DoubleClickZoomHandler,\n    KeyboardHandler,\n    TwoFingersTouchZoomHandler,\n    TwoFingersTouchRotateHandler,\n    TwoFingersTouchPitchHandler,\n    MapWheelEvent,\n    MapTouchEvent,\n    MapMouseEvent,\n    type Handler,\n    type RequireAtLeastOne,\n    type CameraUpdateTransformFunction,\n    type TransformConstrainFunction,\n    type CustomRenderMethod,\n    type CalculateTileZoomFunction,\n    type MapSourceDataType,\n    type TileMesh,\n    type CreateTileMeshOptions,\n    type ControlPosition,\n    type Subscription,\n    type Complete,\n    type CameraOptions,\n    type CenterZoomBearing,\n    type StyleImage,\n    type StyleImageData,\n    type StyleImageMetadata,\n    type StyleLayer,\n    type GetResourceResponse,\n    type MapGeoJSONFeature,\n    type Alignment,\n    type AddProtocolAction,\n    type SourceClass,\n    type IndicesType,\n    type AttributionControlOptions,\n    type CanonicalTileRange,\n    type Tile,\n    type Listener,\n    type Coordinates,\n    type UpdateImageOptions,\n    type DragPanOptions,\n    type FullscreenControlOptions,\n    type SetClusterOptions,\n    type GeoJSONSourceDiff,\n    type GeolocateControlOptions,\n    type LogoControlOptions,\n    type StyleImageInterface,\n    type AddLayerObject,\n    type StyleSetterOptions,\n    type CameraForBoundsOptions,\n    type EaseToOptions,\n    type FitBoundsOptions,\n    type FlyToOptions,\n    type FeatureIdentifier,\n    type JumpToOptions,\n    type QueryRenderedFeaturesOptions,\n    type QuerySourceFeatureOptions,\n    type AnimationOptions,\n    type StyleSwapOptions,\n    type StyleOptions,\n    type RequestTransformFunction,\n    type MarkerOptions,\n    type NavigationControlOptions,\n    type PopupOptions,\n    type Offset,\n    type OverscaledTileID,\n    type ScaleControlOptions,\n    type Unit,\n    type AroundCenterOptions,\n    type HandlerResult,\n    type CustomRenderMethodInput,\n    type ExpiryData,\n    type PositionAnchor,\n    type ProjectionData,\n    type GeoJSONFeatureId,\n    type GeoJSONFeatureDiff,\n    type TextFit,\n    type TransformStyleFunction,\n    type DistributiveOmit,\n    type DistributiveKeys,\n    type RequestParameters,\n    type RequestResponseMessageMap,\n    type WorkerTileResult,\n    type ResourceType,\n    type Dispatcher,\n    type Actor,\n    type IActor,\n    type ActorMessage,\n    type Bucket,\n    type CollisionBoxArray,\n    type FeatureIndex,\n    type AlphaImage,\n    type GlyphPositions,\n    type GlyphPosition,\n    type ImageAtlas,\n    type MessageType,\n    type StyleGlyph,\n    type MapOptions,\n    type GestureOptions,\n    type WebGLContextAttributesWithType,\n    type IControl,\n    type CustomLayerInterface,\n    type CanvasSourceSpecification,\n    type PaddingOptions,\n    type LngLatLike,\n    type PointLike,\n    type LngLatBoundsLike,\n    type Source,\n    type MapProjectionEvent,\n    type MapTerrainEvent,\n    type MapStyleImageMissingEvent,\n    type MapStyleDataEvent,\n    type MapSourceDataEvent,\n    type MapLibreZoomEvent,\n    type MapLibreEvent,\n    type MapLayerTouchEvent,\n    type MapLayerMouseEvent,\n    type MapLayerEventType,\n    type MapEventType,\n    type MapDataEvent,\n    type MapContextEvent,\n    type ErrorEvent,\n    type GeoJSONFeature,\n    type CoveringTilesOptions,\n    type DashEntry,\n    setRTLTextPlugin,\n    getRTLTextPluginStatus,\n    prewarm,\n    clearPrewarmedResources,\n    getVersion,\n    getWorkerCount,\n    setWorkerCount,\n    getMaxParallelImageRequests,\n    setMaxParallelImageRequests,\n    getWorkerUrl,\n    setWorkerUrl,\n    addProtocol,\n    removeProtocol,\n    addSourceType,\n    importScriptInWorkers,\n    createTileMesh,\n    now,\n    setNow,\n    restoreNow,\n    isTimeFrozen\n};\n","import {DOM} from '../../util/dom';\n\nimport {warnOnce} from '../../util/util';\n\nimport {Event, Evented} from '../../util/evented';\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * The {@link FullscreenControl} options object\n */\nexport type FullscreenControlOptions = {\n    /**\n     * `container` is the [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen. By default, the map container element will be made full screen.\n     */\n    container?: HTMLElement;\n};\n\n/**\n * A `FullscreenControl` control contains a button for toggling the map in and out of fullscreen mode.\n * When [requestFullscreen](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen) is not supported, fullscreen is handled via CSS properties.\n * The map's `cooperativeGestures` option is temporarily disabled while the map\n * is in fullscreen mode, and is restored when the map exist fullscreen mode.\n *\n * @group Markers and Controls\n * @param options - the full screen control options\n *\n * @example\n * ```ts\n * map.addControl(new FullscreenControl({container: document.querySelector('body')}));\n * ```\n * @see [View a fullscreen map](https://maplibre.org/maplibre-gl-js/docs/examples/fullscreen/)\n *\n * ## Events\n *\n * **Event** `fullscreenstart` of type {@link Event} will be fired when fullscreen mode has started.\n *\n * **Event** `fullscreenend` of type {@link Event} will be fired when fullscreen mode has ended.\n */\nexport class FullscreenControl extends Evented implements IControl {\n    _map: Map;\n    _controlContainer: HTMLElement;\n    _fullscreen: boolean;\n    _fullscreenchange: string;\n    _fullscreenButton: HTMLButtonElement;\n    _container: HTMLElement;\n    _prevCooperativeGesturesEnabled: boolean;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: FullscreenControlOptions = {}) {\n        super();\n        this._fullscreen = false;\n\n        if (options && options.container) {\n            if (options.container instanceof HTMLElement) {\n                this._container = options.container;\n            } else {\n                warnOnce('Full screen control \\'container\\' must be a DOM element.');\n            }\n        }\n\n        if ('onfullscreenchange' in document) {\n            this._fullscreenchange = 'fullscreenchange';\n        } else if ('onmozfullscreenchange' in document) {\n            this._fullscreenchange = 'mozfullscreenchange';\n        } else if ('onwebkitfullscreenchange' in document) {\n            this._fullscreenchange = 'webkitfullscreenchange';\n        } else if ('onmsfullscreenchange' in document) {\n            this._fullscreenchange = 'MSFullscreenChange';\n        }\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map): HTMLElement {\n        this._map = map;\n        if (!this._container) this._container = this._map.getContainer();\n        this._controlContainer = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._setupUI();\n        return this._controlContainer;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._controlContainer);\n        this._map = null;\n        window.document.removeEventListener(this._fullscreenchange, this._onFullscreenChange);\n    }\n\n    _setupUI() {\n        const button = this._fullscreenButton = DOM.create('button', (('maplibregl-ctrl-fullscreen')), this._controlContainer);\n        DOM.create('span', 'maplibregl-ctrl-icon', button).setAttribute('aria-hidden', 'true');\n        button.type = 'button';\n        this._updateTitle();\n        this._fullscreenButton.addEventListener('click', this._onClickFullscreen);\n        window.document.addEventListener(this._fullscreenchange, this._onFullscreenChange);\n    }\n\n    _updateTitle() {\n        const title = this._getTitle();\n        this._fullscreenButton.setAttribute('aria-label', title);\n        this._fullscreenButton.title = title;\n    }\n\n    _getTitle() {\n        return this._map._getUIString(this._isFullscreen() ? 'FullscreenControl.Exit' : 'FullscreenControl.Enter');\n    }\n\n    _isFullscreen() {\n        return this._fullscreen;\n    }\n\n    _onFullscreenChange = () => {\n        let fullscreenElement =\n            window.document.fullscreenElement ||\n            (window.document as any).mozFullScreenElement ||\n            (window.document as any).webkitFullscreenElement ||\n            (window.document as any).msFullscreenElement;\n\n        while (fullscreenElement?.shadowRoot?.fullscreenElement) {\n            fullscreenElement = fullscreenElement.shadowRoot.fullscreenElement;\n        }\n\n        if ((fullscreenElement === this._container) !== this._fullscreen) {\n            this._handleFullscreenChange();\n        }\n    };\n\n    _handleFullscreenChange() {\n        this._fullscreen = !this._fullscreen;\n        this._fullscreenButton.classList.toggle('maplibregl-ctrl-shrink');\n        this._fullscreenButton.classList.toggle('maplibregl-ctrl-fullscreen');\n        this._updateTitle();\n\n        if (this._fullscreen) {\n            this.fire(new Event('fullscreenstart'));\n            this._prevCooperativeGesturesEnabled = this._map.cooperativeGestures.isEnabled();\n            this._map.cooperativeGestures.disable();\n        } else {\n            this.fire(new Event('fullscreenend'));\n            if (this._prevCooperativeGesturesEnabled) {\n                this._map.cooperativeGestures.enable();\n            }\n        }\n    }\n\n    _onClickFullscreen = () => {\n        if (this._isFullscreen()) {\n            this._exitFullscreen();\n        } else {\n            this._requestFullscreen();\n        }\n    };\n\n    _exitFullscreen() {\n        if (window.document.exitFullscreen) {\n            (window.document as any).exitFullscreen();\n        } else if ((window.document as any).mozCancelFullScreen) {\n            (window.document as any).mozCancelFullScreen();\n        } else if ((window.document as any).msExitFullscreen) {\n            (window.document as any).msExitFullscreen();\n        } else if ((window.document as any).webkitCancelFullScreen) {\n            (window.document as any).webkitCancelFullScreen();\n        } else {\n            this._togglePseudoFullScreen();\n        }\n    }\n\n    _requestFullscreen() {\n        if (this._container.requestFullscreen) {\n            this._container.requestFullscreen();\n        } else if ((this._container as any).mozRequestFullScreen) {\n            (this._container as any).mozRequestFullScreen();\n        } else if ((this._container as any).msRequestFullscreen) {\n            (this._container as any).msRequestFullscreen();\n        } else if ((this._container as any).webkitRequestFullscreen) {\n            (this._container as any).webkitRequestFullscreen();\n        } else {\n            this._togglePseudoFullScreen();\n        }\n    }\n\n    _togglePseudoFullScreen() {\n        this._container.classList.toggle('maplibregl-pseudo-fullscreen');\n        this._handleFullscreenChange();\n        this._map.resize();\n    }\n}\n","import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * A `GlobeControl` control contains a button for toggling the map projection between \"mercator\" and \"globe\".\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let map = new Map()\n *     .addControl(new GlobeControl());\n * ```\n * \n * @see [Display a globe with a fill extrusion layer](https://maplibre.org/maplibre-gl-js/docs/examples/display-a-globe-with-a-fill-extrusion-layer/)\n */\nexport class GlobeControl implements IControl {\n    _map: Map;\n    _container: HTMLElement;\n    _globeButton: HTMLButtonElement;\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._globeButton = DOM.create('button', 'maplibregl-ctrl-globe', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._globeButton).setAttribute('aria-hidden', 'true');\n        this._globeButton.type = 'button';\n        this._globeButton.addEventListener('click', this._toggleProjection);\n\n        this._updateGlobeIcon();\n        this._map.on('styledata', this._updateGlobeIcon);\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('styledata', this._updateGlobeIcon);\n        this._globeButton.removeEventListener('click', this._toggleProjection);\n        this._map = undefined;\n    }\n\n    _toggleProjection = () => {\n        const currentProjection = this._map.getProjection()?.type;\n        if (currentProjection === 'mercator' || !currentProjection) {\n            this._map.setProjection({type: 'globe'});\n        } else {\n            this._map.setProjection({type: 'mercator'});\n        }\n        this._updateGlobeIcon();\n    };\n\n    _updateGlobeIcon = () => {\n        this._globeButton.classList.remove('maplibregl-ctrl-globe');\n        this._globeButton.classList.remove('maplibregl-ctrl-globe-enabled');\n        if (this._map.getProjection()?.type === 'globe') {\n            this._globeButton.classList.add('maplibregl-ctrl-globe-enabled');\n            this._globeButton.title = this._map._getUIString('GlobeControl.Disable');\n        } else {\n            this._globeButton.classList.add('maplibregl-ctrl-globe');\n            this._globeButton.title = this._map._getUIString('GlobeControl.Enable');\n        }\n    };\n}\n","import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\nimport type {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A `TerrainControl` control contains a button for turning the terrain on and off.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let map = new Map({TerrainControl: false})\n *     .addControl(new TerrainControl({\n *         source: \"terrain\"\n *     }));\n * ```\n */\nexport class TerrainControl implements IControl {\n    options: TerrainSpecification;\n    _map: Map;\n    _container: HTMLElement;\n    _terrainButton: HTMLButtonElement;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: TerrainSpecification) {\n        this.options = options;\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._terrainButton = DOM.create('button', 'maplibregl-ctrl-terrain', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._terrainButton).setAttribute('aria-hidden', 'true');\n        this._terrainButton.type = 'button';\n        this._terrainButton.addEventListener('click', this._toggleTerrain);\n\n        this._updateTerrainIcon();\n        this._map.on('terrain', this._updateTerrainIcon);\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('terrain', this._updateTerrainIcon);\n        this._map = undefined;\n    }\n\n    _toggleTerrain = () => {\n        if (this._map.getTerrain()) {\n            this._map.setTerrain(null);\n        } else {\n            this._map.setTerrain(this.options);\n        }\n        this._updateTerrainIcon();\n    };\n\n    _updateTerrainIcon = () => {\n        this._terrainButton.classList.remove('maplibregl-ctrl-terrain');\n        this._terrainButton.classList.remove('maplibregl-ctrl-terrain-enabled');\n        if (this._map.terrain) {\n            this._terrainButton.classList.add('maplibregl-ctrl-terrain-enabled');\n            this._terrainButton.title = this._map._getUIString('TerrainControl.Disable');\n        } else {\n            this._terrainButton.classList.add('maplibregl-ctrl-terrain');\n            this._terrainButton.title = this._map._getUIString('TerrainControl.Enable');\n        }\n    };\n}\n","//\n// Our custom intro provides a specialized \"define()\" function, called by the\n// AMD modules below, that sets up the worker blob URL and then executes the\n// main module, storing its exported value as 'maplibregl'\n\n// The three \"chunks\" imported here are produced by a first Rollup pass,\n// which outputs them as AMD modules.\n\n// Shared dependencies\nimport '../../staging/maplibregl/shared';\n\n// Worker and its unique dependencies\n// When this wrapper function is passed to our custom define() in build/rollup/bundle_prelude.js,\n// it gets stringified, together with the shared wrapper (using\n// Function.toString()), and the resulting string of code is made into a\n// Blob URL that gets used by the main module to create the web workers.\nimport '../../staging/maplibregl/worker';\n\n// Main module and its dependencies\nimport '../../staging/maplibregl/index';\n\nexport default maplibregl;\n","/*!\n * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com\n * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)\n * Copyright 2024 Fonticons, Inc.\n */\nfunction _defineProperty(e, r, t) {\n  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n    value: t,\n    enumerable: !0,\n    configurable: !0,\n    writable: !0\n  }) : e[r] = t, e;\n}\nfunction _inherits(t, e) {\n  if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n  t.prototype = Object.create(e && e.prototype, {\n    constructor: {\n      value: t,\n      writable: !0,\n      configurable: !0\n    }\n  }), Object.defineProperty(t, \"prototype\", {\n    writable: !1\n  }), e && _setPrototypeOf(t, e);\n}\nfunction ownKeys(e, r) {\n  var t = Object.keys(e);\n  if (Object.getOwnPropertySymbols) {\n    var o = Object.getOwnPropertySymbols(e);\n    r && (o = o.filter(function (r) {\n      return Object.getOwnPropertyDescriptor(e, r).enumerable;\n    })), t.push.apply(t, o);\n  }\n  return t;\n}\nfunction _objectSpread2(e) {\n  for (var r = 1; r < arguments.length; r++) {\n    var t = null != arguments[r] ? arguments[r] : {};\n    r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n      _defineProperty(e, r, t[r]);\n    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n    });\n  }\n  return e;\n}\nfunction _setPrototypeOf(t, e) {\n  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n    return t.__proto__ = e, t;\n  }, _setPrototypeOf(t, e);\n}\nfunction _toPrimitive(t, r) {\n  if (\"object\" != typeof t || !t) return t;\n  var e = t[Symbol.toPrimitive];\n  if (void 0 !== e) {\n    var i = e.call(t, r || \"default\");\n    if (\"object\" != typeof i) return i;\n    throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n  }\n  return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n  var i = _toPrimitive(t, \"string\");\n  return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _wrapRegExp() {\n  _wrapRegExp = function (e, r) {\n    return new BabelRegExp(e, void 0, r);\n  };\n  var e = RegExp.prototype,\n    r = new WeakMap();\n  function BabelRegExp(e, t, p) {\n    var o = RegExp(e, t);\n    return r.set(o, p || r.get(e)), _setPrototypeOf(o, BabelRegExp.prototype);\n  }\n  function buildGroups(e, t) {\n    var p = r.get(t);\n    return Object.keys(p).reduce(function (r, t) {\n      var o = p[t];\n      if (\"number\" == typeof o) r[t] = e[o];else {\n        for (var i = 0; void 0 === e[o[i]] && i + 1 < o.length;) i++;\n        r[t] = e[o[i]];\n      }\n      return r;\n    }, Object.create(null));\n  }\n  return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (r) {\n    var t = e.exec.call(this, r);\n    if (t) {\n      t.groups = buildGroups(t, this);\n      var p = t.indices;\n      p && (p.groups = buildGroups(p, this));\n    }\n    return t;\n  }, BabelRegExp.prototype[Symbol.replace] = function (t, p) {\n    if (\"string\" == typeof p) {\n      var o = r.get(this);\n      return e[Symbol.replace].call(this, t, p.replace(/\\$<([^>]+)>/g, function (e, r) {\n        var t = o[r];\n        return \"$\" + (Array.isArray(t) ? t.join(\"$\") : t);\n      }));\n    }\n    if (\"function\" == typeof p) {\n      var i = this;\n      return e[Symbol.replace].call(this, t, function () {\n        var e = arguments;\n        return \"object\" != typeof e[e.length - 1] && (e = [].slice.call(e)).push(buildGroups(e, i)), p.apply(this, e);\n      });\n    }\n    return e[Symbol.replace].call(this, t, p);\n  }, _wrapRegExp.apply(this, arguments);\n}\n\nconst noop = () => {};\nlet _WINDOW = {};\nlet _DOCUMENT = {};\nlet _MUTATION_OBSERVER = null;\nlet _PERFORMANCE = {\n  mark: noop,\n  measure: noop\n};\ntry {\n  if (typeof window !== 'undefined') _WINDOW = window;\n  if (typeof document !== 'undefined') _DOCUMENT = document;\n  if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;\n  if (typeof performance !== 'undefined') _PERFORMANCE = performance;\n} catch (e) {}\nconst {\n  userAgent = ''\n} = _WINDOW.navigator || {};\nconst WINDOW = _WINDOW;\nconst DOCUMENT = _DOCUMENT;\nconst MUTATION_OBSERVER = _MUTATION_OBSERVER;\nconst PERFORMANCE = _PERFORMANCE;\nconst IS_BROWSER = !!WINDOW.document;\nconst IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';\nconst IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');\n\nvar p = /fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\\-\\ ]/,\n  g = /Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;\nvar S = {\n    classic: {\n      fa: \"solid\",\n      fas: \"solid\",\n      \"fa-solid\": \"solid\",\n      far: \"regular\",\n      \"fa-regular\": \"regular\",\n      fal: \"light\",\n      \"fa-light\": \"light\",\n      fat: \"thin\",\n      \"fa-thin\": \"thin\",\n      fab: \"brands\",\n      \"fa-brands\": \"brands\"\n    },\n    duotone: {\n      fa: \"solid\",\n      fad: \"solid\",\n      \"fa-solid\": \"solid\",\n      \"fa-duotone\": \"solid\",\n      fadr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fadl: \"light\",\n      \"fa-light\": \"light\",\n      fadt: \"thin\",\n      \"fa-thin\": \"thin\"\n    },\n    sharp: {\n      fa: \"solid\",\n      fass: \"solid\",\n      \"fa-solid\": \"solid\",\n      fasr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fasl: \"light\",\n      \"fa-light\": \"light\",\n      fast: \"thin\",\n      \"fa-thin\": \"thin\"\n    },\n    \"sharp-duotone\": {\n      fa: \"solid\",\n      fasds: \"solid\",\n      \"fa-solid\": \"solid\",\n      fasdr: \"regular\",\n      \"fa-regular\": \"regular\",\n      fasdl: \"light\",\n      \"fa-light\": \"light\",\n      fasdt: \"thin\",\n      \"fa-thin\": \"thin\"\n    }\n  },\n  A = {\n    GROUP: \"duotone-group\",\n    SWAP_OPACITY: \"swap-opacity\",\n    PRIMARY: \"primary\",\n    SECONDARY: \"secondary\"\n  },\n  P = [\"fa-classic\", \"fa-duotone\", \"fa-sharp\", \"fa-sharp-duotone\"];\nvar s = \"classic\",\n  t = \"duotone\",\n  r = \"sharp\",\n  o = \"sharp-duotone\",\n  L = [s, t, r, o];\nvar G = {\n    classic: {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\",\n      100: \"fat\"\n    },\n    duotone: {\n      900: \"fad\",\n      400: \"fadr\",\n      300: \"fadl\",\n      100: \"fadt\"\n    },\n    sharp: {\n      900: \"fass\",\n      400: \"fasr\",\n      300: \"fasl\",\n      100: \"fast\"\n    },\n    \"sharp-duotone\": {\n      900: \"fasds\",\n      400: \"fasdr\",\n      300: \"fasdl\",\n      100: \"fasdt\"\n    }\n  };\nvar lt = {\n    \"Font Awesome 6 Free\": {\n      900: \"fas\",\n      400: \"far\"\n    },\n    \"Font Awesome 6 Pro\": {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\",\n      100: \"fat\"\n    },\n    \"Font Awesome 6 Brands\": {\n      400: \"fab\",\n      normal: \"fab\"\n    },\n    \"Font Awesome 6 Duotone\": {\n      900: \"fad\",\n      400: \"fadr\",\n      normal: \"fadr\",\n      300: \"fadl\",\n      100: \"fadt\"\n    },\n    \"Font Awesome 6 Sharp\": {\n      900: \"fass\",\n      400: \"fasr\",\n      normal: \"fasr\",\n      300: \"fasl\",\n      100: \"fast\"\n    },\n    \"Font Awesome 6 Sharp Duotone\": {\n      900: \"fasds\",\n      400: \"fasdr\",\n      normal: \"fasdr\",\n      300: \"fasdl\",\n      100: \"fasdt\"\n    }\n  };\nvar pt = new Map([[\"classic\", {\n    defaultShortPrefixId: \"fas\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\", \"brands\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"sharp\", {\n    defaultShortPrefixId: \"fass\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"duotone\", {\n    defaultShortPrefixId: \"fad\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }], [\"sharp-duotone\", {\n    defaultShortPrefixId: \"fasds\",\n    defaultStyleId: \"solid\",\n    styleIds: [\"solid\", \"regular\", \"light\", \"thin\"],\n    futureStyleIds: [],\n    defaultFontWeight: 900\n  }]]),\n  xt = {\n    classic: {\n      solid: \"fas\",\n      regular: \"far\",\n      light: \"fal\",\n      thin: \"fat\",\n      brands: \"fab\"\n    },\n    duotone: {\n      solid: \"fad\",\n      regular: \"fadr\",\n      light: \"fadl\",\n      thin: \"fadt\"\n    },\n    sharp: {\n      solid: \"fass\",\n      regular: \"fasr\",\n      light: \"fasl\",\n      thin: \"fast\"\n    },\n    \"sharp-duotone\": {\n      solid: \"fasds\",\n      regular: \"fasdr\",\n      light: \"fasdl\",\n      thin: \"fasdt\"\n    }\n  };\nvar Ft = [\"fak\", \"fa-kit\", \"fakd\", \"fa-kit-duotone\"],\n  St = {\n    kit: {\n      fak: \"kit\",\n      \"fa-kit\": \"kit\"\n    },\n    \"kit-duotone\": {\n      fakd: \"kit-duotone\",\n      \"fa-kit-duotone\": \"kit-duotone\"\n    }\n  },\n  At = [\"kit\"];\nvar Ct = {\n  kit: {\n    \"fa-kit\": \"fak\"\n  },\n  \"kit-duotone\": {\n    \"fa-kit-duotone\": \"fakd\"\n  }\n};\nvar Lt = [\"fak\", \"fakd\"],\n  Wt = {\n    kit: {\n      fak: \"fa-kit\"\n    },\n    \"kit-duotone\": {\n      fakd: \"fa-kit-duotone\"\n    }\n  };\nvar Et = {\n    kit: {\n      kit: \"fak\"\n    },\n    \"kit-duotone\": {\n      \"kit-duotone\": \"fakd\"\n    }\n  };\n\nvar t$1 = {\n    GROUP: \"duotone-group\",\n    SWAP_OPACITY: \"swap-opacity\",\n    PRIMARY: \"primary\",\n    SECONDARY: \"secondary\"\n  },\n  r$1 = [\"fa-classic\", \"fa-duotone\", \"fa-sharp\", \"fa-sharp-duotone\"];\nvar bt$1 = [\"fak\", \"fa-kit\", \"fakd\", \"fa-kit-duotone\"];\nvar Yt = {\n    \"Font Awesome Kit\": {\n      400: \"fak\",\n      normal: \"fak\"\n    },\n    \"Font Awesome Kit Duotone\": {\n      400: \"fakd\",\n      normal: \"fakd\"\n    }\n  };\nvar ua = {\n    classic: {\n      \"fa-brands\": \"fab\",\n      \"fa-duotone\": \"fad\",\n      \"fa-light\": \"fal\",\n      \"fa-regular\": \"far\",\n      \"fa-solid\": \"fas\",\n      \"fa-thin\": \"fat\"\n    },\n    duotone: {\n      \"fa-regular\": \"fadr\",\n      \"fa-light\": \"fadl\",\n      \"fa-thin\": \"fadt\"\n    },\n    sharp: {\n      \"fa-solid\": \"fass\",\n      \"fa-regular\": \"fasr\",\n      \"fa-light\": \"fasl\",\n      \"fa-thin\": \"fast\"\n    },\n    \"sharp-duotone\": {\n      \"fa-solid\": \"fasds\",\n      \"fa-regular\": \"fasdr\",\n      \"fa-light\": \"fasdl\",\n      \"fa-thin\": \"fasdt\"\n    }\n  },\n  I$1 = {\n    classic: [\"fas\", \"far\", \"fal\", \"fat\", \"fad\"],\n    duotone: [\"fadr\", \"fadl\", \"fadt\"],\n    sharp: [\"fass\", \"fasr\", \"fasl\", \"fast\"],\n    \"sharp-duotone\": [\"fasds\", \"fasdr\", \"fasdl\", \"fasdt\"]\n  },\n  ga = {\n    classic: {\n      fab: \"fa-brands\",\n      fad: \"fa-duotone\",\n      fal: \"fa-light\",\n      far: \"fa-regular\",\n      fas: \"fa-solid\",\n      fat: \"fa-thin\"\n    },\n    duotone: {\n      fadr: \"fa-regular\",\n      fadl: \"fa-light\",\n      fadt: \"fa-thin\"\n    },\n    sharp: {\n      fass: \"fa-solid\",\n      fasr: \"fa-regular\",\n      fasl: \"fa-light\",\n      fast: \"fa-thin\"\n    },\n    \"sharp-duotone\": {\n      fasds: \"fa-solid\",\n      fasdr: \"fa-regular\",\n      fasdl: \"fa-light\",\n      fasdt: \"fa-thin\"\n    }\n  },\n  x = [\"fa-solid\", \"fa-regular\", \"fa-light\", \"fa-thin\", \"fa-duotone\", \"fa-brands\"],\n  Ia = [\"fa\", \"fas\", \"far\", \"fal\", \"fat\", \"fad\", \"fadr\", \"fadl\", \"fadt\", \"fab\", \"fass\", \"fasr\", \"fasl\", \"fast\", \"fasds\", \"fasdr\", \"fasdl\", \"fasdt\", ...r$1, ...x],\n  m$1 = [\"solid\", \"regular\", \"light\", \"thin\", \"duotone\", \"brands\"],\n  c$1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n  F$1 = c$1.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]),\n  ma = [...Object.keys(I$1), ...m$1, \"2xs\", \"xs\", \"sm\", \"lg\", \"xl\", \"2xl\", \"beat\", \"border\", \"fade\", \"beat-fade\", \"bounce\", \"flip-both\", \"flip-horizontal\", \"flip-vertical\", \"flip\", \"fw\", \"inverse\", \"layers-counter\", \"layers-text\", \"layers\", \"li\", \"pull-left\", \"pull-right\", \"pulse\", \"rotate-180\", \"rotate-270\", \"rotate-90\", \"rotate-by\", \"shake\", \"spin-pulse\", \"spin-reverse\", \"spin\", \"stack-1x\", \"stack-2x\", \"stack\", \"ul\", t$1.GROUP, t$1.SWAP_OPACITY, t$1.PRIMARY, t$1.SECONDARY].concat(c$1.map(a => \"\".concat(a, \"x\"))).concat(F$1.map(a => \"w-\".concat(a)));\nvar wa = {\n    \"Font Awesome 5 Free\": {\n      900: \"fas\",\n      400: \"far\"\n    },\n    \"Font Awesome 5 Pro\": {\n      900: \"fas\",\n      400: \"far\",\n      normal: \"far\",\n      300: \"fal\"\n    },\n    \"Font Awesome 5 Brands\": {\n      400: \"fab\",\n      normal: \"fab\"\n    },\n    \"Font Awesome 5 Duotone\": {\n      900: \"fad\"\n    }\n  };\n\nconst NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';\nconst UNITS_IN_GRID = 16;\nconst DEFAULT_CSS_PREFIX = 'fa';\nconst DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';\nconst DATA_FA_I2SVG = 'data-fa-i2svg';\nconst DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';\nconst DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';\nconst DATA_PREFIX = 'data-prefix';\nconst DATA_ICON = 'data-icon';\nconst HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';\nconst MUTATION_APPROACH_ASYNC = 'async';\nconst TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];\nconst PRODUCTION = (() => {\n  try {\n    return process.env.NODE_ENV === 'production';\n  } catch (e$$1) {\n    return false;\n  }\n})();\nfunction familyProxy(obj) {\n  // Defaults to the classic family if family is not available\n  return new Proxy(obj, {\n    get(target, prop) {\n      return prop in target ? target[prop] : target[s];\n    }\n  });\n}\nconst _PREFIX_TO_STYLE = _objectSpread2({}, S);\n\n// We changed FACSSClassesToStyleId in the icons repo to be canonical and as such, \"classic\" family does not have any\n// duotone styles.  But we do still need duotone in _PREFIX_TO_STYLE below, so we are manually adding\n// {'fa-duotone': 'duotone'}\n_PREFIX_TO_STYLE[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  'fa-duotone': 'duotone'\n}), S[s]), St['kit']), St['kit-duotone']);\nconst PREFIX_TO_STYLE = familyProxy(_PREFIX_TO_STYLE);\nconst _STYLE_TO_PREFIX = _objectSpread2({}, xt);\n\n// We changed FAStyleIdToShortPrefixId in the icons repo to be canonical and as such, \"classic\" family does not have any\n// duotone styles.  But we do still need duotone in _STYLE_TO_PREFIX below, so we are manually adding {duotone: 'fad'}\n_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  duotone: 'fad'\n}), _STYLE_TO_PREFIX[s]), Et['kit']), Et['kit-duotone']);\nconst STYLE_TO_PREFIX = familyProxy(_STYLE_TO_PREFIX);\nconst _PREFIX_TO_LONG_STYLE = _objectSpread2({}, ga);\n_PREFIX_TO_LONG_STYLE[s] = _objectSpread2(_objectSpread2({}, _PREFIX_TO_LONG_STYLE[s]), Wt['kit']);\nconst PREFIX_TO_LONG_STYLE = familyProxy(_PREFIX_TO_LONG_STYLE);\nconst _LONG_STYLE_TO_PREFIX = _objectSpread2({}, ua);\n_LONG_STYLE_TO_PREFIX[s] = _objectSpread2(_objectSpread2({}, _LONG_STYLE_TO_PREFIX[s]), Ct['kit']);\nconst LONG_STYLE_TO_PREFIX = familyProxy(_LONG_STYLE_TO_PREFIX);\nconst ICON_SELECTION_SYNTAX_PATTERN = p; // eslint-disable-line no-useless-escape\n\nconst LAYERS_TEXT_CLASSNAME = 'fa-layers-text';\nconst FONT_FAMILY_PATTERN = g;\nconst _FONT_WEIGHT_TO_PREFIX = _objectSpread2({}, G);\nconst FONT_WEIGHT_TO_PREFIX = familyProxy(_FONT_WEIGHT_TO_PREFIX);\nconst ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];\nconst DUOTONE_CLASSES = A;\nconst RESERVED_CLASSES = [...At, ...ma];\n\nconst initial = WINDOW.FontAwesomeConfig || {};\nfunction getAttrConfig(attr) {\n  var element = DOCUMENT.querySelector('script[' + attr + ']');\n  if (element) {\n    return element.getAttribute(attr);\n  }\n}\nfunction coerce(val) {\n  // Getting an empty string will occur if the attribute is set on the HTML tag but without a value\n  // We'll assume that this is an indication that it should be toggled to true\n  if (val === '') return true;\n  if (val === 'false') return false;\n  if (val === 'true') return true;\n  return val;\n}\nif (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {\n  const attrs = [['data-family-prefix', 'familyPrefix'], ['data-css-prefix', 'cssPrefix'], ['data-family-default', 'familyDefault'], ['data-style-default', 'styleDefault'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];\n  attrs.forEach(_ref => {\n    let [attr, key] = _ref;\n    const val = coerce(getAttrConfig(attr));\n    if (val !== undefined && val !== null) {\n      initial[key] = val;\n    }\n  });\n}\nconst _default = {\n  styleDefault: 'solid',\n  familyDefault: s,\n  cssPrefix: DEFAULT_CSS_PREFIX,\n  replacementClass: DEFAULT_REPLACEMENT_CLASS,\n  autoReplaceSvg: true,\n  autoAddCss: true,\n  autoA11y: true,\n  searchPseudoElements: false,\n  observeMutations: true,\n  mutateApproach: 'async',\n  keepOriginalSource: true,\n  measurePerformance: false,\n  showMissingIcons: true\n};\n\n// familyPrefix is deprecated but we must still support it if present\nif (initial.familyPrefix) {\n  initial.cssPrefix = initial.familyPrefix;\n}\nconst _config = _objectSpread2(_objectSpread2({}, _default), initial);\nif (!_config.autoReplaceSvg) _config.observeMutations = false;\nconst config = {};\nObject.keys(_default).forEach(key => {\n  Object.defineProperty(config, key, {\n    enumerable: true,\n    set: function (val) {\n      _config[key] = val;\n      _onChangeCb.forEach(cb => cb(config));\n    },\n    get: function () {\n      return _config[key];\n    }\n  });\n});\n\n// familyPrefix is deprecated as of 6.2.0 and should be removed in 7.0.0\nObject.defineProperty(config, 'familyPrefix', {\n  enumerable: true,\n  set: function (val) {\n    _config.cssPrefix = val;\n    _onChangeCb.forEach(cb => cb(config));\n  },\n  get: function () {\n    return _config.cssPrefix;\n  }\n});\nWINDOW.FontAwesomeConfig = config;\nconst _onChangeCb = [];\nfunction onChange(cb) {\n  _onChangeCb.push(cb);\n  return () => {\n    _onChangeCb.splice(_onChangeCb.indexOf(cb), 1);\n  };\n}\n\nconst d$2 = UNITS_IN_GRID;\nconst meaninglessTransform = {\n  size: 16,\n  x: 0,\n  y: 0,\n  rotate: 0,\n  flipX: false,\n  flipY: false\n};\nfunction insertCss(css) {\n  if (!css || !IS_DOM) {\n    return;\n  }\n  const style = DOCUMENT.createElement('style');\n  style.setAttribute('type', 'text/css');\n  style.innerHTML = css;\n  const headChildren = DOCUMENT.head.childNodes;\n  let beforeChild = null;\n  for (let i = headChildren.length - 1; i > -1; i--) {\n    const child = headChildren[i];\n    const tagName = (child.tagName || '').toUpperCase();\n    if (['STYLE', 'LINK'].indexOf(tagName) > -1) {\n      beforeChild = child;\n    }\n  }\n  DOCUMENT.head.insertBefore(style, beforeChild);\n  return css;\n}\nconst idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\nfunction nextUniqueId() {\n  let size = 12;\n  let id = '';\n  while (size-- > 0) {\n    id += idPool[Math.random() * 62 | 0];\n  }\n  return id;\n}\nfunction toArray(obj) {\n  const array = [];\n  for (let i = (obj || []).length >>> 0; i--;) {\n    array[i] = obj[i];\n  }\n  return array;\n}\nfunction classArray(node) {\n  if (node.classList) {\n    return toArray(node.classList);\n  } else {\n    return (node.getAttribute('class') || '').split(' ').filter(i => i);\n  }\n}\nfunction htmlEscape(str) {\n  return \"\".concat(str).replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\nfunction joinAttributes(attributes) {\n  return Object.keys(attributes || {}).reduce((acc, attributeName) => {\n    return acc + \"\".concat(attributeName, \"=\\\"\").concat(htmlEscape(attributes[attributeName]), \"\\\" \");\n  }, '').trim();\n}\nfunction joinStyles(styles) {\n  return Object.keys(styles || {}).reduce((acc, styleName) => {\n    return acc + \"\".concat(styleName, \": \").concat(styles[styleName].trim(), \";\");\n  }, '');\n}\nfunction transformIsMeaningful(transform) {\n  return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;\n}\nfunction transformForSvg(_ref) {\n  let {\n    transform,\n    containerWidth,\n    iconWidth\n  } = _ref;\n  const outer = {\n    transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n  };\n  const innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n  const innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n  const innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n  const inner = {\n    transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n  };\n  const path = {\n    transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n  };\n  return {\n    outer,\n    inner,\n    path\n  };\n}\nfunction transformForCss(_ref2) {\n  let {\n    transform,\n    width = UNITS_IN_GRID,\n    height = UNITS_IN_GRID,\n    startCentered = false\n  } = _ref2;\n  let val = '';\n  if (startCentered && IS_IE) {\n    val += \"translate(\".concat(transform.x / d$2 - width / 2, \"em, \").concat(transform.y / d$2 - height / 2, \"em) \");\n  } else if (startCentered) {\n    val += \"translate(calc(-50% + \".concat(transform.x / d$2, \"em), calc(-50% + \").concat(transform.y / d$2, \"em)) \");\n  } else {\n    val += \"translate(\".concat(transform.x / d$2, \"em, \").concat(transform.y / d$2, \"em) \");\n  }\n  val += \"scale(\".concat(transform.size / d$2 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / d$2 * (transform.flipY ? -1 : 1), \") \");\n  val += \"rotate(\".concat(transform.rotate, \"deg) \");\n  return val;\n}\n\nvar baseStyles = \":root, :host {\\n  --fa-font-solid: normal 900 1em/1 \\\"Font Awesome 6 Free\\\";\\n  --fa-font-regular: normal 400 1em/1 \\\"Font Awesome 6 Free\\\";\\n  --fa-font-light: normal 300 1em/1 \\\"Font Awesome 6 Pro\\\";\\n  --fa-font-thin: normal 100 1em/1 \\\"Font Awesome 6 Pro\\\";\\n  --fa-font-duotone: normal 900 1em/1 \\\"Font Awesome 6 Duotone\\\";\\n  --fa-font-duotone-regular: normal 400 1em/1 \\\"Font Awesome 6 Duotone\\\";\\n  --fa-font-duotone-light: normal 300 1em/1 \\\"Font Awesome 6 Duotone\\\";\\n  --fa-font-duotone-thin: normal 100 1em/1 \\\"Font Awesome 6 Duotone\\\";\\n  --fa-font-brands: normal 400 1em/1 \\\"Font Awesome 6 Brands\\\";\\n  --fa-font-sharp-solid: normal 900 1em/1 \\\"Font Awesome 6 Sharp\\\";\\n  --fa-font-sharp-regular: normal 400 1em/1 \\\"Font Awesome 6 Sharp\\\";\\n  --fa-font-sharp-light: normal 300 1em/1 \\\"Font Awesome 6 Sharp\\\";\\n  --fa-font-sharp-thin: normal 100 1em/1 \\\"Font Awesome 6 Sharp\\\";\\n  --fa-font-sharp-duotone-solid: normal 900 1em/1 \\\"Font Awesome 6 Sharp Duotone\\\";\\n  --fa-font-sharp-duotone-regular: normal 400 1em/1 \\\"Font Awesome 6 Sharp Duotone\\\";\\n  --fa-font-sharp-duotone-light: normal 300 1em/1 \\\"Font Awesome 6 Sharp Duotone\\\";\\n  --fa-font-sharp-duotone-thin: normal 100 1em/1 \\\"Font Awesome 6 Sharp Duotone\\\";\\n}\\n\\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\\n  overflow: visible;\\n  box-sizing: content-box;\\n}\\n\\n.svg-inline--fa {\\n  display: var(--fa-display, inline-block);\\n  height: 1em;\\n  overflow: visible;\\n  vertical-align: -0.125em;\\n}\\n.svg-inline--fa.fa-2xs {\\n  vertical-align: 0.1em;\\n}\\n.svg-inline--fa.fa-xs {\\n  vertical-align: 0em;\\n}\\n.svg-inline--fa.fa-sm {\\n  vertical-align: -0.0714285705em;\\n}\\n.svg-inline--fa.fa-lg {\\n  vertical-align: -0.2em;\\n}\\n.svg-inline--fa.fa-xl {\\n  vertical-align: -0.25em;\\n}\\n.svg-inline--fa.fa-2xl {\\n  vertical-align: -0.3125em;\\n}\\n.svg-inline--fa.fa-pull-left {\\n  margin-right: var(--fa-pull-margin, 0.3em);\\n  width: auto;\\n}\\n.svg-inline--fa.fa-pull-right {\\n  margin-left: var(--fa-pull-margin, 0.3em);\\n  width: auto;\\n}\\n.svg-inline--fa.fa-li {\\n  width: var(--fa-li-width, 2em);\\n  top: 0.25em;\\n}\\n.svg-inline--fa.fa-fw {\\n  width: var(--fa-fw-width, 1.25em);\\n}\\n\\n.fa-layers svg.svg-inline--fa {\\n  bottom: 0;\\n  left: 0;\\n  margin: auto;\\n  position: absolute;\\n  right: 0;\\n  top: 0;\\n}\\n\\n.fa-layers-counter, .fa-layers-text {\\n  display: inline-block;\\n  position: absolute;\\n  text-align: center;\\n}\\n\\n.fa-layers {\\n  display: inline-block;\\n  height: 1em;\\n  position: relative;\\n  text-align: center;\\n  vertical-align: -0.125em;\\n  width: 1em;\\n}\\n.fa-layers svg.svg-inline--fa {\\n  transform-origin: center center;\\n}\\n\\n.fa-layers-text {\\n  left: 50%;\\n  top: 50%;\\n  transform: translate(-50%, -50%);\\n  transform-origin: center center;\\n}\\n\\n.fa-layers-counter {\\n  background-color: var(--fa-counter-background-color, #ff253a);\\n  border-radius: var(--fa-counter-border-radius, 1em);\\n  box-sizing: border-box;\\n  color: var(--fa-inverse, #fff);\\n  line-height: var(--fa-counter-line-height, 1);\\n  max-width: var(--fa-counter-max-width, 5em);\\n  min-width: var(--fa-counter-min-width, 1.5em);\\n  overflow: hidden;\\n  padding: var(--fa-counter-padding, 0.25em 0.5em);\\n  right: var(--fa-right, 0);\\n  text-overflow: ellipsis;\\n  top: var(--fa-top, 0);\\n  transform: scale(var(--fa-counter-scale, 0.25));\\n  transform-origin: top right;\\n}\\n\\n.fa-layers-bottom-right {\\n  bottom: var(--fa-bottom, 0);\\n  right: var(--fa-right, 0);\\n  top: auto;\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: bottom right;\\n}\\n\\n.fa-layers-bottom-left {\\n  bottom: var(--fa-bottom, 0);\\n  left: var(--fa-left, 0);\\n  right: auto;\\n  top: auto;\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: bottom left;\\n}\\n\\n.fa-layers-top-right {\\n  top: var(--fa-top, 0);\\n  right: var(--fa-right, 0);\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: top right;\\n}\\n\\n.fa-layers-top-left {\\n  left: var(--fa-left, 0);\\n  right: auto;\\n  top: var(--fa-top, 0);\\n  transform: scale(var(--fa-layers-scale, 0.25));\\n  transform-origin: top left;\\n}\\n\\n.fa-1x {\\n  font-size: 1em;\\n}\\n\\n.fa-2x {\\n  font-size: 2em;\\n}\\n\\n.fa-3x {\\n  font-size: 3em;\\n}\\n\\n.fa-4x {\\n  font-size: 4em;\\n}\\n\\n.fa-5x {\\n  font-size: 5em;\\n}\\n\\n.fa-6x {\\n  font-size: 6em;\\n}\\n\\n.fa-7x {\\n  font-size: 7em;\\n}\\n\\n.fa-8x {\\n  font-size: 8em;\\n}\\n\\n.fa-9x {\\n  font-size: 9em;\\n}\\n\\n.fa-10x {\\n  font-size: 10em;\\n}\\n\\n.fa-2xs {\\n  font-size: 0.625em;\\n  line-height: 0.1em;\\n  vertical-align: 0.225em;\\n}\\n\\n.fa-xs {\\n  font-size: 0.75em;\\n  line-height: 0.0833333337em;\\n  vertical-align: 0.125em;\\n}\\n\\n.fa-sm {\\n  font-size: 0.875em;\\n  line-height: 0.0714285718em;\\n  vertical-align: 0.0535714295em;\\n}\\n\\n.fa-lg {\\n  font-size: 1.25em;\\n  line-height: 0.05em;\\n  vertical-align: -0.075em;\\n}\\n\\n.fa-xl {\\n  font-size: 1.5em;\\n  line-height: 0.0416666682em;\\n  vertical-align: -0.125em;\\n}\\n\\n.fa-2xl {\\n  font-size: 2em;\\n  line-height: 0.03125em;\\n  vertical-align: -0.1875em;\\n}\\n\\n.fa-fw {\\n  text-align: center;\\n  width: 1.25em;\\n}\\n\\n.fa-ul {\\n  list-style-type: none;\\n  margin-left: var(--fa-li-margin, 2.5em);\\n  padding-left: 0;\\n}\\n.fa-ul > li {\\n  position: relative;\\n}\\n\\n.fa-li {\\n  left: calc(-1 * var(--fa-li-width, 2em));\\n  position: absolute;\\n  text-align: center;\\n  width: var(--fa-li-width, 2em);\\n  line-height: inherit;\\n}\\n\\n.fa-border {\\n  border-color: var(--fa-border-color, #eee);\\n  border-radius: var(--fa-border-radius, 0.1em);\\n  border-style: var(--fa-border-style, solid);\\n  border-width: var(--fa-border-width, 0.08em);\\n  padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\\n}\\n\\n.fa-pull-left {\\n  float: left;\\n  margin-right: var(--fa-pull-margin, 0.3em);\\n}\\n\\n.fa-pull-right {\\n  float: right;\\n  margin-left: var(--fa-pull-margin, 0.3em);\\n}\\n\\n.fa-beat {\\n  animation-name: fa-beat;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\\n}\\n\\n.fa-bounce {\\n  animation-name: fa-bounce;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\\n}\\n\\n.fa-fade {\\n  animation-name: fa-fade;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\\n}\\n\\n.fa-beat-fade {\\n  animation-name: fa-beat-fade;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\\n}\\n\\n.fa-flip {\\n  animation-name: fa-flip;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, ease-in-out);\\n}\\n\\n.fa-shake {\\n  animation-name: fa-shake;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, linear);\\n}\\n\\n.fa-spin {\\n  animation-name: fa-spin;\\n  animation-delay: var(--fa-animation-delay, 0s);\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 2s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, linear);\\n}\\n\\n.fa-spin-reverse {\\n  --fa-animation-direction: reverse;\\n}\\n\\n.fa-pulse,\\n.fa-spin-pulse {\\n  animation-name: fa-spin;\\n  animation-direction: var(--fa-animation-direction, normal);\\n  animation-duration: var(--fa-animation-duration, 1s);\\n  animation-iteration-count: var(--fa-animation-iteration-count, infinite);\\n  animation-timing-function: var(--fa-animation-timing, steps(8));\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .fa-beat,\\n.fa-bounce,\\n.fa-fade,\\n.fa-beat-fade,\\n.fa-flip,\\n.fa-pulse,\\n.fa-shake,\\n.fa-spin,\\n.fa-spin-pulse {\\n    animation-delay: -1ms;\\n    animation-duration: 1ms;\\n    animation-iteration-count: 1;\\n    transition-delay: 0s;\\n    transition-duration: 0s;\\n  }\\n}\\n@keyframes fa-beat {\\n  0%, 90% {\\n    transform: scale(1);\\n  }\\n  45% {\\n    transform: scale(var(--fa-beat-scale, 1.25));\\n  }\\n}\\n@keyframes fa-bounce {\\n  0% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n  10% {\\n    transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\\n  }\\n  30% {\\n    transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\\n  }\\n  50% {\\n    transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\\n  }\\n  57% {\\n    transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\\n  }\\n  64% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n  100% {\\n    transform: scale(1, 1) translateY(0);\\n  }\\n}\\n@keyframes fa-fade {\\n  50% {\\n    opacity: var(--fa-fade-opacity, 0.4);\\n  }\\n}\\n@keyframes fa-beat-fade {\\n  0%, 100% {\\n    opacity: var(--fa-beat-fade-opacity, 0.4);\\n    transform: scale(1);\\n  }\\n  50% {\\n    opacity: 1;\\n    transform: scale(var(--fa-beat-fade-scale, 1.125));\\n  }\\n}\\n@keyframes fa-flip {\\n  50% {\\n    transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\\n  }\\n}\\n@keyframes fa-shake {\\n  0% {\\n    transform: rotate(-15deg);\\n  }\\n  4% {\\n    transform: rotate(15deg);\\n  }\\n  8%, 24% {\\n    transform: rotate(-18deg);\\n  }\\n  12%, 28% {\\n    transform: rotate(18deg);\\n  }\\n  16% {\\n    transform: rotate(-22deg);\\n  }\\n  20% {\\n    transform: rotate(22deg);\\n  }\\n  32% {\\n    transform: rotate(-12deg);\\n  }\\n  36% {\\n    transform: rotate(12deg);\\n  }\\n  40%, 100% {\\n    transform: rotate(0deg);\\n  }\\n}\\n@keyframes fa-spin {\\n  0% {\\n    transform: rotate(0deg);\\n  }\\n  100% {\\n    transform: rotate(360deg);\\n  }\\n}\\n.fa-rotate-90 {\\n  transform: rotate(90deg);\\n}\\n\\n.fa-rotate-180 {\\n  transform: rotate(180deg);\\n}\\n\\n.fa-rotate-270 {\\n  transform: rotate(270deg);\\n}\\n\\n.fa-flip-horizontal {\\n  transform: scale(-1, 1);\\n}\\n\\n.fa-flip-vertical {\\n  transform: scale(1, -1);\\n}\\n\\n.fa-flip-both,\\n.fa-flip-horizontal.fa-flip-vertical {\\n  transform: scale(-1, -1);\\n}\\n\\n.fa-rotate-by {\\n  transform: rotate(var(--fa-rotate-angle, 0));\\n}\\n\\n.fa-stack {\\n  display: inline-block;\\n  vertical-align: middle;\\n  height: 2em;\\n  position: relative;\\n  width: 2.5em;\\n}\\n\\n.fa-stack-1x,\\n.fa-stack-2x {\\n  bottom: 0;\\n  left: 0;\\n  margin: auto;\\n  position: absolute;\\n  right: 0;\\n  top: 0;\\n  z-index: var(--fa-stack-z-index, auto);\\n}\\n\\n.svg-inline--fa.fa-stack-1x {\\n  height: 1em;\\n  width: 1.25em;\\n}\\n.svg-inline--fa.fa-stack-2x {\\n  height: 2em;\\n  width: 2.5em;\\n}\\n\\n.fa-inverse {\\n  color: var(--fa-inverse, #fff);\\n}\\n\\n.sr-only,\\n.fa-sr-only {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  padding: 0;\\n  margin: -1px;\\n  overflow: hidden;\\n  clip: rect(0, 0, 0, 0);\\n  white-space: nowrap;\\n  border-width: 0;\\n}\\n\\n.sr-only-focusable:not(:focus),\\n.fa-sr-only-focusable:not(:focus) {\\n  position: absolute;\\n  width: 1px;\\n  height: 1px;\\n  padding: 0;\\n  margin: -1px;\\n  overflow: hidden;\\n  clip: rect(0, 0, 0, 0);\\n  white-space: nowrap;\\n  border-width: 0;\\n}\\n\\n.svg-inline--fa .fa-primary {\\n  fill: var(--fa-primary-color, currentColor);\\n  opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa .fa-secondary {\\n  fill: var(--fa-secondary-color, currentColor);\\n  opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-primary {\\n  opacity: var(--fa-secondary-opacity, 0.4);\\n}\\n\\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\\n  opacity: var(--fa-primary-opacity, 1);\\n}\\n\\n.svg-inline--fa mask .fa-primary,\\n.svg-inline--fa mask .fa-secondary {\\n  fill: black;\\n}\";\n\nfunction css() {\n  const dcp = DEFAULT_CSS_PREFIX;\n  const drc = DEFAULT_REPLACEMENT_CLASS;\n  const fp = config.cssPrefix;\n  const rc = config.replacementClass;\n  let s = baseStyles;\n  if (fp !== dcp || rc !== drc) {\n    const dPatt = new RegExp(\"\\\\.\".concat(dcp, \"\\\\-\"), 'g');\n    const customPropPatt = new RegExp(\"\\\\--\".concat(dcp, \"\\\\-\"), 'g');\n    const rPatt = new RegExp(\"\\\\.\".concat(drc), 'g');\n    s = s.replace(dPatt, \".\".concat(fp, \"-\")).replace(customPropPatt, \"--\".concat(fp, \"-\")).replace(rPatt, \".\".concat(rc));\n  }\n  return s;\n}\nlet _cssInserted = false;\nfunction ensureCss() {\n  if (config.autoAddCss && !_cssInserted) {\n    insertCss(css());\n    _cssInserted = true;\n  }\n}\nvar InjectCSS = {\n  mixout() {\n    return {\n      dom: {\n        css,\n        insertCss: ensureCss\n      }\n    };\n  },\n  hooks() {\n    return {\n      beforeDOMElementCreation() {\n        ensureCss();\n      },\n      beforeI2svg() {\n        ensureCss();\n      }\n    };\n  }\n};\n\nconst w = WINDOW || {};\nif (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};\nif (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};\nif (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};\nif (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];\nvar namespace = w[NAMESPACE_IDENTIFIER];\n\nconst functions = [];\nconst listener = function () {\n  DOCUMENT.removeEventListener('DOMContentLoaded', listener);\n  loaded = 1;\n  functions.map(fn => fn());\n};\nlet loaded = false;\nif (IS_DOM) {\n  loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);\n  if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);\n}\nfunction domready (fn) {\n  if (!IS_DOM) return;\n  loaded ? setTimeout(fn, 0) : functions.push(fn);\n}\n\nfunction toHtml(abstractNodes) {\n  const {\n    tag,\n    attributes = {},\n    children = []\n  } = abstractNodes;\n  if (typeof abstractNodes === 'string') {\n    return htmlEscape(abstractNodes);\n  } else {\n    return \"<\".concat(tag, \" \").concat(joinAttributes(attributes), \">\").concat(children.map(toHtml).join(''), \"</\").concat(tag, \">\");\n  }\n}\n\nfunction iconFromMapping(mapping, prefix, iconName) {\n  if (mapping && mapping[prefix] && mapping[prefix][iconName]) {\n    return {\n      prefix,\n      iconName,\n      icon: mapping[prefix][iconName]\n    };\n  }\n}\n\n/**\n * Internal helper to bind a function known to have 4 arguments\n * to a given context.\n */\nvar bindInternal4 = function bindInternal4(func, thisContext) {\n  return function (a, b, c, d) {\n    return func.call(thisContext, a, b, c, d);\n  };\n};\n\n/**\n * # Reduce\n *\n * A fast object `.reduce()` implementation.\n *\n * @param  {Object}   subject      The object to reduce over.\n * @param  {Function} fn           The reducer function.\n * @param  {mixed}    initialValue The initial value for the reducer, defaults to subject[0].\n * @param  {Object}   thisContext  The context for the reducer.\n * @return {mixed}                 The final result.\n */\nvar reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {\n  var keys = Object.keys(subject),\n    length = keys.length,\n    iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,\n    i,\n    key,\n    result;\n  if (initialValue === undefined) {\n    i = 1;\n    result = subject[keys[0]];\n  } else {\n    i = 0;\n    result = initialValue;\n  }\n  for (; i < length; i++) {\n    key = keys[i];\n    result = iterator(result, subject[key], key, subject);\n  }\n  return result;\n};\n\n/**\n * ucs2decode() and codePointAt() are both works of Mathias Bynens and licensed under MIT\n *\n * Copyright Mathias Bynens <https://mathiasbynens.be/>\n\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\nfunction ucs2decode(string) {\n  const output = [];\n  let counter = 0;\n  const length = string.length;\n  while (counter < length) {\n    const value = string.charCodeAt(counter++);\n    if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n      const extra = string.charCodeAt(counter++);\n      if ((extra & 0xFC00) == 0xDC00) {\n        // eslint-disable-line eqeqeq\n        output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n      } else {\n        output.push(value);\n        counter--;\n      }\n    } else {\n      output.push(value);\n    }\n  }\n  return output;\n}\nfunction toHex(unicode) {\n  const decoded = ucs2decode(unicode);\n  return decoded.length === 1 ? decoded[0].toString(16) : null;\n}\nfunction codePointAt(string, index) {\n  const size = string.length;\n  let first = string.charCodeAt(index);\n  let second;\n  if (first >= 0xD800 && first <= 0xDBFF && size > index + 1) {\n    second = string.charCodeAt(index + 1);\n    if (second >= 0xDC00 && second <= 0xDFFF) {\n      return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n    }\n  }\n  return first;\n}\n\nfunction normalizeIcons(icons) {\n  return Object.keys(icons).reduce((acc, iconName) => {\n    const icon = icons[iconName];\n    const expanded = !!icon.icon;\n    if (expanded) {\n      acc[icon.iconName] = icon.icon;\n    } else {\n      acc[iconName] = icon;\n    }\n    return acc;\n  }, {});\n}\nfunction defineIcons(prefix, icons) {\n  let params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n  const {\n    skipHooks = false\n  } = params;\n  const normalized = normalizeIcons(icons);\n  if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {\n    namespace.hooks.addPack(prefix, normalizeIcons(icons));\n  } else {\n    namespace.styles[prefix] = _objectSpread2(_objectSpread2({}, namespace.styles[prefix] || {}), normalized);\n  }\n\n  /**\n   * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction\n   * of new styles we needed to differentiate between them. Prefix `fa` is now an alias\n   * for `fas` so we'll ease the upgrade process for our users by automatically defining\n   * this as well.\n   */\n  if (prefix === 'fas') {\n    defineIcons('fa', icons);\n  }\n}\n\nconst duotonePathRe = [/*#__PURE__*/_wrapRegExp(/path d=\"([^\"]+)\".*path d=\"([^\"]+)\"/, {\n  d1: 1,\n  d2: 2\n}), /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]+)\".*d=\"([^\"]+)\".*path class=\"([^\"]+)\".*d=\"([^\"]+)\"/, {\n  cls1: 1,\n  d1: 2,\n  cls2: 3,\n  d2: 4\n}), /*#__PURE__*/_wrapRegExp(/path class=\"([^\"]+)\".*d=\"([^\"]+)\"/, {\n  cls1: 1,\n  d1: 2\n})];\n\nconst {\n  styles,\n  shims\n} = namespace;\nconst FAMILY_NAMES = Object.keys(PREFIX_TO_LONG_STYLE);\nconst PREFIXES_FOR_FAMILY = FAMILY_NAMES.reduce((acc, familyId) => {\n  acc[familyId] = Object.keys(PREFIX_TO_LONG_STYLE[familyId]);\n  return acc;\n}, {});\nlet _defaultUsablePrefix = null;\nlet _byUnicode = {};\nlet _byLigature = {};\nlet _byOldName = {};\nlet _byOldUnicode = {};\nlet _byAlias = {};\nfunction isReserved(name) {\n  return ~RESERVED_CLASSES.indexOf(name);\n}\nfunction getIconName(cssPrefix, cls) {\n  const parts = cls.split('-');\n  const prefix = parts[0];\n  const iconName = parts.slice(1).join('-');\n  if (prefix === cssPrefix && iconName !== '' && !isReserved(iconName)) {\n    return iconName;\n  } else {\n    return null;\n  }\n}\nconst build = () => {\n  const lookup = reducer => {\n    return reduce(styles, (o$$1, style, prefix) => {\n      o$$1[prefix] = reduce(style, reducer, {});\n      return o$$1;\n    }, {});\n  };\n  _byUnicode = lookup((acc, icon, iconName) => {\n    if (icon[3]) {\n      acc[icon[3]] = iconName;\n    }\n    if (icon[2]) {\n      const aliases = icon[2].filter(a$$1 => {\n        return typeof a$$1 === 'number';\n      });\n      aliases.forEach(alias => {\n        acc[alias.toString(16)] = iconName;\n      });\n    }\n    return acc;\n  });\n  _byLigature = lookup((acc, icon, iconName) => {\n    acc[iconName] = iconName;\n    if (icon[2]) {\n      const aliases = icon[2].filter(a$$1 => {\n        return typeof a$$1 === 'string';\n      });\n      aliases.forEach(alias => {\n        acc[alias] = iconName;\n      });\n    }\n    return acc;\n  });\n  _byAlias = lookup((acc, icon, iconName) => {\n    const aliases = icon[2];\n    acc[iconName] = iconName;\n    aliases.forEach(alias => {\n      acc[alias] = iconName;\n    });\n    return acc;\n  });\n\n  // If we have a Kit, we can't determine if regular is available since we\n  // could be auto-fetching it. We'll have to assume that it is available.\n  const hasRegular = 'far' in styles || config.autoFetchSvg;\n  const shimLookups = reduce(shims, (acc, shim) => {\n    const maybeNameMaybeUnicode = shim[0];\n    let prefix = shim[1];\n    const iconName = shim[2];\n    if (prefix === 'far' && !hasRegular) {\n      prefix = 'fas';\n    }\n    if (typeof maybeNameMaybeUnicode === 'string') {\n      acc.names[maybeNameMaybeUnicode] = {\n        prefix,\n        iconName\n      };\n    }\n    if (typeof maybeNameMaybeUnicode === 'number') {\n      acc.unicodes[maybeNameMaybeUnicode.toString(16)] = {\n        prefix,\n        iconName\n      };\n    }\n    return acc;\n  }, {\n    names: {},\n    unicodes: {}\n  });\n  _byOldName = shimLookups.names;\n  _byOldUnicode = shimLookups.unicodes;\n  _defaultUsablePrefix = getCanonicalPrefix(config.styleDefault, {\n    family: config.familyDefault\n  });\n};\nonChange(c$$1 => {\n  _defaultUsablePrefix = getCanonicalPrefix(c$$1.styleDefault, {\n    family: config.familyDefault\n  });\n});\nbuild();\nfunction byUnicode(prefix, unicode) {\n  return (_byUnicode[prefix] || {})[unicode];\n}\nfunction byLigature(prefix, ligature) {\n  return (_byLigature[prefix] || {})[ligature];\n}\nfunction byAlias(prefix, alias) {\n  return (_byAlias[prefix] || {})[alias];\n}\nfunction byOldName(name) {\n  return _byOldName[name] || {\n    prefix: null,\n    iconName: null\n  };\n}\nfunction byOldUnicode(unicode) {\n  const oldUnicode = _byOldUnicode[unicode];\n  const newUnicode = byUnicode('fas', unicode);\n  return oldUnicode || (newUnicode ? {\n    prefix: 'fas',\n    iconName: newUnicode\n  } : null) || {\n    prefix: null,\n    iconName: null\n  };\n}\nfunction getDefaultUsablePrefix() {\n  return _defaultUsablePrefix;\n}\nconst emptyCanonicalIcon = () => {\n  return {\n    prefix: null,\n    iconName: null,\n    rest: []\n  };\n};\nfunction getFamilyId(values) {\n  let family = s;\n  const famProps = FAMILY_NAMES.reduce((acc, familyId) => {\n    acc[familyId] = \"\".concat(config.cssPrefix, \"-\").concat(familyId);\n    return acc;\n  }, {});\n  L.forEach(familyId => {\n    if (values.includes(famProps[familyId]) || values.some(v$$1 => PREFIXES_FOR_FAMILY[familyId].includes(v$$1))) {\n      family = familyId;\n    }\n  });\n  return family;\n}\nfunction getCanonicalPrefix(styleOrPrefix) {\n  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  const {\n    family = s\n  } = params;\n  const style = PREFIX_TO_STYLE[family][styleOrPrefix];\n\n  // handles the exception of passing in only a family of 'duotone' with no style\n  if (family === t && !styleOrPrefix) {\n    return 'fad';\n  }\n  const prefix = STYLE_TO_PREFIX[family][styleOrPrefix] || STYLE_TO_PREFIX[family][style];\n  const defined = styleOrPrefix in namespace.styles ? styleOrPrefix : null;\n  const result = prefix || defined || null;\n  return result;\n}\nfunction moveNonFaClassesToRest(classNames) {\n  let rest = [];\n  let iconName = null;\n  classNames.forEach(cls => {\n    const result = getIconName(config.cssPrefix, cls);\n    if (result) {\n      iconName = result;\n    } else if (cls) {\n      rest.push(cls);\n    }\n  });\n  return {\n    iconName,\n    rest\n  };\n}\nfunction sortedUniqueValues(arr) {\n  return arr.sort().filter((value, index, arr) => {\n    return arr.indexOf(value) === index;\n  });\n}\nfunction getCanonicalIcon(values) {\n  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  const {\n    skipLookups = false\n  } = params;\n  let givenPrefix = null;\n  const faCombinedClasses = Ia.concat(bt$1);\n  const faStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => faCombinedClasses.includes(cls)));\n  const nonStyleOrFamilyClasses = sortedUniqueValues(values.filter(cls => !Ia.includes(cls)));\n  const faStyles = faStyleOrFamilyClasses.filter(cls => {\n    givenPrefix = cls;\n    return !P.includes(cls);\n  });\n  const [styleFromValues = null] = faStyles;\n  const family = getFamilyId(faStyleOrFamilyClasses);\n  const canonical = _objectSpread2(_objectSpread2({}, moveNonFaClassesToRest(nonStyleOrFamilyClasses)), {}, {\n    prefix: getCanonicalPrefix(styleFromValues, {\n      family\n    })\n  });\n  return _objectSpread2(_objectSpread2(_objectSpread2({}, canonical), getDefaultCanonicalPrefix({\n    values,\n    family,\n    styles,\n    config,\n    canonical,\n    givenPrefix\n  })), applyShimAndAlias(skipLookups, givenPrefix, canonical));\n}\nfunction applyShimAndAlias(skipLookups, givenPrefix, canonical) {\n  let {\n    prefix,\n    iconName\n  } = canonical;\n  if (skipLookups || !prefix || !iconName) {\n    return {\n      prefix,\n      iconName\n    };\n  }\n  const shim = givenPrefix === 'fa' ? byOldName(iconName) : {};\n  const aliasIconName = byAlias(prefix, iconName);\n  iconName = shim.iconName || aliasIconName || iconName;\n  prefix = shim.prefix || prefix;\n  if (prefix === 'far' && !styles['far'] && styles['fas'] && !config.autoFetchSvg) {\n    // Allow a fallback from the regular style to solid if regular is not available\n    // but only if we aren't auto-fetching SVGs\n    prefix = 'fas';\n  }\n  return {\n    prefix,\n    iconName\n  };\n}\nconst newCanonicalFamilies = L.filter(familyId => {\n  return familyId !== s || familyId !== t;\n});\nconst newCanonicalStyles = Object.keys(ga).filter(key => key !== s).map(key => Object.keys(ga[key])).flat();\nfunction getDefaultCanonicalPrefix(prefixOptions) {\n  const {\n    values,\n    family,\n    canonical,\n    givenPrefix = '',\n    styles = {},\n    config: config$$1 = {}\n  } = prefixOptions;\n  const isDuotoneFamily = family === t;\n  const valuesHasDuotone = values.includes('fa-duotone') || values.includes('fad');\n  const defaultFamilyIsDuotone = config$$1.familyDefault === 'duotone';\n  const canonicalPrefixIsDuotone = canonical.prefix === 'fad' || canonical.prefix === 'fa-duotone';\n  if (!isDuotoneFamily && (valuesHasDuotone || defaultFamilyIsDuotone || canonicalPrefixIsDuotone)) {\n    canonical.prefix = 'fad';\n  }\n  if (values.includes('fa-brands') || values.includes('fab')) {\n    canonical.prefix = 'fab';\n  }\n  if (!canonical.prefix && newCanonicalFamilies.includes(family)) {\n    const validPrefix = Object.keys(styles).find(key => newCanonicalStyles.includes(key));\n    if (validPrefix || config$$1.autoFetchSvg) {\n      const defaultPrefix = pt.get(family).defaultShortPrefixId;\n      canonical.prefix = defaultPrefix;\n      canonical.iconName = byAlias(canonical.prefix, canonical.iconName) || canonical.iconName;\n    }\n  }\n  if (canonical.prefix === 'fa' || givenPrefix === 'fa') {\n    // The fa prefix is not canonical. So if it has made it through until this point\n    // we will shift it to the correct prefix.\n    canonical.prefix = getDefaultUsablePrefix() || 'fas';\n  }\n  return canonical;\n}\n\nclass Library {\n  constructor() {\n    this.definitions = {};\n  }\n  add() {\n    for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {\n      definitions[_key] = arguments[_key];\n    }\n    const additions = definitions.reduce(this._pullDefinitions, {});\n    Object.keys(additions).forEach(key => {\n      this.definitions[key] = _objectSpread2(_objectSpread2({}, this.definitions[key] || {}), additions[key]);\n      defineIcons(key, additions[key]);\n\n      // TODO can we stop doing this? We can't get the icons by 'fa-solid' any longer so this probably needs to change\n      const longPrefix = PREFIX_TO_LONG_STYLE[s][key];\n      if (longPrefix) defineIcons(longPrefix, additions[key]);\n      build();\n    });\n  }\n  reset() {\n    this.definitions = {};\n  }\n  _pullDefinitions(additions, definition) {\n    const normalized = definition.prefix && definition.iconName && definition.icon ? {\n      0: definition\n    } : definition;\n    Object.keys(normalized).map(key => {\n      const {\n        prefix,\n        iconName,\n        icon\n      } = normalized[key];\n      const aliases = icon[2];\n      if (!additions[prefix]) additions[prefix] = {};\n      if (aliases.length > 0) {\n        aliases.forEach(alias => {\n          if (typeof alias === 'string') {\n            additions[prefix][alias] = icon;\n          }\n        });\n      }\n      additions[prefix][iconName] = icon;\n    });\n    return additions;\n  }\n}\n\nlet _plugins = [];\nlet _hooks = {};\nconst providers = {};\nconst defaultProviderKeys = Object.keys(providers);\nfunction registerPlugins(nextPlugins, _ref) {\n  let {\n    mixoutsTo: obj\n  } = _ref;\n  _plugins = nextPlugins;\n  _hooks = {};\n  Object.keys(providers).forEach(k => {\n    if (defaultProviderKeys.indexOf(k) === -1) {\n      delete providers[k];\n    }\n  });\n  _plugins.forEach(plugin => {\n    const mixout = plugin.mixout ? plugin.mixout() : {};\n    Object.keys(mixout).forEach(tk => {\n      if (typeof mixout[tk] === 'function') {\n        obj[tk] = mixout[tk];\n      }\n      if (typeof mixout[tk] === 'object') {\n        Object.keys(mixout[tk]).forEach(sk => {\n          if (!obj[tk]) {\n            obj[tk] = {};\n          }\n          obj[tk][sk] = mixout[tk][sk];\n        });\n      }\n    });\n    if (plugin.hooks) {\n      const hooks = plugin.hooks();\n      Object.keys(hooks).forEach(hook => {\n        if (!_hooks[hook]) {\n          _hooks[hook] = [];\n        }\n        _hooks[hook].push(hooks[hook]);\n      });\n    }\n    if (plugin.provides) {\n      plugin.provides(providers);\n    }\n  });\n  return obj;\n}\nfunction chainHooks(hook, accumulator) {\n  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n    args[_key - 2] = arguments[_key];\n  }\n  const hookFns = _hooks[hook] || [];\n  hookFns.forEach(hookFn => {\n    accumulator = hookFn.apply(null, [accumulator, ...args]); // eslint-disable-line no-useless-call\n  });\n  return accumulator;\n}\nfunction callHooks(hook) {\n  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n    args[_key2 - 1] = arguments[_key2];\n  }\n  const hookFns = _hooks[hook] || [];\n  hookFns.forEach(hookFn => {\n    hookFn.apply(null, args);\n  });\n  return undefined;\n}\nfunction callProvided() {\n  const hook = arguments[0];\n  const args = Array.prototype.slice.call(arguments, 1);\n  return providers[hook] ? providers[hook].apply(null, args) : undefined;\n}\n\nfunction findIconDefinition(iconLookup) {\n  if (iconLookup.prefix === 'fa') {\n    iconLookup.prefix = 'fas';\n  }\n  let {\n    iconName\n  } = iconLookup;\n  const prefix = iconLookup.prefix || getDefaultUsablePrefix();\n  if (!iconName) return;\n  iconName = byAlias(prefix, iconName) || iconName;\n  return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);\n}\nconst library = new Library();\nconst noAuto = () => {\n  config.autoReplaceSvg = false;\n  config.observeMutations = false;\n  callHooks('noAuto');\n};\nconst dom = {\n  i2svg: function () {\n    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    if (IS_DOM) {\n      callHooks('beforeI2svg', params);\n      callProvided('pseudoElements2svg', params);\n      return callProvided('i2svg', params);\n    } else {\n      return Promise.reject(new Error('Operation requires a DOM of some kind.'));\n    }\n  },\n  watch: function () {\n    let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    const {\n      autoReplaceSvgRoot\n    } = params;\n    if (config.autoReplaceSvg === false) {\n      config.autoReplaceSvg = true;\n    }\n    config.observeMutations = true;\n    domready(() => {\n      autoReplace({\n        autoReplaceSvgRoot\n      });\n      callHooks('watch', params);\n    });\n  }\n};\nconst parse = {\n  icon: icon => {\n    if (icon === null) {\n      return null;\n    }\n    if (typeof icon === 'object' && icon.prefix && icon.iconName) {\n      return {\n        prefix: icon.prefix,\n        iconName: byAlias(icon.prefix, icon.iconName) || icon.iconName\n      };\n    }\n    if (Array.isArray(icon) && icon.length === 2) {\n      const iconName = icon[1].indexOf('fa-') === 0 ? icon[1].slice(3) : icon[1];\n      const prefix = getCanonicalPrefix(icon[0]);\n      return {\n        prefix,\n        iconName: byAlias(prefix, iconName) || iconName\n      };\n    }\n    if (typeof icon === 'string' && (icon.indexOf(\"\".concat(config.cssPrefix, \"-\")) > -1 || icon.match(ICON_SELECTION_SYNTAX_PATTERN))) {\n      const canonicalIcon = getCanonicalIcon(icon.split(' '), {\n        skipLookups: true\n      });\n      return {\n        prefix: canonicalIcon.prefix || getDefaultUsablePrefix(),\n        iconName: byAlias(canonicalIcon.prefix, canonicalIcon.iconName) || canonicalIcon.iconName\n      };\n    }\n    if (typeof icon === 'string') {\n      const prefix = getDefaultUsablePrefix();\n      return {\n        prefix,\n        iconName: byAlias(prefix, icon) || icon\n      };\n    }\n  }\n};\nconst api = {\n  noAuto,\n  config,\n  dom,\n  parse,\n  library,\n  findIconDefinition,\n  toHtml\n};\nconst autoReplace = function () {\n  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n  const {\n    autoReplaceSvgRoot = DOCUMENT\n  } = params;\n  if ((Object.keys(namespace.styles).length > 0 || config.autoFetchSvg) && IS_DOM && config.autoReplaceSvg) api.dom.i2svg({\n    node: autoReplaceSvgRoot\n  });\n};\n\nfunction domVariants(val, abstractCreator) {\n  Object.defineProperty(val, 'abstract', {\n    get: abstractCreator\n  });\n  Object.defineProperty(val, 'html', {\n    get: function () {\n      return val.abstract.map(a => toHtml(a));\n    }\n  });\n  Object.defineProperty(val, 'node', {\n    get: function () {\n      if (!IS_DOM) return;\n      const container = DOCUMENT.createElement('div');\n      container.innerHTML = val.html;\n      return container.children;\n    }\n  });\n  return val;\n}\n\nfunction asIcon (_ref) {\n  let {\n    children,\n    main,\n    mask,\n    attributes,\n    styles,\n    transform\n  } = _ref;\n  if (transformIsMeaningful(transform) && main.found && !mask.found) {\n    const {\n      width,\n      height\n    } = main;\n    const offset = {\n      x: width / height / 2,\n      y: 0.5\n    };\n    attributes['style'] = joinStyles(_objectSpread2(_objectSpread2({}, styles), {}, {\n      'transform-origin': \"\".concat(offset.x + transform.x / 16, \"em \").concat(offset.y + transform.y / 16, \"em\")\n    }));\n  }\n  return [{\n    tag: 'svg',\n    attributes,\n    children\n  }];\n}\n\nfunction asSymbol (_ref) {\n  let {\n    prefix,\n    iconName,\n    children,\n    attributes,\n    symbol\n  } = _ref;\n  const id = symbol === true ? \"\".concat(prefix, \"-\").concat(config.cssPrefix, \"-\").concat(iconName) : symbol;\n  return [{\n    tag: 'svg',\n    attributes: {\n      style: 'display: none;'\n    },\n    children: [{\n      tag: 'symbol',\n      attributes: _objectSpread2(_objectSpread2({}, attributes), {}, {\n        id\n      }),\n      children\n    }]\n  }];\n}\n\nfunction makeInlineSvgAbstract(params) {\n  const {\n    icons: {\n      main,\n      mask\n    },\n    prefix,\n    iconName,\n    transform,\n    symbol,\n    title,\n    maskId,\n    titleId,\n    extra,\n    watchable = false\n  } = params;\n  const {\n    width,\n    height\n  } = mask.found ? mask : main;\n  const isUploadedIcon = Lt.includes(prefix);\n  const attrClass = [config.replacementClass, iconName ? \"\".concat(config.cssPrefix, \"-\").concat(iconName) : ''].filter(c$$1 => extra.classes.indexOf(c$$1) === -1).filter(c$$1 => c$$1 !== '' || !!c$$1).concat(extra.classes).join(' ');\n  let content = {\n    children: [],\n    attributes: _objectSpread2(_objectSpread2({}, extra.attributes), {}, {\n      'data-prefix': prefix,\n      'data-icon': iconName,\n      'class': attrClass,\n      'role': extra.attributes.role || 'img',\n      'xmlns': 'http://www.w3.org/2000/svg',\n      'viewBox': \"0 0 \".concat(width, \" \").concat(height)\n    })\n  };\n  const uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {\n    width: \"\".concat(width / height * 16 * 0.0625, \"em\")\n  } : {};\n  if (watchable) {\n    content.attributes[DATA_FA_I2SVG] = '';\n  }\n  if (title) {\n    content.children.push({\n      tag: 'title',\n      attributes: {\n        id: content.attributes['aria-labelledby'] || \"title-\".concat(titleId || nextUniqueId())\n      },\n      children: [title]\n    });\n    delete content.attributes.title;\n  }\n  const args = _objectSpread2(_objectSpread2({}, content), {}, {\n    prefix,\n    iconName,\n    main,\n    mask,\n    maskId,\n    transform,\n    symbol,\n    styles: _objectSpread2(_objectSpread2({}, uploadedIconWidthStyle), extra.styles)\n  });\n  const {\n    children,\n    attributes\n  } = mask.found && main.found ? callProvided('generateAbstractMask', args) || {\n    children: [],\n    attributes: {}\n  } : callProvided('generateAbstractIcon', args) || {\n    children: [],\n    attributes: {}\n  };\n  args.children = children;\n  args.attributes = attributes;\n  if (symbol) {\n    return asSymbol(args);\n  } else {\n    return asIcon(args);\n  }\n}\nfunction makeLayersTextAbstract(params) {\n  const {\n    content,\n    width,\n    height,\n    transform,\n    title,\n    extra,\n    watchable = false\n  } = params;\n  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {\n    'title': title\n  } : {}), {}, {\n    'class': extra.classes.join(' ')\n  });\n  if (watchable) {\n    attributes[DATA_FA_I2SVG] = '';\n  }\n  const styles = _objectSpread2({}, extra.styles);\n  if (transformIsMeaningful(transform)) {\n    styles['transform'] = transformForCss({\n      transform,\n      startCentered: true,\n      width,\n      height\n    });\n    styles['-webkit-transform'] = styles['transform'];\n  }\n  const styleString = joinStyles(styles);\n  if (styleString.length > 0) {\n    attributes['style'] = styleString;\n  }\n  const val = [];\n  val.push({\n    tag: 'span',\n    attributes,\n    children: [content]\n  });\n  if (title) {\n    val.push({\n      tag: 'span',\n      attributes: {\n        class: 'sr-only'\n      },\n      children: [title]\n    });\n  }\n  return val;\n}\nfunction makeLayersCounterAbstract(params) {\n  const {\n    content,\n    title,\n    extra\n  } = params;\n  const attributes = _objectSpread2(_objectSpread2(_objectSpread2({}, extra.attributes), title ? {\n    'title': title\n  } : {}), {}, {\n    'class': extra.classes.join(' ')\n  });\n  const styleString = joinStyles(extra.styles);\n  if (styleString.length > 0) {\n    attributes['style'] = styleString;\n  }\n  const val = [];\n  val.push({\n    tag: 'span',\n    attributes,\n    children: [content]\n  });\n  if (title) {\n    val.push({\n      tag: 'span',\n      attributes: {\n        class: 'sr-only'\n      },\n      children: [title]\n    });\n  }\n  return val;\n}\n\nconst {\n  styles: styles$1\n} = namespace;\nfunction asFoundIcon(icon) {\n  const width = icon[0];\n  const height = icon[1];\n  const [vectorData] = icon.slice(4);\n  let element = null;\n  if (Array.isArray(vectorData)) {\n    element = {\n      tag: 'g',\n      attributes: {\n        class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.GROUP)\n      },\n      children: [{\n        tag: 'path',\n        attributes: {\n          class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.SECONDARY),\n          fill: 'currentColor',\n          d: vectorData[0]\n        }\n      }, {\n        tag: 'path',\n        attributes: {\n          class: \"\".concat(config.cssPrefix, \"-\").concat(DUOTONE_CLASSES.PRIMARY),\n          fill: 'currentColor',\n          d: vectorData[1]\n        }\n      }]\n    };\n  } else {\n    element = {\n      tag: 'path',\n      attributes: {\n        fill: 'currentColor',\n        d: vectorData\n      }\n    };\n  }\n  return {\n    found: true,\n    width,\n    height,\n    icon: element\n  };\n}\nconst missingIconResolutionMixin = {\n  found: false,\n  width: 512,\n  height: 512\n};\nfunction maybeNotifyMissing(iconName, prefix) {\n  if (!PRODUCTION && !config.showMissingIcons && iconName) {\n    console.error(\"Icon with name \\\"\".concat(iconName, \"\\\" and prefix \\\"\").concat(prefix, \"\\\" is missing.\"));\n  }\n}\nfunction findIcon(iconName, prefix) {\n  let givenPrefix = prefix;\n  if (prefix === 'fa' && config.styleDefault !== null) {\n    prefix = getDefaultUsablePrefix();\n  }\n  return new Promise((resolve, reject) => {\n    if (givenPrefix === 'fa') {\n      const shim = byOldName(iconName) || {};\n      iconName = shim.iconName || iconName;\n      prefix = shim.prefix || prefix;\n    }\n    if (iconName && prefix && styles$1[prefix] && styles$1[prefix][iconName]) {\n      const icon = styles$1[prefix][iconName];\n      return resolve(asFoundIcon(icon));\n    }\n    maybeNotifyMissing(iconName, prefix);\n    resolve(_objectSpread2(_objectSpread2({}, missingIconResolutionMixin), {}, {\n      icon: config.showMissingIcons && iconName ? callProvided('missingIconAbstract') || {} : {}\n    }));\n  });\n}\n\nconst noop$1 = () => {};\nconst p$2 = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {\n  mark: noop$1,\n  measure: noop$1\n};\nconst preamble = \"FA \\\"6.7.2\\\"\";\nconst begin = name => {\n  p$2.mark(\"\".concat(preamble, \" \").concat(name, \" begins\"));\n  return () => end(name);\n};\nconst end = name => {\n  p$2.mark(\"\".concat(preamble, \" \").concat(name, \" ends\"));\n  p$2.measure(\"\".concat(preamble, \" \").concat(name), \"\".concat(preamble, \" \").concat(name, \" begins\"), \"\".concat(preamble, \" \").concat(name, \" ends\"));\n};\nvar perf = {\n  begin,\n  end\n};\n\nconst noop$2 = () => {};\nfunction isWatched(node) {\n  const i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;\n  return typeof i2svg === 'string';\n}\nfunction hasPrefixAndIcon(node) {\n  const prefix = node.getAttribute ? node.getAttribute(DATA_PREFIX) : null;\n  const icon = node.getAttribute ? node.getAttribute(DATA_ICON) : null;\n  return prefix && icon;\n}\nfunction hasBeenReplaced(node) {\n  return node && node.classList && node.classList.contains && node.classList.contains(config.replacementClass);\n}\nfunction getMutator() {\n  if (config.autoReplaceSvg === true) {\n    return mutators.replace;\n  }\n  const mutator = mutators[config.autoReplaceSvg];\n  return mutator || mutators.replace;\n}\nfunction createElementNS(tag) {\n  return DOCUMENT.createElementNS('http://www.w3.org/2000/svg', tag);\n}\nfunction createElement(tag) {\n  return DOCUMENT.createElement(tag);\n}\nfunction convertSVG(abstractObj) {\n  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  const {\n    ceFn = abstractObj.tag === 'svg' ? createElementNS : createElement\n  } = params;\n  if (typeof abstractObj === 'string') {\n    return DOCUMENT.createTextNode(abstractObj);\n  }\n  const tag = ceFn(abstractObj.tag);\n  Object.keys(abstractObj.attributes || []).forEach(function (key) {\n    tag.setAttribute(key, abstractObj.attributes[key]);\n  });\n  const children = abstractObj.children || [];\n  children.forEach(function (child) {\n    tag.appendChild(convertSVG(child, {\n      ceFn\n    }));\n  });\n  return tag;\n}\nfunction nodeAsComment(node) {\n  let comment = \" \".concat(node.outerHTML, \" \");\n  /* BEGIN.ATTRIBUTION */\n  comment = \"\".concat(comment, \"Font Awesome fontawesome.com \");\n  /* END.ATTRIBUTION */\n  return comment;\n}\nconst mutators = {\n  replace: function (mutation) {\n    const node = mutation[0];\n    if (node.parentNode) {\n      mutation[1].forEach(abstract => {\n        node.parentNode.insertBefore(convertSVG(abstract), node);\n      });\n      if (node.getAttribute(DATA_FA_I2SVG) === null && config.keepOriginalSource) {\n        let comment = DOCUMENT.createComment(nodeAsComment(node));\n        node.parentNode.replaceChild(comment, node);\n      } else {\n        node.remove();\n      }\n    }\n  },\n  nest: function (mutation) {\n    const node = mutation[0];\n    const abstract = mutation[1];\n\n    // If we already have a replaced node we do not want to continue nesting within it.\n    // Short-circuit to the standard replacement\n    if (~classArray(node).indexOf(config.replacementClass)) {\n      return mutators.replace(mutation);\n    }\n    const forSvg = new RegExp(\"\".concat(config.cssPrefix, \"-.*\"));\n    delete abstract[0].attributes.id;\n    if (abstract[0].attributes.class) {\n      const splitClasses = abstract[0].attributes.class.split(' ').reduce((acc, cls) => {\n        if (cls === config.replacementClass || cls.match(forSvg)) {\n          acc.toSvg.push(cls);\n        } else {\n          acc.toNode.push(cls);\n        }\n        return acc;\n      }, {\n        toNode: [],\n        toSvg: []\n      });\n      abstract[0].attributes.class = splitClasses.toSvg.join(' ');\n      if (splitClasses.toNode.length === 0) {\n        node.removeAttribute('class');\n      } else {\n        node.setAttribute('class', splitClasses.toNode.join(' '));\n      }\n    }\n    const newInnerHTML = abstract.map(a => toHtml(a)).join('\\n');\n    node.setAttribute(DATA_FA_I2SVG, '');\n    node.innerHTML = newInnerHTML;\n  }\n};\nfunction performOperationSync(op) {\n  op();\n}\nfunction perform(mutations, callback) {\n  const callbackFunction = typeof callback === 'function' ? callback : noop$2;\n  if (mutations.length === 0) {\n    callbackFunction();\n  } else {\n    let frame = performOperationSync;\n    if (config.mutateApproach === MUTATION_APPROACH_ASYNC) {\n      frame = WINDOW.requestAnimationFrame || performOperationSync;\n    }\n    frame(() => {\n      const mutator = getMutator();\n      const mark = perf.begin('mutate');\n      mutations.map(mutator);\n      mark();\n      callbackFunction();\n    });\n  }\n}\nlet disabled = false;\nfunction disableObservation() {\n  disabled = true;\n}\nfunction enableObservation() {\n  disabled = false;\n}\nlet mo = null;\nfunction observe(options) {\n  if (!MUTATION_OBSERVER) {\n    return;\n  }\n  if (!config.observeMutations) {\n    return;\n  }\n  const {\n    treeCallback = noop$2,\n    nodeCallback = noop$2,\n    pseudoElementsCallback = noop$2,\n    observeMutationsRoot = DOCUMENT\n  } = options;\n  mo = new MUTATION_OBSERVER(objects => {\n    if (disabled) return;\n    const defaultPrefix = getDefaultUsablePrefix();\n    toArray(objects).forEach(mutationRecord => {\n      if (mutationRecord.type === 'childList' && mutationRecord.addedNodes.length > 0 && !isWatched(mutationRecord.addedNodes[0])) {\n        if (config.searchPseudoElements) {\n          pseudoElementsCallback(mutationRecord.target);\n        }\n        treeCallback(mutationRecord.target);\n      }\n      if (mutationRecord.type === 'attributes' && mutationRecord.target.parentNode && config.searchPseudoElements) {\n        pseudoElementsCallback(mutationRecord.target.parentNode);\n      }\n      if (mutationRecord.type === 'attributes' && isWatched(mutationRecord.target) && ~ATTRIBUTES_WATCHED_FOR_MUTATION.indexOf(mutationRecord.attributeName)) {\n        if (mutationRecord.attributeName === 'class' && hasPrefixAndIcon(mutationRecord.target)) {\n          const {\n            prefix,\n            iconName\n          } = getCanonicalIcon(classArray(mutationRecord.target));\n          mutationRecord.target.setAttribute(DATA_PREFIX, prefix || defaultPrefix);\n          if (iconName) mutationRecord.target.setAttribute(DATA_ICON, iconName);\n        } else if (hasBeenReplaced(mutationRecord.target)) {\n          nodeCallback(mutationRecord.target);\n        }\n      }\n    });\n  });\n  if (!IS_DOM) return;\n  mo.observe(observeMutationsRoot, {\n    childList: true,\n    attributes: true,\n    characterData: true,\n    subtree: true\n  });\n}\nfunction disconnect() {\n  if (!mo) return;\n  mo.disconnect();\n}\n\nfunction styleParser (node) {\n  const style = node.getAttribute('style');\n  let val = [];\n  if (style) {\n    val = style.split(';').reduce((acc, style) => {\n      const styles = style.split(':');\n      const prop = styles[0];\n      const value = styles.slice(1);\n      if (prop && value.length > 0) {\n        acc[prop] = value.join(':').trim();\n      }\n      return acc;\n    }, {});\n  }\n  return val;\n}\n\nfunction classParser (node) {\n  const existingPrefix = node.getAttribute('data-prefix');\n  const existingIconName = node.getAttribute('data-icon');\n  const innerText = node.innerText !== undefined ? node.innerText.trim() : '';\n  let val = getCanonicalIcon(classArray(node));\n  if (!val.prefix) {\n    val.prefix = getDefaultUsablePrefix();\n  }\n  if (existingPrefix && existingIconName) {\n    val.prefix = existingPrefix;\n    val.iconName = existingIconName;\n  }\n  if (val.iconName && val.prefix) {\n    return val;\n  }\n  if (val.prefix && innerText.length > 0) {\n    val.iconName = byLigature(val.prefix, node.innerText) || byUnicode(val.prefix, toHex(node.innerText));\n  }\n  if (!val.iconName && config.autoFetchSvg && node.firstChild && node.firstChild.nodeType === Node.TEXT_NODE) {\n    val.iconName = node.firstChild.data;\n  }\n  return val;\n}\n\nfunction attributesParser (node) {\n  const extraAttributes = toArray(node.attributes).reduce((acc, attr) => {\n    if (acc.name !== 'class' && acc.name !== 'style') {\n      acc[attr.name] = attr.value;\n    }\n    return acc;\n  }, {});\n  const title = node.getAttribute('title');\n  const titleId = node.getAttribute('data-fa-title-id');\n  if (config.autoA11y) {\n    if (title) {\n      extraAttributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n    } else {\n      extraAttributes['aria-hidden'] = 'true';\n      extraAttributes['focusable'] = 'false';\n    }\n  }\n  return extraAttributes;\n}\n\nfunction blankMeta() {\n  return {\n    iconName: null,\n    title: null,\n    titleId: null,\n    prefix: null,\n    transform: meaninglessTransform,\n    symbol: false,\n    mask: {\n      iconName: null,\n      prefix: null,\n      rest: []\n    },\n    maskId: null,\n    extra: {\n      classes: [],\n      styles: {},\n      attributes: {}\n    }\n  };\n}\nfunction parseMeta(node) {\n  let parser = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n    styleParser: true\n  };\n  const {\n    iconName,\n    prefix,\n    rest: extraClasses\n  } = classParser(node);\n  const extraAttributes = attributesParser(node);\n  const pluginMeta = chainHooks('parseNodeAttributes', {}, node);\n  let extraStyles = parser.styleParser ? styleParser(node) : [];\n  return _objectSpread2({\n    iconName,\n    title: node.getAttribute('title'),\n    titleId: node.getAttribute('data-fa-title-id'),\n    prefix,\n    transform: meaninglessTransform,\n    mask: {\n      iconName: null,\n      prefix: null,\n      rest: []\n    },\n    maskId: null,\n    symbol: false,\n    extra: {\n      classes: extraClasses,\n      styles: extraStyles,\n      attributes: extraAttributes\n    }\n  }, pluginMeta);\n}\n\nconst {\n  styles: styles$2\n} = namespace;\nfunction generateMutation(node) {\n  const nodeMeta = config.autoReplaceSvg === 'nest' ? parseMeta(node, {\n    styleParser: false\n  }) : parseMeta(node);\n  if (~nodeMeta.extra.classes.indexOf(LAYERS_TEXT_CLASSNAME)) {\n    return callProvided('generateLayersText', node, nodeMeta);\n  } else {\n    return callProvided('generateSvgReplacementMutation', node, nodeMeta);\n  }\n}\nfunction getKnownPrefixes() {\n  return [...Ft, ...Ia];\n}\nfunction onTree(root) {\n  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n  if (!IS_DOM) return Promise.resolve();\n  const htmlClassList = DOCUMENT.documentElement.classList;\n  const hclAdd = suffix => htmlClassList.add(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n  const hclRemove = suffix => htmlClassList.remove(\"\".concat(HTML_CLASS_I2SVG_BASE_CLASS, \"-\").concat(suffix));\n  const prefixes = config.autoFetchSvg ? getKnownPrefixes() : P.concat(Object.keys(styles$2));\n  if (!prefixes.includes('fa')) {\n    prefixes.push('fa');\n  }\n  const prefixesDomQuery = [\".\".concat(LAYERS_TEXT_CLASSNAME, \":not([\").concat(DATA_FA_I2SVG, \"])\")].concat(prefixes.map(p$$1 => \".\".concat(p$$1, \":not([\").concat(DATA_FA_I2SVG, \"])\"))).join(', ');\n  if (prefixesDomQuery.length === 0) {\n    return Promise.resolve();\n  }\n  let candidates = [];\n  try {\n    candidates = toArray(root.querySelectorAll(prefixesDomQuery));\n  } catch (e$$1) {\n    // noop\n  }\n  if (candidates.length > 0) {\n    hclAdd('pending');\n    hclRemove('complete');\n  } else {\n    return Promise.resolve();\n  }\n  const mark = perf.begin('onTree');\n  const mutations = candidates.reduce((acc, node) => {\n    try {\n      const mutation = generateMutation(node);\n      if (mutation) {\n        acc.push(mutation);\n      }\n    } catch (e$$1) {\n      if (!PRODUCTION) {\n        if (e$$1.name === 'MissingIcon') {\n          console.error(e$$1);\n        }\n      }\n    }\n    return acc;\n  }, []);\n  return new Promise((resolve, reject) => {\n    Promise.all(mutations).then(resolvedMutations => {\n      perform(resolvedMutations, () => {\n        hclAdd('active');\n        hclAdd('complete');\n        hclRemove('pending');\n        if (typeof callback === 'function') callback();\n        mark();\n        resolve();\n      });\n    }).catch(e$$1 => {\n      mark();\n      reject(e$$1);\n    });\n  });\n}\nfunction onNode(node) {\n  let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n  generateMutation(node).then(mutation => {\n    if (mutation) {\n      perform([mutation], callback);\n    }\n  });\n}\nfunction resolveIcons(next) {\n  return function (maybeIconDefinition) {\n    let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    const iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});\n    let {\n      mask\n    } = params;\n    if (mask) {\n      mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});\n    }\n    return next(iconDefinition, _objectSpread2(_objectSpread2({}, params), {}, {\n      mask\n    }));\n  };\n}\nconst render = function (iconDefinition) {\n  let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n  const {\n    transform = meaninglessTransform,\n    symbol = false,\n    mask = null,\n    maskId = null,\n    title = null,\n    titleId = null,\n    classes = [],\n    attributes = {},\n    styles = {}\n  } = params;\n  if (!iconDefinition) return;\n  const {\n    prefix,\n    iconName,\n    icon\n  } = iconDefinition;\n  return domVariants(_objectSpread2({\n    type: 'icon'\n  }, iconDefinition), () => {\n    callHooks('beforeDOMElementCreation', {\n      iconDefinition,\n      params\n    });\n    if (config.autoA11y) {\n      if (title) {\n        attributes['aria-labelledby'] = \"\".concat(config.replacementClass, \"-title-\").concat(titleId || nextUniqueId());\n      } else {\n        attributes['aria-hidden'] = 'true';\n        attributes['focusable'] = 'false';\n      }\n    }\n    return makeInlineSvgAbstract({\n      icons: {\n        main: asFoundIcon(icon),\n        mask: mask ? asFoundIcon(mask.icon) : {\n          found: false,\n          width: null,\n          height: null,\n          icon: {}\n        }\n      },\n      prefix,\n      iconName,\n      transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),\n      symbol,\n      title,\n      maskId,\n      titleId,\n      extra: {\n        attributes,\n        styles,\n        classes\n      }\n    });\n  });\n};\nvar ReplaceElements = {\n  mixout() {\n    return {\n      icon: resolveIcons(render)\n    };\n  },\n  hooks() {\n    return {\n      mutationObserverCallbacks(accumulator) {\n        accumulator.treeCallback = onTree;\n        accumulator.nodeCallback = onNode;\n        return accumulator;\n      }\n    };\n  },\n  provides(providers$$1) {\n    providers$$1.i2svg = function (params) {\n      const {\n        node = DOCUMENT,\n        callback = () => {}\n      } = params;\n      return onTree(node, callback);\n    };\n    providers$$1.generateSvgReplacementMutation = function (node, nodeMeta) {\n      const {\n        iconName,\n        title,\n        titleId,\n        prefix,\n        transform,\n        symbol,\n        mask,\n        maskId,\n        extra\n      } = nodeMeta;\n      return new Promise((resolve, reject) => {\n        Promise.all([findIcon(iconName, prefix), mask.iconName ? findIcon(mask.iconName, mask.prefix) : Promise.resolve({\n          found: false,\n          width: 512,\n          height: 512,\n          icon: {}\n        })]).then(_ref => {\n          let [main, mask] = _ref;\n          resolve([node, makeInlineSvgAbstract({\n            icons: {\n              main,\n              mask\n            },\n            prefix,\n            iconName,\n            transform,\n            symbol,\n            maskId,\n            title,\n            titleId,\n            extra,\n            watchable: true\n          })]);\n        }).catch(reject);\n      });\n    };\n    providers$$1.generateAbstractIcon = function (_ref2) {\n      let {\n        children,\n        attributes,\n        main,\n        transform,\n        styles\n      } = _ref2;\n      const styleString = joinStyles(styles);\n      if (styleString.length > 0) {\n        attributes['style'] = styleString;\n      }\n      let nextChild;\n      if (transformIsMeaningful(transform)) {\n        nextChild = callProvided('generateAbstractTransformGrouping', {\n          main,\n          transform,\n          containerWidth: main.width,\n          iconWidth: main.width\n        });\n      }\n      children.push(nextChild || main.icon);\n      return {\n        children,\n        attributes\n      };\n    };\n  }\n};\n\nvar Layers = {\n  mixout() {\n    return {\n      layer(assembler) {\n        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        const {\n          classes = []\n        } = params;\n        return domVariants({\n          type: 'layer'\n        }, () => {\n          callHooks('beforeDOMElementCreation', {\n            assembler,\n            params\n          });\n          let children = [];\n          assembler(args => {\n            Array.isArray(args) ? args.map(a => {\n              children = children.concat(a.abstract);\n            }) : children = children.concat(args.abstract);\n          });\n          return [{\n            tag: 'span',\n            attributes: {\n              class: [\"\".concat(config.cssPrefix, \"-layers\"), ...classes].join(' ')\n            },\n            children\n          }];\n        });\n      }\n    };\n  }\n};\n\nvar LayersCounter = {\n  mixout() {\n    return {\n      counter(content) {\n        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        const {\n          title = null,\n          classes = [],\n          attributes = {},\n          styles = {}\n        } = params;\n        return domVariants({\n          type: 'counter',\n          content\n        }, () => {\n          callHooks('beforeDOMElementCreation', {\n            content,\n            params\n          });\n          return makeLayersCounterAbstract({\n            content: content.toString(),\n            title,\n            extra: {\n              attributes,\n              styles,\n              classes: [\"\".concat(config.cssPrefix, \"-layers-counter\"), ...classes]\n            }\n          });\n        });\n      }\n    };\n  }\n};\n\nvar LayersText = {\n  mixout() {\n    return {\n      text(content) {\n        let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        const {\n          transform = meaninglessTransform,\n          title = null,\n          classes = [],\n          attributes = {},\n          styles = {}\n        } = params;\n        return domVariants({\n          type: 'text',\n          content\n        }, () => {\n          callHooks('beforeDOMElementCreation', {\n            content,\n            params\n          });\n          return makeLayersTextAbstract({\n            content,\n            transform: _objectSpread2(_objectSpread2({}, meaninglessTransform), transform),\n            title,\n            extra: {\n              attributes,\n              styles,\n              classes: [\"\".concat(config.cssPrefix, \"-layers-text\"), ...classes]\n            }\n          });\n        });\n      }\n    };\n  },\n  provides(providers$$1) {\n    providers$$1.generateLayersText = function (node, nodeMeta) {\n      const {\n        title,\n        transform,\n        extra\n      } = nodeMeta;\n      let width = null;\n      let height = null;\n      if (IS_IE) {\n        const computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);\n        const boundingClientRect = node.getBoundingClientRect();\n        width = boundingClientRect.width / computedFontSize;\n        height = boundingClientRect.height / computedFontSize;\n      }\n      if (config.autoA11y && !title) {\n        extra.attributes['aria-hidden'] = 'true';\n      }\n      return Promise.resolve([node, makeLayersTextAbstract({\n        content: node.innerHTML,\n        width,\n        height,\n        transform,\n        title,\n        extra,\n        watchable: true\n      })]);\n    };\n  }\n};\n\nconst CLEAN_CONTENT_PATTERN = new RegExp('\\u{22}', 'ug');\nconst SECONDARY_UNICODE_RANGE = [1105920, 1112319];\nconst _FONT_FAMILY_WEIGHT_TO_PREFIX = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, {\n  FontAwesome: {\n    normal: 'fas',\n    400: 'fas'\n  }\n}), lt), wa), Yt);\nconst FONT_FAMILY_WEIGHT_TO_PREFIX = Object.keys(_FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, key) => {\n  acc[key.toLowerCase()] = _FONT_FAMILY_WEIGHT_TO_PREFIX[key];\n  return acc;\n}, {});\nconst FONT_FAMILY_WEIGHT_FALLBACK = Object.keys(FONT_FAMILY_WEIGHT_TO_PREFIX).reduce((acc, fontFamily) => {\n  const weights = FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamily];\n  acc[fontFamily] = weights[900] || [...Object.entries(weights)][0][1];\n  return acc;\n}, {});\nfunction hexValueFromContent(content) {\n  const cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');\n  const codePoint = codePointAt(cleaned, 0);\n  const isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];\n  const isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;\n  return {\n    value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),\n    isSecondary: isPrependTen || isDoubled\n  };\n}\nfunction getPrefix(fontFamily, fontWeight) {\n  const fontFamilySanitized = fontFamily.replace(/^['\"]|['\"]$/g, '').toLowerCase();\n  const fontWeightInteger = parseInt(fontWeight);\n  const fontWeightSanitized = isNaN(fontWeightInteger) ? 'normal' : fontWeightInteger;\n  return (FONT_FAMILY_WEIGHT_TO_PREFIX[fontFamilySanitized] || {})[fontWeightSanitized] || FONT_FAMILY_WEIGHT_FALLBACK[fontFamilySanitized];\n}\nfunction replaceForPosition(node, position) {\n  const pendingAttribute = \"\".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));\n  return new Promise((resolve, reject) => {\n    if (node.getAttribute(pendingAttribute) !== null) {\n      // This node is already being processed\n      return resolve();\n    }\n    const children = toArray(node.children);\n    const alreadyProcessedPseudoElement = children.filter(c$$1 => c$$1.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position)[0];\n    const styles = WINDOW.getComputedStyle(node, position);\n    const fontFamily = styles.getPropertyValue('font-family');\n    const fontFamilyMatch = fontFamily.match(FONT_FAMILY_PATTERN);\n    const fontWeight = styles.getPropertyValue('font-weight');\n    const content = styles.getPropertyValue('content');\n    if (alreadyProcessedPseudoElement && !fontFamilyMatch) {\n      // If we've already processed it but the current computed style does not result in a font-family,\n      // that probably means that a class name that was previously present to make the icon has been\n      // removed. So we now should delete the icon.\n      node.removeChild(alreadyProcessedPseudoElement);\n      return resolve();\n    } else if (fontFamilyMatch && content !== 'none' && content !== '') {\n      const content = styles.getPropertyValue('content');\n      let prefix = getPrefix(fontFamily, fontWeight);\n      const {\n        value: hexValue,\n        isSecondary\n      } = hexValueFromContent(content);\n      const isV4 = fontFamilyMatch[0].startsWith('FontAwesome');\n      let iconName = byUnicode(prefix, hexValue);\n      let iconIdentifier = iconName;\n      if (isV4) {\n        const iconName4 = byOldUnicode(hexValue);\n        if (iconName4.iconName && iconName4.prefix) {\n          iconName = iconName4.iconName;\n          prefix = iconName4.prefix;\n        }\n      }\n\n      // Only convert the pseudo element in this ::before/::after position into an icon if we haven't\n      // already done so with the same prefix and iconName\n      if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {\n        node.setAttribute(pendingAttribute, iconIdentifier);\n        if (alreadyProcessedPseudoElement) {\n          // Delete the old one, since we're replacing it with a new one\n          node.removeChild(alreadyProcessedPseudoElement);\n        }\n        const meta = blankMeta();\n        const {\n          extra\n        } = meta;\n        extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;\n        findIcon(iconName, prefix).then(main => {\n          const abstract = makeInlineSvgAbstract(_objectSpread2(_objectSpread2({}, meta), {}, {\n            icons: {\n              main,\n              mask: emptyCanonicalIcon()\n            },\n            prefix,\n            iconName: iconIdentifier,\n            extra,\n            watchable: true\n          }));\n          const element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');\n          if (position === '::before') {\n            node.insertBefore(element, node.firstChild);\n          } else {\n            node.appendChild(element);\n          }\n          element.outerHTML = abstract.map(a$$1 => toHtml(a$$1)).join('\\n');\n          node.removeAttribute(pendingAttribute);\n          resolve();\n        }).catch(reject);\n      } else {\n        resolve();\n      }\n    } else {\n      resolve();\n    }\n  });\n}\nfunction replace(node) {\n  return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);\n}\nfunction processable(node) {\n  return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');\n}\nfunction searchPseudoElements(root) {\n  if (!IS_DOM) return;\n  return new Promise((resolve, reject) => {\n    const operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);\n    const end = perf.begin('searchPseudoElements');\n    disableObservation();\n    Promise.all(operations).then(() => {\n      end();\n      enableObservation();\n      resolve();\n    }).catch(() => {\n      end();\n      enableObservation();\n      reject();\n    });\n  });\n}\nvar PseudoElements = {\n  hooks() {\n    return {\n      mutationObserverCallbacks(accumulator) {\n        accumulator.pseudoElementsCallback = searchPseudoElements;\n        return accumulator;\n      }\n    };\n  },\n  provides(providers) {\n    providers.pseudoElements2svg = function (params) {\n      const {\n        node = DOCUMENT\n      } = params;\n      if (config.searchPseudoElements) {\n        searchPseudoElements(node);\n      }\n    };\n  }\n};\n\nlet _unwatched = false;\nvar MutationObserver$1 = {\n  mixout() {\n    return {\n      dom: {\n        unwatch() {\n          disableObservation();\n          _unwatched = true;\n        }\n      }\n    };\n  },\n  hooks() {\n    return {\n      bootstrap() {\n        observe(chainHooks('mutationObserverCallbacks', {}));\n      },\n      noAuto() {\n        disconnect();\n      },\n      watch(params) {\n        const {\n          observeMutationsRoot\n        } = params;\n        if (_unwatched) {\n          enableObservation();\n        } else {\n          observe(chainHooks('mutationObserverCallbacks', {\n            observeMutationsRoot\n          }));\n        }\n      }\n    };\n  }\n};\n\nconst parseTransformString = transformString => {\n  let transform = {\n    size: 16,\n    x: 0,\n    y: 0,\n    flipX: false,\n    flipY: false,\n    rotate: 0\n  };\n  return transformString.toLowerCase().split(' ').reduce((acc, n) => {\n    const parts = n.toLowerCase().split('-');\n    const first = parts[0];\n    let rest = parts.slice(1).join('-');\n    if (first && rest === 'h') {\n      acc.flipX = true;\n      return acc;\n    }\n    if (first && rest === 'v') {\n      acc.flipY = true;\n      return acc;\n    }\n    rest = parseFloat(rest);\n    if (isNaN(rest)) {\n      return acc;\n    }\n    switch (first) {\n      case 'grow':\n        acc.size = acc.size + rest;\n        break;\n      case 'shrink':\n        acc.size = acc.size - rest;\n        break;\n      case 'left':\n        acc.x = acc.x - rest;\n        break;\n      case 'right':\n        acc.x = acc.x + rest;\n        break;\n      case 'up':\n        acc.y = acc.y - rest;\n        break;\n      case 'down':\n        acc.y = acc.y + rest;\n        break;\n      case 'rotate':\n        acc.rotate = acc.rotate + rest;\n        break;\n    }\n    return acc;\n  }, transform);\n};\nvar PowerTransforms = {\n  mixout() {\n    return {\n      parse: {\n        transform: transformString => {\n          return parseTransformString(transformString);\n        }\n      }\n    };\n  },\n  hooks() {\n    return {\n      parseNodeAttributes(accumulator, node) {\n        const transformString = node.getAttribute('data-fa-transform');\n        if (transformString) {\n          accumulator.transform = parseTransformString(transformString);\n        }\n        return accumulator;\n      }\n    };\n  },\n  provides(providers) {\n    providers.generateAbstractTransformGrouping = function (_ref) {\n      let {\n        main,\n        transform,\n        containerWidth,\n        iconWidth\n      } = _ref;\n      const outer = {\n        transform: \"translate(\".concat(containerWidth / 2, \" 256)\")\n      };\n      const innerTranslate = \"translate(\".concat(transform.x * 32, \", \").concat(transform.y * 32, \") \");\n      const innerScale = \"scale(\".concat(transform.size / 16 * (transform.flipX ? -1 : 1), \", \").concat(transform.size / 16 * (transform.flipY ? -1 : 1), \") \");\n      const innerRotate = \"rotate(\".concat(transform.rotate, \" 0 0)\");\n      const inner = {\n        transform: \"\".concat(innerTranslate, \" \").concat(innerScale, \" \").concat(innerRotate)\n      };\n      const path = {\n        transform: \"translate(\".concat(iconWidth / 2 * -1, \" -256)\")\n      };\n      const operations = {\n        outer,\n        inner,\n        path\n      };\n      return {\n        tag: 'g',\n        attributes: _objectSpread2({}, operations.outer),\n        children: [{\n          tag: 'g',\n          attributes: _objectSpread2({}, operations.inner),\n          children: [{\n            tag: main.icon.tag,\n            children: main.icon.children,\n            attributes: _objectSpread2(_objectSpread2({}, main.icon.attributes), operations.path)\n          }]\n        }]\n      };\n    };\n  }\n};\n\nconst ALL_SPACE = {\n  x: 0,\n  y: 0,\n  width: '100%',\n  height: '100%'\n};\nfunction fillBlack(abstract) {\n  let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n  if (abstract.attributes && (abstract.attributes.fill || force)) {\n    abstract.attributes.fill = 'black';\n  }\n  return abstract;\n}\nfunction deGroup(abstract) {\n  if (abstract.tag === 'g') {\n    return abstract.children;\n  } else {\n    return [abstract];\n  }\n}\nvar Masks = {\n  hooks() {\n    return {\n      parseNodeAttributes(accumulator, node) {\n        const maskData = node.getAttribute('data-fa-mask');\n        const mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(i => i.trim()));\n        if (!mask.prefix) {\n          mask.prefix = getDefaultUsablePrefix();\n        }\n        accumulator.mask = mask;\n        accumulator.maskId = node.getAttribute('data-fa-mask-id');\n        return accumulator;\n      }\n    };\n  },\n  provides(providers) {\n    providers.generateAbstractMask = function (_ref) {\n      let {\n        children,\n        attributes,\n        main,\n        mask,\n        maskId: explicitMaskId,\n        transform\n      } = _ref;\n      const {\n        width: mainWidth,\n        icon: mainPath\n      } = main;\n      const {\n        width: maskWidth,\n        icon: maskPath\n      } = mask;\n      const trans = transformForSvg({\n        transform,\n        containerWidth: maskWidth,\n        iconWidth: mainWidth\n      });\n      const maskRect = {\n        tag: 'rect',\n        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {\n          fill: 'white'\n        })\n      };\n      const maskInnerGroupChildrenMixin = mainPath.children ? {\n        children: mainPath.children.map(fillBlack)\n      } : {};\n      const maskInnerGroup = {\n        tag: 'g',\n        attributes: _objectSpread2({}, trans.inner),\n        children: [fillBlack(_objectSpread2({\n          tag: mainPath.tag,\n          attributes: _objectSpread2(_objectSpread2({}, mainPath.attributes), trans.path)\n        }, maskInnerGroupChildrenMixin))]\n      };\n      const maskOuterGroup = {\n        tag: 'g',\n        attributes: _objectSpread2({}, trans.outer),\n        children: [maskInnerGroup]\n      };\n      const maskId = \"mask-\".concat(explicitMaskId || nextUniqueId());\n      const clipId = \"clip-\".concat(explicitMaskId || nextUniqueId());\n      const maskTag = {\n        tag: 'mask',\n        attributes: _objectSpread2(_objectSpread2({}, ALL_SPACE), {}, {\n          id: maskId,\n          maskUnits: 'userSpaceOnUse',\n          maskContentUnits: 'userSpaceOnUse'\n        }),\n        children: [maskRect, maskOuterGroup]\n      };\n      const defs = {\n        tag: 'defs',\n        children: [{\n          tag: 'clipPath',\n          attributes: {\n            id: clipId\n          },\n          children: deGroup(maskPath)\n        }, maskTag]\n      };\n      children.push(defs, {\n        tag: 'rect',\n        attributes: _objectSpread2({\n          fill: 'currentColor',\n          'clip-path': \"url(#\".concat(clipId, \")\"),\n          mask: \"url(#\".concat(maskId, \")\")\n        }, ALL_SPACE)\n      });\n      return {\n        children,\n        attributes\n      };\n    };\n  }\n};\n\nvar MissingIconIndicator = {\n  provides(providers) {\n    let reduceMotion = false;\n    if (WINDOW.matchMedia) {\n      reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;\n    }\n    providers.missingIconAbstract = function () {\n      const gChildren = [];\n      const FILL = {\n        fill: 'currentColor'\n      };\n      const ANIMATION_BASE = {\n        attributeType: 'XML',\n        repeatCount: 'indefinite',\n        dur: '2s'\n      };\n\n      // Ring\n      gChildren.push({\n        tag: 'path',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'\n        })\n      });\n      const OPACITY_ANIMATE = _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {\n        attributeName: 'opacity'\n      });\n      const dot = {\n        tag: 'circle',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          cx: '256',\n          cy: '364',\n          r: '28'\n        }),\n        children: []\n      };\n      if (!reduceMotion) {\n        dot.children.push({\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, ANIMATION_BASE), {}, {\n            attributeName: 'r',\n            values: '28;14;28;28;14;28;'\n          })\n        }, {\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n            values: '1;0;1;1;0;1;'\n          })\n        });\n      }\n      gChildren.push(dot);\n      gChildren.push({\n        tag: 'path',\n        attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n          opacity: '1',\n          d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'\n        }),\n        children: reduceMotion ? [] : [{\n          tag: 'animate',\n          attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n            values: '1;0;0;0;0;1;'\n          })\n        }]\n      });\n      if (!reduceMotion) {\n        // Exclamation\n        gChildren.push({\n          tag: 'path',\n          attributes: _objectSpread2(_objectSpread2({}, FILL), {}, {\n            opacity: '0',\n            d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'\n          }),\n          children: [{\n            tag: 'animate',\n            attributes: _objectSpread2(_objectSpread2({}, OPACITY_ANIMATE), {}, {\n              values: '0;0;1;1;0;0;'\n            })\n          }]\n        });\n      }\n      return {\n        tag: 'g',\n        attributes: {\n          'class': 'missing'\n        },\n        children: gChildren\n      };\n    };\n  }\n};\n\nvar SvgSymbols = {\n  hooks() {\n    return {\n      parseNodeAttributes(accumulator, node) {\n        const symbolData = node.getAttribute('data-fa-symbol');\n        const symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;\n        accumulator['symbol'] = symbol;\n        return accumulator;\n      }\n    };\n  }\n};\n\nvar plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];\n\nregisterPlugins(plugins, {\n  mixoutsTo: api\n});\nconst noAuto$1 = api.noAuto;\nconst config$1 = api.config;\nconst library$1 = api.library;\nconst dom$1 = api.dom;\nconst parse$1 = api.parse;\nconst findIconDefinition$1 = api.findIconDefinition;\nconst toHtml$1 = api.toHtml;\nconst icon = api.icon;\nconst layer = api.layer;\nconst text = api.text;\nconst counter = api.counter;\n\nexport { noAuto$1 as noAuto, config$1 as config, library$1 as library, dom$1 as dom, parse$1 as parse, findIconDefinition$1 as findIconDefinition, toHtml$1 as toHtml, icon, layer, text, counter, api };\n","/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n  global.ShadowRoot &&\n  (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n  'adoptedStyleSheets' in Document.prototype &&\n  'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n  // This property needs to remain unminified.\n  ['_$cssResult$'] = true;\n  readonly cssText: string;\n  private _styleSheet?: CSSStyleSheet;\n  private _strings: TemplateStringsArray | undefined;\n\n  private constructor(\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ) {\n    if (safeToken !== constructionToken) {\n      throw new Error(\n        'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n      );\n    }\n    this.cssText = cssText;\n    this._strings = strings;\n  }\n\n  // This is a getter so that it's lazy. In practice, this means stylesheets\n  // are not created until the first element instance is made.\n  get styleSheet(): CSSStyleSheet | undefined {\n    // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n    // constructable.\n    let styleSheet = this._styleSheet;\n    const strings = this._strings;\n    if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n      const cacheable = strings !== undefined && strings.length === 1;\n      if (cacheable) {\n        styleSheet = cssTagCache.get(strings);\n      }\n      if (styleSheet === undefined) {\n        (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n          this.cssText\n        );\n        if (cacheable) {\n          cssTagCache.set(strings, styleSheet);\n        }\n      }\n    }\n    return styleSheet;\n  }\n\n  toString(): string {\n    return this.cssText;\n  }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n  new (\n    cssText: string,\n    strings: TemplateStringsArray | undefined,\n    safeToken: symbol\n  ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n  // This property needs to remain unminified.\n  if ((value as CSSResult)['_$cssResult$'] === true) {\n    return (value as CSSResult).cssText;\n  } else if (typeof value === 'number') {\n    return value;\n  } else {\n    throw new Error(\n      `Value passed to 'css' function must be a 'css' function result: ` +\n        `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n        `to ensure page security.`\n    );\n  }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n  new (CSSResult as ConstructableCSSResult)(\n    typeof value === 'string' ? value : String(value),\n    undefined,\n    constructionToken\n  );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n  strings: TemplateStringsArray,\n  ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n  const cssText =\n    strings.length === 1\n      ? strings[0]\n      : values.reduce(\n          (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n          strings[0]\n        );\n  return new (CSSResult as ConstructableCSSResult)(\n    cssText,\n    strings,\n    constructionToken\n  );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic spec behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n  renderRoot: ShadowRoot,\n  styles: Array<CSSResultOrNative>\n) => {\n  if (supportsAdoptingStyleSheets) {\n    (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n      s instanceof CSSStyleSheet ? s : s.styleSheet!\n    );\n  } else {\n    for (const s of styles) {\n      const style = document.createElement('style');\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const nonce = (global as any)['litNonce'];\n      if (nonce !== undefined) {\n        style.setAttribute('nonce', nonce);\n      }\n      style.textContent = (s as CSSResult).cssText;\n      renderRoot.appendChild(style);\n    }\n  }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n  let cssText = '';\n  for (const rule of sheet.cssRules) {\n    cssText += rule.cssText;\n  }\n  return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n  supportsAdoptingStyleSheets ||\n  (NODE_MODE && global.CSSStyleSheet === undefined)\n    ? (s: CSSResultOrNative) => s\n    : (s: CSSResultOrNative) =>\n        s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n  getCompatibleStyle,\n  adoptStyles,\n  CSSResultGroup,\n  CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n  ReactiveController,\n  ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n  -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n  is,\n  defineProperty,\n  getOwnPropertyDescriptor,\n  getOwnPropertyNames,\n  getOwnPropertySymbols,\n  getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n  global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n  .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n  ? (trustedTypes.emptyScript as unknown as '')\n  : '';\n\nconst polyfillSupport = DEV_MODE\n  ? global.reactiveElementPolyfillSupportDevMode\n  : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  const issuedWarnings: Set<string | undefined> = (global.litIssuedWarnings ??=\n    new Set());\n\n  // Issue a warning, if we haven't already.\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (!issuedWarnings.has(warning)) {\n      console.warn(warning);\n      issuedWarnings.add(warning);\n    }\n  };\n\n  issueWarning(\n    'dev-mode',\n    `Lit is in dev mode. Not recommended for production!`\n  );\n\n  // Issue polyfill support warning.\n  if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n    issueWarning(\n      'polyfill-support-missing',\n      `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n        `the \\`polyfill-support\\` module has not been loaded.`\n    );\n  }\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry = Update;\n    export interface Update {\n      kind: 'update';\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: ReactiveUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n  prop: P,\n  _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n  /**\n   * Called to convert an attribute value to a property\n   * value.\n   */\n  fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n  /**\n   * Called to convert a property value to an attribute\n   * value.\n   *\n   * It returns unknown instead of string, to be compatible with\n   * https://github.com/WICG/trusted-types (and similar efforts).\n   */\n  toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n  | ComplexAttributeConverter<Type>\n  | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n  /**\n   * When set to `true`, indicates the property is internal private state. The\n   * property should not be set by users. When using TypeScript, this property\n   * should be marked as `private` or `protected`, and it is also a common\n   * practice to use a leading `_` in the name. The property is not added to\n   * `observedAttributes`.\n   */\n  readonly state?: boolean;\n\n  /**\n   * Indicates how and whether the property becomes an observed attribute.\n   * If the value is `false`, the property is not added to `observedAttributes`.\n   * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n   * becomes `foobar`). If a string, the string value is observed (e.g\n   * `attribute: 'foo-bar'`).\n   */\n  readonly attribute?: boolean | string;\n\n  /**\n   * Indicates the type of the property. This is used only as a hint for the\n   * `converter` to determine how to convert the attribute\n   * to/from a property.\n   */\n  readonly type?: TypeHint;\n\n  /**\n   * Indicates how to convert the attribute to/from a property. If this value\n   * is a function, it is used to convert the attribute value a the property\n   * value. If it's an object, it can have keys for `fromAttribute` and\n   * `toAttribute`. If no `toAttribute` function is provided and\n   * `reflect` is set to `true`, the property value is set directly to the\n   * attribute. A default `converter` is used if none is provided; it supports\n   * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n   * when a property changes and the converter is used to update the attribute,\n   * the property is never updated again as a result of the attribute changing,\n   * and vice versa.\n   */\n  readonly converter?: AttributeConverter<Type, TypeHint>;\n\n  /**\n   * Indicates if the property should reflect to an attribute.\n   * If `true`, when the property is set, the attribute is set using the\n   * attribute name determined according to the rules for the `attribute`\n   * property option and the value of the property converted using the rules\n   * from the `converter` property option.\n   */\n  readonly reflect?: boolean;\n\n  /**\n   * A function that indicates if a property should be considered changed when\n   * it is set. The function should take the `newValue` and `oldValue` and\n   * return `true` if an update should be requested.\n   */\n  hasChanged?(value: Type, oldValue: Type): boolean;\n\n  /**\n   * Indicates whether an accessor will be created for this property. By\n   * default, an accessor will be generated for this property that requests an\n   * update when set. If this flag is `true`, no accessor will be created, and\n   * it will be the user's responsibility to call\n   * `this.requestUpdate(propertyName, oldValue)` to request an update when\n   * the property changes.\n   */\n  readonly noAccessor?: boolean;\n\n  /**\n   * Whether this property is wrapping accessors. This is set by `@property`\n   * to control the initial value change and reflection logic.\n   *\n   * @internal\n   */\n  wrapped?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n  readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n  ? PropertyValueMap<T>\n  : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n  get<K extends keyof T>(k: K): T[K] | undefined;\n  set<K extends keyof T>(key: K, value: T[K]): this;\n  has<K extends keyof T>(k: K): boolean;\n  delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n  toAttribute(value: unknown, type?: unknown): unknown {\n    switch (type) {\n      case Boolean:\n        value = value ? emptyStringForBooleanAttribute : null;\n        break;\n      case Object:\n      case Array:\n        // if the value is `null` or `undefined` pass this through\n        // to allow removing/no change behavior.\n        value = value == null ? value : JSON.stringify(value);\n        break;\n    }\n    return value;\n  },\n\n  fromAttribute(value: string | null, type?: unknown) {\n    let fromValue: unknown = value;\n    switch (type) {\n      case Boolean:\n        fromValue = value !== null;\n        break;\n      case Number:\n        fromValue = value === null ? null : Number(value);\n        break;\n      case Object:\n      case Array:\n        // Do *not* generate exception when invalid JSON is set as elements\n        // don't normally complain on being mis-configured.\n        // TODO(sorvell): Do generate exception in *dev mode*.\n        try {\n          // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n          fromValue = JSON.parse(value!) as unknown;\n        } catch (e) {\n          fromValue = null;\n        }\n        break;\n    }\n    return fromValue;\n  },\n};\n\nexport interface HasChanged {\n  (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n  !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute: true,\n  type: String,\n  converter: defaultConverter,\n  reflect: false,\n  hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n  | 'change-in-update'\n  | 'migration'\n  | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n  interface SymbolConstructor {\n    readonly metadata: unique symbol;\n  }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n  // This is public global API, do not change!\n  // eslint-disable-next-line no-var\n  var litPropertyMetadata: WeakMap<\n    object,\n    Map<PropertyKey, PropertyDeclaration>\n  >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n  object,\n  Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n  // In the Node build, this `extends` clause will be substituted with\n  // `(globalThis.HTMLElement ?? HTMLElement)`.\n  //\n  // This way, we will first prefer any global `HTMLElement` polyfill that the\n  // user has assigned, and then fall back to the `HTMLElement` shim which has\n  // been imported (see note at the top of this file about how this import is\n  // generated by Rollup). Note that the `HTMLElement` variable has been\n  // shadowed by this import, so it no longer refers to the global.\n  extends HTMLElement\n  implements ReactiveControllerHost\n{\n  // Note: these are patched in only in DEV_MODE.\n  /**\n   * Read or set all the enabled warning categories for this class.\n   *\n   * This property is only used in development builds.\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enabledWarnings?: WarningKind[];\n\n  /**\n   * Enable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Enable for all ReactiveElement subclasses\n   * ReactiveElement.enableWarning?.('migration');\n   *\n   * // Enable for only MyElement and subclasses\n   * MyElement.enableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static enableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Disable the given warning category for this class.\n   *\n   * This method only exists in development builds, so it should be accessed\n   * with a guard like:\n   *\n   * ```ts\n   * // Disable for all ReactiveElement subclasses\n   * ReactiveElement.disableWarning?.('migration');\n   *\n   * // Disable for only MyElement and subclasses\n   * MyElement.disableWarning?.('migration');\n   * ```\n   *\n   * @nocollapse\n   * @category dev-mode\n   */\n  static disableWarning?: (warningKind: WarningKind) => void;\n\n  /**\n   * Adds an initializer function to the class that is called during instance\n   * construction.\n   *\n   * This is useful for code that runs against a `ReactiveElement`\n   * subclass, such as a decorator, that needs to do work for each\n   * instance, such as setting up a `ReactiveController`.\n   *\n   * ```ts\n   * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n   *   target.addInitializer((instance: ReactiveElement) => {\n   *     // This is run during construction of the element\n   *     new MyController(instance);\n   *   });\n   * }\n   * ```\n   *\n   * Decorating a field will then cause each instance to run an initializer\n   * that adds a controller:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   @myDecorator foo;\n   * }\n   * ```\n   *\n   * Initializers are stored per-constructor. Adding an initializer to a\n   * subclass does not add it to a superclass. Since initializers are run in\n   * constructors, initializers will run in order of the class hierarchy,\n   * starting with superclasses and progressing to the instance's class.\n   *\n   * @nocollapse\n   */\n  static addInitializer(initializer: Initializer) {\n    this.__prepare();\n    (this._initializers ??= []).push(initializer);\n  }\n\n  static _initializers?: Initializer[];\n\n  /*\n   * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n   * all static methods and properties with initializers.  Reference:\n   * - https://github.com/google/closure-compiler/issues/1776\n   */\n\n  /**\n   * Maps attribute names to properties; for example `foobar` attribute to\n   * `fooBar` property. Created lazily on user subclasses when finalizing the\n   * class.\n   * @nocollapse\n   */\n  private static __attributeToPropertyMap: AttributeMap;\n\n  /**\n   * Marks class as having been finalized, which includes creating properties\n   * from `static properties`, but does *not* include all properties created\n   * from decorators.\n   * @nocollapse\n   */\n  protected static finalized: true | undefined;\n\n  /**\n   * Memoized list of all element properties, including any superclass\n   * properties. Created lazily on user subclasses when finalizing the class.\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static elementProperties: PropertyDeclarationMap;\n\n  /**\n   * User-supplied object that maps property names to `PropertyDeclaration`\n   * objects containing options for configuring reactive properties. When\n   * a reactive property is set the element will update and render.\n   *\n   * By default properties are public fields, and as such, they should be\n   * considered as primarily settable by element users, either via attribute or\n   * the property itself.\n   *\n   * Generally, properties that are changed by the element should be private or\n   * protected fields and should use the `state: true` option. Properties\n   * marked as `state` do not reflect from the corresponding attribute\n   *\n   * However, sometimes element code does need to set a public property. This\n   * should typically only be done in response to user interaction, and an event\n   * should be fired informing the user; for example, a checkbox sets its\n   * `checked` property when clicked and fires a `changed` event. Mutating\n   * public properties should typically not be done for non-primitive (object or\n   * array) properties. In other cases when an element needs to manage state, a\n   * private property set with the `state: true` option should be used. When\n   * needed, state properties can be initialized via public properties to\n   * facilitate complex interactions.\n   * @nocollapse\n   * @category properties\n   */\n  static properties: PropertyDeclarations;\n\n  /**\n   * Memoized list of all element styles.\n   * Created lazily on user subclasses when finalizing the class.\n   * @nocollapse\n   * @category styles\n   */\n  static elementStyles: Array<CSSResultOrNative> = [];\n\n  /**\n   * Array of styles to apply to the element. The styles should be defined\n   * using the {@linkcode css} tag function, via constructible stylesheets, or\n   * imported from native CSS module scripts.\n   *\n   * Note on Content Security Policy:\n   *\n   * Element styles are implemented with `<style>` tags when the browser doesn't\n   * support adopted StyleSheets. To use such `<style>` tags with the style-src\n   * CSP directive, the style-src value must either include 'unsafe-inline' or\n   * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n   * nonce.\n   *\n   * To provide a nonce to use on generated `<style>` elements, set\n   * `window.litNonce` to a server-generated nonce in your page's HTML, before\n   * loading application code:\n   *\n   * ```html\n   * <script>\n   *   // Generated and unique per request:\n   *   window.litNonce = 'a1b2c3d4';\n   * </script>\n   * ```\n   * @nocollapse\n   * @category styles\n   */\n  static styles?: CSSResultGroup;\n\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   * @nocollapse\n   * @category attributes\n   */\n  static get observedAttributes() {\n    // Ensure we've created all properties\n    this.finalize();\n    // this.__attributeToPropertyMap is only undefined after finalize() in\n    // ReactiveElement itself. ReactiveElement.observedAttributes is only\n    // accessed with ReactiveElement as the receiver when a subclass or mixin\n    // calls super.observedAttributes\n    return (\n      this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n    );\n  }\n\n  private __instanceProperties?: PropertyValues = undefined;\n\n  /**\n   * Creates a property accessor on the element prototype if one does not exist\n   * and stores a {@linkcode PropertyDeclaration} for the property with the\n   * given options. The property setter calls the property's `hasChanged`\n   * property option or uses a strict identity check to determine whether or not\n   * to request an update.\n   *\n   * This method may be overridden to customize properties; however,\n   * when doing so, it's important to call `super.createProperty` to ensure\n   * the property is setup correctly. This method calls\n   * `getPropertyDescriptor` internally to get a descriptor to install.\n   * To customize what properties do when they are get or set, override\n   * `getPropertyDescriptor`. To customize the options for a property,\n   * implement `createProperty` like this:\n   *\n   * ```ts\n   * static createProperty(name, options) {\n   *   options = Object.assign(options, {myOption: true});\n   *   super.createProperty(name, options);\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  static createProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration = defaultPropertyDeclaration\n  ) {\n    // If this is a state property, force the attribute to false.\n    if (options.state) {\n      (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n    }\n    this.__prepare();\n    this.elementProperties.set(name, options);\n    if (!options.noAccessor) {\n      const key = DEV_MODE\n        ? // Use Symbol.for in dev mode to make it easier to maintain state\n          // when doing HMR.\n          Symbol.for(`${String(name)} (@property() cache)`)\n        : Symbol();\n      const descriptor = this.getPropertyDescriptor(name, key, options);\n      if (descriptor !== undefined) {\n        defineProperty(this.prototype, name, descriptor);\n      }\n    }\n  }\n\n  /**\n   * Returns a property descriptor to be defined on the given named property.\n   * If no descriptor is returned, the property will not become an accessor.\n   * For example,\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   static getPropertyDescriptor(name, key, options) {\n   *     const defaultDescriptor =\n   *         super.getPropertyDescriptor(name, key, options);\n   *     const setter = defaultDescriptor.set;\n   *     return {\n   *       get: defaultDescriptor.get,\n   *       set(value) {\n   *         setter.call(this, value);\n   *         // custom action.\n   *       },\n   *       configurable: true,\n   *       enumerable: true\n   *     }\n   *   }\n   * }\n   * ```\n   *\n   * @nocollapse\n   * @category properties\n   */\n  protected static getPropertyDescriptor(\n    name: PropertyKey,\n    key: string | symbol,\n    options: PropertyDeclaration\n  ): PropertyDescriptor | undefined {\n    const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n      get(this: ReactiveElement) {\n        return this[key as keyof typeof this];\n      },\n      set(this: ReactiveElement, v: unknown) {\n        (this as unknown as Record<string | symbol, unknown>)[key] = v;\n      },\n    };\n    if (DEV_MODE && get == null) {\n      if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n        throw new Error(\n          `Field ${JSON.stringify(String(name))} on ` +\n            `${this.name} was declared as a reactive property ` +\n            `but it's actually declared as a value on the prototype. ` +\n            `Usually this is due to using @property or @state on a method.`\n        );\n      }\n      issueWarning(\n        'reactive-property-without-getter',\n        `Field ${JSON.stringify(String(name))} on ` +\n          `${this.name} was declared as a reactive property ` +\n          `but it does not have a getter. This will be an error in a ` +\n          `future version of Lit.`\n      );\n    }\n    return {\n      get(this: ReactiveElement) {\n        return get?.call(this);\n      },\n      set(this: ReactiveElement, value: unknown) {\n        const oldValue = get?.call(this);\n        set!.call(this, value);\n        this.requestUpdate(name, oldValue, options);\n      },\n      configurable: true,\n      enumerable: true,\n    };\n  }\n\n  /**\n   * Returns the property options associated with the given property.\n   * These options are defined with a `PropertyDeclaration` via the `properties`\n   * object or the `@property` decorator and are registered in\n   * `createProperty(...)`.\n   *\n   * Note, this method should be considered \"final\" and not overridden. To\n   * customize the options for a given property, override\n   * {@linkcode createProperty}.\n   *\n   * @nocollapse\n   * @final\n   * @category properties\n   */\n  static getPropertyOptions(name: PropertyKey) {\n    return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n  }\n\n  // Temporary, until google3 is on TypeScript 5.2\n  declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n  /**\n   * Initializes static own properties of the class used in bookkeeping\n   * for element properties, initializers, etc.\n   *\n   * Can be called multiple times by code that needs to ensure these\n   * properties exist before using them.\n   *\n   * This method ensures the superclass is finalized so that inherited\n   * property metadata can be copied down.\n   * @nocollapse\n   */\n  private static __prepare() {\n    if (\n      this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n    ) {\n      // Already prepared\n      return;\n    }\n    // Finalize any superclasses\n    const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n    superCtor.finalize();\n\n    // Create own set of initializers for this class if any exist on the\n    // superclass and copy them down. Note, for a small perf boost, avoid\n    // creating initializers unless needed.\n    if (superCtor._initializers !== undefined) {\n      this._initializers = [...superCtor._initializers];\n    }\n    // Initialize elementProperties from the superclass\n    this.elementProperties = new Map(superCtor.elementProperties);\n  }\n\n  /**\n   * Finishes setting up the class so that it's ready to be registered\n   * as a custom element and instantiated.\n   *\n   * This method is called by the ReactiveElement.observedAttributes getter.\n   * If you override the observedAttributes getter, you must either call\n   * super.observedAttributes to trigger finalization, or call finalize()\n   * yourself.\n   *\n   * @nocollapse\n   */\n  protected static finalize() {\n    if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n      return;\n    }\n    this.finalized = true;\n    this.__prepare();\n\n    // Create properties from the static properties block:\n    if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n      const props = this.properties;\n      const propKeys = [\n        ...getOwnPropertyNames(props),\n        ...getOwnPropertySymbols(props),\n      ] as Array<keyof typeof props>;\n      for (const p of propKeys) {\n        this.createProperty(p, props[p]);\n      }\n    }\n\n    // Create properties from standard decorator metadata:\n    const metadata = this[Symbol.metadata];\n    if (metadata !== null) {\n      const properties = litPropertyMetadata.get(metadata);\n      if (properties !== undefined) {\n        for (const [p, options] of properties) {\n          this.elementProperties.set(p, options);\n        }\n      }\n    }\n\n    // Create the attribute-to-property map\n    this.__attributeToPropertyMap = new Map();\n    for (const [p, options] of this.elementProperties) {\n      const attr = this.__attributeNameForProperty(p, options);\n      if (attr !== undefined) {\n        this.__attributeToPropertyMap.set(attr, p);\n      }\n    }\n\n    this.elementStyles = this.finalizeStyles(this.styles);\n\n    if (DEV_MODE) {\n      if (this.hasOwnProperty('createProperty')) {\n        issueWarning(\n          'no-override-create-property',\n          'Overriding ReactiveElement.createProperty() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n      if (this.hasOwnProperty('getPropertyDescriptor')) {\n        issueWarning(\n          'no-override-get-property-descriptor',\n          'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n            'The override will not be called with standard decorators'\n        );\n      }\n    }\n  }\n\n  /**\n   * Options used when calling `attachShadow`. Set this property to customize\n   * the options for the shadowRoot; for example, to create a closed\n   * shadowRoot: `{mode: 'closed'}`.\n   *\n   * Note, these options are used in `createRenderRoot`. If this method\n   * is customized, options should be respected if possible.\n   * @nocollapse\n   * @category rendering\n   */\n  static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n  /**\n   * Takes the styles the user supplied via the `static styles` property and\n   * returns the array of styles to apply to the element.\n   * Override this method to integrate into a style management system.\n   *\n   * Styles are deduplicated preserving the _last_ instance in the list. This\n   * is a performance optimization to avoid duplicated styles that can occur\n   * especially when composing via subclassing. The last item is kept to try\n   * to preserve the cascade order with the assumption that it's most important\n   * that last added styles override previous styles.\n   *\n   * @nocollapse\n   * @category styles\n   */\n  protected static finalizeStyles(\n    styles?: CSSResultGroup\n  ): Array<CSSResultOrNative> {\n    const elementStyles = [];\n    if (Array.isArray(styles)) {\n      // Dedupe the flattened array in reverse order to preserve the last items.\n      // Casting to Array<unknown> works around TS error that\n      // appears to come from trying to flatten a type CSSResultArray.\n      const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n      // Then preserve original order by adding the set items in reverse order.\n      for (const s of set) {\n        elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n      }\n    } else if (styles !== undefined) {\n      elementStyles.push(getCompatibleStyle(styles));\n    }\n    return elementStyles;\n  }\n\n  /**\n   * Node or ShadowRoot into which element DOM should be rendered. Defaults\n   * to an open shadowRoot.\n   * @category rendering\n   */\n  readonly renderRoot!: HTMLElement | DocumentFragment;\n\n  /**\n   * Returns the property name for the given attribute `name`.\n   * @nocollapse\n   */\n  private static __attributeNameForProperty(\n    name: PropertyKey,\n    options: PropertyDeclaration\n  ) {\n    const attribute = options.attribute;\n    return attribute === false\n      ? undefined\n      : typeof attribute === 'string'\n      ? attribute\n      : typeof name === 'string'\n      ? name.toLowerCase()\n      : undefined;\n  }\n\n  // Initialize to an unresolved Promise so we can make sure the element has\n  // connected before first update.\n  private __updatePromise!: Promise<boolean>;\n\n  /**\n   * True if there is a pending update as a result of calling `requestUpdate()`.\n   * Should only be read.\n   * @category updates\n   */\n  isUpdatePending = false;\n\n  /**\n   * Is set to `true` after the first update. The element code cannot assume\n   * that `renderRoot` exists before the element `hasUpdated`.\n   * @category updates\n   */\n  hasUpdated = false;\n\n  /**\n   * Map with keys for any properties that have changed since the last\n   * update cycle with previous values.\n   *\n   * @internal\n   */\n  _$changedProperties!: PropertyValues;\n\n  /**\n   * Properties that should be reflected when updated.\n   */\n  private __reflectingProperties?: Set<PropertyKey>;\n\n  /**\n   * Name of currently reflecting property\n   */\n  private __reflectingProperty: PropertyKey | null = null;\n\n  /**\n   * Set of controllers.\n   */\n  private __controllers?: Set<ReactiveController>;\n\n  constructor() {\n    super();\n    this.__initialize();\n  }\n\n  /**\n   * Internal only override point for customizing work done when elements\n   * are constructed.\n   */\n  private __initialize() {\n    this.__updatePromise = new Promise<boolean>(\n      (res) => (this.enableUpdating = res)\n    );\n    this._$changedProperties = new Map();\n    // This enqueues a microtask that ust run before the first update, so it\n    // must be called before requestUpdate()\n    this.__saveInstanceProperties();\n    // ensures first update will be caught by an early access of\n    // `updateComplete`\n    this.requestUpdate();\n    (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n      i(this)\n    );\n  }\n\n  /**\n   * Registers a `ReactiveController` to participate in the element's reactive\n   * update cycle. The element automatically calls into any registered\n   * controllers during its lifecycle callbacks.\n   *\n   * If the element is connected when `addController()` is called, the\n   * controller's `hostConnected()` callback will be immediately called.\n   * @category controllers\n   */\n  addController(controller: ReactiveController) {\n    (this.__controllers ??= new Set()).add(controller);\n    // If a controller is added after the element has been connected,\n    // call hostConnected. Note, re-using existence of `renderRoot` here\n    // (which is set in connectedCallback) to avoid the need to track a\n    // first connected state.\n    if (this.renderRoot !== undefined && this.isConnected) {\n      controller.hostConnected?.();\n    }\n  }\n\n  /**\n   * Removes a `ReactiveController` from the element.\n   * @category controllers\n   */\n  removeController(controller: ReactiveController) {\n    this.__controllers?.delete(controller);\n  }\n\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n   * (<=41), properties created for native platform properties like (`id` or\n   * `name`) may not have default values set in the element constructor. On\n   * these browsers native properties appear on instances and therefore their\n   * default value will overwrite any element default (e.g. if the element sets\n   * this.id = 'id' in the constructor, the 'id' will become '' since this is\n   * the native platform default).\n   */\n  private __saveInstanceProperties() {\n    const instanceProperties = new Map<PropertyKey, unknown>();\n    const elementProperties = (this.constructor as typeof ReactiveElement)\n      .elementProperties;\n    for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n      if (this.hasOwnProperty(p)) {\n        instanceProperties.set(p, this[p]);\n        delete this[p];\n      }\n    }\n    if (instanceProperties.size > 0) {\n      this.__instanceProperties = instanceProperties;\n    }\n  }\n\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return `this`.\n   *\n   * @return Returns a node into which to render.\n   * @category rendering\n   */\n  protected createRenderRoot(): HTMLElement | DocumentFragment {\n    const renderRoot =\n      this.shadowRoot ??\n      this.attachShadow(\n        (this.constructor as typeof ReactiveElement).shadowRootOptions\n      );\n    adoptStyles(\n      renderRoot,\n      (this.constructor as typeof ReactiveElement).elementStyles\n    );\n    return renderRoot;\n  }\n\n  /**\n   * On first connection, creates the element's renderRoot, sets up\n   * element styling, and enables updating.\n   * @category lifecycle\n   */\n  connectedCallback() {\n    // Create renderRoot before controllers `hostConnected`\n    (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n      this.createRenderRoot();\n    this.enableUpdating(true);\n    this.__controllers?.forEach((c) => c.hostConnected?.());\n  }\n\n  /**\n   * Note, this method should be considered final and not overridden. It is\n   * overridden on the element instance with a function that triggers the first\n   * update.\n   * @category updates\n   */\n  protected enableUpdating(_requestedUpdate: boolean) {}\n\n  /**\n   * Allows for `super.disconnectedCallback()` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   * @category lifecycle\n   */\n  disconnectedCallback() {\n    this.__controllers?.forEach((c) => c.hostDisconnected?.());\n  }\n\n  /**\n   * Synchronizes property values when attributes change.\n   *\n   * Specifically, when an attribute is set, the corresponding property is set.\n   * You should rarely need to implement this callback. If this method is\n   * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n   * called.\n   *\n   * See [using the lifecycle callbacks](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks)\n   * on MDN for more information about the `attributeChangedCallback`.\n   * @category attributes\n   */\n  attributeChangedCallback(\n    name: string,\n    _old: string | null,\n    value: string | null\n  ) {\n    this._$attributeToProperty(name, value);\n  }\n\n  private __propertyToAttribute(name: PropertyKey, value: unknown) {\n    const elemProperties: PropertyDeclarationMap = (\n      this.constructor as typeof ReactiveElement\n    ).elementProperties;\n    const options = elemProperties.get(name)!;\n    const attr = (\n      this.constructor as typeof ReactiveElement\n    ).__attributeNameForProperty(name, options);\n    if (attr !== undefined && options.reflect === true) {\n      const converter =\n        (options.converter as ComplexAttributeConverter)?.toAttribute !==\n        undefined\n          ? (options.converter as ComplexAttributeConverter)\n          : defaultConverter;\n      const attrValue = converter.toAttribute!(value, options.type);\n      if (\n        DEV_MODE &&\n        (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n          'migration'\n        ) &&\n        attrValue === undefined\n      ) {\n        issueWarning(\n          'undefined-attribute-value',\n          `The attribute value for the ${name as string} property is ` +\n            `undefined on element ${this.localName}. The attribute will be ` +\n            `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n            `the attribute would not have changed.`\n        );\n      }\n      // Track if the property is being reflected to avoid\n      // setting the property again via `attributeChangedCallback`. Note:\n      // 1. this takes advantage of the fact that the callback is synchronous.\n      // 2. will behave incorrectly if multiple attributes are in the reaction\n      // stack at time of calling. However, since we process attributes\n      // in `update` this should not be possible (or an extreme corner case\n      // that we'd like to discover).\n      // mark state reflecting\n      this.__reflectingProperty = name;\n      if (attrValue == null) {\n        this.removeAttribute(attr);\n      } else {\n        this.setAttribute(attr, attrValue as string);\n      }\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /** @internal */\n  _$attributeToProperty(name: string, value: string | null) {\n    const ctor = this.constructor as typeof ReactiveElement;\n    // Note, hint this as an `AttributeMap` so closure clearly understands\n    // the type; it has issues with tracking types through statics\n    const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n    // Use tracking info to avoid reflecting a property value to an attribute\n    // if it was just set because the attribute changed.\n    if (propName !== undefined && this.__reflectingProperty !== propName) {\n      const options = ctor.getPropertyOptions(propName);\n      const converter =\n        typeof options.converter === 'function'\n          ? {fromAttribute: options.converter}\n          : options.converter?.fromAttribute !== undefined\n          ? options.converter\n          : defaultConverter;\n      // mark state reflecting\n      this.__reflectingProperty = propName;\n      this[propName as keyof this] = converter.fromAttribute!(\n        value,\n        options.type\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      ) as any;\n      // mark state not reflecting\n      this.__reflectingProperty = null;\n    }\n  }\n\n  /**\n   * Requests an update which is processed asynchronously. This should be called\n   * when an element should update based on some state not triggered by setting\n   * a reactive property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property `name` and `oldValue` to ensure that any configured property\n   * options are honored.\n   *\n   * @param name name of requesting property\n   * @param oldValue old value of requesting property\n   * @param options property options to use instead of the previously\n   *     configured options\n   * @category updates\n   */\n  requestUpdate(\n    name?: PropertyKey,\n    oldValue?: unknown,\n    options?: PropertyDeclaration\n  ): void {\n    // If we have a property key, perform property update steps.\n    if (name !== undefined) {\n      if (DEV_MODE && (name as unknown) instanceof Event) {\n        issueWarning(\n          ``,\n          `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n        );\n      }\n      options ??= (\n        this.constructor as typeof ReactiveElement\n      ).getPropertyOptions(name);\n      const hasChanged = options.hasChanged ?? notEqual;\n      const newValue = this[name as keyof this];\n      if (hasChanged(newValue, oldValue)) {\n        this._$changeProperty(name, oldValue, options);\n      } else {\n        // Abort the request if the property should not be considered changed.\n        return;\n      }\n    }\n    if (this.isUpdatePending === false) {\n      this.__updatePromise = this.__enqueueUpdate();\n    }\n  }\n\n  /**\n   * @internal\n   */\n  _$changeProperty(\n    name: PropertyKey,\n    oldValue: unknown,\n    options: PropertyDeclaration\n  ) {\n    // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n    // vs just Map.set()\n    if (!this._$changedProperties.has(name)) {\n      this._$changedProperties.set(name, oldValue);\n    }\n    // Add to reflecting properties set.\n    // Note, it's important that every change has a chance to add the\n    // property to `__reflectingProperties`. This ensures setting\n    // attribute + property reflects correctly.\n    if (options.reflect === true && this.__reflectingProperty !== name) {\n      (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n    }\n  }\n\n  /**\n   * Sets up the element to asynchronously update.\n   */\n  private async __enqueueUpdate() {\n    this.isUpdatePending = true;\n    try {\n      // Ensure any previous update has resolved before updating.\n      // This `await` also ensures that property changes are batched.\n      await this.__updatePromise;\n    } catch (e) {\n      // Refire any previous errors async so they do not disrupt the update\n      // cycle. Errors are refired so developers have a chance to observe\n      // them, and this can be done by implementing\n      // `window.onunhandledrejection`.\n      Promise.reject(e);\n    }\n    const result = this.scheduleUpdate();\n    // If `scheduleUpdate` returns a Promise, we await it. This is done to\n    // enable coordinating updates with a scheduler. Note, the result is\n    // checked to avoid delaying an additional microtask unless we need to.\n    if (result != null) {\n      await result;\n    }\n    return !this.isUpdatePending;\n  }\n\n  /**\n   * Schedules an element update. You can override this method to change the\n   * timing of updates by returning a Promise. The update will await the\n   * returned Promise, and you should resolve the Promise to allow the update\n   * to proceed. If this method is overridden, `super.scheduleUpdate()`\n   * must be called.\n   *\n   * For instance, to schedule updates to occur just before the next frame:\n   *\n   * ```ts\n   * override protected async scheduleUpdate(): Promise<unknown> {\n   *   await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n   *   super.scheduleUpdate();\n   * }\n   * ```\n   * @category updates\n   */\n  protected scheduleUpdate(): void | Promise<unknown> {\n    const result = this.performUpdate();\n    if (\n      DEV_MODE &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'async-perform-update'\n      ) &&\n      typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n        'function'\n    ) {\n      issueWarning(\n        'async-perform-update',\n        `Element ${this.localName} returned a Promise from performUpdate(). ` +\n          `This behavior is deprecated and will be removed in a future ` +\n          `version of ReactiveElement.`\n      );\n    }\n    return result;\n  }\n\n  /**\n   * Performs an element update. Note, if an exception is thrown during the\n   * update, `firstUpdated` and `updated` will not be called.\n   *\n   * Call `performUpdate()` to immediately process a pending update. This should\n   * generally not be needed, but it can be done in rare cases when you need to\n   * update synchronously.\n   *\n   * @category updates\n   */\n  protected performUpdate(): void {\n    // Abort any update if one is not pending when this is called.\n    // This can happen if `performUpdate` is called early to \"flush\"\n    // the update.\n    if (!this.isUpdatePending) {\n      return;\n    }\n    debugLogEvent?.({kind: 'update'});\n    if (!this.hasUpdated) {\n      // Create renderRoot before first update. This occurs in `connectedCallback`\n      // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n      (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n        this.createRenderRoot();\n      if (DEV_MODE) {\n        // Produce warning if any reactive properties on the prototype are\n        // shadowed by class fields. Instance fields set before upgrade are\n        // deleted by this point, so any own property is caused by class field\n        // initialization in the constructor.\n        const ctor = this.constructor as typeof ReactiveElement;\n        const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n          (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n        );\n        if (shadowedProperties.length) {\n          throw new Error(\n            `The following properties on element ${this.localName} will not ` +\n              `trigger updates as expected because they are set using class ` +\n              `fields: ${shadowedProperties.join(', ')}. ` +\n              `Native class fields and some compiled output will overwrite ` +\n              `accessors used for detecting changes. See ` +\n              `https://lit.dev/msg/class-field-shadowing ` +\n              `for more information.`\n          );\n        }\n      }\n      // Mixin instance properties once, if they exist.\n      if (this.__instanceProperties) {\n        // TODO (justinfagnani): should we use the stored value? Could a new value\n        // have been set since we stored the own property value?\n        for (const [p, value] of this.__instanceProperties) {\n          this[p as keyof this] = value as this[keyof this];\n        }\n        this.__instanceProperties = undefined;\n      }\n      // Trigger initial value reflection and populate the initial\n      // changedProperties map, but only for the case of experimental\n      // decorators on accessors, which will not have already populated the\n      // changedProperties map. We can't know if these accessors had\n      // initializers, so we just set them anyway - a difference from\n      // experimental decorators on fields and standard decorators on\n      // auto-accessors.\n      // For context why experimentalDecorators with auto accessors are handled\n      // specifically also see:\n      // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n      const elementProperties = (this.constructor as typeof ReactiveElement)\n        .elementProperties;\n      if (elementProperties.size > 0) {\n        for (const [p, options] of elementProperties) {\n          if (\n            options.wrapped === true &&\n            !this._$changedProperties.has(p) &&\n            this[p as keyof this] !== undefined\n          ) {\n            this._$changeProperty(p, this[p as keyof this], options);\n          }\n        }\n      }\n    }\n    let shouldUpdate = false;\n    const changedProperties = this._$changedProperties;\n    try {\n      shouldUpdate = this.shouldUpdate(changedProperties);\n      if (shouldUpdate) {\n        this.willUpdate(changedProperties);\n        this.__controllers?.forEach((c) => c.hostUpdate?.());\n        this.update(changedProperties);\n      } else {\n        this.__markUpdated();\n      }\n    } catch (e) {\n      // Prevent `firstUpdated` and `updated` from running when there's an\n      // update exception.\n      shouldUpdate = false;\n      // Ensure element can accept additional updates after an exception.\n      this.__markUpdated();\n      throw e;\n    }\n    // The update is no longer considered pending and further updates are now allowed.\n    if (shouldUpdate) {\n      this._$didUpdate(changedProperties);\n    }\n  }\n\n  /**\n   * Invoked before `update()` to compute values needed during the update.\n   *\n   * Implement `willUpdate` to compute property values that depend on other\n   * properties and are used in the rest of the update process.\n   *\n   * ```ts\n   * willUpdate(changedProperties) {\n   *   // only need to check changed properties for an expensive computation.\n   *   if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n   *     this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n   *   }\n   * }\n   *\n   * render() {\n   *   return html`SHA: ${this.sha}`;\n   * }\n   * ```\n   *\n   * @category updates\n   */\n  protected willUpdate(_changedProperties: PropertyValues): void {}\n\n  // Note, this is an override point for polyfill-support.\n  // @internal\n  _$didUpdate(changedProperties: PropertyValues) {\n    this.__controllers?.forEach((c) => c.hostUpdated?.());\n    if (!this.hasUpdated) {\n      this.hasUpdated = true;\n      this.firstUpdated(changedProperties);\n    }\n    this.updated(changedProperties);\n    if (\n      DEV_MODE &&\n      this.isUpdatePending &&\n      (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n        'change-in-update'\n      )\n    ) {\n      issueWarning(\n        'change-in-update',\n        `Element ${this.localName} scheduled an update ` +\n          `(generally because a property was set) ` +\n          `after an update completed, causing a new update to be scheduled. ` +\n          `This is inefficient and should be avoided unless the next update ` +\n          `can only be scheduled as a side effect of the previous update.`\n      );\n    }\n  }\n\n  private __markUpdated() {\n    this._$changedProperties = new Map();\n    this.isUpdatePending = false;\n  }\n\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is `true` if the element completed the\n   * update without triggering another update. The Promise result is `false` if\n   * a property was set inside `updated()`. If the Promise is rejected, an\n   * exception was thrown during the update.\n   *\n   * To await additional asynchronous work, override the `getUpdateComplete`\n   * method. For example, it is sometimes useful to await a rendered element\n   * before fulfilling this Promise. To do this, first await\n   * `super.getUpdateComplete()`, then any subsequent state.\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  get updateComplete(): Promise<boolean> {\n    return this.getUpdateComplete();\n  }\n\n  /**\n   * Override point for the `updateComplete` promise.\n   *\n   * It is not safe to override the `updateComplete` getter directly due to a\n   * limitation in TypeScript which means it is not possible to call a\n   * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n   * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n   * This method should be overridden instead. For example:\n   *\n   * ```ts\n   * class MyElement extends LitElement {\n   *   override async getUpdateComplete() {\n   *     const result = await super.getUpdateComplete();\n   *     await this._myChild.updateComplete;\n   *     return result;\n   *   }\n   * }\n   * ```\n   *\n   * @return A promise of a boolean that resolves to true if the update completed\n   *     without triggering another update.\n   * @category updates\n   */\n  protected getUpdateComplete(): Promise<boolean> {\n    return this.__updatePromise;\n  }\n\n  /**\n   * Controls whether or not `update()` should be called when the element requests\n   * an update. By default, this method always returns `true`, but this can be\n   * customized to control when to update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n    return true;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated element DOM.\n   * Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected update(_changedProperties: PropertyValues) {\n    // The forEach() expression will only run when when __reflectingProperties is\n    // defined, and it returns undefined, setting __reflectingProperties to\n    // undefined\n    this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n      this.__propertyToAttribute(p, this[p as keyof this])\n    ) as undefined;\n    this.__markUpdated();\n  }\n\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected updated(_changedProperties: PropertyValues) {}\n\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * ```ts\n   * firstUpdated() {\n   *   this.renderRoot.getElementById('my-text-area').focus();\n   * }\n   * ```\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * @param _changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n  JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n  JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n  // Default warning set.\n  ReactiveElement.enabledWarnings = [\n    'change-in-update',\n    'async-perform-update',\n  ];\n  const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n    if (\n      !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n    ) {\n      ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n    }\n  };\n  ReactiveElement.enableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    if (!this.enabledWarnings!.includes(warning)) {\n      this.enabledWarnings!.push(warning);\n    }\n  };\n  ReactiveElement.disableWarning = function (\n    this: typeof ReactiveElement,\n    warning: WarningKind\n  ) {\n    ensureOwnWarnings(this);\n    const i = this.enabledWarnings!.indexOf(warning);\n    if (i >= 0) {\n      this.enabledWarnings!.splice(i, 1);\n    }\n  };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.0.4');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n  issueWarning!(\n    'multiple-versions',\n    `Multiple versions of Lit loaded. Loading multiple versions ` +\n      `is not recommended.`\n  );\n}\n","/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class\n * @param {number} x the x-coordinate. This could be longitude or screen pixels, or any other sort of unit.\n * @param {number} y the y-coordinate. This could be latitude or screen pixels, or any other sort of unit.\n *\n * @example\n * const point = new Point(-77, 38);\n */\nexport default function Point(x, y) {\n    this.x = x;\n    this.y = y;\n}\n\nPoint.prototype = {\n    /**\n     * Clone this point, returning a new point that can be modified\n     * without affecting the old one.\n     * @return {Point} the clone\n     */\n    clone() { return new Point(this.x, this.y); },\n\n    /**\n     * Add this point's x & y coordinates to another point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    add(p) { return this.clone()._add(p); },\n\n    /**\n     * Subtract this point's x & y coordinates to from point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    sub(p) { return this.clone()._sub(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    multByPoint(p) { return this.clone()._multByPoint(p); },\n\n    /**\n     * Divide this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    divByPoint(p) { return this.clone()._divByPoint(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {number} k factor\n     * @return {Point} output point\n     */\n    mult(k) { return this.clone()._mult(k); },\n\n    /**\n     * Divide this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {number} k factor\n     * @return {Point} output point\n     */\n    div(k) { return this.clone()._div(k); },\n\n    /**\n     * Rotate this point around the 0, 0 origin by an angle a,\n     * given in radians\n     * @param {number} a angle to rotate around, in radians\n     * @return {Point} output point\n     */\n    rotate(a) { return this.clone()._rotate(a); },\n\n    /**\n     * Rotate this point around p point by an angle a,\n     * given in radians\n     * @param {number} a angle to rotate around, in radians\n     * @param {Point} p Point to rotate around\n     * @return {Point} output point\n     */\n    rotateAround(a, p) { return this.clone()._rotateAround(a, p); },\n\n    /**\n     * Multiply this point by a 4x1 transformation matrix\n     * @param {[number, number, number, number]} m transformation matrix\n     * @return {Point} output point\n     */\n    matMult(m) { return this.clone()._matMult(m); },\n\n    /**\n     * Calculate this point but as a unit vector from 0, 0, meaning\n     * that the distance from the resulting point to the 0, 0\n     * coordinate will be equal to 1 and the angle from the resulting\n     * point to the 0, 0 coordinate will be the same as before.\n     * @return {Point} unit vector point\n     */\n    unit() { return this.clone()._unit(); },\n\n    /**\n     * Compute a perpendicular point, where the new y coordinate\n     * is the old x coordinate and the new x coordinate is the old y\n     * coordinate multiplied by -1\n     * @return {Point} perpendicular point\n     */\n    perp() { return this.clone()._perp(); },\n\n    /**\n     * Return a version of this point with the x & y coordinates\n     * rounded to integers.\n     * @return {Point} rounded point\n     */\n    round() { return this.clone()._round(); },\n\n    /**\n     * Return the magnitude of this point: this is the Euclidean\n     * distance from the 0, 0 coordinate to this point's x and y\n     * coordinates.\n     * @return {number} magnitude\n     */\n    mag() {\n        return Math.sqrt(this.x * this.x + this.y * this.y);\n    },\n\n    /**\n     * Judge whether this point is equal to another point, returning\n     * true or false.\n     * @param {Point} other the other point\n     * @return {boolean} whether the points are equal\n     */\n    equals(other) {\n        return this.x === other.x &&\n               this.y === other.y;\n    },\n\n    /**\n     * Calculate the distance from this point to another point\n     * @param {Point} p the other point\n     * @return {number} distance\n     */\n    dist(p) {\n        return Math.sqrt(this.distSqr(p));\n    },\n\n    /**\n     * Calculate the distance from this point to another point,\n     * without the square root step. Useful if you're comparing\n     * relative distances.\n     * @param {Point} p the other point\n     * @return {number} distance\n     */\n    distSqr(p) {\n        const dx = p.x - this.x,\n            dy = p.y - this.y;\n        return dx * dx + dy * dy;\n    },\n\n    /**\n     * Get the angle from the 0, 0 coordinate to this point, in radians\n     * coordinates.\n     * @return {number} angle\n     */\n    angle() {\n        return Math.atan2(this.y, this.x);\n    },\n\n    /**\n     * Get the angle from this point to another point, in radians\n     * @param {Point} b the other point\n     * @return {number} angle\n     */\n    angleTo(b) {\n        return Math.atan2(this.y - b.y, this.x - b.x);\n    },\n\n    /**\n     * Get the angle between this point and another point, in radians\n     * @param {Point} b the other point\n     * @return {number} angle\n     */\n    angleWith(b) {\n        return this.angleWithSep(b.x, b.y);\n    },\n\n    /**\n     * Find the angle of the two vectors, solving the formula for\n     * the cross product a x b = |a||b|sin(θ) for θ.\n     * @param {number} x the x-coordinate\n     * @param {number} y the y-coordinate\n     * @return {number} the angle in radians\n     */\n    angleWithSep(x, y) {\n        return Math.atan2(\n            this.x * y - this.y * x,\n            this.x * x + this.y * y);\n    },\n\n    /** @param {[number, number, number, number]} m */\n    _matMult(m) {\n        const x = m[0] * this.x + m[1] * this.y,\n            y = m[2] * this.x + m[3] * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _add(p) {\n        this.x += p.x;\n        this.y += p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _sub(p) {\n        this.x -= p.x;\n        this.y -= p.y;\n        return this;\n    },\n\n    /** @param {number} k */\n    _mult(k) {\n        this.x *= k;\n        this.y *= k;\n        return this;\n    },\n\n    /** @param {number} k */\n    _div(k) {\n        this.x /= k;\n        this.y /= k;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _multByPoint(p) {\n        this.x *= p.x;\n        this.y *= p.y;\n        return this;\n    },\n\n    /** @param {Point} p */\n    _divByPoint(p) {\n        this.x /= p.x;\n        this.y /= p.y;\n        return this;\n    },\n\n    _unit() {\n        this._div(this.mag());\n        return this;\n    },\n\n    _perp() {\n        const y = this.y;\n        this.y = this.x;\n        this.x = -y;\n        return this;\n    },\n\n    /** @param {number} angle */\n    _rotate(angle) {\n        const cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = cos * this.x - sin * this.y,\n            y = sin * this.x + cos * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    /**\n     * @param {number} angle\n     * @param {Point} p\n     */\n    _rotateAround(angle, p) {\n        const cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n            y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    _round() {\n        this.x = Math.round(this.x);\n        this.y = Math.round(this.y);\n        return this;\n    },\n\n    constructor: Point\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, return it unchanged.\n * @param {Point | [number, number] | {x: number, y: number}} p input value\n * @return {Point} constructed point.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (p) {\n    if (p instanceof Point) {\n        return /** @type {Point} */ (p);\n    }\n    if (Array.isArray(p)) {\n        return new Point(+p[0], +p[1]);\n    }\n    if (p.x !== undefined && p.y !== undefined) {\n        return new Point(+p.x, +p.y);\n    }\n    throw new Error('Expected [x, y] or {x, y} point format');\n};\n","\nimport Point from '@mapbox/point-geometry';\n\n/** @import Pbf from 'pbf' */\n/** @import {Feature} from 'geojson' */\n\nexport class VectorTileFeature {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} end\n     * @param {number} extent\n     * @param {string[]} keys\n     * @param {(number | string | boolean)[]} values\n     */\n    constructor(pbf, end, extent, keys, values) {\n        // Public\n\n        /** @type {Record<string, number | string | boolean>} */\n        this.properties = {};\n\n        this.extent = extent;\n        /** @type {0 | 1 | 2 | 3} */\n        this.type = 0;\n\n        /** @type {number | undefined} */\n        this.id = undefined;\n\n        /** @private */\n        this._pbf = pbf;\n        /** @private */\n        this._geometry = -1;\n        /** @private */\n        this._keys = keys;\n        /** @private */\n        this._values = values;\n\n        pbf.readFields(readFeature, this, end);\n    }\n\n    loadGeometry() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n\n        /** @type Point[][] */\n        const lines = [];\n\n        /** @type Point[] | undefined */\n        let line;\n\n        let cmd = 1;\n        let length = 0;\n        let x = 0;\n        let y = 0;\n\n        while (pbf.pos < end) {\n            if (length <= 0) {\n                const cmdLen = pbf.readVarint();\n                cmd = cmdLen & 0x7;\n                length = cmdLen >> 3;\n            }\n\n            length--;\n\n            if (cmd === 1 || cmd === 2) {\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\n\n                if (cmd === 1) { // moveTo\n                    if (line) lines.push(line);\n                    line = [];\n                }\n\n                if (line) line.push(new Point(x, y));\n\n            } else if (cmd === 7) {\n\n                // Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90\n                if (line) {\n                    line.push(line[0].clone()); // closePolygon\n                }\n\n            } else {\n                throw new Error(`unknown command ${cmd}`);\n            }\n        }\n\n        if (line) lines.push(line);\n\n        return lines;\n    }\n\n    bbox() {\n        const pbf = this._pbf;\n        pbf.pos = this._geometry;\n\n        const end = pbf.readVarint() + pbf.pos;\n        let cmd = 1,\n            length = 0,\n            x = 0,\n            y = 0,\n            x1 = Infinity,\n            x2 = -Infinity,\n            y1 = Infinity,\n            y2 = -Infinity;\n\n        while (pbf.pos < end) {\n            if (length <= 0) {\n                const cmdLen = pbf.readVarint();\n                cmd = cmdLen & 0x7;\n                length = cmdLen >> 3;\n            }\n\n            length--;\n\n            if (cmd === 1 || cmd === 2) {\n                x += pbf.readSVarint();\n                y += pbf.readSVarint();\n                if (x < x1) x1 = x;\n                if (x > x2) x2 = x;\n                if (y < y1) y1 = y;\n                if (y > y2) y2 = y;\n\n            } else if (cmd !== 7) {\n                throw new Error(`unknown command ${cmd}`);\n            }\n        }\n\n        return [x1, y1, x2, y2];\n    }\n\n    /**\n     * @param {number} x\n     * @param {number} y\n     * @param {number} z\n     * @return {Feature}\n     */\n    toGeoJSON(x, y, z) {\n        const size = this.extent * Math.pow(2, z),\n            x0 = this.extent * x,\n            y0 = this.extent * y,\n            vtCoords = this.loadGeometry();\n\n        /** @param {Point} p */\n        function projectPoint(p) {\n            return [\n                (p.x + x0) * 360 / size - 180,\n                360 / Math.PI * Math.atan(Math.exp((1 - (p.y + y0) * 2 / size) * Math.PI)) - 90\n            ];\n        }\n\n        /** @param {Point[]} line */\n        function projectLine(line) {\n            return line.map(projectPoint);\n        }\n\n        /** @type {Feature[\"geometry\"]} */\n        let geometry;\n\n        if (this.type === 1) {\n            const points = [];\n            for (const line of vtCoords) {\n                points.push(line[0]);\n            }\n            const coordinates = projectLine(points);\n            geometry = points.length === 1 ?\n                {type: 'Point', coordinates: coordinates[0]} :\n                {type: 'MultiPoint', coordinates};\n\n        } else if (this.type === 2) {\n\n            const coordinates = vtCoords.map(projectLine);\n            geometry = coordinates.length === 1 ?\n                {type: 'LineString', coordinates: coordinates[0]} :\n                {type: 'MultiLineString', coordinates};\n\n        } else if (this.type === 3) {\n            const polygons = classifyRings(vtCoords);\n            const coordinates = [];\n            for (const polygon of polygons) {\n                coordinates.push(polygon.map(projectLine));\n            }\n            geometry = coordinates.length === 1 ?\n                {type: 'Polygon', coordinates: coordinates[0]} :\n                {type: 'MultiPolygon', coordinates};\n        } else {\n\n            throw new Error('unknown feature type');\n        }\n\n        /** @type {Feature} */\n        const result = {\n            type: 'Feature',\n            geometry,\n            properties: this.properties\n        };\n\n        if (this.id != null) {\n            result.id = this.id;\n        }\n\n        return result;\n    }\n}\n\n/** @type {['Unknown', 'Point', 'LineString', 'Polygon']} */\nVectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\n/**\n * @param {number} tag\n * @param {VectorTileFeature} feature\n * @param {Pbf} pbf\n */\nfunction readFeature(tag, feature, pbf) {\n    if (tag === 1) feature.id = pbf.readVarint();\n    else if (tag === 2) readTag(pbf, feature);\n    else if (tag === 3) feature.type = /** @type {0 | 1 | 2 | 3} */ (pbf.readVarint());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) feature._geometry = pbf.pos;\n}\n\n/**\n * @param {Pbf} pbf\n * @param {VectorTileFeature} feature\n */\nfunction readTag(pbf, feature) {\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const key = feature._keys[pbf.readVarint()];\n        // @ts-expect-error TS2341 deliberately accessing a private property\n        const value = feature._values[pbf.readVarint()];\n        feature.properties[key] = value;\n    }\n}\n\n/** classifies an array of rings into polygons with outer rings and holes\n * @param {Point[][]} rings\n */\nexport function classifyRings(rings) {\n    const len = rings.length;\n\n    if (len <= 1) return [rings];\n\n    const polygons = [];\n    let polygon, ccw;\n\n    for (let i = 0; i < len; i++) {\n        const area = signedArea(rings[i]);\n        if (area === 0) continue;\n\n        if (ccw === undefined) ccw = area < 0;\n\n        if (ccw === area < 0) {\n            if (polygon) polygons.push(polygon);\n            polygon = [rings[i]];\n\n        } else if (polygon) {\n            polygon.push(rings[i]);\n        }\n    }\n    if (polygon) polygons.push(polygon);\n\n    return polygons;\n}\n\n/** @param {Point[]} ring */\nfunction signedArea(ring) {\n    let sum = 0;\n    for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n        p1 = ring[i];\n        p2 = ring[j];\n        sum += (p2.x - p1.x) * (p1.y + p2.y);\n    }\n    return sum;\n}\n\nexport class VectorTileLayer {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        // Public\n        this.version = 1;\n        this.name = '';\n        this.extent = 4096;\n        this.length = 0;\n\n        /** @private */\n        this._pbf = pbf;\n\n        /** @private\n         * @type {string[]} */\n        this._keys = [];\n\n        /** @private\n         * @type {(number | string | boolean)[]} */\n        this._values = [];\n\n        /** @private\n         * @type {number[]} */\n        this._features = [];\n\n        pbf.readFields(readLayer, this, end);\n\n        this.length = this._features.length;\n    }\n\n    /** return feature `i` from this layer as a `VectorTileFeature`\n     * @param {number} i\n     */\n    feature(i) {\n        if (i < 0 || i >= this._features.length) throw new Error('feature index out of bounds');\n\n        this._pbf.pos = this._features[i];\n\n        const end = this._pbf.readVarint() + this._pbf.pos;\n        return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {VectorTileLayer} layer\n * @param {Pbf} pbf\n */\nfunction readLayer(tag, layer, pbf) {\n    if (tag === 15) layer.version = pbf.readVarint();\n    else if (tag === 1) layer.name = pbf.readString();\n    else if (tag === 5) layer.extent = pbf.readVarint();\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 2) layer._features.push(pbf.pos);\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 3) layer._keys.push(pbf.readString());\n    // @ts-expect-error TS2341 deliberately accessing a private property\n    else if (tag === 4) layer._values.push(readValueMessage(pbf));\n}\n\n/**\n * @param {Pbf} pbf\n */\nfunction readValueMessage(pbf) {\n    let value = null;\n    const end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        const tag = pbf.readVarint() >> 3;\n\n        value = tag === 1 ? pbf.readString() :\n            tag === 2 ? pbf.readFloat() :\n            tag === 3 ? pbf.readDouble() :\n            tag === 4 ? pbf.readVarint64() :\n            tag === 5 ? pbf.readVarint() :\n            tag === 6 ? pbf.readSVarint() :\n            tag === 7 ? pbf.readBoolean() : null;\n    }\n    if (value == null) {\n        throw new Error('unknown feature value');\n    }\n\n    return value;\n}\n\nexport class VectorTile {\n    /**\n     * @param {Pbf} pbf\n     * @param {number} [end]\n     */\n    constructor(pbf, end) {\n        /** @type {Record<string, VectorTileLayer>} */\n        this.layers = pbf.readFields(readTile, {}, end);\n    }\n}\n\n/**\n * @param {number} tag\n * @param {Record<string, VectorTileLayer>} layers\n * @param {Pbf} pbf\n */\nfunction readTile(tag, layers, pbf) {\n    if (tag === 3) {\n        const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);\n        if (layer.length) layers[layer.name] = layer;\n    }\n}\n","import Point from '@mapbox/point-geometry';\nimport type {TileFeature, AnyProps} from 'supercluster';\nimport type {GeoJSONVTFeature} from '@maplibre/geojson-vt';\nimport type {\n    VectorTileFeatureLike,\n    VectorTileLayerLike,\n    VectorTileLike,\n} from \"./types\";\n\nexport { VectorTileFeatureLike, VectorTileLayerLike, VectorTileLike };\n\nexport type Feature = TileFeature<AnyProps, AnyProps> | GeoJSONVTFeature;\n\nexport interface GeoJSONOptions {\n    version: number;\n    extent: number;\n}\n\nclass FeatureWrapper implements VectorTileFeatureLike {\n    feature: Feature;\n    type: VectorTileFeatureLike['type'];\n    properties: VectorTileFeatureLike['properties'];\n    id: VectorTileFeatureLike['id'];\n    extent: VectorTileFeatureLike['extent'];\n\n    constructor(feature: Feature, extent: number) {\n        this.feature = feature;\n        this.type = feature.type;\n        this.properties = feature.tags ? feature.tags : {};\n        this.extent = extent;\n\n        // If the feature has a top-level `id` property, copy it over, but only\n        // if it can be coerced to an integer, because this wrapper is used for\n        // serializing geojson feature data into vector tile PBF data, and the\n        // vector tile spec only supports integer values for feature ids --\n        // allowing non-integer values here results in a non-compliant PBF\n        // that causes an exception when it is parsed with vector-tile-js\n        if ('id' in feature) {\n            if (typeof feature.id === 'string') {\n                this.id = parseInt(feature.id, 10);\n            } else if (typeof feature.id === 'number' && !isNaN(feature.id)) {\n                this.id = feature.id;\n            }\n        }\n    }\n\n    loadGeometry() {\n        const geometry = [];\n        const rawGeo = this.feature.type === 1 ? [this.feature.geometry] : this.feature.geometry;\n        for (const ring of rawGeo) {\n            const newRing = [];\n            for (const point of ring) {\n                newRing.push(new Point(point[0], point[1]));\n            }\n            geometry.push(newRing);\n        }\n        return geometry;\n    }\n}\n\nexport const GEOJSON_TILE_LAYER_NAME = \"_geojsonTileLayer\";\n\nexport class GeoJSONWrapper implements VectorTileLayerLike {\n    layers: Record<string, VectorTileLayerLike>;\n    features: Feature[];\n    version: VectorTileLayerLike['version'];\n    name: VectorTileLayerLike['name'];\n    extent: VectorTileLayerLike['extent'];\n    length: VectorTileLayerLike['length'];\n\n    constructor(features: Feature[], options?: GeoJSONOptions) {\n        this.layers = { [GEOJSON_TILE_LAYER_NAME]: this };\n        this.name = GEOJSON_TILE_LAYER_NAME;\n        this.version = options ? options.version : 1;\n        this.extent = options ? options.extent : 4096;\n        this.length = features.length;\n        this.features = features;\n    }\n\n    feature(i: number): VectorTileFeatureLike {\n        return new FeatureWrapper(this.features[i], this.extent);\n    }\n}\n","import Pbf from 'pbf';\nimport {type Feature, GEOJSON_TILE_LAYER_NAME, type GeoJSONOptions, GeoJSONWrapper} from \"./lib/geojson_wrapper\";\nimport type {GeoJSONVTTile} from '@maplibre/geojson-vt';\nimport type {VectorTileFeatureLike, VectorTileLike, VectorTileLayerLike} from './lib/types';\n\ninterface Context {\n    keys: string[];\n    values: (string | boolean | number)[];\n    keycache: Record<string, number>;\n    valuecache: Record<string, number>;\n    feature?: VectorTileFeatureLike;\n}\n\n/**\n * Serialize a vector-tile-js-created tile to pbf\n *\n * @param tile\n * @return uncompressed, pbf-serialized tile data\n */\nexport function fromVectorTileJs(tile: VectorTileLike): Uint8Array {\n    const out = new Pbf();\n    writeTile(tile, out);\n    return out.finish();\n}\n\n/**\n * Serialized a geojson-vt-created tile to pbf.\n *\n * @param layers - An object mapping layer names to geojson-vt-created vector tile objects\n * @param options - An object specifying the vector-tile specification version and extent that were used to create `layers`.\n * @return uncompressed, pbf-serialized tile data\n */\nexport function fromGeojsonVt(layers: Record<string, GeoJSONVTTile>, options?: GeoJSONOptions): Uint8Array {\n    const l: Record<string, VectorTileLayerLike> = {};\n    // eslint-disable-next-line @typescript-eslint/no-for-in-array\n    for (const k in layers) {\n        l[k] = new GeoJSONWrapper(layers[k].features, options);\n        l[k].name = k;\n        l[k].version = options ? options.version : 1;\n        l[k].extent = options ? options.extent : 4096;\n    }\n    return fromVectorTileJs({ layers: l });\n}\n\nfunction writeTile(tile: VectorTileLike, pbf: Pbf) {\n    for (const key in tile.layers) {\n        pbf.writeMessage(3, writeLayer, tile.layers[key]);\n    }\n}\n\nfunction writeLayer(layer: VectorTileLayerLike, pbf: Pbf) {\n    pbf.writeVarintField(15, layer.version || 1);\n    pbf.writeStringField(1, layer.name || '');\n    pbf.writeVarintField(5, layer.extent || 4096);\n\n    const context: Context = {\n        keys: [],\n        values: [],\n        keycache: {},\n        valuecache: {}\n    }\n\n    for (let i = 0; i < layer.length; i++) {\n        context.feature = layer.feature(i);\n        pbf.writeMessage(2, writeFeature, context);\n    }\n\n    const keys = context.keys;\n    for (const key of keys) {\n        pbf.writeStringField(3, key);\n    }\n\n    const values = context.values;\n    for (const value of values) {\n        pbf.writeMessage(4, writeValue, value);\n    }\n}\n\nfunction writeFeature(context: Context, pbf: Pbf) {\n    if (!context.feature) {\n        return;\n    }\n\n    const feature = context.feature;\n\n    if (feature.id !== undefined) {\n        pbf.writeVarintField(1, feature.id);\n    }\n\n    pbf.writeMessage(2, writeProperties, context);\n    pbf.writeVarintField(3, feature.type);\n    pbf.writeMessage(4, writeGeometry, feature);\n}\n\nfunction writeProperties(context: Context, pbf: Pbf) {\n    for (const key in context.feature?.properties) {\n        let value = context.feature.properties[key];\n\n        let keyIndex = context.keycache[key];\n        if (value == null) continue // don't encode null/undefined value properties\n\n        if (typeof keyIndex === 'undefined') {\n            context.keys.push(key);\n            keyIndex = context.keys.length - 1;\n            context.keycache[key] = keyIndex;\n        }\n        pbf.writeVarint(keyIndex);\n\n        if (typeof value !== 'string' && typeof value !== 'boolean' && typeof value !== 'number') {\n            value = JSON.stringify(value);\n        }\n        const valueKey = typeof value + ':' + value;\n        let valueIndex = context.valuecache[valueKey];\n        if (typeof valueIndex === 'undefined') {\n            context.values.push(value);\n            valueIndex = context.values.length - 1;\n            context.valuecache[valueKey] = valueIndex;\n        }\n        pbf.writeVarint(valueIndex);\n    }\n}\n\nfunction command(cmd: number, length: number) {\n    return (length << 3) + (cmd & 0x7);\n}\n\nfunction zigzag(num: number) {\n    return (num << 1) ^ (num >> 31);\n}\n\nfunction writeGeometry(feature: VectorTileFeatureLike, pbf: Pbf) {\n    const geometry = feature.loadGeometry();\n    const type = feature.type;\n    let x = 0;\n    let y = 0;\n\n    for (const ring of geometry) {\n        let count = 1;\n        if (type === 1) {\n            count = ring.length;\n        }\n        pbf.writeVarint(command(1, count)); // moveto\n        // do not write polygon closing path as lineto\n        const lineCount = type === 3 ? ring.length - 1 : ring.length;\n        for (let i = 0; i < lineCount; i++) {\n            if (i === 1 && type !== 1) {\n                pbf.writeVarint(command(2, lineCount - 1)); // lineto\n            }\n            const dx = ring[i].x - x;\n            const dy = ring[i].y - y;\n            pbf.writeVarint(zigzag(dx));\n            pbf.writeVarint(zigzag(dy));\n            x += dx;\n            y += dy;\n        }\n        if (feature.type === 3) {\n            pbf.writeVarint(command(7, 1)); // closepath\n        }\n    }\n}\n\nfunction writeValue(value: string | boolean | number, pbf: Pbf) {\n    const type = typeof value;\n    if (type === 'string') {\n        pbf.writeStringField(1, value as string);\n    } else if (type === 'boolean') {\n        pbf.writeBooleanField(7, value as boolean);\n    } else if (type === 'number') {\n        if (value as number % 1 !== 0) {\n            pbf.writeDoubleField(3, value as number);\n        } else if (value as number < 0) {\n            pbf.writeSVarintField(6, value as number);\n        } else {\n            pbf.writeVarintField(5, value as number);\n        }\n    }\n}\n\nexport {\n    GeoJSONWrapper,\n    GeoJSONOptions,\n    Feature,\n    GEOJSON_TILE_LAYER_NAME,\n    VectorTileFeatureLike,\n    VectorTileLike,\n    VectorTileLayerLike,\n};\n","\nimport createFeature from './feature.js';\n\n/* clip features between two vertical or horizontal axis-parallel lines:\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *\n * k1 and k2 are the line coordinates\n * axis: 0 for x, 1 for y\n * minAll and maxAll: minimum and maximum coordinate value for all features\n */\nexport default function clip(features, scale, k1, k2, axis, minAll, maxAll, options) {\n    k1 /= scale;\n    k2 /= scale;\n\n    if (minAll >= k1 && maxAll < k2) return features; // trivial accept\n    else if (maxAll < k1 || minAll >= k2) return null; // trivial reject\n\n    const clipped = [];\n\n    for (const feature of features) {\n        const geometry = feature.geometry;\n        let type = feature.type;\n\n        const min = axis === 0 ? feature.minX : feature.minY;\n        const max = axis === 0 ? feature.maxX : feature.maxY;\n\n        if (min >= k1 && max < k2) { // trivial accept\n            clipped.push(feature);\n            continue;\n        } else if (max < k1 || min >= k2) { // trivial reject\n            continue;\n        }\n\n        let newGeometry = [];\n\n        if (type === 'Point' || type === 'MultiPoint') {\n            clipPoints(geometry, newGeometry, k1, k2, axis);\n\n        } else if (type === 'LineString') {\n            clipLine(geometry, newGeometry, k1, k2, axis, false, options.lineMetrics);\n\n        } else if (type === 'MultiLineString') {\n            clipLines(geometry, newGeometry, k1, k2, axis, false);\n\n        } else if (type === 'Polygon') {\n            clipLines(geometry, newGeometry, k1, k2, axis, true);\n\n        } else if (type === 'MultiPolygon') {\n            for (const polygon of geometry) {\n                const newPolygon = [];\n                clipLines(polygon, newPolygon, k1, k2, axis, true);\n                if (newPolygon.length) {\n                    newGeometry.push(newPolygon);\n                }\n            }\n        }\n\n        if (newGeometry.length) {\n            if (options.lineMetrics && type === 'LineString') {\n                for (const line of newGeometry) {\n                    clipped.push(createFeature(feature.id, type, line, feature.tags));\n                }\n                continue;\n            }\n\n            if (type === 'LineString' || type === 'MultiLineString') {\n                if (newGeometry.length === 1) {\n                    type = 'LineString';\n                    newGeometry = newGeometry[0];\n                } else {\n                    type = 'MultiLineString';\n                }\n            }\n            if (type === 'Point' || type === 'MultiPoint') {\n                type = newGeometry.length === 3 ? 'Point' : 'MultiPoint';\n            }\n\n            clipped.push(createFeature(feature.id, type, newGeometry, feature.tags));\n        }\n    }\n\n    return clipped.length ? clipped : null;\n}\n\nfunction clipPoints(geom, newGeom, k1, k2, axis) {\n    for (let i = 0; i < geom.length; i += 3) {\n        const a = geom[i + axis];\n\n        if (a >= k1 && a <= k2) {\n            addPoint(newGeom, geom[i], geom[i + 1], geom[i + 2]);\n        }\n    }\n}\n\nfunction clipLine(geom, newGeom, k1, k2, axis, isPolygon, trackMetrics) {\n\n    let slice = newSlice(geom);\n    const intersect = axis === 0 ? intersectX : intersectY;\n    let len = geom.start;\n    let segLen, t;\n\n    for (let i = 0; i < geom.length - 3; i += 3) {\n        const ax = geom[i];\n        const ay = geom[i + 1];\n        const az = geom[i + 2];\n        const bx = geom[i + 3];\n        const by = geom[i + 4];\n        const a = axis === 0 ? ax : ay;\n        const b = axis === 0 ? bx : by;\n        let exited = false;\n\n        if (trackMetrics) segLen = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));\n\n        if (a < k1) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (b > k1) {\n                t = intersect(slice, ax, ay, bx, by, k1);\n                if (trackMetrics) slice.start = len + segLen * t;\n            }\n        } else if (a > k2) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (b < k2) {\n                t = intersect(slice, ax, ay, bx, by, k2);\n                if (trackMetrics) slice.start = len + segLen * t;\n            }\n        } else {\n            addPoint(slice, ax, ay, az);\n        }\n        if (b < k1 && a >= k1) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            t = intersect(slice, ax, ay, bx, by, k1);\n            exited = true;\n        }\n        if (b > k2 && a <= k2) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            t = intersect(slice, ax, ay, bx, by, k2);\n            exited = true;\n        }\n\n        if (!isPolygon && exited) {\n            if (trackMetrics) slice.end = len + segLen * t;\n            newGeom.push(slice);\n            slice = newSlice(geom);\n        }\n\n        if (trackMetrics) len += segLen;\n    }\n\n    // add the last point\n    let last = geom.length - 3;\n    const ax = geom[last];\n    const ay = geom[last + 1];\n    const az = geom[last + 2];\n    const a = axis === 0 ? ax : ay;\n    if (a >= k1 && a <= k2) addPoint(slice, ax, ay, az);\n\n    // close the polygon if its endpoints are not the same after clipping\n    last = slice.length - 3;\n    if (isPolygon && last >= 3 && (slice[last] !== slice[0] || slice[last + 1] !== slice[1])) {\n        addPoint(slice, slice[0], slice[1], slice[2]);\n    }\n\n    // add the final slice\n    if (slice.length) {\n        newGeom.push(slice);\n    }\n}\n\nfunction newSlice(line) {\n    const slice = [];\n    slice.size = line.size;\n    slice.start = line.start;\n    slice.end = line.end;\n    return slice;\n}\n\nfunction clipLines(geom, newGeom, k1, k2, axis, isPolygon) {\n    for (const line of geom) {\n        clipLine(line, newGeom, k1, k2, axis, isPolygon, false);\n    }\n}\n\nfunction addPoint(out, x, y, z) {\n    out.push(x, y, z);\n}\n\nfunction intersectX(out, ax, ay, bx, by, x) {\n    const t = (x - ax) / (bx - ax);\n    addPoint(out, x, ay + (by - ay) * t, 1);\n    return t;\n}\n\nfunction intersectY(out, ax, ay, bx, by, y) {\n    const t = (y - ay) / (by - ay);\n    addPoint(out, ax + (bx - ax) * t, y, 1);\n    return t;\n}\n","\nimport simplify from './simplify.js';\nimport createFeature from './feature.js';\n\n// converts GeoJSON feature into an intermediate projected JSON vector format with simplification data\n\nexport default function convert(data, options) {\n    const features = [];\n    if (data.type === 'FeatureCollection') {\n        for (let i = 0; i < data.features.length; i++) {\n            convertFeature(features, data.features[i], options, i);\n        }\n\n    } else if (data.type === 'Feature') {\n        convertFeature(features, data, options);\n\n    } else {\n        // single geometry or a geometry collection\n        convertFeature(features, {geometry: data}, options);\n    }\n\n    return features;\n}\n\nfunction convertFeature(features, geojson, options, index) {\n    if (!geojson.geometry) return;\n\n    const coords = geojson.geometry.coordinates;\n    if (coords && coords.length === 0) return;\n\n    const type = geojson.geometry.type;\n    const tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);\n    let geometry = [];\n    let id = geojson.id;\n    if (options.promoteId) {\n        id = geojson.properties[options.promoteId];\n    } else if (options.generateId) {\n        id = index || 0;\n    }\n    if (type === 'Point') {\n        convertPoint(coords, geometry);\n\n    } else if (type === 'MultiPoint') {\n        for (const p of coords) {\n            convertPoint(p, geometry);\n        }\n\n    } else if (type === 'LineString') {\n        convertLine(coords, geometry, tolerance, false);\n\n    } else if (type === 'MultiLineString') {\n        if (options.lineMetrics) {\n            // explode into linestrings to be able to track metrics\n            for (const line of coords) {\n                geometry = [];\n                convertLine(line, geometry, tolerance, false);\n                features.push(createFeature(id, 'LineString', geometry, geojson.properties));\n            }\n            return;\n        } else {\n            convertLines(coords, geometry, tolerance, false);\n        }\n\n    } else if (type === 'Polygon') {\n        convertLines(coords, geometry, tolerance, true);\n\n    } else if (type === 'MultiPolygon') {\n        for (const polygon of coords) {\n            const newPolygon = [];\n            convertLines(polygon, newPolygon, tolerance, true);\n            geometry.push(newPolygon);\n        }\n    } else if (type === 'GeometryCollection') {\n        for (const singleGeometry of geojson.geometry.geometries) {\n            convertFeature(features, {\n                id,\n                geometry: singleGeometry,\n                properties: geojson.properties\n            }, options, index);\n        }\n        return;\n    } else {\n        throw new Error('Input data is not a valid GeoJSON object.');\n    }\n\n    features.push(createFeature(id, type, geometry, geojson.properties));\n}\n\nfunction convertPoint(coords, out) {\n    out.push(projectX(coords[0]), projectY(coords[1]), 0);\n}\n\nfunction convertLine(ring, out, tolerance, isPolygon) {\n    let x0, y0;\n    let size = 0;\n\n    for (let j = 0; j < ring.length; j++) {\n        const x = projectX(ring[j][0]);\n        const y = projectY(ring[j][1]);\n\n        out.push(x, y, 0);\n\n        if (j > 0) {\n            if (isPolygon) {\n                size += (x0 * y - x * y0) / 2; // area\n            } else {\n                size += Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2)); // length\n            }\n        }\n        x0 = x;\n        y0 = y;\n    }\n\n    const last = out.length - 3;\n    out[2] = 1;\n    simplify(out, 0, last, tolerance);\n    out[last + 2] = 1;\n\n    out.size = Math.abs(size);\n    out.start = 0;\n    out.end = out.size;\n}\n\nfunction convertLines(rings, out, tolerance, isPolygon) {\n    for (let i = 0; i < rings.length; i++) {\n        const geom = [];\n        convertLine(rings[i], geom, tolerance, isPolygon);\n        out.push(geom);\n    }\n}\n\nfunction projectX(x) {\n    return x / 360 + 0.5;\n}\n\nfunction projectY(y) {\n    const sin = Math.sin(y * Math.PI / 180);\n    const y2 = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n    return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;\n}\n","\nexport default function createFeature(id, type, geom, tags) {\n    const feature = {\n        id: id == null ? null : id,\n        type,\n        geometry: geom,\n        tags,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n\n    if (type === 'Point' || type === 'MultiPoint' || type === 'LineString') {\n        calcLineBBox(feature, geom);\n\n    } else if (type === 'Polygon') {\n        // the outer ring (ie [0]) contains all inner rings\n        calcLineBBox(feature, geom[0]);\n\n    } else if (type === 'MultiLineString') {\n        for (const line of geom) {\n            calcLineBBox(feature, line);\n        }\n\n    } else if (type === 'MultiPolygon') {\n        for (const polygon of geom) {\n            // the outer ring (ie [0]) contains all inner rings\n            calcLineBBox(feature, polygon[0]);\n        }\n    }\n\n    return feature;\n}\n\nfunction calcLineBBox(feature, geom) {\n    for (let i = 0; i < geom.length; i += 3) {\n        feature.minX = Math.min(feature.minX, geom[i]);\n        feature.minY = Math.min(feature.minY, geom[i + 1]);\n        feature.maxX = Math.max(feature.maxX, geom[i]);\n        feature.maxY = Math.max(feature.maxY, geom[i + 1]);\n    }\n}\n","\nimport convert from './convert.js';     // GeoJSON conversion and preprocessing\nimport clip from './clip.js';           // stripe clipping algorithm\nimport wrap from './wrap.js';           // date line processing\nimport transform from './transform.js'; // coordinate transformation\nimport createTile from './tile.js';     // final simplified tile generation\n\nconst defaultOptions = {\n    maxZoom: 14,            // max zoom to preserve detail on\n    indexMaxZoom: 5,        // max zoom in the tile index\n    indexMaxPoints: 100000, // max number of points per tile in the tile index\n    tolerance: 3,           // simplification tolerance (higher means simpler)\n    extent: 4096,           // tile extent\n    buffer: 64,             // tile buffer on each side\n    lineMetrics: false,     // whether to calculate line metrics\n    promoteId: null,        // name of a feature property to be promoted to feature.id\n    generateId: false,      // whether to generate feature ids. Cannot be used with promoteId\n    debug: 0                // logging level (0, 1 or 2)\n};\n\nclass GeoJSONVT {\n    constructor(data, options) {\n        options = this.options = extend(Object.create(defaultOptions), options);\n\n        const debug = options.debug;\n\n        if (debug) console.time('preprocess data');\n\n        if (options.maxZoom < 0 || options.maxZoom > 24) throw new Error('maxZoom should be in the 0-24 range');\n        if (options.promoteId && options.generateId) throw new Error('promoteId and generateId cannot be used together.');\n\n        // projects and adds simplification info\n        let features = convert(data, options);\n\n        // tiles and tileCoords are part of the public API\n        this.tiles = {};\n        this.tileCoords = [];\n\n        if (debug) {\n            console.timeEnd('preprocess data');\n            console.log('index: maxZoom: %d, maxPoints: %d', options.indexMaxZoom, options.indexMaxPoints);\n            console.time('generate tiles');\n            this.stats = {};\n            this.total = 0;\n        }\n\n        // wraps features (ie extreme west and extreme east)\n        features = wrap(features, options);\n\n        // start slicing from the top tile down\n        if (features.length) this.splitTile(features, 0, 0, 0);\n\n        if (debug) {\n            if (features.length) console.log('features: %d, points: %d', this.tiles[0].numFeatures, this.tiles[0].numPoints);\n            console.timeEnd('generate tiles');\n            console.log('tiles generated:', this.total, JSON.stringify(this.stats));\n        }\n    }\n\n    // splits features from a parent tile to sub-tiles.\n    // z, x, and y are the coordinates of the parent tile\n    // cz, cx, and cy are the coordinates of the target tile\n    //\n    // If no target tile is specified, splitting stops when we reach the maximum\n    // zoom or the number of points is low as specified in the options.\n    splitTile(features, z, x, y, cz, cx, cy) {\n\n        const stack = [features, z, x, y];\n        const options = this.options;\n        const debug = options.debug;\n\n        // avoid recursion by using a processing queue\n        while (stack.length) {\n            y = stack.pop();\n            x = stack.pop();\n            z = stack.pop();\n            features = stack.pop();\n\n            const z2 = 1 << z;\n            const id = toID(z, x, y);\n            let tile = this.tiles[id];\n\n            if (!tile) {\n                if (debug > 1) console.time('creation');\n\n                tile = this.tiles[id] = createTile(features, z, x, y, options);\n                this.tileCoords.push({z, x, y});\n\n                if (debug) {\n                    if (debug > 1) {\n                        console.log('tile z%d-%d-%d (features: %d, points: %d, simplified: %d)',\n                            z, x, y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n                        console.timeEnd('creation');\n                    }\n                    const key = `z${  z}`;\n                    this.stats[key] = (this.stats[key] || 0) + 1;\n                    this.total++;\n                }\n            }\n\n            // save reference to original geometry in tile so that we can drill down later if we stop now\n            tile.source = features;\n\n            // if it's the first-pass tiling\n            if (cz == null) {\n                // stop tiling if we reached max zoom, or if the tile is too simple\n                if (z === options.indexMaxZoom || tile.numPoints <= options.indexMaxPoints) continue;\n            // if a drilldown to a specific tile\n            } else if (z === options.maxZoom || z === cz) {\n                // stop tiling if we reached base zoom or our target tile zoom\n                continue;\n            } else if (cz != null) {\n                // stop tiling if it's not an ancestor of the target tile\n                const zoomSteps = cz - z;\n                if (x !== cx >> zoomSteps || y !== cy >> zoomSteps) continue;\n            }\n\n            // if we slice further down, no need to keep source geometry\n            tile.source = null;\n\n            if (features.length === 0) continue;\n\n            if (debug > 1) console.time('clipping');\n\n            // values we'll use for clipping\n            const k1 = 0.5 * options.buffer / options.extent;\n            const k2 = 0.5 - k1;\n            const k3 = 0.5 + k1;\n            const k4 = 1 + k1;\n\n            let tl = null;\n            let bl = null;\n            let tr = null;\n            let br = null;\n\n            let left  = clip(features, z2, x - k1, x + k3, 0, tile.minX, tile.maxX, options);\n            let right = clip(features, z2, x + k2, x + k4, 0, tile.minX, tile.maxX, options);\n            features = null;\n\n            if (left) {\n                tl = clip(left, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                bl = clip(left, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n                left = null;\n            }\n\n            if (right) {\n                tr = clip(right, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                br = clip(right, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n                right = null;\n            }\n\n            if (debug > 1) console.timeEnd('clipping');\n\n            stack.push(tl || [], z + 1, x * 2,     y * 2);\n            stack.push(bl || [], z + 1, x * 2,     y * 2 + 1);\n            stack.push(tr || [], z + 1, x * 2 + 1, y * 2);\n            stack.push(br || [], z + 1, x * 2 + 1, y * 2 + 1);\n        }\n    }\n\n    getTile(z, x, y) {\n        z = +z;\n        x = +x;\n        y = +y;\n\n        const options = this.options;\n        const {extent, debug} = options;\n\n        if (z < 0 || z > 24) return null;\n\n        const z2 = 1 << z;\n        x = (x + z2) & (z2 - 1); // wrap tile x coordinate\n\n        const id = toID(z, x, y);\n        if (this.tiles[id]) return transform(this.tiles[id], extent);\n\n        if (debug > 1) console.log('drilling down to z%d-%d-%d', z, x, y);\n\n        let z0 = z;\n        let x0 = x;\n        let y0 = y;\n        let parent;\n\n        while (!parent && z0 > 0) {\n            z0--;\n            x0 = x0 >> 1;\n            y0 = y0 >> 1;\n            parent = this.tiles[toID(z0, x0, y0)];\n        }\n\n        if (!parent || !parent.source) return null;\n\n        // if we found a parent tile containing the original geometry, we can drill down from it\n        if (debug > 1) {\n            console.log('found parent tile z%d-%d-%d', z0, x0, y0);\n            console.time('drilling down');\n        }\n        this.splitTile(parent.source, z0, x0, y0, z, x, y);\n        if (debug > 1) console.timeEnd('drilling down');\n\n        return this.tiles[id] ? transform(this.tiles[id], extent) : null;\n    }\n}\n\nfunction toID(z, x, y) {\n    return (((1 << z) * y + x) * 32) + z;\n}\n\nfunction extend(dest, src) {\n    for (const i in src) dest[i] = src[i];\n    return dest;\n}\n\nexport default function geojsonvt(data, options) {\n    return new GeoJSONVT(data, options);\n}\n","\n// calculate simplification data using optimized Douglas-Peucker algorithm\n\nexport default function simplify(coords, first, last, sqTolerance) {\n    let maxSqDist = sqTolerance;\n    const mid = first + ((last - first) >> 1);\n    let minPosToMid = last - first;\n    let index;\n\n    const ax = coords[first];\n    const ay = coords[first + 1];\n    const bx = coords[last];\n    const by = coords[last + 1];\n\n    for (let i = first + 3; i < last; i += 3) {\n        const d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);\n\n        if (d > maxSqDist) {\n            index = i;\n            maxSqDist = d;\n\n        } else if (d === maxSqDist) {\n            // a workaround to ensure we choose a pivot close to the middle of the list,\n            // reducing recursion depth, for certain degenerate inputs\n            // https://github.com/mapbox/geojson-vt/issues/104\n            const posToMid = Math.abs(i - mid);\n            if (posToMid < minPosToMid) {\n                index = i;\n                minPosToMid = posToMid;\n            }\n        }\n    }\n\n    if (maxSqDist > sqTolerance) {\n        if (index - first > 3) simplify(coords, first, index, sqTolerance);\n        coords[index + 2] = maxSqDist;\n        if (last - index > 3) simplify(coords, index, last, sqTolerance);\n    }\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(px, py, x, y, bx, by) {\n\n    let dx = bx - x;\n    let dy = by - y;\n\n    if (dx !== 0 || dy !== 0) {\n\n        const t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\n        if (t > 1) {\n            x = bx;\n            y = by;\n\n        } else if (t > 0) {\n            x += dx * t;\n            y += dy * t;\n        }\n    }\n\n    dx = px - x;\n    dy = py - y;\n\n    return dx * dx + dy * dy;\n}\n","\nexport default function createTile(features, z, tx, ty, options) {\n    const tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);\n    const tile = {\n        features: [],\n        numPoints: 0,\n        numSimplified: 0,\n        numFeatures: features.length,\n        source: null,\n        x: tx,\n        y: ty,\n        z,\n        transformed: false,\n        minX: 2,\n        minY: 1,\n        maxX: -1,\n        maxY: 0\n    };\n    for (const feature of features) {\n        addFeature(tile, feature, tolerance, options);\n    }\n    return tile;\n}\n\nfunction addFeature(tile, feature, tolerance, options) {\n    const geom = feature.geometry;\n    const type = feature.type;\n    const simplified = [];\n\n    tile.minX = Math.min(tile.minX, feature.minX);\n    tile.minY = Math.min(tile.minY, feature.minY);\n    tile.maxX = Math.max(tile.maxX, feature.maxX);\n    tile.maxY = Math.max(tile.maxY, feature.maxY);\n\n    if (type === 'Point' || type === 'MultiPoint') {\n        for (let i = 0; i < geom.length; i += 3) {\n            simplified.push(geom[i], geom[i + 1]);\n            tile.numPoints++;\n            tile.numSimplified++;\n        }\n\n    } else if (type === 'LineString') {\n        addLine(simplified, geom, tile, tolerance, false, false);\n\n    } else if (type === 'MultiLineString' || type === 'Polygon') {\n        for (let i = 0; i < geom.length; i++) {\n            addLine(simplified, geom[i], tile, tolerance, type === 'Polygon', i === 0);\n        }\n\n    } else if (type === 'MultiPolygon') {\n\n        for (let k = 0; k < geom.length; k++) {\n            const polygon = geom[k];\n            for (let i = 0; i < polygon.length; i++) {\n                addLine(simplified, polygon[i], tile, tolerance, true, i === 0);\n            }\n        }\n    }\n\n    if (simplified.length) {\n        let tags = feature.tags || null;\n\n        if (type === 'LineString' && options.lineMetrics) {\n            tags = {};\n            for (const key in feature.tags) tags[key] = feature.tags[key];\n            tags['mapbox_clip_start'] = geom.start / geom.size;\n            tags['mapbox_clip_end'] = geom.end / geom.size;\n        }\n\n        const tileFeature = {\n            geometry: simplified,\n            type: type === 'Polygon' || type === 'MultiPolygon' ? 3 :\n            (type === 'LineString' || type === 'MultiLineString' ? 2 : 1),\n            tags\n        };\n        if (feature.id !== null) {\n            tileFeature.id = feature.id;\n        }\n        tile.features.push(tileFeature);\n    }\n}\n\nfunction addLine(result, geom, tile, tolerance, isPolygon, isOuter) {\n    const sqTolerance = tolerance * tolerance;\n\n    if (tolerance > 0 && (geom.size < (isPolygon ? sqTolerance : tolerance))) {\n        tile.numPoints += geom.length / 3;\n        return;\n    }\n\n    const ring = [];\n\n    for (let i = 0; i < geom.length; i += 3) {\n        if (tolerance === 0 || geom[i + 2] > sqTolerance) {\n            tile.numSimplified++;\n            ring.push(geom[i], geom[i + 1]);\n        }\n        tile.numPoints++;\n    }\n\n    if (isPolygon) rewind(ring, isOuter);\n\n    result.push(ring);\n}\n\nfunction rewind(ring, clockwise) {\n    let area = 0;\n    for (let i = 0, len = ring.length, j = len - 2; i < len; j = i, i += 2) {\n        area += (ring[i] - ring[j]) * (ring[i + 1] + ring[j + 1]);\n    }\n    if (area > 0 === clockwise) {\n        for (let i = 0, len = ring.length; i < len / 2; i += 2) {\n            const x = ring[i];\n            const y = ring[i + 1];\n            ring[i] = ring[len - 2 - i];\n            ring[i + 1] = ring[len - 1 - i];\n            ring[len - 2 - i] = x;\n            ring[len - 1 - i] = y;\n        }\n    }\n}\n","\n// Transforms the coordinates of each feature in the given tile from\n// mercator-projected space into (extent x extent) tile space.\nexport default function transformTile(tile, extent) {\n    if (tile.transformed) return tile;\n\n    const z2 = 1 << tile.z;\n    const tx = tile.x;\n    const ty = tile.y;\n\n    for (const feature of tile.features) {\n        const geom = feature.geometry;\n        const type = feature.type;\n\n        feature.geometry = [];\n\n        if (type === 1) {\n            for (let j = 0; j < geom.length; j += 2) {\n                feature.geometry.push(transformPoint(geom[j], geom[j + 1], extent, z2, tx, ty));\n            }\n        } else {\n            for (let j = 0; j < geom.length; j++) {\n                const ring = [];\n                for (let k = 0; k < geom[j].length; k += 2) {\n                    ring.push(transformPoint(geom[j][k], geom[j][k + 1], extent, z2, tx, ty));\n                }\n                feature.geometry.push(ring);\n            }\n        }\n    }\n\n    tile.transformed = true;\n\n    return tile;\n}\n\nfunction transformPoint(x, y, extent, z2, tx, ty) {\n    return [\n        Math.round(extent * (x * z2 - tx)),\n        Math.round(extent * (y * z2 - ty))];\n}\n","\nimport clip from './clip.js';\nimport createFeature from './feature.js';\n\nexport default function wrap(features, options) {\n    const buffer = options.buffer / options.extent;\n    let merged = features;\n    const left  = clip(features, 1, -1 - buffer, buffer,     0, -1, 2, options); // left world copy\n    const right = clip(features, 1,  1 - buffer, 2 + buffer, 0, -1, 2, options); // right world copy\n\n    if (left || right) {\n        merged = clip(features, 1, -buffer, 1 + buffer, 0, -1, 2, options) || []; // center world copy\n\n        if (left) merged = shiftFeatureCoords(left, 1).concat(merged); // merge left into center\n        if (right) merged = merged.concat(shiftFeatureCoords(right, -1)); // merge right into center\n    }\n\n    return merged;\n}\n\nfunction shiftFeatureCoords(features, offset) {\n    const newFeatures = [];\n\n    for (let i = 0; i < features.length; i++) {\n        const feature = features[i];\n        const type = feature.type;\n\n        let newGeometry;\n\n        if (type === 'Point' || type === 'MultiPoint' || type === 'LineString') {\n            newGeometry = shiftCoords(feature.geometry, offset);\n\n        } else if (type === 'MultiLineString' || type === 'Polygon') {\n            newGeometry = [];\n            for (const line of feature.geometry) {\n                newGeometry.push(shiftCoords(line, offset));\n            }\n        } else if (type === 'MultiPolygon') {\n            newGeometry = [];\n            for (const polygon of feature.geometry) {\n                const newPolygon = [];\n                for (const line of polygon) {\n                    newPolygon.push(shiftCoords(line, offset));\n                }\n                newGeometry.push(newPolygon);\n            }\n        }\n\n        newFeatures.push(createFeature(feature.id, type, newGeometry, feature.tags));\n    }\n\n    return newFeatures;\n}\n\nfunction shiftCoords(points, offset) {\n    const newPoints = [];\n    newPoints.size = points.size;\n\n    if (points.start !== undefined) {\n        newPoints.start = points.start;\n        newPoints.end = points.end;\n    }\n\n    for (let i = 0; i < points.length; i += 3) {\n        newPoints.push(points[i] + offset, points[i + 1], points[i + 2]);\n    }\n    return newPoints;\n}\n","/**\n* (c) Iconify\n*\n* For the full copyright and license information, please view the license.txt\n* files at https://github.com/iconify/iconify\n*\n* Licensed under MIT.\n*\n* @license MIT\n* @version 3.0.0\n*/\nconst defaultIconDimensions = Object.freeze(\n  {\n    left: 0,\n    top: 0,\n    width: 16,\n    height: 16\n  }\n);\nconst defaultIconTransformations = Object.freeze({\n  rotate: 0,\n  vFlip: false,\n  hFlip: false\n});\nconst defaultIconProps = Object.freeze({\n  ...defaultIconDimensions,\n  ...defaultIconTransformations\n});\nconst defaultExtendedIconProps = Object.freeze({\n  ...defaultIconProps,\n  body: \"\",\n  hidden: false\n});\n\nconst defaultIconSizeCustomisations = Object.freeze({\n  width: null,\n  height: null\n});\nconst defaultIconCustomisations = Object.freeze({\n  // Dimensions\n  ...defaultIconSizeCustomisations,\n  // Transformations\n  ...defaultIconTransformations\n});\n\nfunction rotateFromString(value, defaultValue = 0) {\n  const units = value.replace(/^-?[0-9.]*/, \"\");\n  function cleanup(value2) {\n    while (value2 < 0) {\n      value2 += 4;\n    }\n    return value2 % 4;\n  }\n  if (units === \"\") {\n    const num = parseInt(value);\n    return isNaN(num) ? 0 : cleanup(num);\n  } else if (units !== value) {\n    let split = 0;\n    switch (units) {\n      case \"%\":\n        split = 25;\n        break;\n      case \"deg\":\n        split = 90;\n    }\n    if (split) {\n      let num = parseFloat(value.slice(0, value.length - units.length));\n      if (isNaN(num)) {\n        return 0;\n      }\n      num = num / split;\n      return num % 1 === 0 ? cleanup(num) : 0;\n    }\n  }\n  return defaultValue;\n}\n\nconst separator = /[\\s,]+/;\nfunction flipFromString(custom, flip) {\n  flip.split(separator).forEach((str) => {\n    const value = str.trim();\n    switch (value) {\n      case \"horizontal\":\n        custom.hFlip = true;\n        break;\n      case \"vertical\":\n        custom.vFlip = true;\n        break;\n    }\n  });\n}\n\nconst defaultCustomisations = {\n    ...defaultIconCustomisations,\n    preserveAspectRatio: '',\n};\n/**\n * Get customisations\n */\nfunction getCustomisations(node) {\n    const customisations = {\n        ...defaultCustomisations,\n    };\n    const attr = (key, def) => node.getAttribute(key) || def;\n    // Dimensions\n    customisations.width = attr('width', null);\n    customisations.height = attr('height', null);\n    // Rotation\n    customisations.rotate = rotateFromString(attr('rotate', ''));\n    // Flip\n    flipFromString(customisations, attr('flip', ''));\n    // SVG attributes\n    customisations.preserveAspectRatio = attr('preserveAspectRatio', attr('preserveaspectratio', ''));\n    return customisations;\n}\n/**\n * Check if customisations have been updated\n */\nfunction haveCustomisationsChanged(value1, value2) {\n    for (const key in defaultCustomisations) {\n        if (value1[key] !== value2[key]) {\n            return true;\n        }\n    }\n    return false;\n}\n\nconst matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;\nconst stringToIcon = (value, validate, allowSimpleName, provider = \"\") => {\n  const colonSeparated = value.split(\":\");\n  if (value.slice(0, 1) === \"@\") {\n    if (colonSeparated.length < 2 || colonSeparated.length > 3) {\n      return null;\n    }\n    provider = colonSeparated.shift().slice(1);\n  }\n  if (colonSeparated.length > 3 || !colonSeparated.length) {\n    return null;\n  }\n  if (colonSeparated.length > 1) {\n    const name2 = colonSeparated.pop();\n    const prefix = colonSeparated.pop();\n    const result = {\n      // Allow provider without '@': \"provider:prefix:name\"\n      provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,\n      prefix,\n      name: name2\n    };\n    return validate && !validateIconName(result) ? null : result;\n  }\n  const name = colonSeparated[0];\n  const dashSeparated = name.split(\"-\");\n  if (dashSeparated.length > 1) {\n    const result = {\n      provider,\n      prefix: dashSeparated.shift(),\n      name: dashSeparated.join(\"-\")\n    };\n    return validate && !validateIconName(result) ? null : result;\n  }\n  if (allowSimpleName && provider === \"\") {\n    const result = {\n      provider,\n      prefix: \"\",\n      name\n    };\n    return validate && !validateIconName(result, allowSimpleName) ? null : result;\n  }\n  return null;\n};\nconst validateIconName = (icon, allowSimpleName) => {\n  if (!icon) {\n    return false;\n  }\n  return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled\n  // Check name: cannot be empty\n  ((allowSimpleName && icon.prefix === \"\" || !!icon.prefix) && !!icon.name);\n};\n\nfunction mergeIconTransformations(obj1, obj2) {\n  const result = {};\n  if (!obj1.hFlip !== !obj2.hFlip) {\n    result.hFlip = true;\n  }\n  if (!obj1.vFlip !== !obj2.vFlip) {\n    result.vFlip = true;\n  }\n  const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;\n  if (rotate) {\n    result.rotate = rotate;\n  }\n  return result;\n}\n\nfunction mergeIconData(parent, child) {\n  const result = mergeIconTransformations(parent, child);\n  for (const key in defaultExtendedIconProps) {\n    if (key in defaultIconTransformations) {\n      if (key in parent && !(key in result)) {\n        result[key] = defaultIconTransformations[key];\n      }\n    } else if (key in child) {\n      result[key] = child[key];\n    } else if (key in parent) {\n      result[key] = parent[key];\n    }\n  }\n  return result;\n}\n\nfunction getIconsTree(data, names) {\n  const icons = data.icons;\n  const aliases = data.aliases || /* @__PURE__ */ Object.create(null);\n  const resolved = /* @__PURE__ */ Object.create(null);\n  function resolve(name) {\n    if (icons[name]) {\n      return resolved[name] = [];\n    }\n    if (!(name in resolved)) {\n      resolved[name] = null;\n      const parent = aliases[name] && aliases[name].parent;\n      const value = parent && resolve(parent);\n      if (value) {\n        resolved[name] = [parent].concat(value);\n      }\n    }\n    return resolved[name];\n  }\n  (Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);\n  return resolved;\n}\n\nfunction internalGetIconData(data, name, tree) {\n  const icons = data.icons;\n  const aliases = data.aliases || /* @__PURE__ */ Object.create(null);\n  let currentProps = {};\n  function parse(name2) {\n    currentProps = mergeIconData(\n      icons[name2] || aliases[name2],\n      currentProps\n    );\n  }\n  parse(name);\n  tree.forEach(parse);\n  return mergeIconData(data, currentProps);\n}\n\nfunction parseIconSet(data, callback) {\n  const names = [];\n  if (typeof data !== \"object\" || typeof data.icons !== \"object\") {\n    return names;\n  }\n  if (data.not_found instanceof Array) {\n    data.not_found.forEach((name) => {\n      callback(name, null);\n      names.push(name);\n    });\n  }\n  const tree = getIconsTree(data);\n  for (const name in tree) {\n    const item = tree[name];\n    if (item) {\n      callback(name, internalGetIconData(data, name, item));\n      names.push(name);\n    }\n  }\n  return names;\n}\n\nconst optionalPropertyDefaults = {\n  provider: \"\",\n  aliases: {},\n  not_found: {},\n  ...defaultIconDimensions\n};\nfunction checkOptionalProps(item, defaults) {\n  for (const prop in defaults) {\n    if (prop in item && typeof item[prop] !== typeof defaults[prop]) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction quicklyValidateIconSet(obj) {\n  if (typeof obj !== \"object\" || obj === null) {\n    return null;\n  }\n  const data = obj;\n  if (typeof data.prefix !== \"string\" || !obj.icons || typeof obj.icons !== \"object\") {\n    return null;\n  }\n  if (!checkOptionalProps(obj, optionalPropertyDefaults)) {\n    return null;\n  }\n  const icons = data.icons;\n  for (const name in icons) {\n    const icon = icons[name];\n    if (\n      // Name cannot be empty\n      !name || // Must have body\n      typeof icon.body !== \"string\" || // Check other props\n      !checkOptionalProps(\n        icon,\n        defaultExtendedIconProps\n      )\n    ) {\n      return null;\n    }\n  }\n  const aliases = data.aliases || /* @__PURE__ */ Object.create(null);\n  for (const name in aliases) {\n    const icon = aliases[name];\n    const parent = icon.parent;\n    if (\n      // Name cannot be empty\n      !name || // Parent must be set and point to existing icon\n      typeof parent !== \"string\" || !icons[parent] && !aliases[parent] || // Check other props\n      !checkOptionalProps(\n        icon,\n        defaultExtendedIconProps\n      )\n    ) {\n      return null;\n    }\n  }\n  return data;\n}\n\nconst dataStorage = /* @__PURE__ */ Object.create(null);\nfunction newStorage(provider, prefix) {\n  return {\n    provider,\n    prefix,\n    icons: /* @__PURE__ */ Object.create(null),\n    missing: /* @__PURE__ */ new Set()\n  };\n}\nfunction getStorage(provider, prefix) {\n  const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));\n  return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));\n}\nfunction addIconSet(storage, data) {\n  if (!quicklyValidateIconSet(data)) {\n    return [];\n  }\n  return parseIconSet(data, (name, icon) => {\n    if (icon) {\n      storage.icons[name] = icon;\n    } else {\n      storage.missing.add(name);\n    }\n  });\n}\nfunction addIconToStorage(storage, name, icon) {\n  try {\n    if (typeof icon.body === \"string\") {\n      storage.icons[name] = { ...icon };\n      return true;\n    }\n  } catch (err) {\n  }\n  return false;\n}\nfunction listIcons$1(provider, prefix) {\n  let allIcons = [];\n  const providers = typeof provider === \"string\" ? [provider] : Object.keys(dataStorage);\n  providers.forEach((provider2) => {\n    const prefixes = typeof provider2 === \"string\" && typeof prefix === \"string\" ? [prefix] : Object.keys(dataStorage[provider2] || {});\n    prefixes.forEach((prefix2) => {\n      const storage = getStorage(provider2, prefix2);\n      allIcons = allIcons.concat(\n        Object.keys(storage.icons).map(\n          (name) => (provider2 !== \"\" ? \"@\" + provider2 + \":\" : \"\") + prefix2 + \":\" + name\n        )\n      );\n    });\n  });\n  return allIcons;\n}\n\nlet simpleNames = false;\nfunction allowSimpleNames(allow) {\n  if (typeof allow === \"boolean\") {\n    simpleNames = allow;\n  }\n  return simpleNames;\n}\nfunction getIconData(name) {\n  const icon = typeof name === \"string\" ? stringToIcon(name, true, simpleNames) : name;\n  if (icon) {\n    const storage = getStorage(icon.provider, icon.prefix);\n    const iconName = icon.name;\n    return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);\n  }\n}\nfunction addIcon$1(name, data) {\n  const icon = stringToIcon(name, true, simpleNames);\n  if (!icon) {\n    return false;\n  }\n  const storage = getStorage(icon.provider, icon.prefix);\n  if (data) {\n    return addIconToStorage(storage, icon.name, data);\n  } else {\n    storage.missing.add(icon.name);\n    return true;\n  }\n}\nfunction addCollection$1(data, provider) {\n  if (typeof data !== \"object\") {\n    return false;\n  }\n  if (typeof provider !== \"string\") {\n    provider = data.provider || \"\";\n  }\n  if (simpleNames && !provider && !data.prefix) {\n    let added = false;\n    if (quicklyValidateIconSet(data)) {\n      data.prefix = \"\";\n      parseIconSet(data, (name, icon) => {\n        if (addIcon$1(name, icon)) {\n          added = true;\n        }\n      });\n    }\n    return added;\n  }\n  const prefix = data.prefix;\n  if (!validateIconName({\n    prefix,\n    name: \"a\"\n  })) {\n    return false;\n  }\n  const storage = getStorage(provider, prefix);\n  return !!addIconSet(storage, data);\n}\nfunction iconLoaded$1(name) {\n  return !!getIconData(name);\n}\nfunction getIcon$1(name) {\n  const result = getIconData(name);\n  return result ? {\n    ...defaultIconProps,\n    ...result\n  } : result;\n}\n\nfunction sortIcons(icons) {\n  const result = {\n    loaded: [],\n    missing: [],\n    pending: []\n  };\n  const storage = /* @__PURE__ */ Object.create(null);\n  icons.sort((a, b) => {\n    if (a.provider !== b.provider) {\n      return a.provider.localeCompare(b.provider);\n    }\n    if (a.prefix !== b.prefix) {\n      return a.prefix.localeCompare(b.prefix);\n    }\n    return a.name.localeCompare(b.name);\n  });\n  let lastIcon = {\n    provider: \"\",\n    prefix: \"\",\n    name: \"\"\n  };\n  icons.forEach((icon) => {\n    if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {\n      return;\n    }\n    lastIcon = icon;\n    const provider = icon.provider;\n    const prefix = icon.prefix;\n    const name = icon.name;\n    const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));\n    const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));\n    let list;\n    if (name in localStorage.icons) {\n      list = result.loaded;\n    } else if (prefix === \"\" || localStorage.missing.has(name)) {\n      list = result.missing;\n    } else {\n      list = result.pending;\n    }\n    const item = {\n      provider,\n      prefix,\n      name\n    };\n    list.push(item);\n  });\n  return result;\n}\n\nfunction removeCallback(storages, id) {\n  storages.forEach((storage) => {\n    const items = storage.loaderCallbacks;\n    if (items) {\n      storage.loaderCallbacks = items.filter((row) => row.id !== id);\n    }\n  });\n}\nfunction updateCallbacks(storage) {\n  if (!storage.pendingCallbacksFlag) {\n    storage.pendingCallbacksFlag = true;\n    setTimeout(() => {\n      storage.pendingCallbacksFlag = false;\n      const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];\n      if (!items.length) {\n        return;\n      }\n      let hasPending = false;\n      const provider = storage.provider;\n      const prefix = storage.prefix;\n      items.forEach((item) => {\n        const icons = item.icons;\n        const oldLength = icons.pending.length;\n        icons.pending = icons.pending.filter((icon) => {\n          if (icon.prefix !== prefix) {\n            return true;\n          }\n          const name = icon.name;\n          if (storage.icons[name]) {\n            icons.loaded.push({\n              provider,\n              prefix,\n              name\n            });\n          } else if (storage.missing.has(name)) {\n            icons.missing.push({\n              provider,\n              prefix,\n              name\n            });\n          } else {\n            hasPending = true;\n            return true;\n          }\n          return false;\n        });\n        if (icons.pending.length !== oldLength) {\n          if (!hasPending) {\n            removeCallback([storage], item.id);\n          }\n          item.callback(\n            icons.loaded.slice(0),\n            icons.missing.slice(0),\n            icons.pending.slice(0),\n            item.abort\n          );\n        }\n      });\n    });\n  }\n}\nlet idCounter = 0;\nfunction storeCallback(callback, icons, pendingSources) {\n  const id = idCounter++;\n  const abort = removeCallback.bind(null, pendingSources, id);\n  if (!icons.pending.length) {\n    return abort;\n  }\n  const item = {\n    id,\n    icons,\n    callback,\n    abort\n  };\n  pendingSources.forEach((storage) => {\n    (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);\n  });\n  return abort;\n}\n\nconst storage = /* @__PURE__ */ Object.create(null);\nfunction setAPIModule(provider, item) {\n  storage[provider] = item;\n}\nfunction getAPIModule(provider) {\n  return storage[provider] || storage[\"\"];\n}\n\nfunction listToIcons(list, validate = true, simpleNames = false) {\n  const result = [];\n  list.forEach((item) => {\n    const icon = typeof item === \"string\" ? stringToIcon(item, validate, simpleNames) : item;\n    if (icon) {\n      result.push(icon);\n    }\n  });\n  return result;\n}\n\n// src/config.ts\nvar defaultConfig = {\n  resources: [],\n  index: 0,\n  timeout: 2e3,\n  rotate: 750,\n  random: false,\n  dataAfterTimeout: false\n};\n\n// src/query.ts\nfunction sendQuery(config, payload, query, done) {\n  const resourcesCount = config.resources.length;\n  const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;\n  let resources;\n  if (config.random) {\n    let list = config.resources.slice(0);\n    resources = [];\n    while (list.length > 1) {\n      const nextIndex = Math.floor(Math.random() * list.length);\n      resources.push(list[nextIndex]);\n      list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));\n    }\n    resources = resources.concat(list);\n  } else {\n    resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));\n  }\n  const startTime = Date.now();\n  let status = \"pending\";\n  let queriesSent = 0;\n  let lastError;\n  let timer = null;\n  let queue = [];\n  let doneCallbacks = [];\n  if (typeof done === \"function\") {\n    doneCallbacks.push(done);\n  }\n  function resetTimer() {\n    if (timer) {\n      clearTimeout(timer);\n      timer = null;\n    }\n  }\n  function abort() {\n    if (status === \"pending\") {\n      status = \"aborted\";\n    }\n    resetTimer();\n    queue.forEach((item) => {\n      if (item.status === \"pending\") {\n        item.status = \"aborted\";\n      }\n    });\n    queue = [];\n  }\n  function subscribe(callback, overwrite) {\n    if (overwrite) {\n      doneCallbacks = [];\n    }\n    if (typeof callback === \"function\") {\n      doneCallbacks.push(callback);\n    }\n  }\n  function getQueryStatus() {\n    return {\n      startTime,\n      payload,\n      status,\n      queriesSent,\n      queriesPending: queue.length,\n      subscribe,\n      abort\n    };\n  }\n  function failQuery() {\n    status = \"failed\";\n    doneCallbacks.forEach((callback) => {\n      callback(void 0, lastError);\n    });\n  }\n  function clearQueue() {\n    queue.forEach((item) => {\n      if (item.status === \"pending\") {\n        item.status = \"aborted\";\n      }\n    });\n    queue = [];\n  }\n  function moduleResponse(item, response, data) {\n    const isError = response !== \"success\";\n    queue = queue.filter((queued) => queued !== item);\n    switch (status) {\n      case \"pending\":\n        break;\n      case \"failed\":\n        if (isError || !config.dataAfterTimeout) {\n          return;\n        }\n        break;\n      default:\n        return;\n    }\n    if (response === \"abort\") {\n      lastError = data;\n      failQuery();\n      return;\n    }\n    if (isError) {\n      lastError = data;\n      if (!queue.length) {\n        if (!resources.length) {\n          failQuery();\n        } else {\n          execNext();\n        }\n      }\n      return;\n    }\n    resetTimer();\n    clearQueue();\n    if (!config.random) {\n      const index = config.resources.indexOf(item.resource);\n      if (index !== -1 && index !== config.index) {\n        config.index = index;\n      }\n    }\n    status = \"completed\";\n    doneCallbacks.forEach((callback) => {\n      callback(data);\n    });\n  }\n  function execNext() {\n    if (status !== \"pending\") {\n      return;\n    }\n    resetTimer();\n    const resource = resources.shift();\n    if (resource === void 0) {\n      if (queue.length) {\n        timer = setTimeout(() => {\n          resetTimer();\n          if (status === \"pending\") {\n            clearQueue();\n            failQuery();\n          }\n        }, config.timeout);\n        return;\n      }\n      failQuery();\n      return;\n    }\n    const item = {\n      status: \"pending\",\n      resource,\n      callback: (status2, data) => {\n        moduleResponse(item, status2, data);\n      }\n    };\n    queue.push(item);\n    queriesSent++;\n    timer = setTimeout(execNext, config.rotate);\n    query(resource, payload, item.callback);\n  }\n  setTimeout(execNext);\n  return getQueryStatus;\n}\n\n// src/index.ts\nfunction initRedundancy(cfg) {\n  const config = {\n    ...defaultConfig,\n    ...cfg\n  };\n  let queries = [];\n  function cleanup() {\n    queries = queries.filter((item) => item().status === \"pending\");\n  }\n  function query(payload, queryCallback, doneCallback) {\n    const query2 = sendQuery(\n      config,\n      payload,\n      queryCallback,\n      (data, error) => {\n        cleanup();\n        if (doneCallback) {\n          doneCallback(data, error);\n        }\n      }\n    );\n    queries.push(query2);\n    return query2;\n  }\n  function find(callback) {\n    return queries.find((value) => {\n      return callback(value);\n    }) || null;\n  }\n  const instance = {\n    query,\n    find,\n    setIndex: (index) => {\n      config.index = index;\n    },\n    getIndex: () => config.index,\n    cleanup\n  };\n  return instance;\n}\n\nfunction createAPIConfig(source) {\n  let resources;\n  if (typeof source.resources === \"string\") {\n    resources = [source.resources];\n  } else {\n    resources = source.resources;\n    if (!(resources instanceof Array) || !resources.length) {\n      return null;\n    }\n  }\n  const result = {\n    // API hosts\n    resources,\n    // Root path\n    path: source.path || \"/\",\n    // URL length limit\n    maxURL: source.maxURL || 500,\n    // Timeout before next host is used.\n    rotate: source.rotate || 750,\n    // Timeout before failing query.\n    timeout: source.timeout || 5e3,\n    // Randomise default API end point.\n    random: source.random === true,\n    // Start index\n    index: source.index || 0,\n    // Receive data after time out (used if time out kicks in first, then API module sends data anyway).\n    dataAfterTimeout: source.dataAfterTimeout !== false\n  };\n  return result;\n}\nconst configStorage = /* @__PURE__ */ Object.create(null);\nconst fallBackAPISources = [\n  \"https://api.simplesvg.com\",\n  \"https://api.unisvg.com\"\n];\nconst fallBackAPI = [];\nwhile (fallBackAPISources.length > 0) {\n  if (fallBackAPISources.length === 1) {\n    fallBackAPI.push(fallBackAPISources.shift());\n  } else {\n    if (Math.random() > 0.5) {\n      fallBackAPI.push(fallBackAPISources.shift());\n    } else {\n      fallBackAPI.push(fallBackAPISources.pop());\n    }\n  }\n}\nconfigStorage[\"\"] = createAPIConfig({\n  resources: [\"https://api.iconify.design\"].concat(fallBackAPI)\n});\nfunction addAPIProvider$1(provider, customConfig) {\n  const config = createAPIConfig(customConfig);\n  if (config === null) {\n    return false;\n  }\n  configStorage[provider] = config;\n  return true;\n}\nfunction getAPIConfig(provider) {\n  return configStorage[provider];\n}\nfunction listAPIProviders() {\n  return Object.keys(configStorage);\n}\n\nfunction emptyCallback$1() {\n}\nconst redundancyCache = /* @__PURE__ */ Object.create(null);\nfunction getRedundancyCache(provider) {\n  if (!redundancyCache[provider]) {\n    const config = getAPIConfig(provider);\n    if (!config) {\n      return;\n    }\n    const redundancy = initRedundancy(config);\n    const cachedReundancy = {\n      config,\n      redundancy\n    };\n    redundancyCache[provider] = cachedReundancy;\n  }\n  return redundancyCache[provider];\n}\nfunction sendAPIQuery(target, query, callback) {\n  let redundancy;\n  let send;\n  if (typeof target === \"string\") {\n    const api = getAPIModule(target);\n    if (!api) {\n      callback(void 0, 424);\n      return emptyCallback$1;\n    }\n    send = api.send;\n    const cached = getRedundancyCache(target);\n    if (cached) {\n      redundancy = cached.redundancy;\n    }\n  } else {\n    const config = createAPIConfig(target);\n    if (config) {\n      redundancy = initRedundancy(config);\n      const moduleKey = target.resources ? target.resources[0] : \"\";\n      const api = getAPIModule(moduleKey);\n      if (api) {\n        send = api.send;\n      }\n    }\n  }\n  if (!redundancy || !send) {\n    callback(void 0, 424);\n    return emptyCallback$1;\n  }\n  return redundancy.query(query, send, callback)().abort;\n}\n\nfunction emptyCallback() {\n}\nfunction loadedNewIcons(storage) {\n  if (!storage.iconsLoaderFlag) {\n    storage.iconsLoaderFlag = true;\n    setTimeout(() => {\n      storage.iconsLoaderFlag = false;\n      updateCallbacks(storage);\n    });\n  }\n}\nfunction checkIconNamesForAPI(icons) {\n  const valid = [];\n  const invalid = [];\n  icons.forEach((name) => {\n    (name.match(matchIconName) ? valid : invalid).push(name);\n  });\n  return {\n    valid,\n    invalid\n  };\n}\nfunction parseLoaderResponse(storage, icons, data) {\n  function checkMissing() {\n    const pending = storage.pendingIcons;\n    icons.forEach((name) => {\n      if (pending) {\n        pending.delete(name);\n      }\n      if (!storage.icons[name]) {\n        storage.missing.add(name);\n      }\n    });\n  }\n  if (data && typeof data === \"object\") {\n    try {\n      const parsed = addIconSet(storage, data);\n      if (!parsed.length) {\n        checkMissing();\n        return;\n      }\n    } catch (err) {\n      console.error(err);\n    }\n  }\n  checkMissing();\n  loadedNewIcons(storage);\n}\nfunction parsePossiblyAsyncResponse(response, callback) {\n  if (response instanceof Promise) {\n    response.then((data) => {\n      callback(data);\n    }).catch(() => {\n      callback(null);\n    });\n  } else {\n    callback(response);\n  }\n}\nfunction loadNewIcons(storage, icons) {\n  if (!storage.iconsToLoad) {\n    storage.iconsToLoad = icons;\n  } else {\n    storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();\n  }\n  if (!storage.iconsQueueFlag) {\n    storage.iconsQueueFlag = true;\n    setTimeout(() => {\n      storage.iconsQueueFlag = false;\n      const { provider, prefix } = storage;\n      const icons2 = storage.iconsToLoad;\n      delete storage.iconsToLoad;\n      if (!icons2 || !icons2.length) {\n        return;\n      }\n      const customIconLoader = storage.loadIcon;\n      if (storage.loadIcons && (icons2.length > 1 || !customIconLoader)) {\n        parsePossiblyAsyncResponse(\n          storage.loadIcons(icons2, prefix, provider),\n          (data) => {\n            parseLoaderResponse(storage, icons2, data);\n          }\n        );\n        return;\n      }\n      if (customIconLoader) {\n        icons2.forEach((name) => {\n          const response = customIconLoader(name, prefix, provider);\n          parsePossiblyAsyncResponse(response, (data) => {\n            const iconSet = data ? {\n              prefix,\n              icons: {\n                [name]: data\n              }\n            } : null;\n            parseLoaderResponse(storage, [name], iconSet);\n          });\n        });\n        return;\n      }\n      const { valid, invalid } = checkIconNamesForAPI(icons2);\n      if (invalid.length) {\n        parseLoaderResponse(storage, invalid, null);\n      }\n      if (!valid.length) {\n        return;\n      }\n      const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;\n      if (!api) {\n        parseLoaderResponse(storage, valid, null);\n        return;\n      }\n      const params = api.prepare(provider, prefix, valid);\n      params.forEach((item) => {\n        sendAPIQuery(provider, item, (data) => {\n          parseLoaderResponse(storage, item.icons, data);\n        });\n      });\n    });\n  }\n}\nconst loadIcons$1 = (icons, callback) => {\n  const cleanedIcons = listToIcons(icons, true, allowSimpleNames());\n  const sortedIcons = sortIcons(cleanedIcons);\n  if (!sortedIcons.pending.length) {\n    let callCallback = true;\n    if (callback) {\n      setTimeout(() => {\n        if (callCallback) {\n          callback(\n            sortedIcons.loaded,\n            sortedIcons.missing,\n            sortedIcons.pending,\n            emptyCallback\n          );\n        }\n      });\n    }\n    return () => {\n      callCallback = false;\n    };\n  }\n  const newIcons = /* @__PURE__ */ Object.create(null);\n  const sources = [];\n  let lastProvider, lastPrefix;\n  sortedIcons.pending.forEach((icon) => {\n    const { provider, prefix } = icon;\n    if (prefix === lastPrefix && provider === lastProvider) {\n      return;\n    }\n    lastProvider = provider;\n    lastPrefix = prefix;\n    sources.push(getStorage(provider, prefix));\n    const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));\n    if (!providerNewIcons[prefix]) {\n      providerNewIcons[prefix] = [];\n    }\n  });\n  sortedIcons.pending.forEach((icon) => {\n    const { provider, prefix, name } = icon;\n    const storage = getStorage(provider, prefix);\n    const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());\n    if (!pendingQueue.has(name)) {\n      pendingQueue.add(name);\n      newIcons[provider][prefix].push(name);\n    }\n  });\n  sources.forEach((storage) => {\n    const list = newIcons[storage.provider][storage.prefix];\n    if (list.length) {\n      loadNewIcons(storage, list);\n    }\n  });\n  return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;\n};\nconst loadIcon$1 = (icon) => {\n  return new Promise((fulfill, reject) => {\n    const iconObj = typeof icon === \"string\" ? stringToIcon(icon, true) : icon;\n    if (!iconObj) {\n      reject(icon);\n      return;\n    }\n    loadIcons$1([iconObj || icon], (loaded) => {\n      if (loaded.length && iconObj) {\n        const data = getIconData(iconObj);\n        if (data) {\n          fulfill({\n            ...defaultIconProps,\n            ...data\n          });\n          return;\n        }\n      }\n      reject(icon);\n    });\n  });\n};\n\n/**\n * Test icon string\n */\nfunction testIconObject(value) {\n    try {\n        const obj = typeof value === 'string' ? JSON.parse(value) : value;\n        if (typeof obj.body === 'string') {\n            return {\n                ...obj,\n            };\n        }\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    }\n    catch (err) {\n        //\n    }\n}\n\n/**\n * Parse icon value, load if needed\n */\nfunction parseIconValue(value, onload) {\n    if (typeof value === 'object') {\n        const data = testIconObject(value);\n        return {\n            data,\n            value,\n        };\n    }\n    if (typeof value !== 'string') {\n        // Invalid value\n        return {\n            value,\n        };\n    }\n    // Check for JSON\n    if (value.includes('{')) {\n        const data = testIconObject(value);\n        if (data) {\n            return {\n                data,\n                value,\n            };\n        }\n    }\n    // Parse icon name\n    const name = stringToIcon(value, true, true);\n    if (!name) {\n        return {\n            value,\n        };\n    }\n    // Valid icon name: check if data is available\n    const data = getIconData(name);\n    // Icon data exists or icon has no prefix. Do not load icon from API if icon has no prefix\n    if (data !== undefined || !name.prefix) {\n        return {\n            value,\n            name,\n            data, // could be 'null' -> icon is missing\n        };\n    }\n    // Load icon\n    const loading = loadIcons$1([name], () => onload(value, name, getIconData(name)));\n    return {\n        value,\n        name,\n        loading,\n    };\n}\n\n// Check for Safari\nlet isBuggedSafari = false;\ntry {\n    isBuggedSafari = navigator.vendor.indexOf('Apple') === 0;\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n}\ncatch (err) {\n    //\n}\n/**\n * Get render mode\n */\nfunction getRenderMode(body, mode) {\n    switch (mode) {\n        // Force mode\n        case 'svg':\n        case 'bg':\n        case 'mask':\n            return mode;\n    }\n    // Check for animation, use 'style' for animated icons, unless browser is Safari\n    // (only <a>, which should be ignored or animations start with '<a')\n    if (mode !== 'style' &&\n        (isBuggedSafari || body.indexOf('<a') === -1)) {\n        // Render <svg>\n        return 'svg';\n    }\n    // Use background or mask\n    return body.indexOf('currentColor') === -1 ? 'bg' : 'mask';\n}\n\nconst unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;\nconst unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;\nfunction calculateSize$1(size, ratio, precision) {\n  if (ratio === 1) {\n    return size;\n  }\n  precision = precision || 100;\n  if (typeof size === \"number\") {\n    return Math.ceil(size * ratio * precision) / precision;\n  }\n  if (typeof size !== \"string\") {\n    return size;\n  }\n  const oldParts = size.split(unitsSplit);\n  if (oldParts === null || !oldParts.length) {\n    return size;\n  }\n  const newParts = [];\n  let code = oldParts.shift();\n  let isNumber = unitsTest.test(code);\n  while (true) {\n    if (isNumber) {\n      const num = parseFloat(code);\n      if (isNaN(num)) {\n        newParts.push(code);\n      } else {\n        newParts.push(Math.ceil(num * ratio * precision) / precision);\n      }\n    } else {\n      newParts.push(code);\n    }\n    code = oldParts.shift();\n    if (code === void 0) {\n      return newParts.join(\"\");\n    }\n    isNumber = !isNumber;\n  }\n}\n\nfunction splitSVGDefs(content, tag = \"defs\") {\n  let defs = \"\";\n  const index = content.indexOf(\"<\" + tag);\n  while (index >= 0) {\n    const start = content.indexOf(\">\", index);\n    const end = content.indexOf(\"</\" + tag);\n    if (start === -1 || end === -1) {\n      break;\n    }\n    const endEnd = content.indexOf(\">\", end);\n    if (endEnd === -1) {\n      break;\n    }\n    defs += content.slice(start + 1, end).trim();\n    content = content.slice(0, index).trim() + content.slice(endEnd + 1);\n  }\n  return {\n    defs,\n    content\n  };\n}\nfunction mergeDefsAndContent(defs, content) {\n  return defs ? \"<defs>\" + defs + \"</defs>\" + content : content;\n}\nfunction wrapSVGContent(body, start, end) {\n  const split = splitSVGDefs(body);\n  return mergeDefsAndContent(split.defs, start + split.content + end);\n}\n\nconst isUnsetKeyword = (value) => value === \"unset\" || value === \"undefined\" || value === \"none\";\nfunction iconToSVG(icon, customisations) {\n  const fullIcon = {\n    ...defaultIconProps,\n    ...icon\n  };\n  const fullCustomisations = {\n    ...defaultIconCustomisations,\n    ...customisations\n  };\n  const box = {\n    left: fullIcon.left,\n    top: fullIcon.top,\n    width: fullIcon.width,\n    height: fullIcon.height\n  };\n  let body = fullIcon.body;\n  [fullIcon, fullCustomisations].forEach((props) => {\n    const transformations = [];\n    const hFlip = props.hFlip;\n    const vFlip = props.vFlip;\n    let rotation = props.rotate;\n    if (hFlip) {\n      if (vFlip) {\n        rotation += 2;\n      } else {\n        transformations.push(\n          \"translate(\" + (box.width + box.left).toString() + \" \" + (0 - box.top).toString() + \")\"\n        );\n        transformations.push(\"scale(-1 1)\");\n        box.top = box.left = 0;\n      }\n    } else if (vFlip) {\n      transformations.push(\n        \"translate(\" + (0 - box.left).toString() + \" \" + (box.height + box.top).toString() + \")\"\n      );\n      transformations.push(\"scale(1 -1)\");\n      box.top = box.left = 0;\n    }\n    let tempValue;\n    if (rotation < 0) {\n      rotation -= Math.floor(rotation / 4) * 4;\n    }\n    rotation = rotation % 4;\n    switch (rotation) {\n      case 1:\n        tempValue = box.height / 2 + box.top;\n        transformations.unshift(\n          \"rotate(90 \" + tempValue.toString() + \" \" + tempValue.toString() + \")\"\n        );\n        break;\n      case 2:\n        transformations.unshift(\n          \"rotate(180 \" + (box.width / 2 + box.left).toString() + \" \" + (box.height / 2 + box.top).toString() + \")\"\n        );\n        break;\n      case 3:\n        tempValue = box.width / 2 + box.left;\n        transformations.unshift(\n          \"rotate(-90 \" + tempValue.toString() + \" \" + tempValue.toString() + \")\"\n        );\n        break;\n    }\n    if (rotation % 2 === 1) {\n      if (box.left !== box.top) {\n        tempValue = box.left;\n        box.left = box.top;\n        box.top = tempValue;\n      }\n      if (box.width !== box.height) {\n        tempValue = box.width;\n        box.width = box.height;\n        box.height = tempValue;\n      }\n    }\n    if (transformations.length) {\n      body = wrapSVGContent(\n        body,\n        '<g transform=\"' + transformations.join(\" \") + '\">',\n        \"</g>\"\n      );\n    }\n  });\n  const customisationsWidth = fullCustomisations.width;\n  const customisationsHeight = fullCustomisations.height;\n  const boxWidth = box.width;\n  const boxHeight = box.height;\n  let width;\n  let height;\n  if (customisationsWidth === null) {\n    height = customisationsHeight === null ? \"1em\" : customisationsHeight === \"auto\" ? boxHeight : customisationsHeight;\n    width = calculateSize$1(height, boxWidth / boxHeight);\n  } else {\n    width = customisationsWidth === \"auto\" ? boxWidth : customisationsWidth;\n    height = customisationsHeight === null ? calculateSize$1(width, boxHeight / boxWidth) : customisationsHeight === \"auto\" ? boxHeight : customisationsHeight;\n  }\n  const attributes = {};\n  const setAttr = (prop, value) => {\n    if (!isUnsetKeyword(value)) {\n      attributes[prop] = value.toString();\n    }\n  };\n  setAttr(\"width\", width);\n  setAttr(\"height\", height);\n  const viewBox = [box.left, box.top, boxWidth, boxHeight];\n  attributes.viewBox = viewBox.join(\" \");\n  return {\n    attributes,\n    viewBox,\n    body\n  };\n}\n\nfunction iconToHTML$1(body, attributes) {\n  let renderAttribsHTML = body.indexOf(\"xlink:\") === -1 ? \"\" : ' xmlns:xlink=\"http://www.w3.org/1999/xlink\"';\n  for (const attr in attributes) {\n    renderAttribsHTML += \" \" + attr + '=\"' + attributes[attr] + '\"';\n  }\n  return '<svg xmlns=\"http://www.w3.org/2000/svg\"' + renderAttribsHTML + \">\" + body + \"</svg>\";\n}\n\nfunction encodeSVGforURL(svg) {\n  return svg.replace(/\"/g, \"'\").replace(/%/g, \"%25\").replace(/#/g, \"%23\").replace(/</g, \"%3C\").replace(/>/g, \"%3E\").replace(/\\s+/g, \" \");\n}\nfunction svgToData(svg) {\n  return \"data:image/svg+xml,\" + encodeSVGforURL(svg);\n}\nfunction svgToURL$1(svg) {\n  return 'url(\"' + svgToData(svg) + '\")';\n}\n\nconst detectFetch = () => {\n  let callback;\n  try {\n    callback = fetch;\n    if (typeof callback === \"function\") {\n      return callback;\n    }\n  } catch (err) {\n  }\n};\nlet fetchModule = detectFetch();\nfunction setFetch(fetch2) {\n  fetchModule = fetch2;\n}\nfunction getFetch() {\n  return fetchModule;\n}\nfunction calculateMaxLength(provider, prefix) {\n  const config = getAPIConfig(provider);\n  if (!config) {\n    return 0;\n  }\n  let result;\n  if (!config.maxURL) {\n    result = 0;\n  } else {\n    let maxHostLength = 0;\n    config.resources.forEach((item) => {\n      const host = item;\n      maxHostLength = Math.max(maxHostLength, host.length);\n    });\n    const url = prefix + \".json?icons=\";\n    result = config.maxURL - maxHostLength - config.path.length - url.length;\n  }\n  return result;\n}\nfunction shouldAbort(status) {\n  return status === 404;\n}\nconst prepare = (provider, prefix, icons) => {\n  const results = [];\n  const maxLength = calculateMaxLength(provider, prefix);\n  const type = \"icons\";\n  let item = {\n    type,\n    provider,\n    prefix,\n    icons: []\n  };\n  let length = 0;\n  icons.forEach((name, index) => {\n    length += name.length + 1;\n    if (length >= maxLength && index > 0) {\n      results.push(item);\n      item = {\n        type,\n        provider,\n        prefix,\n        icons: []\n      };\n      length = name.length;\n    }\n    item.icons.push(name);\n  });\n  results.push(item);\n  return results;\n};\nfunction getPath(provider) {\n  if (typeof provider === \"string\") {\n    const config = getAPIConfig(provider);\n    if (config) {\n      return config.path;\n    }\n  }\n  return \"/\";\n}\nconst send = (host, params, callback) => {\n  if (!fetchModule) {\n    callback(\"abort\", 424);\n    return;\n  }\n  let path = getPath(params.provider);\n  switch (params.type) {\n    case \"icons\": {\n      const prefix = params.prefix;\n      const icons = params.icons;\n      const iconsList = icons.join(\",\");\n      const urlParams = new URLSearchParams({\n        icons: iconsList\n      });\n      path += prefix + \".json?\" + urlParams.toString();\n      break;\n    }\n    case \"custom\": {\n      const uri = params.uri;\n      path += uri.slice(0, 1) === \"/\" ? uri.slice(1) : uri;\n      break;\n    }\n    default:\n      callback(\"abort\", 400);\n      return;\n  }\n  let defaultError = 503;\n  fetchModule(host + path).then((response) => {\n    const status = response.status;\n    if (status !== 200) {\n      setTimeout(() => {\n        callback(shouldAbort(status) ? \"abort\" : \"next\", status);\n      });\n      return;\n    }\n    defaultError = 501;\n    return response.json();\n  }).then((data) => {\n    if (typeof data !== \"object\" || data === null) {\n      setTimeout(() => {\n        if (data === 404) {\n          callback(\"abort\", data);\n        } else {\n          callback(\"next\", defaultError);\n        }\n      });\n      return;\n    }\n    setTimeout(() => {\n      callback(\"success\", data);\n    });\n  }).catch(() => {\n    callback(\"next\", defaultError);\n  });\n};\nconst fetchAPIModule = {\n  prepare,\n  send\n};\n\nfunction setCustomIconsLoader$1(loader, prefix, provider) {\n  getStorage(provider || \"\", prefix).loadIcons = loader;\n}\nfunction setCustomIconLoader$1(loader, prefix, provider) {\n  getStorage(provider || \"\", prefix).loadIcon = loader;\n}\n\n/**\n * Attribute to add\n */\nconst nodeAttr = 'data-style';\n/**\n * Custom style to add to each node\n */\nlet customStyle = '';\n/**\n * Set custom style to add to all components\n *\n * Affects only components rendered after function call\n */\nfunction appendCustomStyle(style) {\n    customStyle = style;\n}\n/**\n * Add/update style node\n */\nfunction updateStyle(parent, inline) {\n    // Get node, create if needed\n    let styleNode = Array.from(parent.childNodes).find((node) => node.hasAttribute &&\n        node.hasAttribute(nodeAttr));\n    if (!styleNode) {\n        styleNode = document.createElement('style');\n        styleNode.setAttribute(nodeAttr, nodeAttr);\n        parent.appendChild(styleNode);\n    }\n    // Update content\n    styleNode.textContent =\n        ':host{display:inline-block;vertical-align:' +\n            (inline ? '-0.125em' : '0') +\n            '}span,svg{display:block;margin:auto}' +\n            customStyle;\n}\n\n// Core\n/**\n * Get functions and initialise stuff\n */\nfunction exportFunctions() {\n    /**\n     * Initialise stuff\n     */\n    // Set API module\n    setAPIModule('', fetchAPIModule);\n    // Allow simple icon names\n    allowSimpleNames(true);\n    let _window;\n    try {\n        _window = window;\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    }\n    catch (err) {\n        //\n    }\n    if (_window) {\n        // Load icons from global \"IconifyPreload\"\n        if (_window.IconifyPreload !== void 0) {\n            const preload = _window.IconifyPreload;\n            const err = 'Invalid IconifyPreload syntax.';\n            if (typeof preload === 'object' && preload !== null) {\n                (preload instanceof Array ? preload : [preload]).forEach((item) => {\n                    try {\n                        if (\n                        // Check if item is an object and not null/array\n                        typeof item !== 'object' ||\n                            item === null ||\n                            item instanceof Array ||\n                            // Check for 'icons' and 'prefix'\n                            typeof item.icons !== 'object' ||\n                            typeof item.prefix !== 'string' ||\n                            // Add icon set\n                            !addCollection$1(item)) {\n                            console.error(err);\n                        }\n                        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                    }\n                    catch (e) {\n                        console.error(err);\n                    }\n                });\n            }\n        }\n        // Set API from global \"IconifyProviders\"\n        if (_window.IconifyProviders !== void 0) {\n            const providers = _window.IconifyProviders;\n            if (typeof providers === 'object' && providers !== null) {\n                for (const key in providers) {\n                    const err = 'IconifyProviders[' + key + '] is invalid.';\n                    try {\n                        const value = providers[key];\n                        if (typeof value !== 'object' ||\n                            !value ||\n                            value.resources === void 0) {\n                            continue;\n                        }\n                        if (!addAPIProvider$1(key, value)) {\n                            console.error(err);\n                        }\n                        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                    }\n                    catch (e) {\n                        console.error(err);\n                    }\n                }\n            }\n        }\n    }\n    const _api = {\n        getAPIConfig,\n        setAPIModule,\n        sendAPIQuery,\n        setFetch,\n        getFetch,\n        listAPIProviders,\n    };\n    return {\n        iconLoaded: iconLoaded$1,\n        getIcon: getIcon$1,\n        listIcons: listIcons$1,\n        addIcon: addIcon$1,\n        addCollection: addCollection$1,\n        calculateSize: calculateSize$1,\n        buildIcon: iconToSVG,\n        iconToHTML: iconToHTML$1,\n        svgToURL: svgToURL$1,\n        loadIcons: loadIcons$1,\n        loadIcon: loadIcon$1,\n        addAPIProvider: addAPIProvider$1,\n        setCustomIconLoader: setCustomIconLoader$1,\n        setCustomIconsLoader: setCustomIconsLoader$1,\n        appendCustomStyle,\n        _api,\n    };\n}\n\n// List of properties to apply\nconst monotoneProps = {\n    'background-color': 'currentColor',\n};\nconst coloredProps = {\n    'background-color': 'transparent',\n};\n// Dynamically add common props to variables above\nconst propsToAdd = {\n    image: 'var(--svg)',\n    repeat: 'no-repeat',\n    size: '100% 100%',\n};\nconst propsToAddTo = {\n    '-webkit-mask': monotoneProps,\n    'mask': monotoneProps,\n    'background': coloredProps,\n};\nfor (const prefix in propsToAddTo) {\n    const list = propsToAddTo[prefix];\n    for (const prop in propsToAdd) {\n        list[prefix + '-' + prop] = propsToAdd[prop];\n    }\n}\n/**\n * Fix size: add 'px' to numbers\n */\nfunction fixSize(value) {\n    return value ? value + (value.match(/^[-0-9.]+$/) ? 'px' : '') : 'inherit';\n}\n/**\n * Render node as <span>\n */\nfunction renderSPAN(data, icon, useMask) {\n    const node = document.createElement('span');\n    // Body\n    let body = data.body;\n    if (body.indexOf('<a') !== -1) {\n        // Animated SVG: add something to fix timing bug\n        body += '<!-- ' + Date.now() + ' -->';\n    }\n    // Generate SVG as URL\n    const renderAttribs = data.attributes;\n    const html = iconToHTML$1(body, {\n        ...renderAttribs,\n        width: icon.width + '',\n        height: icon.height + '',\n    });\n    const url = svgToURL$1(html);\n    // Generate style\n    const svgStyle = node.style;\n    const styles = {\n        '--svg': url,\n        'width': fixSize(renderAttribs.width),\n        'height': fixSize(renderAttribs.height),\n        ...(useMask ? monotoneProps : coloredProps),\n    };\n    // Apply style\n    for (const prop in styles) {\n        svgStyle.setProperty(prop, styles[prop]);\n    }\n    return node;\n}\n\nlet policy;\nfunction createPolicy() {\n  try {\n    policy = window.trustedTypes.createPolicy(\"iconify\", {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n      createHTML: (s) => s\n    });\n  } catch (err) {\n    policy = null;\n  }\n}\nfunction cleanUpInnerHTML(html) {\n  if (policy === void 0) {\n    createPolicy();\n  }\n  return policy ? policy.createHTML(html) : html;\n}\n\n/**\n * Render node as <svg>\n */\nfunction renderSVG(data) {\n    const node = document.createElement('span');\n    // Add style if needed\n    const attr = data.attributes;\n    let style = '';\n    if (!attr.width) {\n        style = 'width: inherit;';\n    }\n    if (!attr.height) {\n        style += 'height: inherit;';\n    }\n    if (style) {\n        attr.style = style;\n    }\n    // Generate SVG\n    const html = iconToHTML$1(data.body, attr);\n    node.innerHTML = cleanUpInnerHTML(html);\n    return node.firstChild;\n}\n\n/**\n * Find icon node\n */\nfunction findIconElement(parent) {\n    return Array.from(parent.childNodes).find((node) => {\n        const tag = node.tagName &&\n            node.tagName.toUpperCase();\n        return tag === 'SPAN' || tag === 'SVG';\n    });\n}\n/**\n * Render icon\n */\nfunction renderIcon(parent, state) {\n    const iconData = state.icon.data;\n    const customisations = state.customisations;\n    // Render icon\n    const renderData = iconToSVG(iconData, customisations);\n    if (customisations.preserveAspectRatio) {\n        renderData.attributes['preserveAspectRatio'] =\n            customisations.preserveAspectRatio;\n    }\n    const mode = state.renderedMode;\n    let node;\n    switch (mode) {\n        case 'svg':\n            node = renderSVG(renderData);\n            break;\n        default:\n            node = renderSPAN(renderData, {\n                ...defaultIconProps,\n                ...iconData,\n            }, mode === 'mask');\n    }\n    // Set element\n    const oldNode = findIconElement(parent);\n    if (oldNode) {\n        // Replace old element\n        if (node.tagName === 'SPAN' && oldNode.tagName === node.tagName) {\n            // Swap style instead of whole node\n            oldNode.setAttribute('style', node.getAttribute('style'));\n        }\n        else {\n            parent.replaceChild(node, oldNode);\n        }\n    }\n    else {\n        // Add new element\n        parent.appendChild(node);\n    }\n}\n\n/**\n * Set state to PendingState\n */\nfunction setPendingState(icon, inline, lastState) {\n    const lastRender = lastState &&\n        (lastState.rendered\n            ? lastState\n            : lastState.lastRender);\n    return {\n        rendered: false,\n        inline,\n        icon,\n        lastRender,\n    };\n}\n\n/**\n * Register 'iconify-icon' component, if it does not exist\n */\nfunction defineIconifyIcon(name = 'iconify-icon') {\n    // Check for custom elements registry and HTMLElement\n    let customElements;\n    let ParentClass;\n    try {\n        customElements = window.customElements;\n        ParentClass = window.HTMLElement;\n        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    }\n    catch (err) {\n        return;\n    }\n    // Make sure registry and HTMLElement exist\n    if (!customElements || !ParentClass) {\n        return;\n    }\n    // Check for duplicate\n    const ConflictingClass = customElements.get(name);\n    if (ConflictingClass) {\n        return ConflictingClass;\n    }\n    // All attributes\n    const attributes = [\n        // Icon\n        'icon',\n        // Mode\n        'mode',\n        'inline',\n        'noobserver',\n        // Customisations\n        'width',\n        'height',\n        'rotate',\n        'flip',\n    ];\n    /**\n     * Component class\n     */\n    const IconifyIcon = class extends ParentClass {\n        // Root\n        _shadowRoot;\n        // Initialised\n        _initialised = false;\n        // Icon state\n        _state;\n        // Attributes check queued\n        _checkQueued = false;\n        // Connected\n        _connected = false;\n        // Observer\n        _observer = null;\n        _visible = true;\n        /**\n         * Constructor\n         */\n        constructor() {\n            super();\n            // Attach shadow DOM\n            const root = (this._shadowRoot = this.attachShadow({\n                mode: 'open',\n            }));\n            // Add style\n            const inline = this.hasAttribute('inline');\n            updateStyle(root, inline);\n            // Create empty state\n            this._state = setPendingState({\n                value: '',\n            }, inline);\n            // Queue icon render\n            this._queueCheck();\n        }\n        /**\n         * Connected to DOM\n         */\n        connectedCallback() {\n            this._connected = true;\n            this.startObserver();\n        }\n        /**\n         * Disconnected from DOM\n         */\n        disconnectedCallback() {\n            this._connected = false;\n            this.stopObserver();\n        }\n        /**\n         * Observed attributes\n         */\n        static get observedAttributes() {\n            return attributes.slice(0);\n        }\n        /**\n         * Observed properties that are different from attributes\n         *\n         * Experimental! Need to test with various frameworks that support it\n         */\n        /*\n        static get properties() {\n            return {\n                inline: {\n                    type: Boolean,\n                    reflect: true,\n                },\n                // Not listing other attributes because they are strings or combination\n                // of string and another type. Cannot have multiple types\n            };\n        }\n        */\n        /**\n         * Attribute has changed\n         */\n        attributeChangedCallback(name) {\n            switch (name) {\n                case 'inline': {\n                    // Update immediately: not affected by other attributes\n                    const newInline = this.hasAttribute('inline');\n                    const state = this._state;\n                    if (newInline !== state.inline) {\n                        // Update style if inline mode changed\n                        state.inline = newInline;\n                        updateStyle(this._shadowRoot, newInline);\n                    }\n                    break;\n                }\n                case 'noobserver': {\n                    const value = this.hasAttribute('noobserver');\n                    if (value) {\n                        this.startObserver();\n                    }\n                    else {\n                        this.stopObserver();\n                    }\n                    break;\n                }\n                default:\n                    // Queue check for other attributes\n                    this._queueCheck();\n            }\n        }\n        /**\n         * Get/set icon\n         */\n        get icon() {\n            const value = this.getAttribute('icon');\n            if (value && value.slice(0, 1) === '{') {\n                try {\n                    return JSON.parse(value);\n                    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                }\n                catch (err) {\n                    //\n                }\n            }\n            return value;\n        }\n        set icon(value) {\n            if (typeof value === 'object') {\n                value = JSON.stringify(value);\n            }\n            this.setAttribute('icon', value);\n        }\n        /**\n         * Get/set inline\n         */\n        get inline() {\n            return this.hasAttribute('inline');\n        }\n        set inline(value) {\n            if (value) {\n                this.setAttribute('inline', 'true');\n            }\n            else {\n                this.removeAttribute('inline');\n            }\n        }\n        /**\n         * Get/set observer\n         */\n        get observer() {\n            return this.hasAttribute('observer');\n        }\n        set observer(value) {\n            if (value) {\n                this.setAttribute('observer', 'true');\n            }\n            else {\n                this.removeAttribute('observer');\n            }\n        }\n        /**\n         * Restart animation\n         */\n        restartAnimation() {\n            const state = this._state;\n            if (state.rendered) {\n                const root = this._shadowRoot;\n                if (state.renderedMode === 'svg') {\n                    // Update root node\n                    try {\n                        root.lastChild.setCurrentTime(0);\n                        return;\n                        // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                    }\n                    catch (err) {\n                        // Failed: setCurrentTime() is not supported\n                    }\n                }\n                renderIcon(root, state);\n            }\n        }\n        /**\n         * Get status\n         */\n        get status() {\n            const state = this._state;\n            return state.rendered\n                ? 'rendered'\n                : state.icon.data === null\n                    ? 'failed'\n                    : 'loading';\n        }\n        /**\n         * Queue attributes re-check\n         */\n        _queueCheck() {\n            if (!this._checkQueued) {\n                this._checkQueued = true;\n                setTimeout(() => {\n                    this._check();\n                });\n            }\n        }\n        /**\n         * Check for changes\n         */\n        _check() {\n            if (!this._checkQueued) {\n                return;\n            }\n            this._checkQueued = false;\n            const state = this._state;\n            // Get icon\n            const newIcon = this.getAttribute('icon');\n            if (newIcon !== state.icon.value) {\n                this._iconChanged(newIcon);\n                return;\n            }\n            // Ignore other attributes if icon is not rendered\n            if (!state.rendered || !this._visible) {\n                return;\n            }\n            // Check for mode and attribute changes\n            const mode = this.getAttribute('mode');\n            const customisations = getCustomisations(this);\n            if (state.attrMode !== mode ||\n                haveCustomisationsChanged(state.customisations, customisations) ||\n                !findIconElement(this._shadowRoot)) {\n                this._renderIcon(state.icon, customisations, mode);\n            }\n        }\n        /**\n         * Icon value has changed\n         */\n        _iconChanged(newValue) {\n            const icon = parseIconValue(newValue, (value, name, data) => {\n                // Asynchronous callback: re-check values to make sure stuff wasn't changed\n                const state = this._state;\n                if (state.rendered || this.getAttribute('icon') !== value) {\n                    // Icon data is already available or icon attribute was changed\n                    return;\n                }\n                // Change icon\n                const icon = {\n                    value,\n                    name,\n                    data,\n                };\n                if (icon.data) {\n                    // Render icon\n                    this._gotIconData(icon);\n                }\n                else {\n                    // Nothing to render: update icon in state\n                    state.icon = icon;\n                }\n            });\n            if (icon.data) {\n                // Icon is ready to render\n                this._gotIconData(icon);\n            }\n            else {\n                // Pending icon\n                this._state = setPendingState(icon, this._state.inline, this._state);\n            }\n        }\n        /**\n         * Force render icon on state change\n         */\n        _forceRender() {\n            if (!this._visible) {\n                // Remove icon\n                const node = findIconElement(this._shadowRoot);\n                if (node) {\n                    this._shadowRoot.removeChild(node);\n                }\n                return;\n            }\n            // Re-render icon\n            this._queueCheck();\n        }\n        /**\n         * Got new icon data, icon is ready to (re)render\n         */\n        _gotIconData(icon) {\n            this._checkQueued = false;\n            this._renderIcon(icon, getCustomisations(this), this.getAttribute('mode'));\n        }\n        /**\n         * Re-render based on icon data\n         */\n        _renderIcon(icon, customisations, attrMode) {\n            // Get mode\n            const renderedMode = getRenderMode(icon.data.body, attrMode);\n            // Inline was not changed\n            const inline = this._state.inline;\n            // Set state and render\n            renderIcon(this._shadowRoot, (this._state = {\n                rendered: true,\n                icon,\n                inline,\n                customisations,\n                attrMode,\n                renderedMode,\n            }));\n        }\n        /**\n         * Start observer\n         */\n        startObserver() {\n            if (!this._observer && !this.hasAttribute('noobserver')) {\n                try {\n                    this._observer = new IntersectionObserver((entries) => {\n                        const intersecting = entries.some((entry) => entry.isIntersecting);\n                        if (intersecting !== this._visible) {\n                            this._visible = intersecting;\n                            this._forceRender();\n                        }\n                    });\n                    this._observer.observe(this);\n                    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                }\n                catch (err) {\n                    // Something went wrong, possibly observer is not supported\n                    if (this._observer) {\n                        try {\n                            this._observer.disconnect();\n                            // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                        }\n                        catch (err) {\n                            //\n                        }\n                        this._observer = null;\n                    }\n                }\n            }\n        }\n        /**\n         * Stop observer\n         */\n        stopObserver() {\n            if (this._observer) {\n                this._observer.disconnect();\n                this._observer = null;\n                this._visible = true;\n                if (this._connected) {\n                    // Render icon\n                    this._forceRender();\n                }\n            }\n        }\n    };\n    // Add getters and setters\n    attributes.forEach((attr) => {\n        if (!(attr in IconifyIcon.prototype)) {\n            Object.defineProperty(IconifyIcon.prototype, attr, {\n                get: function () {\n                    return this.getAttribute(attr);\n                },\n                set: function (value) {\n                    if (value !== null) {\n                        this.setAttribute(attr, value);\n                    }\n                    else {\n                        this.removeAttribute(attr);\n                    }\n                },\n            });\n        }\n    });\n    // Add exported functions: both as static and instance methods\n    const functions = exportFunctions();\n    for (const key in functions) {\n        IconifyIcon[key] = IconifyIcon.prototype[key] = functions[key];\n    }\n    // Define new component\n    customElements.define(name, IconifyIcon);\n    return IconifyIcon;\n}\n\n/**\n * Create exported data: either component instance or functions\n */\nconst IconifyIconComponent = defineIconifyIcon() || exportFunctions();\n/**\n * Export functions\n */\nconst { iconLoaded, getIcon, listIcons, addIcon, addCollection, calculateSize, buildIcon, iconToHTML, svgToURL, loadIcons, loadIcon, setCustomIconLoader, setCustomIconsLoader, addAPIProvider, _api, } = IconifyIconComponent;\n\nexport { IconifyIconComponent, _api, addAPIProvider, addCollection, addIcon, appendCustomStyle, buildIcon, calculateSize, getIcon, iconLoaded, iconToHTML, listIcons, loadIcon, loadIcons, setCustomIconLoader, setCustomIconsLoader, svgToURL };\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n *  ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n *   // Declare observed properties\n *   static get properties() {\n *     return {\n *       adjective: {}\n *     }\n *   }\n *\n *   constructor() {\n *     this.adjective = 'awesome';\n *   }\n *\n *   // Define the element's template\n *   render() {\n *     return html`<p>your ${adjective} template here</p>`;\n *   }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | LitUnstable.DebugLog.Entry\n      | ReactiveUnstable.DebugLog.Entry;\n  }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n  prop: P,\n  _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  // Ensure warnings are issued only 1x, even if multiple versions of Lit\n  // are loaded.\n  const issuedWarnings: Set<string | undefined> =\n    (globalThis.litIssuedWarnings ??= new Set());\n\n  // Issue a warning, if we haven't already.\n  issueWarning = (code: string, warning: string) => {\n    warning += ` See https://lit.dev/msg/${code} for more information.`;\n    if (!issuedWarnings.has(warning)) {\n      console.warn(warning);\n      issuedWarnings.add(warning);\n    }\n  };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n  // This property needs to remain unminified.\n  static ['_$litElement$'] = true;\n\n  /**\n   * @category rendering\n   */\n  readonly renderOptions: RenderOptions = {host: this};\n\n  private __childPart: RootPart | undefined = undefined;\n\n  /**\n   * @category rendering\n   */\n  protected override createRenderRoot() {\n    const renderRoot = super.createRenderRoot();\n    // When adoptedStyleSheets are shimmed, they are inserted into the\n    // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n    // any styles in Lit content render before adoptedStyleSheets. This is\n    // important so that adoptedStyleSheets have precedence over styles in\n    // the shadowRoot.\n    this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n    return renderRoot;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls `render` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * @param changedProperties Map of changed properties with old values\n   * @category updates\n   */\n  protected override update(changedProperties: PropertyValues) {\n    // Setting properties in `render` should not trigger an update. Since\n    // updates are allowed after super.update, it's important to call `render`\n    // before that.\n    const value = this.render();\n    if (!this.hasUpdated) {\n      this.renderOptions.isConnected = this.isConnected;\n    }\n    super.update(changedProperties);\n    this.__childPart = render(value, this.renderRoot, this.renderOptions);\n  }\n\n  /**\n   * Invoked when the component is added to the document's DOM.\n   *\n   * In `connectedCallback()` you should setup tasks that should only occur when\n   * the element is connected to the document. The most common of these is\n   * adding event listeners to nodes external to the element, like a keydown\n   * event handler added to the window.\n   *\n   * ```ts\n   * connectedCallback() {\n   *   super.connectedCallback();\n   *   addEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * Typically, anything done in `connectedCallback()` should be undone when the\n   * element is disconnected, in `disconnectedCallback()`.\n   *\n   * @category lifecycle\n   */\n  override connectedCallback() {\n    super.connectedCallback();\n    this.__childPart?.setConnected(true);\n  }\n\n  /**\n   * Invoked when the component is removed from the document's DOM.\n   *\n   * This callback is the main signal to the element that it may no longer be\n   * used. `disconnectedCallback()` should ensure that nothing is holding a\n   * reference to the element (such as event listeners added to nodes external\n   * to the element), so that it is free to be garbage collected.\n   *\n   * ```ts\n   * disconnectedCallback() {\n   *   super.disconnectedCallback();\n   *   window.removeEventListener('keydown', this._handleKeydown);\n   * }\n   * ```\n   *\n   * An element may be re-connected after being disconnected.\n   *\n   * @category lifecycle\n   */\n  override disconnectedCallback() {\n    super.disconnectedCallback();\n    this.__childPart?.setConnected(false);\n  }\n\n  /**\n   * Invoked on each update to perform rendering tasks. This method may return\n   * any value renderable by lit-html's `ChildPart` - typically a\n   * `TemplateResult`. Setting properties inside this method will *not* trigger\n   * the element to update.\n   * @category rendering\n   */\n  protected render(): unknown {\n    return noChange;\n  }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n  JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobalThis.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n  ? globalThis.litElementPolyfillSupportDevMode\n  : globalThis.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports  mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n  _$attributeToProperty: (\n    el: LitElement,\n    name: string,\n    value: string | null\n  ) => {\n    // eslint-disable-next-line\n    (el as any)._$attributeToProperty(name, value);\n  },\n  // eslint-disable-next-line\n  _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(globalThis.litElementVersions ??= []).push('4.1.1');\nif (DEV_MODE && globalThis.litElementVersions.length > 1) {\n  issueWarning!(\n    'multiple-versions',\n    `Multiple versions of Lit loaded. Loading multiple versions ` +\n      `is not recommended.`\n  );\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n  AttributePart,\n  BooleanAttributePart,\n  ChildPart,\n  ElementPart,\n  EventPart,\n  Part,\n  PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n  new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n  /**\n   * This property needs to remain unminified.\n   * @internal\n   */\n  ['_$litDirective$']: C;\n  /** @internal */\n  values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n  ATTRIBUTE: 1,\n  CHILD: 2,\n  PROPERTY: 3,\n  BOOLEAN_ATTRIBUTE: 4,\n  EVENT: 5,\n  ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n  readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n  readonly type:\n    | typeof PartType.ATTRIBUTE\n    | typeof PartType.PROPERTY\n    | typeof PartType.BOOLEAN_ATTRIBUTE\n    | typeof PartType.EVENT;\n  readonly strings?: ReadonlyArray<string>;\n  readonly name: string;\n  readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n  readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n  <C extends DirectiveClass>(c: C) =>\n  (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n    // This property needs to remain unminified.\n    ['_$litDirective$']: c,\n    values,\n  });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n  //@internal\n  __part!: Part;\n  //@internal\n  __attributeIndex: number | undefined;\n  //@internal\n  __directive?: Directive;\n\n  //@internal\n  _$parent!: Disconnectable;\n\n  // These will only exist on the AsyncDirective subclass\n  //@internal\n  _$disconnectableChildren?: Set<Disconnectable>;\n  // This property needs to remain unminified.\n  //@internal\n  ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n  constructor(_partInfo: PartInfo) {}\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  /** @internal */\n  _$initialize(\n    part: Part,\n    parent: Disconnectable,\n    attributeIndex: number | undefined\n  ) {\n    this.__part = part;\n    this._$parent = parent;\n    this.__attributeIndex = attributeIndex;\n  }\n  /** @internal */\n  _$resolve(part: Part, props: Array<unknown>): unknown {\n    return this.update(part, props);\n  }\n\n  abstract render(...props: Array<unknown>): unknown;\n\n  update(_part: Part, props: Array<unknown>): unknown {\n    return this.render(...props);\n  }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n  directive,\n  Directive,\n  DirectiveParameters,\n  PartInfo,\n  PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of class names to truthy values.\n */\nexport interface ClassInfo {\n  readonly [name: string]: string | boolean | number;\n}\n\nclass ClassMapDirective extends Directive {\n  /**\n   * Stores the ClassInfo object applied to a given AttributePart.\n   * Used to unset existing values when a new ClassInfo object is applied.\n   */\n  private _previousClasses?: Set<string>;\n  private _staticClasses?: Set<string>;\n\n  constructor(partInfo: PartInfo) {\n    super(partInfo);\n    if (\n      partInfo.type !== PartType.ATTRIBUTE ||\n      partInfo.name !== 'class' ||\n      (partInfo.strings?.length as number) > 2\n    ) {\n      throw new Error(\n        '`classMap()` can only be used in the `class` attribute ' +\n          'and must be the only part in the attribute.'\n      );\n    }\n  }\n\n  render(classInfo: ClassInfo) {\n    // Add spaces to ensure separation from static classes\n    return (\n      ' ' +\n      Object.keys(classInfo)\n        .filter((key) => classInfo[key])\n        .join(' ') +\n      ' '\n    );\n  }\n\n  override update(part: AttributePart, [classInfo]: DirectiveParameters<this>) {\n    // Remember dynamic classes on the first render\n    if (this._previousClasses === undefined) {\n      this._previousClasses = new Set();\n      if (part.strings !== undefined) {\n        this._staticClasses = new Set(\n          part.strings\n            .join(' ')\n            .split(/\\s/)\n            .filter((s) => s !== '')\n        );\n      }\n      for (const name in classInfo) {\n        if (classInfo[name] && !this._staticClasses?.has(name)) {\n          this._previousClasses.add(name);\n        }\n      }\n      return this.render(classInfo);\n    }\n\n    const classList = part.element.classList;\n\n    // Remove old classes that no longer apply\n    for (const name of this._previousClasses) {\n      if (!(name in classInfo)) {\n        classList.remove(name);\n        this._previousClasses!.delete(name);\n      }\n    }\n\n    // Add or remove classes based on their classMap value\n    for (const name in classInfo) {\n      // We explicitly want a loose truthy check of `value` because it seems\n      // more convenient that '' and 0 are skipped.\n      const value = !!classInfo[name];\n      if (\n        value !== this._previousClasses.has(name) &&\n        !this._staticClasses?.has(name)\n      ) {\n        if (value) {\n          classList.add(name);\n          this._previousClasses.add(name);\n        } else {\n          classList.remove(name);\n          this._previousClasses.delete(name);\n        }\n      }\n    }\n    return noChange;\n  }\n}\n\n/**\n * A directive that applies dynamic CSS classes.\n *\n * This must be used in the `class` attribute and must be the only part used in\n * the attribute. It takes each property in the `classInfo` argument and adds\n * the property name to the element's `classList` if the property value is\n * truthy; if the property value is falsy, the property name is removed from\n * the element's `class`.\n *\n * For example `{foo: bar}` applies the class `foo` if the value of `bar` is\n * truthy.\n *\n * @param classInfo\n */\nexport const classMap = directive(ClassMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {ClassMapDirective};\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Returns an iterable containing the result of calling `f(value)` on each\n * value in `items`.\n *\n * @example\n *\n * ```ts\n * render() {\n *   return html`\n *     <ul>\n *       ${map(items, (i) => html`<li>${i}</li>`)}\n *     </ul>\n *   `;\n * }\n * ```\n */\nexport function* map<T>(\n  items: Iterable<T> | undefined,\n  f: (value: T, index: number) => unknown\n) {\n  if (items !== undefined) {\n    let i = 0;\n    for (const value of items) {\n      yield f(value, i++);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n  /**\n   * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n   * we will emit 'lit-debug' events to window, with live details about the update and render\n   * lifecycle. These can be useful for writing debug tooling and visualizations.\n   *\n   * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n   * making certain operations that are normally very cheap (like a no-op render) much slower,\n   * because we must copy data and dispatch events.\n   */\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  export namespace DebugLog {\n    export type Entry =\n      | TemplatePrep\n      | TemplateInstantiated\n      | TemplateInstantiatedAndUpdated\n      | TemplateUpdating\n      | BeginRender\n      | EndRender\n      | CommitPartEntry\n      | SetPartValue;\n    export interface TemplatePrep {\n      kind: 'template prep';\n      template: Template;\n      strings: TemplateStringsArray;\n      clonableTemplate: HTMLTemplateElement;\n      parts: TemplatePart[];\n    }\n    export interface BeginRender {\n      kind: 'begin render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart | undefined;\n    }\n    export interface EndRender {\n      kind: 'end render';\n      id: number;\n      value: unknown;\n      container: HTMLElement | DocumentFragment;\n      options: RenderOptions | undefined;\n      part: ChildPart;\n    }\n    export interface TemplateInstantiated {\n      kind: 'template instantiated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateInstantiatedAndUpdated {\n      kind: 'template instantiated and updated';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      fragment: Node;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface TemplateUpdating {\n      kind: 'template updating';\n      template: Template | CompiledTemplate;\n      instance: TemplateInstance;\n      options: RenderOptions | undefined;\n      parts: Array<Part | undefined>;\n      values: unknown[];\n    }\n    export interface SetPartValue {\n      kind: 'set part';\n      part: Part;\n      value: unknown;\n      valueIndex: number;\n      values: unknown[];\n      templateInstance: TemplateInstance;\n    }\n\n    export type CommitPartEntry =\n      | CommitNothingToChildEntry\n      | CommitText\n      | CommitNode\n      | CommitAttribute\n      | CommitProperty\n      | CommitBooleanAttribute\n      | CommitEventListener\n      | CommitToElementBinding;\n\n    export interface CommitNothingToChildEntry {\n      kind: 'commit nothing to child';\n      start: ChildNode;\n      end: ChildNode | null;\n      parent: Disconnectable | undefined;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitText {\n      kind: 'commit text';\n      node: Text;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitNode {\n      kind: 'commit node';\n      start: Node;\n      parent: Disconnectable | undefined;\n      value: Node;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitAttribute {\n      kind: 'commit attribute';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitProperty {\n      kind: 'commit property';\n      element: Element;\n      name: string;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitBooleanAttribute {\n      kind: 'commit boolean attribute';\n      element: Element;\n      name: string;\n      value: boolean;\n      options: RenderOptions | undefined;\n    }\n\n    export interface CommitEventListener {\n      kind: 'commit event listener';\n      element: Element;\n      name: string;\n      value: unknown;\n      oldListener: unknown;\n      options: RenderOptions | undefined;\n      // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n      removeListener: boolean;\n      // True if we're adding a new event listener (e.g. because first render, or settings changed)\n      addListener: boolean;\n    }\n\n    export interface CommitToElementBinding {\n      kind: 'commit to element binding';\n      element: Element;\n      value: unknown;\n      options: RenderOptions | undefined;\n    }\n  }\n}\n\ninterface DebugLoggingWindow {\n  // Even in dev mode, we generally don't want to emit these events, as that's\n  // another level of cost, so only emit them when DEV_MODE is true _and_ when\n  // window.emitLitDebugEvents is true.\n  emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n  ? (event: LitUnstable.DebugLog.Entry) => {\n      const shouldEmit = (global as unknown as DebugLoggingWindow)\n        .emitLitDebugLogEvents;\n      if (!shouldEmit) {\n        return;\n      }\n      global.dispatchEvent(\n        new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n          detail: event,\n        })\n      );\n    }\n  : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n  global.litIssuedWarnings ??= new Set();\n\n  // Issue a warning, if we haven't already.\n  issueWarning = (code: string, warning: string) => {\n    warning += code\n      ? ` See https://lit.dev/msg/${code} for more information.`\n      : '';\n    if (!global.litIssuedWarnings!.has(warning)) {\n      console.warn(warning);\n      global.litIssuedWarnings!.add(warning);\n    }\n  };\n\n  issueWarning(\n    'dev-mode',\n    `Lit is in dev mode. Not recommended for production!`\n  );\n}\n\nconst wrap =\n  ENABLE_SHADYDOM_NOPATCH &&\n  global.ShadyDOM?.inUse &&\n  global.ShadyDOM?.noPatch === true\n    ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n    : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n  ? trustedTypes.createPolicy('lit-html', {\n      createHTML: (s) => s,\n    })\n  : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n *     is being written to. Note that this is just an exemplar node, the write\n *     may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n *     be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n  node: Node,\n  name: string,\n  type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n *     the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n *     unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n  _node: Node,\n  _name: string,\n  _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n  if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n    return;\n  }\n  if (sanitizerFactoryInternal !== noopSanitizer) {\n    throw new Error(\n      `Attempted to overwrite existing lit-html security policy.` +\n        ` setSanitizeDOMValueFactory should be called at most once.`\n    );\n  }\n  sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n  sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n  return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n  NODE_MODE && global.document === undefined\n    ? ({\n        createTreeWalker() {\n          return {};\n        },\n      } as unknown as Document)\n    : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n  value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n  isArray(value) ||\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n *   (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n *  * The name: any character except a whitespace character, (\"), ('), \">\",\n *    \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n *  * Followed by zero or more space characters\n *  * Followed by \"=\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n *    * (\") then any non-(\"), or\n *    * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n  `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n  'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n  // This property needs to remain unminified.\n  ['_$litType$']: T;\n  strings: TemplateStringsArray;\n  values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n  | UncompiledTemplateResult<T>\n  | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n  UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n  // This is a factory in order to make template initialization lazy\n  // and allow ShadyRenderOptions scope to be passed in.\n  // This property needs to remain unminified.\n  ['_$litType$']: CompiledTemplate;\n  values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n  // el is overridden to be optional. We initialize it on first render\n  el?: HTMLTemplateElement;\n\n  // The prepared HTML string to create a template element from.\n  // The type is a TemplateStringsArray to guarantee that the value came from\n  // source code, preventing a JSON injection attack.\n  h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n  <T extends ResultType>(type: T) =>\n  (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n    // Warn against templates octal escape sequences\n    // We do this here rather than in render so that the warning is closer to the\n    // template definition.\n    if (DEV_MODE && strings.some((s) => s === undefined)) {\n      console.warn(\n        'Some template strings are undefined.\\n' +\n          'This is probably caused by illegal octal escape sequences.'\n      );\n    }\n    if (DEV_MODE) {\n      // Import static-html.js results in a circular dependency which g3 doesn't\n      // handle. Instead we know that static values must have the field\n      // `_$litStatic$`.\n      if (\n        values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n      ) {\n        issueWarning(\n          '',\n          `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n            `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n        );\n      }\n    }\n    return {\n      // This property needs to remain unminified.\n      ['_$litType$']: type,\n      strings,\n      values,\n    };\n  };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n *   <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n *     ${rect}\n *   </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n *   <math>\n *     ${num}\n *   </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n *  user.isAdmin\n *    ? html`<button>DELETE</button>`\n *    : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n  /**\n   * An object to use as the `this` value for event listeners. It's often\n   * useful to set this to the host component rendering a template.\n   */\n  host?: object;\n  /**\n   * A DOM node before which to render content in the container.\n   */\n  renderBefore?: ChildNode | null;\n  /**\n   * Node used for cloning the template (`importNode` will be called on this\n   * node). This controls the `ownerDocument` of the rendered DOM, along with\n   * any inherited context. Defaults to the global `document`.\n   */\n  creationScope?: {importNode(node: Node, deep?: boolean): Node};\n  /**\n   * The initial connected state for the top-level part being rendered. If no\n   * `isConnected` option is set, `AsyncDirective`s will be connected by\n   * default. Set to `false` if the initial render occurs in a disconnected tree\n   * and `AsyncDirective`s should see `isConnected === false` for their initial\n   * render. The `part.setConnected()` method must be used subsequent to initial\n   * render to change the connected state of the part.\n   */\n  isConnected?: boolean;\n}\n\nconst walker = d.createTreeWalker(\n  d,\n  129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n  _$parent?: DirectiveParent;\n  _$isConnected: boolean;\n  __directive?: Directive;\n  __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n  tsa: TemplateStringsArray,\n  stringFromTSA: string\n): TrustedHTML {\n  // A security check to prevent spoofing of Lit template results.\n  // In the future, we may be able to replace this with Array.isTemplateObject,\n  // though we might need to make that check inside of the html and svg\n  // functions, because precompiled templates don't come in as\n  // TemplateStringArray objects.\n  if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n    let message = 'invalid template strings array';\n    if (DEV_MODE) {\n      message = `\n          Internal Error: expected template strings to be an array\n          with a 'raw' field. Faking a template strings array by\n          calling html or svg like an ordinary function is effectively\n          the same as calling unsafeHtml and can lead to major security\n          issues, e.g. opening your code up to XSS attacks.\n          If you're using the html or svg tagged template functions normally\n          and still seeing this error, please file a bug at\n          https://github.com/lit/lit/issues/new?template=bug_report.md\n          and include information about your build tooling, if any.\n        `\n        .trim()\n        .replace(/\\n */g, '\\n');\n    }\n    throw new Error(message);\n  }\n  return policy !== undefined\n    ? policy.createHTML(stringFromTSA)\n    : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n *     to avoid object fields since this code is shared with non-minified SSR\n *     code)\n */\nconst getTemplateHtml = (\n  strings: TemplateStringsArray,\n  type: ResultType\n): [TrustedHTML, Array<string>] => {\n  // Insert makers into the template HTML to represent the position of\n  // bindings. The following code scans the template strings to determine the\n  // syntactic position of the bindings. They can be in text position, where\n  // we insert an HTML comment, attribute value position, where we insert a\n  // sentinel string and re-write the attribute name, or inside a tag where\n  // we insert the sentinel string.\n  const l = strings.length - 1;\n  // Stores the case-sensitive bound attribute names in the order of their\n  // parts. ElementParts are also reflected in this array as undefined\n  // rather than a string, to disambiguate from attribute bindings.\n  const attrNames: Array<string> = [];\n  let html =\n    type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n  // When we're inside a raw text tag (not it's text content), the regex\n  // will still be tagRegex so we can find attributes, but will switch to\n  // this regex when the tag ends.\n  let rawTextEndRegex: RegExp | undefined;\n\n  // The current parsing state, represented as a reference to one of the\n  // regexes\n  let regex = textEndRegex;\n\n  for (let i = 0; i < l; i++) {\n    const s = strings[i];\n    // The index of the end of the last attribute name. When this is\n    // positive at end of a string, it means we're in an attribute value\n    // position and need to rewrite the attribute name.\n    // We also use a special value of -2 to indicate that we encountered\n    // the end of a string in attribute name position.\n    let attrNameEndIndex = -1;\n    let attrName: string | undefined;\n    let lastIndex = 0;\n    let match!: RegExpExecArray | null;\n\n    // The conditions in this loop handle the current parse state, and the\n    // assignments to the `regex` variable are the state transitions.\n    while (lastIndex < s.length) {\n      // Make sure we start searching from where we previously left off\n      regex.lastIndex = lastIndex;\n      match = regex.exec(s);\n      if (match === null) {\n        break;\n      }\n      lastIndex = regex.lastIndex;\n      if (regex === textEndRegex) {\n        if (match[COMMENT_START] === '!--') {\n          regex = commentEndRegex;\n        } else if (match[COMMENT_START] !== undefined) {\n          // We started a weird comment, like </{\n          regex = comment2EndRegex;\n        } else if (match[TAG_NAME] !== undefined) {\n          if (rawTextElement.test(match[TAG_NAME])) {\n            // Record if we encounter a raw-text element. We'll switch to\n            // this regex at the end of the tag.\n            rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n          }\n          regex = tagEndRegex;\n        } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n          if (DEV_MODE) {\n            throw new Error(\n              'Bindings in tag names are not supported. Please use static templates instead. ' +\n                'See https://lit.dev/docs/templates/expressions/#static-expressions'\n            );\n          }\n          regex = tagEndRegex;\n        }\n      } else if (regex === tagEndRegex) {\n        if (match[ENTIRE_MATCH] === '>') {\n          // End of a tag. If we had started a raw-text element, use that\n          // regex\n          regex = rawTextEndRegex ?? textEndRegex;\n          // We may be ending an unquoted attribute value, so make sure we\n          // clear any pending attrNameEndIndex\n          attrNameEndIndex = -1;\n        } else if (match[ATTRIBUTE_NAME] === undefined) {\n          // Attribute name position\n          attrNameEndIndex = -2;\n        } else {\n          attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n          attrName = match[ATTRIBUTE_NAME];\n          regex =\n            match[QUOTE_CHAR] === undefined\n              ? tagEndRegex\n              : match[QUOTE_CHAR] === '\"'\n                ? doubleQuoteAttrEndRegex\n                : singleQuoteAttrEndRegex;\n        }\n      } else if (\n        regex === doubleQuoteAttrEndRegex ||\n        regex === singleQuoteAttrEndRegex\n      ) {\n        regex = tagEndRegex;\n      } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n        regex = textEndRegex;\n      } else {\n        // Not one of the five state regexes, so it must be the dynamically\n        // created raw text regex and we're at the close of that element.\n        regex = tagEndRegex;\n        rawTextEndRegex = undefined;\n      }\n    }\n\n    if (DEV_MODE) {\n      // If we have a attrNameEndIndex, which indicates that we should\n      // rewrite the attribute name, assert that we're in a valid attribute\n      // position - either in a tag, or a quoted attribute value.\n      console.assert(\n        attrNameEndIndex === -1 ||\n          regex === tagEndRegex ||\n          regex === singleQuoteAttrEndRegex ||\n          regex === doubleQuoteAttrEndRegex,\n        'unexpected parse state B'\n      );\n    }\n\n    // We have four cases:\n    //  1. We're in text position, and not in a raw text element\n    //     (regex === textEndRegex): insert a comment marker.\n    //  2. We have a non-negative attrNameEndIndex which means we need to\n    //     rewrite the attribute name to add a bound attribute suffix.\n    //  3. We're at the non-first binding in a multi-binding attribute, use a\n    //     plain marker.\n    //  4. We're somewhere else inside the tag. If we're in attribute name\n    //     position (attrNameEndIndex === -2), add a sequential suffix to\n    //     generate a unique attribute name.\n\n    // Detect a binding next to self-closing tag end and insert a space to\n    // separate the marker from the tag end:\n    const end =\n      regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n    html +=\n      regex === textEndRegex\n        ? s + nodeMarker\n        : attrNameEndIndex >= 0\n          ? (attrNames.push(attrName!),\n            s.slice(0, attrNameEndIndex) +\n              boundAttributeSuffix +\n              s.slice(attrNameEndIndex)) +\n            marker +\n            end\n          : s + marker + (attrNameEndIndex === -2 ? i : end);\n  }\n\n  const htmlResult: string | TrustedHTML =\n    html +\n    (strings[l] || '<?>') +\n    (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n  // Returned as an array for terseness\n  return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n  /** @internal */\n  el!: HTMLTemplateElement;\n\n  parts: Array<TemplatePart> = [];\n\n  constructor(\n    // This property needs to remain unminified.\n    {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n    options?: RenderOptions\n  ) {\n    let node: Node | null;\n    let nodeIndex = 0;\n    let attrNameIndex = 0;\n    const partCount = strings.length - 1;\n    const parts = this.parts;\n\n    // Create template element\n    const [html, attrNames] = getTemplateHtml(strings, type);\n    this.el = Template.createElement(html, options);\n    walker.currentNode = this.el.content;\n\n    // Re-parent SVG or MathML nodes into template root\n    if (type === SVG_RESULT || type === MATHML_RESULT) {\n      const wrapper = this.el.content.firstChild!;\n      wrapper.replaceWith(...wrapper.childNodes);\n    }\n\n    // Walk the template to find binding markers and create TemplateParts\n    while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n      if (node.nodeType === 1) {\n        if (DEV_MODE) {\n          const tag = (node as Element).localName;\n          // Warn if `textarea` includes an expression and throw if `template`\n          // does since these are not supported. We do this by checking\n          // innerHTML for anything that looks like a marker. This catches\n          // cases like bindings in textarea there markers turn into text nodes.\n          if (\n            /^(?:textarea|template)$/i!.test(tag) &&\n            (node as Element).innerHTML.includes(marker)\n          ) {\n            const m =\n              `Expressions are not supported inside \\`${tag}\\` ` +\n              `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n              `information.`;\n            if (tag === 'template') {\n              throw new Error(m);\n            } else issueWarning('', m);\n          }\n        }\n        // TODO (justinfagnani): for attempted dynamic tag names, we don't\n        // increment the bindingIndex, and it'll be off by 1 in the element\n        // and off by two after it.\n        if ((node as Element).hasAttributes()) {\n          for (const name of (node as Element).getAttributeNames()) {\n            if (name.endsWith(boundAttributeSuffix)) {\n              const realName = attrNames[attrNameIndex++];\n              const value = (node as Element).getAttribute(name)!;\n              const statics = value.split(marker);\n              const m = /([.?@])?(.*)/.exec(realName)!;\n              parts.push({\n                type: ATTRIBUTE_PART,\n                index: nodeIndex,\n                name: m[2],\n                strings: statics,\n                ctor:\n                  m[1] === '.'\n                    ? PropertyPart\n                    : m[1] === '?'\n                      ? BooleanAttributePart\n                      : m[1] === '@'\n                        ? EventPart\n                        : AttributePart,\n              });\n              (node as Element).removeAttribute(name);\n            } else if (name.startsWith(marker)) {\n              parts.push({\n                type: ELEMENT_PART,\n                index: nodeIndex,\n              });\n              (node as Element).removeAttribute(name);\n            }\n          }\n        }\n        // TODO (justinfagnani): benchmark the regex against testing for each\n        // of the 3 raw text element names.\n        if (rawTextElement.test((node as Element).tagName)) {\n          // For raw text elements we need to split the text content on\n          // markers, create a Text node for each segment, and create\n          // a TemplatePart for each marker.\n          const strings = (node as Element).textContent!.split(marker);\n          const lastIndex = strings.length - 1;\n          if (lastIndex > 0) {\n            (node as Element).textContent = trustedTypes\n              ? (trustedTypes.emptyScript as unknown as '')\n              : '';\n            // Generate a new text node for each literal section\n            // These nodes are also used as the markers for node parts\n            // We can't use empty text nodes as markers because they're\n            // normalized when cloning in IE (could simplify when\n            // IE is no longer supported)\n            for (let i = 0; i < lastIndex; i++) {\n              (node as Element).append(strings[i], createMarker());\n              // Walk past the marker node we just added\n              walker.nextNode();\n              parts.push({type: CHILD_PART, index: ++nodeIndex});\n            }\n            // Note because this marker is added after the walker's current\n            // node, it will be walked to in the outer loop (and ignored), so\n            // we don't need to adjust nodeIndex here\n            (node as Element).append(strings[lastIndex], createMarker());\n          }\n        }\n      } else if (node.nodeType === 8) {\n        const data = (node as Comment).data;\n        if (data === markerMatch) {\n          parts.push({type: CHILD_PART, index: nodeIndex});\n        } else {\n          let i = -1;\n          while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n            // Comment node has a binding marker inside, make an inactive part\n            // The binding won't work, but subsequent bindings will\n            parts.push({type: COMMENT_PART, index: nodeIndex});\n            // Move to the end of the match\n            i += marker.length - 1;\n          }\n        }\n      }\n      nodeIndex++;\n    }\n\n    if (DEV_MODE) {\n      // If there was a duplicate attribute on a tag, then when the tag is\n      // parsed into an element the attribute gets de-duplicated. We can detect\n      // this mismatch if we haven't precisely consumed every attribute name\n      // when preparing the template. This works because `attrNames` is built\n      // from the template string and `attrNameIndex` comes from processing the\n      // resulting DOM.\n      if (attrNames.length !== attrNameIndex) {\n        throw new Error(\n          `Detected duplicate attribute bindings. This occurs if your template ` +\n            `has duplicate attributes on an element tag. For example ` +\n            `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n            `duplicate \"disabled\" attribute. The error was detected in ` +\n            `the following template: \\n` +\n            '`' +\n            strings.join('${...}') +\n            '`'\n        );\n      }\n    }\n\n    // We could set walker.currentNode to another node here to prevent a memory\n    // leak, but every time we prepare a template, we immediately render it\n    // and re-use the walker in new TemplateInstance._clone().\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'template prep',\n        template: this,\n        clonableTemplate: this.el,\n        parts: this.parts,\n        strings,\n      });\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @nocollapse */\n  static createElement(html: TrustedHTML, _options?: RenderOptions) {\n    const el = d.createElement('template');\n    el.innerHTML = html as unknown as string;\n    return el;\n  }\n}\n\nexport interface Disconnectable {\n  _$parent?: Disconnectable;\n  _$disconnectableChildren?: Set<Disconnectable>;\n  // Rather than hold connection state on instances, Disconnectables recursively\n  // fetch the connection state from the RootPart they are connected in via\n  // getters up the Disconnectable tree via _$parent references. This pushes the\n  // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n  // needing to pass all Disconnectables (parts, template instances, and\n  // directives) their connection state each time it changes, which would be\n  // costly for trees that have no AsyncDirectives.\n  _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n  part: ChildPart | AttributePart | ElementPart,\n  value: unknown,\n  parent: DirectiveParent = part,\n  attributeIndex?: number\n): unknown {\n  // Bail early if the value is explicitly noChange. Note, this means any\n  // nested directive is still attached and is not run.\n  if (value === noChange) {\n    return value;\n  }\n  let currentDirective =\n    attributeIndex !== undefined\n      ? (parent as AttributePart).__directives?.[attributeIndex]\n      : (parent as ChildPart | ElementPart | Directive).__directive;\n  const nextDirectiveConstructor = isPrimitive(value)\n    ? undefined\n    : // This property needs to remain unminified.\n      (value as DirectiveResult)['_$litDirective$'];\n  if (currentDirective?.constructor !== nextDirectiveConstructor) {\n    // This property needs to remain unminified.\n    currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n    if (nextDirectiveConstructor === undefined) {\n      currentDirective = undefined;\n    } else {\n      currentDirective = new nextDirectiveConstructor(part as PartInfo);\n      currentDirective._$initialize(part, parent, attributeIndex);\n    }\n    if (attributeIndex !== undefined) {\n      ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n        currentDirective;\n    } else {\n      (parent as ChildPart | Directive).__directive = currentDirective;\n    }\n  }\n  if (currentDirective !== undefined) {\n    value = resolveDirective(\n      part,\n      currentDirective._$resolve(part, (value as DirectiveResult).values),\n      currentDirective,\n      attributeIndex\n    );\n  }\n  return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n  _$template: Template;\n  _$parts: Array<Part | undefined> = [];\n\n  /** @internal */\n  _$parent: ChildPart;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  constructor(template: Template, parent: ChildPart) {\n    this._$template = template;\n    this._$parent = parent;\n  }\n\n  // Called by ChildPart parentNode getter\n  get parentNode() {\n    return this._$parent.parentNode;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  // This method is separate from the constructor because we need to return a\n  // DocumentFragment and we don't want to hold onto it with an instance field.\n  _clone(options: RenderOptions | undefined) {\n    const {\n      el: {content},\n      parts: parts,\n    } = this._$template;\n    const fragment = (options?.creationScope ?? d).importNode(content, true);\n    walker.currentNode = fragment;\n\n    let node = walker.nextNode()!;\n    let nodeIndex = 0;\n    let partIndex = 0;\n    let templatePart = parts[0];\n\n    while (templatePart !== undefined) {\n      if (nodeIndex === templatePart.index) {\n        let part: Part | undefined;\n        if (templatePart.type === CHILD_PART) {\n          part = new ChildPart(\n            node as HTMLElement,\n            node.nextSibling,\n            this,\n            options\n          );\n        } else if (templatePart.type === ATTRIBUTE_PART) {\n          part = new templatePart.ctor(\n            node as HTMLElement,\n            templatePart.name,\n            templatePart.strings,\n            this,\n            options\n          );\n        } else if (templatePart.type === ELEMENT_PART) {\n          part = new ElementPart(node as HTMLElement, this, options);\n        }\n        this._$parts.push(part);\n        templatePart = parts[++partIndex];\n      }\n      if (nodeIndex !== templatePart?.index) {\n        node = walker.nextNode()!;\n        nodeIndex++;\n      }\n    }\n    // We need to set the currentNode away from the cloned tree so that we\n    // don't hold onto the tree even if the tree is detached and should be\n    // freed.\n    walker.currentNode = d;\n    return fragment;\n  }\n\n  _update(values: Array<unknown>) {\n    let i = 0;\n    for (const part of this._$parts) {\n      if (part !== undefined) {\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'set part',\n            part,\n            value: values[i],\n            valueIndex: i,\n            values,\n            templateInstance: this,\n          });\n        if ((part as AttributePart).strings !== undefined) {\n          (part as AttributePart)._$setValue(values, part as AttributePart, i);\n          // The number of values the part consumes is part.strings.length - 1\n          // since values are in between template spans. We increment i by 1\n          // later in the loop, so increment it by part.strings.length - 2 here\n          i += (part as AttributePart).strings!.length - 2;\n        } else {\n          part._$setValue(values[i]);\n        }\n      }\n      i++;\n    }\n  }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n  readonly type: typeof ATTRIBUTE_PART;\n  readonly index: number;\n  readonly name: string;\n  readonly ctor: typeof AttributePart;\n  readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n  readonly type: typeof CHILD_PART;\n  readonly index: number;\n};\ntype ElementTemplatePart = {\n  readonly type: typeof ELEMENT_PART;\n  readonly index: number;\n};\ntype CommentTemplatePart = {\n  readonly type: typeof COMMENT_PART;\n  readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n  | ChildTemplatePart\n  | AttributeTemplatePart\n  | ElementTemplatePart\n  | CommentTemplatePart;\n\nexport type Part =\n  | ChildPart\n  | AttributePart\n  | PropertyPart\n  | BooleanAttributePart\n  | ElementPart\n  | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n  readonly type = CHILD_PART;\n  readonly options: RenderOptions | undefined;\n  _$committedValue: unknown = nothing;\n  /** @internal */\n  __directive?: Directive;\n  /** @internal */\n  _$startNode: ChildNode;\n  /** @internal */\n  _$endNode: ChildNode | null;\n  private _textSanitizer: ValueSanitizer | undefined;\n  /** @internal */\n  _$parent: Disconnectable | undefined;\n  /**\n   * Connection state for RootParts only (i.e. ChildPart without _$parent\n   * returned from top-level `render`). This field is unused otherwise. The\n   * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n   * with this field (and a different _$isConnected getter), but the subclass\n   * caused a perf regression, possibly due to making call sites polymorphic.\n   * @internal\n   */\n  __isConnected: boolean;\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    // ChildParts that are not at the root should always be created with a\n    // parent; only RootChildNode's won't, so they return the local isConnected\n    // state\n    return this._$parent?._$isConnected ?? this.__isConnected;\n  }\n\n  // The following fields will be patched onto ChildParts when required by\n  // AsyncDirective\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n  /** @internal */\n  _$notifyConnectionChanged?(\n    isConnected: boolean,\n    removeFromParent?: boolean,\n    from?: number\n  ): void;\n  /** @internal */\n  _$reparentDisconnectables?(parent: Disconnectable): void;\n\n  constructor(\n    startNode: ChildNode,\n    endNode: ChildNode | null,\n    parent: TemplateInstance | ChildPart | undefined,\n    options: RenderOptions | undefined\n  ) {\n    this._$startNode = startNode;\n    this._$endNode = endNode;\n    this._$parent = parent;\n    this.options = options;\n    // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n    // no _$parent); the value on a non-root-part is \"don't care\", but checking\n    // for parent would be more code\n    this.__isConnected = options?.isConnected ?? true;\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      // Explicitly initialize for consistent class shape.\n      this._textSanitizer = undefined;\n    }\n  }\n\n  /**\n   * The parent node into which the part renders its content.\n   *\n   * A ChildPart's content consists of a range of adjacent child nodes of\n   * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n   * `.endNode`).\n   *\n   * - If both `.startNode` and `.endNode` are non-null, then the part's content\n   * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n   *\n   * - If `.startNode` is non-null but `.endNode` is null, then the part's\n   * content consists of all siblings following `.startNode`, up to and\n   * including the last child of `.parentNode`. If `.endNode` is non-null, then\n   * `.startNode` will always be non-null.\n   *\n   * - If both `.endNode` and `.startNode` are null, then the part's content\n   * consists of all child nodes of `.parentNode`.\n   */\n  get parentNode(): Node {\n    let parentNode: Node = wrap(this._$startNode).parentNode!;\n    const parent = this._$parent;\n    if (\n      parent !== undefined &&\n      parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n    ) {\n      // If the parentNode is a DocumentFragment, it may be because the DOM is\n      // still in the cloned fragment during initial render; if so, get the real\n      // parentNode the part will be committed into by asking the parent.\n      parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n    }\n    return parentNode;\n  }\n\n  /**\n   * The part's leading marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get startNode(): Node | null {\n    return this._$startNode;\n  }\n\n  /**\n   * The part's trailing marker node, if any. See `.parentNode` for more\n   * information.\n   */\n  get endNode(): Node | null {\n    return this._$endNode;\n  }\n\n  _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n    if (DEV_MODE && this.parentNode === null) {\n      throw new Error(\n        `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n      );\n    }\n    value = resolveDirective(this, value, directiveParent);\n    if (isPrimitive(value)) {\n      // Non-rendering child values. It's important that these do not render\n      // empty text nodes to avoid issues with preventing default <slot>\n      // fallback content.\n      if (value === nothing || value == null || value === '') {\n        if (this._$committedValue !== nothing) {\n          debugLogEvent &&\n            debugLogEvent({\n              kind: 'commit nothing to child',\n              start: this._$startNode,\n              end: this._$endNode,\n              parent: this._$parent,\n              options: this.options,\n            });\n          this._$clear();\n        }\n        this._$committedValue = nothing;\n      } else if (value !== this._$committedValue && value !== noChange) {\n        this._commitText(value);\n      }\n      // This property needs to remain unminified.\n    } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n      this._commitTemplateResult(value as TemplateResult);\n    } else if ((value as Node).nodeType !== undefined) {\n      if (DEV_MODE && this.options?.host === value) {\n        this._commitText(\n          `[probable mistake: rendered a template's host in itself ` +\n            `(commonly caused by writing \\${this} in a template]`\n        );\n        console.warn(\n          `Attempted to render the template host`,\n          value,\n          `inside itself. This is almost always a mistake, and in dev mode `,\n          `we render some warning text. In production however, we'll `,\n          `render it, which will usually result in an error, and sometimes `,\n          `in the element disappearing from the DOM.`\n        );\n        return;\n      }\n      this._commitNode(value as Node);\n    } else if (isIterable(value)) {\n      this._commitIterable(value);\n    } else {\n      // Fallback, will render the string representation\n      this._commitText(value);\n    }\n  }\n\n  private _insert<T extends Node>(node: T) {\n    return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n      node,\n      this._$endNode\n    );\n  }\n\n  private _commitNode(value: Node): void {\n    if (this._$committedValue !== value) {\n      this._$clear();\n      if (\n        ENABLE_EXTRA_SECURITY_HOOKS &&\n        sanitizerFactoryInternal !== noopSanitizer\n      ) {\n        const parentNodeName = this._$startNode.parentNode?.nodeName;\n        if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n          let message = 'Forbidden';\n          if (DEV_MODE) {\n            if (parentNodeName === 'STYLE') {\n              message =\n                `Lit does not support binding inside style nodes. ` +\n                `This is a security risk, as style injection attacks can ` +\n                `exfiltrate data and spoof UIs. ` +\n                `Consider instead using css\\`...\\` literals ` +\n                `to compose styles, and do dynamic styling with ` +\n                `css custom properties, ::parts, <slot>s, ` +\n                `and by mutating the DOM rather than stylesheets.`;\n            } else {\n              message =\n                `Lit does not support binding inside script nodes. ` +\n                `This is a security risk, as it could allow arbitrary ` +\n                `code execution.`;\n            }\n          }\n          throw new Error(message);\n        }\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit node',\n          start: this._$startNode,\n          parent: this._$parent,\n          value: value,\n          options: this.options,\n        });\n      this._$committedValue = this._insert(value);\n    }\n  }\n\n  private _commitText(value: unknown): void {\n    // If the committed value is a primitive it means we called _commitText on\n    // the previous render, and we know that this._$startNode.nextSibling is a\n    // Text node. We can now just replace the text content (.data) of the node.\n    if (\n      this._$committedValue !== nothing &&\n      isPrimitive(this._$committedValue)\n    ) {\n      const node = wrap(this._$startNode).nextSibling as Text;\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(node, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit text',\n          node,\n          value,\n          options: this.options,\n        });\n      (node as Text).data = value as string;\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        const textNode = d.createTextNode('');\n        this._commitNode(textNode);\n        // When setting text content, for security purposes it matters a lot\n        // what the parent is. For example, <style> and <script> need to be\n        // handled with care, while <span> does not. So first we need to put a\n        // text node into the document, then we can sanitize its content.\n        if (this._textSanitizer === undefined) {\n          this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n        }\n        value = this._textSanitizer(value);\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: textNode,\n            value,\n            options: this.options,\n          });\n        textNode.data = value as string;\n      } else {\n        this._commitNode(d.createTextNode(value as string));\n        debugLogEvent &&\n          debugLogEvent({\n            kind: 'commit text',\n            node: wrap(this._$startNode).nextSibling as Text,\n            value,\n            options: this.options,\n          });\n      }\n    }\n    this._$committedValue = value;\n  }\n\n  private _commitTemplateResult(\n    result: TemplateResult | CompiledTemplateResult\n  ): void {\n    // This property needs to remain unminified.\n    const {values, ['_$litType$']: type} = result;\n    // If $litType$ is a number, result is a plain TemplateResult and we get\n    // the template from the template cache. If not, result is a\n    // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n    // to create the <template> element the first time we see it.\n    const template: Template | CompiledTemplate =\n      typeof type === 'number'\n        ? this._$getTemplate(result as UncompiledTemplateResult)\n        : (type.el === undefined &&\n            (type.el = Template.createElement(\n              trustFromTemplateString(type.h, type.h[0]),\n              this.options\n            )),\n          type);\n\n    if ((this._$committedValue as TemplateInstance)?._$template === template) {\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template updating',\n          template,\n          instance: this._$committedValue as TemplateInstance,\n          parts: (this._$committedValue as TemplateInstance)._$parts,\n          options: this.options,\n          values,\n        });\n      (this._$committedValue as TemplateInstance)._update(values);\n    } else {\n      const instance = new TemplateInstance(template as Template, this);\n      const fragment = instance._clone(this.options);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      instance._update(values);\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'template instantiated and updated',\n          template,\n          instance,\n          parts: instance._$parts,\n          options: this.options,\n          fragment,\n          values,\n        });\n      this._commitNode(fragment);\n      this._$committedValue = instance;\n    }\n  }\n\n  // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n  /** @internal */\n  _$getTemplate(result: UncompiledTemplateResult) {\n    let template = templateCache.get(result.strings);\n    if (template === undefined) {\n      templateCache.set(result.strings, (template = new Template(result)));\n    }\n    return template;\n  }\n\n  private _commitIterable(value: Iterable<unknown>): void {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n    // If value is an array, then the previous render was of an\n    // iterable and value will contain the ChildParts from the previous\n    // render. If value is not an array, clear this part and make a new\n    // array for ChildParts.\n    if (!isArray(this._$committedValue)) {\n      this._$committedValue = [];\n      this._$clear();\n    }\n\n    // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this._$committedValue as ChildPart[];\n    let partIndex = 0;\n    let itemPart: ChildPart | undefined;\n\n    for (const item of value) {\n      if (partIndex === itemParts.length) {\n        // If no existing part, create a new one\n        // TODO (justinfagnani): test perf impact of always creating two parts\n        // instead of sharing parts between nodes\n        // https://github.com/lit/lit/issues/1266\n        itemParts.push(\n          (itemPart = new ChildPart(\n            this._insert(createMarker()),\n            this._insert(createMarker()),\n            this,\n            this.options\n          ))\n        );\n      } else {\n        // Reuse an existing part\n        itemPart = itemParts[partIndex];\n      }\n      itemPart._$setValue(item);\n      partIndex++;\n    }\n\n    if (partIndex < itemParts.length) {\n      // itemParts always have end nodes\n      this._$clear(\n        itemPart && wrap(itemPart._$endNode!).nextSibling,\n        partIndex\n      );\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n    }\n  }\n\n  /**\n   * Removes the nodes contained within this Part from the DOM.\n   *\n   * @param start Start node to clear from, for clearing a subset of the part's\n   *     DOM (used when truncating iterables)\n   * @param from  When `start` is specified, the index within the iterable from\n   *     which ChildParts are being removed, used for disconnecting directives in\n   *     those Parts.\n   *\n   * @internal\n   */\n  _$clear(\n    start: ChildNode | null = wrap(this._$startNode).nextSibling,\n    from?: number\n  ) {\n    this._$notifyConnectionChanged?.(false, true, from);\n    while (start && start !== this._$endNode) {\n      const n = wrap(start!).nextSibling;\n      (wrap(start!) as Element).remove();\n      start = n;\n    }\n  }\n  /**\n   * Implementation of RootPart's `isConnected`. Note that this method\n   * should only be called on `RootPart`s (the `ChildPart` returned from a\n   * top-level `render()` call). It has no effect on non-root ChildParts.\n   * @param isConnected Whether to set\n   * @internal\n   */\n  setConnected(isConnected: boolean) {\n    if (this._$parent === undefined) {\n      this.__isConnected = isConnected;\n      this._$notifyConnectionChanged?.(isConnected);\n    } else if (DEV_MODE) {\n      throw new Error(\n        'part.setConnected() may only be called on a ' +\n          'RootPart returned from render().'\n      );\n    }\n  }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n  /**\n   * Sets the connection state for `AsyncDirective`s contained within this root\n   * ChildPart.\n   *\n   * lit-html does not automatically monitor the connectedness of DOM rendered;\n   * as such, it is the responsibility of the caller to `render` to ensure that\n   * `part.setConnected(false)` is called before the part object is potentially\n   * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n   * any resources being held. If a `RootPart` that was previously\n   * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n   * re-connect), `setConnected(true)` should be called.\n   *\n   * @param isConnected Whether directives within this tree should be connected\n   * or not\n   */\n  setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n  readonly type:\n    | typeof ATTRIBUTE_PART\n    | typeof PROPERTY_PART\n    | typeof BOOLEAN_ATTRIBUTE_PART\n    | typeof EVENT_PART = ATTRIBUTE_PART;\n  readonly element: HTMLElement;\n  readonly name: string;\n  readonly options: RenderOptions | undefined;\n\n  /**\n   * If this attribute part represents an interpolation, this contains the\n   * static strings of the interpolation. For single-value, complete bindings,\n   * this is undefined.\n   */\n  readonly strings?: ReadonlyArray<string>;\n  /** @internal */\n  _$committedValue: unknown | Array<unknown> = nothing;\n  /** @internal */\n  __directives?: Array<Directive | undefined>;\n  /** @internal */\n  _$parent: Disconnectable;\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  protected _sanitizer: ValueSanitizer | undefined;\n\n  get tagName() {\n    return this.element.tagName;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this.element = element;\n    this.name = name;\n    this._$parent = parent;\n    this.options = options;\n    if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n      this._$committedValue = new Array(strings.length - 1).fill(new String());\n      this.strings = strings;\n    } else {\n      this._$committedValue = nothing;\n    }\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      this._sanitizer = undefined;\n    }\n  }\n\n  /**\n   * Sets the value of this part by resolving the value from possibly multiple\n   * values and static strings and committing it to the DOM.\n   * If this part is single-valued, `this._strings` will be undefined, and the\n   * method will be called with a single value argument. If this part is\n   * multi-value, `this._strings` will be defined, and the method is called\n   * with the value array of the part's owning TemplateInstance, and an offset\n   * into the value array from which the values should be read.\n   * This method is overloaded this way to eliminate short-lived array slices\n   * of the template instance values, and allow a fast-path for single-valued\n   * parts.\n   *\n   * @param value The part value, or an array of values for multi-valued parts\n   * @param valueIndex the index to start reading values from. `undefined` for\n   *   single-valued parts\n   * @param noCommit causes the part to not commit its value to the DOM. Used\n   *   in hydration to prime attribute parts with their first-rendered value,\n   *   but not set the attribute, and in SSR to no-op the DOM operation and\n   *   capture the value for serialization.\n   *\n   * @internal\n   */\n  _$setValue(\n    value: unknown | Array<unknown>,\n    directiveParent: DirectiveParent = this,\n    valueIndex?: number,\n    noCommit?: boolean\n  ) {\n    const strings = this.strings;\n\n    // Whether any of the values has changed, for dirty-checking\n    let change = false;\n\n    if (strings === undefined) {\n      // Single-value binding case\n      value = resolveDirective(this, value, directiveParent, 0);\n      change =\n        !isPrimitive(value) ||\n        (value !== this._$committedValue && value !== noChange);\n      if (change) {\n        this._$committedValue = value;\n      }\n    } else {\n      // Interpolation case\n      const values = value as Array<unknown>;\n      value = strings[0];\n\n      let i, v;\n      for (i = 0; i < strings.length - 1; i++) {\n        v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n        if (v === noChange) {\n          // If the user-provided value is `noChange`, use the previous value\n          v = (this._$committedValue as Array<unknown>)[i];\n        }\n        change ||=\n          !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n        if (v === nothing) {\n          value = nothing;\n        } else if (value !== nothing) {\n          value += (v ?? '') + strings[i + 1];\n        }\n        // We always record each value, even if one is `nothing`, for future\n        // change detection.\n        (this._$committedValue as Array<unknown>)[i] = v;\n      }\n    }\n    if (change && !noCommit) {\n      this._commitValue(value);\n    }\n  }\n\n  /** @internal */\n  _commitValue(value: unknown) {\n    if (value === nothing) {\n      (wrap(this.element) as Element).removeAttribute(this.name);\n    } else {\n      if (ENABLE_EXTRA_SECURITY_HOOKS) {\n        if (this._sanitizer === undefined) {\n          this._sanitizer = sanitizerFactoryInternal(\n            this.element,\n            this.name,\n            'attribute'\n          );\n        }\n        value = this._sanitizer(value ?? '');\n      }\n      debugLogEvent &&\n        debugLogEvent({\n          kind: 'commit attribute',\n          element: this.element,\n          name: this.name,\n          value,\n          options: this.options,\n        });\n      (wrap(this.element) as Element).setAttribute(\n        this.name,\n        (value ?? '') as string\n      );\n    }\n  }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n  override readonly type = PROPERTY_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    if (ENABLE_EXTRA_SECURITY_HOOKS) {\n      if (this._sanitizer === undefined) {\n        this._sanitizer = sanitizerFactoryInternal(\n          this.element,\n          this.name,\n          'property'\n        );\n      }\n      value = this._sanitizer(value);\n    }\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit property',\n        element: this.element,\n        name: this.name,\n        value,\n        options: this.options,\n      });\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (this.element as any)[this.name] = value === nothing ? undefined : value;\n  }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n  override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n  /** @internal */\n  override _commitValue(value: unknown) {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit boolean attribute',\n        element: this.element,\n        name: this.name,\n        value: !!(value && value !== nothing),\n        options: this.options,\n      });\n    (wrap(this.element) as Element).toggleAttribute(\n      this.name,\n      !!value && value !== nothing\n    );\n  }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n  Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n  override readonly type = EVENT_PART;\n\n  constructor(\n    element: HTMLElement,\n    name: string,\n    strings: ReadonlyArray<string>,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    super(element, name, strings, parent, options);\n\n    if (DEV_MODE && this.strings !== undefined) {\n      throw new Error(\n        `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n          'invalid content. Event listeners in templates must have exactly ' +\n          'one expression and no surrounding text.'\n      );\n    }\n  }\n\n  // EventPart does not use the base _$setValue/_resolveValue implementation\n  // since the dirty checking is more complex\n  /** @internal */\n  override _$setValue(\n    newListener: unknown,\n    directiveParent: DirectiveParent = this\n  ) {\n    newListener =\n      resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n    if (newListener === noChange) {\n      return;\n    }\n    const oldListener = this._$committedValue;\n\n    // If the new value is nothing or any options change we have to remove the\n    // part as a listener.\n    const shouldRemoveListener =\n      (newListener === nothing && oldListener !== nothing) ||\n      (newListener as EventListenerWithOptions).capture !==\n        (oldListener as EventListenerWithOptions).capture ||\n      (newListener as EventListenerWithOptions).once !==\n        (oldListener as EventListenerWithOptions).once ||\n      (newListener as EventListenerWithOptions).passive !==\n        (oldListener as EventListenerWithOptions).passive;\n\n    // If the new value is not nothing and we removed the listener, we have\n    // to add the part as a listener.\n    const shouldAddListener =\n      newListener !== nothing &&\n      (oldListener === nothing || shouldRemoveListener);\n\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit event listener',\n        element: this.element,\n        name: this.name,\n        value: newListener,\n        options: this.options,\n        removeListener: shouldRemoveListener,\n        addListener: shouldAddListener,\n        oldListener,\n      });\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n        this.name,\n        this,\n        oldListener as EventListenerWithOptions\n      );\n    }\n    if (shouldAddListener) {\n      // Beware: IE11 and Chrome 41 don't like using the listener as the\n      // options object. Figure out how to deal w/ this in IE11 - maybe\n      // patch addEventListener?\n      this.element.addEventListener(\n        this.name,\n        this,\n        newListener as EventListenerWithOptions\n      );\n    }\n    this._$committedValue = newListener;\n  }\n\n  handleEvent(event: Event) {\n    if (typeof this._$committedValue === 'function') {\n      this._$committedValue.call(this.options?.host ?? this.element, event);\n    } else {\n      (this._$committedValue as EventListenerObject).handleEvent(event);\n    }\n  }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n  readonly type = ELEMENT_PART;\n\n  /** @internal */\n  __directive?: Directive;\n\n  // This is to ensure that every Part has a _$committedValue\n  _$committedValue: undefined;\n\n  /** @internal */\n  _$parent!: Disconnectable;\n\n  /** @internal */\n  _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n  options: RenderOptions | undefined;\n\n  constructor(\n    public element: Element,\n    parent: Disconnectable,\n    options: RenderOptions | undefined\n  ) {\n    this._$parent = parent;\n    this.options = options;\n  }\n\n  // See comment in Disconnectable interface for why this is a getter\n  get _$isConnected() {\n    return this._$parent._$isConnected;\n  }\n\n  _$setValue(value: unknown): void {\n    debugLogEvent &&\n      debugLogEvent({\n        kind: 'commit to element binding',\n        element: this.element,\n        value,\n        options: this.options,\n      });\n    resolveDirective(this, value);\n  }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n  // Used in lit-ssr\n  _boundAttributeSuffix: boundAttributeSuffix,\n  _marker: marker,\n  _markerMatch: markerMatch,\n  _HTML_RESULT: HTML_RESULT,\n  _getTemplateHtml: getTemplateHtml,\n  // Used in tests and private-ssr-support\n  _TemplateInstance: TemplateInstance,\n  _isIterable: isIterable,\n  _resolveDirective: resolveDirective,\n  _ChildPart: ChildPart,\n  _AttributePart: AttributePart,\n  _BooleanAttributePart: BooleanAttributePart,\n  _EventPart: EventPart,\n  _PropertyPart: PropertyPart,\n  _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n  ? global.litHtmlPolyfillSupportDevMode\n  : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.2.1');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n  issueWarning!(\n    'multiple-versions',\n    `Multiple versions of Lit loaded. ` +\n      `Loading multiple versions is not recommended.`\n  );\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n *   value](https://lit.dev/docs/templates/expressions/#child-expressions),\n *   typically a {@linkcode TemplateResult} created by evaluating a template tag\n *   like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n *   the rendered value to the container, and subsequent renders will\n *   efficiently update the rendered value if the same result type was\n *   previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n  value: unknown,\n  container: HTMLElement | DocumentFragment,\n  options?: RenderOptions\n): RootPart => {\n  if (DEV_MODE && container == null) {\n    // Give a clearer error message than\n    //     Uncaught TypeError: Cannot read properties of null (reading\n    //     '_$litPart$')\n    // which reads like an internal Lit error.\n    throw new TypeError(`The container to render into may not be ${container}`);\n  }\n  const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n  const partOwnerNode = options?.renderBefore ?? container;\n  // This property needs to remain unminified.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'begin render',\n      id: renderId,\n      value,\n      container,\n      options,\n      part,\n    });\n  if (part === undefined) {\n    const endNode = options?.renderBefore ?? null;\n    // This property needs to remain unminified.\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n      container.insertBefore(createMarker(), endNode),\n      endNode,\n      undefined,\n      options ?? {}\n    );\n  }\n  part._$setValue(value);\n  debugLogEvent &&\n    debugLogEvent({\n      kind: 'end render',\n      id: renderId,\n      value,\n      container,\n      options,\n      part,\n    });\n  return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n  render.setSanitizer = setSanitizer;\n  render.createSanitizer = createSanitizer;\n  if (DEV_MODE) {\n    render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n      _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// Any new exports need to be added to the export statement in\n// `packages/lit/src/index.all.ts`.\n\nimport {\n  html as coreHtml,\n  svg as coreSvg,\n  mathml as coreMathml,\n  TemplateResult,\n} from './lit-html.js';\n\nexport interface StaticValue {\n  /** The value to interpolate as-is into the template. */\n  _$litStatic$: string;\n\n  /**\n   * A value that can't be decoded from ordinary JSON, make it harder for\n   * an attacker-controlled data that goes through JSON.parse to produce a valid\n   * StaticValue.\n   */\n  r: typeof brand;\n}\n\n/**\n * Prevents JSON injection attacks.\n *\n * The goals of this brand:\n *   1) fast to check\n *   2) code is small on the wire\n *   3) multiple versions of Lit in a single page will all produce mutually\n *      interoperable StaticValues\n *   4) normal JSON.parse (without an unusual reviver) can not produce a\n *      StaticValue\n *\n * Symbols satisfy (1), (2), and (4). We use Symbol.for to satisfy (3), but\n * we don't care about the key, so we break ties via (2) and use the empty\n * string.\n */\nconst brand = Symbol.for('');\n\n/** Safely extracts the string part of a StaticValue. */\nconst unwrapStaticValue = (value: unknown): string | undefined => {\n  if ((value as Partial<StaticValue>)?.r !== brand) {\n    return undefined;\n  }\n  return (value as Partial<StaticValue>)?.['_$litStatic$'];\n};\n\n/**\n * Wraps a string so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Note that this function is unsafe to use on untrusted content, as it will be\n * directly parsed into HTML. Do not pass user input to this function\n * without sanitizing it.\n *\n * Static values can be changed, but they will cause a complete re-render\n * since they effectively create a new template.\n */\nexport const unsafeStatic = (value: string): StaticValue => ({\n  ['_$litStatic$']: value,\n  r: brand,\n});\n\nconst textFromStatic = (value: StaticValue) => {\n  if (value['_$litStatic$'] !== undefined) {\n    return value['_$litStatic$'];\n  } else {\n    throw new Error(\n      `Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but\n            take care to ensure page security.`\n    );\n  }\n};\n\n/**\n * Tags a string literal so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * The only values that may be used in template expressions are other tagged\n * `literal` results or `unsafeStatic` values (note that untrusted content\n * should never be passed to `unsafeStatic`).\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Static values can be changed, but they will cause a complete re-render since\n * they effectively create a new template.\n */\nexport const literal = (\n  strings: TemplateStringsArray,\n  ...values: unknown[]\n): StaticValue => ({\n  ['_$litStatic$']: values.reduce(\n    (acc, v, idx) => acc + textFromStatic(v as StaticValue) + strings[idx + 1],\n    strings[0]\n  ) as string,\n  r: brand,\n});\n\nconst stringsCache = new Map<string, TemplateStringsArray>();\n\n/**\n * Wraps a lit-html template tag (`html` or `svg`) to add static value support.\n */\nexport const withStatic =\n  (coreTag: typeof coreHtml | typeof coreSvg | typeof coreMathml) =>\n  (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult => {\n    const l = values.length;\n    let staticValue: string | undefined;\n    let dynamicValue: unknown;\n    const staticStrings: Array<string> = [];\n    const dynamicValues: Array<unknown> = [];\n    let i = 0;\n    let hasStatics = false;\n    let s: string;\n\n    while (i < l) {\n      s = strings[i];\n      // Collect any unsafeStatic values, and their following template strings\n      // so that we treat a run of template strings and unsafe static values as\n      // a single template string.\n      while (\n        i < l &&\n        ((dynamicValue = values[i]),\n        (staticValue = unwrapStaticValue(dynamicValue))) !== undefined\n      ) {\n        s += staticValue + strings[++i];\n        hasStatics = true;\n      }\n      // If the last value is static, we don't need to push it.\n      if (i !== l) {\n        dynamicValues.push(dynamicValue);\n      }\n      staticStrings.push(s);\n      i++;\n    }\n    // If the last value isn't static (which would have consumed the last\n    // string), then we need to add the last string.\n    if (i === l) {\n      staticStrings.push(strings[l]);\n    }\n\n    if (hasStatics) {\n      const key = staticStrings.join('$$lit$$');\n      strings = stringsCache.get(key)!;\n      if (strings === undefined) {\n        // Beware: in general this pattern is unsafe, and doing so may bypass\n        // lit's security checks and allow an attacker to execute arbitrary\n        // code and inject arbitrary content.\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        (staticStrings as any).raw = staticStrings;\n        stringsCache.set(\n          key,\n          (strings = staticStrings as unknown as TemplateStringsArray)\n        );\n      }\n      values = dynamicValues;\n    }\n    return coreTag(strings, ...values);\n  };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const html = withStatic(coreHtml);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const svg = withStatic(coreSvg);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const mathml = withStatic(coreMathml);\n","\nconst SHIFT_LEFT_32 = (1 << 16) * (1 << 16);\nconst SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;\n\n// Threshold chosen based on both benchmarking and knowledge about browser string\n// data structures (which currently switch structure types at 12 bytes or more)\nconst TEXT_DECODER_MIN_LENGTH = 12;\nconst utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8');\n\nconst PBF_VARINT  = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nconst PBF_FIXED64 = 1; // 64-bit: double, fixed64, sfixed64\nconst PBF_BYTES   = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nconst PBF_FIXED32 = 5; // 32-bit: float, fixed32, sfixed32\n\nexport default class Pbf {\n    /**\n     * @param {Uint8Array | ArrayBuffer} [buf]\n     */\n    constructor(buf = new Uint8Array(16)) {\n        this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);\n        this.dataView = new DataView(this.buf.buffer);\n        this.pos = 0;\n        this.type = 0;\n        this.length = this.buf.length;\n    }\n\n    // === READING =================================================================\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     * @param {number} [end]\n     */\n    readFields(readField, result, end = this.length) {\n        while (this.pos < end) {\n            const val = this.readVarint(),\n                tag = val >> 3,\n                startPos = this.pos;\n\n            this.type = val & 0x7;\n            readField(tag, result, this);\n\n            if (this.pos === startPos) this.skip(val);\n        }\n        return result;\n    }\n\n    /**\n     * @template T\n     * @param {(tag: number, result: T, pbf: Pbf) => void} readField\n     * @param {T} result\n     */\n    readMessage(readField, result) {\n        return this.readFields(readField, result, this.readVarint() + this.pos);\n    }\n\n    readFixed32() {\n        const val = this.dataView.getUint32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readSFixed32() {\n        const val = this.dataView.getInt32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)\n\n    readFixed64() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getUint32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readSFixed64() {\n        const val = this.dataView.getUint32(this.pos, true) + this.dataView.getInt32(this.pos + 4, true) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    }\n\n    readFloat() {\n        const val = this.dataView.getFloat32(this.pos, true);\n        this.pos += 4;\n        return val;\n    }\n\n    readDouble() {\n        const val = this.dataView.getFloat64(this.pos, true);\n        this.pos += 8;\n        return val;\n    }\n\n    /**\n     * @param {boolean} [isSigned]\n     */\n    readVarint(isSigned) {\n        const buf = this.buf;\n        let val, b;\n\n        b = buf[this.pos++]; val  =  b & 0x7f;        if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 7;  if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;\n        b = buf[this.pos];   val |= (b & 0x0f) << 28;\n\n        return readVarintRemainder(val, isSigned, this);\n    }\n\n    readVarint64() { // for compatibility with v2.0.1\n        return this.readVarint(true);\n    }\n\n    readSVarint() {\n        const num = this.readVarint();\n        return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n    }\n\n    readBoolean() {\n        return Boolean(this.readVarint());\n    }\n\n    readString() {\n        const end = this.readVarint() + this.pos;\n        const pos = this.pos;\n        this.pos = end;\n\n        if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {\n            // longer strings are fast with the built-in browser TextDecoder API\n            return utf8TextDecoder.decode(this.buf.subarray(pos, end));\n        }\n        // short strings are fast with our custom implementation\n        return readUtf8(this.buf, pos, end);\n    }\n\n    readBytes() {\n        const end = this.readVarint() + this.pos,\n            buffer = this.buf.subarray(this.pos, end);\n        this.pos = end;\n        return buffer;\n    }\n\n    // verbose for performance reasons; doesn't affect gzipped size\n\n    /**\n     * @param {number[]} [arr]\n     * @param {boolean} [isSigned]\n     */\n    readPackedVarint(arr = [], isSigned) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readVarint(isSigned));\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSVarint(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSVarint());\n        return arr;\n    }\n    /** @param {boolean[]} [arr] */\n    readPackedBoolean(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readBoolean());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFloat(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFloat());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedDouble(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readDouble());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed32(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed32());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readFixed64());\n        return arr;\n    }\n    /** @param {number[]} [arr] */\n    readPackedSFixed64(arr = []) {\n        const end = this.readPackedEnd();\n        while (this.pos < end) arr.push(this.readSFixed64());\n        return arr;\n    }\n    readPackedEnd() {\n        return this.type === PBF_BYTES ? this.readVarint() + this.pos : this.pos + 1;\n    }\n\n    /** @param {number} val */\n    skip(val) {\n        const type = val & 0x7;\n        if (type === PBF_VARINT) while (this.buf[this.pos++] > 0x7f) {}\n        else if (type === PBF_BYTES) this.pos = this.readVarint() + this.pos;\n        else if (type === PBF_FIXED32) this.pos += 4;\n        else if (type === PBF_FIXED64) this.pos += 8;\n        else throw new Error(`Unimplemented type: ${type}`);\n    }\n\n    // === WRITING =================================================================\n\n    /**\n     * @param {number} tag\n     * @param {number} type\n     */\n    writeTag(tag, type) {\n        this.writeVarint((tag << 3) | type);\n    }\n\n    /** @param {number} min */\n    realloc(min) {\n        let length = this.length || 16;\n\n        while (length < this.pos + min) length *= 2;\n\n        if (length !== this.length) {\n            const buf = new Uint8Array(length);\n            buf.set(this.buf);\n            this.buf = buf;\n            this.dataView = new DataView(buf.buffer);\n            this.length = length;\n        }\n    }\n\n    finish() {\n        this.length = this.pos;\n        this.pos = 0;\n        return this.buf.subarray(0, this.length);\n    }\n\n    /** @param {number} val */\n    writeFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeSFixed32(val) {\n        this.realloc(4);\n        this.dataView.setInt32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeSFixed64(val) {\n        this.realloc(8);\n        this.dataView.setInt32(this.pos, val & -1, true);\n        this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);\n        this.pos += 8;\n    }\n\n    /** @param {number} val */\n    writeVarint(val) {\n        val = +val || 0;\n\n        if (val > 0xfffffff || val < 0) {\n            writeBigVarint(val, this);\n            return;\n        }\n\n        this.realloc(4);\n\n        this.buf[this.pos++] =           val & 0x7f  | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] =   (val >>> 7) & 0x7f;\n    }\n\n    /** @param {number} val */\n    writeSVarint(val) {\n        this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n    }\n\n    /** @param {boolean} val */\n    writeBoolean(val) {\n        this.writeVarint(+val);\n    }\n\n    /** @param {string} str */\n    writeString(str) {\n        str = String(str);\n        this.realloc(str.length * 4);\n\n        this.pos++; // reserve 1 byte for short string length\n\n        const startPos = this.pos;\n        // write the string directly to the buffer and see how much was written\n        this.pos = writeUtf8(this.buf, str, this.pos);\n        const len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    }\n\n    /** @param {number} val */\n    writeFloat(val) {\n        this.realloc(4);\n        this.dataView.setFloat32(this.pos, val, true);\n        this.pos += 4;\n    }\n\n    /** @param {number} val */\n    writeDouble(val) {\n        this.realloc(8);\n        this.dataView.setFloat64(this.pos, val, true);\n        this.pos += 8;\n    }\n\n    /** @param {Uint8Array} buffer */\n    writeBytes(buffer) {\n        const len = buffer.length;\n        this.writeVarint(len);\n        this.realloc(len);\n        for (let i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n    }\n\n    /**\n     * @template T\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeRawMessage(fn, obj) {\n        this.pos++; // reserve 1 byte for short message length\n\n        // write the message directly to the buffer and see how much was written\n        const startPos = this.pos;\n        fn(obj, this);\n        const len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    }\n\n    /**\n     * @template T\n     * @param {number} tag\n     * @param {(obj: T, pbf: Pbf) => void} fn\n     * @param {T} obj\n     */\n    writeMessage(tag, fn, obj) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeRawMessage(fn, obj);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSVarint(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean[]} arr\n     */\n    writePackedBoolean(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFloat(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFloat, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedDouble(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedDouble, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed32(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);\n    }\n    /**\n     * @param {number} tag\n     * @param {number[]} arr\n     */\n    writePackedSFixed64(tag, arr) {\n        if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);\n    }\n\n    /**\n     * @param {number} tag\n     * @param {Uint8Array} buffer\n     */\n    writeBytesField(tag, buffer) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeBytes(buffer);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed32Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeSFixed32(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSFixed64Field(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeSFixed64(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeSVarintField(tag, val) {\n        this.writeTag(tag, PBF_VARINT);\n        this.writeSVarint(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {string} str\n     */\n    writeStringField(tag, str) {\n        this.writeTag(tag, PBF_BYTES);\n        this.writeString(str);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeFloatField(tag, val) {\n        this.writeTag(tag, PBF_FIXED32);\n        this.writeFloat(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {number} val\n     */\n    writeDoubleField(tag, val) {\n        this.writeTag(tag, PBF_FIXED64);\n        this.writeDouble(val);\n    }\n    /**\n     * @param {number} tag\n     * @param {boolean} val\n     */\n    writeBooleanField(tag, val) {\n        this.writeVarintField(tag, +val);\n    }\n};\n\n/**\n * @param {number} l\n * @param {boolean | undefined} s\n * @param {Pbf} p\n */\nfunction readVarintRemainder(l, s, p) {\n    const buf = p.buf;\n    let h, b;\n\n    b = buf[p.pos++]; h  = (b & 0x70) >> 4;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 3;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);\n\n    throw new Error('Expected varint not more than 10 bytes');\n}\n\n/**\n * @param {number} low\n * @param {number} high\n * @param {boolean} [isSigned]\n */\nfunction toNum(low, high, isSigned) {\n    return isSigned ? high * 0x100000000 + (low >>> 0) : ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\n/**\n * @param {number} val\n * @param {Pbf} pbf\n */\nfunction writeBigVarint(val, pbf) {\n    let low, high;\n\n    if (val >= 0) {\n        low  = (val % 0x100000000) | 0;\n        high = (val / 0x100000000) | 0;\n    } else {\n        low  = ~(-val % 0x100000000);\n        high = ~(-val / 0x100000000);\n\n        if (low ^ 0xffffffff) {\n            low = (low + 1) | 0;\n        } else {\n            low = 0;\n            high = (high + 1) | 0;\n        }\n    }\n\n    if (val >= 0x10000000000000000 || val < -0x10000000000000000) {\n        throw new Error('Given varint doesn\\'t fit into 10 bytes');\n    }\n\n    pbf.realloc(10);\n\n    writeBigVarintLow(low, high, pbf);\n    writeBigVarintHigh(high, pbf);\n}\n\n/**\n * @param {number} high\n * @param {number} low\n * @param {Pbf} pbf\n */\nfunction writeBigVarintLow(low, high, pbf) {\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos]   = low & 0x7f;\n}\n\n/**\n * @param {number} high\n * @param {Pbf} pbf\n */\nfunction writeBigVarintHigh(high, pbf) {\n    const lsb = (high & 0x07) << 4;\n\n    pbf.buf[pbf.pos++] |= lsb         | ((high >>>= 3) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f;\n}\n\n/**\n * @param {number} startPos\n * @param {number} len\n * @param {Pbf} pbf\n */\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n    const extraLen =\n        len <= 0x3fff ? 1 :\n        len <= 0x1fffff ? 2 :\n        len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));\n\n    // if 1 byte isn't enough for encoding message length, shift the data to the right\n    pbf.realloc(extraLen);\n    for (let i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSVarint(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFloat(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedDouble(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]);\n}\n/**\n * @param {boolean[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedBoolean(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed32(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]);\n}\n/**\n * @param {number[]} arr\n * @param {Pbf} pbf\n */\nfunction writePackedSFixed64(arr, pbf) {\n    for (let i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]);\n}\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\n/**\n * @param {Uint8Array} buf\n * @param {number} pos\n * @param {number} end\n */\nfunction readUtf8(buf, pos, end) {\n    let str = '';\n    let i = pos;\n\n    while (i < end) {\n        const b0 = buf[i];\n        let c = null; // codepoint\n        let bytesPerSequence =\n            b0 > 0xEF ? 4 :\n            b0 > 0xDF ? 3 :\n            b0 > 0xBF ? 2 : 1;\n\n        if (i + bytesPerSequence > end) break;\n\n        let b1, b2, b3;\n\n        if (bytesPerSequence === 1) {\n            if (b0 < 0x80) {\n                c = b0;\n            }\n        } else if (bytesPerSequence === 2) {\n            b1 = buf[i + 1];\n            if ((b1 & 0xC0) === 0x80) {\n                c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);\n                if (c <= 0x7F) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 3) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);\n                if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 4) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            b3 = buf[i + 3];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);\n                if (c <= 0xFFFF || c >= 0x110000) {\n                    c = null;\n                }\n            }\n        }\n\n        if (c === null) {\n            c = 0xFFFD;\n            bytesPerSequence = 1;\n\n        } else if (c > 0xFFFF) {\n            c -= 0x10000;\n            str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);\n            c = 0xDC00 | c & 0x3FF;\n        }\n\n        str += String.fromCharCode(c);\n        i += bytesPerSequence;\n    }\n\n    return str;\n}\n\n/**\n * @param {Uint8Array} buf\n * @param {string} str\n * @param {number} pos\n */\nfunction writeUtf8(buf, str, pos) {\n    for (let i = 0, c, lead; i < str.length; i++) {\n        c = str.charCodeAt(i); // code point\n\n        if (c > 0xD7FF && c < 0xE000) {\n            if (lead) {\n                if (c < 0xDC00) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                    lead = c;\n                    continue;\n                } else {\n                    c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;\n                    lead = null;\n                }\n            } else {\n                if (c > 0xDBFF || (i + 1 === str.length)) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                } else {\n                    lead = c;\n                }\n                continue;\n            }\n        } else if (lead) {\n            buf[pos++] = 0xEF;\n            buf[pos++] = 0xBF;\n            buf[pos++] = 0xBD;\n            lead = null;\n        }\n\n        if (c < 0x80) {\n            buf[pos++] = c;\n        } else {\n            if (c < 0x800) {\n                buf[pos++] = c >> 0x6 | 0xC0;\n            } else {\n                if (c < 0x10000) {\n                    buf[pos++] = c >> 0xC | 0xE0;\n                } else {\n                    buf[pos++] = c >> 0x12 | 0xF0;\n                    buf[pos++] = c >> 0xC & 0x3F | 0x80;\n                }\n                buf[pos++] = c >> 0x6 & 0x3F | 0x80;\n            }\n            buf[pos++] = c & 0x3F | 0x80;\n        }\n    }\n    return pos;\n}\n","// biome-ignore lint: needed for Leaflet + IIFE to work\ndeclare const L: any;\n// biome-ignore lint: needed for window.URL to disambiguate from cloudflare workers\ndeclare const window: any;\ndeclare const document: DocumentLike;\n\nimport type { Coords } from \"leaflet\";\nimport { PMTiles, TileType } from \"./index\";\n\ninterface DocumentLike {\n  // biome-ignore lint: we don't want to bring in the entire document type\n  createElement: (s: string) => any;\n}\n\n// biome-ignore lint: we don't want to bring in the entire document type\ntype DoneCallback = (error?: Error, tile?: any) => void;\n\n/**\n * Add a raster PMTiles as a layer to a Leaflet map.\n *\n * For vector tiles see https://github.com/protomaps/protomaps-leaflet\n */\nexport const leafletRasterLayer = (source: PMTiles, options: unknown) => {\n  let loaded = false;\n  let mimeType = \"\";\n  const cls = L.GridLayer.extend({\n    createTile: (coord: Coords, done: DoneCallback) => {\n      const el = document.createElement(\"img\");\n      const controller = new AbortController();\n      const signal = controller.signal;\n      el.cancel = () => {\n        controller.abort();\n      };\n      if (!loaded) {\n        source.getHeader().then((header) => {\n          if (header.tileType === TileType.Mvt) {\n            console.error(\n              \"Error: archive contains MVT vector tiles, but leafletRasterLayer is for displaying raster tiles. See https://github.com/protomaps/PMTiles/tree/main/js for details.\"\n            );\n          } else if (header.tileType === 2) {\n            mimeType = \"image/png\";\n          } else if (header.tileType === 3) {\n            mimeType = \"image/jpeg\";\n          } else if (header.tileType === 4) {\n            mimeType = \"image/webp\";\n          } else if (header.tileType === 5) {\n            mimeType = \"image/avif\";\n          }\n        });\n        loaded = true;\n      }\n      source\n        .getZxy(coord.z, coord.x, coord.y, signal)\n        .then((arr) => {\n          if (arr) {\n            const blob = new Blob([arr.data], { type: mimeType });\n            const imageUrl = window.URL.createObjectURL(blob);\n            el.src = imageUrl;\n            el.cancel = undefined;\n            done(undefined, el);\n          }\n        })\n        .catch((e) => {\n          if (e.name !== \"AbortError\") {\n            throw e;\n          }\n        });\n      return el;\n    },\n\n    _removeTile: function (key: string) {\n      const tile = this._tiles[key];\n      if (!tile) {\n        return;\n      }\n\n      if (tile.el.cancel) tile.el.cancel();\n\n      tile.el.width = 0;\n      tile.el.height = 0;\n      tile.el.deleted = true;\n      L.DomUtil.remove(tile.el);\n      delete this._tiles[key];\n      this.fire(\"tileunload\", {\n        tile: tile.el,\n        coords: this._keyToTileCoords(key),\n      });\n    },\n  });\n  return new cls(options);\n};\n\ntype GetResourceResponse<T> = ExpiryData & {\n  data: T;\n};\ntype AddProtocolAction = (\n  requestParameters: RequestParameters,\n  abortController: AbortController\n) => Promise<GetResourceResponse<unknown>>;\n\ntype ExpiryData = {\n  cacheControl?: string | null;\n  expires?: string | null; // MapLibre can be a Date object\n};\n\n// copied from MapLibre /util/ajax.ts\ntype RequestParameters = {\n  url: string;\n  headers?: unknown;\n  method?: \"GET\" | \"POST\" | \"PUT\";\n  body?: string;\n  type?: \"string\" | \"json\" | \"arrayBuffer\" | \"image\";\n  credentials?: \"same-origin\" | \"include\";\n  collectResourceTiming?: boolean;\n};\n\n// for legacy maplibre-3 interop\ntype ResponseCallbackV3 = (\n  error?: Error | undefined,\n  data?: unknown | undefined,\n  cacheControl?: string | undefined,\n  expires?: string | undefined\n) => void;\n\ntype V3OrV4Protocol = <\n  T extends AbortController | ResponseCallbackV3,\n  R = T extends AbortController\n    ? Promise<GetResourceResponse<unknown>>\n    : { cancel: () => void },\n>(\n  requestParameters: RequestParameters,\n  arg2: T\n) => R;\n\nconst v3compat =\n  (v4: AddProtocolAction): V3OrV4Protocol =>\n  (requestParameters, arg2) => {\n    if (arg2 instanceof AbortController) {\n      // biome-ignore lint: overloading return type not handled by compiler\n      return v4(requestParameters, arg2) as any;\n    }\n    const abortController = new AbortController();\n    v4(requestParameters, abortController)\n      .then(\n        (result) => {\n          return arg2(\n            undefined,\n            result.data,\n            result.cacheControl || \"\",\n            result.expires || \"\"\n          );\n        },\n        (err) => {\n          return arg2(err);\n        }\n      )\n      .catch((e) => {\n        return arg2(e);\n      });\n    return { cancel: () => abortController.abort() };\n  };\n\n/**\n * MapLibre GL JS protocol. Must be added once globally.\n */\nexport class Protocol {\n  /** @hidden */\n  tiles: Map<string, PMTiles>;\n  metadata: boolean;\n  errorOnMissingTile: boolean;\n\n  /**\n   * Initialize the MapLibre PMTiles protocol.\n   *\n   * * metadata: also load the metadata section of the PMTiles. required for some \"inspect\" functionality\n   * and to automatically populate the map attribution. Requires an extra HTTP request.\n   * * errorOnMissingTile: When a vector MVT tile is missing from the archive, raise an error instead of\n   * returning the empty array. Not recommended. This is only to reproduce the behavior of ZXY tile APIs\n   * which some applications depend on when overzooming.\n   */\n  constructor(options?: { metadata?: boolean; errorOnMissingTile?: boolean }) {\n    this.tiles = new Map<string, PMTiles>();\n    this.metadata = options?.metadata || false;\n    this.errorOnMissingTile = options?.errorOnMissingTile || false;\n  }\n\n  /**\n   * Add a {@link PMTiles} instance to the global protocol instance.\n   *\n   * For remote fetch sources, references in MapLibre styles like pmtiles://http://...\n   * will resolve to the same instance if the URLs match.\n   */\n  add(p: PMTiles) {\n    this.tiles.set(p.source.getKey(), p);\n  }\n\n  /**\n   * Fetch a {@link PMTiles} instance by URL, for remote PMTiles instances.\n   */\n  get(url: string) {\n    return this.tiles.get(url);\n  }\n\n  /** @hidden */\n  tilev4 = async (\n    params: RequestParameters,\n    abortController: AbortController\n  ) => {\n    if (params.type === \"json\") {\n      const pmtilesUrl = params.url.substr(10);\n      let instance = this.tiles.get(pmtilesUrl);\n      if (!instance) {\n        instance = new PMTiles(pmtilesUrl);\n        this.tiles.set(pmtilesUrl, instance);\n      }\n\n      if (this.metadata) {\n        return {\n          data: await instance.getTileJson(params.url),\n        };\n      }\n\n      const h = await instance.getHeader();\n\n      if (h.minLon >= h.maxLon || h.minLat >= h.maxLat) {\n        console.error(\n          `Bounds of PMTiles archive ${h.minLon},${h.minLat},${h.maxLon},${h.maxLat} are not valid.`\n        );\n      }\n\n      return {\n        data: {\n          tiles: [`${params.url}/{z}/{x}/{y}`],\n          minzoom: h.minZoom,\n          maxzoom: h.maxZoom,\n          bounds: [h.minLon, h.minLat, h.maxLon, h.maxLat],\n        },\n      };\n    }\n    const re = new RegExp(/pmtiles:\\/\\/(.+)\\/(\\d+)\\/(\\d+)\\/(\\d+)/);\n    const result = params.url.match(re);\n    if (!result) {\n      throw new Error(\"Invalid PMTiles protocol URL\");\n    }\n    const pmtilesUrl = result[1];\n\n    let instance = this.tiles.get(pmtilesUrl);\n    if (!instance) {\n      instance = new PMTiles(pmtilesUrl);\n      this.tiles.set(pmtilesUrl, instance);\n    }\n    const z = result[2];\n    const x = result[3];\n    const y = result[4];\n\n    const header = await instance.getHeader();\n    const resp = await instance?.getZxy(+z, +x, +y, abortController.signal);\n    if (resp) {\n      return {\n        data: new Uint8Array(resp.data),\n        cacheControl: resp.cacheControl,\n        expires: resp.expires,\n      };\n    }\n    if (header.tileType === TileType.Mvt) {\n      if (this.errorOnMissingTile) {\n        throw new Error(\"Tile not found.\");\n      }\n      return { data: new Uint8Array() };\n    }\n    return { data: null };\n  };\n\n  tile = v3compat(this.tilev4);\n}\n","import { decompressSync } from \"fflate\";\nexport * from \"./adapters\";\n\n/** @hidden */\nexport interface BufferPosition {\n  buf: Uint8Array;\n  pos: number;\n}\n\nfunction toNum(low: number, high: number): number {\n  return (high >>> 0) * 0x100000000 + (low >>> 0);\n}\n\nfunction readVarintRemainder(l: number, p: BufferPosition): number {\n  const buf = p.buf;\n  let b = buf[p.pos++];\n  let h = (b & 0x70) >> 4;\n  if (b < 0x80) return toNum(l, h);\n  b = buf[p.pos++];\n  h |= (b & 0x7f) << 3;\n  if (b < 0x80) return toNum(l, h);\n  b = buf[p.pos++];\n  h |= (b & 0x7f) << 10;\n  if (b < 0x80) return toNum(l, h);\n  b = buf[p.pos++];\n  h |= (b & 0x7f) << 17;\n  if (b < 0x80) return toNum(l, h);\n  b = buf[p.pos++];\n  h |= (b & 0x7f) << 24;\n  if (b < 0x80) return toNum(l, h);\n  b = buf[p.pos++];\n  h |= (b & 0x01) << 31;\n  if (b < 0x80) return toNum(l, h);\n  throw new Error(\"Expected varint not more than 10 bytes\");\n}\n\n/** @hidden */\nexport function readVarint(p: BufferPosition): number {\n  const buf = p.buf;\n  let b = buf[p.pos++];\n  let val = b & 0x7f;\n  if (b < 0x80) return val;\n  b = buf[p.pos++];\n  val |= (b & 0x7f) << 7;\n  if (b < 0x80) return val;\n  b = buf[p.pos++];\n  val |= (b & 0x7f) << 14;\n  if (b < 0x80) return val;\n  b = buf[p.pos++];\n  val |= (b & 0x7f) << 21;\n  if (b < 0x80) return val;\n  b = buf[p.pos];\n  val |= (b & 0x0f) << 28;\n\n  return readVarintRemainder(val, p);\n}\n\nfunction rotate(n: number, xy: number[], rx: number, ry: number): void {\n  if (ry === 0) {\n    if (rx === 1) {\n      xy[0] = n - 1 - xy[0];\n      xy[1] = n - 1 - xy[1];\n    }\n    const t = xy[0];\n    xy[0] = xy[1];\n    xy[1] = t;\n  }\n}\n\nfunction idOnLevel(z: number, pos: number): [number, number, number] {\n  const n = 2 ** z;\n  let rx = pos;\n  let ry = pos;\n  let t = pos;\n  const xy = [0, 0];\n  let s = 1;\n  while (s < n) {\n    rx = 1 & (t / 2);\n    ry = 1 & (t ^ rx);\n    rotate(s, xy, rx, ry);\n    xy[0] += s * rx;\n    xy[1] += s * ry;\n    t = t / 4;\n    s *= 2;\n  }\n  return [z, xy[0], xy[1]];\n}\n\nconst tzValues: number[] = [\n  0, 1, 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405,\n  22369621, 89478485, 357913941, 1431655765, 5726623061, 22906492245,\n  91625968981, 366503875925, 1466015503701, 5864062014805, 23456248059221,\n  93824992236885, 375299968947541, 1501199875790165,\n];\n\n/**\n * Convert Z,X,Y to a Hilbert TileID.\n */\nexport function zxyToTileId(z: number, x: number, y: number): number {\n  if (z > 26) {\n    throw new Error(\"Tile zoom level exceeds max safe number limit (26)\");\n  }\n  if (x > 2 ** z - 1 || y > 2 ** z - 1) {\n    throw new Error(\"tile x/y outside zoom level bounds\");\n  }\n\n  const acc = tzValues[z];\n  const n = 2 ** z;\n  let rx = 0;\n  let ry = 0;\n  let d = 0;\n  const xy = [x, y];\n  let s = n / 2;\n  while (s > 0) {\n    rx = (xy[0] & s) > 0 ? 1 : 0;\n    ry = (xy[1] & s) > 0 ? 1 : 0;\n    d += s * s * ((3 * rx) ^ ry);\n    rotate(s, xy, rx, ry);\n    s = s / 2;\n  }\n  return acc + d;\n}\n\n/**\n * Convert a Hilbert TileID to Z,X,Y.\n */\nexport function tileIdToZxy(i: number): [number, number, number] {\n  let acc = 0;\n  const z = 0;\n\n  for (let z = 0; z < 27; z++) {\n    const numTiles = (0x1 << z) * (0x1 << z);\n    if (acc + numTiles > i) {\n      return idOnLevel(z, i - acc);\n    }\n    acc += numTiles;\n  }\n\n  throw new Error(\"Tile zoom level exceeds max safe number limit (26)\");\n}\n\n/**\n * PMTiles v3 directory entry.\n */\nexport interface Entry {\n  tileId: number;\n  offset: number;\n  length: number;\n  runLength: number;\n}\n\ninterface MetadataLike {\n  attribution?: string;\n  name?: string;\n  version?: string;\n  // biome-ignore lint: TileJSON spec\n  vector_layers?: string;\n  description?: string;\n}\n\n/**\n * Enum representing a compression algorithm used.\n * 0 = unknown compression, for if you must use a different or unspecified algorithm.\n * 1 = no compression.\n */\nexport enum Compression {\n  Unknown = 0,\n  None = 1,\n  Gzip = 2,\n  Brotli = 3,\n  Zstd = 4,\n}\n\n/**\n * Provide a decompression implementation that acts on `buf` and returns decompressed data.\n *\n * Should use the native DecompressionStream on browsers, zlib on node.\n * Should throw if the compression algorithm is not supported.\n */\nexport type DecompressFunc = (\n  buf: ArrayBuffer,\n  compression: Compression\n) => Promise<ArrayBuffer>;\n\nasync function defaultDecompress(\n  buf: ArrayBuffer,\n  compression: Compression\n): Promise<ArrayBuffer> {\n  if (compression === Compression.None || compression === Compression.Unknown) {\n    return buf;\n  }\n  if (compression === Compression.Gzip) {\n    // biome-ignore lint: needed to detect DecompressionStream in browser+node+cloudflare workers\n    if (typeof (globalThis as any).DecompressionStream === \"undefined\") {\n      return decompressSync(new Uint8Array(buf));\n    }\n    const stream = new Response(buf).body;\n    if (!stream) {\n      throw new Error(\"Failed to read response stream\");\n    }\n    const result: ReadableStream<Uint8Array> = stream.pipeThrough(\n      // biome-ignore lint: needed to detect DecompressionStream in browser+node+cloudflare workers\n      new (globalThis as any).DecompressionStream(\"gzip\")\n    );\n    return new Response(result).arrayBuffer();\n  }\n  throw new Error(\"Compression method not supported\");\n}\n\n/**\n * Describe the type of tiles stored in the archive.\n * 0 is unknown/other, 1 is \"MVT\" vector tiles.\n */\nexport enum TileType {\n  Unknown = 0,\n  Mvt = 1,\n  Png = 2,\n  Jpeg = 3,\n  Webp = 4,\n  Avif = 5,\n}\n\nexport function tileTypeExt(t: TileType): string {\n  if (t === TileType.Mvt) return \".mvt\";\n  if (t === TileType.Png) return \".png\";\n  if (t === TileType.Jpeg) return \".jpg\";\n  if (t === TileType.Webp) return \".webp\";\n  if (t === TileType.Avif) return \".avif\";\n  return \"\";\n}\n\nconst HEADER_SIZE_BYTES = 127;\n\n/**\n * PMTiles v3 header storing basic archive-level information.\n */\nexport interface Header {\n  specVersion: number;\n  rootDirectoryOffset: number;\n  rootDirectoryLength: number;\n  jsonMetadataOffset: number;\n  jsonMetadataLength: number;\n  leafDirectoryOffset: number;\n  leafDirectoryLength?: number;\n  tileDataOffset: number;\n  tileDataLength?: number;\n  numAddressedTiles: number;\n  numTileEntries: number;\n  numTileContents: number;\n  clustered: boolean;\n  internalCompression: Compression;\n  tileCompression: Compression;\n  tileType: TileType;\n  minZoom: number;\n  maxZoom: number;\n  minLon: number;\n  minLat: number;\n  maxLon: number;\n  maxLat: number;\n  centerZoom: number;\n  centerLon: number;\n  centerLat: number;\n  etag?: string;\n}\n\n/**\n * Low-level function for looking up a TileID or leaf directory inside a directory.\n */\nexport function findTile(entries: Entry[], tileId: number): Entry | null {\n  let m = 0;\n  let n = entries.length - 1;\n  while (m <= n) {\n    const k = (n + m) >> 1;\n    const cmp = tileId - entries[k].tileId;\n    if (cmp > 0) {\n      m = k + 1;\n    } else if (cmp < 0) {\n      n = k - 1;\n    } else {\n      return entries[k];\n    }\n  }\n\n  // at this point, m > n\n  if (n >= 0) {\n    if (entries[n].runLength === 0) {\n      return entries[n];\n    }\n    if (tileId - entries[n].tileId < entries[n].runLength) {\n      return entries[n];\n    }\n  }\n  return null;\n}\n\nexport interface RangeResponse {\n  data: ArrayBuffer;\n  etag?: string;\n  expires?: string;\n  cacheControl?: string;\n}\n\n/**\n * Interface for retrieving an archive from remote or local storage.\n */\nexport interface Source {\n  getBytes: (\n    offset: number,\n    length: number,\n    signal?: AbortSignal,\n    etag?: string\n  ) => Promise<RangeResponse>;\n\n  /**\n   * Return a unique string key for the archive e.g. a URL.\n   */\n  getKey: () => string;\n}\n\n/**\n * Use the Browser's File API, which is different from the NodeJS file API.\n * see https://developer.mozilla.org/en-US/docs/Web/API/File_API\n */\nexport class FileSource implements Source {\n  file: File;\n\n  constructor(file: File) {\n    this.file = file;\n  }\n\n  getKey() {\n    return this.file.name;\n  }\n\n  async getBytes(offset: number, length: number): Promise<RangeResponse> {\n    const blob = this.file.slice(offset, offset + length);\n    const a = await blob.arrayBuffer();\n    return { data: a };\n  }\n}\n\n/**\n * Uses the browser Fetch API to make tile requests via HTTP.\n *\n * This method does not send conditional request headers If-Match because of CORS.\n * Instead, it detects ETag mismatches via the response ETag or the 416 response code.\n *\n * This also works around browser and storage-specific edge cases.\n */\nexport class FetchSource implements Source {\n  url: string;\n\n  /**\n   * A [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object, specfying custom [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) set for all requests to the remote archive.\n   *\n   * This should be used instead of maplibre's [transformRequest](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#example) for PMTiles archives.\n   */\n  customHeaders: Headers;\n  /** @hidden */\n  mustReload: boolean;\n  /** @hidden */\n  chromeWindowsNoCache: boolean;\n\n  constructor(url: string, customHeaders: Headers = new Headers()) {\n    this.url = url;\n    this.customHeaders = customHeaders;\n    this.mustReload = false;\n    let userAgent = \"\";\n    if (\"navigator\" in globalThis) {\n      //biome-ignore lint: cf workers\n      userAgent = (globalThis as any).navigator.userAgent || \"\";\n    }\n    const isWindows = userAgent.indexOf(\"Windows\") > -1;\n    const isChromiumBased = /Chrome|Chromium|Edg|OPR|Brave/.test(userAgent);\n    this.chromeWindowsNoCache = false;\n    if (isWindows && isChromiumBased) {\n      this.chromeWindowsNoCache = true;\n    }\n  }\n\n  getKey() {\n    return this.url;\n  }\n\n  /**\n   * Mutate the custom [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) set for all requests to the remote archive.\n   */\n  setHeaders(customHeaders: Headers) {\n    this.customHeaders = customHeaders;\n  }\n\n  async getBytes(\n    offset: number,\n    length: number,\n    passedSignal?: AbortSignal,\n    etag?: string\n  ): Promise<RangeResponse> {\n    let controller: AbortController | undefined;\n    let signal: AbortSignal | undefined;\n    if (passedSignal) {\n      signal = passedSignal;\n    } else {\n      controller = new AbortController();\n      signal = controller.signal;\n    }\n\n    const requestHeaders = new Headers(this.customHeaders);\n    requestHeaders.set(\"range\", `bytes=${offset}-${offset + length - 1}`);\n\n    // we don't send if match because:\n    // * it disables browser caching completely (Chromium)\n    // * it requires a preflight request for every tile request\n    // * it requires CORS configuration becasue If-Match is not a CORs-safelisted header\n    // CORs configuration should expose ETag.\n    // if any etag mismatch is detected, we need to ignore the browser cache\n    let cache: string | undefined;\n    if (this.mustReload) {\n      cache = \"reload\";\n    } else if (this.chromeWindowsNoCache) {\n      cache = \"no-store\";\n    }\n\n    let resp = await fetch(this.url, {\n      signal: signal,\n      cache: cache,\n      headers: requestHeaders,\n      //biome-ignore lint: \"cache\" is incompatible between cloudflare workers and browser\n    } as any);\n\n    // handle edge case where the archive is < 16384 kb total.\n    if (offset === 0 && resp.status === 416) {\n      const contentRange = resp.headers.get(\"Content-Range\");\n      if (!contentRange || !contentRange.startsWith(\"bytes */\")) {\n        throw new Error(\"Missing content-length on 416 response\");\n      }\n      const actualLength = +contentRange.substr(8);\n      resp = await fetch(this.url, {\n        signal: signal,\n        cache: \"reload\",\n        headers: { range: `bytes=0-${actualLength - 1}` },\n        //biome-ignore lint: \"cache\" is incompatible between cloudflare workers and browser\n      } as any);\n    }\n\n    // if it's a weak etag, it's not useful for us, so ignore it.\n    let newEtag = resp.headers.get(\"Etag\");\n    if (newEtag?.startsWith(\"W/\")) {\n      newEtag = null;\n    }\n\n    // some storage systems are misbehaved (Cloudflare R2)\n    if (resp.status === 416 || (etag && newEtag && newEtag !== etag)) {\n      this.mustReload = true;\n      throw new EtagMismatch(\n        `Server returned non-matching ETag ${etag} after one retry. Check browser extensions and servers for issues that may affect correct ETag headers.`\n      );\n    }\n\n    if (resp.status >= 300) {\n      throw new Error(`Bad response code: ${resp.status}`);\n    }\n\n    // some well-behaved backends, e.g. DigitalOcean CDN, respond with 200 instead of 206\n    // but we also need to detect no support for Byte Serving which is returning the whole file\n    const contentLength = resp.headers.get(\"Content-Length\");\n    if (resp.status === 200 && (!contentLength || +contentLength > length)) {\n      if (controller) controller.abort();\n      throw new Error(\n        \"Server returned no content-length header or content-length exceeding request. Check that your storage backend supports HTTP Byte Serving.\"\n      );\n    }\n\n    const a = await resp.arrayBuffer();\n    return {\n      data: a,\n      etag: newEtag || undefined,\n      cacheControl: resp.headers.get(\"Cache-Control\") || undefined,\n      expires: resp.headers.get(\"Expires\") || undefined,\n    };\n  }\n}\n\n/** @hidden */\nexport function getUint64(v: DataView, offset: number): number {\n  const wh = v.getUint32(offset + 4, true);\n  const wl = v.getUint32(offset + 0, true);\n  return wh * 2 ** 32 + wl;\n}\n\n/**\n * Parse raw header bytes into a Header object.\n */\nexport function bytesToHeader(bytes: ArrayBuffer, etag?: string): Header {\n  const v = new DataView(bytes);\n  const specVersion = v.getUint8(7);\n  if (specVersion > 3) {\n    throw new Error(\n      `Archive is spec version ${specVersion} but this library supports up to spec version 3`\n    );\n  }\n\n  return {\n    specVersion: specVersion,\n    rootDirectoryOffset: getUint64(v, 8),\n    rootDirectoryLength: getUint64(v, 16),\n    jsonMetadataOffset: getUint64(v, 24),\n    jsonMetadataLength: getUint64(v, 32),\n    leafDirectoryOffset: getUint64(v, 40),\n    leafDirectoryLength: getUint64(v, 48),\n    tileDataOffset: getUint64(v, 56),\n    tileDataLength: getUint64(v, 64),\n    numAddressedTiles: getUint64(v, 72),\n    numTileEntries: getUint64(v, 80),\n    numTileContents: getUint64(v, 88),\n    clustered: v.getUint8(96) === 1,\n    internalCompression: v.getUint8(97),\n    tileCompression: v.getUint8(98),\n    tileType: v.getUint8(99),\n    minZoom: v.getUint8(100),\n    maxZoom: v.getUint8(101),\n    minLon: v.getInt32(102, true) / 10000000,\n    minLat: v.getInt32(106, true) / 10000000,\n    maxLon: v.getInt32(110, true) / 10000000,\n    maxLat: v.getInt32(114, true) / 10000000,\n    centerZoom: v.getUint8(118),\n    centerLon: v.getInt32(119, true) / 10000000,\n    centerLat: v.getInt32(123, true) / 10000000,\n    etag: etag,\n  };\n}\n\nfunction deserializeIndex(buffer: ArrayBuffer): Entry[] {\n  const p = { buf: new Uint8Array(buffer), pos: 0 };\n  const numEntries = readVarint(p);\n\n  const entries: Entry[] = [];\n\n  let lastId = 0;\n  for (let i = 0; i < numEntries; i++) {\n    const v = readVarint(p);\n    entries.push({ tileId: lastId + v, offset: 0, length: 0, runLength: 1 });\n    lastId += v;\n  }\n\n  for (let i = 0; i < numEntries; i++) {\n    entries[i].runLength = readVarint(p);\n  }\n\n  for (let i = 0; i < numEntries; i++) {\n    entries[i].length = readVarint(p);\n  }\n\n  for (let i = 0; i < numEntries; i++) {\n    const v = readVarint(p);\n    if (v === 0 && i > 0) {\n      entries[i].offset = entries[i - 1].offset + entries[i - 1].length;\n    } else {\n      entries[i].offset = v - 1;\n    }\n  }\n\n  return entries;\n}\n\nfunction detectVersion(a: ArrayBuffer): number {\n  const v = new DataView(a);\n  if (v.getUint16(2, true) === 2) {\n    console.error(\n      \"PMTiles spec version 2 is not supported; please see github.com/protomaps/PMTiles for tools to upgrade\"\n    );\n    return 2;\n  }\n  if (v.getUint16(2, true) === 1) {\n    console.error(\n      \"PMTiles spec version 1 is not supported; please see github.com/protomaps/PMTiles for tools to upgrade\"\n    );\n    return 1;\n  }\n  return 3;\n}\n\n/**\n * Error thrown when a response for PMTiles over HTTP does not match previous, cached parts of the archive.\n * The default PMTiles implementation will catch this error once internally and retry a request.\n */\nexport class EtagMismatch extends Error {}\n\n/**\n * Interface for caches of parts (headers, directories) of a PMTiles archive.\n */\nexport interface Cache {\n  getHeader: (source: Source) => Promise<Header>;\n  getDirectory: (\n    source: Source,\n    offset: number,\n    length: number,\n    header: Header\n  ) => Promise<Entry[]>;\n  invalidate: (source: Source) => Promise<void>;\n}\n\nasync function getHeaderAndRoot(\n  source: Source,\n  decompress: DecompressFunc\n): Promise<[Header, [string, number, Entry[] | ArrayBuffer]?]> {\n  const resp = await source.getBytes(0, 16384);\n\n  const v = new DataView(resp.data);\n  if (v.getUint16(0, true) !== 0x4d50) {\n    throw new Error(\"Wrong magic number for PMTiles archive\");\n  }\n\n  const headerData = resp.data.slice(0, HEADER_SIZE_BYTES);\n\n  const header = bytesToHeader(headerData, resp.etag);\n\n  // optimistically set the root directory\n  // TODO check root bounds\n  const rootDirData = resp.data.slice(\n    header.rootDirectoryOffset,\n    header.rootDirectoryOffset + header.rootDirectoryLength\n  );\n  const dirKey = `${source.getKey()}|${header.etag || \"\"}|${\n    header.rootDirectoryOffset\n  }|${header.rootDirectoryLength}`;\n\n  const rootDir = deserializeIndex(\n    await decompress(rootDirData, header.internalCompression)\n  );\n  return [header, [dirKey, rootDir.length, rootDir]];\n}\n\nasync function getDirectory(\n  source: Source,\n  decompress: DecompressFunc,\n  offset: number,\n  length: number,\n  header: Header\n): Promise<Entry[]> {\n  const resp = await source.getBytes(offset, length, undefined, header.etag);\n  const data = await decompress(resp.data, header.internalCompression);\n  const directory = deserializeIndex(data);\n  if (directory.length === 0) {\n    throw new Error(\"Empty directory is invalid\");\n  }\n\n  return directory;\n}\n\ninterface ResolvedValue {\n  lastUsed: number;\n  data: Header | Entry[] | ArrayBuffer;\n}\n\n/**\n * A cache for parts of a PMTiles archive where promises are never shared between requests.\n *\n * Runtimes such as Cloudflare Workers cannot share promises between different requests.\n *\n * Only caches headers and directories, not individual tile contents.\n */\nexport class ResolvedValueCache {\n  cache: Map<string, ResolvedValue>;\n  maxCacheEntries: number;\n  counter: number;\n  decompress: DecompressFunc;\n\n  constructor(\n    maxCacheEntries = 100,\n    prefetch = true, // deprecated\n    decompress: DecompressFunc = defaultDecompress\n  ) {\n    this.cache = new Map<string, ResolvedValue>();\n    this.maxCacheEntries = maxCacheEntries;\n    this.counter = 1;\n    this.decompress = decompress;\n  }\n\n  async getHeader(source: Source): Promise<Header> {\n    const cacheKey = source.getKey();\n    const cacheValue = this.cache.get(cacheKey);\n    if (cacheValue) {\n      cacheValue.lastUsed = this.counter++;\n      const data = cacheValue.data;\n      return data as Header;\n    }\n\n    const res = await getHeaderAndRoot(source, this.decompress);\n    if (res[1]) {\n      this.cache.set(res[1][0], {\n        lastUsed: this.counter++,\n        data: res[1][2],\n      });\n    }\n\n    this.cache.set(cacheKey, {\n      lastUsed: this.counter++,\n      data: res[0],\n    });\n    this.prune();\n    return res[0];\n  }\n\n  async getDirectory(\n    source: Source,\n    offset: number,\n    length: number,\n    header: Header\n  ): Promise<Entry[]> {\n    const cacheKey = `${source.getKey()}|${\n      header.etag || \"\"\n    }|${offset}|${length}`;\n    const cacheValue = this.cache.get(cacheKey);\n    if (cacheValue) {\n      cacheValue.lastUsed = this.counter++;\n      const data = cacheValue.data;\n      return data as Entry[];\n    }\n\n    const directory = await getDirectory(\n      source,\n      this.decompress,\n      offset,\n      length,\n      header\n    );\n    this.cache.set(cacheKey, {\n      lastUsed: this.counter++,\n      data: directory,\n    });\n    this.prune();\n    return directory;\n  }\n\n  prune() {\n    if (this.cache.size > this.maxCacheEntries) {\n      let minUsed = Infinity;\n      let minKey = undefined;\n      this.cache.forEach((cacheValue: ResolvedValue, key: string) => {\n        if (cacheValue.lastUsed < minUsed) {\n          minUsed = cacheValue.lastUsed;\n          minKey = key;\n        }\n      });\n      if (minKey) {\n        this.cache.delete(minKey);\n      }\n    }\n  }\n\n  async invalidate(source: Source) {\n    this.cache.delete(source.getKey());\n  }\n}\n\ninterface SharedPromiseCacheValue {\n  lastUsed: number;\n  data: Promise<Header | Entry[] | ArrayBuffer>;\n}\n\n/**\n * A cache for parts of a PMTiles archive where promises can be shared between requests.\n *\n * Only caches headers and directories, not individual tile contents.\n */\nexport class SharedPromiseCache {\n  cache: Map<string, SharedPromiseCacheValue>;\n  invalidations: Map<string, Promise<void>>;\n  maxCacheEntries: number;\n  counter: number;\n  decompress: DecompressFunc;\n\n  constructor(\n    maxCacheEntries = 100,\n    prefetch = true, // deprecated\n    decompress: DecompressFunc = defaultDecompress\n  ) {\n    this.cache = new Map<string, SharedPromiseCacheValue>();\n    this.invalidations = new Map<string, Promise<void>>();\n    this.maxCacheEntries = maxCacheEntries;\n    this.counter = 1;\n    this.decompress = decompress;\n  }\n\n  async getHeader(source: Source): Promise<Header> {\n    const cacheKey = source.getKey();\n    const cacheValue = this.cache.get(cacheKey);\n    if (cacheValue) {\n      cacheValue.lastUsed = this.counter++;\n      const data = await cacheValue.data;\n      return data as Header;\n    }\n\n    const p = new Promise<Header>((resolve, reject) => {\n      getHeaderAndRoot(source, this.decompress)\n        .then((res) => {\n          if (res[1]) {\n            this.cache.set(res[1][0], {\n              lastUsed: this.counter++,\n              data: Promise.resolve(res[1][2]),\n            });\n          }\n          resolve(res[0]);\n          this.prune();\n        })\n        .catch((e) => {\n          reject(e);\n        });\n    });\n    this.cache.set(cacheKey, { lastUsed: this.counter++, data: p });\n    return p;\n  }\n\n  async getDirectory(\n    source: Source,\n    offset: number,\n    length: number,\n    header: Header\n  ): Promise<Entry[]> {\n    const cacheKey = `${source.getKey()}|${\n      header.etag || \"\"\n    }|${offset}|${length}`;\n    const cacheValue = this.cache.get(cacheKey);\n    if (cacheValue) {\n      cacheValue.lastUsed = this.counter++;\n      const data = await cacheValue.data;\n      return data as Entry[];\n    }\n\n    const p = new Promise<Entry[]>((resolve, reject) => {\n      getDirectory(source, this.decompress, offset, length, header)\n        .then((directory) => {\n          resolve(directory);\n          this.prune();\n        })\n        .catch((e) => {\n          reject(e);\n        });\n    });\n    this.cache.set(cacheKey, { lastUsed: this.counter++, data: p });\n    return p;\n  }\n\n  prune() {\n    if (this.cache.size >= this.maxCacheEntries) {\n      let minUsed = Infinity;\n      let minKey = undefined;\n      this.cache.forEach((cacheValue: SharedPromiseCacheValue, key: string) => {\n        if (cacheValue.lastUsed < minUsed) {\n          minUsed = cacheValue.lastUsed;\n          minKey = key;\n        }\n      });\n      if (minKey) {\n        this.cache.delete(minKey);\n      }\n    }\n  }\n\n  async invalidate(source: Source) {\n    const key = source.getKey();\n    if (this.invalidations.get(key)) {\n      return await this.invalidations.get(key);\n    }\n    this.cache.delete(source.getKey());\n    const p = new Promise<void>((resolve, reject) => {\n      this.getHeader(source)\n        .then((h) => {\n          resolve();\n          this.invalidations.delete(key);\n        })\n        .catch((e) => {\n          reject(e);\n        });\n    });\n    this.invalidations.set(key, p);\n  }\n}\n\n/**\n * Main class encapsulating PMTiles decoding logic.\n *\n * if `source` is a string, creates a FetchSource using that string as the URL to a remote PMTiles.\n * if no `cache` is passed, use a SharedPromiseCache.\n * if no `decompress` is passed, default to the browser DecompressionStream API with a fallback to `fflate`.\n */\n// biome-ignore lint: that's just how its capitalized\nexport class PMTiles {\n  source: Source;\n  cache: Cache;\n  decompress: DecompressFunc;\n\n  constructor(\n    source: Source | string,\n    cache?: Cache,\n    decompress?: DecompressFunc\n  ) {\n    if (typeof source === \"string\") {\n      this.source = new FetchSource(source);\n    } else {\n      this.source = source;\n    }\n    if (decompress) {\n      this.decompress = decompress;\n    } else {\n      this.decompress = defaultDecompress;\n    }\n    if (cache) {\n      this.cache = cache;\n    } else {\n      this.cache = new SharedPromiseCache();\n    }\n  }\n\n  /**\n   * Return the header of the archive,\n   * including information such as tile type, min/max zoom, bounds, and summary statistics.\n   */\n  async getHeader() {\n    return await this.cache.getHeader(this.source);\n  }\n\n  /** @hidden */\n  async getZxyAttempt(\n    z: number,\n    x: number,\n    y: number,\n    signal?: AbortSignal\n  ): Promise<RangeResponse | undefined> {\n    const tileId = zxyToTileId(z, x, y);\n    const header = await this.cache.getHeader(this.source);\n\n    if (z < header.minZoom || z > header.maxZoom) {\n      return undefined;\n    }\n\n    let dO = header.rootDirectoryOffset;\n    let dL = header.rootDirectoryLength;\n    for (let depth = 0; depth <= 3; depth++) {\n      const directory = await this.cache.getDirectory(\n        this.source,\n        dO,\n        dL,\n        header\n      );\n      const entry = findTile(directory, tileId);\n      if (entry) {\n        if (entry.runLength > 0) {\n          const resp = await this.source.getBytes(\n            header.tileDataOffset + entry.offset,\n            entry.length,\n            signal,\n            header.etag\n          );\n          return {\n            data: await this.decompress(resp.data, header.tileCompression),\n            cacheControl: resp.cacheControl,\n            expires: resp.expires,\n          };\n        }\n        dO = header.leafDirectoryOffset + entry.offset;\n        dL = entry.length;\n      } else {\n        // TODO: We should in fact return a valid RangeResponse\n        // with empty data, but filled in cache control / expires headers\n        return undefined;\n      }\n    }\n    throw new Error(\"Maximum directory depth exceeded\");\n  }\n\n  /**\n   * Primary method to get a single tile's bytes from an archive.\n   *\n   * Returns undefined if the tile does not exist in the archive.\n   */\n  async getZxy(\n    z: number,\n    x: number,\n    y: number,\n    signal?: AbortSignal\n  ): Promise<RangeResponse | undefined> {\n    try {\n      return await this.getZxyAttempt(z, x, y, signal);\n    } catch (e) {\n      if (e instanceof EtagMismatch) {\n        this.cache.invalidate(this.source);\n        return await this.getZxyAttempt(z, x, y, signal);\n      }\n      throw e;\n    }\n  }\n\n  /** @hidden */\n  async getMetadataAttempt(): Promise<unknown> {\n    const header = await this.cache.getHeader(this.source);\n\n    const resp = await this.source.getBytes(\n      header.jsonMetadataOffset,\n      header.jsonMetadataLength,\n      undefined,\n      header.etag\n    );\n    const decompressed = await this.decompress(\n      resp.data,\n      header.internalCompression\n    );\n    const dec = new TextDecoder(\"utf-8\");\n    return JSON.parse(dec.decode(decompressed));\n  }\n\n  /**\n   * Return the arbitrary JSON metadata of the archive.\n   */\n  async getMetadata(): Promise<unknown> {\n    try {\n      return await this.getMetadataAttempt();\n    } catch (e) {\n      if (e instanceof EtagMismatch) {\n        this.cache.invalidate(this.source);\n        return await this.getMetadataAttempt();\n      }\n      throw e;\n    }\n  }\n\n  /**\n   * Construct a [TileJSON](https://github.com/mapbox/tilejson-spec) object.\n   *\n   * baseTilesUrl is the desired tiles URL, excluding the suffix `/{z}/{x}/{y}.{ext}`.\n   * For example, if the desired URL is `http://example.com/tileset/{z}/{x}/{y}.mvt`,\n   * the baseTilesUrl should be `https://example.com/tileset`.\n   */\n  async getTileJson(baseTilesUrl: string): Promise<unknown> {\n    const header = await this.getHeader();\n    const metadata = (await this.getMetadata()) as MetadataLike;\n    const ext = tileTypeExt(header.tileType);\n\n    return {\n      tilejson: \"3.0.0\",\n      scheme: \"xyz\",\n      tiles: [`${baseTilesUrl}/{z}/{x}/{y}${ext}`],\n      // biome-ignore lint: TileJSON spec\n      vector_layers: metadata.vector_layers,\n      attribution: metadata.attribution,\n      description: metadata.description,\n      name: metadata.name,\n      version: metadata.version,\n      bounds: [header.minLon, header.minLat, header.maxLon, header.maxLat],\n      center: [header.centerLon, header.centerLat, header.centerZoom],\n      minzoom: header.minZoom,\n      maxzoom: header.maxZoom,\n    };\n  }\n}\n","/**\n * @license\n * Copyright 2010-2025 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\nconst REVISION = '179';\n\n/**\n * Represents mouse buttons and interaction types in context of controls.\n *\n * @type {ConstantsMouse}\n * @constant\n */\nconst MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };\n\n/**\n * Represents touch interaction types in context of controls.\n *\n * @type {ConstantsTouch}\n * @constant\n */\nconst TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };\n\n/**\n * Disables face culling.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceNone = 0;\n\n/**\n * Culls back faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceBack = 1;\n\n/**\n * Culls front faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceFront = 2;\n\n/**\n * Culls both front and back faces.\n *\n * @type {number}\n * @constant\n */\nconst CullFaceFrontBack = 3;\n\n/**\n * Gives unfiltered shadow maps - fastest, but lowest quality.\n *\n * @type {number}\n * @constant\n */\nconst BasicShadowMap = 0;\n\n/**\n * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm.\n *\n * @type {number}\n * @constant\n */\nconst PCFShadowMap = 1;\n\n/**\n * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with\n * better soft shadows especially when using low-resolution shadow maps.\n *\n * @type {number}\n * @constant\n */\nconst PCFSoftShadowMap = 2;\n\n/**\n * Filters shadow maps using the Variance Shadow Map (VSM) algorithm.\n * When using VSMShadowMap all shadow receivers will also cast shadows.\n *\n * @type {number}\n * @constant\n */\nconst VSMShadowMap = 3;\n\n/**\n * Only front faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst FrontSide = 0;\n\n/**\n * Only back faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst BackSide = 1;\n\n/**\n * Both front and back faces are rendered.\n *\n * @type {number}\n * @constant\n */\nconst DoubleSide = 2;\n\n/**\n * No blending is performed which effectively disables\n * alpha transparency.\n *\n * @type {number}\n * @constant\n */\nconst NoBlending = 0;\n\n/**\n * The default blending.\n *\n * @type {number}\n * @constant\n */\nconst NormalBlending = 1;\n\n/**\n * Represents additive blending.\n *\n * @type {number}\n * @constant\n */\nconst AdditiveBlending = 2;\n\n/**\n * Represents subtractive blending.\n *\n * @type {number}\n * @constant\n */\nconst SubtractiveBlending = 3;\n\n/**\n * Represents multiply blending.\n *\n * @type {number}\n * @constant\n */\nconst MultiplyBlending = 4;\n\n/**\n * Represents custom blending.\n *\n * @type {number}\n * @constant\n */\nconst CustomBlending = 5;\n\n/**\n * A `source + destination` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst AddEquation = 100;\n\n/**\n * A `source - destination` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst SubtractEquation = 101;\n\n/**\n * A `destination - source` blending equation.\n *\n * @type {number}\n * @constant\n */\nconst ReverseSubtractEquation = 102;\n\n/**\n * A blend equation that uses the minimum of source and destination.\n *\n * @type {number}\n * @constant\n */\nconst MinEquation = 103;\n\n/**\n * A blend equation that uses the maximum of source and destination.\n *\n * @type {number}\n * @constant\n */\nconst MaxEquation = 104;\n\n/**\n * Multiplies all colors by `0`.\n *\n * @type {number}\n * @constant\n */\nconst ZeroFactor = 200;\n\n/**\n * Multiplies all colors by `1`.\n *\n * @type {number}\n * @constant\n */\nconst OneFactor = 201;\n\n/**\n * Multiplies all colors by the source colors.\n *\n * @type {number}\n * @constant\n */\nconst SrcColorFactor = 202;\n\n/**\n * Multiplies all colors by `1` minus each source color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusSrcColorFactor = 203;\n\n/**\n * Multiplies all colors by the source alpha value.\n *\n * @type {number}\n * @constant\n */\nconst SrcAlphaFactor = 204;\n\n/**\n * Multiplies all colors by 1 minus the source alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusSrcAlphaFactor = 205;\n\n/**\n * Multiplies all colors by the destination alpha value.\n *\n * @type {number}\n * @constant\n */\nconst DstAlphaFactor = 206;\n\n/**\n * Multiplies all colors by `1` minus the destination alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusDstAlphaFactor = 207;\n\n/**\n * Multiplies all colors by the destination color.\n *\n * @type {number}\n * @constant\n */\nconst DstColorFactor = 208;\n\n/**\n * Multiplies all colors by `1` minus each destination color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusDstColorFactor = 209;\n\n/**\n * Multiplies the RGB colors by the smaller of either the source alpha\n * value or the value of `1` minus the destination alpha value. The alpha\n * value is multiplied by `1`.\n *\n * @type {number}\n * @constant\n */\nconst SrcAlphaSaturateFactor = 210;\n\n/**\n * Multiplies all colors by a constant color.\n *\n * @type {number}\n * @constant\n */\nconst ConstantColorFactor = 211;\n\n/**\n * Multiplies all colors by `1` minus a constant color.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusConstantColorFactor = 212;\n\n/**\n * Multiplies all colors by a constant alpha value.\n *\n * @type {number}\n * @constant\n */\nconst ConstantAlphaFactor = 213;\n\n/**\n * Multiplies all colors by 1 minus a constant alpha value.\n *\n * @type {number}\n * @constant\n */\nconst OneMinusConstantAlphaFactor = 214;\n\n/**\n * Never pass.\n *\n * @type {number}\n * @constant\n */\nconst NeverDepth = 0;\n\n/**\n * Always pass.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysDepth = 1;\n\n/**\n * Pass if the incoming value is less than the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst LessDepth = 2;\n\n/**\n * Pass if the incoming value is less than or equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualDepth = 3;\n\n/**\n * Pass if the incoming value equals the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst EqualDepth = 4;\n\n/**\n * Pass if the incoming value is greater than or equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualDepth = 5;\n\n/**\n * Pass if the incoming value is greater than the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterDepth = 6;\n\n/**\n * Pass if the incoming value is not equal to the depth buffer value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualDepth = 7;\n\n/**\n * Multiplies the environment map color with the surface color.\n *\n * @type {number}\n * @constant\n */\nconst MultiplyOperation = 0;\n\n/**\n * Uses reflectivity to blend between the two colors.\n *\n * @type {number}\n * @constant\n */\nconst MixOperation = 1;\n\n/**\n * Adds the two colors.\n *\n * @type {number}\n * @constant\n */\nconst AddOperation = 2;\n\n/**\n * No tone mapping is applied.\n *\n * @type {number}\n * @constant\n */\nconst NoToneMapping = 0;\n\n/**\n * Linear tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst LinearToneMapping = 1;\n\n/**\n * Reinhard tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst ReinhardToneMapping = 2;\n\n/**\n * Cineon tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst CineonToneMapping = 3;\n\n/**\n * ACES Filmic tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst ACESFilmicToneMapping = 4;\n\n/**\n * Custom tone mapping.\n *\n * Expects a custom implementation by modifying shader code of the material's fragment shader.\n *\n * @type {number}\n * @constant\n */\nconst CustomToneMapping = 5;\n\n/**\n * AgX tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst AgXToneMapping = 6;\n\n/**\n * Neutral tone mapping.\n *\n * Implementation based on the Khronos 3D Commerce Group standard tone mapping.\n *\n * @type {number}\n * @constant\n */\nconst NeutralToneMapping = 7;\n\n/**\n * The skinned mesh shares the same world space as the skeleton.\n *\n * @type {string}\n * @constant\n */\nconst AttachedBindMode = 'attached';\n\n/**\n * The skinned mesh does not share the same world space as the skeleton.\n * This is useful when a skeleton is shared across multiple skinned meshes.\n *\n * @type {string}\n * @constant\n */\nconst DetachedBindMode = 'detached';\n\n/**\n * Maps textures using the geometry's UV coordinates.\n *\n * @type {number}\n * @constant\n */\nconst UVMapping = 300;\n\n/**\n * Reflection mapping for cube textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeReflectionMapping = 301;\n\n/**\n * Refraction mapping for cube textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeRefractionMapping = 302;\n\n/**\n * Reflection mapping for equirectangular textures.\n *\n * @type {number}\n * @constant\n */\nconst EquirectangularReflectionMapping = 303;\n\n/**\n * Refraction mapping for equirectangular textures.\n *\n * @type {number}\n * @constant\n */\nconst EquirectangularRefractionMapping = 304;\n\n/**\n * Reflection mapping for PMREM textures.\n *\n * @type {number}\n * @constant\n */\nconst CubeUVReflectionMapping = 306;\n\n/**\n * The texture will simply repeat to infinity.\n *\n * @type {number}\n * @constant\n */\nconst RepeatWrapping = 1000;\n\n/**\n * The last pixel of the texture stretches to the edge of the mesh.\n *\n * @type {number}\n * @constant\n */\nconst ClampToEdgeWrapping = 1001;\n\n/**\n * The texture will repeats to infinity, mirroring on each repeat.\n *\n * @type {number}\n * @constant\n */\nconst MirroredRepeatWrapping = 1002;\n\n/**\n * Returns the value of the texture element that is nearest (in Manhattan distance)\n * to the specified texture coordinates.\n *\n * @type {number}\n * @constant\n */\nconst NearestFilter = 1003;\n\n/**\n * Chooses the mipmap that most closely matches the size of the pixel being textured\n * and uses the `NearestFilter` criterion (the texel nearest to the center of the pixel)\n * to produce a texture value.\n *\n * @type {number}\n * @constant\n */\nconst NearestMipmapNearestFilter = 1004;\nconst NearestMipMapNearestFilter = 1004; // legacy\n\n/**\n * Chooses the two mipmaps that most closely match the size of the pixel being textured and\n * uses the `NearestFilter` criterion to produce a texture value from each mipmap.\n * The final texture value is a weighted average of those two values.\n *\n * @type {number}\n * @constant\n */\nconst NearestMipmapLinearFilter = 1005;\nconst NearestMipMapLinearFilter = 1005; // legacy\n\n/**\n * Returns the weighted average of the four texture elements that are closest to the specified\n * texture coordinates, and can include items wrapped or repeated from other parts of a texture,\n * depending on the values of `wrapS` and `wrapT`, and on the exact mapping.\n *\n * @type {number}\n * @constant\n */\nconst LinearFilter = 1006;\n\n/**\n * Chooses the mipmap that most closely matches the size of the pixel being textured and uses\n * the `LinearFilter` criterion (a weighted average of the four texels that are closest to the\n * center of the pixel) to produce a texture value.\n *\n * @type {number}\n * @constant\n */\nconst LinearMipmapNearestFilter = 1007;\nconst LinearMipMapNearestFilter = 1007; // legacy\n\n/**\n * Chooses the two mipmaps that most closely match the size of the pixel being textured and uses\n * the `LinearFilter` criterion to produce a texture value from each mipmap. The final texture value\n * is a weighted average of those two values.\n *\n * @type {number}\n * @constant\n */\nconst LinearMipmapLinearFilter = 1008;\nconst LinearMipMapLinearFilter = 1008; // legacy\n\n/**\n * An unsigned byte data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedByteType = 1009;\n\n/**\n * A byte data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst ByteType = 1010;\n\n/**\n * A short data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst ShortType = 1011;\n\n/**\n * An unsigned short data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShortType = 1012;\n\n/**\n * An int data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst IntType = 1013;\n\n/**\n * An unsigned int data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedIntType = 1014;\n\n/**\n * A float data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst FloatType = 1015;\n\n/**\n * A half float data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst HalfFloatType = 1016;\n\n/**\n * An unsigned short 4_4_4_4 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShort4444Type = 1017;\n\n/**\n * An unsigned short 5_5_5_1 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedShort5551Type = 1018;\n\n/**\n * An unsigned int 24_8 data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedInt248Type = 1020;\n\n/**\n * An unsigned int 5_9_9_9 (packed) data type for textures.\n *\n * @type {number}\n * @constant\n */\nconst UnsignedInt5999Type = 35902;\n\n/**\n * Discards the red, green and blue components and reads just the alpha component.\n *\n * @type {number}\n * @constant\n */\nconst AlphaFormat = 1021;\n\n/**\n * Discards the alpha component and reads the red, green and blue component.\n *\n * @type {number}\n * @constant\n */\nconst RGBFormat = 1022;\n\n/**\n * Reads the red, green, blue and alpha components.\n *\n * @type {number}\n * @constant\n */\nconst RGBAFormat = 1023;\n\n/**\n * Reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.\n *\n * @type {number}\n * @constant\n */\nconst DepthFormat = 1026;\n\n/**\n * Reads each element is a pair of depth and stencil values. The depth component of the pair is interpreted as\n * in `DepthFormat`. The stencil component is interpreted based on the depth + stencil internal format.\n *\n * @type {number}\n * @constant\n */\nconst DepthStencilFormat = 1027;\n\n/**\n * Discards the green, blue and alpha components and reads just the red component.\n *\n * @type {number}\n * @constant\n */\nconst RedFormat = 1028;\n\n/**\n * Discards the green, blue and alpha components and reads just the red component. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RedIntegerFormat = 1029;\n\n/**\n * Discards the alpha, and blue components and reads the red, and green components.\n *\n * @type {number}\n * @constant\n */\nconst RGFormat = 1030;\n\n/**\n * Discards the alpha, and blue components and reads the red, and green components. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGIntegerFormat = 1031;\n\n/**\n * Discards the alpha component and reads the red, green and blue component. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGBIntegerFormat = 1032;\n\n/**\n * Reads the red, green, blue and alpha components. The texels are read as integers instead of floating point.\n *\n * @type {number}\n * @constant\n */\nconst RGBAIntegerFormat = 1033;\n\n/**\n * A DXT1-compressed image in an RGB image format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_S3TC_DXT1_Format = 33776;\n\n/**\n * A DXT1-compressed image in an RGB image format with a simple on/off alpha value.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT1_Format = 33777;\n\n/**\n * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT3_Format = 33778;\n\n/**\n * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3\n * compression in how the alpha compression is done.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_S3TC_DXT5_Format = 33779;\n\n/**\n * PVRTC RGB compression in 4-bit mode. One block for each 4×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGB_PVRTC_4BPPV1_Format = 35840;\n\n/**\n * PVRTC RGB compression in 2-bit mode. One block for each 8×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGB_PVRTC_2BPPV1_Format = 35841;\n\n/**\n * PVRTC RGBA compression in 4-bit mode. One block for each 4×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_PVRTC_4BPPV1_Format = 35842;\n\n/**\n * PVRTC RGBA compression in 2-bit mode. One block for each 8×4 pixels.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_PVRTC_2BPPV1_Format = 35843;\n\n/**\n * ETC1 RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_ETC1_Format = 36196;\n\n/**\n * ETC2 RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_ETC2_Format = 37492;\n\n/**\n * ETC2 RGBA format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ETC2_EAC_Format = 37496;\n\n/**\n * ASTC RGBA 4x4 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_4x4_Format = 37808;\n\n/**\n * ASTC RGBA 5x4 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_5x4_Format = 37809;\n\n/**\n * ASTC RGBA 5x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_5x5_Format = 37810;\n\n/**\n * ASTC RGBA 6x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_6x5_Format = 37811;\n\n/**\n * ASTC RGBA 6x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_6x6_Format = 37812;\n\n/**\n * ASTC RGBA 8x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x5_Format = 37813;\n\n/**\n * ASTC RGBA 8x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x6_Format = 37814;\n\n/**\n * ASTC RGBA 8x8 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_8x8_Format = 37815;\n\n/**\n * ASTC RGBA 10x5 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x5_Format = 37816;\n\n/**\n * ASTC RGBA 10x6 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x6_Format = 37817;\n\n/**\n * ASTC RGBA 10x8 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x8_Format = 37818;\n\n/**\n * ASTC RGBA 10x10 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_10x10_Format = 37819;\n\n/**\n * ASTC RGBA 12x10 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_12x10_Format = 37820;\n\n/**\n * ASTC RGBA 12x12 format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_ASTC_12x12_Format = 37821;\n\n/**\n * BPTC RGBA format.\n *\n * @type {number}\n * @constant\n */\nconst RGBA_BPTC_Format = 36492;\n\n/**\n * BPTC Signed RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_BPTC_SIGNED_Format = 36494;\n\n/**\n * BPTC Unsigned RGB format.\n *\n * @type {number}\n * @constant\n */\nconst RGB_BPTC_UNSIGNED_Format = 36495;\n\n/**\n * RGTC1 Red format.\n *\n * @type {number}\n * @constant\n */\nconst RED_RGTC1_Format = 36283;\n\n/**\n * RGTC1 Signed Red format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_RED_RGTC1_Format = 36284;\n\n/**\n * RGTC2 Red Green format.\n *\n * @type {number}\n * @constant\n */\nconst RED_GREEN_RGTC2_Format = 36285;\n\n/**\n * RGTC2 Signed Red Green format.\n *\n * @type {number}\n * @constant\n */\nconst SIGNED_RED_GREEN_RGTC2_Format = 36286;\n\n/**\n * Animations are played once.\n *\n * @type {number}\n * @constant\n */\nconst LoopOnce = 2200;\n\n/**\n * Animations are played with a chosen number of repetitions, each time jumping from\n * the end of the clip directly to its beginning.\n *\n * @type {number}\n * @constant\n */\nconst LoopRepeat = 2201;\n\n/**\n * Animations are played with a chosen number of repetitions, alternately playing forward\n * and backward.\n *\n * @type {number}\n * @constant\n */\nconst LoopPingPong = 2202;\n\n/**\n * Discrete interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateDiscrete = 2300;\n\n/**\n * Linear interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateLinear = 2301;\n\n/**\n * Smooth interpolation mode for keyframe tracks.\n *\n * @type {number}\n * @constant\n */\nconst InterpolateSmooth = 2302;\n\n/**\n * Zero curvature ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst ZeroCurvatureEnding = 2400;\n\n/**\n * Zero slope ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst ZeroSlopeEnding = 2401;\n\n/**\n * Wrap around ending for animations.\n *\n * @type {number}\n * @constant\n */\nconst WrapAroundEnding = 2402;\n\n/**\n * Default animation blend mode.\n *\n * @type {number}\n * @constant\n */\nconst NormalAnimationBlendMode = 2500;\n\n/**\n * Additive animation blend mode. Can be used to layer motions on top of\n * each other to build complex performances from smaller re-usable assets.\n *\n * @type {number}\n * @constant\n */\nconst AdditiveAnimationBlendMode = 2501;\n\n/**\n * For every three vertices draw a single triangle.\n *\n * @type {number}\n * @constant\n */\nconst TrianglesDrawMode = 0;\n\n/**\n * For each vertex draw a triangle from the last three vertices.\n *\n * @type {number}\n * @constant\n */\nconst TriangleStripDrawMode = 1;\n\n/**\n * For each vertex draw a triangle from the first vertex and the last two vertices.\n *\n * @type {number}\n * @constant\n */\nconst TriangleFanDrawMode = 2;\n\n/**\n * Basic depth packing.\n *\n * @type {number}\n * @constant\n */\nconst BasicDepthPacking = 3200;\n\n/**\n * A depth value is packed into 32 bit RGBA.\n *\n * @type {number}\n * @constant\n */\nconst RGBADepthPacking = 3201;\n\n/**\n * A depth value is packed into 24 bit RGB.\n *\n * @type {number}\n * @constant\n */\nconst RGBDepthPacking = 3202;\n\n/**\n * A depth value is packed into 16 bit RG.\n *\n * @type {number}\n * @constant\n */\nconst RGDepthPacking = 3203;\n\n/**\n * Normal information is relative to the underlying surface.\n *\n * @type {number}\n * @constant\n */\nconst TangentSpaceNormalMap = 0;\n\n/**\n * Normal information is relative to the object orientation.\n *\n * @type {number}\n * @constant\n */\nconst ObjectSpaceNormalMap = 1;\n\n// Color space string identifiers, matching CSS Color Module Level 4 and WebGPU names where available.\n\n/**\n * No color space.\n *\n * @type {string}\n * @constant\n */\nconst NoColorSpace = '';\n\n/**\n * sRGB color space.\n *\n * @type {string}\n * @constant\n */\nconst SRGBColorSpace = 'srgb';\n\n/**\n * sRGB-linear color space.\n *\n * @type {string}\n * @constant\n */\nconst LinearSRGBColorSpace = 'srgb-linear';\n\n/**\n * Linear transfer function.\n *\n * @type {string}\n * @constant\n */\nconst LinearTransfer = 'linear';\n\n/**\n * sRGB transfer function.\n *\n * @type {string}\n * @constant\n */\nconst SRGBTransfer = 'srgb';\n\n/**\n * Sets the stencil buffer value to `0`.\n *\n * @type {number}\n * @constant\n */\nconst ZeroStencilOp = 0;\n\n/**\n * Keeps the current value.\n *\n * @type {number}\n * @constant\n */\nconst KeepStencilOp = 7680;\n\n/**\n * Sets the stencil buffer value to the specified reference value.\n *\n * @type {number}\n * @constant\n */\nconst ReplaceStencilOp = 7681;\n\n/**\n * Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.\n *\n * @type {number}\n * @constant\n */\nconst IncrementStencilOp = 7682;\n\n/**\n * Decrements the current stencil buffer value. Clamps to `0`.\n *\n * @type {number}\n * @constant\n */\nconst DecrementStencilOp = 7683;\n\n/**\n * Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing\n * the maximum representable unsigned value.\n *\n * @type {number}\n * @constant\n */\nconst IncrementWrapStencilOp = 34055;\n\n/**\n * Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable\n * unsigned value when decrementing a stencil buffer value of `0`.\n *\n * @type {number}\n * @constant\n */\nconst DecrementWrapStencilOp = 34056;\n\n/**\n * Inverts the current stencil buffer value bitwise.\n *\n * @type {number}\n * @constant\n */\nconst InvertStencilOp = 5386;\n\n/**\n * Will never return true.\n *\n * @type {number}\n * @constant\n */\nconst NeverStencilFunc = 512;\n\n/**\n * Will return true if the stencil reference value is less than the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst LessStencilFunc = 513;\n\n/**\n * Will return true if the stencil reference value is equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst EqualStencilFunc = 514;\n\n/**\n * Will return true if the stencil reference value is less than or equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualStencilFunc = 515;\n\n/**\n * Will return true if the stencil reference value is greater than the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterStencilFunc = 516;\n\n/**\n * Will return true if the stencil reference value is not equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualStencilFunc = 517;\n\n/**\n * Will return true if the stencil reference value is greater than or equal to the current stencil value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualStencilFunc = 518;\n\n/**\n * Will always return true.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysStencilFunc = 519;\n\n/**\n * Never pass.\n *\n * @type {number}\n * @constant\n */\nconst NeverCompare = 512;\n\n/**\n * Pass if the incoming value is less than the texture value.\n *\n * @type {number}\n * @constant\n */\nconst LessCompare = 513;\n\n/**\n * Pass if the incoming value equals the texture value.\n *\n * @type {number}\n * @constant\n */\nconst EqualCompare = 514;\n\n/**\n * Pass if the incoming value is less than or equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst LessEqualCompare = 515;\n\n/**\n * Pass if the incoming value is greater than the texture value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterCompare = 516;\n\n/**\n * Pass if the incoming value is not equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst NotEqualCompare = 517;\n\n/**\n * Pass if the incoming value is greater than or equal to the texture value.\n *\n * @type {number}\n * @constant\n */\nconst GreaterEqualCompare = 518;\n\n/**\n * Always pass.\n *\n * @type {number}\n * @constant\n */\nconst AlwaysCompare = 519;\n\n/**\n * The contents are intended to be specified once by the application, and used many\n * times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StaticDrawUsage = 35044;\n\n/**\n * The contents are intended to be respecified repeatedly by the application, and\n * used many times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst DynamicDrawUsage = 35048;\n\n/**\n * The contents are intended to be specified once by the application, and used at most\n * a few times as the source for drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StreamDrawUsage = 35040;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and queried\n * many times by the application.\n *\n * @type {number}\n * @constant\n */\nconst StaticReadUsage = 35045;\n\n/**\n * The contents are intended to be respecified repeatedly by reading data from the 3D API, and queried\n * many times by the application.\n *\n * @type {number}\n * @constant\n */\nconst DynamicReadUsage = 35049;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and queried at most\n * a few times by the application\n *\n * @type {number}\n * @constant\n */\nconst StreamReadUsage = 35041;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and used many times as\n * the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StaticCopyUsage = 35046;\n\n/**\n * The contents are intended to be respecified repeatedly by reading data from the 3D API, and used many times\n * as the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst DynamicCopyUsage = 35050;\n\n/**\n * The contents are intended to be specified once by reading data from the 3D API, and used at most a few times\n * as the source for WebGL drawing and image specification commands.\n *\n * @type {number}\n * @constant\n */\nconst StreamCopyUsage = 35042;\n\n/**\n * GLSL 1 shader code.\n *\n * @type {string}\n * @constant\n */\nconst GLSL1 = '100';\n\n/**\n * GLSL 3 shader code.\n *\n * @type {string}\n * @constant\n */\nconst GLSL3 = '300 es';\n\n/**\n * WebGL coordinate system.\n *\n * @type {number}\n * @constant\n */\nconst WebGLCoordinateSystem = 2000;\n\n/**\n * WebGPU coordinate system.\n *\n * @type {number}\n * @constant\n */\nconst WebGPUCoordinateSystem = 2001;\n\n/**\n * Represents the different timestamp query types.\n *\n * @type {ConstantsTimestampQuery}\n * @constant\n */\nconst TimestampQuery = {\n\tCOMPUTE: 'compute',\n\tRENDER: 'render'\n};\n\n/**\n * Represents mouse buttons and interaction types in context of controls.\n *\n * @type {ConstantsInterpolationSamplingType}\n * @constant\n */\nconst InterpolationSamplingType = {\n\tPERSPECTIVE: 'perspective',\n\tLINEAR: 'linear',\n\tFLAT: 'flat'\n};\n\n/**\n * Represents the different interpolation sampling modes.\n *\n * @type {ConstantsInterpolationSamplingMode}\n * @constant\n */\nconst InterpolationSamplingMode = {\n\tNORMAL: 'normal',\n\tCENTROID: 'centroid',\n\tSAMPLE: 'sample',\n\tFIRST: 'first',\n\tEITHER: 'either'\n};\n\n/**\n * This type represents mouse buttons and interaction types in context of controls.\n *\n * @typedef {Object} ConstantsMouse\n * @property {number} MIDDLE - The left mouse button.\n * @property {number} LEFT - The middle mouse button.\n * @property {number} RIGHT - The right mouse button.\n * @property {number} ROTATE - A rotate interaction.\n * @property {number} DOLLY - A dolly interaction.\n * @property {number} PAN - A pan interaction.\n **/\n\n/**\n * This type represents touch interaction types in context of controls.\n *\n * @typedef {Object} ConstantsTouch\n * @property {number} ROTATE - A rotate interaction.\n * @property {number} PAN - A pan interaction.\n * @property {number} DOLLY_PAN - The dolly-pan interaction.\n * @property {number} DOLLY_ROTATE - A dolly-rotate interaction.\n **/\n\n/**\n * This type represents the different timestamp query types.\n *\n * @typedef {Object} ConstantsTimestampQuery\n * @property {string} COMPUTE - A `compute` timestamp query.\n * @property {string} RENDER - A `render` timestamp query.\n **/\n\n/**\n * Represents the different interpolation sampling types.\n *\n * @typedef {Object} ConstantsInterpolationSamplingType\n * @property {string} PERSPECTIVE - Perspective-correct interpolation.\n * @property {string} LINEAR - Linear interpolation.\n * @property {string} FLAT - Flat interpolation.\n */\n\n/**\n * Represents the different interpolation sampling modes.\n *\n * @typedef {Object} ConstantsInterpolationSamplingMode\n * @property {string} NORMAL - Normal sampling mode.\n * @property {string} CENTROID - Centroid sampling mode.\n * @property {string} SAMPLE - Sample-specific sampling mode.\n * @property {string} FLAT_FIRST - Flat interpolation using the first vertex.\n * @property {string} FLAT_EITHER - Flat interpolation using either vertex.\n */\n\n/**\n * This modules allows to dispatch event objects on custom JavaScript objects.\n *\n * Main repository: [eventdispatcher.js]{@link https://github.com/mrdoob/eventdispatcher.js/}\n *\n * Code Example:\n * ```js\n * class Car extends EventDispatcher {\n * \tstart() {\n *\t\tthis.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );\n *\t}\n *};\n *\n * // Using events with the custom object\n * const car = new Car();\n * car.addEventListener( 'start', function ( event ) {\n * \talert( event.message );\n * } );\n *\n * car.start();\n * ```\n */\nclass EventDispatcher {\n\n\t/**\n\t * Adds the given event listener to the given event type.\n\t *\n\t * @param {string} type - The type of event to listen to.\n\t * @param {Function} listener - The function that gets called when the event is fired.\n\t */\n\taddEventListener( type, listener ) {\n\n\t\tif ( this._listeners === undefined ) this._listeners = {};\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners[ type ] === undefined ) {\n\n\t\t\tlisteners[ type ] = [];\n\n\t\t}\n\n\t\tif ( listeners[ type ].indexOf( listener ) === -1 ) {\n\n\t\t\tlisteners[ type ].push( listener );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns `true` if the given event listener has been added to the given event type.\n\t *\n\t * @param {string} type - The type of event.\n\t * @param {Function} listener - The listener to check.\n\t * @return {boolean} Whether the given event listener has been added to the given event type.\n\t */\n\thasEventListener( type, listener ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return false;\n\n\t\treturn listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== -1;\n\n\t}\n\n\t/**\n\t * Removes the given event listener from the given event type.\n\t *\n\t * @param {string} type - The type of event.\n\t * @param {Function} listener - The listener to remove.\n\t */\n\tremoveEventListener( type, listener ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return;\n\n\t\tconst listenerArray = listeners[ type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tconst index = listenerArray.indexOf( listener );\n\n\t\t\tif ( index !== -1 ) {\n\n\t\t\t\tlistenerArray.splice( index, 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Dispatches an event object.\n\t *\n\t * @param {Object} event - The event that gets fired.\n\t */\n\tdispatchEvent( event ) {\n\n\t\tconst listeners = this._listeners;\n\n\t\tif ( listeners === undefined ) return;\n\n\t\tconst listenerArray = listeners[ event.type ];\n\n\t\tif ( listenerArray !== undefined ) {\n\n\t\t\tevent.target = this;\n\n\t\t\t// Make a copy, in case listeners are removed while iterating.\n\t\t\tconst array = listenerArray.slice( 0 );\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\n\n\t\t\t\tarray[ i ].call( this, event );\n\n\t\t\t}\n\n\t\t\tevent.target = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _lut = [ '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' ];\n\nlet _seed = 1234567;\n\n\nconst DEG2RAD = Math.PI / 180;\nconst RAD2DEG = 180 / Math.PI;\n\n/**\n * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}\n * (universally unique identifier).\n *\n * @return {string} The UUID.\n */\nfunction generateUUID() {\n\n\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\tconst d0 = Math.random() * 0xffffffff | 0;\n\tconst d1 = Math.random() * 0xffffffff | 0;\n\tconst d2 = Math.random() * 0xffffffff | 0;\n\tconst d3 = Math.random() * 0xffffffff | 0;\n\tconst uuid = _lut[ d0 & 0xff ] + _lut[ d0 >> 8 & 0xff ] + _lut[ d0 >> 16 & 0xff ] + _lut[ d0 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d1 & 0xff ] + _lut[ d1 >> 8 & 0xff ] + '-' + _lut[ d1 >> 16 & 0x0f | 0x40 ] + _lut[ d1 >> 24 & 0xff ] + '-' +\n\t\t\t_lut[ d2 & 0x3f | 0x80 ] + _lut[ d2 >> 8 & 0xff ] + '-' + _lut[ d2 >> 16 & 0xff ] + _lut[ d2 >> 24 & 0xff ] +\n\t\t\t_lut[ d3 & 0xff ] + _lut[ d3 >> 8 & 0xff ] + _lut[ d3 >> 16 & 0xff ] + _lut[ d3 >> 24 & 0xff ];\n\n\t// .toLowerCase() here flattens concatenated strings to save heap memory space.\n\treturn uuid.toLowerCase();\n\n}\n\n/**\n * Clamps the given value between min and max.\n *\n * @param {number} value - The value to clamp.\n * @param {number} min - The min value.\n * @param {number} max - The max value.\n * @return {number} The clamped value.\n */\nfunction clamp( value, min, max ) {\n\n\treturn Math.max( min, Math.min( max, value ) );\n\n}\n\n/**\n * Computes the Euclidean modulo of the given parameters that\n * is `( ( n % m ) + m ) % m`.\n *\n * @param {number} n - The first parameter.\n * @param {number} m - The second parameter.\n * @return {number} The Euclidean modulo.\n */\nfunction euclideanModulo( n, m ) {\n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\treturn ( ( n % m ) + m ) % m;\n\n}\n\n/**\n * Performs a linear mapping from range `<a1, a2>` to range `<b1, b2>`\n * for the given value.\n *\n * @param {number} x - The value to be mapped.\n * @param {number} a1 - Minimum value for range A.\n * @param {number} a2 - Maximum value for range A.\n * @param {number} b1 - Minimum value for range B.\n * @param {number} b2 - Maximum value for range B.\n * @return {number} The mapped value.\n */\nfunction mapLinear( x, a1, a2, b1, b2 ) {\n\n\treturn b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );\n\n}\n\n/**\n * Returns the percentage in the closed interval `[0, 1]` of the given value\n * between the start and end point.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} value - A value between start and end.\n * @return {number} The interpolation factor.\n */\nfunction inverseLerp( x, y, value ) {\n\n\t// https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\tif ( x !== y ) {\n\n\t\treturn ( value - x ) / ( y - x );\n\n\t} else {\n\n\t\treturn 0;\n\n\t}\n\n}\n\n/**\n * Returns a value linearly interpolated from two known points based on the given interval -\n * `t = 0` will return `x` and `t = 1` will return `y`.\n *\n * @param {number} x - The start point\n * @param {number} y - The end point.\n * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n * @return {number} The interpolated value.\n */\nfunction lerp( x, y, t ) {\n\n\treturn ( 1 - t ) * x + t * y;\n\n}\n\n/**\n * Smoothly interpolate a number from `x` to `y` in  a spring-like manner using a delta\n * time to maintain frame rate independent movement. For details, see\n * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.\n *\n * @param {number} x - The current point.\n * @param {number} y - The target point.\n * @param {number} lambda - A higher lambda value will make the movement more sudden,\n * and a lower value will make the movement more gradual.\n * @param {number} dt - Delta time in seconds.\n * @return {number} The interpolated value.\n */\nfunction damp( x, y, lambda, dt ) {\n\n\treturn lerp( x, y, 1 - Math.exp( - lambda * dt ) );\n\n}\n\n/**\n * Returns a value that alternates between `0` and the given `length` parameter.\n *\n * @param {number} x - The value to pingpong.\n * @param {number} [length=1] - The positive value the function will pingpong to.\n * @return {number} The alternated value.\n */\nfunction pingpong( x, length = 1 ) {\n\n\t// https://www.desmos.com/calculator/vcsjnyz7x4\n\n\treturn length - Math.abs( euclideanModulo( x, length * 2 ) - length );\n\n}\n\n/**\n * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n * the `min` and `max`.\n *\n * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smoothstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * ( 3 - 2 * x );\n\n}\n\n/**\n * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n *\n * @param {number} x - The value to evaluate based on its position between min and max.\n * @param {number} min - The min value. Any x value below min will be `0`.\n * @param {number} max - The max value. Any x value above max will be `1`.\n * @return {number} The alternated value.\n */\nfunction smootherstep( x, min, max ) {\n\n\tif ( x <= min ) return 0;\n\tif ( x >= max ) return 1;\n\n\tx = ( x - min ) / ( max - min );\n\n\treturn x * x * x * ( x * ( x * 6 - 15 ) + 10 );\n\n}\n\n/**\n * Returns a random integer from `<low, high>` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random integer.\n */\nfunction randInt( low, high ) {\n\n\treturn low + Math.floor( Math.random() * ( high - low + 1 ) );\n\n}\n\n/**\n * Returns a random float from `<low, high>` interval.\n *\n * @param {number} low - The lower value boundary.\n * @param {number} high - The upper value boundary\n * @return {number} A random float.\n */\nfunction randFloat( low, high ) {\n\n\treturn low + Math.random() * ( high - low );\n\n}\n\n/**\n * Returns a random integer from `<-range/2, range/2>` interval.\n *\n * @param {number} range - Defines the value range.\n * @return {number} A random float.\n */\nfunction randFloatSpread( range ) {\n\n\treturn range * ( 0.5 - Math.random() );\n\n}\n\n/**\n * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n *\n * @param {number} [s] - The integer seed.\n * @return {number} A random float.\n */\nfunction seededRandom( s ) {\n\n\tif ( s !== undefined ) _seed = s;\n\n\t// Mulberry32 generator\n\n\tlet t = _seed += 0x6D2B79F5;\n\n\tt = Math.imul( t ^ t >>> 15, t | 1 );\n\n\tt ^= t + Math.imul( t ^ t >>> 7, t | 61 );\n\n\treturn ( ( t ^ t >>> 14 ) >>> 0 ) / 4294967296;\n\n}\n\n/**\n * Converts degrees to radians.\n *\n * @param {number} degrees - A value in degrees.\n * @return {number} The converted value in radians.\n */\nfunction degToRad( degrees ) {\n\n\treturn degrees * DEG2RAD;\n\n}\n\n/**\n * Converts radians to degrees.\n *\n * @param {number} radians - A value in radians.\n * @return {number} The converted value in degrees.\n */\nfunction radToDeg( radians ) {\n\n\treturn radians * RAD2DEG;\n\n}\n\n/**\n * Returns `true` if the given number is a power of two.\n *\n * @param {number} value - The value to check.\n * @return {boolean} Whether the given number is a power of two or not.\n */\nfunction isPowerOfTwo( value ) {\n\n\treturn ( value & ( value - 1 ) ) === 0 && value !== 0;\n\n}\n\n/**\n * Returns the smallest power of two that is greater than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The smallest power of two that is greater than or equal to the given number.\n */\nfunction ceilPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Returns the largest power of two that is less than or equal to the given number.\n *\n * @param {number} value - The value to find a POT for.\n * @return {number} The largest power of two that is less than or equal to the given number.\n */\nfunction floorPowerOfTwo( value ) {\n\n\treturn Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );\n\n}\n\n/**\n * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}\n * defined by the given angles and order.\n *\n * Rotations are applied to the axes in the order specified by order:\n * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n *\n * @param {Quaternion} q - The quaternion to set.\n * @param {number} a - The rotation applied to the first axis, in radians.\n * @param {number} b - The rotation applied to the second axis, in radians.\n * @param {number} c - The rotation applied to the third axis, in radians.\n * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n */\nfunction setQuaternionFromProperEuler( q, a, b, c, order ) {\n\n\tconst cos = Math.cos;\n\tconst sin = Math.sin;\n\n\tconst c2 = cos( b / 2 );\n\tconst s2 = sin( b / 2 );\n\n\tconst c13 = cos( ( a + c ) / 2 );\n\tconst s13 = sin( ( a + c ) / 2 );\n\n\tconst c1_3 = cos( ( a - c ) / 2 );\n\tconst s1_3 = sin( ( a - c ) / 2 );\n\n\tconst c3_1 = cos( ( c - a ) / 2 );\n\tconst s3_1 = sin( ( c - a ) / 2 );\n\n\tswitch ( order ) {\n\n\t\tcase 'XYX':\n\t\t\tq.set( c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YZY':\n\t\t\tq.set( s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZXZ':\n\t\t\tq.set( s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'XZX':\n\t\t\tq.set( c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'YXY':\n\t\t\tq.set( s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13 );\n\t\t\tbreak;\n\n\t\tcase 'ZYZ':\n\t\t\tq.set( s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13 );\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );\n\n\t}\n\n}\n\n/**\n * Denormalizes the given value according to the given typed array.\n *\n * @param {number} value - The value to denormalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The denormalize (float) value in the range `[0,1]`.\n */\nfunction denormalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn value / 4294967295.0;\n\n\t\tcase Uint16Array:\n\n\t\t\treturn value / 65535.0;\n\n\t\tcase Uint8Array:\n\n\t\t\treturn value / 255.0;\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.max( value / 2147483647.0, -1 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.max( value / 32767.0, -1 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.max( value / 127.0, -1 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * Normalizes the given value according to the given typed array.\n *\n * @param {number} value - The float value in the range `[0,1]` to normalize.\n * @param {TypedArray} array - The typed array that defines the data type of the value.\n * @return {number} The normalize value.\n */\nfunction normalize( value, array ) {\n\n\tswitch ( array.constructor ) {\n\n\t\tcase Float32Array:\n\n\t\t\treturn value;\n\n\t\tcase Uint32Array:\n\n\t\t\treturn Math.round( value * 4294967295.0 );\n\n\t\tcase Uint16Array:\n\n\t\t\treturn Math.round( value * 65535.0 );\n\n\t\tcase Uint8Array:\n\n\t\t\treturn Math.round( value * 255.0 );\n\n\t\tcase Int32Array:\n\n\t\t\treturn Math.round( value * 2147483647.0 );\n\n\t\tcase Int16Array:\n\n\t\t\treturn Math.round( value * 32767.0 );\n\n\t\tcase Int8Array:\n\n\t\t\treturn Math.round( value * 127.0 );\n\n\t\tdefault:\n\n\t\t\tthrow new Error( 'Invalid component type.' );\n\n\t}\n\n}\n\n/**\n * @class\n * @classdesc A collection of math utility functions.\n * @hideconstructor\n */\nconst MathUtils = {\n\tDEG2RAD: DEG2RAD,\n\tRAD2DEG: RAD2DEG,\n\t/**\n\t * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}\n\t * (universally unique identifier).\n\t *\n\t * @static\n\t * @method\n\t * @return {string} The UUID.\n\t */\n\tgenerateUUID: generateUUID,\n\t/**\n\t * Clamps the given value between min and max.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to clamp.\n\t * @param {number} min - The min value.\n\t * @param {number} max - The max value.\n\t * @return {number} The clamped value.\n\t */\n\tclamp: clamp,\n\t/**\n\t * Computes the Euclidean modulo of the given parameters that\n\t * is `( ( n % m ) + m ) % m`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} n - The first parameter.\n\t * @param {number} m - The second parameter.\n\t * @return {number} The Euclidean modulo.\n\t */\n\teuclideanModulo: euclideanModulo,\n\t/**\n\t * Performs a linear mapping from range `<a1, a2>` to range `<b1, b2>`\n\t * for the given value.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to be mapped.\n\t * @param {number} a1 - Minimum value for range A.\n\t * @param {number} a2 - Maximum value for range A.\n\t * @param {number} b1 - Minimum value for range B.\n\t * @param {number} b2 - Maximum value for range B.\n\t * @return {number} The mapped value.\n\t */\n\tmapLinear: mapLinear,\n\t/**\n\t * Returns the percentage in the closed interval `[0, 1]` of the given value\n\t * between the start and end point.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} value - A value between start and end.\n\t * @return {number} The interpolation factor.\n\t */\n\tinverseLerp: inverseLerp,\n\t/**\n\t * Returns a value linearly interpolated from two known points based on the given interval -\n\t * `t = 0` will return `x` and `t = 1` will return `y`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The start point\n\t * @param {number} y - The end point.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {number} The interpolated value.\n\t */\n\tlerp: lerp,\n\t/**\n\t * Smoothly interpolate a number from `x` to `y` in  a spring-like manner using a delta\n\t * time to maintain frame rate independent movement. For details, see\n\t * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The current point.\n\t * @param {number} y - The target point.\n\t * @param {number} lambda - A higher lambda value will make the movement more sudden,\n\t * and a lower value will make the movement more gradual.\n\t * @param {number} dt - Delta time in seconds.\n\t * @return {number} The interpolated value.\n\t */\n\tdamp: damp,\n\t/**\n\t * Returns a value that alternates between `0` and the given `length` parameter.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to pingpong.\n\t * @param {number} [length=1] - The positive value the function will pingpong to.\n\t * @return {number} The alternated value.\n\t */\n\tpingpong: pingpong,\n\t/**\n\t * Returns a value in the range `[0,1]` that represents the percentage that `x` has\n\t * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to\n\t * the `min` and `max`.\n\t *\n\t * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmoothstep: smoothstep,\n\t/**\n\t * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n\t * that has zero 1st and 2nd order derivatives at x=0 and x=1.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} x - The value to evaluate based on its position between min and max.\n\t * @param {number} min - The min value. Any x value below min will be `0`.\n\t * @param {number} max - The max value. Any x value above max will be `1`.\n\t * @return {number} The alternated value.\n\t */\n\tsmootherstep: smootherstep,\n\t/**\n\t * Returns a random integer from `<low, high>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random integer.\n\t */\n\trandInt: randInt,\n\t/**\n\t * Returns a random float from `<low, high>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} low - The lower value boundary.\n\t * @param {number} high - The upper value boundary\n\t * @return {number} A random float.\n\t */\n\trandFloat: randFloat,\n\t/**\n\t * Returns a random integer from `<-range/2, range/2>` interval.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} range - Defines the value range.\n\t * @return {number} A random float.\n\t */\n\trandFloatSpread: randFloatSpread,\n\t/**\n\t * Returns a deterministic pseudo-random float in the interval `[0, 1]`.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} [s] - The integer seed.\n\t * @return {number} A random float.\n\t */\n\tseededRandom: seededRandom,\n\t/**\n\t * Converts degrees to radians.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} degrees - A value in degrees.\n\t * @return {number} The converted value in radians.\n\t */\n\tdegToRad: degToRad,\n\t/**\n\t * Converts radians to degrees.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} radians - A value in radians.\n\t * @return {number} The converted value in degrees.\n\t */\n\tradToDeg: radToDeg,\n\t/**\n\t * Returns `true` if the given number is a power of two.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to check.\n\t * @return {boolean} Whether the given number is a power of two or not.\n\t */\n\tisPowerOfTwo: isPowerOfTwo,\n\t/**\n\t * Returns the smallest power of two that is greater than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The smallest power of two that is greater than or equal to the given number.\n\t */\n\tceilPowerOfTwo: ceilPowerOfTwo,\n\t/**\n\t * Returns the largest power of two that is less than or equal to the given number.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to find a POT for.\n\t * @return {number} The largest power of two that is less than or equal to the given number.\n\t */\n\tfloorPowerOfTwo: floorPowerOfTwo,\n\t/**\n\t * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}\n\t * defined by the given angles and order.\n\t *\n\t * Rotations are applied to the axes in the order specified by order:\n\t * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`.\n\t *\n\t * @static\n\t * @method\n\t * @param {Quaternion} q - The quaternion to set.\n\t * @param {number} a - The rotation applied to the first axis, in radians.\n\t * @param {number} b - The rotation applied to the second axis, in radians.\n\t * @param {number} c - The rotation applied to the third axis, in radians.\n\t * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order.\n\t */\n\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler,\n\t/**\n\t * Normalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The float value in the range `[0,1]` to normalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The normalize value.\n\t */\n\tnormalize: normalize,\n\t/**\n\t * Denormalizes the given value according to the given typed array.\n\t *\n\t * @static\n\t * @method\n\t * @param {number} value - The value to denormalize.\n\t * @param {TypedArray} array - The typed array that defines the data type of the value.\n\t * @return {number} The denormalize (float) value in the range `[0,1]`.\n\t */\n\tdenormalize: denormalize\n};\n\n/**\n * Class representing a 2D vector. A 2D vector is an ordered pair of numbers\n * (labeled x and y), which can be used to represent a number of things, such as:\n *\n * - A point in 2D space (i.e. a position on a plane).\n * - A direction and length across a plane. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0)` to `(x, y)`\n * and the direction is also measured from `(0, 0)` towards `(x, y)`.\n * - Any arbitrary ordered pair of numbers.\n *\n * There are other things a 2D vector can be used to represent, such as\n * momentum vectors, complex numbers and so on, however these are the most\n * common uses in three.js.\n *\n * Iterating through a vector instance will yield its components `(x, y)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector2( 0, 1 );\n *\n * //no arguments; will be initialised to (0, 0)\n * const b = new THREE.Vector2( );\n *\n * const d = a.distanceTo( b );\n * ```\n */\nclass Vector2 {\n\n\t/**\n\t * Constructs a new 2D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t */\n\tconstructor( x = 0, y = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector2.prototype.isVector2 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector2#x}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.x;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.x = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector2#y}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.y;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.y = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tset( x, y ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n\t * @param {number} value - The value to set.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to copy.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to add.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector2} a - The first vector.\n\t * @param {Vector2} b - The second vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector2} v - The vector to subtract.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector2} a - The first vector.\n\t * @param {Vector2} b - The second vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to multiply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector2} v - The vector to divide.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Multiplies this vector (with an implicit 1 as the 3rd component) by\n\t * the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to apply.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is greater than the given vector's x or y\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is less than the given vector's x or y\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector2} v - The vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y value is greater than the max vector's x or y\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x or y value is less than the min vector's x or y value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector2} min - The minimum x and y values.\n\t * @param {Vector2} max - The maximum x and y values in the desired range.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x or y values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x or y values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x and y = -y.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y;\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vector with this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the cross product with.\n\t * @return {number} The result of the cross product.\n\t */\n\tcross( v ) {\n\n\t\treturn this.x * v.y - this.y * v.x;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0) to (x, y). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0) to (x, y).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Computes the angle in radians of this vector with respect to the positive x-axis.\n\t *\n\t * @return {number} The angle in radians.\n\t */\n\tangle() {\n\n\t\tconst angle = Math.atan2( - this.y, - this.x ) + Math.PI;\n\n\t\treturn angle;\n\n\t}\n\n\t/**\n\t * Returns the angle between the given vector and this instance in radians.\n\t *\n\t * @param {Vector2} v - The vector to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, -1, 1 ) );\n\n\t}\n\n\t/**\n\t * Computes the distance from the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\t/**\n\t * Computes the squared distance from the given vector to this instance.\n\t * If you are just comparing the distance with another distance, you should compare\n\t * the distance squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @param {Vector2} v - The vector to compute the squared distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y;\n\t\treturn dx * dx + dy * dy;\n\n\t}\n\n\t/**\n\t * Computes the Manhattan distance from the given vector to this instance.\n\t *\n\t * @param {Vector2} v - The vector to compute the Manhattan distance to.\n\t * @return {number} The Manhattan distance.\n\t */\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector2} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector2} v1 - The first vector.\n\t * @param {Vector2} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector2} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]` and y\n\t * value to be `array[ offset + 1 ]`.\n\t *\n\t * @param {Array<number>} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates this vector around the given center by the given angle.\n\t *\n\t * @param {Vector2} center - The point around which to rotate.\n\t * @param {number} angle - The angle to rotate, in radians.\n\t * @return {Vector2} A reference to this vector.\n\t */\n\trotateAround( center, angle ) {\n\n\t\tconst c = Math.cos( angle ), s = Math.sin( angle );\n\n\t\tconst x = this.x - center.x;\n\t\tconst y = this.y - center.y;\n\n\t\tthis.x = x * c - y * s + center.x;\n\t\tthis.y = x * s + y * c + center.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector2} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\n\t}\n\n}\n\n/**\n * Class for representing a Quaternion. Quaternions are used in three.js to represent rotations.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n *\n * Note that three.js expects Quaternions to be normalized.\n * ```js\n * const quaternion = new THREE.Quaternion();\n * quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 );\n *\n * const vector = new THREE.Vector3( 1, 0, 0 );\n * vector.applyQuaternion( quaternion );\n * ```\n */\nclass Quaternion {\n\n\t/**\n\t * Constructs a new quaternion.\n\t *\n\t * @param {number} [x=0] - The x value of this quaternion.\n\t * @param {number} [y=0] - The y value of this quaternion.\n\t * @param {number} [z=0] - The z value of this quaternion.\n\t * @param {number} [w=1] - The w value of this quaternion.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuaternion = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t}\n\n\t/**\n\t * Interpolates between two quaternions via SLERP. This implementation assumes the\n\t * quaternion data are managed  in flat arrays.\n\t *\n\t * @param {Array<number>} dst - The destination array.\n\t * @param {number} dstOffset - An offset into the destination array.\n\t * @param {Array<number>} src0 - The source array of the first quaternion.\n\t * @param {number} srcOffset0 - An offset into the first source array.\n\t * @param {Array<number>} src1 -  The source array of the second quaternion.\n\t * @param {number} srcOffset1 - An offset into the second source array.\n\t * @param {number} t - The interpolation factor in the range `[0,1]`.\n\t * @see {@link Quaternion#slerp}\n\t */\n\tstatic slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {\n\n\t\t// fuzz-free, array-based Quaternion SLERP operation\n\n\t\tlet x0 = src0[ srcOffset0 + 0 ],\n\t\t\ty0 = src0[ srcOffset0 + 1 ],\n\t\t\tz0 = src0[ srcOffset0 + 2 ],\n\t\t\tw0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 + 0 ],\n\t\t\ty1 = src1[ srcOffset1 + 1 ],\n\t\t\tz1 = src1[ srcOffset1 + 2 ],\n\t\t\tw1 = src1[ srcOffset1 + 3 ];\n\n\t\tif ( t === 0 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x0;\n\t\t\tdst[ dstOffset + 1 ] = y0;\n\t\t\tdst[ dstOffset + 2 ] = z0;\n\t\t\tdst[ dstOffset + 3 ] = w0;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( t === 1 ) {\n\n\t\t\tdst[ dstOffset + 0 ] = x1;\n\t\t\tdst[ dstOffset + 1 ] = y1;\n\t\t\tdst[ dstOffset + 2 ] = z1;\n\t\t\tdst[ dstOffset + 3 ] = w1;\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {\n\n\t\t\tlet s = 1 - t;\n\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\tdir = ( cos >= 0 ? 1 : -1 ),\n\t\t\t\tsqrSin = 1 - cos * cos;\n\n\t\t\t// Skip the Slerp for tiny steps to avoid numeric problems:\n\t\t\tif ( sqrSin > Number.EPSILON ) {\n\n\t\t\t\tconst sin = Math.sqrt( sqrSin ),\n\t\t\t\t\tlen = Math.atan2( sin, cos * dir );\n\n\t\t\t\ts = Math.sin( s * len ) / sin;\n\t\t\t\tt = Math.sin( t * len ) / sin;\n\n\t\t\t}\n\n\t\t\tconst tDir = t * dir;\n\n\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\tw0 = w0 * s + w1 * tDir;\n\n\t\t\t// Normalize in case we just did a lerp:\n\t\t\tif ( s === 1 - t ) {\n\n\t\t\t\tconst f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );\n\n\t\t\t\tx0 *= f;\n\t\t\t\ty0 *= f;\n\t\t\t\tz0 *= f;\n\t\t\t\tw0 *= f;\n\n\t\t\t}\n\n\t\t}\n\n\t\tdst[ dstOffset ] = x0;\n\t\tdst[ dstOffset + 1 ] = y0;\n\t\tdst[ dstOffset + 2 ] = z0;\n\t\tdst[ dstOffset + 3 ] = w0;\n\n\t}\n\n\t/**\n\t * Multiplies two quaternions. This implementation assumes the quaternion data are managed\n\t * in flat arrays.\n\t *\n\t * @param {Array<number>} dst - The destination array.\n\t * @param {number} dstOffset - An offset into the destination array.\n\t * @param {Array<number>} src0 - The source array of the first quaternion.\n\t * @param {number} srcOffset0 - An offset into the first source array.\n\t * @param {Array<number>} src1 -  The source array of the second quaternion.\n\t * @param {number} srcOffset1 - An offset into the second source array.\n\t * @return {Array<number>} The destination array.\n\t * @see {@link Quaternion#multiplyQuaternions}.\n\t */\n\tstatic multiplyQuaternionsFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1 ) {\n\n\t\tconst x0 = src0[ srcOffset0 ];\n\t\tconst y0 = src0[ srcOffset0 + 1 ];\n\t\tconst z0 = src0[ srcOffset0 + 2 ];\n\t\tconst w0 = src0[ srcOffset0 + 3 ];\n\n\t\tconst x1 = src1[ srcOffset1 ];\n\t\tconst y1 = src1[ srcOffset1 + 1 ];\n\t\tconst z1 = src1[ srcOffset1 + 2 ];\n\t\tconst w1 = src1[ srcOffset1 + 3 ];\n\n\t\tdst[ dstOffset ] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\tdst[ dstOffset + 1 ] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\tdst[ dstOffset + 2 ] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\tdst[ dstOffset + 3 ] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\n\t\treturn dst;\n\n\t}\n\n\t/**\n\t * The x value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The y value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The z value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The w value of this quaternion.\n\t *\n\t * @type {number}\n\t * @default 1\n\t */\n\tget w() {\n\n\t\treturn this._w;\n\n\t}\n\n\tset w( value ) {\n\n\t\tthis._w = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * Sets the quaternion components.\n\t *\n\t * @param {number} x - The x value of this quaternion.\n\t * @param {number} y - The y value of this quaternion.\n\t * @param {number} z - The z value of this quaternion.\n\t * @param {number} w - The w value of this quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._w = w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new quaternion with copied values from this instance.\n\t *\n\t * @return {Quaternion} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given quaternion to this instance.\n\t *\n\t * @param {Quaternion} quaternion - The quaternion to copy.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tcopy( quaternion ) {\n\n\t\tthis._x = quaternion.x;\n\t\tthis._y = quaternion.y;\n\t\tthis._z = quaternion.z;\n\t\tthis._w = quaternion.w;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the rotation specified by the given\n\t * Euler angles.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromEuler( euler, update = true ) {\n\n\t\tconst x = euler._x, y = euler._y, z = euler._z, order = euler._order;\n\n\t\t// http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t//\tcontent/SpinCalc.m\n\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\n\t\tconst c1 = cos( x / 2 );\n\t\tconst c2 = cos( y / 2 );\n\t\tconst c3 = cos( z / 2 );\n\n\t\tconst s1 = sin( x / 2 );\n\t\tconst s2 = sin( y / 2 );\n\t\tconst s3 = sin( z / 2 );\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the given axis and angle.\n\t *\n\t * @param {Vector3} axis - The normalized axis.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromAxisAngle( axis, angle ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\n\t\tconst halfAngle = angle / 2, s = Math.sin( halfAngle );\n\n\t\tthis._x = axis.x * s;\n\t\tthis._y = axis.y * s;\n\t\tthis._z = axis.z * s;\n\t\tthis._w = Math.cos( halfAngle );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion from the given rotation matrix.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tconst te = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],\n\n\t\t\ttrace = m11 + m22 + m33;\n\n\t\tif ( trace > 0 ) {\n\n\t\t\tconst s = 0.5 / Math.sqrt( trace + 1.0 );\n\n\t\t\tthis._w = 0.25 / s;\n\t\t\tthis._x = ( m32 - m23 ) * s;\n\t\t\tthis._y = ( m13 - m31 ) * s;\n\t\t\tthis._z = ( m21 - m12 ) * s;\n\n\t\t} else if ( m11 > m22 && m11 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );\n\n\t\t\tthis._w = ( m32 - m23 ) / s;\n\t\t\tthis._x = 0.25 * s;\n\t\t\tthis._y = ( m12 + m21 ) / s;\n\t\t\tthis._z = ( m13 + m31 ) / s;\n\n\t\t} else if ( m22 > m33 ) {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );\n\n\t\t\tthis._w = ( m13 - m31 ) / s;\n\t\t\tthis._x = ( m12 + m21 ) / s;\n\t\t\tthis._y = 0.25 * s;\n\t\t\tthis._z = ( m23 + m32 ) / s;\n\n\t\t} else {\n\n\t\t\tconst s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );\n\n\t\t\tthis._w = ( m21 - m12 ) / s;\n\t\t\tthis._x = ( m13 + m31 ) / s;\n\t\t\tthis._y = ( m23 + m32 ) / s;\n\t\t\tthis._z = 0.25 * s;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion to the rotation required to rotate the direction vector\n\t * `vFrom` to the direction vector `vTo`.\n\t *\n\t * @param {Vector3} vFrom - The first (normalized) direction vector.\n\t * @param {Vector3} vTo - The second (normalized) direction vector.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tsetFromUnitVectors( vFrom, vTo ) {\n\n\t\t// assumes direction vectors vFrom and vTo are normalized\n\n\t\tlet r = vFrom.dot( vTo ) + 1;\n\n\t\tif ( r < 1e-8 ) { // the epsilon value has been discussed in #31286\n\n\t\t\t// vFrom and vTo point in opposite directions\n\n\t\t\tr = 0;\n\n\t\t\tif ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {\n\n\t\t\t\tthis._x = - vFrom.y;\n\t\t\t\tthis._y = vFrom.x;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = r;\n\n\t\t\t} else {\n\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = - vFrom.z;\n\t\t\t\tthis._z = vFrom.y;\n\t\t\t\tthis._w = r;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\n\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\tthis._w = r;\n\n\t\t}\n\n\t\treturn this.normalize();\n\n\t}\n\n\t/**\n\t * Returns the angle between this quaternion and the given one in radians.\n\t *\n\t * @param {Quaternion} q - The quaternion to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( q ) {\n\n\t\treturn 2 * Math.acos( Math.abs( clamp( this.dot( q ), -1, 1 ) ) );\n\n\t}\n\n\t/**\n\t * Rotates this quaternion by a given angular step to the given quaternion.\n\t * The method ensures that the final quaternion will not overshoot `q`.\n\t *\n\t * @param {Quaternion} q - The target quaternion.\n\t * @param {number} step - The angular step in radians.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\trotateTowards( q, step ) {\n\n\t\tconst angle = this.angleTo( q );\n\n\t\tif ( angle === 0 ) return this;\n\n\t\tconst t = Math.min( 1, step / angle );\n\n\t\tthis.slerp( q, t );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this quaternion to the identity quaternion; that is, to the\n\t * quaternion that represents \"no rotation\".\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tidentity() {\n\n\t\treturn this.set( 0, 0, 0, 1 );\n\n\t}\n\n\t/**\n\t * Inverts this quaternion via {@link Quaternion#conjugate}. The\n\t * quaternion is assumed to have unit length.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tinvert() {\n\n\t\treturn this.conjugate();\n\n\t}\n\n\t/**\n\t * Returns the rotational conjugate of this quaternion. The conjugate of a\n\t * quaternion represents the same rotation in the opposite direction about\n\t * the rotational axis.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tconjugate() {\n\n\t\tthis._x *= -1;\n\t\tthis._y *= -1;\n\t\tthis._z *= -1;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of this quaternion and the given one.\n\t *\n\t * @param {Quaternion} v - The quaternion to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\n\t}\n\n\t/**\n\t * Computes the squared Euclidean length (straight-line length) of this quaternion,\n\t * considered as a 4 dimensional vector. This can be useful if you are comparing the\n\t * lengths of two quaternions, as this is a slightly more efficient calculation than\n\t * {@link Quaternion#length}.\n\t *\n\t * @return {number} The squared Euclidean length.\n\t */\n\tlengthSq() {\n\n\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\n\t}\n\n\t/**\n\t * Computes the Euclidean length (straight-line length) of this quaternion,\n\t * considered as a 4 dimensional vector.\n\t *\n\t * @return {number} The Euclidean length.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );\n\n\t}\n\n\t/**\n\t * Normalizes this quaternion - that is, calculated the quaternion that performs\n\t * the same rotation as this one, but has a length equal to `1`.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tnormalize() {\n\n\t\tlet l = this.length();\n\n\t\tif ( l === 0 ) {\n\n\t\t\tthis._x = 0;\n\t\t\tthis._y = 0;\n\t\t\tthis._z = 0;\n\t\t\tthis._w = 1;\n\n\t\t} else {\n\n\t\t\tl = 1 / l;\n\n\t\t\tthis._x = this._x * l;\n\t\t\tthis._y = this._y * l;\n\t\t\tthis._z = this._z * l;\n\t\t\tthis._w = this._w * l;\n\n\t\t}\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this quaternion by the given one.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tmultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( this, q );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this quaternion by the given one.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tpremultiply( q ) {\n\n\t\treturn this.multiplyQuaternions( q, this );\n\n\t}\n\n\t/**\n\t * Multiplies the given quaternions and stores the result in this instance.\n\t *\n\t * @param {Quaternion} a - The first quaternion.\n\t * @param {Quaternion} b - The second quaternion.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tmultiplyQuaternions( a, b ) {\n\n\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\n\t\tconst qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;\n\t\tconst qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;\n\n\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs a spherical linear interpolation between quaternions.\n\t *\n\t * @param {Quaternion} qb - The target quaternion.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tslerp( qb, t ) {\n\n\t\tif ( t === 0 ) return this;\n\t\tif ( t === 1 ) return this.copy( qb );\n\n\t\tconst x = this._x, y = this._y, z = this._z, w = this._w;\n\n\t\t// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\tif ( cosHalfTheta < 0 ) {\n\n\t\t\tthis._w = - qb._w;\n\t\t\tthis._x = - qb._x;\n\t\t\tthis._y = - qb._y;\n\t\t\tthis._z = - qb._z;\n\n\t\t\tcosHalfTheta = - cosHalfTheta;\n\n\t\t} else {\n\n\t\t\tthis.copy( qb );\n\n\t\t}\n\n\t\tif ( cosHalfTheta >= 1.0 ) {\n\n\t\t\tthis._w = w;\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\tif ( sqrSinHalfTheta <= Number.EPSILON ) {\n\n\t\t\tconst s = 1 - t;\n\t\t\tthis._w = s * w + t * this._w;\n\t\t\tthis._x = s * x + t * this._x;\n\t\t\tthis._y = s * y + t * this._y;\n\t\t\tthis._z = s * z + t * this._z;\n\n\t\t\tthis.normalize(); // normalize calls _onChangeCallback()\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst sinHalfTheta = Math.sqrt( sqrSinHalfTheta );\n\t\tconst halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );\n\t\tconst ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,\n\t\t\tratioB = Math.sin( t * halfTheta ) / sinHalfTheta;\n\n\t\tthis._w = ( w * ratioA + this._w * ratioB );\n\t\tthis._x = ( x * ratioA + this._x * ratioB );\n\t\tthis._y = ( y * ratioA + this._y * ratioB );\n\t\tthis._z = ( z * ratioA + this._z * ratioB );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs a spherical linear interpolation between the given quaternions\n\t * and stores the result in this quaternion.\n\t *\n\t * @param {Quaternion} qa - The source quaternion.\n\t * @param {Quaternion} qb - The target quaternion.\n\t * @param {number} t - The interpolation factor in the closed interval `[0, 1]`.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tslerpQuaternions( qa, qb, t ) {\n\n\t\treturn this.copy( qa ).slerp( qb, t );\n\n\t}\n\n\t/**\n\t * Sets this quaternion to a uniformly random, normalized quaternion.\n\t *\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\trandom() {\n\n\t\t// Ken Shoemake\n\t\t// Uniform random rotations\n\t\t// D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.\n\n\t\tconst theta1 = 2 * Math.PI * Math.random();\n\t\tconst theta2 = 2 * Math.PI * Math.random();\n\n\t\tconst x0 = Math.random();\n\t\tconst r1 = Math.sqrt( 1 - x0 );\n\t\tconst r2 = Math.sqrt( x0 );\n\n\t\treturn this.set(\n\t\t\tr1 * Math.sin( theta1 ),\n\t\t\tr1 * Math.cos( theta1 ),\n\t\t\tr2 * Math.sin( theta2 ),\n\t\t\tr2 * Math.cos( theta2 ),\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if this quaternion is equal with the given one.\n\t *\n\t * @param {Quaternion} quaternion - The quaternion to test for equality.\n\t * @return {boolean} Whether this quaternion is equal with the given one.\n\t */\n\tequals( quaternion ) {\n\n\t\treturn ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );\n\n\t}\n\n\t/**\n\t * Sets this quaternion's components from the given array.\n\t *\n\t * @param {Array<number>} array - An array holding the quaternion component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis._x = array[ offset ];\n\t\tthis._y = array[ offset + 1 ];\n\t\tthis._z = array[ offset + 2 ];\n\t\tthis._w = array[ offset + 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this quaternion to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the quaternion components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The quaternion components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this quaternion from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding quaternion data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Quaternion} A reference to this quaternion.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis._x = attribute.getX( index );\n\t\tthis._y = attribute.getY( index );\n\t\tthis._z = attribute.getZ( index );\n\t\tthis._w = attribute.getW( index );\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This methods defines the serialization result of this class. Returns the\n\t * numerical elements of this quaternion in an array of format `[x, y, z, w]`.\n\t *\n\t * @return {Array<number>} The serialized quaternion.\n\t */\n\ttoJSON() {\n\n\t\treturn this.toArray();\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._w;\n\n\t}\n\n}\n\n/**\n * Class representing a 3D vector. A 3D vector is an ordered triplet of numbers\n * (labeled x, y and z), which can be used to represent a number of things, such as:\n *\n * - A point in 3D space.\n * - A direction and length in 3D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0)` to `(x, y, z)`\n * and the direction is also measured from `(0, 0, 0)` towards `(x, y, z)`.\n * - Any arbitrary ordered triplet of numbers.\n *\n * There are other things a 3D vector can be used to represent, such as\n * momentum vectors and so on, however these are the most\n * common uses in three.js.\n *\n * Iterating through a vector instance will yield its components `(x, y, z)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector3( 0, 1, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0)\n * const b = new THREE.Vector3( );\n *\n * const d = a.distanceTo( b );\n * ```\n */\nclass Vector3 {\n\n\t/**\n\t * Constructs a new 3D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector3.prototype.isVector3 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tset( x, y, z ) {\n\n\t\tif ( z === undefined ) z = this.z; // sprite.scale.set(x,y)\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n\t * @param {number} value - The value to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to copy.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to add.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector3} v - The vector to subtract.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to multiply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmultiplyVectors( a, b ) {\n\n\t\tthis.x = a.x * b.x;\n\t\tthis.y = a.y * b.y;\n\t\tthis.z = a.z * b.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given Euler rotation to this vector.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyEuler( euler ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );\n\n\t}\n\n\t/**\n\t * Applies a rotation specified by an axis and an angle to this vector.\n\t *\n\t * @param {Vector3} axis - A normalized vector representing the rotation axis.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyAxisAngle( axis, angle ) {\n\n\t\treturn this.applyQuaternion( _quaternion$4.setFromAxisAngle( axis, angle ) );\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector by the given normal matrix and normalizes\n\t * the result.\n\t *\n\t * @param {Matrix3} m - The normal matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\treturn this.applyMatrix3( m ).normalize();\n\n\t}\n\n\t/**\n\t * Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and\n\t * divides by perspective.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tconst w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );\n\n\t\tthis.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;\n\t\tthis.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;\n\t\tthis.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given Quaternion to this vector.\n\t *\n\t * @param {Quaternion} q - The Quaternion.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\t// quaternion q is assumed to have unit length\n\n\t\tconst vx = this.x, vy = this.y, vz = this.z;\n\t\tconst qx = q.x, qy = q.y, qz = q.z, qw = q.w;\n\n\t\t// t = 2 * cross( q.xyz, v );\n\t\tconst tx = 2 * ( qy * vz - qz * vy );\n\t\tconst ty = 2 * ( qz * vx - qx * vz );\n\t\tconst tz = 2 * ( qx * vy - qy * vx );\n\n\t\t// v + q.w * t + cross( q.xyz, t );\n\t\tthis.x = vx + qw * tx + qy * tz - qz * ty;\n\t\tthis.y = vy + qw * ty + qz * tx - qx * tz;\n\t\tthis.z = vz + qw * tz + qx * ty - qy * tx;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Projects this vector from world space into the camera's normalized\n\t * device coordinate (NDC) space.\n\t *\n\t * @param {Camera} camera - The camera.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );\n\n\t}\n\n\t/**\n\t * Unprojects this vector from the camera's normalized device coordinate (NDC)\n\t * space into world space.\n\t *\n\t * @param {Camera} camera - The camera.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tunproject( camera ) {\n\n\t\treturn this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );\n\n\t}\n\n\t/**\n\t * Transforms the direction of this vector by a matrix (the upper left 3 x 3\n\t * subset of the given 4x4 matrix and then normalizes the result.\n\t *\n\t * @param {Matrix4} m - The matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\ttransformDirection( m ) {\n\n\t\t// input: THREE.Matrix4 affine matrix\n\t\t// vector interpreted as a direction\n\n\t\tconst x = this.x, y = this.y, z = this.z;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;\n\n\t\treturn this.normalize();\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector3} v - The vector to divide.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is greater than the given vector's x, y or z\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is less than the given vector's x, y or z\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z value is greater than the max vector's x, y or z\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y or z value is less than the min vector's x, y or z value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector3} min - The minimum x, y and z values.\n\t * @param {Vector3} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y or z values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y or z values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y and z = -z.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\n\t}\n\n\t// TODO lengthSquared?\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector3} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector3} v1 - The first vector.\n\t * @param {Vector3} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vector with this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the cross product with.\n\t * @return {Vector3} The result of the cross product.\n\t */\n\tcross( v ) {\n\n\t\treturn this.crossVectors( this, v );\n\n\t}\n\n\t/**\n\t * Calculates the cross product of the given vectors and stores the result\n\t * in this instance.\n\t *\n\t * @param {Vector3} a - The first vector.\n\t * @param {Vector3} b - The second vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tcrossVectors( a, b ) {\n\n\t\tconst ax = a.x, ay = a.y, az = a.z;\n\t\tconst bx = b.x, by = b.y, bz = b.z;\n\n\t\tthis.x = ay * bz - az * by;\n\t\tthis.y = az * bx - ax * bz;\n\t\tthis.z = ax * by - ay * bx;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Projects this vector onto the given one.\n\t *\n\t * @param {Vector3} v - The vector to project to.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tprojectOnVector( v ) {\n\n\t\tconst denominator = v.lengthSq();\n\n\t\tif ( denominator === 0 ) return this.set( 0, 0, 0 );\n\n\t\tconst scalar = v.dot( this ) / denominator;\n\n\t\treturn this.copy( v ).multiplyScalar( scalar );\n\n\t}\n\n\t/**\n\t * Projects this vector onto a plane by subtracting this\n\t * vector projected onto the plane's normal from this vector.\n\t *\n\t * @param {Vector3} planeNormal - The plane normal.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tprojectOnPlane( planeNormal ) {\n\n\t\t_vector$c.copy( this ).projectOnVector( planeNormal );\n\n\t\treturn this.sub( _vector$c );\n\n\t}\n\n\t/**\n\t * Reflects this vector off a plane orthogonal to the given normal vector.\n\t *\n\t * @param {Vector3} normal - The (normalized) normal vector.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\treflect( normal ) {\n\n\t\treturn this.sub( _vector$c.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );\n\n\t}\n\t/**\n\t * Returns the angle between the given vector and this instance in radians.\n\t *\n\t * @param {Vector3} v - The vector to compute the angle with.\n\t * @return {number} The angle in radians.\n\t */\n\tangleTo( v ) {\n\n\t\tconst denominator = Math.sqrt( this.lengthSq() * v.lengthSq() );\n\n\t\tif ( denominator === 0 ) return Math.PI / 2;\n\n\t\tconst theta = this.dot( v ) / denominator;\n\n\t\t// clamp, to handle numerical problems\n\n\t\treturn Math.acos( clamp( theta, -1, 1 ) );\n\n\t}\n\n\t/**\n\t * Computes the distance from the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceTo( v ) {\n\n\t\treturn Math.sqrt( this.distanceToSquared( v ) );\n\n\t}\n\n\t/**\n\t * Computes the squared distance from the given vector to this instance.\n\t * If you are just comparing the distance with another distance, you should compare\n\t * the distance squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @param {Vector3} v - The vector to compute the squared distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceToSquared( v ) {\n\n\t\tconst dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;\n\n\t\treturn dx * dx + dy * dy + dz * dz;\n\n\t}\n\n\t/**\n\t * Computes the Manhattan distance from the given vector to this instance.\n\t *\n\t * @param {Vector3} v - The vector to compute the Manhattan distance to.\n\t * @return {number} The Manhattan distance.\n\t */\n\tmanhattanDistanceTo( v ) {\n\n\t\treturn Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given spherical coordinates.\n\t *\n\t * @param {Spherical} s - The spherical coordinates.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromSpherical( s ) {\n\n\t\treturn this.setFromSphericalCoords( s.radius, s.phi, s.theta );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given spherical coordinates.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} phi - The phi angle in radians.\n\t * @param {number} theta - The theta angle in radians.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromSphericalCoords( radius, phi, theta ) {\n\n\t\tconst sinPhiRadius = Math.sin( phi ) * radius;\n\n\t\tthis.x = sinPhiRadius * Math.sin( theta );\n\t\tthis.y = Math.cos( phi ) * radius;\n\t\tthis.z = sinPhiRadius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given cylindrical coordinates.\n\t *\n\t * @param {Cylindrical} c - The cylindrical coordinates.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromCylindrical( c ) {\n\n\t\treturn this.setFromCylindricalCoords( c.radius, c.theta, c.y );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given cylindrical coordinates.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} theta - The theta angle in radians.\n\t * @param {number} y - The y value.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromCylindricalCoords( radius, theta, y ) {\n\n\t\tthis.x = radius * Math.sin( theta );\n\t\tthis.y = y;\n\t\tthis.z = radius * Math.cos( theta );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the scale elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixScale( m ) {\n\n\t\tconst sx = this.setFromMatrixColumn( m, 0 ).length();\n\t\tconst sy = this.setFromMatrixColumn( m, 1 ).length();\n\t\tconst sz = this.setFromMatrixColumn( m, 2 ).length();\n\n\t\tthis.x = sx;\n\t\tthis.y = sy;\n\t\tthis.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the specified matrix column.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @param {number} index - The column index.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrixColumn( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 4 );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the specified matrix column.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @param {number} index - The column index.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromMatrix3Column( m, index ) {\n\n\t\treturn this.fromArray( m.elements, index * 3 );\n\n\t}\n\n\t/**\n\t * Sets the vector components from the given Euler angles.\n\t *\n\t * @param {Euler} e - The Euler angles to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromEuler( e ) {\n\n\t\tthis.x = e._x;\n\t\tthis.y = e._y;\n\t\tthis.z = e._z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components from the RGB components of the\n\t * given color.\n\t *\n\t * @param {Color} c - The color to set.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tsetFromColor( c ) {\n\n\t\tthis.x = c.r;\n\t\tthis.y = c.g;\n\t\tthis.z = c.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector3} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`\n\t * and z value to be `array[ offset + 2 ]`.\n\t *\n\t * @param {Array<number>} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector3} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this vector to a uniformly random point on a unit sphere.\n\t *\n\t * @return {Vector3} A reference to this vector.\n\t */\n\trandomDirection() {\n\n\t\t// https://mathworld.wolfram.com/SpherePointPicking.html\n\n\t\tconst theta = Math.random() * Math.PI * 2;\n\t\tconst u = Math.random() * 2 - 1;\n\t\tconst c = Math.sqrt( 1 - u * u );\n\n\t\tthis.x = c * Math.cos( theta );\n\t\tthis.y = u;\n\t\tthis.z = c * Math.sin( theta );\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\n\t}\n\n}\n\nconst _vector$c = /*@__PURE__*/ new Vector3();\nconst _quaternion$4 = /*@__PURE__*/ new Quaternion();\n\n/**\n * Represents a 3x3 matrix.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix3#set} method take arguments in\n * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}\n * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix();\n * m.set( 11, 12, 13,\n *        21, 22, 23,\n *        31, 32, 33 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21, 31,\n *                12, 22, 32,\n *                13, 23, 33 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix3 {\n\n\t/**\n\t * Constructs a new 3x3 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t */\n\tconstructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix3.prototype.isMatrix3 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array<number>}\n\t\t */\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tset( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;\n\t\tte[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;\n\t\tte[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 3x3 identity matrix.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0,\n\t\t\t0, 1, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given matrix to this instance.\n\t *\n\t * @param {Matrix3} m - The matrix to copy.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];\n\t\tte[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];\n\t\tte[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the basis of this matrix into the three axis vectors provided.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrix3Column( this, 0 );\n\t\tyAxis.setFromMatrix3Column( this, 1 );\n\t\tzAxis.setFromMatrix3Column( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tsetFromMatrix4( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 4 ], me[ 8 ],\n\t\t\tme[ 1 ], me[ 5 ], me[ 9 ],\n\t\t\tme[ 2 ], me[ 6 ], me[ 10 ]\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Post-multiplies this matrix by the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to multiply with.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this matrix by the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix to multiply with.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\t/**\n\t * Multiples the given 3x3 matrices and stores the result\n\t * in this matrix.\n\t *\n\t * @param {Matrix3} a - The first matrix.\n\t * @param {Matrix3} b - The second matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\tte[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\tte[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\tte[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\tte[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\tte[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\tte[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies every component of the matrix by the given scalar.\n\t *\n\t * @param {number} s - The scalar.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;\n\t\tte[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;\n\t\tte[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes and returns the determinant of this matrix.\n\t *\n\t * @return {number} The determinant.\n\t */\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],\n\t\t\td = te[ 3 ], e = te[ 4 ], f = te[ 5 ],\n\t\t\tg = te[ 6 ], h = te[ 7 ], i = te[ 8 ];\n\n\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\n\t}\n\n\t/**\n\t * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.\n\t * You can not invert with a determinant of zero. If you attempt this, the method produces\n\t * a zero matrix instead.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tinvert() {\n\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ],\n\t\t\tn12 = te[ 3 ], n22 = te[ 4 ], n32 = te[ 5 ],\n\t\t\tn13 = te[ 6 ], n23 = te[ 7 ], n33 = te[ 8 ],\n\n\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\tt13 = n23 * n12 - n22 * n13,\n\n\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;\n\t\tte[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;\n\n\t\tte[ 3 ] = t12 * detInv;\n\t\tte[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;\n\t\tte[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;\n\n\t\tte[ 6 ] = t13 * detInv;\n\t\tte[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;\n\t\tte[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transposes this matrix in place.\n\t *\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttranspose() {\n\n\t\tlet tmp;\n\t\tconst m = this.elements;\n\n\t\ttmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;\n\t\ttmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;\n\t\ttmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the normal matrix which is the inverse transpose of the upper\n\t * left 3x3 portion of the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} matrix4 - The 4x4 matrix.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tgetNormalMatrix( matrix4 ) {\n\n\t\treturn this.setFromMatrix4( matrix4 ).invert().transpose();\n\n\t}\n\n\t/**\n\t * Transposes this matrix into the supplied array, and returns itself unchanged.\n\t *\n\t * @param {Array<number>} r - An array to store the transposed matrix elements.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttransposeIntoArray( r ) {\n\n\t\tconst m = this.elements;\n\n\t\tr[ 0 ] = m[ 0 ];\n\t\tr[ 1 ] = m[ 3 ];\n\t\tr[ 2 ] = m[ 6 ];\n\t\tr[ 3 ] = m[ 1 ];\n\t\tr[ 4 ] = m[ 4 ];\n\t\tr[ 5 ] = m[ 7 ];\n\t\tr[ 6 ] = m[ 2 ];\n\t\tr[ 7 ] = m[ 5 ];\n\t\tr[ 8 ] = m[ 8 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the UV transform matrix from offset, repeat, rotation, and center.\n\t *\n\t * @param {number} tx - Offset x.\n\t * @param {number} ty - Offset y.\n\t * @param {number} sx - Repeat x.\n\t * @param {number} sy - Repeat y.\n\t * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise.\n\t * @param {number} cx - Center x of rotation.\n\t * @param {number} cy - Center y of rotation\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tsetUvTransform( tx, ty, sx, sy, rotation, cx, cy ) {\n\n\t\tconst c = Math.cos( rotation );\n\t\tconst s = Math.sin( rotation );\n\n\t\tthis.set(\n\t\t\tsx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,\n\t\t\t- sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,\n\t\t\t0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales this matrix with the given scalar values.\n\t *\n\t * @param {number} sx - The amount to scale in the X axis.\n\t * @param {number} sy - The amount to scale in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tscale( sx, sy ) {\n\n\t\tthis.premultiply( _m3.makeScale( sx, sy ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates this matrix by the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\trotate( theta ) {\n\n\t\tthis.premultiply( _m3.makeRotation( - theta ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates this matrix by the given scalar values.\n\t *\n\t * @param {number} tx - The amount to translate in the X axis.\n\t * @param {number} ty - The amount to translate in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\ttranslate( tx, ty ) {\n\n\t\tthis.premultiply( _m3.makeTranslation( tx, ty ) );\n\n\t\treturn this;\n\n\t}\n\n\t// for 2D Transforms\n\n\t/**\n\t * Sets this matrix as a 2D translation transform.\n\t *\n\t * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector.\n\t * @param {number} y - The amount to translate in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeTranslation( x, y ) {\n\n\t\tif ( x.isVector2 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x.x,\n\t\t\t\t0, 1, x.y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, x,\n\t\t\t\t0, 1, y,\n\t\t\t\t0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a 2D rotational transformation.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeRotation( theta ) {\n\n\t\t// counterclockwise\n\n\t\tconst c = Math.cos( theta );\n\t\tconst s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0,\n\t\t\ts, c, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a 2D scale transform.\n\t *\n\t * @param {number} x - The amount to scale in the X axis.\n\t * @param {number} y - The amount to scale in the Y axis.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tmakeScale( x, y ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0,\n\t\t\t0, y, 0,\n\t\t\t0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this matrix is equal with the given one.\n\t *\n\t * @param {Matrix3} matrix - The matrix to test for equality.\n\t * @return {boolean} Whether this matrix is equal with the given one.\n\t */\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array<number>} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix3} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the elements of this matrix to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The matrix elements in column-major order.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Returns a matrix with copied values from this instance.\n\t *\n\t * @return {Matrix3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().fromArray( this.elements );\n\n\t}\n\n}\n\nconst _m3 = /*@__PURE__*/ new Matrix3();\n\nfunction arrayNeedsUint32( array ) {\n\n\t// assumes larger values usually on last\n\n\tfor ( let i = array.length - 1; i >= 0; -- i ) {\n\n\t\tif ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565\n\n\t}\n\n\treturn false;\n\n}\n\nconst TYPED_ARRAYS = {\n\tInt8Array: Int8Array,\n\tUint8Array: Uint8Array,\n\tUint8ClampedArray: Uint8ClampedArray,\n\tInt16Array: Int16Array,\n\tUint16Array: Uint16Array,\n\tInt32Array: Int32Array,\n\tUint32Array: Uint32Array,\n\tFloat32Array: Float32Array,\n\tFloat64Array: Float64Array\n};\n\nfunction getTypedArray( type, buffer ) {\n\n\treturn new TYPED_ARRAYS[ type ]( buffer );\n\n}\n\nfunction createElementNS( name ) {\n\n\treturn document.createElementNS( 'http://www.w3.org/1999/xhtml', name );\n\n}\n\nfunction createCanvasElement() {\n\n\tconst canvas = createElementNS( 'canvas' );\n\tcanvas.style.display = 'block';\n\treturn canvas;\n\n}\n\nconst _cache = {};\n\nfunction warnOnce( message ) {\n\n\tif ( message in _cache ) return;\n\n\t_cache[ message ] = true;\n\n\tconsole.warn( message );\n\n}\n\nfunction probeAsync( gl, sync, interval ) {\n\n\treturn new Promise( function ( resolve, reject ) {\n\n\t\tfunction probe() {\n\n\t\t\tswitch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {\n\n\t\t\t\tcase gl.WAIT_FAILED:\n\t\t\t\t\treject();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.TIMEOUT_EXPIRED:\n\t\t\t\t\tsetTimeout( probe, interval );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tresolve();\n\n\t\t\t}\n\n\t\t}\n\n\t\tsetTimeout( probe, interval );\n\n\t} );\n\n}\n\nconst LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(\n\t0.4123908, 0.3575843, 0.1804808,\n\t0.2126390, 0.7151687, 0.0721923,\n\t0.0193308, 0.1191948, 0.9505322\n);\n\nconst XYZ_TO_LINEAR_REC709 = /*@__PURE__*/ new Matrix3().set(\n\t3.2409699, -1.5373832, -0.4986108,\n\t-0.9692436, 1.8759675, 0.0415551,\n\t0.0556301, -0.203977, 1.0569715\n);\n\nfunction createColorManagement() {\n\n\tconst ColorManagement = {\n\n\t\tenabled: true,\n\n\t\tworkingColorSpace: LinearSRGBColorSpace,\n\n\t\t/**\n\t\t * Implementations of supported color spaces.\n\t\t *\n\t\t * Required:\n\t\t *\t- primaries: chromaticity coordinates [ rx ry gx gy bx by ]\n\t\t *\t- whitePoint: reference white [ x y ]\n\t\t *\t- transfer: transfer function (pre-defined)\n\t\t *\t- toXYZ: Matrix3 RGB to XYZ transform\n\t\t *\t- fromXYZ: Matrix3 XYZ to RGB transform\n\t\t *\t- luminanceCoefficients: RGB luminance coefficients\n\t\t *\n\t\t * Optional:\n\t\t *  - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace }\n\t\t *  - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }\n\t\t *\n\t\t * Reference:\n\t\t * - https://www.russellcottrell.com/photo/matrixCalculator.htm\n\t\t */\n\t\tspaces: {},\n\n\t\tconvert: function ( color, sourceColorSpace, targetColorSpace ) {\n\n\t\t\tif ( this.enabled === false || sourceColorSpace === targetColorSpace || ! sourceColorSpace || ! targetColorSpace ) {\n\n\t\t\t\treturn color;\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = SRGBToLinear( color.r );\n\t\t\t\tcolor.g = SRGBToLinear( color.g );\n\t\t\t\tcolor.b = SRGBToLinear( color.b );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ sourceColorSpace ].primaries !== this.spaces[ targetColorSpace ].primaries ) {\n\n\t\t\t\tcolor.applyMatrix3( this.spaces[ sourceColorSpace ].toXYZ );\n\t\t\t\tcolor.applyMatrix3( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t\t}\n\n\t\t\tif ( this.spaces[ targetColorSpace ].transfer === SRGBTransfer ) {\n\n\t\t\t\tcolor.r = LinearToSRGB( color.r );\n\t\t\t\tcolor.g = LinearToSRGB( color.g );\n\t\t\t\tcolor.b = LinearToSRGB( color.b );\n\n\t\t\t}\n\n\t\t\treturn color;\n\n\t\t},\n\n\t\tworkingToColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\treturn this.convert( color, this.workingColorSpace, targetColorSpace );\n\n\t\t},\n\n\t\tcolorSpaceToWorking: function ( color, sourceColorSpace ) {\n\n\t\t\treturn this.convert( color, sourceColorSpace, this.workingColorSpace );\n\n\t\t},\n\n\t\tgetPrimaries: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].primaries;\n\n\t\t},\n\n\t\tgetTransfer: function ( colorSpace ) {\n\n\t\t\tif ( colorSpace === NoColorSpace ) return LinearTransfer;\n\n\t\t\treturn this.spaces[ colorSpace ].transfer;\n\n\t\t},\n\n\t\tgetLuminanceCoefficients: function ( target, colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn target.fromArray( this.spaces[ colorSpace ].luminanceCoefficients );\n\n\t\t},\n\n\t\tdefine: function ( colorSpaces ) {\n\n\t\t\tObject.assign( this.spaces, colorSpaces );\n\n\t\t},\n\n\t\t// Internal APIs\n\n\t\t_getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {\n\n\t\t\treturn targetMatrix\n\t\t\t\t.copy( this.spaces[ sourceColorSpace ].toXYZ )\n\t\t\t\t.multiply( this.spaces[ targetColorSpace ].fromXYZ );\n\n\t\t},\n\n\t\t_getDrawingBufferColorSpace: function ( colorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].outputColorSpaceConfig.drawingBufferColorSpace;\n\n\t\t},\n\n\t\t_getUnpackColorSpace: function ( colorSpace = this.workingColorSpace ) {\n\n\t\t\treturn this.spaces[ colorSpace ].workingColorSpaceConfig.unpackColorSpace;\n\n\t\t},\n\n\t\t// Deprecated\n\n\t\tfromWorkingColorSpace: function ( color, targetColorSpace ) {\n\n\t\t\twarnOnce( 'THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.workingToColorSpace( color, targetColorSpace );\n\n\t\t},\n\n\t\ttoWorkingColorSpace: function ( color, sourceColorSpace ) {\n\n\t\t\twarnOnce( 'THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177\n\n\t\t\treturn ColorManagement.colorSpaceToWorking( color, sourceColorSpace );\n\n\t\t},\n\n\t};\n\n\t/******************************************************************************\n\t * sRGB definitions\n\t */\n\n\tconst REC709_PRIMARIES = [ 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 ];\n\tconst REC709_LUMINANCE_COEFFICIENTS = [ 0.2126, 0.7152, 0.0722 ];\n\tconst D65 = [ 0.3127, 0.3290 ];\n\n\tColorManagement.define( {\n\n\t\t[ LinearSRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: LinearTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\tworkingColorSpaceConfig: { unpackColorSpace: SRGBColorSpace },\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t\t[ SRGBColorSpace ]: {\n\t\t\tprimaries: REC709_PRIMARIES,\n\t\t\twhitePoint: D65,\n\t\t\ttransfer: SRGBTransfer,\n\t\t\ttoXYZ: LINEAR_REC709_TO_XYZ,\n\t\t\tfromXYZ: XYZ_TO_LINEAR_REC709,\n\t\t\tluminanceCoefficients: REC709_LUMINANCE_COEFFICIENTS,\n\t\t\toutputColorSpaceConfig: { drawingBufferColorSpace: SRGBColorSpace }\n\t\t},\n\n\t} );\n\n\treturn ColorManagement;\n\n}\n\nconst ColorManagement = /*@__PURE__*/ createColorManagement();\n\nfunction SRGBToLinear( c ) {\n\n\treturn ( c < 0.04045 ) ? c * 0.0773993808 : Math.pow( c * 0.9478672986 + 0.0521327014, 2.4 );\n\n}\n\nfunction LinearToSRGB( c ) {\n\n\treturn ( c < 0.0031308 ) ? c * 12.92 : 1.055 * ( Math.pow( c, 0.41666 ) ) - 0.055;\n\n}\n\nlet _canvas;\n\n/**\n * A class containing utility functions for images.\n *\n * @hideconstructor\n */\nclass ImageUtils {\n\n\t/**\n\t * Returns a data URI containing a representation of the given image.\n\t *\n\t * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.\n\t * @param {string} [type='image/png'] - Indicates the image format.\n\t * @return {string} The data URI.\n\t */\n\tstatic getDataURL( image, type = 'image/png' ) {\n\n\t\tif ( /^data:/i.test( image.src ) ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tif ( typeof HTMLCanvasElement === 'undefined' ) {\n\n\t\t\treturn image.src;\n\n\t\t}\n\n\t\tlet canvas;\n\n\t\tif ( image instanceof HTMLCanvasElement ) {\n\n\t\t\tcanvas = image;\n\n\t\t} else {\n\n\t\t\tif ( _canvas === undefined ) _canvas = createElementNS( 'canvas' );\n\n\t\t\t_canvas.width = image.width;\n\t\t\t_canvas.height = image.height;\n\n\t\t\tconst context = _canvas.getContext( '2d' );\n\n\t\t\tif ( image instanceof ImageData ) {\n\n\t\t\t\tcontext.putImageData( image, 0, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\t}\n\n\t\t\tcanvas = _canvas;\n\n\t\t}\n\n\t\treturn canvas.toDataURL( type );\n\n\t}\n\n\t/**\n\t * Converts the given sRGB image data to linear color space.\n\t *\n\t * @param {(HTMLImageElement|HTMLCanvasElement|ImageBitmap|Object)} image - The image object.\n\t * @return {HTMLCanvasElement|Object} The converted image.\n\t */\n\tstatic sRGBToLinear( image ) {\n\n\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t\tconst canvas = createElementNS( 'canvas' );\n\n\t\t\tcanvas.width = image.width;\n\t\t\tcanvas.height = image.height;\n\n\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\tcontext.drawImage( image, 0, 0, image.width, image.height );\n\n\t\t\tconst imageData = context.getImageData( 0, 0, image.width, image.height );\n\t\t\tconst data = imageData.data;\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] / 255 ) * 255;\n\n\t\t\t}\n\n\t\t\tcontext.putImageData( imageData, 0, 0 );\n\n\t\t\treturn canvas;\n\n\t\t} else if ( image.data ) {\n\n\t\t\tconst data = image.data.slice( 0 );\n\n\t\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\t\tif ( data instanceof Uint8Array || data instanceof Uint8ClampedArray ) {\n\n\t\t\t\t\tdata[ i ] = Math.floor( SRGBToLinear( data[ i ] / 255 ) * 255 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// assuming float\n\n\t\t\t\t\tdata[ i ] = SRGBToLinear( data[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tdata: data,\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );\n\t\t\treturn image;\n\n\t\t}\n\n\t}\n\n}\n\nlet _sourceId = 0;\n\n/**\n * Represents the data source of a texture.\n *\n * The main purpose of this class is to decouple the data definition from the texture\n * definition so the same data can be used with multiple texture instances.\n */\nclass Source {\n\n\t/**\n\t * Constructs a new video texture.\n\t *\n\t * @param {any} [data=null] - The data definition of a texture.\n\t */\n\tconstructor( data = null ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSource = true;\n\n\t\t/**\n\t\t * The ID of the source.\n\t\t *\n\t\t * @name Source#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _sourceId ++ } );\n\n\t\t/**\n\t\t * The UUID of the source.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The data definition of a texture.\n\t\t *\n\t\t * @type {any}\n\t\t */\n\t\tthis.data = data;\n\n\t\t/**\n\t\t * This property is only relevant when {@link Source#needsUpdate} is set to `true` and\n\t\t * provides more control on how texture data should be processed. When `dataReady` is set\n\t\t * to `false`, the engine performs the memory allocation (if necessary) but does not transfer\n\t\t * the data into the GPU memory.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.dataReady = true;\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Source#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * Returns the dimensions of the source into the given target vector.\n\t *\n\t * @param {(Vector2|Vector3)} target - The target object the result is written into.\n\t * @return {(Vector2|Vector3)} The dimensions of the source.\n\t */\n\tgetSize( target ) {\n\n\t\tconst data = this.data;\n\n\t\tif ( data instanceof HTMLVideoElement ) {\n\n\t\t\ttarget.set( data.videoWidth, data.videoHeight, 0 );\n\n\t\t} else if ( data instanceof VideoFrame ) {\n\n\t\t\ttarget.set( data.displayHeight, data.displayWidth, 0 );\n\n\t\t} else if ( data !== null ) {\n\n\t\t\ttarget.set( data.width, data.height, data.depth || 0 );\n\n\t\t} else {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * When the property is set to `true`, the engine allocates the memory\n\t * for the texture (if necessary) and triggers the actual texture upload\n\t * to the GPU next time the source is used.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Serializes the source into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized source.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.images[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.images[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\t\t\tuuid: this.uuid,\n\t\t\turl: ''\n\t\t};\n\n\t\tconst data = this.data;\n\n\t\tif ( data !== null ) {\n\n\t\t\tlet url;\n\n\t\t\tif ( Array.isArray( data ) ) {\n\n\t\t\t\t// cube texture\n\n\t\t\t\turl = [];\n\n\t\t\t\tfor ( let i = 0, l = data.length; i < l; i ++ ) {\n\n\t\t\t\t\tif ( data[ i ].isDataTexture ) {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ].image ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\turl.push( serializeImage( data[ i ] ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// texture\n\n\t\t\t\turl = serializeImage( data );\n\n\t\t\t}\n\n\t\t\toutput.url = url;\n\n\t\t}\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.images[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n}\n\nfunction serializeImage( image ) {\n\n\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {\n\n\t\t// default images\n\n\t\treturn ImageUtils.getDataURL( image );\n\n\t} else {\n\n\t\tif ( image.data ) {\n\n\t\t\t// images of DataTexture\n\n\t\t\treturn {\n\t\t\t\tdata: Array.from( image.data ),\n\t\t\t\twidth: image.width,\n\t\t\t\theight: image.height,\n\t\t\t\ttype: image.data.constructor.name\n\t\t\t};\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Texture: Unable to serialize Texture.' );\n\t\t\treturn {};\n\n\t\t}\n\n\t}\n\n}\n\nlet _textureId = 0;\n\nconst _tempVec3 = /*@__PURE__*/ new Vector3();\n\n/**\n * Base class for all textures.\n *\n * Note: After the initial use of a texture, its dimensions, format, and type\n * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.\n *\n * @augments EventDispatcher\n */\nclass Texture extends EventDispatcher {\n\n\t/**\n\t * Constructs a new texture.\n\t *\n\t * @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, colorSpace = NoColorSpace ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isTexture = true;\n\n\t\t/**\n\t\t * The ID of the texture.\n\t\t *\n\t\t * @name Texture#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _textureId ++ } );\n\n\t\t/**\n\t\t * The UUID of the material.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the material.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The data definition of a texture. A reference to the data source can be\n\t\t * shared across textures. This is often useful in context of spritesheets\n\t\t * where multiple textures render the same data but with different texture\n\t\t * transformations.\n\t\t *\n\t\t * @type {Source}\n\t\t */\n\t\tthis.source = new Source( image );\n\n\t\t/**\n\t\t * An array holding user-defined mipmaps.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.mipmaps = [];\n\n\t\t/**\n\t\t * How the texture is applied to the object. The value `UVMapping`\n\t\t * is the default, where texture or uv coordinates are used to apply the map.\n\t\t *\n\t\t * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping|CubeUVReflectionMapping)}\n\t\t * @default UVMapping\n\t\t*/\n\t\tthis.mapping = mapping;\n\n\t\t/**\n\t\t * Lets you select the uv attribute to map the texture to. `0` for `uv`,\n\t\t * `1` for `uv1`, `2` for `uv2` and `3` for `uv3`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.channel = 0;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped horizontally and corresponds to\n\t\t * *U* in UV mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapS = wrapS;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped horizontally and corresponds to\n\t\t * *V* in UV mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapT = wrapT;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default LinearFilter\n\t\t */\n\t\tthis.magFilter = magFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default LinearMipmapLinearFilter\n\t\t */\n\t\tthis.minFilter = minFilter;\n\n\t\t/**\n\t\t * The number of samples taken along the axis through the pixel that has the\n\t\t * highest density of texels. By default, this value is `1`. A higher value\n\t\t * gives a less blurry result than a basic mipmap, at the cost of more\n\t\t * texture samples being used.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.anisotropy = anisotropy;\n\n\t\t/**\n\t\t * The format of the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default RGBAFormat\n\t\t */\n\t\tthis.format = format;\n\n\t\t/**\n\t\t * The default internal format is derived from {@link Texture#format} and {@link Texture#type} and\n\t\t * defines how the texture data is going to be stored on the GPU.\n\t\t *\n\t\t * This property allows to overwrite the default format.\n\t\t *\n\t\t * @type {?string}\n\t\t * @default null\n\t\t */\n\t\tthis.internalFormat = null;\n\n\t\t/**\n\t\t * The data type of the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default UnsignedByteType\n\t\t */\n\t\tthis.type = type;\n\n\t\t/**\n\t\t * How much a single repetition of the texture is offset from the beginning,\n\t\t * in each direction U and V. Typical range is `0.0` to `1.0`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0,0)\n\t\t */\n\t\tthis.offset = new Vector2( 0, 0 );\n\n\t\t/**\n\t\t * How many times the texture is repeated across the surface, in each\n\t\t * direction U and V. If repeat is set greater than `1` in either direction,\n\t\t * the corresponding wrap parameter should also be set to `RepeatWrapping`\n\t\t * or `MirroredRepeatWrapping` to achieve the desired tiling effect.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.repeat = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The point around which rotation occurs. A value of `(0.5, 0.5)` corresponds\n\t\t * to the center of the texture. Default is `(0, 0)`, the lower left.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0,0)\n\t\t */\n\t\tthis.center = new Vector2( 0, 0 );\n\n\t\t/**\n\t\t * How much the texture is rotated around the center point, in radians.\n\t\t * Positive values are counter-clockwise.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.rotation = 0;\n\n\t\t/**\n\t\t * Whether to update the texture's uv-transformation {@link Texture#matrix}\n\t\t * from the properties {@link Texture#offset}, {@link Texture#repeat},\n\t\t * {@link Texture#rotation}, and {@link Texture#center}.\n\t\t *\n\t\t * Set this to `false` if you are specifying the uv-transform matrix directly.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixAutoUpdate = true;\n\n\t\t/**\n\t\t * The uv-transformation matrix of the texture.\n\t\t *\n\t\t * @type {Matrix3}\n\t\t */\n\t\tthis.matrix = new Matrix3();\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Set this to `false` if you are creating mipmaps manually.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.generateMipmaps = true;\n\n\t\t/**\n\t\t * If set to `true`, the alpha channel, if present, is multiplied into the\n\t\t * color channels when the texture is uploaded to the GPU.\n\t\t *\n\t\t * Note that this property has no effect when using `ImageBitmap`. You need to\n\t\t * configure premultiply alpha on bitmap creation instead.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultiplyAlpha = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Note that this property has no effect when using `ImageBitmap`. You need to\n\t\t * configure the flip on bitmap creation instead.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.flipY = true;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t * The allowable values are `1` (byte-alignment), `2` (rows aligned to even-numbered bytes),\n\t\t * `4` (word-alignment), and `8` (rows start on double-word boundaries).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 4\n\t\t */\n\t\tthis.unpackAlignment = 4;\t// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\n\t\t/**\n\t\t * Textures containing color data should be annotated with `SRGBColorSpace` or `LinearSRGBColorSpace`.\n\t\t *\n\t\t * @type {string}\n\t\t * @default NoColorSpace\n\t\t */\n\t\tthis.colorSpace = colorSpace;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the texture. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t\t/**\n\t\t * This can be used to only update a subregion or specific rows of the texture (for example, just the\n\t\t * first 3 rows). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Texture#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t\t/**\n\t\t * A callback function, called when the texture is updated (e.g., when\n\t\t * {@link Texture#needsUpdate} has been set to true and then the texture is used).\n\t\t *\n\t\t * @type {?Function}\n\t\t * @default null\n\t\t */\n\t\tthis.onUpdate = null;\n\n\t\t/**\n\t\t * An optional back reference to the textures render target.\n\t\t *\n\t\t * @type {?(RenderTarget|WebGLRenderTarget)}\n\t\t * @default null\n\t\t */\n\t\tthis.renderTarget = null;\n\n\t\t/**\n\t\t * Indicates whether a texture belongs to a render target or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isRenderTargetTexture = false;\n\n\t\t/**\n\t\t * Indicates if a texture should be handled like a texture array.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isArrayTexture = image && image.depth && image.depth > 1 ? true : false;\n\n\t\t/**\n\t\t * Indicates whether this texture should be processed by `PMREMGenerator` or not\n\t\t * (only relevant for render target textures).\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.pmremVersion = 0;\n\n\t}\n\n\t/**\n\t * The width of the texture in pixels.\n\t */\n\tget width() {\n\n\t\treturn this.source.getSize( _tempVec3 ).x;\n\n\t}\n\n\t/**\n\t * The height of the texture in pixels.\n\t */\n\tget height() {\n\n\t\treturn this.source.getSize( _tempVec3 ).y;\n\n\t}\n\n\t/**\n\t * The depth of the texture in pixels.\n\t */\n\tget depth() {\n\n\t\treturn this.source.getSize( _tempVec3 ).z;\n\n\t}\n\n\t/**\n\t * The image object holding the texture data.\n\t *\n\t * @type {?Object}\n\t */\n\tget image() {\n\n\t\treturn this.source.data;\n\n\t}\n\n\tset image( value = null ) {\n\n\t\tthis.source.data = value;\n\n\t}\n\n\t/**\n\t * Updates the texture transformation matrix from the from the properties {@link Texture#offset},\n\t * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}.\n\t */\n\tupdateMatrix() {\n\n\t\tthis.matrix.setUvTransform( this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y );\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data texture to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Returns a new texture with copied values from this instance.\n\t *\n\t * @return {Texture} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given texture to this instance.\n\t *\n\t * @param {Texture} source - The texture to copy.\n\t * @return {Texture} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.source = source.source;\n\t\tthis.mipmaps = source.mipmaps.slice( 0 );\n\n\t\tthis.mapping = source.mapping;\n\t\tthis.channel = source.channel;\n\n\t\tthis.wrapS = source.wrapS;\n\t\tthis.wrapT = source.wrapT;\n\n\t\tthis.magFilter = source.magFilter;\n\t\tthis.minFilter = source.minFilter;\n\n\t\tthis.anisotropy = source.anisotropy;\n\n\t\tthis.format = source.format;\n\t\tthis.internalFormat = source.internalFormat;\n\t\tthis.type = source.type;\n\n\t\tthis.offset.copy( source.offset );\n\t\tthis.repeat.copy( source.repeat );\n\t\tthis.center.copy( source.center );\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\tthis.matrix.copy( source.matrix );\n\n\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\tthis.flipY = source.flipY;\n\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\tthis.colorSpace = source.colorSpace;\n\n\t\tthis.renderTarget = source.renderTarget;\n\t\tthis.isRenderTargetTexture = source.isRenderTargetTexture;\n\t\tthis.isArrayTexture = source.isArrayTexture;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tthis.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this texture's properties based on `values`.\n\t * @param {Object} values - A container with texture parameters.\n\t */\n\tsetValues( values ) {\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Texture.setValues(): parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Texture.setValues(): property '${ key }' does not exist.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( ( currentValue && newValue ) && ( currentValue.isVector2 && newValue.isVector2 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else if ( ( currentValue && newValue ) && ( currentValue.isVector3 && newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else if ( ( currentValue && newValue ) && ( currentValue.isMatrix3 && newValue.isMatrix3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the texture into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized texture.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) {\n\n\t\t\treturn meta.textures[ this.uuid ];\n\n\t\t}\n\n\t\tconst output = {\n\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Texture',\n\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t},\n\n\t\t\tuuid: this.uuid,\n\t\t\tname: this.name,\n\n\t\t\timage: this.source.toJSON( meta ).uuid,\n\n\t\t\tmapping: this.mapping,\n\t\t\tchannel: this.channel,\n\n\t\t\trepeat: [ this.repeat.x, this.repeat.y ],\n\t\t\toffset: [ this.offset.x, this.offset.y ],\n\t\t\tcenter: [ this.center.x, this.center.y ],\n\t\t\trotation: this.rotation,\n\n\t\t\twrap: [ this.wrapS, this.wrapT ],\n\n\t\t\tformat: this.format,\n\t\t\tinternalFormat: this.internalFormat,\n\t\t\ttype: this.type,\n\t\t\tcolorSpace: this.colorSpace,\n\n\t\t\tminFilter: this.minFilter,\n\t\t\tmagFilter: this.magFilter,\n\t\t\tanisotropy: this.anisotropy,\n\n\t\t\tflipY: this.flipY,\n\n\t\t\tgenerateMipmaps: this.generateMipmaps,\n\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\tunpackAlignment: this.unpackAlignment\n\n\t\t};\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) output.userData = this.userData;\n\n\t\tif ( ! isRootObject ) {\n\n\t\t\tmeta.textures[ this.uuid ] = output;\n\n\t\t}\n\n\t\treturn output;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Texture#dispose\n\t */\n\tdispose() {\n\n\t\t/**\n\t\t * Fires when the texture has been disposed of.\n\t\t *\n\t\t * @event Texture#dispose\n\t\t * @type {Object}\n\t\t */\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Transforms the given uv vector with the textures uv transformation matrix.\n\t *\n\t * @param {Vector2} uv - The uv vector.\n\t * @return {Vector2} The transformed uv vector.\n\t */\n\ttransformUv( uv ) {\n\n\t\tif ( this.mapping !== UVMapping ) return uv;\n\n\t\tuv.applyMatrix3( this.matrix );\n\n\t\tif ( uv.x < 0 || uv.x > 1 ) {\n\n\t\t\tswitch ( this.wrapS ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.x = Math.ceil( uv.x ) - uv.x;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.x = uv.x - Math.floor( uv.x );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( uv.y < 0 || uv.y > 1 ) {\n\n\t\t\tswitch ( this.wrapT ) {\n\n\t\t\t\tcase RepeatWrapping:\n\n\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ClampToEdgeWrapping:\n\n\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MirroredRepeatWrapping:\n\n\t\t\t\t\tif ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {\n\n\t\t\t\t\t\tuv.y = Math.ceil( uv.y ) - uv.y;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tuv.y = uv.y - Math.floor( uv.y );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.flipY ) {\n\n\t\t\tuv.y = 1 - uv.y;\n\n\t\t}\n\n\t\treturn uv;\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the texture\n\t * must be updated in the next render. This triggers a texture upload\n\t * to the GPU and ensures correct texture parameter configuration.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.version ++;\n\t\t\tthis.source.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the PMREM\n\t * must be regenerated.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsPMREMUpdate( value ) {\n\n\t\tif ( value === true ) {\n\n\t\t\tthis.pmremVersion ++;\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * The default image for all textures.\n *\n * @static\n * @type {?Image}\n * @default null\n */\nTexture.DEFAULT_IMAGE = null;\n\n/**\n * The default mapping for all textures.\n *\n * @static\n * @type {number}\n * @default UVMapping\n */\nTexture.DEFAULT_MAPPING = UVMapping;\n\n/**\n * The default anisotropy value for all textures.\n *\n * @static\n * @type {number}\n * @default 1\n */\nTexture.DEFAULT_ANISOTROPY = 1;\n\n/**\n * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers\n * (labeled x, y, z and w), which can be used to represent a number of things, such as:\n *\n * - A point in 4D space.\n * - A direction and length in 4D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)`\n * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`.\n * - Any arbitrary ordered quadruplet of numbers.\n *\n * There are other things a 4D vector can be used to represent, however these\n * are the most common uses in *three.js*.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector4( 0, 1, 0, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0, 1)\n * const b = new THREE.Vector4( );\n *\n * const d = a.dot( b );\n * ```\n */\nclass Vector4 {\n\n\t/**\n\t * Constructs a new 4D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t * @param {number} [w=1] - The w value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector4.prototype.isVector4 = true;\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t\t/**\n\t\t * The w value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.w = w;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#z}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#w}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @param {number} w - The value of the w component.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's w component to the given value\n\t *\n\t * @param {number} w - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @param {number} value - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector to copy.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector4} v - The vector to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector4} v - The vector to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector4} v - The vector to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the quaternion's axis and w to the angle.\n\t *\n\t * @param {Quaternion} q - The Quaternion to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the axis of rotation and w to the angle.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t     ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t     ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t     ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t     ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t     ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is less than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector4} min - The minimum x, y and z values.\n\t * @param {Vector4} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\t\tthis.w = clamp( this.w, min.w, max.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y, z or w values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\t\tthis.w = clamp( this.w, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\t/**\n\t * Computes the  Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector4} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector4} v1 - The first vector.\n\t * @param {Vector4} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector4} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`,\n\t * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`.\n\t *\n\t * @param {Array<number>} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\n/**\n * A render target is a buffer where the video card draws pixels for a scene\n * that is being rendered in the background. It is used in different effects,\n * such as applying postprocessing to a rendered image before displaying it\n * on the screen.\n *\n * @augments EventDispatcher\n */\nclass RenderTarget extends EventDispatcher {\n\n\t/**\n\t * Render target options.\n\t *\n\t * @typedef {Object} RenderTarget~Options\n\t * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not.\n\t * @property {number} [magFilter=LinearFilter] - The mag filter.\n\t * @property {number} [minFilter=LinearFilter] - The min filter.\n\t * @property {number} [format=RGBAFormat] - The texture format.\n\t * @property {number} [type=UnsignedByteType] - The texture type.\n\t * @property {?string} [internalFormat=null] - The texture's internal format.\n\t * @property {number} [wrapS=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n\t * @property {number} [wrapT=ClampToEdgeWrapping] - The texture's uv wrapping mode.\n\t * @property {number} [anisotropy=1] - The texture's anisotropy value.\n\t * @property {string} [colorSpace=NoColorSpace] - The texture's color space.\n\t * @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not.\n\t * @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not.\n\t * @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not.\n\t * @property {boolean} [resolveStencilBuffer=true] - Whether  to resolve the stencil buffer or not.\n\t * @property {?Texture} [depthTexture=null] - Reference to a depth texture.\n\t * @property {number} [samples=0] - The MSAA samples count.\n\t * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.\n\t * @property {number} [depth=1] - The texture depth.\n\t * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering.\n\t */\n\n\t/**\n\t * Constructs a new render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper();\n\n\t\toptions = Object.assign( {\n\t\t\tgenerateMipmaps: false,\n\t\t\tinternalFormat: null,\n\t\t\tminFilter: LinearFilter,\n\t\t\tdepthBuffer: true,\n\t\t\tstencilBuffer: false,\n\t\t\tresolveDepthBuffer: true,\n\t\t\tresolveStencilBuffer: true,\n\t\t\tdepthTexture: null,\n\t\t\tsamples: 0,\n\t\t\tcount: 1,\n\t\t\tdepth: 1,\n\t\t\tmultiview: false\n\t\t}, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRenderTarget = true;\n\n\t\t/**\n\t\t * The width of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.width = width;\n\n\t\t/**\n\t\t * The height of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.height = height;\n\n\t\t/**\n\t\t * The depth of the render target.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.depth = options.depth;\n\n\t\t/**\n\t\t * A rectangular area inside the render target's viewport. Fragments that are\n\t\t * outside the area will be discarded.\n\t\t *\n\t\t * @type {Vector4}\n\t\t * @default (0,0,width,height)\n\t\t */\n\t\tthis.scissor = new Vector4( 0, 0, width, height );\n\n\t\t/**\n\t\t * Indicates whether the scissor test should be enabled when rendering into\n\t\t * this render target or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.scissorTest = false;\n\n\t\t/**\n\t\t * A rectangular area representing the render target's viewport.\n\t\t *\n\t\t * @type {Vector4}\n\t\t * @default (0,0,width,height)\n\t\t */\n\t\tthis.viewport = new Vector4( 0, 0, width, height );\n\n\t\tconst image = { width: width, height: height, depth: options.depth };\n\n\t\tconst texture = new Texture( image );\n\n\t\t/**\n\t\t * An array of textures. Each color attachment is represented as a separate texture.\n\t\t * Has at least a single entry for the default color attachment.\n\t\t *\n\t\t * @type {Array<Texture>}\n\t\t */\n\t\tthis.textures = [];\n\n\t\tconst count = options.count;\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.textures[ i ] = texture.clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\t\t\tthis.textures[ i ].renderTarget = this;\n\n\t\t}\n\n\t\tthis._setTextureOptions( options );\n\n\t\t/**\n\t\t * Whether to allocate a depth buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthBuffer = options.depthBuffer;\n\n\t\t/**\n\t\t * Whether to allocate a stencil buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.stencilBuffer = options.stencilBuffer;\n\n\t\t/**\n\t\t * Whether to resolve the depth buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.resolveDepthBuffer = options.resolveDepthBuffer;\n\n\t\t/**\n\t\t * Whether to resolve the stencil buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.resolveStencilBuffer = options.resolveStencilBuffer;\n\n\t\tthis._depthTexture = null;\n\t\tthis.depthTexture = options.depthTexture;\n\n\t\t/**\n\t\t * The number of MSAA samples.\n\t\t *\n\t\t * A value of `0` disables MSAA.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.samples = options.samples;\n\n\t\t/**\n\t\t * Whether to this target is used in multiview rendering.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.multiview = options.multiview;\n\n\t}\n\n\t_setTextureOptions( options = {} ) {\n\n\t\tconst values = {\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\tflipY: false,\n\t\t\tinternalFormat: null\n\t\t};\n\n\t\tif ( options.mapping !== undefined ) values.mapping = options.mapping;\n\t\tif ( options.wrapS !== undefined ) values.wrapS = options.wrapS;\n\t\tif ( options.wrapT !== undefined ) values.wrapT = options.wrapT;\n\t\tif ( options.wrapR !== undefined ) values.wrapR = options.wrapR;\n\t\tif ( options.magFilter !== undefined ) values.magFilter = options.magFilter;\n\t\tif ( options.minFilter !== undefined ) values.minFilter = options.minFilter;\n\t\tif ( options.format !== undefined ) values.format = options.format;\n\t\tif ( options.type !== undefined ) values.type = options.type;\n\t\tif ( options.anisotropy !== undefined ) values.anisotropy = options.anisotropy;\n\t\tif ( options.colorSpace !== undefined ) values.colorSpace = options.colorSpace;\n\t\tif ( options.flipY !== undefined ) values.flipY = options.flipY;\n\t\tif ( options.generateMipmaps !== undefined ) values.generateMipmaps = options.generateMipmaps;\n\t\tif ( options.internalFormat !== undefined ) values.internalFormat = options.internalFormat;\n\n\t\tfor ( let i = 0; i < this.textures.length; i ++ ) {\n\n\t\t\tconst texture = this.textures[ i ];\n\t\t\ttexture.setValues( values );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * The texture representing the default color attachment.\n\t *\n\t * @type {Texture}\n\t */\n\tget texture() {\n\n\t\treturn this.textures[ 0 ];\n\n\t}\n\n\tset texture( value ) {\n\n\t\tthis.textures[ 0 ] = value;\n\n\t}\n\n\tset depthTexture( current ) {\n\n\t\tif ( this._depthTexture !== null ) this._depthTexture.renderTarget = null;\n\t\tif ( current !== null ) current.renderTarget = this;\n\n\t\tthis._depthTexture = current;\n\n\t}\n\n\t/**\n\t * Instead of saving the depth in a renderbuffer, a texture\n\t * can be used instead which is useful for further processing\n\t * e.g. in context of post-processing.\n\t *\n\t * @type {?DepthTexture}\n\t * @default null\n\t */\n\tget depthTexture() {\n\n\t\treturn this._depthTexture;\n\n\t}\n\n\t/**\n\t * Sets the size of this render target.\n\t *\n\t * @param {number} width - The width.\n\t * @param {number} height - The height.\n\t * @param {number} [depth=1] - The depth.\n\t */\n\tsetSize( width, height, depth = 1 ) {\n\n\t\tif ( this.width !== width || this.height !== height || this.depth !== depth ) {\n\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = depth;\n\n\t\t\tfor ( let i = 0, il = this.textures.length; i < il; i ++ ) {\n\n\t\t\t\tthis.textures[ i ].image.width = width;\n\t\t\t\tthis.textures[ i ].image.height = height;\n\t\t\t\tthis.textures[ i ].image.depth = depth;\n\t\t\t\tthis.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;\n\n\t\t\t}\n\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tthis.viewport.set( 0, 0, width, height );\n\t\tthis.scissor.set( 0, 0, width, height );\n\n\t}\n\n\t/**\n\t * Returns a new render target with copied values from this instance.\n\t *\n\t * @return {RenderTarget} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the settings of the given render target. This is a structural copy so\n\t * no resources are shared between render targets after the copy. That includes\n\t * all MRT textures and the depth texture.\n\t *\n\t * @param {RenderTarget} source - The render target to copy.\n\t * @return {RenderTarget} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\t\tthis.depth = source.depth;\n\n\t\tthis.scissor.copy( source.scissor );\n\t\tthis.scissorTest = source.scissorTest;\n\n\t\tthis.viewport.copy( source.viewport );\n\n\t\tthis.textures.length = 0;\n\n\t\tfor ( let i = 0, il = source.textures.length; i < il; i ++ ) {\n\n\t\t\tthis.textures[ i ] = source.textures[ i ].clone();\n\t\t\tthis.textures[ i ].isRenderTargetTexture = true;\n\t\t\tthis.textures[ i ].renderTarget = this;\n\n\t\t\t// ensure image object is not shared, see #20328\n\n\t\t\tconst image = Object.assign( {}, source.textures[ i ].image );\n\t\t\tthis.textures[ i ].source = new Source( image );\n\n\t\t}\n\n\t\tthis.depthBuffer = source.depthBuffer;\n\t\tthis.stencilBuffer = source.stencilBuffer;\n\n\t\tthis.resolveDepthBuffer = source.resolveDepthBuffer;\n\t\tthis.resolveStencilBuffer = source.resolveStencilBuffer;\n\n\t\tif ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();\n\n\t\tthis.samples = source.samples;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires RenderTarget#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\n/**\n * A render target used in context of {@link WebGLRenderer}.\n *\n * @augments RenderTarget\n */\nclass WebGLRenderTarget extends RenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLRenderTarget = true;\n\n\t}\n\n}\n\n/**\n * Creates an array of textures directly from raw buffer data.\n *\n * @augments Texture\n */\nclass DataArrayTexture extends Texture {\n\n\t/**\n\t * Constructs a new data array texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\tsuper( null );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDataArrayTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image = { data, width, height, depth };\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t\t/**\n\t\t * A set of all layers which need to be updated in the texture.\n\t\t *\n\t\t * @type {Set<number>}\n\t\t */\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\t/**\n\t * Describes that a specific layer of the texture needs to be updated.\n\t * Normally when {@link Texture#needsUpdate} is set to `true`, the\n\t * entire data texture array is sent to the GPU. Marking specific\n\t * layers will only transmit subsets of all mipmaps associated with a\n\t * specific depth in the array which is often much more performant.\n\t *\n\t * @param {number} layerIndex - The layer index that should be updated.\n\t */\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\t/**\n\t * Resets the layer updates registry.\n\t */\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\n/**\n * An array render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGLArrayRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new array render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLArrayRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {DataArrayTexture}\n\t\t */\n\t\tthis.texture = new DataArrayTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Creates a three-dimensional texture from raw data, with parameters to\n * divide it into width, height, and depth.\n *\n * @augments Texture\n */\nclass Data3DTexture extends Texture {\n\n\t/**\n\t * Constructs a new data array texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( data = null, width = 1, height = 1, depth = 1 ) {\n\n\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t// Users can still set in Data3DTexture directly.\n\t\t//\n\t\t//\tconst texture = new THREE.Data3DTexture( data, width, height, depth );\n\t\t// \ttexture.anisotropy = 16;\n\t\t//\n\t\t// See #14839\n\n\t\tsuper( null );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isData3DTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image = { data, width, height, depth };\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\n/**\n * A 3D render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGL3DRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGL3DRenderTarget = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {Data3DTexture}\n\t\t */\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Represents an axis-aligned bounding box (AABB) in 3D space.\n */\nclass Box3 {\n\n\t/**\n\t * Constructs a new bounding box.\n\t *\n\t * @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box.\n\t * @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box.\n\t */\n\tconstructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBox3 = true;\n\n\t\t/**\n\t\t * The lower boundary of the box.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.min = min;\n\n\t\t/**\n\t\t * The upper boundary of the box.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.max = max;\n\n\t}\n\n\t/**\n\t * Sets the lower and upper boundaries of this box.\n\t * Please note that this method only copies the values from the given objects.\n\t *\n\t * @param {Vector3} min - The lower boundary of the box.\n\t * @param {Vector3} max - The upper boundary of the box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array<number>} array - An array holding 3D position data.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromArray( array ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = array.length; i < il; i += 3 ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromArray( array, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute holding 3D position data.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromBufferAttribute( attribute ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = attribute.count; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( _vector$b.fromBufferAttribute( attribute, i ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array<Vector3>} points - An array holding 3D position data as instances of {@link Vector3}.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Centers this box on the given center vector and sets this box's width, height and\n\t * depth to the given size values.\n\t *\n\t * @param {Vector3} center - The center of the box.\n\t * @param {Vector3} size - The x, y and z dimensions of the box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$b.copy( size ).multiplyScalar( 0.5 );\n\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the world-axis-aligned bounding box for the given 3D object\n\t * (including its children), accounting for the object's, and children's,\n\t * world transforms. The function may result in a larger box than strictly necessary.\n\t *\n\t * @param {Object3D} object - The 3D object to compute the bounding box for.\n\t * @param {boolean} [precise=false] - If set to `true`, the method computes the smallest\n\t * world-axis-aligned bounding box at the expense of more computation.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tsetFromObject( object, precise = false ) {\n\n\t\tthis.makeEmpty();\n\n\t\treturn this.expandByObject( object, precise );\n\n\t}\n\n\t/**\n\t * Returns a new box with copied values from this instance.\n\t *\n\t * @return {Box3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given box to this instance.\n\t *\n\t * @param {Box3} box - The box to copy.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Makes this box empty which means in encloses a zero space in 3D.\n\t *\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = this.min.z = + Infinity;\n\t\tthis.max.x = this.max.y = this.max.z = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns true if this box includes zero points within its bounds.\n\t * Note that a box with equal lower and upper bounds still includes one\n\t * point, the one both bounds share.\n\t *\n\t * @return {boolean} Whether this box is empty or not.\n\t */\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y ) || ( this.max.z < this.min.z );\n\n\t}\n\n\t/**\n\t * Returns the center point of this box.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the dimensions of this box.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The size.\n\t */\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given point.\n\t *\n\t * @param {Vector3} point - The point that should be included by the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this box equilaterally by the given vector. The width of this\n\t * box will be expanded by the x component of the vector in both\n\t * directions. The height of this box will be expanded by the y component of\n\t * the vector in both directions. The depth of this box will be\n\t * expanded by the z component of the vector in both directions.\n\t *\n\t * @param {Vector3} vector - The vector that should expand the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands each dimension of the box by the given scalar. If negative, the\n\t * dimensions of the box will be contracted.\n\t *\n\t * @param {number} scalar - The scalar value that should expand the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given 3D object and\n\t * its children, accounting for the object's, and children's, world\n\t * transforms. The function may result in a larger box than strictly\n\t * necessary (unless the precise parameter is set to true).\n\t *\n\t * @param {Object3D} object - The 3D object that should expand the bounding box.\n\t * @param {boolean} precise - If set to `true`, the method expands the bounding box\n\t * as little as necessary at the expense of more computation.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\texpandByObject( object, precise = false ) {\n\n\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t// accounting for both the object's, and children's, world transforms\n\n\t\tobject.updateWorldMatrix( false, false );\n\n\t\tconst geometry = object.geometry;\n\n\t\tif ( geometry !== undefined ) {\n\n\t\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\t\t// precise AABB computation based on vertex data requires at least a position attribute.\n\t\t\t// instancing isn't supported so far and uses the normal (conservative) code path.\n\n\t\t\tif ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {\n\n\t\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t\tif ( object.isMesh === true ) {\n\n\t\t\t\t\t\tobject.getVertexPosition( i, _vector$b );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_vector$b.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_vector$b.applyMatrix4( object.matrixWorld );\n\t\t\t\t\tthis.expandByPoint( _vector$b );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( object.boundingBox !== undefined ) {\n\n\t\t\t\t\t// object-level bounding box\n\n\t\t\t\t\tif ( object.boundingBox === null ) {\n\n\t\t\t\t\t\tobject.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( object.boundingBox );\n\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// geometry-level bounding box\n\n\t\t\t\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\t\t\t\tgeometry.computeBoundingBox();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_box$4.copy( geometry.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\t_box$4.applyMatrix4( object.matrixWorld );\n\n\t\t\t\tthis.union( _box$4 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tthis.expandByObject( children[ i ], precise );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within or on the boundaries of this box.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @return {boolean} Whether the bounding box contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn point.x >= this.min.x && point.x <= this.max.x &&\n\t\t\tpoint.y >= this.min.y && point.y <= this.max.y &&\n\t\t\tpoint.z >= this.min.z && point.z <= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box includes the entirety of the given bounding box.\n\t * If this box and the given one are identical, this function also returns `true`.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box contains the given bounding box or not.\n\t */\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y &&\n\t\t\tthis.min.z <= box.min.z && box.max.z <= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns a point as a proportion of this box's width, height and depth.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} A point as a proportion of this box's width, height and depth.\n\t */\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y ),\n\t\t\t( point.z - this.min.z ) / ( this.max.z - this.min.z )\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with this bounding box.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with this bounding box.\n\t */\n\tintersectsBox( box ) {\n\n\t\t// using 6 splitting planes to rule out intersections.\n\t\treturn box.max.x >= this.min.x && box.min.x <= this.max.x &&\n\t\t\tbox.max.y >= this.min.y && box.min.y <= this.max.y &&\n\t\t\tbox.max.z >= this.min.z && box.min.z <= this.max.z;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere intersects with this bounding box.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the given bounding sphere intersects with this bounding box.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\t// Find the point on the AABB closest to the sphere center.\n\t\tthis.clampPoint( sphere.center, _vector$b );\n\n\t\t// If that point is inside the sphere, the AABB and sphere intersect.\n\t\treturn _vector$b.distanceToSquared( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given plane intersects with this bounding box.\n\t *\n\t * @param {Plane} plane - The plane to test.\n\t * @return {boolean} Whether the given plane intersects with this bounding box.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\n\t\tlet min, max;\n\n\t\tif ( plane.normal.x > 0 ) {\n\n\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\tmax = plane.normal.x * this.max.x;\n\n\t\t} else {\n\n\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\tmax = plane.normal.x * this.min.x;\n\n\t\t}\n\n\t\tif ( plane.normal.y > 0 ) {\n\n\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\tmax += plane.normal.y * this.max.y;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\tmax += plane.normal.y * this.min.y;\n\n\t\t}\n\n\t\tif ( plane.normal.z > 0 ) {\n\n\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\tmax += plane.normal.z * this.max.z;\n\n\t\t} else {\n\n\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\tmax += plane.normal.z * this.min.z;\n\n\t\t}\n\n\t\treturn ( min <= - plane.constant && max >= - plane.constant );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given triangle intersects with this bounding box.\n\t *\n\t * @param {Triangle} triangle - The triangle to test.\n\t * @return {boolean} Whether the given triangle intersects with this bounding box.\n\t */\n\tintersectsTriangle( triangle ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// compute box center and extents\n\t\tthis.getCenter( _center );\n\t\t_extents.subVectors( this.max, _center );\n\n\t\t// translate triangle to aabb origin\n\t\t_v0$2.subVectors( triangle.a, _center );\n\t\t_v1$7.subVectors( triangle.b, _center );\n\t\t_v2$4.subVectors( triangle.c, _center );\n\n\t\t// compute edge vectors for triangle\n\t\t_f0.subVectors( _v1$7, _v0$2 );\n\t\t_f1.subVectors( _v2$4, _v1$7 );\n\t\t_f2.subVectors( _v0$2, _v2$4 );\n\n\t\t// test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\t\tlet axes = [\n\t\t\t0, - _f0.z, _f0.y, 0, - _f1.z, _f1.y, 0, - _f2.z, _f2.y,\n\t\t\t_f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,\n\t\t\t- _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0\n\t\t];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// test 3 face normals from the aabb\n\t\taxes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];\n\t\tif ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\t// finally testing the face normal of the triangle\n\t\t// use already existing triangle edge vectors here\n\t\t_triangleNormal.crossVectors( _f0, _f1 );\n\t\taxes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];\n\n\t\treturn satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents );\n\n\t}\n\n\t/**\n\t * Clamps the given point within the bounds of this box.\n\t *\n\t * @param {Vector3} point - The point to clamp.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\t/**\n\t * Returns the euclidean distance from any edge of this box to the specified point. If\n\t * the given point lies inside of this box, the distance will be `0`.\n\t *\n\t * @param {Vector3} point - The point to compute the distance to.\n\t * @return {number} The euclidean distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$b ).distanceTo( point );\n\n\t}\n\n\t/**\n\t * Returns a bounding sphere that encloses this bounding box.\n\t *\n\t * @param {Sphere} target - The target sphere that is used to store the method's result.\n\t * @return {Sphere} The bounding sphere that encloses this bounding box.\n\t */\n\tgetBoundingSphere( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\ttarget.makeEmpty();\n\n\t\t} else {\n\n\t\t\tthis.getCenter( target.center );\n\n\t\t\ttarget.radius = this.getSize( _vector$b ).length() * 0.5;\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the intersection of this bounding box and the given one, setting the upper\n\t * bound of this box to the lesser of the two boxes' upper bounds and the\n\t * lower bound of this box to the greater of the two boxes' lower bounds. If\n\t * there's no overlap, makes this box empty.\n\t *\n\t * @param {Box3} box - The bounding box to intersect with.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\t// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the union of this box and another and the given one, setting the upper\n\t * bound of this box to the greater of the two boxes' upper bounds and the\n\t * lower bound of this box to the lesser of the two boxes' lower bounds.\n\t *\n\t * @param {Box3} box - The bounding box that will be unioned with this instance.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transforms this bounding box by the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\t// transform of empty box is an empty box.\n\t\tif ( this.isEmpty() ) return this;\n\n\t\t// NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\t\t_points[ 0 ].set( this.min.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 000\n\t\t_points[ 1 ].set( this.min.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 001\n\t\t_points[ 2 ].set( this.min.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 010\n\t\t_points[ 3 ].set( this.min.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 011\n\t\t_points[ 4 ].set( this.max.x, this.min.y, this.min.z ).applyMatrix4( matrix ); // 100\n\t\t_points[ 5 ].set( this.max.x, this.min.y, this.max.z ).applyMatrix4( matrix ); // 101\n\t\t_points[ 6 ].set( this.max.x, this.max.y, this.min.z ).applyMatrix4( matrix ); // 110\n\t\t_points[ 7 ].set( this.max.x, this.max.y, this.max.z ).applyMatrix4( matrix ); // 111\n\n\t\tthis.setFromPoints( _points );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given offset to both the upper and lower bounds of this bounding box,\n\t * effectively moving it in 3D space.\n\t *\n\t * @param {Vector3} offset - The offset that should be used to translate the bounding box.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box is equal with the given one.\n\t *\n\t * @param {Box3} box - The box to test for equality.\n\t * @return {boolean} Whether this bounding box is equal with the given one.\n\t */\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding box.\n\t *\n\t * @return {Object} Serialized structure with fields representing the object state.\n\t */\n\ttoJSON() {\n\n\t\treturn {\n\t\t\tmin: this.min.toArray(),\n\t\t\tmax: this.max.toArray()\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding box.\n\t *\n\t * @param {Object} json - The serialized json to set the box from.\n\t * @return {Box3} A reference to this bounding box.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.min.fromArray( json.min );\n\t\tthis.max.fromArray( json.max );\n\t\treturn this;\n\n\t}\n\n}\n\nconst _points = [\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3(),\n\t/*@__PURE__*/ new Vector3()\n];\n\nconst _vector$b = /*@__PURE__*/ new Vector3();\n\nconst _box$4 = /*@__PURE__*/ new Box3();\n\n// triangle centered vertices\n\nconst _v0$2 = /*@__PURE__*/ new Vector3();\nconst _v1$7 = /*@__PURE__*/ new Vector3();\nconst _v2$4 = /*@__PURE__*/ new Vector3();\n\n// triangle edge vectors\n\nconst _f0 = /*@__PURE__*/ new Vector3();\nconst _f1 = /*@__PURE__*/ new Vector3();\nconst _f2 = /*@__PURE__*/ new Vector3();\n\nconst _center = /*@__PURE__*/ new Vector3();\nconst _extents = /*@__PURE__*/ new Vector3();\nconst _triangleNormal = /*@__PURE__*/ new Vector3();\nconst _testAxis = /*@__PURE__*/ new Vector3();\n\nfunction satForAxes( axes, v0, v1, v2, extents ) {\n\n\tfor ( let i = 0, j = axes.length - 3; i <= j; i += 3 ) {\n\n\t\t_testAxis.fromArray( axes, i );\n\t\t// project the aabb onto the separating axis\n\t\tconst r = extents.x * Math.abs( _testAxis.x ) + extents.y * Math.abs( _testAxis.y ) + extents.z * Math.abs( _testAxis.z );\n\t\t// project all 3 vertices of the triangle onto the separating axis\n\t\tconst p0 = v0.dot( _testAxis );\n\t\tconst p1 = v1.dot( _testAxis );\n\t\tconst p2 = v2.dot( _testAxis );\n\t\t// actual test, basically see if either of the most extreme of the triangle points intersects r\n\t\tif ( Math.max( - Math.max( p0, p1, p2 ), Math.min( p0, p1, p2 ) ) > r ) {\n\n\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t// the axis is separating and we can exit\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}\n\nconst _box$3 = /*@__PURE__*/ new Box3();\nconst _v1$6 = /*@__PURE__*/ new Vector3();\nconst _v2$3 = /*@__PURE__*/ new Vector3();\n\n/**\n * An analytical 3D sphere defined by a center and radius. This class is mainly\n * used as a Bounding Sphere for 3D objects.\n */\nclass Sphere {\n\n\t/**\n\t * Constructs a new sphere.\n\t *\n\t * @param {Vector3} [center=(0,0,0)] - The center of the sphere\n\t * @param {number} [radius=-1] - The radius of the sphere.\n\t */\n\tconstructor( center = new Vector3(), radius = -1 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSphere = true;\n\n\t\t/**\n\t\t * The center of the sphere\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.center = center;\n\n\t\t/**\n\t\t * The radius of the sphere.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.radius = radius;\n\n\t}\n\n\t/**\n\t * Sets the sphere's components by copying the given values.\n\t *\n\t * @param {Vector3} center - The center.\n\t * @param {number} radius - The radius.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tset( center, radius ) {\n\n\t\tthis.center.copy( center );\n\t\tthis.radius = radius;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the minimum bounding sphere for list of points.\n\t * If the optional center point is given, it is used as the sphere's\n\t * center. Otherwise, the center of the axis-aligned bounding box\n\t * encompassing the points is calculated.\n\t *\n\t * @param {Array<Vector3>} points - A list of points in 3D space.\n\t * @param {Vector3} [optionalCenter] - The center of the sphere.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tsetFromPoints( points, optionalCenter ) {\n\n\t\tconst center = this.center;\n\n\t\tif ( optionalCenter !== undefined ) {\n\n\t\t\tcenter.copy( optionalCenter );\n\n\t\t} else {\n\n\t\t\t_box$3.setFromPoints( points ).getCenter( center );\n\n\t\t}\n\n\t\tlet maxRadiusSq = 0;\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( points[ i ] ) );\n\n\t\t}\n\n\t\tthis.radius = Math.sqrt( maxRadiusSq );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given sphere to this instance.\n\t *\n\t * @param {Sphere} sphere - The sphere to copy.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tcopy( sphere ) {\n\n\t\tthis.center.copy( sphere.center );\n\t\tthis.radius = sphere.radius;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the sphere is empty (the radius set to a negative number).\n\t *\n\t * Spheres with a radius of `0` contain only their center point and are not\n\t * considered to be empty.\n\t *\n\t * @return {boolean} Whether this sphere is empty or not.\n\t */\n\tisEmpty() {\n\n\t\treturn ( this.radius < 0 );\n\n\t}\n\n\t/**\n\t * Makes this sphere empty which means in encloses a zero space in 3D.\n\t *\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.center.set( 0, 0, 0 );\n\t\tthis.radius = -1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere contains the given point inclusive of\n\t * the surface of the sphere.\n\t *\n\t * @param {Vector3} point - The point to check.\n\t * @return {boolean} Whether this sphere contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn ( point.distanceToSquared( this.center ) <= ( this.radius * this.radius ) );\n\n\t}\n\n\t/**\n\t * Returns the closest distance from the boundary of the sphere to the\n\t * given point. If the sphere contains the point, the distance will\n\t * be negative.\n\t *\n\t * @param {Vector3} point - The point to compute the distance to.\n\t * @return {number} The distance to the point.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn ( point.distanceTo( this.center ) - this.radius );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given one.\n\t *\n\t * @param {Sphere} sphere - The sphere to test.\n\t * @return {boolean} Whether this sphere intersects with the given one or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tconst radiusSum = this.radius + sphere.radius;\n\n\t\treturn sphere.center.distanceToSquared( this.center ) <= ( radiusSum * radiusSum );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to test.\n\t * @return {boolean} Whether this sphere intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsSphere( this );\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere intersects with the given plane.\n\t *\n\t * @param {Plane} plane - The plane to test.\n\t * @return {boolean} Whether this sphere intersects with the given plane or not.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\treturn Math.abs( plane.distanceToPoint( this.center ) ) <= this.radius;\n\n\t}\n\n\t/**\n\t * Clamps a point within the sphere. If the point is outside the sphere, it\n\t * will clamp it to the closest point on the edge of the sphere. Points\n\t * already inside the sphere will not be affected.\n\t *\n\t * @param {Vector3} point - The plane to clamp.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\tconst deltaLengthSq = this.center.distanceToSquared( point );\n\n\t\ttarget.copy( point );\n\n\t\tif ( deltaLengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\ttarget.sub( this.center ).normalize();\n\t\t\ttarget.multiplyScalar( this.radius ).add( this.center );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a bounding box that encloses this sphere.\n\t *\n\t * @param {Box3} target - The target box that is used to store the method's result.\n\t * @return {Box3} The bounding box that encloses this sphere.\n\t */\n\tgetBoundingBox( target ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\t// Empty sphere produces empty bounding box\n\t\t\ttarget.makeEmpty();\n\t\t\treturn target;\n\n\t\t}\n\n\t\ttarget.set( this.center, this.center );\n\t\ttarget.expandByScalar( this.radius );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Transforms this sphere with the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.center.applyMatrix4( matrix );\n\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the sphere's center by the given offset.\n\t *\n\t * @param {Vector3} offset - The offset.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.center.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this sphere to include the given point.\n\t *\n\t * @param {Vector3} point - The point to include.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\texpandByPoint( point ) {\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.center.copy( point );\n\n\t\t\tthis.radius = 0;\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_v1$6.subVectors( point, this.center );\n\n\t\tconst lengthSq = _v1$6.lengthSq();\n\n\t\tif ( lengthSq > ( this.radius * this.radius ) ) {\n\n\t\t\t// calculate the minimal sphere\n\n\t\t\tconst length = Math.sqrt( lengthSq );\n\n\t\t\tconst delta = ( length - this.radius ) * 0.5;\n\n\t\t\tthis.center.addScaledVector( _v1$6, delta / length );\n\n\t\t\tthis.radius += delta;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this sphere to enclose both the original sphere and the given sphere.\n\t *\n\t * @param {Sphere} sphere - The sphere to include.\n\t * @return {Sphere} A reference to this sphere.\n\t */\n\tunion( sphere ) {\n\n\t\tif ( sphere.isEmpty() ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.isEmpty() ) {\n\n\t\t\tthis.copy( sphere );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( this.center.equals( sphere.center ) === true ) {\n\n\t\t\t this.radius = Math.max( this.radius, sphere.radius );\n\n\t\t} else {\n\n\t\t\t_v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) );\n\n\t\t\tthis.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this sphere is equal with the given one.\n\t *\n\t * @param {Sphere} sphere - The sphere to test for equality.\n\t * @return {boolean} Whether this bounding sphere is equal with the given one.\n\t */\n\tequals( sphere ) {\n\n\t\treturn sphere.center.equals( this.center ) && ( sphere.radius === this.radius );\n\n\t}\n\n\t/**\n\t * Returns a new sphere with copied values from this instance.\n\t *\n\t * @return {Sphere} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding sphere.\n\t *\n\t * @return {Object} Serialized structure with fields representing the object state.\n\t */\n\ttoJSON() {\n\n\t\treturn {\n\t\t\tradius: this.radius,\n\t\t\tcenter: this.center.toArray()\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a serialized structure of the bounding sphere.\n\t *\n\t * @param {Object} json - The serialized json to set the sphere from.\n\t * @return {Box3} A reference to this bounding sphere.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.radius = json.radius;\n\t\tthis.center.fromArray( json.center );\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vector$a = /*@__PURE__*/ new Vector3();\nconst _segCenter = /*@__PURE__*/ new Vector3();\nconst _segDir = /*@__PURE__*/ new Vector3();\nconst _diff = /*@__PURE__*/ new Vector3();\n\nconst _edge1 = /*@__PURE__*/ new Vector3();\nconst _edge2 = /*@__PURE__*/ new Vector3();\nconst _normal$1 = /*@__PURE__*/ new Vector3();\n\n/**\n * A ray that emits from an origin in a certain direction. The class is used by\n * {@link Raycaster} to assist with raycasting. Raycasting is used for\n * mouse picking (working out what objects in the 3D space the mouse is over)\n * amongst other things.\n */\nclass Ray {\n\n\t/**\n\t * Constructs a new ray.\n\t *\n\t * @param {Vector3} [origin=(0,0,0)] - The origin of the ray.\n\t * @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray.\n\t */\n\tconstructor( origin = new Vector3(), direction = new Vector3( 0, 0, -1 ) ) {\n\n\t\t/**\n\t\t * The origin of the ray.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.origin = origin;\n\n\t\t/**\n\t\t * The (normalized) direction of the ray.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.direction = direction;\n\n\t}\n\n\t/**\n\t * Sets the ray's components by copying the given values.\n\t *\n\t * @param {Vector3} origin - The origin.\n\t * @param {Vector3} direction - The direction.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tset( origin, direction ) {\n\n\t\tthis.origin.copy( origin );\n\t\tthis.direction.copy( direction );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given ray to this instance.\n\t *\n\t * @param {Ray} ray - The ray to copy.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tcopy( ray ) {\n\n\t\tthis.origin.copy( ray.origin );\n\t\tthis.direction.copy( ray.direction );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a vector that is located at a given distance along this ray.\n\t *\n\t * @param {number} t - The distance along the ray to retrieve a position for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} A position on the ray.\n\t */\n\tat( t, target ) {\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, t );\n\n\t}\n\n\t/**\n\t * Adjusts the direction of the ray to point at the given vector in world space.\n\t *\n\t * @param {Vector3} v - The target position.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tlookAt( v ) {\n\n\t\tthis.direction.copy( v ).sub( this.origin ).normalize();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Shift the origin of this ray along its direction by the given distance.\n\t *\n\t * @param {number} t - The distance along the ray to interpolate.\n\t * @return {Ray} A reference to this ray.\n\t */\n\trecast( t ) {\n\n\t\tthis.origin.copy( this.at( t, _vector$a ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the point along this ray that is closest to the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to get the closet location on the ray for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on this ray.\n\t */\n\tclosestPointToPoint( point, target ) {\n\n\t\ttarget.subVectors( point, this.origin );\n\n\t\tconst directionDistance = target.dot( this.direction );\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn target.copy( this.origin );\n\n\t\t}\n\n\t\treturn target.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t}\n\n\t/**\n\t * Returns the distance of the closest approach between this ray and the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to compute the distance to.\n\t * @return {number} The distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn Math.sqrt( this.distanceSqToPoint( point ) );\n\n\t}\n\n\t/**\n\t * Returns the squared distance of the closest approach between this ray and the given point.\n\t *\n\t * @param {Vector3} point - A point in 3D space to compute the distance to.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceSqToPoint( point ) {\n\n\t\tconst directionDistance = _vector$a.subVectors( point, this.origin ).dot( this.direction );\n\n\t\t// point behind the ray\n\n\t\tif ( directionDistance < 0 ) {\n\n\t\t\treturn this.origin.distanceToSquared( point );\n\n\t\t}\n\n\t\t_vector$a.copy( this.origin ).addScaledVector( this.direction, directionDistance );\n\n\t\treturn _vector$a.distanceToSquared( point );\n\n\t}\n\n\t/**\n\t * Returns the squared distance between this ray and the given line segment.\n\t *\n\t * @param {Vector3} v0 - The start point of the line segment.\n\t * @param {Vector3} v1 - The end point of the line segment.\n\t * @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment.\n\t * @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray.\n\t * @return {number} The squared distance.\n\t */\n\tdistanceSqToSegment( v0, v1, optionalPointOnRay, optionalPointOnSegment ) {\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t// It returns the min distance between the ray and the segment\n\t\t// defined by v0 and v1\n\t\t// It can also set two optional targets :\n\t\t// - The closest point on the ray\n\t\t// - The closest point on the segment\n\n\t\t_segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );\n\t\t_segDir.copy( v1 ).sub( v0 ).normalize();\n\t\t_diff.copy( this.origin ).sub( _segCenter );\n\n\t\tconst segExtent = v0.distanceTo( v1 ) * 0.5;\n\t\tconst a01 = - this.direction.dot( _segDir );\n\t\tconst b0 = _diff.dot( this.direction );\n\t\tconst b1 = - _diff.dot( _segDir );\n\t\tconst c = _diff.lengthSq();\n\t\tconst det = Math.abs( 1 - a01 * a01 );\n\t\tlet s0, s1, sqrDist, extDet;\n\n\t\tif ( det > 0 ) {\n\n\t\t\t// The ray and segment are not parallel.\n\n\t\t\ts0 = a01 * b1 - b0;\n\t\t\ts1 = a01 * b0 - b1;\n\t\t\textDet = segExtent * det;\n\n\t\t\tif ( s0 >= 0 ) {\n\n\t\t\t\tif ( s1 >= - extDet ) {\n\n\t\t\t\t\tif ( s1 <= extDet ) {\n\n\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\n\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\tsqrDist = s0 * ( s0 + a01 * s1 + 2 * b0 ) + s1 * ( a01 * s0 + s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// region 1\n\n\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 5\n\n\t\t\t\t\ts1 = - segExtent;\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( s1 <= - extDet ) {\n\n\t\t\t\t\t// region 4\n\n\t\t\t\t\ts0 = Math.max( 0, - ( - a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? - segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else if ( s1 <= extDet ) {\n\n\t\t\t\t\t// region 3\n\n\t\t\t\t\ts0 = 0;\n\t\t\t\t\ts1 = Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// region 2\n\n\t\t\t\t\ts0 = Math.max( 0, - ( a01 * segExtent + b0 ) );\n\t\t\t\t\ts1 = ( s0 > 0 ) ? segExtent : Math.min( Math.max( - segExtent, - b1 ), segExtent );\n\t\t\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Ray and segment are parallel.\n\n\t\t\ts1 = ( a01 > 0 ) ? - segExtent : segExtent;\n\t\t\ts0 = Math.max( 0, - ( a01 * s1 + b0 ) );\n\t\t\tsqrDist = - s0 * s0 + s1 * ( s1 + 2 * b1 ) + c;\n\n\t\t}\n\n\t\tif ( optionalPointOnRay ) {\n\n\t\t\toptionalPointOnRay.copy( this.origin ).addScaledVector( this.direction, s0 );\n\n\t\t}\n\n\t\tif ( optionalPointOnSegment ) {\n\n\t\t\toptionalPointOnSegment.copy( _segCenter ).addScaledVector( _segDir, s1 );\n\n\t\t}\n\n\t\treturn sqrDist;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given sphere, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Sphere} sphere - The sphere to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectSphere( sphere, target ) {\n\n\t\t_vector$a.subVectors( sphere.center, this.origin );\n\t\tconst tca = _vector$a.dot( this.direction );\n\t\tconst d2 = _vector$a.dot( _vector$a ) - tca * tca;\n\t\tconst radius2 = sphere.radius * sphere.radius;\n\n\t\tif ( d2 > radius2 ) return null;\n\n\t\tconst thc = Math.sqrt( radius2 - d2 );\n\n\t\t// t0 = first intersect point - entrance on front of sphere\n\t\tconst t0 = tca - thc;\n\n\t\t// t1 = second intersect point - exit point on back of sphere\n\t\tconst t1 = tca + thc;\n\n\t\t// test to see if t1 is behind the ray - if so, return null\n\t\tif ( t1 < 0 ) return null;\n\n\t\t// test to see if t0 is behind the ray:\n\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t// in order to always return an intersect point that is in front of the ray.\n\t\tif ( t0 < 0 ) return this.at( t1, target );\n\n\t\t// else t0 is in front of the ray, so return the first collision point scaled by t0\n\t\treturn this.at( t0, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given sphere.\n\t *\n\t * @param {Sphere} sphere - The sphere to intersect.\n\t * @return {boolean} Whether this ray intersects with the given sphere or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tif ( sphere.radius < 0 ) return false; // handle empty spheres, see #31187\n\n\t\treturn this.distanceSqToPoint( sphere.center ) <= ( sphere.radius * sphere.radius );\n\n\t}\n\n\t/**\n\t * Computes the distance from the ray's origin to the given plane. Returns `null` if the ray\n\t * does not intersect with the plane.\n\t *\n\t * @param {Plane} plane - The plane to compute the distance to.\n\t * @return {?number} Whether this ray intersects with the given sphere or not.\n\t */\n\tdistanceToPlane( plane ) {\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( plane.distanceToPoint( this.origin ) === 0 ) {\n\n\t\t\t\treturn 0;\n\n\t\t\t}\n\n\t\t\t// Null is preferable to undefined since undefined means.... it is undefined\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( this.origin.dot( plane.normal ) + plane.constant ) / denominator;\n\n\t\t// Return if the ray never intersects the plane\n\n\t\treturn t >= 0 ? t : null;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given plane, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Plane} plane - The plane to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectPlane( plane, target ) {\n\n\t\tconst t = this.distanceToPlane( plane );\n\n\t\tif ( t === null ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn this.at( t, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given plane.\n\t *\n\t * @param {Plane} plane - The plane to intersect.\n\t * @return {boolean} Whether this ray intersects with the given plane or not.\n\t */\n\tintersectsPlane( plane ) {\n\n\t\t// check if the ray lies on the plane first\n\n\t\tconst distToPoint = plane.distanceToPoint( this.origin );\n\n\t\tif ( distToPoint === 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\tconst denominator = plane.normal.dot( this.direction );\n\n\t\tif ( denominator * distToPoint < 0 ) {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// ray origin is behind the plane (and is pointing behind it)\n\n\t\treturn false;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given bounding box, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectBox( box, target ) {\n\n\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\n\t\tconst invdirx = 1 / this.direction.x,\n\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\tinvdirz = 1 / this.direction.z;\n\n\t\tconst origin = this.origin;\n\n\t\tif ( invdirx >= 0 ) {\n\n\t\t\ttmin = ( box.min.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.max.x - origin.x ) * invdirx;\n\n\t\t} else {\n\n\t\t\ttmin = ( box.max.x - origin.x ) * invdirx;\n\t\t\ttmax = ( box.min.x - origin.x ) * invdirx;\n\n\t\t}\n\n\t\tif ( invdiry >= 0 ) {\n\n\t\t\ttymin = ( box.min.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.max.y - origin.y ) * invdiry;\n\n\t\t} else {\n\n\t\t\ttymin = ( box.max.y - origin.y ) * invdiry;\n\t\t\ttymax = ( box.min.y - origin.y ) * invdiry;\n\n\t\t}\n\n\t\tif ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;\n\n\t\tif ( tymin > tmin || isNaN( tmin ) ) tmin = tymin;\n\n\t\tif ( tymax < tmax || isNaN( tmax ) ) tmax = tymax;\n\n\t\tif ( invdirz >= 0 ) {\n\n\t\t\ttzmin = ( box.min.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.max.z - origin.z ) * invdirz;\n\n\t\t} else {\n\n\t\t\ttzmin = ( box.max.z - origin.z ) * invdirz;\n\t\t\ttzmax = ( box.min.z - origin.z ) * invdirz;\n\n\t\t}\n\n\t\tif ( ( tmin > tzmax ) || ( tzmin > tmax ) ) return null;\n\n\t\tif ( tzmin > tmin || tmin !== tmin ) tmin = tzmin;\n\n\t\tif ( tzmax < tmax || tmax !== tmax ) tmax = tzmax;\n\n\t\t//return point closest to the ray (positive side)\n\n\t\tif ( tmax < 0 ) return null;\n\n\t\treturn this.at( tmin >= 0 ? tmin : tmax, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this ray intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn this.intersectBox( box, _vector$a ) !== null;\n\n\t}\n\n\t/**\n\t * Intersects this ray with the given triangle, returning the intersection\n\t * point or `null` if there is no intersection.\n\t *\n\t * @param {Vector3} a - The first vertex of the triangle.\n\t * @param {Vector3} b - The second vertex of the triangle.\n\t * @param {Vector3} c - The third vertex of the triangle.\n\t * @param {boolean} backfaceCulling - Whether to use backface culling or not.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectTriangle( a, b, c, backfaceCulling, target ) {\n\n\t\t// Compute the offset origin, edges, and normal.\n\n\t\t// from https://github.com/pmjoniak/GeometricTools/blob/master/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\n\t\t_edge1.subVectors( b, a );\n\t\t_edge2.subVectors( c, a );\n\t\t_normal$1.crossVectors( _edge1, _edge2 );\n\n\t\t// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t//   |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t//   |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t//   |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\t\tlet DdN = this.direction.dot( _normal$1 );\n\t\tlet sign;\n\n\t\tif ( DdN > 0 ) {\n\n\t\t\tif ( backfaceCulling ) return null;\n\t\t\tsign = 1;\n\n\t\t} else if ( DdN < 0 ) {\n\n\t\t\tsign = -1;\n\t\t\tDdN = - DdN;\n\n\t\t} else {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_diff.subVectors( this.origin, a );\n\t\tconst DdQxE2 = sign * this.direction.dot( _edge2.crossVectors( _diff, _edge2 ) );\n\n\t\t// b1 < 0, no intersection\n\t\tif ( DdQxE2 < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst DdE1xQ = sign * this.direction.dot( _edge1.cross( _diff ) );\n\n\t\t// b2 < 0, no intersection\n\t\tif ( DdE1xQ < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// b1+b2 > 1, no intersection\n\t\tif ( DdQxE2 + DdE1xQ > DdN ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Line intersects triangle, check if ray does.\n\t\tconst QdN = - sign * _diff.dot( _normal$1 );\n\n\t\t// t < 0, no intersection\n\t\tif ( QdN < 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// Ray intersects triangle.\n\t\treturn this.at( QdN / DdN, target );\n\n\t}\n\n\t/**\n\t * Transforms this ray with the given 4x4 transformation matrix.\n\t *\n\t * @param {Matrix4} matrix4 - The transformation matrix.\n\t * @return {Ray} A reference to this ray.\n\t */\n\tapplyMatrix4( matrix4 ) {\n\n\t\tthis.origin.applyMatrix4( matrix4 );\n\t\tthis.direction.transformDirection( matrix4 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this ray is equal with the given one.\n\t *\n\t * @param {Ray} ray - The ray to test for equality.\n\t * @return {boolean} Whether this ray is equal with the given one.\n\t */\n\tequals( ray ) {\n\n\t\treturn ray.origin.equals( this.origin ) && ray.direction.equals( this.direction );\n\n\t}\n\n\t/**\n\t * Returns a new ray with copied values from this instance.\n\t *\n\t * @return {Ray} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Represents a 4x4 matrix.\n *\n * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.\n * For an introduction to transformation matrices as used in WebGL, check out [this tutorial]{@link https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices}\n *\n * This allows a 3D vector representing a point in 3D space to undergo\n * transformations such as translation, rotation, shear, scale, reflection,\n * orthogonal or perspective projection and so on, by being multiplied by the\n * matrix. This is known as `applying` the matrix to the vector.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix3#set} method take arguments in\n * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}\n * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix4();\n * m.set( 11, 12, 13, 14,\n *        21, 22, 23, 24,\n *        31, 32, 33, 34,\n *        41, 42, 43, 44 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21, 31, 41,\n *                12, 22, 32, 42,\n *                13, 23, 33, 43,\n *                14, 24, 34, 44 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix4 {\n\n\t/**\n\t * Constructs a new 4x4 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n14] - 1-4 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n24] - 2-4 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @param {number} [n34] - 3-4 matrix element.\n\t * @param {number} [n41] - 4-1 matrix element.\n\t * @param {number} [n42] - 4-2 matrix element.\n\t * @param {number} [n43] - 4-3 matrix element.\n\t * @param {number} [n44] - 4-4 matrix element.\n\t */\n\tconstructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix4.prototype.isMatrix4 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array<number>}\n\t\t */\n\t\tthis.elements = [\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n13] - 1-3 matrix element.\n\t * @param {number} [n14] - 1-4 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t * @param {number} [n23] - 2-3 matrix element.\n\t * @param {number} [n24] - 2-4 matrix element.\n\t * @param {number} [n31] - 3-1 matrix element.\n\t * @param {number} [n32] - 3-2 matrix element.\n\t * @param {number} [n33] - 3-3 matrix element.\n\t * @param {number} [n34] - 3-4 matrix element.\n\t * @param {number} [n41] - 4-1 matrix element.\n\t * @param {number} [n42] - 4-2 matrix element.\n\t * @param {number} [n43] - 4-3 matrix element.\n\t * @param {number} [n44] - 4-4 matrix element.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tset( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;\n\t\tte[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;\n\t\tte[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;\n\t\tte[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 4x4 identity matrix.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, 1, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a matrix with copied values from this instance.\n\t *\n\t * @return {Matrix4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Matrix4().fromArray( this.elements );\n\n\t}\n\n\t/**\n\t * Copies the values of the given matrix to this instance.\n\t *\n\t * @param {Matrix4} m - The matrix to copy.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcopy( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tte[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];\n\t\tte[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];\n\t\tte[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];\n\t\tte[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the translation component of the given matrix\n\t * into this matrix's translation component.\n\t *\n\t * @param {Matrix4} m - The matrix to copy the translation component.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcopyPosition( m ) {\n\n\t\tconst te = this.elements, me = m.elements;\n\n\t\tte[ 12 ] = me[ 12 ];\n\t\tte[ 13 ] = me[ 13 ];\n\t\tte[ 14 ] = me[ 14 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The 3x3 matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tsetFromMatrix3( m ) {\n\n\t\tconst me = m.elements;\n\n\t\tthis.set(\n\n\t\t\tme[ 0 ], me[ 3 ], me[ 6 ], 0,\n\t\t\tme[ 1 ], me[ 4 ], me[ 7 ], 0,\n\t\t\tme[ 2 ], me[ 5 ], me[ 8 ], 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the basis of this matrix into the three axis vectors provided.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\textractBasis( xAxis, yAxis, zAxis ) {\n\n\t\txAxis.setFromMatrixColumn( this, 0 );\n\t\tyAxis.setFromMatrixColumn( this, 1 );\n\t\tzAxis.setFromMatrixColumn( this, 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given basis vectors to this matrix.\n\t *\n\t * @param {Vector3} xAxis - The basis's x axis.\n\t * @param {Vector3} yAxis - The basis's y axis.\n\t * @param {Vector3} zAxis - The basis's z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeBasis( xAxis, yAxis, zAxis ) {\n\n\t\tthis.set(\n\t\t\txAxis.x, yAxis.x, zAxis.x, 0,\n\t\t\txAxis.y, yAxis.y, zAxis.y, 0,\n\t\t\txAxis.z, yAxis.z, zAxis.z, 0,\n\t\t\t0, 0, 0, 1\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Extracts the rotation component of the given matrix\n\t * into this matrix's rotation component.\n\t *\n\t * Note: This method does not support reflection matrices.\n\t *\n\t * @param {Matrix4} m - The matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\textractRotation( m ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = m.elements;\n\n\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn( m, 0 ).length();\n\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn( m, 1 ).length();\n\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn( m, 2 ).length();\n\n\t\tte[ 0 ] = me[ 0 ] * scaleX;\n\t\tte[ 1 ] = me[ 1 ] * scaleX;\n\t\tte[ 2 ] = me[ 2 ] * scaleX;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = me[ 4 ] * scaleY;\n\t\tte[ 5 ] = me[ 5 ] * scaleY;\n\t\tte[ 6 ] = me[ 6 ] * scaleY;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = me[ 8 ] * scaleZ;\n\t\tte[ 9 ] = me[ 9 ] * scaleZ;\n\t\tte[ 10 ] = me[ 10 ] * scaleZ;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the rotation component (the upper left 3x3 matrix) of this matrix to\n\t * the rotation specified by the given Euler angles. The rest of\n\t * the matrix is set to the identity. Depending on the {@link Euler#order},\n\t * there are six possible outcomes. See [this page]{@link https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix}\n\t * for a complete list.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationFromEuler( euler ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = euler.x, y = euler.y, z = euler.z;\n\t\tconst a = Math.cos( x ), b = Math.sin( x );\n\t\tconst c = Math.cos( y ), d = Math.sin( y );\n\t\tconst e = Math.cos( z ), f = Math.sin( z );\n\n\t\tif ( euler.order === 'XYZ' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - c * f;\n\t\t\tte[ 8 ] = d;\n\n\t\t\tte[ 1 ] = af + be * d;\n\t\t\tte[ 5 ] = ae - bf * d;\n\t\t\tte[ 9 ] = - b * c;\n\n\t\t\tte[ 2 ] = bf - ae * d;\n\t\t\tte[ 6 ] = be + af * d;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YXZ' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce + df * b;\n\t\t\tte[ 4 ] = de * b - cf;\n\t\t\tte[ 8 ] = a * d;\n\n\t\t\tte[ 1 ] = a * f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b;\n\n\t\t\tte[ 2 ] = cf * b - de;\n\t\t\tte[ 6 ] = df + ce * b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZXY' ) {\n\n\t\t\tconst ce = c * e, cf = c * f, de = d * e, df = d * f;\n\n\t\t\tte[ 0 ] = ce - df * b;\n\t\t\tte[ 4 ] = - a * f;\n\t\t\tte[ 8 ] = de + cf * b;\n\n\t\t\tte[ 1 ] = cf + de * b;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = df - ce * b;\n\n\t\t\tte[ 2 ] = - a * d;\n\t\t\tte[ 6 ] = b;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'ZYX' ) {\n\n\t\t\tconst ae = a * e, af = a * f, be = b * e, bf = b * f;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = be * d - af;\n\t\t\tte[ 8 ] = ae * d + bf;\n\n\t\t\tte[ 1 ] = c * f;\n\t\t\tte[ 5 ] = bf * d + ae;\n\t\t\tte[ 9 ] = af * d - be;\n\n\t\t\tte[ 2 ] = - d;\n\t\t\tte[ 6 ] = b * c;\n\t\t\tte[ 10 ] = a * c;\n\n\t\t} else if ( euler.order === 'YZX' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = bd - ac * f;\n\t\t\tte[ 8 ] = bc * f + ad;\n\n\t\t\tte[ 1 ] = f;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = - b * e;\n\n\t\t\tte[ 2 ] = - d * e;\n\t\t\tte[ 6 ] = ad * f + bc;\n\t\t\tte[ 10 ] = ac - bd * f;\n\n\t\t} else if ( euler.order === 'XZY' ) {\n\n\t\t\tconst ac = a * c, ad = a * d, bc = b * c, bd = b * d;\n\n\t\t\tte[ 0 ] = c * e;\n\t\t\tte[ 4 ] = - f;\n\t\t\tte[ 8 ] = d * e;\n\n\t\t\tte[ 1 ] = ac * f + bd;\n\t\t\tte[ 5 ] = a * e;\n\t\t\tte[ 9 ] = ad * f - bc;\n\n\t\t\tte[ 2 ] = bc * f - ad;\n\t\t\tte[ 6 ] = b * e;\n\t\t\tte[ 10 ] = bd * f + ac;\n\n\t\t}\n\n\t\t// bottom row\n\t\tte[ 3 ] = 0;\n\t\tte[ 7 ] = 0;\n\t\tte[ 11 ] = 0;\n\n\t\t// last column\n\t\tte[ 12 ] = 0;\n\t\tte[ 13 ] = 0;\n\t\tte[ 14 ] = 0;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the rotation component of this matrix to the rotation specified by\n\t * the given Quaternion as outlined [here]{@link https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion}\n\t * The rest of the matrix is set to the identity.\n\t *\n\t * @param {Quaternion} q - The Quaternion.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationFromQuaternion( q ) {\n\n\t\treturn this.compose( _zero, q, _one );\n\n\t}\n\n\t/**\n\t * Sets the rotation component of the transformation matrix, looking from `eye` towards\n\t * `target`, and oriented by the up-direction.\n\t *\n\t * @param {Vector3} eye - The eye vector.\n\t * @param {Vector3} target - The target vector.\n\t * @param {Vector3} up - The up vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tlookAt( eye, target, up ) {\n\n\t\tconst te = this.elements;\n\n\t\t_z.subVectors( eye, target );\n\n\t\tif ( _z.lengthSq() === 0 ) {\n\n\t\t\t// eye and target are in the same position\n\n\t\t\t_z.z = 1;\n\n\t\t}\n\n\t\t_z.normalize();\n\t\t_x.crossVectors( up, _z );\n\n\t\tif ( _x.lengthSq() === 0 ) {\n\n\t\t\t// up and z are parallel\n\n\t\t\tif ( Math.abs( up.z ) === 1 ) {\n\n\t\t\t\t_z.x += 0.0001;\n\n\t\t\t} else {\n\n\t\t\t\t_z.z += 0.0001;\n\n\t\t\t}\n\n\t\t\t_z.normalize();\n\t\t\t_x.crossVectors( up, _z );\n\n\t\t}\n\n\t\t_x.normalize();\n\t\t_y.crossVectors( _z, _x );\n\n\t\tte[ 0 ] = _x.x; te[ 4 ] = _y.x; te[ 8 ] = _z.x;\n\t\tte[ 1 ] = _x.y; te[ 5 ] = _y.y; te[ 9 ] = _z.y;\n\t\tte[ 2 ] = _x.z; te[ 6 ] = _y.z; te[ 10 ] = _z.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Post-multiplies this matrix by the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The matrix to multiply with.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiply( m ) {\n\n\t\treturn this.multiplyMatrices( this, m );\n\n\t}\n\n\t/**\n\t * Pre-multiplies this matrix by the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The matrix to multiply with.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tpremultiply( m ) {\n\n\t\treturn this.multiplyMatrices( m, this );\n\n\t}\n\n\t/**\n\t * Multiples the given 4x4 matrices and stores the result\n\t * in this matrix.\n\t *\n\t * @param {Matrix4} a - The first matrix.\n\t * @param {Matrix4} b - The second matrix.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiplyMatrices( a, b ) {\n\n\t\tconst ae = a.elements;\n\t\tconst be = b.elements;\n\t\tconst te = this.elements;\n\n\t\tconst a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];\n\t\tconst a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];\n\t\tconst a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];\n\t\tconst a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];\n\n\t\tconst b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];\n\t\tconst b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];\n\t\tconst b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];\n\t\tconst b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];\n\n\t\tte[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\tte[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\tte[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\tte[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\n\t\tte[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\tte[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\tte[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\tte[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\n\t\tte[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\tte[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\tte[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\tte[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\n\t\tte[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\tte[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\tte[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\tte[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies every component of the matrix by the given scalar.\n\t *\n\t * @param {number} s - The scalar.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;\n\t\tte[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;\n\t\tte[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;\n\t\tte[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes and returns the determinant of this matrix.\n\t *\n\t * Based on the method outlined [here]{@link http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html}.\n\t *\n\t * @return {number} The determinant.\n\t */\n\tdeterminant() {\n\n\t\tconst te = this.elements;\n\n\t\tconst n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];\n\t\tconst n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];\n\t\tconst n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];\n\t\tconst n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];\n\n\t\t//TODO: make this more efficient\n\n\t\treturn (\n\t\t\tn41 * (\n\t\t\t\t+ n14 * n23 * n32\n\t\t\t\t - n13 * n24 * n32\n\t\t\t\t - n14 * n22 * n33\n\t\t\t\t + n12 * n24 * n33\n\t\t\t\t + n13 * n22 * n34\n\t\t\t\t - n12 * n23 * n34\n\t\t\t) +\n\t\t\tn42 * (\n\t\t\t\t+ n11 * n23 * n34\n\t\t\t\t - n11 * n24 * n33\n\t\t\t\t + n14 * n21 * n33\n\t\t\t\t - n13 * n21 * n34\n\t\t\t\t + n13 * n24 * n31\n\t\t\t\t - n14 * n23 * n31\n\t\t\t) +\n\t\t\tn43 * (\n\t\t\t\t+ n11 * n24 * n32\n\t\t\t\t - n11 * n22 * n34\n\t\t\t\t - n14 * n21 * n32\n\t\t\t\t + n12 * n21 * n34\n\t\t\t\t + n14 * n22 * n31\n\t\t\t\t - n12 * n24 * n31\n\t\t\t) +\n\t\t\tn44 * (\n\t\t\t\t- n13 * n22 * n31\n\t\t\t\t - n11 * n23 * n32\n\t\t\t\t + n11 * n22 * n33\n\t\t\t\t + n13 * n21 * n32\n\t\t\t\t - n12 * n21 * n33\n\t\t\t\t + n12 * n23 * n31\n\t\t\t)\n\n\t\t);\n\n\t}\n\n\t/**\n\t * Transposes this matrix in place.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\ttranspose() {\n\n\t\tconst te = this.elements;\n\t\tlet tmp;\n\n\t\ttmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;\n\t\ttmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;\n\t\ttmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;\n\n\t\ttmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;\n\t\ttmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;\n\t\ttmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the position component for this matrix from the given vector,\n\t * without affecting the rest of the matrix.\n\t *\n\t * @param {number|Vector3} x - The x component of the vector or alternatively the vector object.\n\t * @param {number} y - The y component of the vector.\n\t * @param {number} z - The z component of the vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tsetPosition( x, y, z ) {\n\n\t\tconst te = this.elements;\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tte[ 12 ] = x.x;\n\t\t\tte[ 13 ] = x.y;\n\t\t\tte[ 14 ] = x.z;\n\n\t\t} else {\n\n\t\t\tte[ 12 ] = x;\n\t\t\tte[ 13 ] = y;\n\t\t\tte[ 14 ] = z;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.\n\t * You can not invert with a determinant of zero. If you attempt this, the method produces\n\t * a zero matrix instead.\n\t *\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tinvert() {\n\n\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\tconst te = this.elements,\n\n\t\t\tn11 = te[ 0 ], n21 = te[ 1 ], n31 = te[ 2 ], n41 = te[ 3 ],\n\t\t\tn12 = te[ 4 ], n22 = te[ 5 ], n32 = te[ 6 ], n42 = te[ 7 ],\n\t\t\tn13 = te[ 8 ], n23 = te[ 9 ], n33 = te[ 10 ], n43 = te[ 11 ],\n\t\t\tn14 = te[ 12 ], n24 = te[ 13 ], n34 = te[ 14 ], n44 = te[ 15 ],\n\n\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\n\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\n\t\tif ( det === 0 ) return this.set( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );\n\n\t\tconst detInv = 1 / det;\n\n\t\tte[ 0 ] = t11 * detInv;\n\t\tte[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;\n\t\tte[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;\n\t\tte[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;\n\n\t\tte[ 4 ] = t12 * detInv;\n\t\tte[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;\n\t\tte[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;\n\t\tte[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;\n\n\t\tte[ 8 ] = t13 * detInv;\n\t\tte[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;\n\t\tte[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;\n\t\tte[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;\n\n\t\tte[ 12 ] = t14 * detInv;\n\t\tte[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;\n\t\tte[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;\n\t\tte[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the columns of this matrix by the given vector.\n\t *\n\t * @param {Vector3} v - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tscale( v ) {\n\n\t\tconst te = this.elements;\n\t\tconst x = v.x, y = v.y, z = v.z;\n\n\t\tte[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;\n\t\tte[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;\n\t\tte[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;\n\t\tte[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Gets the maximum scale value of the three axes.\n\t *\n\t * @return {number} The maximum scale.\n\t */\n\tgetMaxScaleOnAxis() {\n\n\t\tconst te = this.elements;\n\n\t\tconst scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];\n\t\tconst scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];\n\t\tconst scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];\n\n\t\treturn Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );\n\n\t}\n\n\t/**\n\t * Sets this matrix as a translation transform from the given vector.\n\t *\n\t * @param {number|Vector3} x - The amount to translate in the X axis or alternatively a translation vector.\n\t * @param {number} y - The amount to translate in the Y axis.\n\t * @param {number} z - The amount to translate in the z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeTranslation( x, y, z ) {\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x.x,\n\t\t\t\t0, 1, 0, x.y,\n\t\t\t\t0, 0, 1, x.z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tthis.set(\n\n\t\t\t\t1, 0, 0, x,\n\t\t\t\t0, 1, 0, y,\n\t\t\t\t0, 0, 1, z,\n\t\t\t\t0, 0, 0, 1\n\n\t\t\t);\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the X axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationX( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t1, 0, 0, 0,\n\t\t\t0, c, - s, 0,\n\t\t\t0, s, c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the Y axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationY( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\t c, 0, s, 0,\n\t\t\t 0, 1, 0, 0,\n\t\t\t- s, 0, c, 0,\n\t\t\t 0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the Z axis by\n\t * the given angle.\n\t *\n\t * @param {number} theta - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationZ( theta ) {\n\n\t\tconst c = Math.cos( theta ), s = Math.sin( theta );\n\n\t\tthis.set(\n\n\t\t\tc, - s, 0, 0,\n\t\t\ts, c, 0, 0,\n\t\t\t0, 0, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a rotational transformation around the given axis by\n\t * the given angle.\n\t *\n\t * This is a somewhat controversial but mathematically sound alternative to\n\t * rotating via Quaternions. See the discussion [here]{@link https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199}.\n\t *\n\t * @param {Vector3} axis - The normalized rotation axis.\n\t * @param {number} angle - The rotation in radians.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeRotationAxis( axis, angle ) {\n\n\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n\t\tconst c = Math.cos( angle );\n\t\tconst s = Math.sin( angle );\n\t\tconst t = 1 - c;\n\t\tconst x = axis.x, y = axis.y, z = axis.z;\n\t\tconst tx = t * x, ty = t * y;\n\n\t\tthis.set(\n\n\t\t\ttx * x + c, tx * y - s * z, tx * z + s * y, 0,\n\t\t\ttx * y + s * z, ty * y + c, ty * z - s * x, 0,\n\t\t\ttx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a scale transformation.\n\t *\n\t * @param {number} x - The amount to scale in the X axis.\n\t * @param {number} y - The amount to scale in the Y axis.\n\t * @param {number} z - The amount to scale in the Z axis.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeScale( x, y, z ) {\n\n\t\tthis.set(\n\n\t\t\tx, 0, 0, 0,\n\t\t\t0, y, 0, 0,\n\t\t\t0, 0, z, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix as a shear transformation.\n\t *\n\t * @param {number} xy - The amount to shear X by Y.\n\t * @param {number} xz - The amount to shear X by Z.\n\t * @param {number} yx - The amount to shear Y by X.\n\t * @param {number} yz - The amount to shear Y by Z.\n\t * @param {number} zx - The amount to shear Z by X.\n\t * @param {number} zy - The amount to shear Z by Y.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeShear( xy, xz, yx, yz, zx, zy ) {\n\n\t\tthis.set(\n\n\t\t\t1, yx, zx, 0,\n\t\t\txy, 1, zy, 0,\n\t\t\txz, yz, 1, 0,\n\t\t\t0, 0, 0, 1\n\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this matrix to the transformation composed of the given position,\n\t * rotation (Quaternion) and scale.\n\t *\n\t * @param {Vector3} position - The position vector.\n\t * @param {Quaternion} quaternion - The rotation as a Quaternion.\n\t * @param {Vector3} scale - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tcompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = quaternion._x, y = quaternion._y, z = quaternion._z, w = quaternion._w;\n\t\tconst x2 = x + x,\ty2 = y + y, z2 = z + z;\n\t\tconst xx = x * x2, xy = x * y2, xz = x * z2;\n\t\tconst yy = y * y2, yz = y * z2, zz = z * z2;\n\t\tconst wx = w * x2, wy = w * y2, wz = w * z2;\n\n\t\tconst sx = scale.x, sy = scale.y, sz = scale.z;\n\n\t\tte[ 0 ] = ( 1 - ( yy + zz ) ) * sx;\n\t\tte[ 1 ] = ( xy + wz ) * sx;\n\t\tte[ 2 ] = ( xz - wy ) * sx;\n\t\tte[ 3 ] = 0;\n\n\t\tte[ 4 ] = ( xy - wz ) * sy;\n\t\tte[ 5 ] = ( 1 - ( xx + zz ) ) * sy;\n\t\tte[ 6 ] = ( yz + wx ) * sy;\n\t\tte[ 7 ] = 0;\n\n\t\tte[ 8 ] = ( xz + wy ) * sz;\n\t\tte[ 9 ] = ( yz - wx ) * sz;\n\t\tte[ 10 ] = ( 1 - ( xx + yy ) ) * sz;\n\t\tte[ 11 ] = 0;\n\n\t\tte[ 12 ] = position.x;\n\t\tte[ 13 ] = position.y;\n\t\tte[ 14 ] = position.z;\n\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Decomposes this matrix into its position, rotation and scale components\n\t * and provides the result in the given objects.\n\t *\n\t * Note: Not all matrices are decomposable in this way. For example, if an\n\t * object has a non-uniformly scaled parent, then the object's world matrix\n\t * may not be decomposable, and this method may not be appropriate.\n\t *\n\t * @param {Vector3} position - The position vector.\n\t * @param {Quaternion} quaternion - The rotation as a Quaternion.\n\t * @param {Vector3} scale - The scale vector.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tdecompose( position, quaternion, scale ) {\n\n\t\tconst te = this.elements;\n\n\t\tlet sx = _v1$5.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();\n\t\tconst sy = _v1$5.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();\n\t\tconst sz = _v1$5.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();\n\n\t\t// if determine is negative, we need to invert one scale\n\t\tconst det = this.determinant();\n\t\tif ( det < 0 ) sx = - sx;\n\n\t\tposition.x = te[ 12 ];\n\t\tposition.y = te[ 13 ];\n\t\tposition.z = te[ 14 ];\n\n\t\t// scale the rotation part\n\t\t_m1$2.copy( this );\n\n\t\tconst invSX = 1 / sx;\n\t\tconst invSY = 1 / sy;\n\t\tconst invSZ = 1 / sz;\n\n\t\t_m1$2.elements[ 0 ] *= invSX;\n\t\t_m1$2.elements[ 1 ] *= invSX;\n\t\t_m1$2.elements[ 2 ] *= invSX;\n\n\t\t_m1$2.elements[ 4 ] *= invSY;\n\t\t_m1$2.elements[ 5 ] *= invSY;\n\t\t_m1$2.elements[ 6 ] *= invSY;\n\n\t\t_m1$2.elements[ 8 ] *= invSZ;\n\t\t_m1$2.elements[ 9 ] *= invSZ;\n\t\t_m1$2.elements[ 10 ] *= invSZ;\n\n\t\tquaternion.setFromRotationMatrix( _m1$2 );\n\n\t\tscale.x = sx;\n\t\tscale.y = sy;\n\t\tscale.z = sz;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a perspective projection matrix. This is used internally by\n\t * {@link PerspectiveCamera#updateProjectionMatrix}.\n\n\t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n\t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n\t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n\t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n\t * @param {number} near - The distance from the camera to the near plane.\n\t * @param {number} far - The distance from the camera to the far plane.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = 2 * near / ( right - left );\n\t\tconst y = 2 * near / ( top - bottom );\n\n\t\tconst a = ( right + left ) / ( right - left );\n\t\tconst b = ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tc = near / ( far - near );\n\t\t\td = ( far * near ) / ( far - near );\n\n\t\t} else {\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tc = - ( far + near ) / ( far - near );\n\t\t\t\td = ( -2 * far * near ) / ( far - near );\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tc = - far / ( far - near );\n\t\t\t\td = ( - far * near ) / ( far - near );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\tte[ 0 ] = x;\tte[ 4 ] = 0;\tte[ 8 ] = a; \tte[ 12 ] = 0;\n\t\tte[ 1 ] = 0;\tte[ 5 ] = y;\tte[ 9 ] = b; \tte[ 13 ] = 0;\n\t\tte[ 2 ] = 0;\tte[ 6 ] = 0;\tte[ 10 ] = c; \tte[ 14 ] = d;\n\t\tte[ 3 ] = 0;\tte[ 7 ] = 0;\tte[ 11 ] = -1;\tte[ 15 ] = 0;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a orthographic projection matrix. This is used internally by\n\t * {@link OrthographicCamera#updateProjectionMatrix}.\n\n\t * @param {number} left - Left boundary of the viewing frustum at the near plane.\n\t * @param {number} right - Right boundary of the viewing frustum at the near plane.\n\t * @param {number} top - Top boundary of the viewing frustum at the near plane.\n\t * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane.\n\t * @param {number} near - The distance from the camera to the near plane.\n\t * @param {number} far - The distance from the camera to the far plane.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tmakeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst te = this.elements;\n\n\t\tconst x = 2 / ( right - left );\n\t\tconst y = 2 / ( top - bottom );\n\n\t\tconst a = - ( right + left ) / ( right - left );\n\t\tconst b = - ( top + bottom ) / ( top - bottom );\n\n\t\tlet c, d;\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tc = 1 / ( far - near );\n\t\t\td = far / ( far - near );\n\n\t\t} else {\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tc = -2 / ( far - near );\n\t\t\t\td = - ( far + near ) / ( far - near );\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tc = -1 / ( far - near );\n\t\t\t\td = - near / ( far - near );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\tte[ 0 ] = x;\t\tte[ 4 ] = 0;\t\tte[ 8 ] = 0; \t\tte[ 12 ] = a;\n\t\tte[ 1 ] = 0; \t\tte[ 5 ] = y;\t\tte[ 9 ] = 0; \t\tte[ 13 ] = b;\n\t\tte[ 2 ] = 0; \t\tte[ 6 ] = 0;\t\tte[ 10 ] = c;\t\tte[ 14 ] = d;\n\t\tte[ 3 ] = 0; \t\tte[ 7 ] = 0;\t\tte[ 11 ] = 0;\t\tte[ 15 ] = 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this matrix is equal with the given one.\n\t *\n\t * @param {Matrix4} matrix - The matrix to test for equality.\n\t * @return {boolean} Whether this matrix is equal with the given one.\n\t */\n\tequals( matrix ) {\n\n\t\tconst te = this.elements;\n\t\tconst me = matrix.elements;\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tif ( te[ i ] !== me[ i ] ) return false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array<number>} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix4} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 16; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the elements of this matrix to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The matrix elements in column-major order.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst te = this.elements;\n\n\t\tarray[ offset ] = te[ 0 ];\n\t\tarray[ offset + 1 ] = te[ 1 ];\n\t\tarray[ offset + 2 ] = te[ 2 ];\n\t\tarray[ offset + 3 ] = te[ 3 ];\n\n\t\tarray[ offset + 4 ] = te[ 4 ];\n\t\tarray[ offset + 5 ] = te[ 5 ];\n\t\tarray[ offset + 6 ] = te[ 6 ];\n\t\tarray[ offset + 7 ] = te[ 7 ];\n\n\t\tarray[ offset + 8 ] = te[ 8 ];\n\t\tarray[ offset + 9 ] = te[ 9 ];\n\t\tarray[ offset + 10 ] = te[ 10 ];\n\t\tarray[ offset + 11 ] = te[ 11 ];\n\n\t\tarray[ offset + 12 ] = te[ 12 ];\n\t\tarray[ offset + 13 ] = te[ 13 ];\n\t\tarray[ offset + 14 ] = te[ 14 ];\n\t\tarray[ offset + 15 ] = te[ 15 ];\n\n\t\treturn array;\n\n\t}\n\n}\n\nconst _v1$5 = /*@__PURE__*/ new Vector3();\nconst _m1$2 = /*@__PURE__*/ new Matrix4();\nconst _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );\nconst _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );\nconst _x = /*@__PURE__*/ new Vector3();\nconst _y = /*@__PURE__*/ new Vector3();\nconst _z = /*@__PURE__*/ new Vector3();\n\nconst _matrix$2 = /*@__PURE__*/ new Matrix4();\nconst _quaternion$3 = /*@__PURE__*/ new Quaternion();\n\n/**\n * A class representing Euler angles.\n *\n * Euler angles describe a rotational transformation by rotating an object on\n * its various axes in specified amounts per axis, and a specified axis\n * order.\n *\n * Iterating through an instance will yield its components (x, y, z,\n * order) in the corresponding order.\n *\n * ```js\n * const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );\n * const b = new THREE.Vector3( 1, 0, 1 );\n * b.applyEuler(a);\n * ```\n */\nclass Euler {\n\n\t/**\n\t * Constructs a new euler instance.\n\t *\n\t * @param {number} [x=0] - The angle of the x axis in radians.\n\t * @param {number} [y=0] - The angle of the y axis in radians.\n\t * @param {number} [z=0] - The angle of the z axis in radians.\n\t * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, order = Euler.DEFAULT_ORDER ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isEuler = true;\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t}\n\n\t/**\n\t * The angle of the x axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget x() {\n\n\t\treturn this._x;\n\n\t}\n\n\tset x( value ) {\n\n\t\tthis._x = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The angle of the y axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget y() {\n\n\t\treturn this._y;\n\n\t}\n\n\tset y( value ) {\n\n\t\tthis._y = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * The angle of the z axis in radians.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget z() {\n\n\t\treturn this._z;\n\n\t}\n\n\tset z( value ) {\n\n\t\tthis._z = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * A string representing the order that the rotations are applied.\n\t *\n\t * @type {string}\n\t * @default 'XYZ'\n\t */\n\tget order() {\n\n\t\treturn this._order;\n\n\t}\n\n\tset order( value ) {\n\n\t\tthis._order = value;\n\t\tthis._onChangeCallback();\n\n\t}\n\n\t/**\n\t * Sets the Euler components.\n\t *\n\t * @param {number} x - The angle of the x axis in radians.\n\t * @param {number} y - The angle of the y axis in radians.\n\t * @param {number} z - The angle of the z axis in radians.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tset( x, y, z, order = this._order ) {\n\n\t\tthis._x = x;\n\t\tthis._y = y;\n\t\tthis._z = z;\n\t\tthis._order = order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new Euler instance with copied values from this instance.\n\t *\n\t * @return {Euler} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this._x, this._y, this._z, this._order );\n\n\t}\n\n\t/**\n\t * Copies the values of the given Euler instance to this instance.\n\t *\n\t * @param {Euler} euler - The Euler instance to copy.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tcopy( euler ) {\n\n\t\tthis._x = euler._x;\n\t\tthis._y = euler._y;\n\t\tthis._z = euler._z;\n\t\tthis._order = euler._order;\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from a pure rotation matrix.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromRotationMatrix( m, order = this._order, update = true ) {\n\n\t\tconst te = m.elements;\n\t\tconst m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ];\n\t\tconst m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ];\n\t\tconst m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tswitch ( order ) {\n\n\t\t\tcase 'XYZ':\n\n\t\t\t\tthis._y = Math.asin( clamp( m13, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m13 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXZ':\n\n\t\t\t\tthis._x = Math.asin( - clamp( m23, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m23 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\t\t\t\t\tthis._z = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXY':\n\n\t\t\t\tthis._x = Math.asin( clamp( m32, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m32 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._y = Math.atan2( - m31, m33 );\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._y = 0;\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYX':\n\n\t\t\t\tthis._y = Math.asin( - clamp( m31, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m31 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m33 );\n\t\t\t\t\tthis._z = Math.atan2( m21, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._z = Math.atan2( - m12, m22 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZX':\n\n\t\t\t\tthis._z = Math.asin( clamp( m21, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m21 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m22 );\n\t\t\t\t\tthis._y = Math.atan2( - m31, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = Math.atan2( m13, m33 );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZY':\n\n\t\t\t\tthis._z = Math.asin( - clamp( m12, -1, 1 ) );\n\n\t\t\t\tif ( Math.abs( m12 ) < 0.9999999 ) {\n\n\t\t\t\t\tthis._x = Math.atan2( m32, m22 );\n\t\t\t\t\tthis._y = Math.atan2( m13, m11 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._x = Math.atan2( - m23, m33 );\n\t\t\t\t\tthis._y = 0;\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tconsole.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );\n\n\t\t}\n\n\t\tthis._order = order;\n\n\t\tif ( update === true ) this._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from a normalized quaternion.\n\t *\n\t * @param {Quaternion} q - A normalized Quaternion.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromQuaternion( q, order, update ) {\n\n\t\t_matrix$2.makeRotationFromQuaternion( q );\n\n\t\treturn this.setFromRotationMatrix( _matrix$2, order, update );\n\n\t}\n\n\t/**\n\t * Sets the angles of this Euler instance from the given vector.\n\t *\n\t * @param {Vector3} v - The vector.\n\t * @param {string} [order] - A string representing the order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tsetFromVector3( v, order = this._order ) {\n\n\t\treturn this.set( v.x, v.y, v.z, order );\n\n\t}\n\n\t/**\n\t * Resets the euler angle with a new order by creating a quaternion from this\n\t * euler angle and then setting this euler angle with the quaternion and the\n\t * new order.\n\t *\n\t * Warning: This discards revolution information.\n\t *\n\t * @param {string} [newOrder] - A string representing the new order that the rotations are applied.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\treorder( newOrder ) {\n\n\t\t_quaternion$3.setFromEuler( this );\n\n\t\treturn this.setFromQuaternion( _quaternion$3, newOrder );\n\n\t}\n\n\t/**\n\t * Returns `true` if this Euler instance is equal with the given one.\n\t *\n\t * @param {Euler} euler - The Euler instance to test for equality.\n\t * @return {boolean} Whether this Euler instance is equal with the given one.\n\t */\n\tequals( euler ) {\n\n\t\treturn ( euler._x === this._x ) && ( euler._y === this._y ) && ( euler._z === this._z ) && ( euler._order === this._order );\n\n\t}\n\n\t/**\n\t * Sets this Euler instance's components to values from the given array. The first three\n\t * entries of the array are assign to the x,y and z components. An optional fourth entry\n\t * defines the Euler order.\n\t *\n\t * @param {Array<number,number,number,?string>} array - An array holding the Euler component values.\n\t * @return {Euler} A reference to this Euler instance.\n\t */\n\tfromArray( array ) {\n\n\t\tthis._x = array[ 0 ];\n\t\tthis._y = array[ 1 ];\n\t\tthis._z = array[ 2 ];\n\t\tif ( array[ 3 ] !== undefined ) this._order = array[ 3 ];\n\n\t\tthis._onChangeCallback();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this Euler instance to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number,number,number,string>} [array=[]] - The target array holding the Euler components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number,number,number,string>} The Euler components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this._x;\n\t\tarray[ offset + 1 ] = this._y;\n\t\tarray[ offset + 2 ] = this._z;\n\t\tarray[ offset + 3 ] = this._order;\n\n\t\treturn array;\n\n\t}\n\n\t_onChange( callback ) {\n\n\t\tthis._onChangeCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t_onChangeCallback() {}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this._x;\n\t\tyield this._y;\n\t\tyield this._z;\n\t\tyield this._order;\n\n\t}\n\n}\n\n/**\n * The default Euler angle order.\n *\n * @static\n * @type {string}\n * @default 'XYZ'\n */\nEuler.DEFAULT_ORDER = 'XYZ';\n\n/**\n * A layers object assigns an 3D object to 1 or more of 32\n * layers numbered `0` to `31` - internally the layers are stored as a\n * bit mask], and by default all 3D objects are a member of layer `0`.\n *\n * This can be used to control visibility - an object must share a layer with\n * a camera to be visible when that camera's view is\n * rendered.\n *\n * All classes that inherit from {@link Object3D} have an `layers` property which\n * is an instance of this class.\n */\nclass Layers {\n\n\t/**\n\t * Constructs a new layers instance, with membership\n\t * initially set to layer `0`.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A bit mask storing which of the 32 layers this layers object is currently\n\t\t * a member of.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.mask = 1 | 0;\n\n\t}\n\n\t/**\n\t * Sets membership to the given layer, and remove membership all other layers.\n\t *\n\t * @param {number} layer - The layer to set.\n\t */\n\tset( layer ) {\n\n\t\tthis.mask = ( 1 << layer | 0 ) >>> 0;\n\n\t}\n\n\t/**\n\t * Adds membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to enable.\n\t */\n\tenable( layer ) {\n\n\t\tthis.mask |= 1 << layer | 0;\n\n\t}\n\n\t/**\n\t * Adds membership to all layers.\n\t */\n\tenableAll() {\n\n\t\tthis.mask = 0xffffffff | 0;\n\n\t}\n\n\t/**\n\t * Toggles the membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to toggle.\n\t */\n\ttoggle( layer ) {\n\n\t\tthis.mask ^= 1 << layer | 0;\n\n\t}\n\n\t/**\n\t * Removes membership of the given layer.\n\t *\n\t * @param {number} layer - The layer to enable.\n\t */\n\tdisable( layer ) {\n\n\t\tthis.mask &= ~ ( 1 << layer | 0 );\n\n\t}\n\n\t/**\n\t * Removes the membership from all layers.\n\t */\n\tdisableAll() {\n\n\t\tthis.mask = 0;\n\n\t}\n\n\t/**\n\t * Returns `true` if this and the given layers object have at least one\n\t * layer in common.\n\t *\n\t * @param {Layers} layers - The layers to test.\n\t * @return {boolean } Whether this and the given layers object have at least one layer in common or not.\n\t */\n\ttest( layers ) {\n\n\t\treturn ( this.mask & layers.mask ) !== 0;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given layer is enabled.\n\t *\n\t * @param {number} layer - The layer to test.\n\t * @return {boolean } Whether the given layer is enabled or not.\n\t */\n\tisEnabled( layer ) {\n\n\t\treturn ( this.mask & ( 1 << layer | 0 ) ) !== 0;\n\n\t}\n\n}\n\nlet _object3DId = 0;\n\nconst _v1$4 = /*@__PURE__*/ new Vector3();\nconst _q1 = /*@__PURE__*/ new Quaternion();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\nconst _target = /*@__PURE__*/ new Vector3();\n\nconst _position$3 = /*@__PURE__*/ new Vector3();\nconst _scale$2 = /*@__PURE__*/ new Vector3();\nconst _quaternion$2 = /*@__PURE__*/ new Quaternion();\n\nconst _xAxis = /*@__PURE__*/ new Vector3( 1, 0, 0 );\nconst _yAxis = /*@__PURE__*/ new Vector3( 0, 1, 0 );\nconst _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );\n\n/**\n * Fires when the object has been added to its parent object.\n *\n * @event Object3D#added\n * @type {Object}\n */\nconst _addedEvent = { type: 'added' };\n\n/**\n * Fires when the object has been removed from its parent object.\n *\n * @event Object3D#removed\n * @type {Object}\n */\nconst _removedEvent = { type: 'removed' };\n\n/**\n * Fires when a new child object has been added.\n *\n * @event Object3D#childadded\n * @type {Object}\n */\nconst _childaddedEvent = { type: 'childadded', child: null };\n\n/**\n * Fires when a child object has been removed.\n *\n * @event Object3D#childremoved\n * @type {Object}\n */\nconst _childremovedEvent = { type: 'childremoved', child: null };\n\n/**\n * This is the base class for most objects in three.js and provides a set of\n * properties and methods for manipulating objects in 3D space.\n *\n * @augments EventDispatcher\n */\nclass Object3D extends EventDispatcher {\n\n\t/**\n\t * Constructs a new 3D object.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isObject3D = true;\n\n\t\t/**\n\t\t * The ID of the 3D object.\n\t\t *\n\t\t * @name Object3D#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _object3DId ++ } );\n\n\t\t/**\n\t\t * The UUID of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Object3D';\n\n\t\t/**\n\t\t * A reference to the parent object.\n\t\t *\n\t\t * @type {?Object3D}\n\t\t * @default null\n\t\t */\n\t\tthis.parent = null;\n\n\t\t/**\n\t\t * An array holding the child 3D objects of this instance.\n\t\t *\n\t\t * @type {Array<Object3D>}\n\t\t */\n\t\tthis.children = [];\n\n\t\t/**\n\t\t * Defines the `up` direction of the 3D object which influences\n\t\t * the orientation via methods like {@link Object3D#lookAt}.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_UP`.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.up = Object3D.DEFAULT_UP.clone();\n\n\t\tconst position = new Vector3();\n\t\tconst rotation = new Euler();\n\t\tconst quaternion = new Quaternion();\n\t\tconst scale = new Vector3( 1, 1, 1 );\n\n\t\tfunction onRotationChange() {\n\n\t\t\tquaternion.setFromEuler( rotation, false );\n\n\t\t}\n\n\t\tfunction onQuaternionChange() {\n\n\t\t\trotation.setFromQuaternion( quaternion, undefined, false );\n\n\t\t}\n\n\t\trotation._onChange( onRotationChange );\n\t\tquaternion._onChange( onQuaternionChange );\n\n\t\tObject.defineProperties( this, {\n\t\t\t/**\n\t\t\t * Represents the object's local position.\n\t\t\t *\n\t\t\t * @name Object3D#position\n\t\t\t * @type {Vector3}\n\t\t\t * @default (0,0,0)\n\t\t\t */\n\t\t\tposition: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: position\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local rotation as Euler angles, in radians.\n\t\t\t *\n\t\t\t * @name Object3D#rotation\n\t\t\t * @type {Euler}\n\t\t\t * @default (0,0,0)\n\t\t\t */\n\t\t\trotation: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: rotation\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local rotation as Quaternions.\n\t\t\t *\n\t\t\t * @name Object3D#quaternion\n\t\t\t * @type {Quaternion}\n\t\t\t */\n\t\t\tquaternion: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: quaternion\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's local scale.\n\t\t\t *\n\t\t\t * @name Object3D#scale\n\t\t\t * @type {Vector3}\n\t\t\t * @default (1,1,1)\n\t\t\t */\n\t\t\tscale: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: scale\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's model-view matrix.\n\t\t\t *\n\t\t\t * @name Object3D#modelViewMatrix\n\t\t\t * @type {Matrix4}\n\t\t\t */\n\t\t\tmodelViewMatrix: {\n\t\t\t\tvalue: new Matrix4()\n\t\t\t},\n\t\t\t/**\n\t\t\t * Represents the object's normal matrix.\n\t\t\t *\n\t\t\t * @name Object3D#normalMatrix\n\t\t\t * @type {Matrix3}\n\t\t\t */\n\t\t\tnormalMatrix: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Represents the object's transformation matrix in local space.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrix = new Matrix4();\n\n\t\t/**\n\t\t * Represents the object's transformation matrix in world space.\n\t\t * If the 3D object has no parent, then it's identical to the local transformation matrix\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrixWorld = new Matrix4();\n\n\t\t/**\n\t\t * When set to `true`, the engine automatically computes the local matrix from position,\n\t\t * rotation and scale every frame.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_AUTO_UPDATE`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixAutoUpdate = Object3D.DEFAULT_MATRIX_AUTO_UPDATE;\n\n\t\t/**\n\t\t * When set to `true`, the engine automatically computes the world matrix from the current local\n\t\t * matrix and the object's transformation hierarchy.\n\t\t *\n\t\t * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.matrixWorldAutoUpdate = Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE; // checked by the renderer\n\n\t\t/**\n\t\t * When set to `true`, it calculates the world matrix in that frame and resets this property\n\t\t * to `false`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t/**\n\t\t * The layer membership of the 3D object. The 3D object is only visible if it has\n\t\t * at least one layer in common with the camera in use. This property can also be\n\t\t * used to filter out unwanted objects in ray-intersection tests when using {@link Raycaster}.\n\t\t *\n\t\t * @type {Layers}\n\t\t */\n\t\tthis.layers = new Layers();\n\n\t\t/**\n\t\t * When set to `true`, the 3D object gets rendered.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.visible = true;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object gets rendered into shadow maps.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.castShadow = false;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object is affected by shadows in the scene.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.receiveShadow = false;\n\n\t\t/**\n\t\t * When set to `true`, the 3D object is honored by view frustum culling.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.frustumCulled = true;\n\n\t\t/**\n\t\t * This value allows the default rendering order of scene graph objects to be\n\t\t * overridden although opaque and transparent objects remain sorted independently.\n\t\t * When this property is set for an instance of {@link Group},all descendants\n\t\t * objects will be sorted and rendered together. Sorting is from lowest to highest\n\t\t * render order.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.renderOrder = 0;\n\n\t\t/**\n\t\t * An array holding the animation clips of the 3D object.\n\t\t *\n\t\t * @type {Array<AnimationClip>}\n\t\t */\n\t\tthis.animations = [];\n\n\t\t/**\n\t\t * Custom depth material to be used when rendering to the depth map. Can only be used\n\t\t * in context of meshes. When shadow-casting with a {@link DirectionalLight} or {@link SpotLight},\n\t\t * if you are modifying vertex positions in the vertex shader you must specify a custom depth\n\t\t * material for proper shadows.\n\t\t *\n\t\t * Only relevant in context of {@link WebGLRenderer}.\n\t\t *\n\t\t * @type {(Material|undefined)}\n\t\t * @default undefined\n\t\t */\n\t\tthis.customDepthMaterial = undefined;\n\n\t\t/**\n\t\t * Same as {@link Object3D#customDepthMaterial}, but used with {@link PointLight}.\n\t\t *\n\t\t * Only relevant in context of {@link WebGLRenderer}.\n\t\t *\n\t\t * @type {(Material|undefined)}\n\t\t * @default undefined\n\t\t */\n\t\tthis.customDistanceMaterial = undefined;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the 3D object. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t}\n\n\t/**\n\t * A callback that is executed immediately before a 3D object is rendered to a shadow map.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {Camera} shadowCamera - The shadow camera.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} depthMaterial - The depth material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately after a 3D object is rendered to a shadow map.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {Camera} shadowCamera - The shadow camera.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} depthMaterial - The depth material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately before a 3D object is rendered.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} material - The 3D object's material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\t/**\n\t * A callback that is executed immediately after a 3D object is rendered.\n\t *\n\t * @param {Renderer|WebGLRenderer} renderer - The renderer.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Material} material - The 3D object's material.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}\n\n\t/**\n\t * Applies the given transformation matrix to the object and updates the object's position,\n\t * rotation and scale.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tthis.matrix.premultiply( matrix );\n\n\t\tthis.matrix.decompose( this.position, this.quaternion, this.scale );\n\n\t}\n\n\t/**\n\t * Applies a rotation represented by given the quaternion to the 3D object.\n\t *\n\t * @param {Quaternion} q - The quaternion.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\tthis.quaternion.premultiply( q );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as an axis/angle couple to the 3D object.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t */\n\tsetRotationFromAxisAngle( axis, angle ) {\n\n\t\t// assumes axis is normalized\n\n\t\tthis.quaternion.setFromAxisAngle( axis, angle );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as Euler angles to the 3D object.\n\t *\n\t * @param {Euler} euler - The Euler angles.\n\t */\n\tsetRotationFromEuler( euler ) {\n\n\t\tthis.quaternion.setFromEuler( euler, true );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as rotation matrix to the 3D object.\n\t *\n\t * @param {Matrix4} m - Although a 4x4 matrix is expected, the upper 3x3 portion must be\n\t * a pure rotation matrix (i.e, unscaled).\n\t */\n\tsetRotationFromMatrix( m ) {\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tthis.quaternion.setFromRotationMatrix( m );\n\n\t}\n\n\t/**\n\t * Sets the given rotation represented as a Quaternion to the 3D object.\n\t *\n\t * @param {Quaternion} q - The Quaternion\n\t */\n\tsetRotationFromQuaternion( q ) {\n\n\t\t// assumes q is normalized\n\n\t\tthis.quaternion.copy( q );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object along an axis in local space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateOnAxis( axis, angle ) {\n\n\t\t// rotate object on axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.multiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the 3D object along an axis in world space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateOnWorldAxis( axis, angle ) {\n\n\t\t// rotate object on axis in world space\n\t\t// axis is assumed to be normalized\n\t\t// method assumes no rotated parent\n\n\t\t_q1.setFromAxisAngle( axis, angle );\n\n\t\tthis.quaternion.premultiply( _q1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its X axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateX( angle ) {\n\n\t\treturn this.rotateOnAxis( _xAxis, angle );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its Y axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateY( angle ) {\n\n\t\treturn this.rotateOnAxis( _yAxis, angle );\n\n\t}\n\n\t/**\n\t * Rotates the 3D object around its Z axis in local space.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\trotateZ( angle ) {\n\n\t\treturn this.rotateOnAxis( _zAxis, angle );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along the given axis in local space.\n\t *\n\t * @param {Vector3} axis - The (normalized) axis vector.\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateOnAxis( axis, distance ) {\n\n\t\t// translate object by distance along axis in object space\n\t\t// axis is assumed to be normalized\n\n\t\t_v1$4.copy( axis ).applyQuaternion( this.quaternion );\n\n\t\tthis.position.add( _v1$4.multiplyScalar( distance ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its X-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateX( distance ) {\n\n\t\treturn this.translateOnAxis( _xAxis, distance );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its Y-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateY( distance ) {\n\n\t\treturn this.translateOnAxis( _yAxis, distance );\n\n\t}\n\n\t/**\n\t * Translate the 3D object by a distance along its Z-axis in local space.\n\t *\n\t * @param {number} distance - The distance in world units.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\ttranslateZ( distance ) {\n\n\t\treturn this.translateOnAxis( _zAxis, distance );\n\n\t}\n\n\t/**\n\t * Converts the given vector from this 3D object's local space to world space.\n\t *\n\t * @param {Vector3} vector - The vector to convert.\n\t * @return {Vector3} The converted vector.\n\t */\n\tlocalToWorld( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( this.matrixWorld );\n\n\t}\n\n\t/**\n\t * Converts the given vector from this 3D object's word space to local space.\n\t *\n\t * @param {Vector3} vector - The vector to convert.\n\t * @return {Vector3} The converted vector.\n\t */\n\tworldToLocal( vector ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );\n\n\t}\n\n\t/**\n\t * Rotates the object to face a point in world space.\n\t *\n\t * This method does not support objects having non-uniformly-scaled parent(s).\n\t *\n\t * @param {number|Vector3} x - The x coordinate in world space. Alternatively, a vector representing a position in world space\n\t * @param {number} [y] - The y coordinate in world space.\n\t * @param {number} [z] - The z coordinate in world space.\n\t */\n\tlookAt( x, y, z ) {\n\n\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\n\t\tif ( x.isVector3 ) {\n\n\t\t\t_target.copy( x );\n\n\t\t} else {\n\n\t\t\t_target.set( x, y, z );\n\n\t\t}\n\n\t\tconst parent = this.parent;\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_position$3.setFromMatrixPosition( this.matrixWorld );\n\n\t\tif ( this.isCamera || this.isLight ) {\n\n\t\t\t_m1$1.lookAt( _position$3, _target, this.up );\n\n\t\t} else {\n\n\t\t\t_m1$1.lookAt( _target, _position$3, this.up );\n\n\t\t}\n\n\t\tthis.quaternion.setFromRotationMatrix( _m1$1 );\n\n\t\tif ( parent ) {\n\n\t\t\t_m1$1.extractRotation( parent.matrixWorld );\n\t\t\t_q1.setFromRotationMatrix( _m1$1 );\n\t\t\tthis.quaternion.premultiply( _q1.invert() );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Adds the given 3D object as a child to this 3D object. An arbitrary number of\n\t * objects may be added. Any current parent on an object passed in here will be\n\t * removed, since an object can have at most one parent.\n\t *\n\t * @fires Object3D#added\n\t * @fires Object3D#childadded\n\t * @param {Object3D} object - The 3D object to add.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tadd( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.add( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object === this ) {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object can\\'t be added as a child of itself.', object );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tif ( object && object.isObject3D ) {\n\n\t\t\tobject.removeFromParent();\n\t\t\tobject.parent = this;\n\t\t\tthis.children.push( object );\n\n\t\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t\t_childaddedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t\t_childaddedEvent.child = null;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes the given 3D object as child from this 3D object.\n\t * An arbitrary number of objects may be removed.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @param {Object3D} object - The 3D object to remove.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tremove( object ) {\n\n\t\tif ( arguments.length > 1 ) {\n\n\t\t\tfor ( let i = 0; i < arguments.length; i ++ ) {\n\n\t\t\t\tthis.remove( arguments[ i ] );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst index = this.children.indexOf( object );\n\n\t\tif ( index !== -1 ) {\n\n\t\t\tobject.parent = null;\n\t\t\tthis.children.splice( index, 1 );\n\n\t\t\tobject.dispatchEvent( _removedEvent );\n\n\t\t\t_childremovedEvent.child = object;\n\t\t\tthis.dispatchEvent( _childremovedEvent );\n\t\t\t_childremovedEvent.child = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes this 3D object from its current parent.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tremoveFromParent() {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tparent.remove( this );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes all child objects.\n\t *\n\t * @fires Object3D#removed\n\t * @fires Object3D#childremoved\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tclear() {\n\n\t\treturn this.remove( ... this.children );\n\n\t}\n\n\t/**\n\t * Adds the given 3D object as a child of this 3D object, while maintaining the object's world\n\t * transform. This method does not support scene graphs having non-uniformly-scaled nodes(s).\n\t *\n\t * @fires Object3D#added\n\t * @fires Object3D#childadded\n\t * @param {Object3D} object - The 3D object to attach.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tattach( object ) {\n\n\t\t// adds object as a child of this, while maintaining the object's world transform\n\n\t\t// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\t_m1$1.copy( this.matrixWorld ).invert();\n\n\t\tif ( object.parent !== null ) {\n\n\t\t\tobject.parent.updateWorldMatrix( true, false );\n\n\t\t\t_m1$1.multiply( object.parent.matrixWorld );\n\n\t\t}\n\n\t\tobject.applyMatrix4( _m1$1 );\n\n\t\tobject.removeFromParent();\n\t\tobject.parent = this;\n\t\tthis.children.push( object );\n\n\t\tobject.updateWorldMatrix( false, true );\n\n\t\tobject.dispatchEvent( _addedEvent );\n\n\t\t_childaddedEvent.child = object;\n\t\tthis.dispatchEvent( _childaddedEvent );\n\t\t_childaddedEvent.child = null;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching ID.\n\t *\n\t * @param {number} id - The id.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectById( id ) {\n\n\t\treturn this.getObjectByProperty( 'id', id );\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching name.\n\t *\n\t * @param {string} name - The name.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectByName( name ) {\n\n\t\treturn this.getObjectByProperty( 'name', name );\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns the first with a matching property value.\n\t *\n\t * @param {string} name - The name of the property.\n\t * @param {any} value - The value.\n\t * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found.\n\t */\n\tgetObjectByProperty( name, value ) {\n\n\t\tif ( this[ name ] === value ) return this;\n\n\t\tfor ( let i = 0, l = this.children.length; i < l; i ++ ) {\n\n\t\t\tconst child = this.children[ i ];\n\t\t\tconst object = child.getObjectByProperty( name, value );\n\n\t\t\tif ( object !== undefined ) {\n\n\t\t\t\treturn object;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\t/**\n\t * Searches through the 3D object and its children, starting with the 3D object\n\t * itself, and returns all 3D objects with a matching property value.\n\t *\n\t * @param {string} name - The name of the property.\n\t * @param {any} value - The value.\n\t * @param {Array<Object3D>} result - The method stores the result in this array.\n\t * @return {Array<Object3D>} The found 3D objects.\n\t */\n\tgetObjectsByProperty( name, value, result = [] ) {\n\n\t\tif ( this[ name ] === value ) result.push( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].getObjectsByProperty( name, value, result );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the position of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's position in world space.\n\t */\n\tgetWorldPosition( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\treturn target.setFromMatrixPosition( this.matrixWorld );\n\n\t}\n\n\t/**\n\t * Returns a Quaternion representing the position of the 3D object in world space.\n\t *\n\t * @param {Quaternion} target - The target Quaternion the result is stored to.\n\t * @return {Quaternion} The 3D object's rotation in world space.\n\t */\n\tgetWorldQuaternion( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, target, _scale$2 );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the scale of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's scale in world space.\n\t */\n\tgetWorldScale( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tthis.matrixWorld.decompose( _position$3, _quaternion$2, target );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's direction in world space.\n\t */\n\tgetWorldDirection( target ) {\n\n\t\tthis.updateWorldMatrix( true, false );\n\n\t\tconst e = this.matrixWorld.elements;\n\n\t\treturn target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();\n\n\t}\n\n\t/**\n\t * Abstract method to get intersections between a casted ray and this\n\t * 3D object. Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points}\n\t * implement this method in order to use raycasting.\n\t *\n\t * @abstract\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - An array holding the result of the method.\n\t */\n\traycast( /* raycaster, intersects */ ) {}\n\n\t/**\n\t * Executes the callback on this 3D object and all descendants.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverse( callback ) {\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverse( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects.\n\t * Descendants of invisible 3D objects are not traversed.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverseVisible( callback ) {\n\n\t\tif ( this.visible === false ) return;\n\n\t\tcallback( this );\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tchildren[ i ].traverseVisible( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors.\n\t *\n\t * Note: Modifying the scene graph inside the callback is discouraged.\n\t *\n\t * @param {Function} callback - A callback function that allows to process the current 3D object.\n\t */\n\ttraverseAncestors( callback ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( parent !== null ) {\n\n\t\t\tcallback( parent );\n\n\t\t\tparent.traverseAncestors( callback );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the transformation matrix in local space by computing it from the current\n\t * position, rotation and scale values.\n\t */\n\tupdateMatrix() {\n\n\t\tthis.matrix.compose( this.position, this.quaternion, this.scale );\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t/**\n\t * Updates the transformation matrix in world space of this 3D objects and its descendants.\n\t *\n\t * To ensure correct results, this method also recomputes the 3D object's transformation matrix in\n\t * local space. The computation of the local and world matrix can be controlled with the\n\t * {@link Object3D#matrixAutoUpdate} and {@link Object3D#matrixWorldAutoUpdate} flags which are both\n\t * `true` by default.  Set these flags to `false` if you need more control over the update matrix process.\n\t *\n\t * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even\n\t * when {@link Object3D#matrixWorldAutoUpdate} is set to `false`.\n\t */\n\tupdateMatrixWorld( force ) {\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\n\n\t\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\t\tif ( this.parent === null ) {\n\n\t\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\n\t\t\tforce = true;\n\n\t\t}\n\n\t\t// make sure descendants are updated if required\n\n\t\tconst children = this.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tconst child = children[ i ];\n\n\t\t\tchild.updateMatrixWorld( force );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the\n\t * update of ancestor and descendant nodes.\n\t *\n\t * @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.\n\t * @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.\n\t */\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tconst parent = this.parent;\n\n\t\tif ( updateParents === true && parent !== null ) {\n\n\t\t\tparent.updateWorldMatrix( true, false );\n\n\t\t}\n\n\t\tif ( this.matrixAutoUpdate ) this.updateMatrix();\n\n\t\tif ( this.matrixWorldAutoUpdate === true ) {\n\n\t\t\tif ( this.parent === null ) {\n\n\t\t\t\tthis.matrixWorld.copy( this.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tthis.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// make sure descendants are updated\n\n\t\tif ( updateChildren === true ) {\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tconst child = children[ i ];\n\n\t\t\t\tchild.updateWorldMatrix( false, true );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the 3D object into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized 3D object.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\t// meta is a string when called from JSON.stringify\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tconst output = {};\n\n\t\t// meta is a hash used to collect geometries, materials.\n\t\t// not providing it implies that this is the root object\n\t\t// being serialized.\n\t\tif ( isRootObject ) {\n\n\t\t\t// initialize meta obj\n\t\t\tmeta = {\n\t\t\t\tgeometries: {},\n\t\t\t\tmaterials: {},\n\t\t\t\ttextures: {},\n\t\t\t\timages: {},\n\t\t\t\tshapes: {},\n\t\t\t\tskeletons: {},\n\t\t\t\tanimations: {},\n\t\t\t\tnodes: {}\n\t\t\t};\n\n\t\t\toutput.metadata = {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Object',\n\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t};\n\n\t\t}\n\n\t\t// standard Object3D serialization\n\n\t\tconst object = {};\n\n\t\tobject.uuid = this.uuid;\n\t\tobject.type = this.type;\n\n\t\tif ( this.name !== '' ) object.name = this.name;\n\t\tif ( this.castShadow === true ) object.castShadow = true;\n\t\tif ( this.receiveShadow === true ) object.receiveShadow = true;\n\t\tif ( this.visible === false ) object.visible = false;\n\t\tif ( this.frustumCulled === false ) object.frustumCulled = false;\n\t\tif ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;\n\t\tif ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData;\n\n\t\tobject.layers = this.layers.mask;\n\t\tobject.matrix = this.matrix.toArray();\n\t\tobject.up = this.up.toArray();\n\n\t\tif ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;\n\n\t\t// object specific properties\n\n\t\tif ( this.isInstancedMesh ) {\n\n\t\t\tobject.type = 'InstancedMesh';\n\t\t\tobject.count = this.count;\n\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\tif ( this.instanceColor !== null ) object.instanceColor = this.instanceColor.toJSON();\n\n\t\t}\n\n\t\tif ( this.isBatchedMesh ) {\n\n\t\t\tobject.type = 'BatchedMesh';\n\t\t\tobject.perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\t\tobject.sortObjects = this.sortObjects;\n\n\t\t\tobject.drawRanges = this._drawRanges;\n\t\t\tobject.reservedRanges = this._reservedRanges;\n\n\t\t\tobject.geometryInfo = this._geometryInfo.map( info => ( {\n\t\t\t\t...info,\n\t\t\t\tboundingBox: info.boundingBox ? info.boundingBox.toJSON() : undefined,\n\t\t\t\tboundingSphere: info.boundingSphere ? info.boundingSphere.toJSON() : undefined\n\t\t\t} ) );\n\t\t\tobject.instanceInfo = this._instanceInfo.map( info => ( { ...info } ) );\n\n\t\t\tobject.availableInstanceIds = this._availableInstanceIds.slice();\n\t\t\tobject.availableGeometryIds = this._availableGeometryIds.slice();\n\n\t\t\tobject.nextIndexStart = this._nextIndexStart;\n\t\t\tobject.nextVertexStart = this._nextVertexStart;\n\t\t\tobject.geometryCount = this._geometryCount;\n\n\t\t\tobject.maxInstanceCount = this._maxInstanceCount;\n\t\t\tobject.maxVertexCount = this._maxVertexCount;\n\t\t\tobject.maxIndexCount = this._maxIndexCount;\n\n\t\t\tobject.geometryInitialized = this._geometryInitialized;\n\n\t\t\tobject.matricesTexture = this._matricesTexture.toJSON( meta );\n\n\t\t\tobject.indirectTexture = this._indirectTexture.toJSON( meta );\n\n\t\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\t\tobject.colorsTexture = this._colorsTexture.toJSON( meta );\n\n\t\t\t}\n\n\t\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\t\tobject.boundingSphere = this.boundingSphere.toJSON();\n\n\t\t\t}\n\n\t\t\tif ( this.boundingBox !== null ) {\n\n\t\t\t\tobject.boundingBox = this.boundingBox.toJSON();\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tfunction serialize( library, element ) {\n\n\t\t\tif ( library[ element.uuid ] === undefined ) {\n\n\t\t\t\tlibrary[ element.uuid ] = element.toJSON( meta );\n\n\t\t\t}\n\n\t\t\treturn element.uuid;\n\n\t\t}\n\n\t\tif ( this.isScene ) {\n\n\t\t\tif ( this.background ) {\n\n\t\t\t\tif ( this.background.isColor ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON();\n\n\t\t\t\t} else if ( this.background.isTexture ) {\n\n\t\t\t\t\tobject.background = this.background.toJSON( meta ).uuid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) {\n\n\t\t\t\tobject.environment = this.environment.toJSON( meta ).uuid;\n\n\t\t\t}\n\n\t\t} else if ( this.isMesh || this.isLine || this.isPoints ) {\n\n\t\t\tobject.geometry = serialize( meta.geometries, this.geometry );\n\n\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\tif ( parameters !== undefined && parameters.shapes !== undefined ) {\n\n\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\tif ( Array.isArray( shapes ) ) {\n\n\t\t\t\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst shape = shapes[ i ];\n\n\t\t\t\t\t\tserialize( meta.shapes, shape );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tserialize( meta.shapes, shapes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.isSkinnedMesh ) {\n\n\t\t\tobject.bindMode = this.bindMode;\n\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\tif ( this.skeleton !== undefined ) {\n\n\t\t\t\tserialize( meta.skeletons, this.skeleton );\n\n\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.material !== undefined ) {\n\n\t\t\tif ( Array.isArray( this.material ) ) {\n\n\t\t\t\tconst uuids = [];\n\n\t\t\t\tfor ( let i = 0, l = this.material.length; i < l; i ++ ) {\n\n\t\t\t\t\tuuids.push( serialize( meta.materials, this.material[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\tobject.material = uuids;\n\n\t\t\t} else {\n\n\t\t\t\tobject.material = serialize( meta.materials, this.material );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.children.length > 0 ) {\n\n\t\t\tobject.children = [];\n\n\t\t\tfor ( let i = 0; i < this.children.length; i ++ ) {\n\n\t\t\t\tobject.children.push( this.children[ i ].toJSON( meta ).object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.animations.length > 0 ) {\n\n\t\t\tobject.animations = [];\n\n\t\t\tfor ( let i = 0; i < this.animations.length; i ++ ) {\n\n\t\t\t\tconst animation = this.animations[ i ];\n\n\t\t\t\tobject.animations.push( serialize( meta.animations, animation ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst geometries = extractFromCache( meta.geometries );\n\t\t\tconst materials = extractFromCache( meta.materials );\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\t\t\tconst shapes = extractFromCache( meta.shapes );\n\t\t\tconst skeletons = extractFromCache( meta.skeletons );\n\t\t\tconst animations = extractFromCache( meta.animations );\n\t\t\tconst nodes = extractFromCache( meta.nodes );\n\n\t\t\tif ( geometries.length > 0 ) output.geometries = geometries;\n\t\t\tif ( materials.length > 0 ) output.materials = materials;\n\t\t\tif ( textures.length > 0 ) output.textures = textures;\n\t\t\tif ( images.length > 0 ) output.images = images;\n\t\t\tif ( shapes.length > 0 ) output.shapes = shapes;\n\t\t\tif ( skeletons.length > 0 ) output.skeletons = skeletons;\n\t\t\tif ( animations.length > 0 ) output.animations = animations;\n\t\t\tif ( nodes.length > 0 ) output.nodes = nodes;\n\n\t\t}\n\n\t\toutput.object = object;\n\n\t\treturn output;\n\n\t\t// extract data from the cache hash\n\t\t// remove metadata on each item\n\t\t// and return as array\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new 3D object with copied values from this instance.\n\t *\n\t * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are also cloned.\n\t * @return {Object3D} A clone of this instance.\n\t */\n\tclone( recursive ) {\n\n\t\treturn new this.constructor().copy( this, recursive );\n\n\t}\n\n\t/**\n\t * Copies the values of the given 3D object to this instance.\n\t *\n\t * @param {Object3D} source - The 3D object to copy.\n\t * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are cloned.\n\t * @return {Object3D} A reference to this instance.\n\t */\n\tcopy( source, recursive = true ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.up.copy( source.up );\n\n\t\tthis.position.copy( source.position );\n\t\tthis.rotation.order = source.rotation.order;\n\t\tthis.quaternion.copy( source.quaternion );\n\t\tthis.scale.copy( source.scale );\n\n\t\tthis.matrix.copy( source.matrix );\n\t\tthis.matrixWorld.copy( source.matrixWorld );\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\tthis.matrixWorldAutoUpdate = source.matrixWorldAutoUpdate;\n\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\n\t\tthis.layers.mask = source.layers.mask;\n\t\tthis.visible = source.visible;\n\n\t\tthis.castShadow = source.castShadow;\n\t\tthis.receiveShadow = source.receiveShadow;\n\n\t\tthis.frustumCulled = source.frustumCulled;\n\t\tthis.renderOrder = source.renderOrder;\n\n\t\tthis.animations = source.animations.slice();\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\tif ( recursive === true ) {\n\n\t\t\tfor ( let i = 0; i < source.children.length; i ++ ) {\n\n\t\t\t\tconst child = source.children[ i ];\n\t\t\t\tthis.add( child.clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * The default up direction for objects, also used as the default\n * position for {@link DirectionalLight} and {@link HemisphereLight}.\n *\n * @static\n * @type {Vector3}\n * @default (0,1,0)\n */\nObject3D.DEFAULT_UP = /*@__PURE__*/ new Vector3( 0, 1, 0 );\n\n/**\n * The default setting for {@link Object3D#matrixAutoUpdate} for\n * newly created 3D objects.\n *\n * @static\n * @type {boolean}\n * @default true\n */\nObject3D.DEFAULT_MATRIX_AUTO_UPDATE = true;\n\n/**\n * The default setting for {@link Object3D#matrixWorldAutoUpdate} for\n * newly created 3D objects.\n *\n * @static\n * @type {boolean}\n * @default true\n */\nObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;\n\nconst _v0$1 = /*@__PURE__*/ new Vector3();\nconst _v1$3 = /*@__PURE__*/ new Vector3();\nconst _v2$2 = /*@__PURE__*/ new Vector3();\nconst _v3$2 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nconst _v40 = /*@__PURE__*/ new Vector4();\nconst _v41 = /*@__PURE__*/ new Vector4();\nconst _v42 = /*@__PURE__*/ new Vector4();\n\n/**\n * A geometric triangle as defined by three vectors representing its three corners.\n */\nclass Triangle {\n\n\t/**\n\t * Constructs a new triangle.\n\t *\n\t * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle.\n\t * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle.\n\t * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle.\n\t */\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\t/**\n\t\t * The first corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.a = a;\n\n\t\t/**\n\t\t * The second corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.b = b;\n\n\t\t/**\n\t\t * The third corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.c = c;\n\n\t}\n\n\t/**\n\t * Computes the normal vector of a triangle.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0$1.subVectors( a, b );\n\t\ttarget.cross( _v0$1 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\t\t_v0$1.subVectors( c, a );\n\t\t_v1$3.subVectors( b, a );\n\t\t_v2$2.subVectors( point, a );\n\n\t\tconst dot00 = _v0$1.dot( _v0$1 );\n\t\tconst dot01 = _v0$1.dot( _v1$3 );\n\t\tconst dot02 = _v0$1.dot( _v2$2 );\n\t\tconst dot11 = _v1$3.dot( _v1$3 );\n\t\tconst dot12 = _v1$3.dot( _v2$2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3$2 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3$2.x >= 0 ) && ( _v3$2.y >= 0 ) && ( ( _v3$2.x + _v3$2.y ) <= 1 );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} p1 - The first corner of the triangle.\n\t * @param {Vector3} p2 - The second corner of the triangle.\n\t * @param {Vector3} p3 - The third corner of the triangle.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3$2 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3$2.x );\n\t\ttarget.addScaledVector( v2, _v3$2.y );\n\t\ttarget.addScaledVector( v3, _v3$2.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given attribute and indices.\n\t *\n\t * @param {BufferAttribute} attr - The attribute to interpolate.\n\t * @param {number} i1 - Index of first vertex.\n\t * @param {number} i2 - Index of second vertex.\n\t * @param {number} i3 - Index of third vertex.\n\t * @param {Vector3} barycoord - The barycoordinate value to use to interpolate.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The interpolated attribute value.\n\t */\n\tstatic getInterpolatedAttribute( attr, i1, i2, i3, barycoord, target ) {\n\n\t\t_v40.setScalar( 0 );\n\t\t_v41.setScalar( 0 );\n\t\t_v42.setScalar( 0 );\n\n\t\t_v40.fromBufferAttribute( attr, i1 );\n\t\t_v41.fromBufferAttribute( attr, i2 );\n\t\t_v42.fromBufferAttribute( attr, i3 );\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( _v40, barycoord.x );\n\t\ttarget.addScaledVector( _v41, barycoord.y );\n\t\ttarget.addScaledVector( _v42, barycoord.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0$1.subVectors( c, b );\n\t\t_v1$3.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given values.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given array values.\n\t *\n\t * @param {Array<Vector3>} points - An array with 3D points.\n\t * @param {number} i0 - The array index representing the first corner of the triangle.\n\t * @param {number} i1 - The array index representing the second corner of the triangle.\n\t * @param {number} i2 - The array index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given attribute values.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute with 3D points data.\n\t * @param {number} i0 - The attribute index representing the first corner of the triangle.\n\t * @param {number} i1 - The attribute index representing the second corner of the triangle.\n\t * @param {number} i2 - The attribute index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new triangle with copied values from this instance.\n\t *\n\t * @return {Triangle} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given triangle to this instance.\n\t *\n\t * @param {Triangle} triangle - The triangle to copy.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the area of the triangle.\n\t *\n\t * @return {number} The triangle's area.\n\t */\n\tgetArea() {\n\n\t\t_v0$1.subVectors( this.c, this.b );\n\t\t_v1$3.subVectors( this.a, this.b );\n\n\t\treturn _v0$1.cross( _v1$3 ).length() * 0.5;\n\n\t}\n\n\t/**\n\t * Computes the midpoint of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's midpoint.\n\t */\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\t/**\n\t * Computes the normal of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes a plane the triangle lies within.\n\t *\n\t * @param {Plane} target - The target vector that is used to store the method's result.\n\t * @return {Plane} The plane the triangle lies within.\n\t */\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this triangle intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\t/**\n\t * Returns the closest point on the triangle to the given point.\n\t *\n\t * @param {Vector3} p - The point to compute the closest point for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the triangle.\n\t */\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle is equal with the given one.\n\t *\n\t * @param {Triangle} triangle - The triangle to test for equality.\n\t * @return {boolean} Whether this triangle is equal with the given one.\n\t */\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nconst _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,\n\t'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,\n\t'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,\n\t'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,\n\t'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,\n\t'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,\n\t'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,\n\t'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,\n\t'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,\n\t'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,\n\t'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,\n\t'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,\n\t'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,\n\t'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,\n\t'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,\n\t'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,\n\t'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,\n\t'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,\n\t'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,\n\t'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,\n\t'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,\n\t'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,\n\t'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,\n\t'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };\n\nconst _hslA = { h: 0, s: 0, l: 0 };\nconst _hslB = { h: 0, s: 0, l: 0 };\n\nfunction hue2rgb( p, q, t ) {\n\n\tif ( t < 0 ) t += 1;\n\tif ( t > 1 ) t -= 1;\n\tif ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;\n\tif ( t < 1 / 2 ) return q;\n\tif ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );\n\treturn p;\n\n}\n\n/**\n * A Color instance is represented by RGB components in the linear <i>working\n * color space</i>, which defaults to `LinearSRGBColorSpace`. Inputs\n * conventionally using `SRGBColorSpace` (such as hexadecimals and CSS\n * strings) are converted to the working color space automatically.\n *\n * ```js\n * // converted automatically from SRGBColorSpace to LinearSRGBColorSpace\n * const color = new THREE.Color().setHex( 0x112233 );\n * ```\n * Source color spaces may be specified explicitly, to ensure correct conversions.\n * ```js\n * // assumed already LinearSRGBColorSpace; no conversion\n * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 );\n *\n * // converted explicitly from SRGBColorSpace to LinearSRGBColorSpace\n * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace );\n * ```\n * If THREE.ColorManagement is disabled, no conversions occur. For details,\n * see <i>Color management</i>. Iterating through a Color instance will yield\n * its components (r, g, b) in the corresponding order. A Color can be initialised\n * in any of the following ways:\n * ```js\n * //empty constructor - will default white\n * const color1 = new THREE.Color();\n *\n * //Hexadecimal color (recommended)\n * const color2 = new THREE.Color( 0xff0000 );\n *\n * //RGB string\n * const color3 = new THREE.Color(\"rgb(255, 0, 0)\");\n * const color4 = new THREE.Color(\"rgb(100%, 0%, 0%)\");\n *\n * //X11 color name - all 140 color names are supported.\n * //Note the lack of CamelCase in the name\n * const color5 = new THREE.Color( 'skyblue' );\n * //HSL string\n * const color6 = new THREE.Color(\"hsl(0, 100%, 50%)\");\n *\n * //Separate RGB values between 0 and 1\n * const color7 = new THREE.Color( 1, 0, 0 );\n * ```\n */\nclass Color {\n\n\t/**\n\t * Constructs a new color.\n\t *\n\t * Note that standard method of specifying color in three.js is with a hexadecimal triplet,\n\t * and that method is used throughout the rest of the documentation.\n\t *\n\t * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n\t * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n\t * @param {number} [g] - The green component.\n\t * @param {number} [b] - The blue component.\n\t */\n\tconstructor( r, g, b ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isColor = true;\n\n\t\t/**\n\t\t * The red component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.r = 1;\n\n\t\t/**\n\t\t * The green component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.g = 1;\n\n\t\t/**\n\t\t * The blue component.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.b = 1;\n\n\t\treturn this.set( r, g, b );\n\n\t}\n\n\t/**\n\t * Sets the colors's components from the given values.\n\t *\n\t * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are\n\t * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.\n\t * @param {number} [g] - The green component.\n\t * @param {number} [b] - The blue component.\n\t * @return {Color} A reference to this color.\n\t */\n\tset( r, g, b ) {\n\n\t\tif ( g === undefined && b === undefined ) {\n\n\t\t\t// r is THREE.Color, hex or string\n\n\t\t\tconst value = r;\n\n\t\t\tif ( value && value.isColor ) {\n\n\t\t\t\tthis.copy( value );\n\n\t\t\t} else if ( typeof value === 'number' ) {\n\n\t\t\t\tthis.setHex( value );\n\n\t\t\t} else if ( typeof value === 'string' ) {\n\n\t\t\t\tthis.setStyle( value );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.setRGB( r, g, b );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the colors's components to the given scalar value.\n\t *\n\t * @param {number} scalar - The scalar value.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.r = scalar;\n\t\tthis.g = scalar;\n\t\tthis.b = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a hexadecimal value.\n\t *\n\t * @param {number} hex - The hexadecimal value.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetHex( hex, colorSpace = SRGBColorSpace ) {\n\n\t\thex = Math.floor( hex );\n\n\t\tthis.r = ( hex >> 16 & 255 ) / 255;\n\t\tthis.g = ( hex >> 8 & 255 ) / 255;\n\t\tthis.b = ( hex & 255 ) / 255;\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from RGB values.\n\t *\n\t * @param {number} r - Red channel value between `0.0` and `1.0`.\n\t * @param {number} g - Green channel value between `0.0` and `1.0`.\n\t * @param {number} b - Blue channel value between `0.0` and `1.0`.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from RGB values.\n\t *\n\t * @param {number} h - Hue value between `0.0` and `1.0`.\n\t * @param {number} s - Saturation value between `0.0` and `1.0`.\n\t * @param {number} l - Lightness value between `0.0` and `1.0`.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\th = euclideanModulo( h, 1 );\n\t\ts = clamp( s, 0, 1 );\n\t\tl = clamp( l, 0, 1 );\n\n\t\tif ( s === 0 ) {\n\n\t\t\tthis.r = this.g = this.b = l;\n\n\t\t} else {\n\n\t\t\tconst p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );\n\t\t\tconst q = ( 2 * l ) - p;\n\n\t\t\tthis.r = hue2rgb( q, p, h + 1 / 3 );\n\t\t\tthis.g = hue2rgb( q, p, h );\n\t\t\tthis.b = hue2rgb( q, p, h - 1 / 3 );\n\n\t\t}\n\n\t\tColorManagement.colorSpaceToWorking( this, colorSpace );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,\n\t * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or\n\t * any [X11 color name]{@link https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart} -\n\t * all 140 color names are supported).\n\t *\n\t * @param {string} style - Color as a CSS-style string.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetStyle( style, colorSpace = SRGBColorSpace ) {\n\n\t\tfunction handleAlpha( string ) {\n\n\t\t\tif ( string === undefined ) return;\n\n\t\t\tif ( parseFloat( string ) < 1 ) {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\tlet m;\n\n\t\tif ( m = /^(\\w+)\\(([^\\)]*)\\)/.exec( style ) ) {\n\n\t\t\t// rgb / hsl\n\n\t\t\tlet color;\n\t\t\tconst name = m[ 1 ];\n\t\t\tconst components = m[ 2 ];\n\n\t\t\tswitch ( name ) {\n\n\t\t\t\tcase 'rgb':\n\t\t\t\tcase 'rgba':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 1 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 2 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tMath.min( 255, parseInt( color[ 3 ], 10 ) ) / 255,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setRGB(\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 1 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 2 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tMath.min( 100, parseInt( color[ 3 ], 10 ) ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hsl':\n\t\t\t\tcase 'hsla':\n\n\t\t\t\t\tif ( color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec( components ) ) {\n\n\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\n\t\t\t\t\t\thandleAlpha( color[ 4 ] );\n\n\t\t\t\t\t\treturn this.setHSL(\n\t\t\t\t\t\t\tparseFloat( color[ 1 ] ) / 360,\n\t\t\t\t\t\t\tparseFloat( color[ 2 ] ) / 100,\n\t\t\t\t\t\t\tparseFloat( color[ 3 ] ) / 100,\n\t\t\t\t\t\t\tcolorSpace\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tconsole.warn( 'THREE.Color: Unknown color model ' + style );\n\n\t\t\t}\n\n\t\t} else if ( m = /^\\#([A-Fa-f\\d]+)$/.exec( style ) ) {\n\n\t\t\t// hex color\n\n\t\t\tconst hex = m[ 1 ];\n\t\t\tconst size = hex.length;\n\n\t\t\tif ( size === 3 ) {\n\n\t\t\t\t// #ff0\n\t\t\t\treturn this.setRGB(\n\t\t\t\t\tparseInt( hex.charAt( 0 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 1 ), 16 ) / 15,\n\t\t\t\t\tparseInt( hex.charAt( 2 ), 16 ) / 15,\n\t\t\t\t\tcolorSpace\n\t\t\t\t);\n\n\t\t\t} else if ( size === 6 ) {\n\n\t\t\t\t// #ff0000\n\t\t\t\treturn this.setHex( parseInt( hex, 16 ), colorSpace );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.Color: Invalid hex color ' + style );\n\n\t\t\t}\n\n\t\t} else if ( style && style.length > 0 ) {\n\n\t\t\treturn this.setColorName( style, colorSpace );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets this color from a color name. Faster than {@link Color#setStyle} if\n\t * you don't need the other CSS-style formats.\n\t *\n\t * For convenience, the list of names is exposed in `Color.NAMES` as a hash.\n\t * ```js\n\t * Color.NAMES.aliceblue // returns 0xF0F8FF\n\t * ```\n\t *\n\t * @param {string} style - The color name.\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetColorName( style, colorSpace = SRGBColorSpace ) {\n\n\t\t// color keywords\n\t\tconst hex = _colorKeywords[ style.toLowerCase() ];\n\n\t\tif ( hex !== undefined ) {\n\n\t\t\t// red\n\t\t\tthis.setHex( hex, colorSpace );\n\n\t\t} else {\n\n\t\t\t// unknown color\n\t\t\tconsole.warn( 'THREE.Color: Unknown color ' + style );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new color with copied values from this instance.\n\t *\n\t * @return {Color} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.r, this.g, this.b );\n\n\t}\n\n\t/**\n\t * Copies the values of the given color to this instance.\n\t *\n\t * @param {Color} color - The color to copy.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopy( color ) {\n\n\t\tthis.r = color.r;\n\t\tthis.g = color.g;\n\t\tthis.b = color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given color into this color, and then converts this color from\n\t * `SRGBColorSpace` to `LinearSRGBColorSpace`.\n\t *\n\t * @param {Color} color - The color to copy/convert.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopySRGBToLinear( color ) {\n\n\t\tthis.r = SRGBToLinear( color.r );\n\t\tthis.g = SRGBToLinear( color.g );\n\t\tthis.b = SRGBToLinear( color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given color into this color, and then converts this color from\n\t * `LinearSRGBColorSpace` to `SRGBColorSpace`.\n\t *\n\t * @param {Color} color - The color to copy/convert.\n\t * @return {Color} A reference to this color.\n\t */\n\tcopyLinearToSRGB( color ) {\n\n\t\tthis.r = LinearToSRGB( color.r );\n\t\tthis.g = LinearToSRGB( color.g );\n\t\tthis.b = LinearToSRGB( color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.\n\t *\n\t * @return {Color} A reference to this color.\n\t */\n\tconvertSRGBToLinear() {\n\n\t\tthis.copySRGBToLinear( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.\n\t *\n\t * @return {Color} A reference to this color.\n\t */\n\tconvertLinearToSRGB() {\n\n\t\tthis.copyLinearToSRGB( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the hexadecimal value of this color.\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {number} The hexadecimal value.\n\t */\n\tgetHex( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\treturn Math.round( clamp( _color.r * 255, 0, 255 ) ) * 65536 + Math.round( clamp( _color.g * 255, 0, 255 ) ) * 256 + Math.round( clamp( _color.b * 255, 0, 255 ) );\n\n\t}\n\n\t/**\n\t * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {string} The hexadecimal value as a string.\n\t */\n\tgetHexString( colorSpace = SRGBColorSpace ) {\n\n\t\treturn ( '000000' + this.getHex( colorSpace ).toString( 16 ) ).slice( -6 );\n\n\t}\n\n\t/**\n\t * Converts the colors RGB values into the HSL format and stores them into the\n\t * given target object.\n\t *\n\t * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {{h:number,s:number,l:number}} The HSL representation of this color.\n\t */\n\tgetHSL( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\t// h,s,l ranges are in 0.0 - 1.0\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tconst max = Math.max( r, g, b );\n\t\tconst min = Math.min( r, g, b );\n\n\t\tlet hue, saturation;\n\t\tconst lightness = ( min + max ) / 2.0;\n\n\t\tif ( min === max ) {\n\n\t\t\thue = 0;\n\t\t\tsaturation = 0;\n\n\t\t} else {\n\n\t\t\tconst delta = max - min;\n\n\t\t\tsaturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );\n\n\t\t\tswitch ( max ) {\n\n\t\t\t\tcase r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;\n\t\t\t\tcase g: hue = ( b - r ) / delta + 2; break;\n\t\t\t\tcase b: hue = ( r - g ) / delta + 4; break;\n\n\t\t\t}\n\n\t\t\thue /= 6;\n\n\t\t}\n\n\t\ttarget.h = hue;\n\t\ttarget.s = saturation;\n\t\ttarget.l = lightness;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the RGB values of this color and stores them into the given target object.\n\t *\n\t * @param {Color} target - The target color that is used to store the method's result.\n\t * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.\n\t * @return {Color} The RGB representation of this color.\n\t */\n\tgetRGB( target, colorSpace = ColorManagement.workingColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\ttarget.r = _color.r;\n\t\ttarget.g = _color.g;\n\t\ttarget.b = _color.b;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.\n\t *\n\t * @param {string} [colorSpace=SRGBColorSpace] - The color space.\n\t * @return {string} The CSS representation of this color.\n\t */\n\tgetStyle( colorSpace = SRGBColorSpace ) {\n\n\t\tColorManagement.workingToColorSpace( _color.copy( this ), colorSpace );\n\n\t\tconst r = _color.r, g = _color.g, b = _color.b;\n\n\t\tif ( colorSpace !== SRGBColorSpace ) {\n\n\t\t\t// Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).\n\t\t\treturn `color(${ colorSpace } ${ r.toFixed( 3 ) } ${ g.toFixed( 3 ) } ${ b.toFixed( 3 ) })`;\n\n\t\t}\n\n\t\treturn `rgb(${ Math.round( r * 255 ) },${ Math.round( g * 255 ) },${ Math.round( b * 255 ) })`;\n\n\t}\n\n\t/**\n\t * Adds the given HSL values to this color's values.\n\t * Internally, this converts the color's RGB values to HSL, adds HSL\n\t * and then converts the color back to RGB.\n\t *\n\t * @param {number} h - Hue value between `0.0` and `1.0`.\n\t * @param {number} s - Saturation value between `0.0` and `1.0`.\n\t * @param {number} l - Lightness value between `0.0` and `1.0`.\n\t * @return {Color} A reference to this color.\n\t */\n\toffsetHSL( h, s, l ) {\n\n\t\tthis.getHSL( _hslA );\n\n\t\treturn this.setHSL( _hslA.h + h, _hslA.s + s, _hslA.l + l );\n\n\t}\n\n\t/**\n\t * Adds the RGB values of the given color to the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to add.\n\t * @return {Color} A reference to this color.\n\t */\n\tadd( color ) {\n\n\t\tthis.r += color.r;\n\t\tthis.g += color.g;\n\t\tthis.b += color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the RGB values of the given colors and stores the result in this instance.\n\t *\n\t * @param {Color} color1 - The first color.\n\t * @param {Color} color2 - The second color.\n\t * @return {Color} A reference to this color.\n\t */\n\taddColors( color1, color2 ) {\n\n\t\tthis.r = color1.r + color2.r;\n\t\tthis.g = color1.g + color2.g;\n\t\tthis.b = color1.b + color2.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to the RGB values of this color.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Color} A reference to this color.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.r += s;\n\t\tthis.g += s;\n\t\tthis.b += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the RGB values of the given color from the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to subtract.\n\t * @return {Color} A reference to this color.\n\t */\n\tsub( color ) {\n\n\t\tthis.r = Math.max( 0, this.r - color.r );\n\t\tthis.g = Math.max( 0, this.g - color.g );\n\t\tthis.b = Math.max( 0, this.b - color.b );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the RGB values of the given color with the RGB values of this color.\n\t *\n\t * @param {Color} color - The color to multiply.\n\t * @return {Color} A reference to this color.\n\t */\n\tmultiply( color ) {\n\n\t\tthis.r *= color.r;\n\t\tthis.g *= color.g;\n\t\tthis.b *= color.b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with the RGB values of this color.\n\t *\n\t * @param {number} s - The scalar to multiply.\n\t * @return {Color} A reference to this color.\n\t */\n\tmultiplyScalar( s ) {\n\n\t\tthis.r *= s;\n\t\tthis.g *= s;\n\t\tthis.b *= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates this color's RGB values toward the RGB values of the\n\t * given color. The alpha argument can be thought of as the ratio between\n\t * the two colors, where `0.0` is this color and `1.0` is the first argument.\n\t *\n\t * @param {Color} color - The color to converge on.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerp( color, alpha ) {\n\n\t\tthis.r += ( color.r - this.r ) * alpha;\n\t\tthis.g += ( color.g - this.g ) * alpha;\n\t\tthis.b += ( color.b - this.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given colors and stores the result in this instance.\n\t * The alpha argument can be thought of as the ratio between the two colors, where `0.0`\n\t * is the first and `1.0` is the second color.\n\t *\n\t * @param {Color} color1 - The first color.\n\t * @param {Color} color2 - The second color.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerpColors( color1, color2, alpha ) {\n\n\t\tthis.r = color1.r + ( color2.r - color1.r ) * alpha;\n\t\tthis.g = color1.g + ( color2.g - color1.g ) * alpha;\n\t\tthis.b = color1.b + ( color2.b - color1.b ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates this color's HSL values toward the HSL values of the\n\t * given color. It differs from {@link Color#lerp} by not interpolating straight\n\t * from one color to the other, but instead going through all the hues in between\n\t * those two colors. The alpha argument can be thought of as the ratio between\n\t * the two colors, where 0.0 is this color and 1.0 is the first argument.\n\t *\n\t * @param {Color} color - The color to converge on.\n\t * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.\n\t * @return {Color} A reference to this color.\n\t */\n\tlerpHSL( color, alpha ) {\n\n\t\tthis.getHSL( _hslA );\n\t\tcolor.getHSL( _hslB );\n\n\t\tconst h = lerp( _hslA.h, _hslB.h, alpha );\n\t\tconst s = lerp( _hslA.s, _hslB.s, alpha );\n\t\tconst l = lerp( _hslA.l, _hslB.l, alpha );\n\n\t\tthis.setHSL( h, s, l );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the color's RGB components from the given 3D vector.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Color} A reference to this color.\n\t */\n\tsetFromVector3( v ) {\n\n\t\tthis.r = v.x;\n\t\tthis.g = v.y;\n\t\tthis.b = v.z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Transforms this color with the given 3x3 matrix.\n\t *\n\t * @param {Matrix3} m - The matrix.\n\t * @return {Color} A reference to this color.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tconst r = this.r, g = this.g, b = this.b;\n\t\tconst e = m.elements;\n\n\t\tthis.r = e[ 0 ] * r + e[ 3 ] * g + e[ 6 ] * b;\n\t\tthis.g = e[ 1 ] * r + e[ 4 ] * g + e[ 7 ] * b;\n\t\tthis.b = e[ 2 ] * r + e[ 5 ] * g + e[ 8 ] * b;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this color is equal with the given one.\n\t *\n\t * @param {Color} c - The color to test for equality.\n\t * @return {boolean} Whether this bounding color is equal with the given one.\n\t */\n\tequals( c ) {\n\n\t\treturn ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );\n\n\t}\n\n\t/**\n\t * Sets this color's RGB components from the given array.\n\t *\n\t * @param {Array<number>} array - An array holding the RGB values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Color} A reference to this color.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.r = array[ offset ];\n\t\tthis.g = array[ offset + 1 ];\n\t\tthis.b = array[ offset + 2 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the RGB components of this color to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the color components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The color components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.r;\n\t\tarray[ offset + 1 ] = this.g;\n\t\tarray[ offset + 2 ] = this.b;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this color from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding color data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Color} A reference to this color.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.r = attribute.getX( index );\n\t\tthis.g = attribute.getY( index );\n\t\tthis.b = attribute.getZ( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This methods defines the serialization result of this class. Returns the color\n\t * as a hexadecimal value.\n\t *\n\t * @return {number} The hexadecimal value.\n\t */\n\ttoJSON() {\n\n\t\treturn this.getHex();\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.r;\n\t\tyield this.g;\n\t\tyield this.b;\n\n\t}\n\n}\n\nconst _color = /*@__PURE__*/ new Color();\n\n/**\n * A dictionary with X11 color names.\n *\n * Note that multiple words such as Dark Orange become the string 'darkorange'.\n *\n * @static\n * @type {Object}\n */\nColor.NAMES = _colorKeywords;\n\nlet _materialId = 0;\n\n/**\n * Abstract base class for materials.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * @abstract\n * @augments EventDispatcher\n */\nclass Material extends EventDispatcher {\n\n\t/**\n\t * Constructs a new material.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMaterial = true;\n\n\t\t/**\n\t\t * The ID of the material.\n\t\t *\n\t\t * @name Material#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _materialId ++ } );\n\n\t\t/**\n\t\t * The UUID of the material.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the material.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Material';\n\n\t\t/**\n\t\t * Defines the blending type of the material.\n\t\t *\n\t\t * It must be set to `CustomBlending` if custom blending properties like\n\t\t * {@link Material#blendSrc}, {@link Material#blendDst} or {@link Material#blendEquation}\n\t\t * should have any effect.\n\t\t *\n\t\t * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending)}\n\t\t * @default NormalBlending\n\t\t */\n\t\tthis.blending = NormalBlending;\n\n\t\t/**\n\t\t * Defines which side of faces will be rendered - front, back or both.\n\t\t *\n\t\t * @type {(FrontSide|BackSide|DoubleSide)}\n\t\t * @default FrontSide\n\t\t */\n\t\tthis.side = FrontSide;\n\n\t\t/**\n\t\t * If set to `true`, vertex colors should be used.\n\t\t *\n\t\t * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or\n\t\t * four (RGBA) component color buffer attribute is used.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.vertexColors = false;\n\n\t\t/**\n\t\t * Defines how transparent the material is.\n\t\t * A value of `0.0` indicates fully transparent, `1.0` is fully opaque.\n\t\t *\n\t\t * If the {@link Material#transparent} is not set to `true`,\n\t\t * the material will remain fully opaque and this value will only affect its color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.opacity = 1;\n\n\t\t/**\n\t\t * Defines whether this material is transparent. This has an effect on\n\t\t * rendering as transparent objects need special treatment and are rendered\n\t\t * after non-transparent objects.\n\t\t *\n\t\t * When set to true, the extent to which the material is transparent is\n\t\t * controlled by {@link Material#opacity}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.transparent = false;\n\n\t\t/**\n\t\t * Enables alpha hashed transparency, an alternative to {@link Material#transparent} or\n\t\t * {@link Material#alphaTest}. The material will not be rendered if opacity is lower than\n\t\t * a random threshold. Randomization introduces some grain or noise, but approximates alpha\n\t\t * blending without the associated problems of sorting. Using TAA can reduce the resulting noise.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.alphaHash = false;\n\n\t\t/**\n\t\t * Defines the blending source factor.\n\t\t *\n\t\t * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default SrcAlphaFactor\n\t\t */\n\t\tthis.blendSrc = SrcAlphaFactor;\n\n\t\t/**\n\t\t * Defines the blending destination factor.\n\t\t *\n\t\t * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default OneMinusSrcAlphaFactor\n\t\t */\n\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\n\t\t/**\n\t\t * Defines the blending equation.\n\t\t *\n\t\t * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}\n\t\t * @default AddEquation\n\t\t */\n\t\tthis.blendEquation = AddEquation;\n\n\t\t/**\n\t\t * Defines the blending source alpha factor.\n\t\t *\n\t\t * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendSrcAlpha = null;\n\n\t\t/**\n\t\t * Defines the blending destination alpha factor.\n\t\t *\n\t\t * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendDstAlpha = null;\n\n\t\t/**\n\t\t * Defines the blending equation of the alpha channel.\n\t\t *\n\t\t * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)}\n\t\t * @default null\n\t\t */\n\t\tthis.blendEquationAlpha = null;\n\n\t\t/**\n\t\t * Represents the RGB values of the constant blend color.\n\t\t *\n\t\t * This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.blendColor = new Color( 0, 0, 0 );\n\n\t\t/**\n\t\t * Represents the alpha value of the constant blend color.\n\t\t *\n\t\t * This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.blendAlpha = 0;\n\n\t\t/**\n\t\t * Defines the depth function.\n\t\t *\n\t\t * @type {(NeverDepth|AlwaysDepth|LessDepth|LessEqualDepth|EqualDepth|GreaterEqualDepth|GreaterDepth|NotEqualDepth)}\n\t\t * @default LessEqualDepth\n\t\t */\n\t\tthis.depthFunc = LessEqualDepth;\n\n\t\t/**\n\t\t * Whether to have depth test enabled when rendering this material.\n\t\t * When the depth test is disabled, the depth write will also be implicitly disabled.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthTest = true;\n\n\t\t/**\n\t\t * Whether rendering this material has any effect on the depth buffer.\n\t\t *\n\t\t * When drawing 2D overlays it can be useful to disable the depth writing in\n\t\t * order to layer several things together without creating z-index artifacts.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.depthWrite = true;\n\n\t\t/**\n\t\t * The bit mask to use when writing to the stencil buffer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0xff\n\t\t */\n\t\tthis.stencilWriteMask = 0xff;\n\n\t\t/**\n\t\t * The stencil comparison function to use.\n\t\t *\n\t\t * @type {NeverStencilFunc|LessStencilFunc|EqualStencilFunc|LessEqualStencilFunc|GreaterStencilFunc|NotEqualStencilFunc|GreaterEqualStencilFunc|AlwaysStencilFunc}\n\t\t * @default AlwaysStencilFunc\n\t\t */\n\t\tthis.stencilFunc = AlwaysStencilFunc;\n\n\t\t/**\n\t\t * The value to use when performing stencil comparisons or stencil operations.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.stencilRef = 0;\n\n\t\t/**\n\t\t * The bit mask to use when comparing against the stencil buffer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0xff\n\t\t */\n\t\tthis.stencilFuncMask = 0xff;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns `false`.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilFail = KeepStencilOp;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns\n\t\t * `true` but the depth test fails.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilZFail = KeepStencilOp;\n\n\t\t/**\n\t\t * Which stencil operation to perform when the comparison function returns\n\t\t * `true` and the depth test passes.\n\t\t *\n\t\t * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp}\n\t\t * @default KeepStencilOp\n\t\t */\n\t\tthis.stencilZPass = KeepStencilOp;\n\n\t\t/**\n\t\t * Whether stencil operations are performed against the stencil buffer. In\n\t\t * order to perform writes or comparisons against the stencil buffer this\n\t\t * value must be `true`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.stencilWrite = false;\n\n\t\t/**\n\t\t * User-defined clipping planes specified as THREE.Plane objects in world\n\t\t * space. These planes apply to the objects this material is attached to.\n\t\t * Points in space whose signed distance to the plane is negative are clipped\n\t\t * (not rendered). This requires {@link WebGLRenderer#localClippingEnabled} to\n\t\t * be `true`.\n\t\t *\n\t\t * @type {?Array<Plane>}\n\t\t * @default null\n\t\t */\n\t\tthis.clippingPlanes = null;\n\n\t\t/**\n\t\t * Changes the behavior of clipping planes so that only their intersection is\n\t\t * clipped, rather than their union.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipIntersection = false;\n\n\t\t/**\n\t\t * Defines whether to clip shadows according to the clipping planes specified\n\t\t * on this material.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipShadows = false;\n\n\t\t/**\n\t\t * Defines which side of faces cast shadows. If `null`, the side casting shadows\n\t\t * is determined as follows:\n\t\t *\n\t\t * - When {@link Material#side} is set to `FrontSide`, the back side cast shadows.\n\t\t * - When {@link Material#side} is set to `BackSide`, the front side cast shadows.\n\t\t * - When {@link Material#side} is set to `DoubleSide`, both sides cast shadows.\n\t\t *\n\t\t * @type {?(FrontSide|BackSide|DoubleSide)}\n\t\t * @default null\n\t\t */\n\t\tthis.shadowSide = null;\n\n\t\t/**\n\t\t * Whether to render the material's color.\n\t\t *\n\t\t * This can be used in conjunction with {@link Object3D#renderOder} to create invisible\n\t\t * objects that occlude other objects.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.colorWrite = true;\n\n\t\t/**\n\t\t * Override the renderer's default precision for this material.\n\t\t *\n\t\t * @type {?('highp'|'mediump'|'lowp')}\n\t\t * @default null\n\t\t */\n\t\tthis.precision = null;\n\n\t\t/**\n\t\t * Whether to use polygon offset or not. When enabled, each fragment's depth value will\n\t\t * be offset after it is interpolated from the depth values of the appropriate vertices.\n\t\t * The offset is added before the depth test is performed and before the value is written\n\t\t * into the depth buffer.\n\t\t *\n\t\t * Can be useful for rendering hidden-line images, for applying decals to surfaces, and for\n\t\t * rendering solids with highlighted edges.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.polygonOffset = false;\n\n\t\t/**\n\t\t * Specifies a scale factor that is used to create a variable depth offset for each polygon.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.polygonOffsetFactor = 0;\n\n\t\t/**\n\t\t * Is multiplied by an implementation-specific value to create a constant depth offset.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.polygonOffsetUnits = 0;\n\n\t\t/**\n\t\t * Whether to apply dithering to the color to remove the appearance of banding.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.dithering = false;\n\n\t\t/**\n\t\t * Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts\n\t\t * (meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this\n\t\t * will smooth aliasing on clip plane edges and alphaTest-clipped edges.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.alphaToCoverage = false;\n\n\t\t/**\n\t\t * Whether to premultiply the alpha (transparency) value.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultipliedAlpha = false;\n\n\t\t/**\n\t\t * Whether double-sided, transparent objects should be rendered with a single pass or not.\n\t\t *\n\t\t * The engine renders double-sided, transparent objects with two draw calls (back faces first,\n\t\t * then front faces) to mitigate transparency artifacts. There are scenarios however where this\n\t\t * approach produces no quality gains but still doubles draw calls e.g. when rendering flat\n\t\t * vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to\n\t\t * disable the two pass rendering to avoid performance issues.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.forceSinglePass = false;\n\n\t\t/**\n\t\t * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.allowOverride = true;\n\n\t\t/**\n\t\t * Defines whether 3D objects using this material are visible.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.visible = true;\n\n\t\t/**\n\t\t * Defines whether this material is tone mapped according to the renderer's tone mapping setting.\n\t\t *\n\t\t * It is ignored when rendering to a render target or using post processing or when using\n\t\t * `WebGPURenderer`. In all these cases, all materials are honored by tone mapping.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.toneMapped = true;\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the Material. It\n\t\t * should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t\t/**\n\t\t * This starts at `0` and counts how many times {@link Material#needsUpdate} is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 0\n\t\t */\n\t\tthis.version = 0;\n\n\t\tthis._alphaTest = 0;\n\n\t}\n\n\t/**\n\t * Sets the alpha value to be used when running an alpha test. The material\n\t * will not be rendered if the opacity is lower than this value.\n\t *\n\t * @type {number}\n\t * @readonly\n\t * @default 0\n\t */\n\tget alphaTest() {\n\n\t\treturn this._alphaTest;\n\n\t}\n\n\tset alphaTest( value ) {\n\n\t\tif ( this._alphaTest > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._alphaTest = value;\n\n\t}\n\n\t/**\n\t * An optional callback that is executed immediately before the material is used to render a 3D object.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {Scene} scene - The scene.\n\t * @param {Camera} camera - The camera that is used to render the scene.\n\t * @param {BufferGeometry} geometry - The 3D object's geometry.\n\t * @param {Object3D} object - The 3D object.\n\t * @param {Object} group - The geometry group data.\n\t */\n\tonBeforeRender( /* renderer, scene, camera, geometry, object, group */ ) {}\n\n\t/**\n\t * An optional callback that is executed immediately before the shader\n\t * program is compiled. This function is called with the shader source code\n\t * as a parameter. Useful for the modification of built-in materials.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}. The\n\t * recommended approach when customizing materials is to use `WebGPURenderer` with the new\n\t * Node Material system and [TSL]{@link https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language}.\n\t *\n\t * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.\n\t * @param {WebGLRenderer} renderer - A reference to the renderer.\n\t */\n\tonBeforeCompile( /* shaderobject, renderer */ ) {}\n\n\t/**\n\t * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify\n\t * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached\n\t * shader or recompile the shader for this material as needed.\n\t *\n\t * This method can only be used when rendering with {@link WebGLRenderer}.\n\t *\n\t * @return {string} The custom program cache key.\n\t */\n\tcustomProgramCacheKey() {\n\n\t\treturn this.onBeforeCompile.toString();\n\n\t}\n\n\t/**\n\t * This method can be used to set default values from parameter objects.\n\t * It is a generic implementation so it can be used with different types\n\t * of materials.\n\t *\n\t * @param {Object} [values] - The material values to set.\n\t */\n\tsetValues( values ) {\n\n\t\tif ( values === undefined ) return;\n\n\t\tfor ( const key in values ) {\n\n\t\t\tconst newValue = values[ key ];\n\n\t\t\tif ( newValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: parameter '${ key }' has value of undefined.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst currentValue = this[ key ];\n\n\t\t\tif ( currentValue === undefined ) {\n\n\t\t\t\tconsole.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( currentValue && currentValue.isColor ) {\n\n\t\t\t\tcurrentValue.set( newValue );\n\n\t\t\t} else if ( ( currentValue && currentValue.isVector3 ) && ( newValue && newValue.isVector3 ) ) {\n\n\t\t\t\tcurrentValue.copy( newValue );\n\n\t\t\t} else {\n\n\t\t\t\tthis[ key ] = newValue;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the material into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized material.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON( meta ) {\n\n\t\tconst isRootObject = ( meta === undefined || typeof meta === 'string' );\n\n\t\tif ( isRootObject ) {\n\n\t\t\tmeta = {\n\t\t\t\ttextures: {},\n\t\t\t\timages: {}\n\t\t\t};\n\n\t\t}\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Material',\n\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard Material serialization\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\n\t\tif ( this.color && this.color.isColor ) data.color = this.color.getHex();\n\n\t\tif ( this.roughness !== undefined ) data.roughness = this.roughness;\n\t\tif ( this.metalness !== undefined ) data.metalness = this.metalness;\n\n\t\tif ( this.sheen !== undefined ) data.sheen = this.sheen;\n\t\tif ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();\n\t\tif ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;\n\t\tif ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();\n\t\tif ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;\n\n\t\tif ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();\n\t\tif ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;\n\t\tif ( this.specularColor && this.specularColor.isColor ) data.specularColor = this.specularColor.getHex();\n\t\tif ( this.shininess !== undefined ) data.shininess = this.shininess;\n\t\tif ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;\n\t\tif ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\tif ( this.clearcoatMap && this.clearcoatMap.isTexture ) {\n\n\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture ) {\n\n\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture ) {\n\n\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON( meta ).uuid;\n\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.dispersion !== undefined ) data.dispersion = this.dispersion;\n\n\t\tif ( this.iridescence !== undefined ) data.iridescence = this.iridescence;\n\t\tif ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;\n\t\tif ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;\n\n\t\tif ( this.iridescenceMap && this.iridescenceMap.isTexture ) {\n\n\t\t\tdata.iridescenceMap = this.iridescenceMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture ) {\n\n\t\t\tdata.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;\n\t\tif ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;\n\n\t\tif ( this.anisotropyMap && this.anisotropyMap.isTexture ) {\n\n\t\t\tdata.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;\n\t\tif ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;\n\t\tif ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;\n\n\t\tif ( this.lightMap && this.lightMap.isTexture ) {\n\n\t\t\tdata.lightMap = this.lightMap.toJSON( meta ).uuid;\n\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\n\t\t}\n\n\t\tif ( this.aoMap && this.aoMap.isTexture ) {\n\n\t\t\tdata.aoMap = this.aoMap.toJSON( meta ).uuid;\n\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\n\t\t}\n\n\t\tif ( this.bumpMap && this.bumpMap.isTexture ) {\n\n\t\t\tdata.bumpMap = this.bumpMap.toJSON( meta ).uuid;\n\t\t\tdata.bumpScale = this.bumpScale;\n\n\t\t}\n\n\t\tif ( this.normalMap && this.normalMap.isTexture ) {\n\n\t\t\tdata.normalMap = this.normalMap.toJSON( meta ).uuid;\n\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\tdata.normalScale = this.normalScale.toArray();\n\n\t\t}\n\n\t\tif ( this.displacementMap && this.displacementMap.isTexture ) {\n\n\t\t\tdata.displacementMap = this.displacementMap.toJSON( meta ).uuid;\n\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\tdata.displacementBias = this.displacementBias;\n\n\t\t}\n\n\t\tif ( this.roughnessMap && this.roughnessMap.isTexture ) data.roughnessMap = this.roughnessMap.toJSON( meta ).uuid;\n\t\tif ( this.metalnessMap && this.metalnessMap.isTexture ) data.metalnessMap = this.metalnessMap.toJSON( meta ).uuid;\n\n\t\tif ( this.emissiveMap && this.emissiveMap.isTexture ) data.emissiveMap = this.emissiveMap.toJSON( meta ).uuid;\n\t\tif ( this.specularMap && this.specularMap.isTexture ) data.specularMap = this.specularMap.toJSON( meta ).uuid;\n\t\tif ( this.specularIntensityMap && this.specularIntensityMap.isTexture ) data.specularIntensityMap = this.specularIntensityMap.toJSON( meta ).uuid;\n\t\tif ( this.specularColorMap && this.specularColorMap.isTexture ) data.specularColorMap = this.specularColorMap.toJSON( meta ).uuid;\n\n\t\tif ( this.envMap && this.envMap.isTexture ) {\n\n\t\t\tdata.envMap = this.envMap.toJSON( meta ).uuid;\n\n\t\t\tif ( this.combine !== undefined ) data.combine = this.combine;\n\n\t\t}\n\n\t\tif ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();\n\t\tif ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;\n\t\tif ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;\n\t\tif ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;\n\n\t\tif ( this.gradientMap && this.gradientMap.isTexture ) {\n\n\t\t\tdata.gradientMap = this.gradientMap.toJSON( meta ).uuid;\n\n\t\t}\n\n\t\tif ( this.transmission !== undefined ) data.transmission = this.transmission;\n\t\tif ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;\n\t\tif ( this.thickness !== undefined ) data.thickness = this.thickness;\n\t\tif ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;\n\t\tif ( this.attenuationDistance !== undefined && this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance;\n\t\tif ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();\n\n\t\tif ( this.size !== undefined ) data.size = this.size;\n\t\tif ( this.shadowSide !== null ) data.shadowSide = this.shadowSide;\n\t\tif ( this.sizeAttenuation !== undefined ) data.sizeAttenuation = this.sizeAttenuation;\n\n\t\tif ( this.blending !== NormalBlending ) data.blending = this.blending;\n\t\tif ( this.side !== FrontSide ) data.side = this.side;\n\t\tif ( this.vertexColors === true ) data.vertexColors = true;\n\n\t\tif ( this.opacity < 1 ) data.opacity = this.opacity;\n\t\tif ( this.transparent === true ) data.transparent = true;\n\n\t\tif ( this.blendSrc !== SrcAlphaFactor ) data.blendSrc = this.blendSrc;\n\t\tif ( this.blendDst !== OneMinusSrcAlphaFactor ) data.blendDst = this.blendDst;\n\t\tif ( this.blendEquation !== AddEquation ) data.blendEquation = this.blendEquation;\n\t\tif ( this.blendSrcAlpha !== null ) data.blendSrcAlpha = this.blendSrcAlpha;\n\t\tif ( this.blendDstAlpha !== null ) data.blendDstAlpha = this.blendDstAlpha;\n\t\tif ( this.blendEquationAlpha !== null ) data.blendEquationAlpha = this.blendEquationAlpha;\n\t\tif ( this.blendColor && this.blendColor.isColor ) data.blendColor = this.blendColor.getHex();\n\t\tif ( this.blendAlpha !== 0 ) data.blendAlpha = this.blendAlpha;\n\n\t\tif ( this.depthFunc !== LessEqualDepth ) data.depthFunc = this.depthFunc;\n\t\tif ( this.depthTest === false ) data.depthTest = this.depthTest;\n\t\tif ( this.depthWrite === false ) data.depthWrite = this.depthWrite;\n\t\tif ( this.colorWrite === false ) data.colorWrite = this.colorWrite;\n\n\t\tif ( this.stencilWriteMask !== 0xff ) data.stencilWriteMask = this.stencilWriteMask;\n\t\tif ( this.stencilFunc !== AlwaysStencilFunc ) data.stencilFunc = this.stencilFunc;\n\t\tif ( this.stencilRef !== 0 ) data.stencilRef = this.stencilRef;\n\t\tif ( this.stencilFuncMask !== 0xff ) data.stencilFuncMask = this.stencilFuncMask;\n\t\tif ( this.stencilFail !== KeepStencilOp ) data.stencilFail = this.stencilFail;\n\t\tif ( this.stencilZFail !== KeepStencilOp ) data.stencilZFail = this.stencilZFail;\n\t\tif ( this.stencilZPass !== KeepStencilOp ) data.stencilZPass = this.stencilZPass;\n\t\tif ( this.stencilWrite === true ) data.stencilWrite = this.stencilWrite;\n\n\t\t// rotation (SpriteMaterial)\n\t\tif ( this.rotation !== undefined && this.rotation !== 0 ) data.rotation = this.rotation;\n\n\t\tif ( this.polygonOffset === true ) data.polygonOffset = true;\n\t\tif ( this.polygonOffsetFactor !== 0 ) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\tif ( this.polygonOffsetUnits !== 0 ) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\n\t\tif ( this.linewidth !== undefined && this.linewidth !== 1 ) data.linewidth = this.linewidth;\n\t\tif ( this.dashSize !== undefined ) data.dashSize = this.dashSize;\n\t\tif ( this.gapSize !== undefined ) data.gapSize = this.gapSize;\n\t\tif ( this.scale !== undefined ) data.scale = this.scale;\n\n\t\tif ( this.dithering === true ) data.dithering = true;\n\n\t\tif ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;\n\t\tif ( this.alphaHash === true ) data.alphaHash = true;\n\t\tif ( this.alphaToCoverage === true ) data.alphaToCoverage = true;\n\t\tif ( this.premultipliedAlpha === true ) data.premultipliedAlpha = true;\n\t\tif ( this.forceSinglePass === true ) data.forceSinglePass = true;\n\n\t\tif ( this.wireframe === true ) data.wireframe = true;\n\t\tif ( this.wireframeLinewidth > 1 ) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\tif ( this.wireframeLinecap !== 'round' ) data.wireframeLinecap = this.wireframeLinecap;\n\t\tif ( this.wireframeLinejoin !== 'round' ) data.wireframeLinejoin = this.wireframeLinejoin;\n\n\t\tif ( this.flatShading === true ) data.flatShading = true;\n\n\t\tif ( this.visible === false ) data.visible = false;\n\n\t\tif ( this.toneMapped === false ) data.toneMapped = false;\n\n\t\tif ( this.fog === false ) data.fog = false;\n\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\t// TODO: Copied from Object3D.toJSON\n\n\t\tfunction extractFromCache( cache ) {\n\n\t\t\tconst values = [];\n\n\t\t\tfor ( const key in cache ) {\n\n\t\t\t\tconst data = cache[ key ];\n\t\t\t\tdelete data.metadata;\n\t\t\t\tvalues.push( data );\n\n\t\t\t}\n\n\t\t\treturn values;\n\n\t\t}\n\n\t\tif ( isRootObject ) {\n\n\t\t\tconst textures = extractFromCache( meta.textures );\n\t\t\tconst images = extractFromCache( meta.images );\n\n\t\t\tif ( textures.length > 0 ) data.textures = textures;\n\t\t\tif ( images.length > 0 ) data.images = images;\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Returns a new material with copied values from this instance.\n\t *\n\t * @return {Material} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given material to this instance.\n\t *\n\t * @param {Material} source - The material to copy.\n\t * @return {Material} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\n\t\tthis.blending = source.blending;\n\t\tthis.side = source.side;\n\t\tthis.vertexColors = source.vertexColors;\n\n\t\tthis.opacity = source.opacity;\n\t\tthis.transparent = source.transparent;\n\n\t\tthis.blendSrc = source.blendSrc;\n\t\tthis.blendDst = source.blendDst;\n\t\tthis.blendEquation = source.blendEquation;\n\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\tthis.blendColor.copy( source.blendColor );\n\t\tthis.blendAlpha = source.blendAlpha;\n\n\t\tthis.depthFunc = source.depthFunc;\n\t\tthis.depthTest = source.depthTest;\n\t\tthis.depthWrite = source.depthWrite;\n\n\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\tthis.stencilFunc = source.stencilFunc;\n\t\tthis.stencilRef = source.stencilRef;\n\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\tthis.stencilFail = source.stencilFail;\n\t\tthis.stencilZFail = source.stencilZFail;\n\t\tthis.stencilZPass = source.stencilZPass;\n\t\tthis.stencilWrite = source.stencilWrite;\n\n\t\tconst srcPlanes = source.clippingPlanes;\n\t\tlet dstPlanes = null;\n\n\t\tif ( srcPlanes !== null ) {\n\n\t\t\tconst n = srcPlanes.length;\n\t\t\tdstPlanes = new Array( n );\n\n\t\t\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\t\t\tdstPlanes[ i ] = srcPlanes[ i ].clone();\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.clippingPlanes = dstPlanes;\n\t\tthis.clipIntersection = source.clipIntersection;\n\t\tthis.clipShadows = source.clipShadows;\n\n\t\tthis.shadowSide = source.shadowSide;\n\n\t\tthis.colorWrite = source.colorWrite;\n\n\t\tthis.precision = source.precision;\n\n\t\tthis.polygonOffset = source.polygonOffset;\n\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\n\t\tthis.dithering = source.dithering;\n\n\t\tthis.alphaTest = source.alphaTest;\n\t\tthis.alphaHash = source.alphaHash;\n\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\tthis.forceSinglePass = source.forceSinglePass;\n\n\t\tthis.visible = source.visible;\n\n\t\tthis.toneMapped = source.toneMapped;\n\n\t\tthis.userData = JSON.parse( JSON.stringify( source.userData ) );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Material#dispose\n\t */\n\tdispose() {\n\n\t\t/**\n\t\t * Fires when the material has been disposed of.\n\t\t *\n\t\t * @event Material#dispose\n\t\t * @type {Object}\n\t\t */\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Setting this property to `true` indicates the engine the material\n\t * needs to be recompiled.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n}\n\n/**\n * A material for drawing geometries in a simple shaded (flat or wireframe) way.\n *\n * This material is not affected by lights.\n *\n * @augments Material\n */\nclass MeshBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf\n\nconst _tables = /*@__PURE__*/ _generateTables();\n\nfunction _generateTables() {\n\n\t// float32 to float16 helpers\n\n\tconst buffer = new ArrayBuffer( 4 );\n\tconst floatView = new Float32Array( buffer );\n\tconst uint32View = new Uint32Array( buffer );\n\n\tconst baseTable = new Uint32Array( 512 );\n\tconst shiftTable = new Uint32Array( 512 );\n\n\tfor ( let i = 0; i < 256; ++ i ) {\n\n\t\tconst e = i - 127;\n\n\t\t// very small number (0, -0)\n\n\t\tif ( e < -27 ) {\n\n\t\t\tbaseTable[ i ] = 0x0000;\n\t\t\tbaseTable[ i | 0x100 ] = 0x8000;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// small number (denorm)\n\n\t\t} else if ( e < -14 ) {\n\n\t\t\tbaseTable[ i ] = 0x0400 >> ( - e - 14 );\n\t\t\tbaseTable[ i | 0x100 ] = ( 0x0400 >> ( - e - 14 ) ) | 0x8000;\n\t\t\tshiftTable[ i ] = - e - 1;\n\t\t\tshiftTable[ i | 0x100 ] = - e - 1;\n\n\t\t\t// normal number\n\n\t\t} else if ( e <= 15 ) {\n\n\t\t\tbaseTable[ i ] = ( e + 15 ) << 10;\n\t\t\tbaseTable[ i | 0x100 ] = ( ( e + 15 ) << 10 ) | 0x8000;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t\t// large number (Infinity, -Infinity)\n\n\t\t} else if ( e < 128 ) {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 24;\n\t\t\tshiftTable[ i | 0x100 ] = 24;\n\n\t\t\t// stay (NaN, Infinity, -Infinity)\n\n\t\t} else {\n\n\t\t\tbaseTable[ i ] = 0x7c00;\n\t\t\tbaseTable[ i | 0x100 ] = 0xfc00;\n\t\t\tshiftTable[ i ] = 13;\n\t\t\tshiftTable[ i | 0x100 ] = 13;\n\n\t\t}\n\n\t}\n\n\t// float16 to float32 helpers\n\n\tconst mantissaTable = new Uint32Array( 2048 );\n\tconst exponentTable = new Uint32Array( 64 );\n\tconst offsetTable = new Uint32Array( 64 );\n\n\tfor ( let i = 1; i < 1024; ++ i ) {\n\n\t\tlet m = i << 13; // zero pad mantissa bits\n\t\tlet e = 0; // zero exponent\n\n\t\t// normalized\n\t\twhile ( ( m & 0x00800000 ) === 0 ) {\n\n\t\t\tm <<= 1;\n\t\t\te -= 0x00800000; // decrement exponent\n\n\t\t}\n\n\t\tm &= -8388609; // clear leading 1 bit\n\t\te += 0x38800000; // adjust bias\n\n\t\tmantissaTable[ i ] = m | e;\n\n\t}\n\n\tfor ( let i = 1024; i < 2048; ++ i ) {\n\n\t\tmantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) << 13 );\n\n\t}\n\n\tfor ( let i = 1; i < 31; ++ i ) {\n\n\t\texponentTable[ i ] = i << 23;\n\n\t}\n\n\texponentTable[ 31 ] = 0x47800000;\n\texponentTable[ 32 ] = 0x80000000;\n\n\tfor ( let i = 33; i < 63; ++ i ) {\n\n\t\texponentTable[ i ] = 0x80000000 + ( ( i - 32 ) << 23 );\n\n\t}\n\n\texponentTable[ 63 ] = 0xc7800000;\n\n\tfor ( let i = 1; i < 64; ++ i ) {\n\n\t\tif ( i !== 32 ) {\n\n\t\t\toffsetTable[ i ] = 1024;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tfloatView: floatView,\n\t\tuint32View: uint32View,\n\t\tbaseTable: baseTable,\n\t\tshiftTable: shiftTable,\n\t\tmantissaTable: mantissaTable,\n\t\texponentTable: exponentTable,\n\t\toffsetTable: offsetTable\n\t};\n\n}\n\n/**\n * Returns a half precision floating point value (FP16) from the given single\n * precision floating point value (FP32).\n *\n * @param {number} val - A single precision floating point value.\n * @return {number} The FP16 value.\n */\nfunction toHalfFloat( val ) {\n\n\tif ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' );\n\n\tval = clamp( val, -65504, 65504 );\n\n\t_tables.floatView[ 0 ] = val;\n\tconst f = _tables.uint32View[ 0 ];\n\tconst e = ( f >> 23 ) & 0x1ff;\n\treturn _tables.baseTable[ e ] + ( ( f & 0x007fffff ) >> _tables.shiftTable[ e ] );\n\n}\n\n/**\n * Returns a single precision floating point value (FP32) from the given half\n * precision floating point value (FP16).\n *\n * @param {number} val - A half precision floating point value.\n * @return {number} The FP32 value.\n */\nfunction fromHalfFloat( val ) {\n\n\tconst m = val >> 10;\n\t_tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val & 0x3ff ) ] + _tables.exponentTable[ m ];\n\treturn _tables.floatView[ 0 ];\n\n}\n\n/**\n * A class containing utility functions for data.\n *\n * @hideconstructor\n */\nclass DataUtils {\n\n\t/**\n\t * Returns a half precision floating point value (FP16) from the given single\n\t * precision floating point value (FP32).\n\t *\n\t * @param {number} val - A single precision floating point value.\n\t * @return {number} The FP16 value.\n\t */\n\tstatic toHalfFloat( val ) {\n\n\t\treturn toHalfFloat( val );\n\n\t}\n\n\t/**\n\t * Returns a single precision floating point value (FP32) from the given half\n\t * precision floating point value (FP16).\n\t *\n\t * @param {number} val - A half precision floating point value.\n\t * @return {number} The FP32 value.\n\t */\n\tstatic fromHalfFloat( val ) {\n\n\t\treturn fromHalfFloat( val );\n\n\t}\n\n}\n\nconst _vector$9 = /*@__PURE__*/ new Vector3();\nconst _vector2$1 = /*@__PURE__*/ new Vector2();\n\nlet _id$2 = 0;\n\n/**\n * This class stores data for an attribute (such as vertex positions, face\n * indices, normals, colors, UVs, and any custom attributes ) associated with\n * a geometry, which allows for more efficient passing of data to the GPU.\n *\n * When working with vector-like data, the `fromBufferAttribute( attribute, index )`\n * helper methods on vector and color class might be helpful. E.g. {@link Vector3#fromBufferAttribute}.\n */\nclass BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {TypedArray} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized = false ) {\n\n\t\tif ( Array.isArray( array ) ) {\n\n\t\t\tthrow new TypeError( 'THREE.BufferAttribute: array should be a Typed Array.' );\n\n\t\t}\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBufferAttribute = true;\n\n\t\t/**\n\t\t * The ID of the buffer attribute.\n\t\t *\n\t\t * @name BufferAttribute#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id$2 ++ } );\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The array holding the attribute data. It should have `itemSize * numVertices`\n\t\t * elements, where `numVertices` is the number of vertices in the associated geometry.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.array = array;\n\n\t\t/**\n\t\t * The number of values of the array that should be associated with a particular vertex.\n\t\t * For instance, if this attribute is storing a 3-component vector (such as a position,\n\t\t * normal, or color), then the value should be `3`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * Represents the number of items this buffer attribute stores. It is internally computed\n\t\t * by dividing the `array` length by the `itemSize`.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\n\t\t/**\n\t\t * Applies to integer data only. Indicates how the underlying data in the buffer maps to\n\t\t * the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`,\n\t\t * and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to\n\t\t * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted\n\t\t * to floats unmodified, i.e. `65535` becomes `65535.0f`.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t\t/**\n\t\t * Defines the intended usage pattern of the data store for optimization purposes.\n\t\t *\n\t\t * Note: After the initial use of a buffer, its usage cannot be changed. Instead,\n\t\t * instantiate a new one and set the desired usage before the next render.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * This can be used to only update some components of stored vectors (for example, just the\n\t\t * component related to color). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * Configures the bound GPU type for use in shaders.\n\t\t *\n\t\t * Note: this only has an effect for integer arrays and is not configurable for float arrays.\n\t\t * For lower precision float types, use `Float16BufferAttribute`.\n\t\t *\n\t\t * @type {(FloatType|IntType)}\n\t\t * @default FloatType\n\t\t */\n\t\tthis.gpuType = FloatType;\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * A callback function that is executed after the renderer has transferred the attribute\n\t * array data to the GPU.\n\t */\n\tonUploadCallback() {}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the usage of this buffer attribute.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {BufferAttribute} A reference to this buffer attribute.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data array to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Copies the values of the given buffer attribute to this instance.\n\t *\n\t * @param {BufferAttribute} source - The buffer attribute to copy.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.itemSize = source.itemSize;\n\t\tthis.count = source.count;\n\t\tthis.normalized = source.normalized;\n\n\t\tthis.usage = source.usage;\n\t\tthis.gpuType = source.gpuType;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies a vector from the given buffer attribute to this one. The start\n\t * and destination position in the attribute buffers are represented by the\n\t * given indices.\n\t *\n\t * @param {number} index1 - The destination index into this buffer attribute.\n\t * @param {BufferAttribute} attribute - The buffer attribute to copy from.\n\t * @param {number} index2 - The source index into the given buffer attribute.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopyAt( index1, attribute, index2 ) {\n\n\t\tindex1 *= this.itemSize;\n\t\tindex2 *= attribute.itemSize;\n\n\t\tfor ( let i = 0, l = this.itemSize; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = attribute.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the given array data into this buffer attribute.\n\t *\n\t * @param {(TypedArray|Array)} array - The array to copy.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tcopyArray( array ) {\n\n\t\tthis.array.set( array );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 matrix to the given attribute. Works with\n\t * item size `2` and `3`.\n\t *\n\t * @param {Matrix3} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix3( m ) {\n\n\t\tif ( this.itemSize === 2 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector2$1.fromBufferAttribute( this, i );\n\t\t\t\t_vector2$1.applyMatrix3( m );\n\n\t\t\t\tthis.setXY( i, _vector2$1.x, _vector2$1.y );\n\n\t\t\t}\n\n\t\t} else if ( this.itemSize === 3 ) {\n\n\t\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t\t_vector$9.fromBufferAttribute( this, i );\n\t\t\t\t_vector$9.applyMatrix3( m );\n\n\t\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 normal matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix3} m - The normal matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3` and with direction vectors.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$9.fromBufferAttribute( this, i );\n\n\t\t\t_vector$9.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$9.x, _vector$9.y, _vector$9.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given array data in the buffer attribute.\n\t *\n\t * @param {(TypedArray|Array)} value - The array data to set.\n\t * @param {number} [offset=0] - The offset in this buffer attribute's array.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tset( value, offset = 0 ) {\n\n\t\t// Matching BufferAttribute constructor, do not normalize the array.\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @return {number} The returned value.\n\t */\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.itemSize + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\t/**\n\t * Sets the given value to the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @param {number} value - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.array[ index * this.itemSize + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The x component.\n\t */\n\tgetX( index ) {\n\n\t\tlet x = this.array[ index * this.itemSize ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\t/**\n\t * Sets the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The y component.\n\t */\n\tgetY( index ) {\n\n\t\tlet y = this.array[ index * this.itemSize + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\t/**\n\t * Sets the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} y - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The z component.\n\t */\n\tgetZ( index ) {\n\n\t\tlet z = this.array[ index * this.itemSize + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\t/**\n\t * Sets the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} z - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The w component.\n\t */\n\tgetW( index ) {\n\n\t\tlet w = this.array[ index * this.itemSize + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\t/**\n\t * Sets the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} w - The value to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x and y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y, z and w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @param {number} w - The value for the w component to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = x;\n\t\tthis.array[ index + 1 ] = y;\n\t\tthis.array[ index + 2 ] = z;\n\t\tthis.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given callback function that is executed after the Renderer has transferred\n\t * the attribute array data to the GPU. Can be used to perform clean-up operations after\n\t * the upload when attribute data are not needed anymore on the CPU side.\n\t *\n\t * @param {Function} callback - The `onUpload()` callback.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new buffer attribute with copied values from this instance.\n\t *\n\t * @return {BufferAttribute} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.array, this.itemSize ).copy( this );\n\n\t}\n\n\t/**\n\t * Serializes the buffer attribute into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized buffer attribute.\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\titemSize: this.itemSize,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tarray: Array.from( this.array ),\n\t\t\tnormalized: this.normalized\n\t\t};\n\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( this.usage !== StaticDrawUsage ) data.usage = this.usage;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int8` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int8BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Int8Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt8` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint8BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Uint8Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt8Clamped` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Uint8ClampedArray)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint8ClampedArray( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int16` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Int16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt16` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Uint16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Int32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Int32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Int32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Int32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `UInt32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Uint32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Uint32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Float16` buffer attribute with\n * a plain `Array` instance.\n *\n * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array`\n * browser support is still problematic.\n *\n * @augments BufferAttribute\n */\nclass Float16BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Uint16Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Uint16Array( array ), itemSize, normalized );\n\n\t\tthis.isFloat16BufferAttribute = true;\n\n\t}\n\n\tgetX( index ) {\n\n\t\tlet x = fromHalfFloat( this.array[ index * this.itemSize ] );\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.array[ index * this.itemSize ] = toHalfFloat( x );\n\n\t\treturn this;\n\n\t}\n\n\tgetY( index ) {\n\n\t\tlet y = fromHalfFloat( this.array[ index * this.itemSize + 1 ] );\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.array[ index * this.itemSize + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tgetZ( index ) {\n\n\t\tlet z = fromHalfFloat( this.array[ index * this.itemSize + 2 ] );\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.array[ index * this.itemSize + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tgetW( index ) {\n\n\t\tlet w = fromHalfFloat( this.array[ index * this.itemSize + 3 ] );\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.array[ index * this.itemSize + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n\tsetXY( index, x, y ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\n\t\treturn this;\n\n\t}\n\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex *= this.itemSize;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.array[ index + 0 ] = toHalfFloat( x );\n\t\tthis.array[ index + 1 ] = toHalfFloat( y );\n\t\tthis.array[ index + 2 ] = toHalfFloat( z );\n\t\tthis.array[ index + 3 ] = toHalfFloat( w );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Convenient class that can be used when creating a `Float32` buffer attribute with\n * a plain `Array` instance.\n *\n * @augments BufferAttribute\n */\nclass Float32BufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new buffer attribute.\n\t *\n\t * @param {(Array<number>|Float32Array)} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( array, itemSize, normalized ) {\n\n\t\tsuper( new Float32Array( array ), itemSize, normalized );\n\n\t}\n\n}\n\nlet _id$1 = 0;\n\nconst _m1 = /*@__PURE__*/ new Matrix4();\nconst _obj = /*@__PURE__*/ new Object3D();\nconst _offset = /*@__PURE__*/ new Vector3();\nconst _box$2 = /*@__PURE__*/ new Box3();\nconst _boxMorphTargets = /*@__PURE__*/ new Box3();\nconst _vector$8 = /*@__PURE__*/ new Vector3();\n\n/**\n * A representation of mesh, line, or point geometry. Includes vertex\n * positions, face indices, normals, colors, UVs, and custom attributes\n * within buffers, reducing the cost of passing all this data to the GPU.\n *\n * ```js\n * const geometry = new THREE.BufferGeometry();\n * // create a simple square shape. We duplicate the top left and bottom right\n * // vertices because each vertex needs to appear once per triangle.\n * const vertices = new Float32Array( [\n * \t-1.0, -1.0,  1.0, // v0\n * \t 1.0, -1.0,  1.0, // v1\n * \t 1.0,  1.0,  1.0, // v2\n *\n * \t 1.0,  1.0,  1.0, // v3\n * \t-1.0,  1.0,  1.0, // v4\n * \t-1.0, -1.0,  1.0  // v5\n * ] );\n * // itemSize = 3 because there are 3 values (components) per vertex\n * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );\n * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * ```\n *\n * @augments EventDispatcher\n */\nclass BufferGeometry extends EventDispatcher {\n\n\t/**\n\t * Constructs a new geometry.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBufferGeometry = true;\n\n\t\t/**\n\t\t * The ID of the geometry.\n\t\t *\n\t\t * @name BufferGeometry#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id$1 ++ } );\n\n\t\t/**\n\t\t * The UUID of the geometry.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * The name of the geometry.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\t\tthis.type = 'BufferGeometry';\n\n\t\t/**\n\t\t * Allows for vertices to be re-used across multiple triangles; this is\n\t\t * called using \"indexed triangles\". Each triangle is associated with the\n\t\t * indices of three vertices. This attribute therefore stores the index of\n\t\t * each vertex for each triangular face. If this attribute is not set, the\n\t\t * renderer assumes that each three contiguous positions represent a single triangle.\n\t\t *\n\t\t * @type {?BufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.index = null;\n\n\t\t/**\n\t\t * A (storage) buffer attribute which was generated with a compute shader and\n\t\t * now defines indirect draw calls.\n\t\t *\n\t\t * Can only be used with {@link WebGPURenderer} and a WebGPU backend.\n\t\t *\n\t\t * @type {?BufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.indirect = null;\n\n\t\t/**\n\t\t * This dictionary has as id the name of the attribute to be set and as value\n\t\t * the buffer attribute to set it to. Rather than accessing this property directly,\n\t\t * use `setAttribute()` and `getAttribute()` to access attributes of this geometry.\n\t\t *\n\t\t * @type {Object<string,(BufferAttribute|InterleavedBufferAttribute)>}\n\t\t */\n\t\tthis.attributes = {};\n\n\t\t/**\n\t\t * This dictionary holds the morph targets of the geometry.\n\t\t *\n\t\t * Note: Once the geometry has been rendered, the morph attribute data cannot\n\t\t * be changed. You will have to call `dispose()?, and create a new geometry instance.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.morphAttributes = {};\n\n\t\t/**\n\t\t * Used to control the morph target behavior; when set to `true`, the morph\n\t\t * target data is treated as relative offsets, rather than as absolute\n\t\t * positions/normals.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.morphTargetsRelative = false;\n\n\t\t/**\n\t\t * Split the geometry into groups, each of which will be rendered in a\n\t\t * separate draw call. This allows an array of materials to be used with the geometry.\n\t\t *\n\t\t * Use `addGroup()` and `clearGroups()` to edit groups, rather than modifying this array directly.\n\t\t *\n\t\t * Every vertex and index must belong to exactly one group — groups must not share vertices or\n\t\t * indices, and must not leave vertices or indices unused.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.groups = [];\n\n\t\t/**\n\t\t * Bounding box for the geometry which can be calculated with `computeBoundingBox()`.\n\t\t *\n\t\t * @type {Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`.\n\t\t *\n\t\t * @type {Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\t/**\n\t\t * Determines the part of the geometry to render. This should not be set directly,\n\t\t * instead use `setDrawRange()`.\n\t\t *\n\t\t * @type {{start:number,count:number}}\n\t\t */\n\t\tthis.drawRange = { start: 0, count: Infinity };\n\n\t\t/**\n\t\t * An object that can be used to store custom data about the geometry.\n\t\t * It should not hold references to functions as these will not be cloned.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.userData = {};\n\n\t}\n\n\t/**\n\t * Returns the index of this geometry.\n\t *\n\t * @return {?BufferAttribute} The index. Returns `null` if no index is defined.\n\t */\n\tgetIndex() {\n\n\t\treturn this.index;\n\n\t}\n\n\t/**\n\t * Sets the given index to this geometry.\n\t *\n\t * @param {Array<number>|BufferAttribute} index - The index to set.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetIndex( index ) {\n\n\t\tif ( Array.isArray( index ) ) {\n\n\t\t\tthis.index = new ( arrayNeedsUint32( index ) ? Uint32BufferAttribute : Uint16BufferAttribute )( index, 1 );\n\n\t\t} else {\n\n\t\t\tthis.index = index;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given indirect attribute to this geometry.\n\t *\n\t * @param {BufferAttribute} indirect - The attribute holding indirect draw calls.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetIndirect( indirect ) {\n\n\t\tthis.indirect = indirect;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the indirect attribute of this geometry.\n\t *\n\t * @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined.\n\t */\n\tgetIndirect() {\n\n\t\treturn this.indirect;\n\n\t}\n\n\t/**\n\t * Returns the buffer attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute.\n\t * Returns `undefined` if not attribute has been found.\n\t */\n\tgetAttribute( name ) {\n\n\t\treturn this.attributes[ name ];\n\n\t}\n\n\t/**\n\t * Sets the given attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetAttribute( name, attribute ) {\n\n\t\tthis.attributes[ name ] = attribute;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Deletes the attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name to delete.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tdeleteAttribute( name ) {\n\n\t\tdelete this.attributes[ name ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this geometry has an attribute for the given name.\n\t *\n\t * @param {string} name - The attribute name.\n\t * @return {boolean} Whether this geometry has an attribute for the given name or not.\n\t */\n\thasAttribute( name ) {\n\n\t\treturn this.attributes[ name ] !== undefined;\n\n\t}\n\n\t/**\n\t * Adds a group to this geometry.\n\t *\n\t * @param {number} start - The first element in this draw call. That is the first\n\t * vertex for non-indexed geometry, otherwise the first triangle index.\n\t * @param {number} count - Specifies how many vertices (or indices) are part of this group.\n\t * @param {number} [materialIndex=0] - The material array index to use.\n\t */\n\taddGroup( start, count, materialIndex = 0 ) {\n\n\t\tthis.groups.push( {\n\n\t\t\tstart: start,\n\t\t\tcount: count,\n\t\t\tmaterialIndex: materialIndex\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * Clears all groups.\n\t */\n\tclearGroups() {\n\n\t\tthis.groups = [];\n\n\t}\n\n\t/**\n\t * Sets the draw range for this geometry.\n\t *\n\t * @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index.\n\t * @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render.\n\t * For indexed BufferGeometry, `count` is the number of indices to render.\n\t */\n\tsetDrawRange( start, count ) {\n\n\t\tthis.drawRange.start = start;\n\t\tthis.drawRange.count = count;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 transformation matrix to the geometry.\n\t *\n\t * @param {Matrix4} matrix - The matrix to apply.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tconst position = this.attributes.position;\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tposition.applyMatrix4( matrix );\n\n\t\t\tposition.needsUpdate = true;\n\n\t\t}\n\n\t\tconst normal = this.attributes.normal;\n\n\t\tif ( normal !== undefined ) {\n\n\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix( matrix );\n\n\t\t\tnormal.applyNormalMatrix( normalMatrix );\n\n\t\t\tnormal.needsUpdate = true;\n\n\t\t}\n\n\t\tconst tangent = this.attributes.tangent;\n\n\t\tif ( tangent !== undefined ) {\n\n\t\t\ttangent.transformDirection( matrix );\n\n\t\t\ttangent.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tthis.computeBoundingBox();\n\n\t\t}\n\n\t\tif ( this.boundingSphere !== null ) {\n\n\t\t\tthis.computeBoundingSphere();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the rotation represented by the Quaternion to the geometry.\n\t *\n\t * @param {Quaternion} q - The Quaternion to apply.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tapplyQuaternion( q ) {\n\n\t\t_m1.makeRotationFromQuaternion( q );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the X axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateX( angle ) {\n\n\t\t// rotate geometry around world x-axis\n\n\t\t_m1.makeRotationX( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the Y axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateY( angle ) {\n\n\t\t// rotate geometry around world y-axis\n\n\t\t_m1.makeRotationY( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry about the Z axis. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#rotation} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} angle - The angle in radians.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\trotateZ( angle ) {\n\n\t\t// rotate geometry around world z-axis\n\n\t\t_m1.makeRotationZ( angle );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the geometry. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#position} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} x - The x offset.\n\t * @param {number} y - The y offset.\n\t * @param {number} z - The z offset.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\ttranslate( x, y, z ) {\n\n\t\t// translate geometry\n\n\t\t_m1.makeTranslation( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales the geometry. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#scale} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {number} x - The x scale.\n\t * @param {number} y - The y scale.\n\t * @param {number} z - The z scale.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tscale( x, y, z ) {\n\n\t\t// scale geometry\n\n\t\t_m1.makeScale( x, y, z );\n\n\t\tthis.applyMatrix4( _m1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Rotates the geometry to face a point in 3D space. This is typically done as a one time\n\t * operation, and not during a loop. Use {@link Object3D#lookAt} for typical\n\t * real-time mesh rotation.\n\t *\n\t * @param {Vector3} vector - The target point.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tlookAt( vector ) {\n\n\t\t_obj.lookAt( vector );\n\n\t\t_obj.updateMatrix();\n\n\t\tthis.applyMatrix4( _obj.matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Center the geometry based on its bounding box.\n\t *\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tcenter() {\n\n\t\tthis.computeBoundingBox();\n\n\t\tthis.boundingBox.getCenter( _offset ).negate();\n\n\t\tthis.translate( _offset.x, _offset.y, _offset.z );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Defines a geometry by creating a `position` attribute based on the given array of points. The array\n\t * can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is\n\t * set to `0`.\n\t *\n\t * If the method is used with an existing `position` attribute, the vertex data are overwritten with the\n\t * data from the array. The length of the array must match the vertex count.\n\t *\n\t * @param {Array<Vector2>|Array<Vector3>} points - The points.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute === undefined ) {\n\n\t\t\tconst position = [];\n\n\t\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tposition.push( point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( position, 3 ) );\n\n\t\t} else {\n\n\t\t\tconst l = Math.min( points.length, positionAttribute.count ); // make sure data do not exceed buffer size\n\n\t\t\tfor ( let i = 0; i < l; i ++ ) {\n\n\t\t\t\tconst point = points[ i ];\n\t\t\t\tpositionAttribute.setXYZ( i, point.x, point.y, point.z || 0 );\n\n\t\t\t}\n\n\t\t\tif ( points.length > positionAttribute.count ) {\n\n\t\t\t\tconsole.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );\n\n\t\t\t}\n\n\t\t\tpositionAttribute.needsUpdate = true;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the geometry, and updates the `boundingBox` member.\n\t * The bounding box is not computed by the engine; it must be computed by your app.\n\t * You may need to recompute the bounding box if the geometry vertices are modified.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );\n\n\t\t\tthis.boundingBox.set(\n\t\t\t\tnew Vector3( - Infinity, - Infinity, - Infinity ),\n\t\t\t\tnew Vector3( + Infinity, + Infinity, + Infinity )\n\t\t\t);\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position !== undefined ) {\n\n\t\t\tthis.boundingBox.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_box$2.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.min, _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( this.boundingBox.max, _box$2.max );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.min );\n\t\t\t\t\t\tthis.boundingBox.expandByPoint( _box$2.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthis.boundingBox.makeEmpty();\n\n\t\t}\n\n\t\tif ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the geometry, and updates the `boundingSphere` member.\n\t * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n\t * You may need to recompute the bounding sphere if the geometry vertices are modified.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst position = this.attributes.position;\n\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\tif ( position && position.isGLBufferAttribute ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );\n\n\t\t\tthis.boundingSphere.set( new Vector3(), Infinity );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( position ) {\n\n\t\t\t// first, find the center of the bounding sphere\n\n\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t_box$2.setFromBufferAttribute( position );\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute( morphAttribute );\n\n\t\t\t\t\tif ( this.morphTargetsRelative ) {\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.min, _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t\t_vector$8.addVectors( _box$2.max, _boxMorphTargets.max );\n\t\t\t\t\t\t_box$2.expandByPoint( _vector$8 );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.min );\n\t\t\t\t\t\t_box$2.expandByPoint( _boxMorphTargets.max );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_box$2.getCenter( center );\n\n\t\t\t// second, try to find a boundingSphere with a radius smaller than the\n\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor ( let i = 0, il = position.count; i < il; i ++ ) {\n\n\t\t\t\t_vector$8.fromBufferAttribute( position, i );\n\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t}\n\n\t\t\t// process morph attributes if present\n\n\t\t\tif ( morphAttributesPosition ) {\n\n\t\t\t\tfor ( let i = 0, il = morphAttributesPosition.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst morphAttribute = morphAttributesPosition[ i ];\n\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\tfor ( let j = 0, jl = morphAttribute.count; j < jl; j ++ ) {\n\n\t\t\t\t\t\t_vector$8.fromBufferAttribute( morphAttribute, j );\n\n\t\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t\t_offset.fromBufferAttribute( position, j );\n\t\t\t\t\t\t\t_vector$8.add( _offset );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$8 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.boundingSphere.radius = Math.sqrt( maxRadiusSq );\n\n\t\t\tif ( isNaN( this.boundingSphere.radius ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Calculates and adds a tangent attribute to this geometry.\n\t *\n\t * The computation is only supported for indexed geometries and if position, normal, and uv attributes\n\t * are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by\n\t * {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead.\n\t */\n\tcomputeTangents() {\n\n\t\tconst index = this.index;\n\t\tconst attributes = this.attributes;\n\n\t\t// based on http://www.terathon.com/code/tangent.html\n\t\t// (per vertex tangents)\n\n\t\tif ( index === null ||\n\t\t\t attributes.position === undefined ||\n\t\t\t attributes.normal === undefined ||\n\t\t\t attributes.uv === undefined ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst positionAttribute = attributes.position;\n\t\tconst normalAttribute = attributes.normal;\n\t\tconst uvAttribute = attributes.uv;\n\n\t\tif ( this.hasAttribute( 'tangent' ) === false ) {\n\n\t\t\tthis.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );\n\n\t\t}\n\n\t\tconst tangentAttribute = this.getAttribute( 'tangent' );\n\n\t\tconst tan1 = [], tan2 = [];\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\ttan1[ i ] = new Vector3();\n\t\t\ttan2[ i ] = new Vector3();\n\n\t\t}\n\n\t\tconst vA = new Vector3(),\n\t\t\tvB = new Vector3(),\n\t\t\tvC = new Vector3(),\n\n\t\t\tuvA = new Vector2(),\n\t\t\tuvB = new Vector2(),\n\t\t\tuvC = new Vector2(),\n\n\t\t\tsdir = new Vector3(),\n\t\t\ttdir = new Vector3();\n\n\t\tfunction handleTriangle( a, b, c ) {\n\n\t\t\tvA.fromBufferAttribute( positionAttribute, a );\n\t\t\tvB.fromBufferAttribute( positionAttribute, b );\n\t\t\tvC.fromBufferAttribute( positionAttribute, c );\n\n\t\t\tuvA.fromBufferAttribute( uvAttribute, a );\n\t\t\tuvB.fromBufferAttribute( uvAttribute, b );\n\t\t\tuvC.fromBufferAttribute( uvAttribute, c );\n\n\t\t\tvB.sub( vA );\n\t\t\tvC.sub( vA );\n\n\t\t\tuvB.sub( uvA );\n\t\t\tuvC.sub( uvA );\n\n\t\t\tconst r = 1.0 / ( uvB.x * uvC.y - uvC.x * uvB.y );\n\n\t\t\t// silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\tif ( ! isFinite( r ) ) return;\n\n\t\t\tsdir.copy( vB ).multiplyScalar( uvC.y ).addScaledVector( vC, - uvB.y ).multiplyScalar( r );\n\t\t\ttdir.copy( vC ).multiplyScalar( uvB.x ).addScaledVector( vB, - uvC.x ).multiplyScalar( r );\n\n\t\t\ttan1[ a ].add( sdir );\n\t\t\ttan1[ b ].add( sdir );\n\t\t\ttan1[ c ].add( sdir );\n\n\t\t\ttan2[ a ].add( tdir );\n\t\t\ttan2[ b ].add( tdir );\n\t\t\ttan2[ c ].add( tdir );\n\n\t\t}\n\n\t\tlet groups = this.groups;\n\n\t\tif ( groups.length === 0 ) {\n\n\t\t\tgroups = [ {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: index.count\n\t\t\t} ];\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleTriangle(\n\t\t\t\t\tindex.getX( j + 0 ),\n\t\t\t\t\tindex.getX( j + 1 ),\n\t\t\t\t\tindex.getX( j + 2 )\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst tmp = new Vector3(), tmp2 = new Vector3();\n\t\tconst n = new Vector3(), n2 = new Vector3();\n\n\t\tfunction handleVertex( v ) {\n\n\t\t\tn.fromBufferAttribute( normalAttribute, v );\n\t\t\tn2.copy( n );\n\n\t\t\tconst t = tan1[ v ];\n\n\t\t\t// Gram-Schmidt orthogonalize\n\n\t\t\ttmp.copy( t );\n\t\t\ttmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();\n\n\t\t\t// Calculate handedness\n\n\t\t\ttmp2.crossVectors( n2, t );\n\t\t\tconst test = tmp2.dot( tan2[ v ] );\n\t\t\tconst w = ( test < 0.0 ) ? -1 : 1.0;\n\n\t\t\ttangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );\n\n\t\t}\n\n\t\tfor ( let i = 0, il = groups.length; i < il; ++ i ) {\n\n\t\t\tconst group = groups[ i ];\n\n\t\t\tconst start = group.start;\n\t\t\tconst count = group.count;\n\n\t\t\tfor ( let j = start, jl = start + count; j < jl; j += 3 ) {\n\n\t\t\t\thandleVertex( index.getX( j + 0 ) );\n\t\t\t\thandleVertex( index.getX( j + 1 ) );\n\t\t\t\thandleVertex( index.getX( j + 2 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes vertex normals for the given vertex data. For indexed geometries, the method sets\n\t * each vertex normal to be the average of the face normals of the faces that share that vertex.\n\t * For non-indexed geometries, vertices are not shared, and the method sets each vertex normal\n\t * to be the same as the face normal.\n\t */\n\tcomputeVertexNormals() {\n\n\t\tconst index = this.index;\n\t\tconst positionAttribute = this.getAttribute( 'position' );\n\n\t\tif ( positionAttribute !== undefined ) {\n\n\t\t\tlet normalAttribute = this.getAttribute( 'normal' );\n\n\t\t\tif ( normalAttribute === undefined ) {\n\n\t\t\t\tnormalAttribute = new BufferAttribute( new Float32Array( positionAttribute.count * 3 ), 3 );\n\t\t\t\tthis.setAttribute( 'normal', normalAttribute );\n\n\t\t\t} else {\n\n\t\t\t\t// reset existing normals to zero\n\n\t\t\t\tfor ( let i = 0, il = normalAttribute.count; i < il; i ++ ) {\n\n\t\t\t\t\tnormalAttribute.setXYZ( i, 0, 0, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst pA = new Vector3(), pB = new Vector3(), pC = new Vector3();\n\t\t\tconst nA = new Vector3(), nB = new Vector3(), nC = new Vector3();\n\t\t\tconst cb = new Vector3(), ab = new Vector3();\n\n\t\t\t// indexed elements\n\n\t\t\tif ( index ) {\n\n\t\t\t\tfor ( let i = 0, il = index.count; i < il; i += 3 ) {\n\n\t\t\t\t\tconst vA = index.getX( i + 0 );\n\t\t\t\t\tconst vB = index.getX( i + 1 );\n\t\t\t\t\tconst vC = index.getX( i + 2 );\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, vA );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, vB );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, vC );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnA.fromBufferAttribute( normalAttribute, vA );\n\t\t\t\t\tnB.fromBufferAttribute( normalAttribute, vB );\n\t\t\t\t\tnC.fromBufferAttribute( normalAttribute, vC );\n\n\t\t\t\t\tnA.add( cb );\n\t\t\t\t\tnB.add( cb );\n\t\t\t\t\tnC.add( cb );\n\n\t\t\t\t\tnormalAttribute.setXYZ( vA, nA.x, nA.y, nA.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vB, nB.x, nB.y, nB.z );\n\t\t\t\t\tnormalAttribute.setXYZ( vC, nC.x, nC.y, nC.z );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\n\t\t\t\tfor ( let i = 0, il = positionAttribute.count; i < il; i += 3 ) {\n\n\t\t\t\t\tpA.fromBufferAttribute( positionAttribute, i + 0 );\n\t\t\t\t\tpB.fromBufferAttribute( positionAttribute, i + 1 );\n\t\t\t\t\tpC.fromBufferAttribute( positionAttribute, i + 2 );\n\n\t\t\t\t\tcb.subVectors( pC, pB );\n\t\t\t\t\tab.subVectors( pA, pB );\n\t\t\t\t\tcb.cross( ab );\n\n\t\t\t\t\tnormalAttribute.setXYZ( i + 0, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 1, cb.x, cb.y, cb.z );\n\t\t\t\t\tnormalAttribute.setXYZ( i + 2, cb.x, cb.y, cb.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.normalizeNormals();\n\n\t\t\tnormalAttribute.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Ensures every normal vector in a geometry will have a magnitude of `1`. This will\n\t * correct lighting on the geometry surfaces.\n\t */\n\tnormalizeNormals() {\n\n\t\tconst normals = this.attributes.normal;\n\n\t\tfor ( let i = 0, il = normals.count; i < il; i ++ ) {\n\n\t\t\t_vector$8.fromBufferAttribute( normals, i );\n\n\t\t\t_vector$8.normalize();\n\n\t\t\tnormals.setXYZ( i, _vector$8.x, _vector$8.y, _vector$8.z );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Return a new non-index version of this indexed geometry. If the geometry\n\t * is already non-indexed, the method is a NOOP.\n\t *\n\t * @return {BufferGeometry} The non-indexed version of this indexed geometry.\n\t */\n\ttoNonIndexed() {\n\n\t\tfunction convertBufferAttribute( attribute, indices ) {\n\n\t\t\tconst array = attribute.array;\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst normalized = attribute.normalized;\n\n\t\t\tconst array2 = new array.constructor( indices.length * itemSize );\n\n\t\t\tlet index = 0, index2 = 0;\n\n\t\t\tfor ( let i = 0, l = indices.length; i < l; i ++ ) {\n\n\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\tindex = indices[ i ] * attribute.data.stride + attribute.offset;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindex = indices[ i ] * itemSize;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\tarray2[ index2 ++ ] = array[ index ++ ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( array2, itemSize, normalized );\n\n\t\t}\n\n\t\t//\n\n\t\tif ( this.index === null ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tconst geometry2 = new BufferGeometry();\n\n\t\tconst indices = this.index.array;\n\t\tconst attributes = this.attributes;\n\n\t\t// attributes\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\n\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\tgeometry2.setAttribute( name, newAttribute );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = this.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst morphArray = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = morphAttribute[ i ];\n\n\t\t\t\tconst newAttribute = convertBufferAttribute( attribute, indices );\n\n\t\t\t\tmorphArray.push( newAttribute );\n\n\t\t\t}\n\n\t\t\tgeometry2.morphAttributes[ name ] = morphArray;\n\n\t\t}\n\n\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = this.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tgeometry2.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\treturn geometry2;\n\n\t}\n\n\t/**\n\t * Serializes the geometry into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized geometry.\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t}\n\t\t};\n\n\t\t// standard BufferGeometry serialization\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.type = this.type;\n\t\tif ( this.name !== '' ) data.name = this.name;\n\t\tif ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;\n\n\t\tif ( this.parameters !== undefined ) {\n\n\t\t\tconst parameters = this.parameters;\n\n\t\t\tfor ( const key in parameters ) {\n\n\t\t\t\tif ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];\n\n\t\t\t}\n\n\t\t\treturn data;\n\n\t\t}\n\n\t\t// for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\t\tdata.data = { attributes: {} };\n\n\t\tconst index = this.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tdata.data.index = {\n\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call( index.array )\n\t\t\t};\n\n\t\t}\n\n\t\tconst attributes = this.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\n\t\t\tdata.data.attributes[ key ] = attribute.toJSON( data.data );\n\n\t\t}\n\n\t\tconst morphAttributes = {};\n\t\tlet hasMorphAttributes = false;\n\n\t\tfor ( const key in this.morphAttributes ) {\n\n\t\t\tconst attributeArray = this.morphAttributes[ key ];\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\tconst attribute = attributeArray[ i ];\n\n\t\t\t\tarray.push( attribute.toJSON( data.data ) );\n\n\t\t\t}\n\n\t\t\tif ( array.length > 0 ) {\n\n\t\t\t\tmorphAttributes[ key ] = array;\n\n\t\t\t\thasMorphAttributes = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( hasMorphAttributes ) {\n\n\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t}\n\n\t\tconst groups = this.groups;\n\n\t\tif ( groups.length > 0 ) {\n\n\t\t\tdata.data.groups = JSON.parse( JSON.stringify( groups ) );\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tdata.data.boundingSphere = boundingSphere.toJSON();\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Returns a new geometry with copied values from this instance.\n\t *\n\t * @return {BufferGeometry} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given geometry to this instance.\n\t *\n\t * @param {BufferGeometry} source - The geometry to copy.\n\t * @return {BufferGeometry} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\t// reset\n\n\t\tthis.index = null;\n\t\tthis.attributes = {};\n\t\tthis.morphAttributes = {};\n\t\tthis.groups = [];\n\t\tthis.boundingBox = null;\n\t\tthis.boundingSphere = null;\n\n\t\t// used for storing cloned, shared data\n\n\t\tconst data = {};\n\n\t\t// name\n\n\t\tthis.name = source.name;\n\n\t\t// index\n\n\t\tconst index = source.index;\n\n\t\tif ( index !== null ) {\n\n\t\t\tthis.setIndex( index.clone() );\n\n\t\t}\n\n\t\t// attributes\n\n\t\tconst attributes = source.attributes;\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst attribute = attributes[ name ];\n\t\t\tthis.setAttribute( name, attribute.clone( data ) );\n\n\t\t}\n\n\t\t// morph attributes\n\n\t\tconst morphAttributes = source.morphAttributes;\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst array = [];\n\t\t\tconst morphAttribute = morphAttributes[ name ]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\tfor ( let i = 0, l = morphAttribute.length; i < l; i ++ ) {\n\n\t\t\t\tarray.push( morphAttribute[ i ].clone( data ) );\n\n\t\t\t}\n\n\t\t\tthis.morphAttributes[ name ] = array;\n\n\t\t}\n\n\t\tthis.morphTargetsRelative = source.morphTargetsRelative;\n\n\t\t// groups\n\n\t\tconst groups = source.groups;\n\n\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tthis.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t}\n\n\t\t// bounding box\n\n\t\tconst boundingBox = source.boundingBox;\n\n\t\tif ( boundingBox !== null ) {\n\n\t\t\tthis.boundingBox = boundingBox.clone();\n\n\t\t}\n\n\t\t// bounding sphere\n\n\t\tconst boundingSphere = source.boundingSphere;\n\n\t\tif ( boundingSphere !== null ) {\n\n\t\t\tthis.boundingSphere = boundingSphere.clone();\n\n\t\t}\n\n\t\t// draw range\n\n\t\tthis.drawRange.start = source.drawRange.start;\n\t\tthis.drawRange.count = source.drawRange.count;\n\n\t\t// user data\n\n\t\tthis.userData = source.userData;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires BufferGeometry#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n}\n\nconst _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();\nconst _ray$3 = /*@__PURE__*/ new Ray();\nconst _sphere$6 = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA$1 = /*@__PURE__*/ new Vector3();\nconst _vB$1 = /*@__PURE__*/ new Vector3();\nconst _vC$1 = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\n/**\n * Class representing triangular polygon mesh based objects.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments Object3D\n */\nclass Mesh extends Object3D {\n\n\t/**\n\t * Constructs a new mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\t/**\n\t\t * The mesh geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The mesh material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default MeshBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<String,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\t/**\n\t\t * The number of instances of this mesh.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the local-space position of the vertex at the given index, taking into\n\t * account the current animation state of both morph targets and skinning.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * @return {Vector3} The vertex position in local space.\n\t */\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$6.copy( geometry.boundingSphere );\n\t\t_sphere$6.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray$3.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere$6.containsPoint( _ray$3.origin ) === false ) {\n\n\t\t\tif ( _ray$3.intersectSphere( _sphere$6, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix$3.copy( matrixWorld ).invert();\n\t\t_ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$3 );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection$1( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA$1 );\n\tobject.getVertexPosition( b, _vB$1 );\n\tobject.getVertexPosition( c, _vC$1 );\n\n\tconst intersection = checkIntersection$1( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tconst barycoord = new Vector3();\n\t\tTriangle.getBarycoord( _intersectionPoint, _vA$1, _vB$1, _vC$1, barycoord );\n\n\t\tif ( uv ) {\n\n\t\t\tintersection.uv = Triangle.getInterpolatedAttribute( uv, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\tintersection.uv1 = Triangle.getInterpolatedAttribute( uv1, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\tintersection.normal = Triangle.getInterpolatedAttribute( normal, a, b, c, barycoord, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) > 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( -1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA$1, _vB$1, _vC$1, face.normal );\n\n\t\tintersection.face = face;\n\t\tintersection.barycoord = barycoord;\n\n\t}\n\n\treturn intersection;\n\n}\n\n/**\n * A geometry class for a rectangular cuboid with a given width, height, and depth.\n * On creation, the cuboid is centred on the origin, with each edge parallel to one\n * of the axes.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const cube = new THREE.Mesh( geometry, material );\n * scene.add( cube );\n * ```\n *\n * @augments BufferGeometry\n */\nclass BoxGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new box geometry.\n\t *\n\t * @param {number} [width=1] - The width. That is, the length of the edges parallel to the X axis.\n\t * @param {number} [height=1] - The height. That is, the length of the edges parallel to the Y axis.\n\t * @param {number} [depth=1] - The depth. That is, the length of the edges parallel to the Z axis.\n\t * @param {number} [widthSegments=1] - Number of segmented rectangular faces along the width of the sides.\n\t * @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides.\n\t * @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'BoxGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\tdepth: depth,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tdepthSegments: depthSegments\n\t\t};\n\n\t\tconst scope = this;\n\n\t\t// segments\n\n\t\twidthSegments = Math.floor( widthSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\t\tdepthSegments = Math.floor( depthSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet numberOfVertices = 0;\n\t\tlet groupStart = 0;\n\n\t\t// build each side of the box geometry\n\n\t\tbuildPlane( 'z', 'y', 'x', -1, -1, depth, height, width, depthSegments, heightSegments, 0 ); // px\n\t\tbuildPlane( 'z', 'y', 'x', 1, -1, depth, height, - width, depthSegments, heightSegments, 1 ); // nx\n\t\tbuildPlane( 'x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2 ); // py\n\t\tbuildPlane( 'x', 'z', 'y', 1, -1, width, depth, - height, widthSegments, depthSegments, 3 ); // ny\n\t\tbuildPlane( 'x', 'y', 'z', 1, -1, width, height, depth, widthSegments, heightSegments, 4 ); // pz\n\t\tbuildPlane( 'x', 'y', 'z', -1, -1, width, height, - depth, widthSegments, heightSegments, 5 ); // nz\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction buildPlane( u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex ) {\n\n\t\t\tconst segmentWidth = width / gridX;\n\t\t\tconst segmentHeight = height / gridY;\n\n\t\t\tconst widthHalf = width / 2;\n\t\t\tconst heightHalf = height / 2;\n\t\t\tconst depthHalf = depth / 2;\n\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\n\t\t\tlet vertexCounter = 0;\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst vector = new Vector3();\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\t\tconst x = ix * segmentWidth - widthHalf;\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = x * udir;\n\t\t\t\t\tvector[ v ] = y * vdir;\n\t\t\t\t\tvector[ w ] = depthHalf;\n\n\t\t\t\t\t// now apply vector to vertex buffer\n\n\t\t\t\t\tvertices.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// set values to correct vector component\n\n\t\t\t\t\tvector[ u ] = 0;\n\t\t\t\t\tvector[ v ] = 0;\n\t\t\t\t\tvector[ w ] = depth > 0 ? 1 : -1;\n\n\t\t\t\t\t// now apply vector to normal buffer\n\n\t\t\t\t\tnormals.push( vector.x, vector.y, vector.z );\n\n\t\t\t\t\t// uvs\n\n\t\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t\t\t// counters\n\n\t\t\t\t\tvertexCounter += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\t// 1. you need three indices to draw a single face\n\t\t\t// 2. a single segment consists of two faces\n\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\t\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst c = numberOfVertices + ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\t\tconst d = numberOfVertices + ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t\t// increase counter\n\n\t\t\t\t\tgroupCount += 6;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, materialIndex );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t\t// update total number of vertices\n\n\t\t\tnumberOfVertices += vertexCounter;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {BoxGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new BoxGeometry( data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments );\n\n\t}\n\n}\n\n// Uniform Utilities\n\nfunction cloneUniforms( src ) {\n\n\tconst dst = {};\n\n\tfor ( const u in src ) {\n\n\t\tdst[ u ] = {};\n\n\t\tfor ( const p in src[ u ] ) {\n\n\t\t\tconst property = src[ u ][ p ];\n\n\t\t\tif ( property && ( property.isColor ||\n\t\t\t\tproperty.isMatrix3 || property.isMatrix4 ||\n\t\t\t\tproperty.isVector2 || property.isVector3 || property.isVector4 ||\n\t\t\t\tproperty.isTexture || property.isQuaternion ) ) {\n\n\t\t\t\tif ( property.isRenderTargetTexture ) {\n\n\t\t\t\t\tconsole.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );\n\t\t\t\t\tdst[ u ][ p ] = null;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdst[ u ][ p ] = property.clone();\n\n\t\t\t\t}\n\n\t\t\t} else if ( Array.isArray( property ) ) {\n\n\t\t\t\tdst[ u ][ p ] = property.slice();\n\n\t\t\t} else {\n\n\t\t\t\tdst[ u ][ p ] = property;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction mergeUniforms( uniforms ) {\n\n\tconst merged = {};\n\n\tfor ( let u = 0; u < uniforms.length; u ++ ) {\n\n\t\tconst tmp = cloneUniforms( uniforms[ u ] );\n\n\t\tfor ( const p in tmp ) {\n\n\t\t\tmerged[ p ] = tmp[ p ];\n\n\t\t}\n\n\t}\n\n\treturn merged;\n\n}\n\nfunction cloneUniformsGroups( src ) {\n\n\tconst dst = [];\n\n\tfor ( let u = 0; u < src.length; u ++ ) {\n\n\t\tdst.push( src[ u ].clone() );\n\n\t}\n\n\treturn dst;\n\n}\n\nfunction getUnlitUniformColorSpace( renderer ) {\n\n\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\tif ( currentRenderTarget === null ) {\n\n\t\t// https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398\n\t\treturn renderer.outputColorSpace;\n\n\t}\n\n\t// https://github.com/mrdoob/three.js/issues/27868\n\tif ( currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\treturn currentRenderTarget.texture.colorSpace;\n\n\t}\n\n\treturn ColorManagement.workingColorSpace;\n\n}\n\n// Legacy\n\nconst UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };\n\nvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\nvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\n/**\n * A material rendered with custom shaders. A shader is a small program written in GLSL.\n * that runs on the GPU. You may want to use a custom shader if you need to implement an\n * effect not included with any of the built-in materials.\n *\n * There are the following notes to bear in mind when using a `ShaderMaterial`:\n *\n * - `ShaderMaterial` can only be used with {@link WebGLRenderer}.\n * - Built in attributes and uniforms are passed to the shaders along with your code. If\n * you don't want that, use {@link RawShaderMaterial} instead.\n * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end`\n * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has\n * to be placed right above the loop. The loop formatting has to correspond to a defined standard.\n *   - The loop has to be [normalized]{@link https://en.wikipedia.org/wiki/Normalized_loop}.\n *   - The loop variable has to be *i*.\n *   - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly\n * value of *i* for the given iteration and can be used in preprocessor\n * statements.\n *\n * ```js\n * const material = new THREE.ShaderMaterial( {\n * \tuniforms: {\n * \t\ttime: { value: 1.0 },\n * \t\tresolution: { value: new THREE.Vector2() }\n * \t},\n * \tvertexShader: document.getElementById( 'vertexShader' ).textContent,\n * \tfragmentShader: document.getElementById( 'fragmentShader' ).textContent\n * } );\n * ```\n *\n * @augments Material\n */\nclass ShaderMaterial extends Material {\n\n\t/**\n\t * Constructs a new shader material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isShaderMaterial = true;\n\n\t\tthis.type = 'ShaderMaterial';\n\n\t\t/**\n\t\t * Defines custom constants using `#define` directives within the GLSL code\n\t\t * for both the vertex shader and the fragment shader; each key/value pair\n\t\t * yields another directive.\n\t\t * ```js\n\t\t * defines: {\n\t\t * \tFOO: 15,\n\t\t * \tBAR: true\n\t\t * }\n\t\t * ```\n\t\t * Yields the lines:\n\t\t * ```\n\t\t * #define FOO 15\n\t\t * #define BAR true\n\t\t * ```\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.defines = {};\n\n\t\t/**\n\t\t * An object of the form:\n\t\t * ```js\n\t\t * {\n\t\t * \t\"uniform1\": { value: 1.0 },\n\t\t * \t\"uniform2\": { value: 2 }\n\t\t * }\n\t\t * ```\n\t\t * specifying the uniforms to be passed to the shader code; keys are uniform\n\t\t * names, values are definitions of the form\n\t\t * ```\n\t\t * {\n\t\t * \tvalue: 1.0\n\t\t * }\n\t\t * ```\n\t\t * where `value` is the value of the uniform. Names must match the name of\n\t\t * the uniform, as defined in the GLSL code. Note that uniforms are refreshed\n\t\t * on every frame, so updating the value of the uniform will immediately\n\t\t * update the value available to the GLSL code.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.uniforms = {};\n\n\t\t/**\n\t\t * An array holding uniforms groups for configuring UBOs.\n\t\t *\n\t\t * @type {Array<UniformsGroup>}\n\t\t */\n\t\tthis.uniformsGroups = [];\n\n\t\t/**\n\t\t * Vertex shader GLSL code. This is the actual code for the shader.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.vertexShader = default_vertex;\n\n\t\t/**\n\t\t * Fragment shader GLSL code. This is the actual code for the shader.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.fragmentShader = default_fragment;\n\n\t\t/**\n\t\t * Controls line thickness or lines.\n\t\t *\n\t\t * WebGL and WebGPU ignore this setting and always render line primitives with a\n\t\t * width of one pixel.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.linewidth = 1;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Define whether the material color is affected by global fog settings; `true`\n\t\t * to pass fog uniforms to the shader.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.fog = false;\n\n\t\t/**\n\t\t * Defines whether this material uses lighting; `true` to pass uniform data\n\t\t * related to lighting to this shader.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.lights = false;\n\n\t\t/**\n\t\t * Defines whether this material supports clipping; `true` to let the renderer\n\t\t * pass the clippingPlanes uniform.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clipping = false;\n\n\t\t/**\n\t\t * Overwritten and set to `true` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.forceSinglePass = true;\n\n\t\t/**\n\t\t * This object allows to enable certain WebGL 2 extensions.\n\t\t *\n\t\t * - clipCullDistance: set to `true` to use vertex shader clipping\n\t\t * - multiDraw: set to `true` to use vertex shader multi_draw / enable gl_DrawID\n\t\t *\n\t\t * @type {{clipCullDistance:false,multiDraw:false}}\n\t\t */\n\t\tthis.extensions = {\n\t\t\tclipCullDistance: false, // set to use vertex shader clipping\n\t\t\tmultiDraw: false // set to use vertex shader multi_draw / enable gl_DrawID\n\t\t};\n\n\t\t/**\n\t\t * When the rendered geometry doesn't include these attributes but the\n\t\t * material does, these default values will be passed to the shaders. This\n\t\t * avoids errors when buffer data is missing.\n\t\t *\n\t\t * - color: [ 1, 1, 1 ]\n\t\t * - uv: [ 0, 0 ]\n\t\t * - uv1: [ 0, 0 ]\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.defaultAttributeValues = {\n\t\t\t'color': [ 1, 1, 1 ],\n\t\t\t'uv': [ 0, 0 ],\n\t\t\t'uv1': [ 0, 0 ]\n\t\t};\n\n\t\t/**\n\t\t * If set, this calls [gl.bindAttribLocation]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation}\n\t\t * to bind a generic vertex index to an attribute variable.\n\t\t *\n\t\t * @type {string|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.index0AttributeName = undefined;\n\n\t\t/**\n\t\t * Can be used to force a uniform update while changing uniforms in\n\t\t * {@link Object3D#onBeforeRender}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.uniformsNeedUpdate = false;\n\n\t\t/**\n\t\t * Defines the GLSL version of custom shader code.\n\t\t *\n\t\t * @type {?(GLSL1|GLSL3)}\n\t\t * @default null\n\t\t */\n\t\tthis.glslVersion = null;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tthis.setValues( parameters );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.fragmentShader = source.fragmentShader;\n\t\tthis.vertexShader = source.vertexShader;\n\n\t\tthis.uniforms = cloneUniforms( source.uniforms );\n\t\tthis.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );\n\n\t\tthis.defines = Object.assign( {}, source.defines );\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.fog = source.fog;\n\t\tthis.lights = source.lights;\n\t\tthis.clipping = source.clipping;\n\n\t\tthis.extensions = Object.assign( {}, source.extensions );\n\n\t\tthis.glslVersion = source.glslVersion;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.glslVersion = this.glslVersion;\n\t\tdata.uniforms = {};\n\n\t\tfor ( const name in this.uniforms ) {\n\n\t\t\tconst uniform = this.uniforms[ name ];\n\t\t\tconst value = uniform.value;\n\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 't',\n\t\t\t\t\tvalue: value.toJSON( meta ).uuid\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isColor ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'c',\n\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector2 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v2',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isVector4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'v4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix3 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm3',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else if ( value && value.isMatrix4 ) {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\ttype: 'm4',\n\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t};\n\n\t\t\t} else {\n\n\t\t\t\tdata.uniforms[ name ] = {\n\t\t\t\t\tvalue: value\n\t\t\t\t};\n\n\t\t\t\t// note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Object.keys( this.defines ).length > 0 ) data.defines = this.defines;\n\n\t\tdata.vertexShader = this.vertexShader;\n\t\tdata.fragmentShader = this.fragmentShader;\n\n\t\tdata.lights = this.lights;\n\t\tdata.clipping = this.clipping;\n\n\t\tconst extensions = {};\n\n\t\tfor ( const key in this.extensions ) {\n\n\t\t\tif ( this.extensions[ key ] === true ) extensions[ key ] = true;\n\n\t\t}\n\n\t\tif ( Object.keys( extensions ).length > 0 ) data.extensions = extensions;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Abstract base class for cameras. This class should always be inherited\n * when you build a new camera.\n *\n * @abstract\n * @augments Object3D\n */\nclass Camera extends Object3D {\n\n\t/**\n\t * Constructs a new camera.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCamera = true;\n\n\t\tthis.type = 'Camera';\n\n\t\t/**\n\t\t * The inverse of the camera's world matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\t/**\n\t\t * The camera's projection matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.projectionMatrix = new Matrix4();\n\n\t\t/**\n\t\t * The inverse of the camera's projection matrix.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t\t/**\n\t\t * The coordinate system in which the camera is used.\n\t\t *\n\t\t * @type {(WebGLCoordinateSystem|WebGPUCoordinateSystem)}\n\t\t */\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t\tthis._reversedDepth = false;\n\n\t}\n\n\t/**\n\t * The flag that indicates whether the camera uses a reversed depth buffer.\n\t *\n\t * @type {boolean}\n\t * @default false\n\t */\n\tget reversedDepth() {\n\n\t\treturn this._reversedDepth;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\tthis.coordinateSystem = source.coordinateSystem;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a vector representing the (\"look\") direction of the 3D object in world space.\n\t *\n\t * This method is overwritten since cameras have a different forward vector compared to other\n\t * 3D objects. A camera looks down its local, negative z-axis by default.\n\t *\n\t * @param {Vector3} target - The target vector the result is stored to.\n\t * @return {Vector3} The 3D object's direction in world space.\n\t */\n\tgetWorldDirection( target ) {\n\n\t\treturn super.getWorldDirection( target ).negate();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _v3$1 = /*@__PURE__*/ new Vector3();\nconst _minTarget = /*@__PURE__*/ new Vector2();\nconst _maxTarget = /*@__PURE__*/ new Vector2();\n\n/**\n * Camera that uses [perspective projection]{@link https://en.wikipedia.org/wiki/Perspective_(graphical)}.\n *\n * This projection mode is designed to mimic the way the human eye sees. It\n * is the most common projection mode used for rendering a 3D scene.\n *\n * ```js\n * const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );\n * scene.add( camera );\n * ```\n *\n * @augments Camera\n */\nclass PerspectiveCamera extends Camera {\n\n\t/**\n\t * Constructs a new perspective camera.\n\t *\n\t * @param {number} [fov=50] - The vertical field of view.\n\t * @param {number} [aspect=1] - The aspect ratio.\n\t * @param {number} [near=0.1] - The camera's near plane.\n\t * @param {number} [far=2000] - The camera's far plane.\n\t */\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPerspectiveCamera = true;\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\t/**\n\t\t * The vertical field of view, from bottom to top of view,\n\t\t * in degrees.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 50\n\t\t */\n\t\tthis.fov = fov;\n\n\t\t/**\n\t\t * The zoom factor of the camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.zoom = 1;\n\n\t\t/**\n\t\t * The camera's near plane. The valid range is greater than `0`\n\t\t * and less than the current value of {@link PerspectiveCamera#far}.\n\t\t *\n\t\t * Note that, unlike for the {@link OrthographicCamera}, `0` is <em>not</em> a\n\t\t * valid value for a perspective camera's near plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The camera's far plane. Must be greater than the\n\t\t * current value of {@link PerspectiveCamera#near}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2000\n\t\t */\n\t\tthis.far = far;\n\n\t\t/**\n\t\t * Object distance used for stereoscopy and depth-of-field effects. This\n\t\t * parameter does not influence the projection matrix unless a\n\t\t * {@link StereoCamera} is being used.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.focus = 10;\n\n\t\t/**\n\t\t * The aspect ratio, usually the canvas width / canvas height.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = aspect;\n\n\t\t/**\n\t\t * Represents the frustum window specification. This property should not be edited\n\t\t * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.view = null;\n\n\t\t/**\n\t\t * Film size used for the larger axis. Default is `35` (millimeters). This\n\t\t * parameter does not influence the projection matrix unless {@link PerspectiveCamera#filmOffset}\n\t\t * is set to a nonzero value.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 35\n\t\t */\n\t\tthis.filmGauge = 35;\n\n\t\t/**\n\t\t * Horizontal off-center offset in the same unit as {@link PerspectiveCamera#filmGauge}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.filmOffset = 0;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * @param {number} focalLength - Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Returns the focal length from the current {@link PerspectiveCamera#fov} and\n\t * {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The computed focal length.\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\t/**\n\t * Returns the current vertical field of view angle in degrees considering {@link PerspectiveCamera#zoom}.\n\t *\n\t * @return {number} The effective FOV.\n\t */\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\t/**\n\t * Returns the width of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n\t * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The film width.\n\t */\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect < 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Returns the height of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or\n\t * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}.\n\t *\n\t * @return {number} The film width.\n\t */\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect > 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Sets `minTarget` and `maxTarget` to the coordinates of the lower-left and upper-right corners of the view rectangle.\n\t *\n\t * @param {number} distance - The viewing distance.\n\t * @param {Vector2} minTarget - The lower-left corner of the view rectangle is written into this vector.\n\t * @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector.\n\t */\n\tgetViewBounds( distance, minTarget, maxTarget ) {\n\n\t\t_v3$1.set( -1, -1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tminTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t\t_v3$1.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tmaxTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );\n\n\t}\n\n\t/**\n\t * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n\t *\n\t * @param {number} distance - The viewing distance.\n\t * @param {Vector2} target - The target vector that is used to store result where x is width and y is height.\n\t * @returns {Vector2} The view size.\n\t */\n\tgetViewSize( distance, target ) {\n\n\t\tthis.getViewBounds( distance, _minTarget, _maxTarget );\n\n\t\treturn target.subVectors( _maxTarget, _minTarget );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *```\n\t *   +---+---+---+\n\t *   | A | B | C |\n\t *   +---+---+---+\n\t *   | D | E | F |\n\t *   +---+---+---+\n\t *```\n\t * then for each monitor you would call it like this:\n\t *```js\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * // --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * // --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * // --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * // --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * // --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * // --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t * ```\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t *\n\t * @param {number} fullWidth - The full width of multiview setup.\n\t * @param {number} fullHeight - The full height of multiview setup.\n\t * @param {number} x - The horizontal offset of the subcamera.\n\t * @param {number} y - The vertical offset of the subcamera.\n\t * @param {number} width - The width of subcamera.\n\t * @param {number} height - The height of subcamera.\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Removes the view offset from the projection matrix.\n\t */\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Updates the camera's projection matrix. Must be called after any change of\n\t * camera properties.\n\t */\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = -0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem, this.reversedDepth );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst fov = -90; // negative fov is not an error\nconst aspect = 1;\n\n/**\n * A special type of camera that is positioned in 3D space to render its surroundings into a\n * cube render target. The render target can then be used as an environment map for rendering\n * realtime reflections in your scene.\n *\n * ```js\n * // Create cube render target\n * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 256, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } );\n *\n * // Create cube camera\n * const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget );\n * scene.add( cubeCamera );\n *\n * // Create car\n * const chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeRenderTarget.texture } );\n * const car = new THREE.Mesh( carGeometry, chromeMaterial );\n * scene.add( car );\n *\n * // Update the render target cube\n * car.visible = false;\n * cubeCamera.position.copy( car.position );\n * cubeCamera.update( renderer, scene );\n *\n * // Render the scene\n * car.visible = true;\n * renderer.render( scene, camera );\n * ```\n *\n * @augments Object3D\n */\nclass CubeCamera extends Object3D {\n\n\t/**\n\t * Constructs a new cube camera.\n\t *\n\t * @param {number} near - The camera's near plane.\n\t * @param {number} far - The camera's far plane.\n\t * @param {WebGLCubeRenderTarget} renderTarget - The cube render target.\n\t */\n\tconstructor( near, far, renderTarget ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CubeCamera';\n\n\t\t/**\n\t\t * A reference to the cube render target.\n\t\t *\n\t\t * @type {WebGLCubeRenderTarget}\n\t\t */\n\t\tthis.renderTarget = renderTarget;\n\n\t\t/**\n\t\t * The current active coordinate system.\n\t\t *\n\t\t * @type {?(WebGLCoordinateSystem|WebGPUCoordinateSystem)}\n\t\t * @default null\n\t\t */\n\t\tthis.coordinateSystem = null;\n\n\t\t/**\n\t\t * The current active mipmap level\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.activeMipmapLevel = 0;\n\n\t\tconst cameraPX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPX.layers = this.layers;\n\t\tthis.add( cameraPX );\n\n\t\tconst cameraNX = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNX.layers = this.layers;\n\t\tthis.add( cameraNX );\n\n\t\tconst cameraPY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPY.layers = this.layers;\n\t\tthis.add( cameraPY );\n\n\t\tconst cameraNY = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNY.layers = this.layers;\n\t\tthis.add( cameraNY );\n\n\t\tconst cameraPZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraPZ.layers = this.layers;\n\t\tthis.add( cameraPZ );\n\n\t\tconst cameraNZ = new PerspectiveCamera( fov, aspect, near, far );\n\t\tcameraNZ.layers = this.layers;\n\t\tthis.add( cameraNZ );\n\n\t}\n\n\t/**\n\t * Must be called when the coordinate system of the cube camera is changed.\n\t */\n\tupdateCoordinateSystem() {\n\n\t\tconst coordinateSystem = this.coordinateSystem;\n\n\t\tconst cameras = this.children.concat();\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;\n\n\t\tfor ( const camera of cameras ) this.remove( camera );\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, 1, 0 );\n\t\t\tcameraPX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, 1, 0 );\n\t\t\tcameraNX.lookAt( -1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, -1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, 1 );\n\t\t\tcameraNY.lookAt( 0, -1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, 1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, 1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, -1 );\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tcameraPX.up.set( 0, -1, 0 );\n\t\t\tcameraPX.lookAt( -1, 0, 0 );\n\n\t\t\tcameraNX.up.set( 0, -1, 0 );\n\t\t\tcameraNX.lookAt( 1, 0, 0 );\n\n\t\t\tcameraPY.up.set( 0, 0, 1 );\n\t\t\tcameraPY.lookAt( 0, 1, 0 );\n\n\t\t\tcameraNY.up.set( 0, 0, -1 );\n\t\t\tcameraNY.lookAt( 0, -1, 0 );\n\n\t\t\tcameraPZ.up.set( 0, -1, 0 );\n\t\t\tcameraPZ.lookAt( 0, 0, 1 );\n\n\t\t\tcameraNZ.up.set( 0, -1, 0 );\n\t\t\tcameraNZ.lookAt( 0, 0, -1 );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\tfor ( const camera of cameras ) {\n\n\t\t\tthis.add( camera );\n\n\t\t\tcamera.updateMatrixWorld();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Calling this method will render the given scene with the given renderer\n\t * into the cube render target of the camera.\n\t *\n\t * @param {(Renderer|WebGLRenderer)} renderer - The renderer.\n\t * @param {Scene} scene - The scene to render.\n\t */\n\tupdate( renderer, scene ) {\n\n\t\tif ( this.parent === null ) this.updateMatrixWorld();\n\n\t\tconst { renderTarget, activeMipmapLevel } = this;\n\n\t\tif ( this.coordinateSystem !== renderer.coordinateSystem ) {\n\n\t\t\tthis.coordinateSystem = renderer.coordinateSystem;\n\n\t\t\tthis.updateCoordinateSystem();\n\n\t\t}\n\n\t\tconst [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst currentActiveCubeFace = renderer.getActiveCubeFace();\n\t\tconst currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst currentXrEnabled = renderer.xr.enabled;\n\n\t\trenderer.xr.enabled = false;\n\n\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\n\t\trenderTarget.texture.generateMipmaps = false;\n\n\t\trenderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPX );\n\n\t\trenderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNX );\n\n\t\trenderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPY );\n\n\t\trenderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNY );\n\n\t\trenderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );\n\t\trenderer.render( scene, cameraPZ );\n\n\t\t// mipmaps are generated during the last call of render()\n\t\t// at this point, all sides of the cube render target are defined\n\n\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\n\t\trenderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );\n\t\trenderer.render( scene, cameraNZ );\n\n\t\trenderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );\n\n\t\trenderer.xr.enabled = currentXrEnabled;\n\n\t\trenderTarget.texture.needsPMREMUpdate = true;\n\n\t}\n\n}\n\n/**\n * Creates a cube texture made up of six images.\n *\n * ```js\n * const loader = new THREE.CubeTextureLoader();\n * loader.setPath( 'textures/cube/pisa/' );\n *\n * const textureCube = loader.load( [\n * \t'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'\n * ] );\n *\n * const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );\n * ```\n *\n * @augments Texture\n */\nclass CubeTexture extends Texture {\n\n\t/**\n\t * Constructs a new cube texture.\n\t *\n\t * @param {Array<Image>} [images=[]] - An array holding a image for each side of a cube.\n\t * @param {number} [mapping=CubeReflectionMapping] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space value.\n\t */\n\tconstructor( images = [], mapping = CubeReflectionMapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace ) {\n\n\t\tsuper( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeTexture = true;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t}\n\n\t/**\n\t * Alias for {@link CubeTexture#image}.\n\t *\n\t * @type {Array<Image>}\n\t */\n\tget images() {\n\n\t\treturn this.image;\n\n\t}\n\n\tset images( value ) {\n\n\t\tthis.image = value;\n\n\t}\n\n}\n\n/**\n * A cube render target used in context of {@link WebGLRenderer}.\n *\n * @augments WebGLRenderTarget\n */\nclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\n\t/**\n\t * Constructs a new cube render target.\n\t *\n\t * @param {number} [size=1] - The size of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( size = 1, options = {} ) {\n\n\t\tsuper( size, size, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLCubeRenderTarget = true;\n\n\t\tconst image = { width: size, height: size, depth: 1 };\n\t\tconst images = [ image, image, image, image, image, image ];\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {DataArrayTexture}\n\t\t */\n\t\tthis.texture = new CubeTexture( images );\n\t\tthis._setTextureOptions( options );\n\n\t\t// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\n\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n\t/**\n\t * Converts the given equirectangular texture to a cube map.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {Texture} texture - The equirectangular texture.\n\t * @return {WebGLCubeRenderTarget} A reference to this cube render target.\n\t */\n\tfromEquirectangularTexture( renderer, texture ) {\n\n\t\tthis.texture.type = texture.type;\n\t\tthis.texture.colorSpace = texture.colorSpace;\n\n\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\tthis.texture.minFilter = texture.minFilter;\n\t\tthis.texture.magFilter = texture.magFilter;\n\n\t\tconst shader = {\n\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: { value: null },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\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`,\n\n\t\t\tfragmentShader: /* glsl */`\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`\n\t\t};\n\n\t\tconst geometry = new BoxGeometry( 5, 5, 5 );\n\n\t\tconst material = new ShaderMaterial( {\n\n\t\t\tname: 'CubemapFromEquirect',\n\n\t\t\tuniforms: cloneUniforms( shader.uniforms ),\n\t\t\tvertexShader: shader.vertexShader,\n\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\tside: BackSide,\n\t\t\tblending: NoBlending\n\n\t\t} );\n\n\t\tmaterial.uniforms.tEquirect.value = texture;\n\n\t\tconst mesh = new Mesh( geometry, material );\n\n\t\tconst currentMinFilter = texture.minFilter;\n\n\t\t// Avoid blurred poles\n\t\tif ( texture.minFilter === LinearMipmapLinearFilter ) texture.minFilter = LinearFilter;\n\n\t\tconst camera = new CubeCamera( 1, 10, this );\n\t\tcamera.update( renderer, mesh );\n\n\t\ttexture.minFilter = currentMinFilter;\n\n\t\tmesh.geometry.dispose();\n\t\tmesh.material.dispose();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Clears this cube render target.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.\n\t * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.\n\t * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.\n\t */\n\tclear( renderer, color = true, depth = true, stencil = true ) {\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\trenderer.setRenderTarget( this, i );\n\n\t\t\trenderer.clear( color, depth, stencil );\n\n\t\t}\n\n\t\trenderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n}\n\n/**\n * This is almost identical to an {@link Object3D}. Its purpose is to\n * make working with groups of objects syntactically clearer.\n *\n * ```js\n * // Create a group and add the two cubes.\n * // These cubes can now be rotated / scaled etc as a group.\n * const group = new THREE.Group();\n *\n * group.add( meshA );\n * group.add( meshB );\n *\n * scene.add( group );\n * ```\n *\n * @augments Object3D\n */\nclass Group extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isGroup = true;\n\n\t\tthis.type = 'Group';\n\n\t}\n\n}\n\nconst _moveEvent = { type: 'move' };\n\n/**\n * Class for representing a XR controller with its\n * different coordinate systems.\n *\n * @private\n */\nclass WebXRController {\n\n\t/**\n\t * Constructs a new XR controller.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A group representing the target ray space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._targetRay = null;\n\n\t\t/**\n\t\t * A group representing the grip space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._grip = null;\n\n\t\t/**\n\t\t * A group representing the hand space\n\t\t * of the XR controller.\n\t\t *\n\t\t * @private\n\t\t * @type {?Group}\n\t\t * @default null\n\t\t */\n\t\tthis._hand = null;\n\n\t}\n\n\t/**\n\t * Returns a group representing the hand space of the XR controller.\n\t *\n\t * @return {Group} A group representing the hand space of the XR controller.\n\t */\n\tgetHandSpace() {\n\n\t\tif ( this._hand === null ) {\n\n\t\t\tthis._hand = new Group();\n\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\tthis._hand.visible = false;\n\n\t\t\tthis._hand.joints = {};\n\t\t\tthis._hand.inputState = { pinching: false };\n\n\t\t}\n\n\t\treturn this._hand;\n\n\t}\n\n\t/**\n\t * Returns a group representing the target ray space of the XR controller.\n\t *\n\t * @return {Group} A group representing the target ray space of the XR controller.\n\t */\n\tgetTargetRaySpace() {\n\n\t\tif ( this._targetRay === null ) {\n\n\t\t\tthis._targetRay = new Group();\n\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\tthis._targetRay.visible = false;\n\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._targetRay;\n\n\t}\n\n\t/**\n\t * Returns a group representing the grip space of the XR controller.\n\t *\n\t * @return {Group} A group representing the grip space of the XR controller.\n\t */\n\tgetGripSpace() {\n\n\t\tif ( this._grip === null ) {\n\n\t\t\tthis._grip = new Group();\n\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\tthis._grip.visible = false;\n\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\tthis._grip.angularVelocity = new Vector3();\n\n\t\t}\n\n\t\treturn this._grip;\n\n\t}\n\n\t/**\n\t * Dispatches the given event to the groups representing\n\t * the different coordinate spaces of the XR controller.\n\t *\n\t * @param {Object} event - The event to dispatch.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tdispatchEvent( event ) {\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.dispatchEvent( event );\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.dispatchEvent( event );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Connects the controller with the given XR input source.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tconnect( inputSource ) {\n\n\t\tif ( inputSource && inputSource.hand ) {\n\n\t\t\tconst hand = this._hand;\n\n\t\t\tif ( hand ) {\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Initialize hand with joints when connected\n\t\t\t\t\tthis._getHandJoint( hand, inputjoint );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.dispatchEvent( { type: 'connected', data: inputSource } );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Disconnects the controller from the given XR input source.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tdisconnect( inputSource ) {\n\n\t\tthis.dispatchEvent( { type: 'disconnected', data: inputSource } );\n\n\t\tif ( this._targetRay !== null ) {\n\n\t\t\tthis._targetRay.visible = false;\n\n\t\t}\n\n\t\tif ( this._grip !== null ) {\n\n\t\t\tthis._grip.visible = false;\n\n\t\t}\n\n\t\tif ( this._hand !== null ) {\n\n\t\t\tthis._hand.visible = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Updates the controller with the given input source, XR frame and reference space.\n\t * This updates the transformations of the groups that represent the different\n\t * coordinate systems of the controller.\n\t *\n\t * @param {XRInputSource} inputSource - The input source.\n\t * @param {XRFrame} frame - The XR frame.\n\t * @param {XRReferenceSpace} referenceSpace - The reference space.\n\t * @return {WebXRController} A reference to this instance.\n\t */\n\tupdate( inputSource, frame, referenceSpace ) {\n\n\t\tlet inputPose = null;\n\t\tlet gripPose = null;\n\t\tlet handPose = null;\n\n\t\tconst targetRay = this._targetRay;\n\t\tconst grip = this._grip;\n\t\tconst hand = this._hand;\n\n\t\tif ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {\n\n\t\t\tif ( hand && inputSource.hand ) {\n\n\t\t\t\thandPose = true;\n\n\t\t\t\tfor ( const inputjoint of inputSource.hand.values() ) {\n\n\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\tconst jointPose = frame.getJointPose( inputjoint, referenceSpace );\n\n\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\tconst joint = this._getHandJoint( hand, inputjoint );\n\n\t\t\t\t\tif ( jointPose !== null ) {\n\n\t\t\t\t\t\tjoint.matrix.fromArray( jointPose.transform.matrix );\n\t\t\t\t\t\tjoint.matrix.decompose( joint.position, joint.rotation, joint.scale );\n\t\t\t\t\t\tjoint.matrixWorldNeedsUpdate = true;\n\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tjoint.visible = jointPose !== null;\n\n\t\t\t\t}\n\n\t\t\t\t// Custom events\n\n\t\t\t\t// Check pinchz\n\t\t\t\tconst indexTip = hand.joints[ 'index-finger-tip' ];\n\t\t\t\tconst thumbTip = hand.joints[ 'thumb-tip' ];\n\t\t\t\tconst distance = indexTip.position.distanceTo( thumbTip.position );\n\n\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\tif ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t} else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {\n\n\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\tthis.dispatchEvent( {\n\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( grip !== null && inputSource.gripSpace ) {\n\n\t\t\t\t\tgripPose = frame.getPose( inputSource.gripSpace, referenceSpace );\n\n\t\t\t\t\tif ( gripPose !== null ) {\n\n\t\t\t\t\t\tgrip.matrix.fromArray( gripPose.transform.matrix );\n\t\t\t\t\t\tgrip.matrix.decompose( grip.position, grip.rotation, grip.scale );\n\t\t\t\t\t\tgrip.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\t\tif ( gripPose.linearVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\tgrip.linearVelocity.copy( gripPose.linearVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( gripPose.angularVelocity ) {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\tgrip.angularVelocity.copy( gripPose.angularVelocity );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( targetRay !== null ) {\n\n\t\t\t\tinputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );\n\n\t\t\t\t// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it\n\t\t\t\tif ( inputPose === null && gripPose !== null ) {\n\n\t\t\t\t\tinputPose = gripPose;\n\n\t\t\t\t}\n\n\t\t\t\tif ( inputPose !== null ) {\n\n\t\t\t\t\ttargetRay.matrix.fromArray( inputPose.transform.matrix );\n\t\t\t\t\ttargetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );\n\t\t\t\t\ttargetRay.matrixWorldNeedsUpdate = true;\n\n\t\t\t\t\tif ( inputPose.linearVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\ttargetRay.linearVelocity.copy( inputPose.linearVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( inputPose.angularVelocity ) {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\ttargetRay.angularVelocity.copy( inputPose.angularVelocity );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.dispatchEvent( _moveEvent );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t}\n\n\t\tif ( targetRay !== null ) {\n\n\t\t\ttargetRay.visible = ( inputPose !== null );\n\n\t\t}\n\n\t\tif ( grip !== null ) {\n\n\t\t\tgrip.visible = ( gripPose !== null );\n\n\t\t}\n\n\t\tif ( hand !== null ) {\n\n\t\t\thand.visible = ( handPose !== null );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a group representing the hand joint for the given input joint.\n\t *\n\t * @private\n\t * @param {Group} hand - The group representing the hand space.\n\t * @param {XRJointSpace} inputjoint - The hand joint data.\n\t * @return {Group} A group representing the hand joint for the given input joint.\n\t */\n\t_getHandJoint( hand, inputjoint ) {\n\n\t\tif ( hand.joints[ inputjoint.jointName ] === undefined ) {\n\n\t\t\tconst joint = new Group();\n\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\tjoint.visible = false;\n\t\t\thand.joints[ inputjoint.jointName ] = joint;\n\n\t\t\thand.add( joint );\n\n\t\t}\n\n\t\treturn hand.joints[ inputjoint.jointName ];\n\n\t}\n\n}\n\n/**\n * This class can be used to define an exponential squared fog,\n * which gives a clear view near the camera and a faster than exponentially\n * densening fog farther from the camera.\n *\n * ```js\n * const scene = new THREE.Scene();\n * scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 );\n * ```\n */\nclass FogExp2 {\n\n\t/**\n\t * Constructs a new fog.\n\t *\n\t * @param {number|Color} color - The fog's color.\n\t * @param {number} [density=0.00025] - Defines how fast the fog will grow dense.\n\t */\n\tconstructor( color, density = 0.00025 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFogExp2 = true;\n\n\t\t/**\n\t\t * The name of the fog.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The fog's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t *  Defines how fast the fog will grow dense.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.00025\n\t\t */\n\t\tthis.density = density;\n\n\t}\n\n\t/**\n\t * Returns a new fog with copied values from this instance.\n\t *\n\t * @return {FogExp2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new FogExp2( this.color, this.density );\n\n\t}\n\n\t/**\n\t * Serializes the fog into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized fog\n\t */\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'FogExp2',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tdensity: this.density\n\t\t};\n\n\t}\n\n}\n\n/**\n * This class can be used to define a linear fog that grows linearly denser\n * with the distance.\n *\n * ```js\n * const scene = new THREE.Scene();\n * scene.fog = new THREE.Fog( 0xcccccc, 10, 15 );\n * ```\n */\nclass Fog {\n\n\t/**\n\t * Constructs a new fog.\n\t *\n\t * @param {number|Color} color - The fog's color.\n\t * @param {number} [near=1] - The minimum distance to start applying fog.\n\t * @param {number} [far=1000] - The maximum distance at which fog stops being calculated and applied.\n\t */\n\tconstructor( color, near = 1, far = 1000 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFog = true;\n\n\t\t/**\n\t\t * The name of the fog.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The fog's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t * The minimum distance to start applying fog. Objects that are less than\n\t\t * `near` units from the active camera won't be affected by fog.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The maximum distance at which fog stops being calculated and applied.\n\t\t * Objects that are more than `far` units away from the active camera won't\n\t\t * be affected by fog.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1000\n\t\t */\n\t\tthis.far = far;\n\n\t}\n\n\t/**\n\t * Returns a new fog with copied values from this instance.\n\t *\n\t * @return {Fog} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Fog( this.color, this.near, this.far );\n\n\t}\n\n\t/**\n\t * Serializes the fog into JSON.\n\t *\n\t * @param {?(Object|string)} meta - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized fog\n\t */\n\ttoJSON( /* meta */ ) {\n\n\t\treturn {\n\t\t\ttype: 'Fog',\n\t\t\tname: this.name,\n\t\t\tcolor: this.color.getHex(),\n\t\t\tnear: this.near,\n\t\t\tfar: this.far\n\t\t};\n\n\t}\n\n}\n\n/**\n * Scenes allow you to set up what is to be rendered and where by three.js.\n * This is where you place 3D objects like meshes, lines or lights.\n *\n * @augments Object3D\n */\nclass Scene extends Object3D {\n\n\t/**\n\t * Constructs a new scene.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isScene = true;\n\n\t\tthis.type = 'Scene';\n\n\t\t/**\n\t\t * Defines the background of the scene. Valid inputs are:\n\t\t *\n\t\t * - A color for defining a uniform colored background.\n\t\t * - A texture for defining a (flat) textured background.\n\t\t * - Cube textures or equirectangular textures for defining a skybox.\n\t\t *\n\t\t * @type {?(Color|Texture)}\n\t\t * @default null\n\t\t */\n\t\tthis.background = null;\n\n\t\t/**\n\t\t * Sets the environment map for all physical materials in the scene. However,\n\t\t * it's not possible to overwrite an existing texture assigned to the `envMap`\n\t\t * material property.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.environment = null;\n\n\t\t/**\n\t\t * A fog instance defining the type of fog that affects everything\n\t\t * rendered in the scene.\n\t\t *\n\t\t * @type {?(Fog|FogExp2)}\n\t\t * @default null\n\t\t */\n\t\tthis.fog = null;\n\n\t\t/**\n\t\t * Sets the blurriness of the background. Only influences environment maps\n\t\t * assigned to {@link Scene#background}. Valid input is a float between `0`\n\t\t * and `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.backgroundBlurriness = 0;\n\n\t\t/**\n\t\t * Attenuates the color of the background. Only applies to background textures.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.backgroundIntensity = 1;\n\n\t\t/**\n\t\t * The rotation of the background in radians. Only influences environment maps\n\t\t * assigned to {@link Scene#background}.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.backgroundRotation = new Euler();\n\n\t\t/**\n\t\t * Attenuates the color of the environment. Only influences environment maps\n\t\t * assigned to {@link Scene#environment}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.environmentIntensity = 1;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians. Only influences physical materials\n\t\t * in the scene when {@link Scene#environment} is used.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.environmentRotation = new Euler();\n\n\t\t/**\n\t\t * Forces everything in the scene to be rendered with the defined material. It is possible\n\t\t * to exclude materials from override by setting {@link Material#allowOverride} to `false`.\n\t\t *\n\t\t * @type {?Material}\n\t\t * @default null\n\t\t */\n\t\tthis.overrideMaterial = null;\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.background !== null ) this.background = source.background.clone();\n\t\tif ( source.environment !== null ) this.environment = source.environment.clone();\n\t\tif ( source.fog !== null ) this.fog = source.fog.clone();\n\n\t\tthis.backgroundBlurriness = source.backgroundBlurriness;\n\t\tthis.backgroundIntensity = source.backgroundIntensity;\n\t\tthis.backgroundRotation.copy( source.backgroundRotation );\n\n\t\tthis.environmentIntensity = source.environmentIntensity;\n\t\tthis.environmentRotation.copy( source.environmentRotation );\n\n\t\tif ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();\n\n\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.fog !== null ) data.object.fog = this.fog.toJSON();\n\n\t\tif ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;\n\t\tif ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;\n\t\tdata.object.backgroundRotation = this.backgroundRotation.toArray();\n\n\t\tif ( this.environmentIntensity !== 1 ) data.object.environmentIntensity = this.environmentIntensity;\n\t\tdata.object.environmentRotation = this.environmentRotation.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * \"Interleaved\" means that multiple attributes, possibly of different types,\n * (e.g., position, normal, uv, color) are packed into a single array buffer.\n *\n * An introduction into interleaved arrays can be found here: [Interleaved array basics]{@link https://blog.tojicode.com/2011/05/interleaved-array-basics.html}\n */\nclass InterleavedBuffer {\n\n\t/**\n\t * Constructs a new interleaved buffer.\n\t *\n\t * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.\n\t * @param {number} stride - The number of typed-array elements per vertex.\n\t */\n\tconstructor( array, stride ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInterleavedBuffer = true;\n\n\t\t/**\n\t\t * A typed array with a shared buffer storing attribute data.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.array = array;\n\n\t\t/**\n\t\t * The number of typed-array elements per vertex.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.stride = stride;\n\n\t\t/**\n\t\t * The total number of elements in the array\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\n\t\t/**\n\t\t * Defines the intended usage pattern of the data store for optimization purposes.\n\t\t *\n\t\t * Note: After the initial use of a buffer, its usage cannot be changed. Instead,\n\t\t * instantiate a new one and set the desired usage before the next render.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * This can be used to only update some components of stored vectors (for example, just the\n\t\t * component related to color). Use the `addUpdateRange()` function to add ranges to this array.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.updateRanges = [];\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t\t/**\n\t\t * The UUID of the interleaved buffer.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t}\n\n\t/**\n\t * A callback function that is executed after the renderer has transferred the attribute array\n\t * data to the GPU.\n\t */\n\tonUploadCallback() {}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the usage of this interleaved buffer.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {InterleavedBuffer} A reference to this interleaved buffer.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a range of data in the data array to be updated on the GPU.\n\t *\n\t * @param {number} start - Position at which to start update.\n\t * @param {number} count - The number of components to update.\n\t */\n\taddUpdateRange( start, count ) {\n\n\t\tthis.updateRanges.push( { start, count } );\n\n\t}\n\n\t/**\n\t * Clears the update ranges.\n\t */\n\tclearUpdateRanges() {\n\n\t\tthis.updateRanges.length = 0;\n\n\t}\n\n\t/**\n\t * Copies the values of the given interleaved buffer to this instance.\n\t *\n\t * @param {InterleavedBuffer} source - The interleaved buffer to copy.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.array = new source.array.constructor( source.array );\n\t\tthis.count = source.count;\n\t\tthis.stride = source.stride;\n\t\tthis.usage = source.usage;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies a vector from the given interleaved buffer to this one. The start\n\t * and destination position in the attribute buffers are represented by the\n\t * given indices.\n\t *\n\t * @param {number} index1 - The destination index into this interleaved buffer.\n\t * @param {InterleavedBuffer} interleavedBuffer - The interleaved buffer to copy from.\n\t * @param {number} index2 - The source index into the given interleaved buffer.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tcopyAt( index1, interleavedBuffer, index2 ) {\n\n\t\tindex1 *= this.stride;\n\t\tindex2 *= interleavedBuffer.stride;\n\n\t\tfor ( let i = 0, l = this.stride; i < l; i ++ ) {\n\n\t\t\tthis.array[ index1 + i ] = interleavedBuffer.array[ index2 + i ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given array data in the interleaved buffer.\n\t *\n\t * @param {(TypedArray|Array)} value - The array data to set.\n\t * @param {number} [offset=0] - The offset in this interleaved buffer's array.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tset( value, offset = 0 ) {\n\n\t\tthis.array.set( value, offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new interleaved buffer with copied values from this instance.\n\t *\n\t * @param {Object} [data] - An object with shared array buffers that allows to retain shared structures.\n\t * @return {InterleavedBuffer} A clone of this instance.\n\t */\n\tclone( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;\n\n\t\t}\n\n\t\tconst array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );\n\n\t\tconst ib = new this.constructor( array, this.stride );\n\t\tib.setUsage( this.usage );\n\n\t\treturn ib;\n\n\t}\n\n\t/**\n\t * Sets the given callback function that is executed after the Renderer has transferred\n\t * the array data to the GPU. Can be used to perform clean-up operations after\n\t * the upload when data are not needed anymore on the CPU side.\n\t *\n\t * @param {Function} callback - The `onUpload()` callback.\n\t * @return {InterleavedBuffer} A reference to this instance.\n\t */\n\tonUpload( callback ) {\n\n\t\tthis.onUploadCallback = callback;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the interleaved buffer into JSON.\n\t *\n\t * @param {Object} [data] - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized interleaved buffer.\n\t */\n\ttoJSON( data ) {\n\n\t\tif ( data.arrayBuffers === undefined ) {\n\n\t\t\tdata.arrayBuffers = {};\n\n\t\t}\n\n\t\t// generate UUID for array buffer if necessary\n\n\t\tif ( this.array.buffer._uuid === undefined ) {\n\n\t\t\tthis.array.buffer._uuid = generateUUID();\n\n\t\t}\n\n\t\tif ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {\n\n\t\t\tdata.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );\n\n\t\t}\n\n\t\t//\n\n\t\treturn {\n\t\t\tuuid: this.uuid,\n\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\ttype: this.array.constructor.name,\n\t\t\tstride: this.stride\n\t\t};\n\n\t}\n\n}\n\nconst _vector$7 = /*@__PURE__*/ new Vector3();\n\n/**\n * An alternative version of a buffer attribute with interleaved data. Interleaved\n * attributes share a common interleaved data storage ({@link InterleavedBuffer}) and refer with\n * different offsets into the buffer.\n */\nclass InterleavedBufferAttribute {\n\n\t/**\n\t * Constructs a new interleaved buffer attribute.\n\t *\n\t * @param {InterleavedBuffer} interleavedBuffer - The buffer holding the interleaved data.\n\t * @param {number} itemSize - The item size.\n\t * @param {number} offset - The attribute offset into the buffer.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( interleavedBuffer, itemSize, offset, normalized = false ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInterleavedBufferAttribute = true;\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The buffer holding the interleaved data.\n\t\t *\n\t\t * @type {InterleavedBuffer}\n\t\t */\n\t\tthis.data = interleavedBuffer;\n\n\t\t/**\n\t\t * The item size, see {@link BufferAttribute#itemSize}.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * The attribute offset into the buffer.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.offset = offset;\n\n\t\t/**\n\t\t * Whether the data are normalized or not, see {@link BufferAttribute#normalized}\n\t\t *\n\t\t * @type {InterleavedBuffer}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t}\n\n\t/**\n\t * The item count of this buffer attribute.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget count() {\n\n\t\treturn this.data.count;\n\n\t}\n\n\t/**\n\t * The array holding the interleaved buffer attribute data.\n\t *\n\t * @type {TypedArray}\n\t */\n\tget array() {\n\n\t\treturn this.data.array;\n\n\t}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tthis.data.needsUpdate = value;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tfor ( let i = 0, l = this.data.count; i < l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.applyMatrix4( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 3x3 normal matrix to the given attribute. Only works with\n\t * item size `3`.\n\t *\n\t * @param {Matrix3} m - The normal matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tapplyNormalMatrix( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.applyNormalMatrix( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Applies the given 4x4 matrix to the given attribute. Only works with\n\t * item size `3` and with direction vectors.\n\t *\n\t * @param {Matrix4} m - The matrix to apply.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\ttransformDirection( m ) {\n\n\t\tfor ( let i = 0, l = this.count; i < l; i ++ ) {\n\n\t\t\t_vector$7.fromBufferAttribute( this, i );\n\n\t\t\t_vector$7.transformDirection( m );\n\n\t\t\tthis.setXYZ( i, _vector$7.x, _vector$7.y, _vector$7.z );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @return {number} The returned value.\n\t */\n\tgetComponent( index, component ) {\n\n\t\tlet value = this.array[ index * this.data.stride + this.offset + component ];\n\n\t\tif ( this.normalized ) value = denormalize( value, this.array );\n\n\t\treturn value;\n\n\t}\n\n\t/**\n\t * Sets the given value to the given component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} component - The component index.\n\t * @param {number} value - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetComponent( index, component, value ) {\n\n\t\tif ( this.normalized ) value = normalize( value, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + component ] = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetX( index, x ) {\n\n\t\tif ( this.normalized ) x = normalize( x, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset ] = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} y - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetY( index, y ) {\n\n\t\tif ( this.normalized ) y = normalize( y, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} z - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetZ( index, z ) {\n\n\t\tif ( this.normalized ) z = normalize( z, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} w - The value to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetW( index, w ) {\n\n\t\tif ( this.normalized ) w = normalize( w, this.array );\n\n\t\tthis.data.array[ index * this.data.stride + this.offset + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the x component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The x component.\n\t */\n\tgetX( index ) {\n\n\t\tlet x = this.data.array[ index * this.data.stride + this.offset ];\n\n\t\tif ( this.normalized ) x = denormalize( x, this.array );\n\n\t\treturn x;\n\n\t}\n\n\t/**\n\t * Returns the y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The y component.\n\t */\n\tgetY( index ) {\n\n\t\tlet y = this.data.array[ index * this.data.stride + this.offset + 1 ];\n\n\t\tif ( this.normalized ) y = denormalize( y, this.array );\n\n\t\treturn y;\n\n\t}\n\n\t/**\n\t * Returns the z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The z component.\n\t */\n\tgetZ( index ) {\n\n\t\tlet z = this.data.array[ index * this.data.stride + this.offset + 2 ];\n\n\t\tif ( this.normalized ) z = denormalize( z, this.array );\n\n\t\treturn z;\n\n\t}\n\n\t/**\n\t * Returns the w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @return {number} The w component.\n\t */\n\tgetW( index ) {\n\n\t\tlet w = this.data.array[ index * this.data.stride + this.offset + 3 ];\n\n\t\tif ( this.normalized ) w = denormalize( w, this.array );\n\n\t\treturn w;\n\n\t}\n\n\t/**\n\t * Sets the x and y component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXY( index, x, y ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXYZ( index, x, y, z ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y, z and w component of the vector at the given index.\n\t *\n\t * @param {number} index - The index into the buffer attribute.\n\t * @param {number} x - The value for the x component to set.\n\t * @param {number} y - The value for the y component to set.\n\t * @param {number} z - The value for the z component to set.\n\t * @param {number} w - The value for the w component to set.\n\t * @return {InterleavedBufferAttribute} A reference to this instance.\n\t */\n\tsetXYZW( index, x, y, z, w ) {\n\n\t\tindex = index * this.data.stride + this.offset;\n\n\t\tif ( this.normalized ) {\n\n\t\t\tx = normalize( x, this.array );\n\t\t\ty = normalize( y, this.array );\n\t\t\tz = normalize( z, this.array );\n\t\t\tw = normalize( w, this.array );\n\n\t\t}\n\n\t\tthis.data.array[ index + 0 ] = x;\n\t\tthis.data.array[ index + 1 ] = y;\n\t\tthis.data.array[ index + 2 ] = z;\n\t\tthis.data.array[ index + 3 ] = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new buffer attribute with copied values from this instance.\n\t *\n\t * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n\t *\n\t * @param {Object} [data] - An object with interleaved buffers that allows to retain the interleaved property.\n\t * @return {BufferAttribute|InterleavedBufferAttribute} A clone of this instance.\n\t */\n\tclone( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn new BufferAttribute( new this.array.constructor( array ), this.itemSize, this.normalized );\n\n\t\t} else {\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.clone( data );\n\n\t\t\t}\n\n\t\t\treturn new InterleavedBufferAttribute( data.interleavedBuffers[ this.data.uuid ], this.itemSize, this.offset, this.normalized );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Serializes the buffer attribute into JSON.\n\t *\n\t * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data.\n\t *\n\t * @param {Object} [data] - An optional value holding meta information about the serialization.\n\t * @return {Object} A JSON object representing the serialized buffer attribute.\n\t */\n\ttoJSON( data ) {\n\n\t\tif ( data === undefined ) {\n\n\t\t\tconsole.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );\n\n\t\t\tconst array = [];\n\n\t\t\tfor ( let i = 0; i < this.count; i ++ ) {\n\n\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\tfor ( let j = 0; j < this.itemSize; j ++ ) {\n\n\t\t\t\t\tarray.push( this.data.array[ index + j ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// de-interleave data and save it as an ordinary buffer attribute for now\n\n\t\t\treturn {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: array,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t} else {\n\n\t\t\t// save as true interleaved attribute\n\n\t\t\tif ( data.interleavedBuffers === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers = {};\n\n\t\t\t}\n\n\t\t\tif ( data.interleavedBuffers[ this.data.uuid ] === undefined ) {\n\n\t\t\t\tdata.interleavedBuffers[ this.data.uuid ] = this.data.toJSON( data );\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\tdata: this.data.uuid,\n\t\t\t\toffset: this.offset,\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * A material for rendering instances of {@link Sprite}.\n *\n * ```js\n * const map = new THREE.TextureLoader().load( 'textures/sprite.png' );\n * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } );\n *\n * const sprite = new THREE.Sprite( material );\n * sprite.scale.set(200, 200, 1)\n * scene.add( sprite );\n * ```\n *\n * @augments Material\n */\nclass SpriteMaterial extends Material {\n\n\t/**\n\t * Constructs a new sprite material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpriteMaterial = true;\n\n\t\tthis.type = 'SpriteMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The rotation of the sprite in radians.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.rotation = 0;\n\n\t\t/**\n\t\t * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sizeAttenuation = true;\n\n\t\t/**\n\t\t * Overwritten since sprite materials are transparent\n\t\t * by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.transparent = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.rotation = source.rotation;\n\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _geometry;\n\nconst _intersectPoint = /*@__PURE__*/ new Vector3();\nconst _worldScale = /*@__PURE__*/ new Vector3();\nconst _mvPosition = /*@__PURE__*/ new Vector3();\n\nconst _alignedPosition = /*@__PURE__*/ new Vector2();\nconst _rotatedPosition = /*@__PURE__*/ new Vector2();\nconst _viewWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _uvA = /*@__PURE__*/ new Vector2();\nconst _uvB = /*@__PURE__*/ new Vector2();\nconst _uvC = /*@__PURE__*/ new Vector2();\n\n/**\n * A sprite is a plane that always faces towards the camera, generally with a\n * partially transparent texture applied.\n *\n * Sprites do not cast shadows, setting {@link Object3D#castShadow} to `true` will\n * have no effect.\n *\n * ```js\n * const map = new THREE.TextureLoader().load( 'sprite.png' );\n * const material = new THREE.SpriteMaterial( { map: map } );\n *\n * const sprite = new THREE.Sprite( material );\n * scene.add( sprite );\n * ```\n *\n * @augments Object3D\n */\nclass Sprite extends Object3D {\n\n\t/**\n\t * Constructs a new sprite.\n\t *\n\t * @param {SpriteMaterial} [material] - The sprite material.\n\t */\n\tconstructor( material = new SpriteMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSprite = true;\n\n\t\tthis.type = 'Sprite';\n\n\t\tif ( _geometry === undefined ) {\n\n\t\t\t_geometry = new BufferGeometry();\n\n\t\t\tconst float32Array = new Float32Array( [\n\t\t\t\t-0.5, -0.5, 0, 0, 0,\n\t\t\t\t0.5, -0.5, 0, 1, 0,\n\t\t\t\t0.5, 0.5, 0, 1, 1,\n\t\t\t\t-0.5, 0.5, 0, 0, 1\n\t\t\t] );\n\n\t\t\tconst interleavedBuffer = new InterleavedBuffer( float32Array, 5 );\n\n\t\t\t_geometry.setIndex( [ 0, 1, 2,\t0, 2, 3 ] );\n\t\t\t_geometry.setAttribute( 'position', new InterleavedBufferAttribute( interleavedBuffer, 3, 0, false ) );\n\t\t\t_geometry.setAttribute( 'uv', new InterleavedBufferAttribute( interleavedBuffer, 2, 3, false ) );\n\n\t\t}\n\n\t\t/**\n\t\t * The sprite geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = _geometry;\n\n\t\t/**\n\t\t * The sprite material.\n\t\t *\n\t\t * @type {SpriteMaterial}\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * The sprite's anchor point, and the point around which the sprite rotates.\n\t\t * A value of `(0.5, 0.5)` corresponds to the midpoint of the sprite. A value\n\t\t * of `(0, 0)` corresponds to the lower left corner of the sprite.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\t/**\n\t\t * The number of instances of this sprite.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this sprite.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tif ( raycaster.camera === null ) {\n\n\t\t\tconsole.error( 'THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.' );\n\n\t\t}\n\n\t\t_worldScale.setFromMatrixScale( this.matrixWorld );\n\n\t\t_viewWorldMatrix.copy( raycaster.camera.matrixWorld );\n\t\tthis.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );\n\n\t\t_mvPosition.setFromMatrixPosition( this.modelViewMatrix );\n\n\t\tif ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {\n\n\t\t\t_worldScale.multiplyScalar( - _mvPosition.z );\n\n\t\t}\n\n\t\tconst rotation = this.material.rotation;\n\t\tlet sin, cos;\n\n\t\tif ( rotation !== 0 ) {\n\n\t\t\tcos = Math.cos( rotation );\n\t\t\tsin = Math.sin( rotation );\n\n\t\t}\n\n\t\tconst center = this.center;\n\n\t\ttransformVertex( _vA.set( -0.5, -0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vB.set( 0.5, -0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\ttransformVertex( _vC.set( 0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\n\t\t_uvA.set( 0, 0 );\n\t\t_uvB.set( 1, 0 );\n\t\t_uvC.set( 1, 1 );\n\n\t\t// check first triangle\n\t\tlet intersect = raycaster.ray.intersectTriangle( _vA, _vB, _vC, false, _intersectPoint );\n\n\t\tif ( intersect === null ) {\n\n\t\t\t// check second triangle\n\t\t\ttransformVertex( _vB.set( -0.5, 0.5, 0 ), _mvPosition, center, _worldScale, sin, cos );\n\t\t\t_uvB.set( 0, 1 );\n\n\t\t\tintersect = raycaster.ray.intersectTriangle( _vA, _vC, _vB, false, _intersectPoint );\n\t\t\tif ( intersect === null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( _intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectPoint.clone(),\n\t\t\tuv: Triangle.getInterpolation( _intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2() ),\n\t\t\tface: null,\n\t\t\tobject: this\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.center !== undefined ) this.center.copy( source.center );\n\n\t\tthis.material = source.material;\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {\n\n\t// compute position in camera space\n\t_alignedPosition.subVectors( vertexPosition, center ).addScalar( 0.5 ).multiply( scale );\n\n\t// to check if rotation is not zero\n\tif ( sin !== undefined ) {\n\n\t\t_rotatedPosition.x = ( cos * _alignedPosition.x ) - ( sin * _alignedPosition.y );\n\t\t_rotatedPosition.y = ( sin * _alignedPosition.x ) + ( cos * _alignedPosition.y );\n\n\t} else {\n\n\t\t_rotatedPosition.copy( _alignedPosition );\n\n\t}\n\n\n\tvertexPosition.copy( mvPosition );\n\tvertexPosition.x += _rotatedPosition.x;\n\tvertexPosition.y += _rotatedPosition.y;\n\n\t// transform to world space\n\tvertexPosition.applyMatrix4( _viewWorldMatrix );\n\n}\n\nconst _v1$2 = /*@__PURE__*/ new Vector3();\nconst _v2$1 = /*@__PURE__*/ new Vector3();\n\n/**\n * A component for providing a basic Level of Detail (LOD) mechanism.\n *\n * Every LOD level is associated with an object, and rendering can be switched\n * between them at the distances specified. Typically you would create, say,\n * three meshes, one for far away (low detail), one for mid range (medium\n * detail) and one for close up (high detail).\n *\n * ```js\n * const lod = new THREE.LOD();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n *\n * //Create spheres with 3 levels of detail and create new LOD levels for them\n * for( let i = 0; i < 3; i++ ) {\n *\n * \tconst geometry = new THREE.IcosahedronGeometry( 10, 3 - i );\n * \tconst mesh = new THREE.Mesh( geometry, material );\n * \tlod.addLevel( mesh, i * 75 );\n *\n * }\n *\n * scene.add( lod );\n * ```\n *\n * @augments Object3D\n */\nclass LOD extends Object3D {\n\n\t/**\n\t * Constructs a new LOD.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLOD = true;\n\n\t\t/**\n\t\t * The current LOD index.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis._currentLevel = 0;\n\n\t\tthis.type = 'LOD';\n\n\t\tObject.defineProperties( this, {\n\t\t\t/**\n\t\t\t * This array holds the LOD levels.\n\t\t\t *\n\t\t\t * @name LOD#levels\n\t\t\t * @type {Array<{object:Object3D,distance:number,hysteresis:number}>}\n\t\t\t */\n\t\t\tlevels: {\n\t\t\t\tenumerable: true,\n\t\t\t\tvalue: []\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * Whether the LOD object is updated automatically by the renderer per frame\n\t\t * or not. If set to `false`, you have to call {@link LOD#update} in the\n\t\t * render loop by yourself.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoUpdate = true;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tconst levels = source.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tthis.addLevel( level.object.clone(), level.distance, level.hysteresis );\n\n\t\t}\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds a mesh that will display at a certain distance and greater. Typically\n\t * the further away the distance, the lower the detail on the mesh.\n\t *\n\t * @param {Object3D} object - The 3D object to display at this level.\n\t * @param {number} [distance=0] - The distance at which to display this level of detail.\n\t * @param {number} [hysteresis=0] - Threshold used to avoid flickering at LOD boundaries, as a fraction of distance.\n\t * @return {LOD} A reference to this instance.\n\t */\n\taddLevel( object, distance = 0, hysteresis = 0 ) {\n\n\t\tdistance = Math.abs( distance );\n\n\t\tconst levels = this.levels;\n\n\t\tlet l;\n\n\t\tfor ( l = 0; l < levels.length; l ++ ) {\n\n\t\t\tif ( distance < levels[ l ].distance ) {\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlevels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } );\n\n\t\tthis.add( object );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes an existing level, based on the distance from the camera.\n\t * Returns `true` when the level has been removed. Otherwise `false`.\n\t *\n\t * @param {number} distance - Distance of the level to remove.\n\t * @return {boolean} Whether the level has been removed or not.\n\t */\n\tremoveLevel( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0; i < levels.length; i ++ ) {\n\n\t\t\tif ( levels[ i ].distance === distance ) {\n\n\t\t\t\tconst removedElements = levels.splice( i, 1 );\n\t\t\t\tthis.remove( removedElements[ 0 ].object );\n\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t/**\n\t * Returns the currently active LOD level index.\n\t *\n\t * @return {number} The current active LOD level index.\n\t */\n\tgetCurrentLevel() {\n\n\t\treturn this._currentLevel;\n\n\t}\n\n\t/**\n\t * Returns a reference to the first 3D object that is greater than\n\t * the given distance.\n\t *\n\t * @param {number} distance - The LOD distance.\n\t * @return {Object3D|null} The found 3D object. `null` if no 3D object has been found.\n\t */\n\tgetObjectForDistance( distance ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance < levelDistance ) {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn levels[ i - 1 ].object;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this LOD.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 0 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo( _v1$2 );\n\n\t\t\tthis.getObjectForDistance( distance ).raycast( raycaster, intersects );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Updates the LOD by computing which LOD level should be visible according\n\t * to the current distance of the given camera.\n\t *\n\t * @param {Camera} camera - The camera the scene is rendered with.\n\t */\n\tupdate( camera ) {\n\n\t\tconst levels = this.levels;\n\n\t\tif ( levels.length > 1 ) {\n\n\t\t\t_v1$2.setFromMatrixPosition( camera.matrixWorld );\n\t\t\t_v2$1.setFromMatrixPosition( this.matrixWorld );\n\n\t\t\tconst distance = _v1$2.distanceTo( _v2$1 ) / camera.zoom;\n\n\t\t\tlevels[ 0 ].object.visible = true;\n\n\t\t\tlet i, l;\n\n\t\t\tfor ( i = 1, l = levels.length; i < l; i ++ ) {\n\n\t\t\t\tlet levelDistance = levels[ i ].distance;\n\n\t\t\t\tif ( levels[ i ].object.visible ) {\n\n\t\t\t\t\tlevelDistance -= levelDistance * levels[ i ].hysteresis;\n\n\t\t\t\t}\n\n\t\t\t\tif ( distance >= levelDistance ) {\n\n\t\t\t\t\tlevels[ i - 1 ].object.visible = false;\n\t\t\t\t\tlevels[ i ].object.visible = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._currentLevel = i - 1;\n\n\t\t\tfor ( ; i < l; i ++ ) {\n\n\t\t\t\tlevels[ i ].object.visible = false;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.autoUpdate === false ) data.object.autoUpdate = false;\n\n\t\tdata.object.levels = [];\n\n\t\tconst levels = this.levels;\n\n\t\tfor ( let i = 0, l = levels.length; i < l; i ++ ) {\n\n\t\t\tconst level = levels[ i ];\n\n\t\t\tdata.object.levels.push( {\n\t\t\t\tobject: level.object.uuid,\n\t\t\t\tdistance: level.distance,\n\t\t\t\thysteresis: level.hysteresis\n\t\t\t} );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _basePosition = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\n\nconst _vector3 = /*@__PURE__*/ new Vector3();\nconst _matrix4 = /*@__PURE__*/ new Matrix4();\nconst _vertex = /*@__PURE__*/ new Vector3();\n\nconst _sphere$5 = /*@__PURE__*/ new Sphere();\nconst _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _ray$2 = /*@__PURE__*/ new Ray();\n\n/**\n * A mesh that has a {@link Skeleton} that can then be used to animate the\n * vertices of the geometry with skinning/skeleton animation.\n *\n * Next to a valid skeleton, the skinned mesh requires skin indices and weights\n * as buffer attributes in its geometry. These attribute define which bones affect a single\n * vertex to a certain extend.\n *\n * Typically skinned meshes are not created manually but loaders like {@link GLTFLoader}\n * or {@link FBXLoader } import respective models.\n *\n * @augments Mesh\n */\nclass SkinnedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new skinned mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSkinnedMesh = true;\n\n\t\tthis.type = 'SkinnedMesh';\n\n\t\t/**\n\t\t * `AttachedBindMode` means the skinned mesh shares the same world space as the skeleton.\n\t\t * This is not true when using `DetachedBindMode` which is useful when sharing a skeleton\n\t\t * across multiple skinned meshes.\n\t\t *\n\t\t * @type {(AttachedBindMode|DetachedBindMode)}\n\t\t * @default AttachedBindMode\n\t\t */\n\t\tthis.bindMode = AttachedBindMode;\n\n\t\t/**\n\t\t * The base matrix that is used for the bound bone transforms.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.bindMatrix = new Matrix4();\n\n\t\t/**\n\t\t * The base matrix that is used for resetting the bound bone transforms.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.bindMatrixInverse = new Matrix4();\n\n\t\t/**\n\t\t * The bounding box of the skinned mesh. Can be computed via {@link SkinnedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the skinned mesh. Can be computed via {@link SkinnedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the skinned mesh, and updates {@link SkinnedMesh#boundingBox}.\n\t * The bounding box is not automatically computed by the engine; this method must be called by your app.\n\t * If the skinned mesh is animated, the bounding box should be recomputed per frame in order to reflect\n\t * the current animation state.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingBox.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the skinned mesh, and updates {@link SkinnedMesh#boundingSphere}.\n\t * The bounding sphere is automatically computed by the engine once when it is needed, e.g., for ray casting\n\t * and view frustum culling. If the skinned mesh is animated, the bounding sphere should be recomputed\n\t * per frame in order to reflect the current animation state.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tconst positionAttribute = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0; i < positionAttribute.count; i ++ ) {\n\n\t\t\tthis.getVertexPosition( i, _vertex );\n\t\t\tthis.boundingSphere.expandByPoint( _vertex );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.bindMode = source.bindMode;\n\t\tthis.bindMatrix.copy( source.bindMatrix );\n\t\tthis.bindMatrixInverse.copy( source.bindMatrixInverse );\n\n\t\tthis.skeleton = source.skeleton;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$5.copy( this.boundingSphere );\n\t\t_sphere$5.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$5 ) === false ) return;\n\n\t\t// convert ray to local space of skinned mesh\n\n\t\t_inverseMatrix$2.copy( matrixWorld ).invert();\n\t\t_ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( this.boundingBox !== null ) {\n\n\t\t\tif ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray$2 );\n\n\t}\n\n\tgetVertexPosition( index, target ) {\n\n\t\tsuper.getVertexPosition( index, target );\n\n\t\tthis.applyBoneTransform( index, target );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Binds the given skeleton to the skinned mesh.\n\t *\n\t * @param {Skeleton} skeleton - The skeleton to bind.\n\t * @param {Matrix4} [bindMatrix] - The bind matrix. If no bind matrix is provided,\n\t * the skinned mesh's world matrix will be used instead.\n\t */\n\tbind( skeleton, bindMatrix ) {\n\n\t\tthis.skeleton = skeleton;\n\n\t\tif ( bindMatrix === undefined ) {\n\n\t\t\tthis.updateMatrixWorld( true );\n\n\t\t\tthis.skeleton.calculateInverses();\n\n\t\t\tbindMatrix = this.matrixWorld;\n\n\t\t}\n\n\t\tthis.bindMatrix.copy( bindMatrix );\n\t\tthis.bindMatrixInverse.copy( bindMatrix ).invert();\n\n\t}\n\n\t/**\n\t * This method sets the skinned mesh in the rest pose).\n\t */\n\tpose() {\n\n\t\tthis.skeleton.pose();\n\n\t}\n\n\t/**\n\t * Normalizes the skin weights which are defined as a buffer attribute\n\t * in the skinned mesh's geometry.\n\t */\n\tnormalizeSkinWeights() {\n\n\t\tconst vector = new Vector4();\n\n\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\tfor ( let i = 0, l = skinWeight.count; i < l; i ++ ) {\n\n\t\t\tvector.fromBufferAttribute( skinWeight, i );\n\n\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\tif ( scale !== Infinity ) {\n\n\t\t\t\tvector.multiplyScalar( scale );\n\n\t\t\t} else {\n\n\t\t\t\tvector.set( 1, 0, 0, 0 ); // do something reasonable\n\n\t\t\t}\n\n\t\t\tskinWeight.setXYZW( i, vector.x, vector.y, vector.z, vector.w );\n\n\t\t}\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.bindMode === AttachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.matrixWorld ).invert();\n\n\t\t} else if ( this.bindMode === DetachedBindMode ) {\n\n\t\t\tthis.bindMatrixInverse.copy( this.bindMatrix ).invert();\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Applies the bone transform associated with the given index to the given\n\t * vertex position. Returns the updated vector.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * the skinned mesh's world matrix will be used instead.\n\t * @return {Vector3} The updated vertex position.\n\t */\n\tapplyBoneTransform( index, target ) {\n\n\t\tconst skeleton = this.skeleton;\n\t\tconst geometry = this.geometry;\n\n\t\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t\t_basePosition.copy( target ).applyMatrix4( this.bindMatrix );\n\n\t\ttarget.set( 0, 0, 0 );\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\t\tif ( weight !== 0 ) {\n\n\t\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\n\t\t\t\t_matrix4.multiplyMatrices( skeleton.bones[ boneIndex ].matrixWorld, skeleton.boneInverses[ boneIndex ] );\n\n\t\t\t\ttarget.addScaledVector( _vector3.copy( _basePosition ).applyMatrix4( _matrix4 ), weight );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn target.applyMatrix4( this.bindMatrixInverse );\n\n\t}\n\n}\n\n/**\n * A bone which is part of a {@link Skeleton}. The skeleton in turn is used by\n * the {@link SkinnedMesh}.\n *\n * ```js\n * const root = new THREE.Bone();\n * const child = new THREE.Bone();\n *\n * root.add( child );\n * child.position.y = 5;\n * ```\n *\n * @augments Object3D\n */\nclass Bone extends Object3D {\n\n\t/**\n\t * Constructs a new bone.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBone = true;\n\n\t\tthis.type = 'Bone';\n\n\t}\n\n}\n\n/**\n * Creates a texture directly from raw buffer data.\n *\n * The interpretation of the data depends on type and format: If the type is\n * `UnsignedByteType`, a `Uint8Array` will be useful for addressing the\n * texel data. If the format is `RGBAFormat`, data needs four values for\n * one texel; Red, Green, Blue and Alpha (typically the opacity).\n *\n * @augments Texture\n */\nclass DataTexture extends Texture {\n\n\t/**\n\t * Constructs a new data texture.\n\t *\n\t * @param {?TypedArray} [data=null] - The buffer data.\n\t * @param {number} [width=1] - The width of the texture.\n\t * @param {number} [height=1] - The height of the texture.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=NearestFilter] - The mag filter value.\n\t * @param {number} [minFilter=NearestFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDataTexture = true;\n\n\t\t/**\n\t\t * The image definition of a data texture.\n\t\t *\n\t\t * @type {{data:TypedArray,width:number,height:number}}\n\t\t */\n\t\tthis.image = { data: data, width: width, height: height };\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Specifies the alignment requirements for the start of each pixel row in memory.\n\t\t *\n\t\t * Overwritten and set to `1` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default 1\n\t\t */\n\t\tthis.unpackAlignment = 1;\n\n\t}\n\n}\n\nconst _offsetMatrix = /*@__PURE__*/ new Matrix4();\nconst _identityMatrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * Class for representing the armatures in `three.js`. The skeleton\n * is defined by a hierarchy of bones.\n *\n * ```js\n * const bones = [];\n *\n * const shoulder = new THREE.Bone();\n * const elbow = new THREE.Bone();\n * const hand = new THREE.Bone();\n *\n * shoulder.add( elbow );\n * elbow.add( hand );\n *\n * bones.push( shoulder , elbow, hand);\n *\n * shoulder.position.y = -5;\n * elbow.position.y = 0;\n * hand.position.y = 5;\n *\n * const armSkeleton = new THREE.Skeleton( bones );\n * ```\n */\nclass Skeleton {\n\n\t/**\n\t * Constructs a new skeleton.\n\t *\n\t * @param {Array<Bone>} [bones] - An array of bones.\n\t * @param {Array<Matrix4>} [boneInverses] - An array of bone inverse matrices.\n\t * If not provided, these matrices will be computed automatically via {@link Skeleton#calculateInverses}.\n\t */\n\tconstructor( bones = [], boneInverses = [] ) {\n\n\t\tthis.uuid = generateUUID();\n\n\t\t/**\n\t\t * An array of bones defining the skeleton.\n\t\t *\n\t\t * @type {Array<Bone>}\n\t\t */\n\t\tthis.bones = bones.slice( 0 );\n\n\t\t/**\n\t\t * An array of bone inverse matrices.\n\t\t *\n\t\t * @type {Array<Matrix4>}\n\t\t */\n\t\tthis.boneInverses = boneInverses;\n\n\t\t/**\n\t\t * An array buffer holding the bone data.\n\t\t * Input data for {@link Skeleton#boneTexture}.\n\t\t *\n\t\t * @type {?Float32Array}\n\t\t * @default null\n\t\t */\n\t\tthis.boneMatrices = null;\n\n\t\t/**\n\t\t * A texture holding the bone data for use\n\t\t * in the vertex shader.\n\t\t *\n\t\t * @type {?DataTexture}\n\t\t * @default null\n\t\t */\n\t\tthis.boneTexture = null;\n\n\t\tthis.init();\n\n\t}\n\n\t/**\n\t * Initializes the skeleton. This method gets automatically called by the constructor\n\t * but depending on how the skeleton is created it might be necessary to call this method\n\t * manually.\n\t */\n\tinit() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tthis.boneMatrices = new Float32Array( bones.length * 16 );\n\n\t\t// calculate inverse bone matrices if necessary\n\n\t\tif ( boneInverses.length === 0 ) {\n\n\t\t\tthis.calculateInverses();\n\n\t\t} else {\n\n\t\t\t// handle special case\n\n\t\t\tif ( bones.length !== boneInverses.length ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );\n\n\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\t\t\tthis.boneInverses.push( new Matrix4() );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bone inverse matrices. This method resets {@link Skeleton#boneInverses}\n\t * and fills it with new matrices.\n\t */\n\tcalculateInverses() {\n\n\t\tthis.boneInverses.length = 0;\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst inverse = new Matrix4();\n\n\t\t\tif ( this.bones[ i ] ) {\n\n\t\t\t\tinverse.copy( this.bones[ i ].matrixWorld ).invert();\n\n\t\t\t}\n\n\t\t\tthis.boneInverses.push( inverse );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resets the skeleton to the base pose.\n\t */\n\tpose() {\n\n\t\t// recover the bind-time world matrices\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tbone.matrixWorld.copy( this.boneInverses[ i ] ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute the local matrices, positions, rotations and scales\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone ) {\n\n\t\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t\tbone.matrix.copy( bone.parent.matrixWorld ).invert();\n\t\t\t\t\tbone.matrix.multiply( bone.matrixWorld );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbone.matrix.copy( bone.matrixWorld );\n\n\t\t\t\t}\n\n\t\t\t\tbone.matrix.decompose( bone.position, bone.quaternion, bone.scale );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resets the skeleton to the base pose.\n\t */\n\tupdate() {\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\t\tconst boneMatrices = this.boneMatrices;\n\t\tconst boneTexture = this.boneTexture;\n\n\t\t// flatten bone matrices to array\n\n\t\tfor ( let i = 0, il = bones.length; i < il; i ++ ) {\n\n\t\t\t// compute the offset between the current and the original transform\n\n\t\t\tconst matrix = bones[ i ] ? bones[ i ].matrixWorld : _identityMatrix;\n\n\t\t\t_offsetMatrix.multiplyMatrices( matrix, boneInverses[ i ] );\n\t\t\t_offsetMatrix.toArray( boneMatrices, i * 16 );\n\n\t\t}\n\n\t\tif ( boneTexture !== null ) {\n\n\t\t\tboneTexture.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new skeleton with copied values from this instance.\n\t *\n\t * @return {Skeleton} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Skeleton( this.bones, this.boneInverses );\n\n\t}\n\n\t/**\n\t * Computes a data texture for passing bone data to the vertex shader.\n\t *\n\t * @return {Skeleton} A reference of this instance.\n\t */\n\tcomputeBoneTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t//      RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t//  with  8x8  pixel texture max   16 bones * 4 pixels =  (8 * 8)\n\t\t//       16x16 pixel texture max   64 bones * 4 pixels = (16 * 16)\n\t\t//       32x32 pixel texture max  256 bones * 4 pixels = (32 * 32)\n\t\t//       64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this.bones.length * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst boneMatrices = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tboneMatrices.set( this.boneMatrices ); // copy current values\n\n\t\tconst boneTexture = new DataTexture( boneMatrices, size, size, RGBAFormat, FloatType );\n\t\tboneTexture.needsUpdate = true;\n\n\t\tthis.boneMatrices = boneMatrices;\n\t\tthis.boneTexture = boneTexture;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Searches through the skeleton's bone array and returns the first with a\n\t * matching name.\n\t *\n\t * @param {string} name - The name of the bone.\n\t * @return {Bone|undefined} The found bone. `undefined` if no bone has been found.\n\t */\n\tgetBoneByName( name ) {\n\n\t\tfor ( let i = 0, il = this.bones.length; i < il; i ++ ) {\n\n\t\t\tconst bone = this.bones[ i ];\n\n\t\t\tif ( bone.name === name ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn undefined;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose( ) {\n\n\t\tif ( this.boneTexture !== null ) {\n\n\t\t\tthis.boneTexture.dispose();\n\n\t\t\tthis.boneTexture = null;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Setups the skeleton by the given JSON and bones.\n\t *\n\t * @param {Object} json - The skeleton as serialized JSON.\n\t * @param {Object<string, Bone>} bones - An array of bones.\n\t * @return {Skeleton} A reference of this instance.\n\t */\n\tfromJSON( json, bones ) {\n\n\t\tthis.uuid = json.uuid;\n\n\t\tfor ( let i = 0, l = json.bones.length; i < l; i ++ ) {\n\n\t\t\tconst uuid = json.bones[ i ];\n\t\t\tlet bone = bones[ uuid ];\n\n\t\t\tif ( bone === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );\n\t\t\t\tbone = new Bone();\n\n\t\t\t}\n\n\t\t\tthis.bones.push( bone );\n\t\t\tthis.boneInverses.push( new Matrix4().fromArray( json.boneInverses[ i ] ) );\n\n\t\t}\n\n\t\tthis.init();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the skeleton into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized skeleton.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Skeleton',\n\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t},\n\t\t\tbones: [],\n\t\t\tboneInverses: []\n\t\t};\n\n\t\tdata.uuid = this.uuid;\n\n\t\tconst bones = this.bones;\n\t\tconst boneInverses = this.boneInverses;\n\n\t\tfor ( let i = 0, l = bones.length; i < l; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\t\t\tdata.bones.push( bone.uuid );\n\n\t\t\tconst boneInverse = boneInverses[ i ];\n\t\t\tdata.boneInverses.push( boneInverse.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * An instanced version of a buffer attribute.\n *\n * @augments BufferAttribute\n */\nclass InstancedBufferAttribute extends BufferAttribute {\n\n\t/**\n\t * Constructs a new instanced buffer attribute.\n\t *\n\t * @param {TypedArray} array - The array holding the attribute data.\n\t * @param {number} itemSize - The item size.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t * @param {number} [meshPerAttribute=1] - How often a value of this buffer attribute should be repeated.\n\t */\n\tconstructor( array, itemSize, normalized, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, itemSize, normalized );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedBufferAttribute = true;\n\n\t\t/**\n\t\t * Defines how often a value of this buffer attribute should be repeated. A\n\t\t * value of one means that each value of the instanced attribute is used for\n\t\t * a single instance. A value of two means that each value is used for two\n\t\t * consecutive instances (and so on).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\n\t\tdata.isInstancedBufferAttribute = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\nconst _instanceLocalMatrix = /*@__PURE__*/ new Matrix4();\nconst _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();\n\nconst _instanceIntersects = [];\n\nconst _box3 = /*@__PURE__*/ new Box3();\nconst _identity = /*@__PURE__*/ new Matrix4();\nconst _mesh$1 = /*@__PURE__*/ new Mesh();\nconst _sphere$4 = /*@__PURE__*/ new Sphere();\n\n/**\n * A special version of a mesh with instanced rendering support. Use\n * this class if you have to render a large number of objects with the same\n * geometry and material(s) but with different world transformations. The usage\n * of 'InstancedMesh' will help you to reduce the number of draw calls and thus\n * improve the overall rendering performance in your application.\n *\n * @augments Mesh\n */\nclass InstancedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new instanced mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t * @param {number} count - The number of instances.\n\t */\n\tconstructor( geometry, material, count ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedMesh = true;\n\n\t\t/**\n\t\t * Represents the local transformation of all instances. You have to set its\n\t\t * {@link BufferAttribute#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setMatrixAt}.\n\t\t *\n\t\t * @type {InstancedBufferAttribute}\n\t\t */\n\t\tthis.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );\n\n\t\t/**\n\t\t * Represents the color of all instances. You have to set its\n\t\t * {@link BufferAttribute#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setColorAt}.\n\t\t *\n\t\t * @type {?InstancedBufferAttribute}\n\t\t * @default null\n\t\t */\n\t\tthis.instanceColor = null;\n\n\t\t/**\n\t\t * Represents the morph target weights of all instances. You have to set its\n\t\t * {@link Texture#needsUpdate} flag to true if you modify instanced data\n\t\t * via {@link InstancedMesh#setMorphAt}.\n\t\t *\n\t\t * @type {?DataTexture}\n\t\t * @default null\n\t\t */\n\t\tthis.morphTexture = null;\n\n\t\t/**\n\t\t * The number of instances.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.count = count;\n\n\t\t/**\n\t\t * The bounding box of the instanced mesh. Can be computed via {@link InstancedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the instanced mesh. Can be computed via {@link InstancedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.setMatrixAt( i, _identity );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding box of the instanced mesh, and updates {@link InstancedMesh#boundingBox}.\n\t * The bounding box is not automatically computed by the engine; this method must be called by your app.\n\t * You may need to recompute the bounding box if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( geometry.boundingBox === null ) {\n\n\t\t\tgeometry.computeBoundingBox();\n\n\t\t}\n\n\t\tthis.boundingBox.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_box3.copy( geometry.boundingBox ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingBox.union( _box3 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere of the instanced mesh, and updates {@link InstancedMesh#boundingSphere}\n\t * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling.\n\t * You may need to recompute the bounding sphere if an instance is transformed via {@link InstancedMesh#setMatrixAt}.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst count = this.count;\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tif ( geometry.boundingSphere === null ) {\n\n\t\t\tgeometry.computeBoundingSphere();\n\n\t\t}\n\n\t\tthis.boundingSphere.makeEmpty();\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tthis.getMatrixAt( i, _instanceLocalMatrix );\n\n\t\t\t_sphere$4.copy( geometry.boundingSphere ).applyMatrix4( _instanceLocalMatrix );\n\n\t\t\tthis.boundingSphere.union( _sphere$4 );\n\n\t\t}\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.instanceMatrix.copy( source.instanceMatrix );\n\n\t\tif ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();\n\t\tif ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();\n\n\t\tthis.count = source.count;\n\n\t\tif ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();\n\t\tif ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Gets the color of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Color} color - The target object that is used to store the method's result.\n\t */\n\tgetColorAt( index, color ) {\n\n\t\tcolor.fromArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\t/**\n\t * Gets the local transformation matrix of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Matrix4} matrix - The target object that is used to store the method's result.\n\t */\n\tgetMatrixAt( index, matrix ) {\n\n\t\tmatrix.fromArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\t/**\n\t * Gets the morph target weights of the defined instance.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Mesh} object - The target object that is used to store the method's result.\n\t */\n\tgetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tconst len = objectInfluences.length + 1; // All influences + the baseInfluenceSum\n\n\t\tconst dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tobjectInfluences[ i ] = array[ dataIndex + i ];\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst raycastTimes = this.count;\n\n\t\t_mesh$1.geometry = this.geometry;\n\t\t_mesh$1.material = this.material;\n\n\t\tif ( _mesh$1.material === undefined ) return;\n\n\t\t// test with bounding sphere first\n\n\t\tif ( this.boundingSphere === null ) this.computeBoundingSphere();\n\n\t\t_sphere$4.copy( this.boundingSphere );\n\t\t_sphere$4.applyMatrix4( matrixWorld );\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$4 ) === false ) return;\n\n\t\t// now test each instance\n\n\t\tfor ( let instanceId = 0; instanceId < raycastTimes; instanceId ++ ) {\n\n\t\t\t// calculate the world matrix for each instance\n\n\t\t\tthis.getMatrixAt( instanceId, _instanceLocalMatrix );\n\n\t\t\t_instanceWorldMatrix.multiplyMatrices( matrixWorld, _instanceLocalMatrix );\n\n\t\t\t// the mesh represents this single instance\n\n\t\t\t_mesh$1.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t_mesh$1.raycast( raycaster, _instanceIntersects );\n\n\t\t\t// process the result of raycast\n\n\t\t\tfor ( let i = 0, l = _instanceIntersects.length; i < l; i ++ ) {\n\n\t\t\t\tconst intersect = _instanceIntersects[ i ];\n\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_instanceIntersects.length = 0;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the given color to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#instanceColor} to `true` after updating all the colors.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Color} color - The instance color.\n\t */\n\tsetColorAt( index, color ) {\n\n\t\tif ( this.instanceColor === null ) {\n\n\t\t\tthis.instanceColor = new InstancedBufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ).fill( 1 ), 3 );\n\n\t\t}\n\n\t\tcolor.toArray( this.instanceColor.array, index * 3 );\n\n\t}\n\n\t/**\n\t * Sets the given local transformation matrix to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#instanceMatrix} to `true` after updating all the colors.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Matrix4} matrix - The local transformation.\n\t */\n\tsetMatrixAt( index, matrix ) {\n\n\t\tmatrix.toArray( this.instanceMatrix.array, index * 16 );\n\n\t}\n\n\t/**\n\t * Sets the morph target weights to the defined instance. Make sure you set the `needsUpdate` flag of\n\t * {@link InstancedMesh#morphTexture} to `true` after updating all the influences.\n\t *\n\t * @param {number} index - The instance index.\n\t * @param {Mesh} object -  A mesh which `morphTargetInfluences` property containing the morph target weights\n\t * of a single instance.\n\t */\n\tsetMorphAt( index, object ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\tconst len = objectInfluences.length + 1; // morphBaseInfluence + all influences\n\n\t\tif ( this.morphTexture === null ) {\n\n\t\t\tthis.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );\n\n\t\t}\n\n\t\tconst array = this.morphTexture.source.data.data;\n\n\t\tlet morphInfluencesSum = 0;\n\n\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t}\n\n\t\tconst morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\t\tconst dataIndex = len * index;\n\n\t\tarray[ dataIndex ] = morphBaseInfluence;\n\n\t\tarray.set( objectInfluences, dataIndex + 1 );\n\n\t}\n\n\tupdateMorphTargets() {\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t\tif ( this.morphTexture !== null ) {\n\n\t\t\tthis.morphTexture.dispose();\n\t\t\tthis.morphTexture = null;\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\n/**\n * A two dimensional surface that extends infinitely in 3D space, represented\n * in [Hessian normal form]{@link http://mathworld.wolfram.com/HessianNormalForm.html}\n * by a unit length normal vector and a constant.\n */\nclass Plane {\n\n\t/**\n\t * Constructs a new plane.\n\t *\n\t * @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane.\n\t * @param {number} [constant=0] - The signed distance from the origin to the plane.\n\t */\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPlane = true;\n\n\t\t/**\n\t\t * A unit length vector defining the normal of the plane.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.normal = normal;\n\n\t\t/**\n\t\t * The signed distance from the origin to the plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.constant = constant;\n\n\t}\n\n\t/**\n\t * Sets the plane components by copying the given values.\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {number} constant - The constant.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane components by defining `x`, `y`, `z` as the\n\t * plane normal and `w` as the constant.\n\t *\n\t * @param {number} x - The value for the normal's x component.\n\t * @param {number} y - The value for the normal's y component.\n\t * @param {number} z - The value for the normal's z component.\n\t * @param {number} w - The constant value.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane from the given normal and coplanar point (that is a point\n\t * that lies onto the plane).\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {Vector3} point - A coplanar point.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the plane from three coplanar points. The winding order is\n\t * assumed to be counter-clockwise, and determines the direction of\n\t * the plane normal.\n\t *\n\t * @param {Vector3} a - The first coplanar point.\n\t * @param {Vector3} b - The second coplanar point.\n\t * @param {Vector3} c - The third coplanar point.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given plane to this instance.\n\t *\n\t * @param {Plane} plane - The plane to copy.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Normalizes the plane normal and adjusts the constant accordingly.\n\t *\n\t * @return {Plane} A reference to this plane.\n\t */\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Negates both the plane normal and the constant.\n\t *\n\t * @return {Plane} A reference to this plane.\n\t */\n\tnegate() {\n\n\t\tthis.constant *= -1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the signed distance from the given point to this plane.\n\t *\n\t * @param {Vector3} point - The point to compute the distance for.\n\t * @return {number} The signed distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\t/**\n\t * Returns the signed distance from the given sphere to this plane.\n\t *\n\t * @param {Sphere} sphere - The sphere to compute the distance for.\n\t * @return {number} The signed distance.\n\t */\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\t/**\n\t * Projects a the given point onto the plane.\n\t *\n\t * @param {Vector3} point - The point to project.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The projected point on the plane.\n\t */\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );\n\n\t}\n\n\t/**\n\t * Returns the intersection point of the passed line and the plane. Returns\n\t * `null` if the line does not intersect. Returns the line's starting point if\n\t * the line is coplanar with the plane.\n\t *\n\t * @param {Line3} line - The line to compute the intersection for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The intersection point.\n\t */\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( line.start ).addScaledVector( direction, t );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given line segment intersects with (passes through) the plane.\n\t *\n\t * @param {Line3} line - The line to test.\n\t * @return {boolean} Whether the given line segment intersects with the plane or not.\n\t */\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with the plane.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with the plane or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere intersects with the plane.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the given bounding sphere intersects with the plane or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\t/**\n\t * Returns a coplanar vector to the plane, by calculating the\n\t * projection of the normal at the origin onto the plane.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The coplanar point.\n\t */\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\t/**\n\t * Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform.\n\t *\n\t * The optional normal matrix can be pre-computed like so:\n\t * ```js\n\t * const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );\n\t * ```\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix.\n\t * @return {Plane} A reference to this plane.\n\t */\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Translates the plane by the distance defined by the given offset vector.\n\t * Note that this only affects the plane constant and will not affect the normal vector.\n\t *\n\t * @param {Vector3} offset - The offset vector.\n\t * @return {Plane} A reference to this plane.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this plane is equal with the given one.\n\t *\n\t * @param {Plane} plane - The plane to test for equality.\n\t * @return {boolean} Whether this plane is equal with the given one.\n\t */\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t}\n\n\t/**\n\t * Returns a new plane with copied values from this instance.\n\t *\n\t * @return {Plane} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _sphere$3 = /*@__PURE__*/ new Sphere();\nconst _defaultSpriteCenter = /*@__PURE__*/ new Vector2( 0.5, 0.5 );\nconst _vector$6 = /*@__PURE__*/ new Vector3();\n\n/**\n * Frustums are used to determine what is inside the camera's field of view.\n * They help speed up the rendering process - objects which lie outside a camera's\n * frustum can safely be excluded from rendering.\n *\n * This class is mainly intended for use internally by a renderer.\n */\nclass Frustum {\n\n\t/**\n\t * Constructs a new frustum.\n\t *\n\t * @param {Plane} [p0] - The first plane that encloses the frustum.\n\t * @param {Plane} [p1] - The second plane that encloses the frustum.\n\t * @param {Plane} [p2] - The third plane that encloses the frustum.\n\t * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n\t * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n\t * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n\t */\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\t/**\n\t\t * This array holds the planes that enclose the frustum.\n\t\t *\n\t\t * @type {Array<Plane>}\n\t\t */\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\t/**\n\t * Sets the frustum planes by copying the given planes.\n\t *\n\t * @param {Plane} [p0] - The first plane that encloses the frustum.\n\t * @param {Plane} [p1] - The second plane that encloses the frustum.\n\t * @param {Plane} [p2] - The third plane that encloses the frustum.\n\t * @param {Plane} [p3] - The fourth plane that encloses the frustum.\n\t * @param {Plane} [p4] - The fifth plane that encloses the frustum.\n\t * @param {Plane} [p5] - The sixth plane that encloses the frustum.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given frustum to this instance.\n\t *\n\t * @param {Frustum} frustum - The frustum to copy.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the frustum planes from the given projection matrix.\n\t *\n\t * @param {Matrix4} m - The projection matrix.\n\t * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system.\n\t * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.\n\t * @return {Frustum} A reference to this frustum.\n\t */\n\tsetFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem, reversedDepth = false ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\n\t\tif ( reversedDepth ) {\n\n\t\t\tplanes[ 4 ].setComponents( me2, me6, me10, me14 ).normalize(); // far\n\t\t\tplanes[ 5 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // near\n\n\t\t} else {\n\n\t\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize(); // far\n\n\t\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize(); // near\n\n\t\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tplanes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize(); // near\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the 3D object's bounding sphere is intersecting this frustum.\n\t *\n\t * Note that the 3D object must have a geometry so that the bounding sphere can be calculated.\n\t *\n\t * @param {Object3D} object - The 3D object to test.\n\t * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not.\n\t */\n\tintersectsObject( object ) {\n\n\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t} else {\n\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t}\n\n\t\treturn this.intersectsSphere( _sphere$3 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given sprite is intersecting this frustum.\n\t *\n\t * @param {Sprite} sprite - The sprite to test.\n\t * @return {boolean} Whether the sprite is intersecting this frustum or not.\n\t */\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere$3.center.set( 0, 0, 0 );\n\n\t\tconst offset = _defaultSpriteCenter.distanceTo( sprite.center );\n\n\t\t_sphere$3.radius = 0.7071067811865476 + offset;\n\t\t_sphere$3.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere$3 );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere is intersecting this frustum.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @return {boolean} Whether the bounding sphere is intersecting this frustum or not.\n\t */\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box is intersecting this frustum.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box is intersecting this frustum or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector$6.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t_vector$6.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t_vector$6.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector$6 ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within the frustum.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @return {boolean} Whether the point lies within this frustum or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Returns a new frustum with copied values from this instance.\n\t *\n\t * @return {Frustum} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();\nconst _frustum$1 = /*@__PURE__*/ new Frustum();\n\n/**\n * FrustumArray is used to determine if an object is visible in at least one camera\n * from an array of cameras. This is particularly useful for multi-view renderers.\n*/\nclass FrustumArray {\n\n\t/**\n\t * Constructs a new frustum array.\n\t *\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The coordinate system to use.\n\t\t *\n\t\t * @type {WebGLCoordinateSystem|WebGPUCoordinateSystem}\n\t\t * @default WebGLCoordinateSystem\n\t\t */\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t}\n\n\t/**\n\t * Returns `true` if the 3D object's bounding sphere is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Object3D} object - The 3D object to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the 3D object is visible in any camera.\n\t */\n\tintersectsObject( object, cameraArray ) {\n\n\t\tif ( ! cameraArray.isArrayCamera || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$2.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsObject( object ) ) {\n\n\t\t\t\treturn true; // Object is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given sprite is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Sprite} sprite - The sprite to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the sprite is visible in any camera.\n\t */\n\tintersectsSprite( sprite, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$2.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsSprite( sprite ) ) {\n\n\t\t\t\treturn true; // Sprite is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding sphere is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Sphere} sphere - The bounding sphere to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the sphere is visible in any camera.\n\t */\n\tintersectsSphere( sphere, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$2.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsSphere( sphere ) ) {\n\n\t\t\t\treturn true; // Sphere is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box is intersecting any frustum\n\t * from the camera array.\n\t *\n\t * @param {Box3} box - The bounding box to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the box is visible in any camera.\n\t */\n\tintersectsBox( box, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$2.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.intersectsBox( box ) ) {\n\n\t\t\t\treturn true; // Box is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within any frustum\n\t * from the camera array.\n\t *\n\t * @param {Vector3} point - The point to test.\n\t * @param {Object} cameraArray - An object with a cameras property containing an array of cameras.\n\t * @return {boolean} Whether the point is visible in any camera.\n\t */\n\tcontainsPoint( point, cameraArray ) {\n\n\t\tif ( ! cameraArray || ! cameraArray.cameras || cameraArray.cameras.length === 0 ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < cameraArray.cameras.length; i ++ ) {\n\n\t\t\tconst camera = cameraArray.cameras[ i ];\n\n\t\t\t_projScreenMatrix$2.multiplyMatrices(\n\t\t\t\tcamera.projectionMatrix,\n\t\t\t\tcamera.matrixWorldInverse\n\t\t\t);\n\n\t\t\t_frustum$1.setFromProjectionMatrix(\n\t\t\t\t_projScreenMatrix$2,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t\tif ( _frustum$1.containsPoint( point ) ) {\n\n\t\t\t\treturn true; // Point is visible in at least one camera\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false; // Not visible in any camera\n\n\t}\n\n\t/**\n\t * Returns a new frustum array with copied values from this instance.\n\t *\n\t * @return {FrustumArray} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new FrustumArray();\n\n\t}\n\n}\n\nfunction ascIdSort( a, b ) {\n\n\treturn a - b;\n\n}\n\nfunction sortOpaque( a, b ) {\n\n\treturn a.z - b.z;\n\n}\n\nfunction sortTransparent( a, b ) {\n\n\treturn b.z - a.z;\n\n}\n\nclass MultiDrawRenderList {\n\n\tconstructor() {\n\n\t\tthis.index = 0;\n\t\tthis.pool = [];\n\t\tthis.list = [];\n\n\t}\n\n\tpush( start, count, z, index ) {\n\n\t\tconst pool = this.pool;\n\t\tconst list = this.list;\n\t\tif ( this.index >= pool.length ) {\n\n\t\t\tpool.push( {\n\n\t\t\t\tstart: -1,\n\t\t\t\tcount: -1,\n\t\t\t\tz: -1,\n\t\t\t\tindex: -1,\n\n\t\t\t} );\n\n\t\t}\n\n\t\tconst item = pool[ this.index ];\n\t\tlist.push( item );\n\t\tthis.index ++;\n\n\t\titem.start = start;\n\t\titem.count = count;\n\t\titem.z = z;\n\t\titem.index = index;\n\n\t}\n\n\treset() {\n\n\t\tthis.list.length = 0;\n\t\tthis.index = 0;\n\n\t}\n\n}\n\nconst _matrix$1 = /*@__PURE__*/ new Matrix4();\nconst _whiteColor = /*@__PURE__*/ new Color( 1, 1, 1 );\nconst _frustum = /*@__PURE__*/ new Frustum();\nconst _frustumArray = /*@__PURE__*/ new FrustumArray();\nconst _box$1 = /*@__PURE__*/ new Box3();\nconst _sphere$2 = /*@__PURE__*/ new Sphere();\nconst _vector$5 = /*@__PURE__*/ new Vector3();\nconst _forward$1 = /*@__PURE__*/ new Vector3();\nconst _temp = /*@__PURE__*/ new Vector3();\nconst _renderList = /*@__PURE__*/ new MultiDrawRenderList();\nconst _mesh = /*@__PURE__*/ new Mesh();\nconst _batchIntersects = [];\n\n// copies data from attribute \"src\" into \"target\" starting at \"targetOffset\"\nfunction copyAttributeData( src, target, targetOffset = 0 ) {\n\n\tconst itemSize = target.itemSize;\n\tif ( src.isInterleavedBufferAttribute || src.array.constructor !== target.array.constructor ) {\n\n\t\t// use the component getters and setters if the array data cannot\n\t\t// be copied directly\n\t\tconst vertexCount = src.count;\n\t\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\ttarget.setComponent( i + targetOffset, c, src.getComponent( i, c ) );\n\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\n\t\t// faster copy approach using typed array set function\n\t\ttarget.array.set( src.array, targetOffset * itemSize );\n\n\t}\n\n\ttarget.needsUpdate = true;\n\n}\n\n// safely copies array contents to a potentially smaller array\nfunction copyArrayContents( src, target ) {\n\n\tif ( src.constructor !== target.constructor ) {\n\n\t\t// if arrays are of a different type (eg due to index size increasing) then data must be per-element copied\n\t\tconst len = Math.min( src.length, target.length );\n\t\tfor ( let i = 0; i < len; i ++ ) {\n\n\t\t\ttarget[ i ] = src[ i ];\n\n\t\t}\n\n\t} else {\n\n\t\t// if the arrays use the same data layout we can use a fast block copy\n\t\tconst len = Math.min( src.length, target.length );\n\t\ttarget.set( new src.constructor( src.buffer, 0, len ) );\n\n\t}\n\n}\n\n/**\n * A special version of a mesh with multi draw batch rendering support. Use\n * this class if you have to render a large number of objects with the same\n * material but with different geometries or world transformations. The usage of\n * `BatchedMesh` will help you to reduce the number of draw calls and thus improve the overall\n * rendering performance in your application.\n *\n * ```js\n * const box = new THREE.BoxGeometry( 1, 1, 1 );\n * const sphere = new THREE.SphereGeometry( 1, 12, 12 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n *\n * // initialize and add geometries into the batched mesh\n * const batchedMesh = new BatchedMesh( 10, 5000, 10000, material );\n * const boxGeometryId = batchedMesh.addGeometry( box );\n * const sphereGeometryId = batchedMesh.addGeometry( sphere );\n *\n * // create instances of those geometries\n * const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId );\n * const boxInstancedId2 = batchedMesh.addInstance( boxGeometryId );\n *\n * const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId );\n * const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId );\n *\n * // position the geometries\n * batchedMesh.setMatrixAt( boxInstancedId1, boxMatrix1 );\n * batchedMesh.setMatrixAt( boxInstancedId2, boxMatrix2 );\n *\n * batchedMesh.setMatrixAt( sphereInstancedId1, sphereMatrix1 );\n * batchedMesh.setMatrixAt( sphereInstancedId2, sphereMatrix2 );\n *\n * scene.add( batchedMesh );\n * ```\n *\n * @augments Mesh\n */\nclass BatchedMesh extends Mesh {\n\n\t/**\n\t * Constructs a new batched mesh.\n\t *\n\t * @param {number} maxInstanceCount - The maximum number of individual instances planned to be added and rendered.\n\t * @param {number} maxVertexCount - The maximum number of vertices to be used by all unique geometries.\n\t * @param {number} [maxIndexCount=maxVertexCount*2] - The maximum number of indices to be used by all unique geometries\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t */\n\tconstructor( maxInstanceCount, maxVertexCount, maxIndexCount = maxVertexCount * 2, material ) {\n\n\t\tsuper( new BufferGeometry(), material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBatchedMesh = true;\n\n\t\t/**\n\t\t * When set ot `true`, the individual objects of a batch are frustum culled.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.perObjectFrustumCulled = true;\n\n\t\t/**\n\t\t * When set to `true`, the individual objects of a batch are sorted to improve overdraw-related artifacts.\n\t\t * If the material is marked as \"transparent\" objects are rendered back to front and if not then they are\n\t\t * rendered front to back.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * The bounding box of the batched mesh. Can be computed via {@link BatchedMesh#computeBoundingBox}.\n\t\t *\n\t\t * @type {?Box3}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingBox = null;\n\n\t\t/**\n\t\t * The bounding sphere of the batched mesh. Can be computed via {@link BatchedMesh#computeBoundingSphere}.\n\t\t *\n\t\t * @type {?Sphere}\n\t\t * @default null\n\t\t */\n\t\tthis.boundingSphere = null;\n\n\t\t/**\n\t\t * Takes a sort a function that is run before render. The function takes a list of instances to\n\t\t * sort and a camera. The objects in the list include a \"z\" field to perform a depth-ordered\n\t\t * sort with.\n\t\t *\n\t\t * @type {?Function}\n\t\t * @default null\n\t\t */\n\t\tthis.customSort = null;\n\n\t\t// stores visible, active, and geometry id per instance and reserved buffer ranges for geometries\n\t\tthis._instanceInfo = [];\n\t\tthis._geometryInfo = [];\n\n\t\t// instance, geometry ids that have been set as inactive, and are available to be overwritten\n\t\tthis._availableInstanceIds = [];\n\t\tthis._availableGeometryIds = [];\n\n\t\t// used to track where the next point is that geometry should be inserted\n\t\tthis._nextIndexStart = 0;\n\t\tthis._nextVertexStart = 0;\n\t\tthis._geometryCount = 0;\n\n\t\t// flags\n\t\tthis._visibilityChanged = true;\n\t\tthis._geometryInitialized = false;\n\n\t\t// cached user options\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\t// buffers for multi draw\n\t\tthis._multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tthis._multiDrawCount = 0;\n\t\tthis._multiDrawInstances = null;\n\n\t\t// Local matrix per geometry by using data texture\n\t\tthis._matricesTexture = null;\n\t\tthis._indirectTexture = null;\n\t\tthis._colorsTexture = null;\n\n\t\tthis._initMatricesTexture();\n\t\tthis._initIndirectTexture();\n\n\t}\n\n\t/**\n\t * The maximum number of individual instances that can be stored in the batch.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget maxInstanceCount() {\n\n\t\treturn this._maxInstanceCount;\n\n\t}\n\n\t/**\n\t * The instance count.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget instanceCount() {\n\n\t\treturn this._instanceInfo.length - this._availableInstanceIds.length;\n\n\t}\n\n\t/**\n\t * The number of unused vertices.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget unusedVertexCount() {\n\n\t\treturn this._maxVertexCount - this._nextVertexStart;\n\n\t}\n\n\t/**\n\t * The number of unused indices.\n\t *\n\t * @type {number}\n\t * @readonly\n\t */\n\tget unusedIndexCount() {\n\n\t\treturn this._maxIndexCount - this._nextIndexStart;\n\n\t}\n\n\t_initMatricesTexture() {\n\n\t\t// layout (1 matrix = 4 pixels)\n\t\t//      RGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t//  with  8x8  pixel texture max   16 matrices * 4 pixels =  (8 * 8)\n\t\t//       16x16 pixel texture max   64 matrices * 4 pixels = (16 * 16)\n\t\t//       32x32 pixel texture max  256 matrices * 4 pixels = (32 * 32)\n\t\t//       64x64 pixel texture max 1024 matrices * 4 pixels = (64 * 64)\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount * 4 ); // 4 pixels needed for 1 matrix\n\t\tsize = Math.ceil( size / 4 ) * 4;\n\t\tsize = Math.max( size, 4 );\n\n\t\tconst matricesArray = new Float32Array( size * size * 4 ); // 4 floats per RGBA pixel\n\t\tconst matricesTexture = new DataTexture( matricesArray, size, size, RGBAFormat, FloatType );\n\n\t\tthis._matricesTexture = matricesTexture;\n\n\t}\n\n\t_initIndirectTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\tconst indirectArray = new Uint32Array( size * size );\n\t\tconst indirectTexture = new DataTexture( indirectArray, size, size, RedIntegerFormat, UnsignedIntType );\n\n\t\tthis._indirectTexture = indirectTexture;\n\n\t}\n\n\t_initColorsTexture() {\n\n\t\tlet size = Math.sqrt( this._maxInstanceCount );\n\t\tsize = Math.ceil( size );\n\n\t\t// 4 floats per RGBA pixel initialized to white\n\t\tconst colorsArray = new Float32Array( size * size * 4 ).fill( 1 );\n\t\tconst colorsTexture = new DataTexture( colorsArray, size, size, RGBAFormat, FloatType );\n\t\tcolorsTexture.colorSpace = ColorManagement.workingColorSpace;\n\n\t\tthis._colorsTexture = colorsTexture;\n\n\t}\n\n\t_initializeGeometry( reference ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst maxVertexCount = this._maxVertexCount;\n\t\tconst maxIndexCount = this._maxIndexCount;\n\t\tif ( this._geometryInitialized === false ) {\n\n\t\t\tfor ( const attributeName in reference.attributes ) {\n\n\t\t\t\tconst srcAttribute = reference.getAttribute( attributeName );\n\t\t\t\tconst { array, itemSize, normalized } = srcAttribute;\n\n\t\t\t\tconst dstArray = new array.constructor( maxVertexCount * itemSize );\n\t\t\t\tconst dstAttribute = new BufferAttribute( dstArray, itemSize, normalized );\n\n\t\t\t\tgeometry.setAttribute( attributeName, dstAttribute );\n\n\t\t\t}\n\n\t\t\tif ( reference.getIndex() !== null ) {\n\n\t\t\t\t// Reserve last u16 index for primitive restart.\n\t\t\t\tconst indexArray = maxVertexCount > 65535\n\t\t\t\t\t? new Uint32Array( maxIndexCount )\n\t\t\t\t\t: new Uint16Array( maxIndexCount );\n\n\t\t\t\tgeometry.setIndex( new BufferAttribute( indexArray, 1 ) );\n\n\t\t\t}\n\n\t\t\tthis._geometryInitialized = true;\n\n\t\t}\n\n\t}\n\n\t// Make sure the geometry is compatible with the existing combined geometry attributes\n\t_validateGeometry( geometry ) {\n\n\t\t// check to ensure the geometries are using consistent attributes and indices\n\t\tconst batchGeometry = this.geometry;\n\t\tif ( Boolean( geometry.getIndex() ) !== Boolean( batchGeometry.getIndex() ) ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: All geometries must consistently have \"index\".' );\n\n\t\t}\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\tif ( ! geometry.hasAttribute( attributeName ) ) {\n\n\t\t\t\tthrow new Error( `THREE.BatchedMesh: Added geometry missing \"${ attributeName }\". All geometries must have consistent attributes.` );\n\n\t\t\t}\n\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tif ( srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized ) {\n\n\t\t\t\tthrow new Error( 'THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Validates the instance defined by the given ID.\n\t *\n\t * @param {number} instanceId - The instance to validate.\n\t */\n\tvalidateInstanceId( instanceId ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tif ( instanceId < 0 || instanceId >= instanceInfo.length || instanceInfo[ instanceId ].active === false ) {\n\n\t\t\tthrow new Error( `THREE.BatchedMesh: Invalid instanceId ${instanceId}. Instance is either out of range or has been deleted.` );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Validates the geometry defined by the given ID.\n\t *\n\t * @param {number} geometryId - The geometry to validate.\n\t */\n\tvalidateGeometryId( geometryId ) {\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( geometryId < 0 || geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\tthrow new Error( `THREE.BatchedMesh: Invalid geometryId ${geometryId}. Geometry is either out of range or has been deleted.` );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Takes a sort a function that is run before render. The function takes a list of instances to\n\t * sort and a camera. The objects in the list include a \"z\" field to perform a depth-ordered sort with.\n\t *\n\t * @param {Function} func - The custom sort function.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetCustomSort( func ) {\n\n\t\tthis.customSort = func;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the bounding box, updating {@link BatchedMesh#boundingBox}.\n\t * Bounding boxes aren't computed by default. They need to be explicitly computed,\n\t * otherwise they are `null`.\n\t */\n\tcomputeBoundingBox() {\n\n\t\tif ( this.boundingBox === null ) {\n\n\t\t\tthis.boundingBox = new Box3();\n\n\t\t}\n\n\t\tconst boundingBox = this.boundingBox;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingBox.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingBox.union( _box$1 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Computes the bounding sphere, updating {@link BatchedMesh#boundingSphere}.\n\t * Bounding spheres aren't computed by default. They need to be explicitly computed,\n\t * otherwise they are `null`.\n\t */\n\tcomputeBoundingSphere() {\n\n\t\tif ( this.boundingSphere === null ) {\n\n\t\t\tthis.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tconst boundingSphere = this.boundingSphere;\n\t\tconst instanceInfo = this._instanceInfo;\n\n\t\tboundingSphere.makeEmpty();\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active === false ) continue;\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\tboundingSphere.union( _sphere$2 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Adds a new instance to the batch using the geometry of the given ID and returns\n\t * a new id referring to the new instance to be used by other functions.\n\t *\n\t * @param {number} geometryId - The ID of a previously added geometry via {@link BatchedMesh#addGeometry}.\n\t * @return {number} The instance ID.\n\t */\n\taddInstance( geometryId ) {\n\n\t\tconst atCapacity = this._instanceInfo.length >= this.maxInstanceCount;\n\n\t\t// ensure we're not over geometry\n\t\tif ( atCapacity && this._availableInstanceIds.length === 0 ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Maximum item count reached.' );\n\n\t\t}\n\n\t\tconst instanceInfo = {\n\t\t\tvisible: true,\n\t\t\tactive: true,\n\t\t\tgeometryIndex: geometryId,\n\t\t};\n\n\t\tlet drawId = null;\n\n\t\t// Prioritize using previously freed instance ids\n\t\tif ( this._availableInstanceIds.length > 0 ) {\n\n\t\t\tthis._availableInstanceIds.sort( ascIdSort );\n\n\t\t\tdrawId = this._availableInstanceIds.shift();\n\t\t\tthis._instanceInfo[ drawId ] = instanceInfo;\n\n\t\t} else {\n\n\t\t\tdrawId = this._instanceInfo.length;\n\t\t\tthis._instanceInfo.push( instanceInfo );\n\n\t\t}\n\n\t\tconst matricesTexture = this._matricesTexture;\n\t\t_matrix$1.identity().toArray( matricesTexture.image.data, drawId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\tconst colorsTexture = this._colorsTexture;\n\t\tif ( colorsTexture ) {\n\n\t\t\t_whiteColor.toArray( colorsTexture.image.data, drawId * 4 );\n\t\t\tcolorsTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn drawId;\n\n\t}\n\n\t/**\n\t * Adds the given geometry to the batch and returns the associated\n\t * geometry id referring to it to be used in other functions.\n\t *\n\t * @param {BufferGeometry} geometry - The geometry to add.\n\t * @param {number} [reservedVertexCount=-1] - Optional parameter specifying the amount of\n\t * vertex buffer space to reserve for the added geometry. This is necessary if it is planned\n\t * to set a new geometry at this index at a later time that is larger than the original geometry.\n\t * Defaults to the length of the given geometry vertex buffer.\n\t * @param {number} [reservedIndexCount=-1] - Optional parameter specifying the amount of index\n\t * buffer space to reserve for the added geometry. This is necessary if it is planned to set a\n\t * new geometry at this index at a later time that is larger than the original geometry. Defaults to\n\t * the length of the given geometry index buffer.\n\t * @return {number} The geometry ID.\n\t */\n\taddGeometry( geometry, reservedVertexCount = -1, reservedIndexCount = -1 ) {\n\n\t\tthis._initializeGeometry( geometry );\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst geometryInfo = {\n\t\t\t// geometry information\n\t\t\tvertexStart: -1,\n\t\t\tvertexCount: -1,\n\t\t\treservedVertexCount: -1,\n\n\t\t\tindexStart: -1,\n\t\t\tindexCount: -1,\n\t\t\treservedIndexCount: -1,\n\n\t\t\t// draw range information\n\t\t\tstart: -1,\n\t\t\tcount: -1,\n\n\t\t\t// state\n\t\t\tboundingBox: null,\n\t\t\tboundingSphere: null,\n\t\t\tactive: true,\n\t\t};\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tgeometryInfo.vertexStart = this._nextVertexStart;\n\t\tgeometryInfo.reservedVertexCount = reservedVertexCount === -1 ? geometry.getAttribute( 'position' ).count : reservedVertexCount;\n\n\t\tconst index = geometry.getIndex();\n\t\tconst hasIndex = index !== null;\n\t\tif ( hasIndex ) {\n\n\t\t\tgeometryInfo.indexStart = this._nextIndexStart;\n\t\t\tgeometryInfo.reservedIndexCount = reservedIndexCount === -1 ? index.count : reservedIndexCount;\n\n\t\t}\n\n\t\tif (\n\t\t\tgeometryInfo.indexStart !== -1 &&\n\t\t\tgeometryInfo.indexStart + geometryInfo.reservedIndexCount > this._maxIndexCount ||\n\t\t\tgeometryInfo.vertexStart + geometryInfo.reservedVertexCount > this._maxVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.' );\n\n\t\t}\n\n\t\t// update id\n\t\tlet geometryId;\n\t\tif ( this._availableGeometryIds.length > 0 ) {\n\n\t\t\tthis._availableGeometryIds.sort( ascIdSort );\n\n\t\t\tgeometryId = this._availableGeometryIds.shift();\n\t\t\tgeometryInfoList[ geometryId ] = geometryInfo;\n\n\n\t\t} else {\n\n\t\t\tgeometryId = this._geometryCount;\n\t\t\tthis._geometryCount ++;\n\t\t\tgeometryInfoList.push( geometryInfo );\n\n\t\t}\n\n\t\t// update the geometry\n\t\tthis.setGeometryAt( geometryId, geometry );\n\n\t\t// increment the next geometry position\n\t\tthis._nextIndexStart = geometryInfo.indexStart + geometryInfo.reservedIndexCount;\n\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\treturn geometryId;\n\n\t}\n\n\t/**\n\t * Replaces the geometry at the given ID with the provided geometry. Throws an error if there\n\t * is not enough space reserved for geometry. Calling this will change all instances that are\n\t * rendering that geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry that should be replaced with the given geometry.\n\t * @param {BufferGeometry} geometry - The new geometry.\n\t * @return {number} The geometry ID.\n\t */\n\tsetGeometryAt( geometryId, geometry ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Maximum geometry count reached.' );\n\n\t\t}\n\n\t\tthis._validateGeometry( geometry );\n\n\t\tconst batchGeometry = this.geometry;\n\t\tconst hasIndex = batchGeometry.getIndex() !== null;\n\t\tconst dstIndex = batchGeometry.getIndex();\n\t\tconst srcIndex = geometry.getIndex();\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif (\n\t\t\thasIndex &&\n\t\t\tsrcIndex.count > geometryInfo.reservedIndexCount ||\n\t\t\tgeometry.attributes.position.count > geometryInfo.reservedVertexCount\n\t\t) {\n\n\t\t\tthrow new Error( 'THREE.BatchedMesh: Reserved space not large enough for provided geometry.' );\n\n\t\t}\n\n\t\t// copy geometry buffer data over\n\t\tconst vertexStart = geometryInfo.vertexStart;\n\t\tconst reservedVertexCount = geometryInfo.reservedVertexCount;\n\t\tgeometryInfo.vertexCount = geometry.getAttribute( 'position' ).count;\n\n\t\tfor ( const attributeName in batchGeometry.attributes ) {\n\n\t\t\t// copy attribute data\n\t\t\tconst srcAttribute = geometry.getAttribute( attributeName );\n\t\t\tconst dstAttribute = batchGeometry.getAttribute( attributeName );\n\t\t\tcopyAttributeData( srcAttribute, dstAttribute, vertexStart );\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tconst itemSize = srcAttribute.itemSize;\n\t\t\tfor ( let i = srcAttribute.count, l = reservedVertexCount; i < l; i ++ ) {\n\n\t\t\t\tconst index = vertexStart + i;\n\t\t\t\tfor ( let c = 0; c < itemSize; c ++ ) {\n\n\t\t\t\t\tdstAttribute.setComponent( index, c, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdstAttribute.needsUpdate = true;\n\t\t\tdstAttribute.addUpdateRange( vertexStart * itemSize, reservedVertexCount * itemSize );\n\n\t\t}\n\n\t\t// copy index\n\t\tif ( hasIndex ) {\n\n\t\t\tconst indexStart = geometryInfo.indexStart;\n\t\t\tconst reservedIndexCount = geometryInfo.reservedIndexCount;\n\t\t\tgeometryInfo.indexCount = geometry.getIndex().count;\n\n\t\t\t// copy index data over\n\t\t\tfor ( let i = 0; i < srcIndex.count; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart + srcIndex.getX( i ) );\n\n\t\t\t}\n\n\t\t\t// fill the rest in with zeroes\n\t\t\tfor ( let i = srcIndex.count, l = reservedIndexCount; i < l; i ++ ) {\n\n\t\t\t\tdstIndex.setX( indexStart + i, vertexStart );\n\n\t\t\t}\n\n\t\t\tdstIndex.needsUpdate = true;\n\t\t\tdstIndex.addUpdateRange( indexStart, geometryInfo.reservedIndexCount );\n\n\t\t}\n\n\t\t// update the draw range\n\t\tgeometryInfo.start = hasIndex ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\t\tgeometryInfo.count = hasIndex ? geometryInfo.indexCount : geometryInfo.vertexCount;\n\n\t\t// store the bounding boxes\n\t\tgeometryInfo.boundingBox = null;\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tgeometryInfo.boundingBox = geometry.boundingBox.clone();\n\n\t\t}\n\n\t\tgeometryInfo.boundingSphere = null;\n\t\tif ( geometry.boundingSphere !== null ) {\n\n\t\t\tgeometryInfo.boundingSphere = geometry.boundingSphere.clone();\n\n\t\t}\n\n\t\tthis._visibilityChanged = true;\n\t\treturn geometryId;\n\n\t}\n\n\t/**\n\t * Deletes the geometry defined by the given ID from this batch. Any instances referencing\n\t * this geometry will also be removed as a side effect.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to remove from the batch.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tdeleteGeometry( geometryId ) {\n\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tif ( geometryId >= geometryInfoList.length || geometryInfoList[ geometryId ].active === false ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t// delete any instances associated with this geometry\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( instanceInfo[ i ].active && instanceInfo[ i ].geometryIndex === geometryId ) {\n\n\t\t\t\tthis.deleteInstance( i );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometryInfoList[ geometryId ].active = false;\n\t\tthis._availableGeometryIds.push( geometryId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Deletes an existing instance from the batch using the given ID.\n\t *\n\t * @param {number} instanceId - The ID of the instance to remove from the batch.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tdeleteInstance( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tthis._instanceInfo[ instanceId ].active = false;\n\t\tthis._availableInstanceIds.push( instanceId );\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Repacks the sub geometries in [name] to remove any unused space remaining from\n\t * previously deleted geometry, freeing up space to add new geometry.\n\t *\n\t * @param {number} instanceId - The ID of the instance to remove from the batch.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\toptimize() {\n\n\t\t// track the next indices to copy data to\n\t\tlet nextVertexStart = 0;\n\t\tlet nextIndexStart = 0;\n\n\t\t// Iterate over all geometry ranges in order sorted from earliest in the geometry buffer to latest\n\t\t// in the geometry buffer. Because draw range objects can be reused there is no guarantee of their order.\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst indices = geometryInfoList\n\t\t\t.map( ( e, i ) => i )\n\t\t\t.sort( ( a, b ) => {\n\n\t\t\t\treturn geometryInfoList[ a ].vertexStart - geometryInfoList[ b ].vertexStart;\n\n\t\t\t} );\n\n\t\tconst geometry = this.geometry;\n\t\tfor ( let i = 0, l = geometryInfoList.length; i < l; i ++ ) {\n\n\t\t\t// if a geometry range is inactive then don't copy anything\n\t\t\tconst index = indices[ i ];\n\t\t\tconst geometryInfo = geometryInfoList[ index ];\n\t\t\tif ( geometryInfo.active === false ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// if a geometry contains an index buffer then shift it, as well\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\tif ( geometryInfo.indexStart !== nextIndexStart ) {\n\n\t\t\t\t\tconst { indexStart, vertexStart, reservedIndexCount } = geometryInfo;\n\t\t\t\t\tconst index = geometry.index;\n\t\t\t\t\tconst array = index.array;\n\n\t\t\t\t\t// shift the index pointers based on how the vertex data will shift\n\t\t\t\t\t// adjusting the index must happen first so the original vertex start value is available\n\t\t\t\t\tconst elementDelta = nextVertexStart - vertexStart;\n\t\t\t\t\tfor ( let j = indexStart; j < indexStart + reservedIndexCount; j ++ ) {\n\n\t\t\t\t\t\tarray[ j ] = array[ j ] + elementDelta;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tindex.array.copyWithin( nextIndexStart, indexStart, indexStart + reservedIndexCount );\n\t\t\t\t\tindex.addUpdateRange( nextIndexStart, reservedIndexCount );\n\n\t\t\t\t\tgeometryInfo.indexStart = nextIndexStart;\n\n\t\t\t\t}\n\n\t\t\t\tnextIndexStart += geometryInfo.reservedIndexCount;\n\n\t\t\t}\n\n\t\t\t// if a geometry needs to be moved then copy attribute data to overwrite unused space\n\t\t\tif ( geometryInfo.vertexStart !== nextVertexStart ) {\n\n\t\t\t\tconst { vertexStart, reservedVertexCount } = geometryInfo;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tfor ( const key in attributes ) {\n\n\t\t\t\t\tconst attribute = attributes[ key ];\n\t\t\t\t\tconst { array, itemSize } = attribute;\n\t\t\t\t\tarray.copyWithin( nextVertexStart * itemSize, vertexStart * itemSize, ( vertexStart + reservedVertexCount ) * itemSize );\n\t\t\t\t\tattribute.addUpdateRange( nextVertexStart * itemSize, reservedVertexCount * itemSize );\n\n\t\t\t\t}\n\n\t\t\t\tgeometryInfo.vertexStart = nextVertexStart;\n\n\t\t\t}\n\n\t\t\tnextVertexStart += geometryInfo.reservedVertexCount;\n\t\t\tgeometryInfo.start = geometry.index ? geometryInfo.indexStart : geometryInfo.vertexStart;\n\n\t\t\t// step the next geometry points to the shifted position\n\t\t\tthis._nextIndexStart = geometry.index ? geometryInfo.indexStart + geometryInfo.reservedIndexCount : 0;\n\t\t\tthis._nextVertexStart = geometryInfo.vertexStart + geometryInfo.reservedVertexCount;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the bounding box for the given geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to return the bounding box for.\n\t * @param {Box3} target - The target object that is used to store the method's result.\n\t * @return {Box3|null} The geometry's bounding box. Returns `null` if no geometry has been found for the given ID.\n\t */\n\tgetBoundingBoxAt( geometryId, target ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding box\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingBox === null ) {\n\n\t\t\tconst box = new Box3();\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\tbox.expandByPoint( _vector$5.fromBufferAttribute( position, iv ) );\n\n\t\t\t}\n\n\t\t\tgeometryInfo.boundingBox = box;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingBox );\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the bounding sphere for the given geometry.\n\t *\n\t * @param {number} geometryId - The ID of the geometry to return the bounding sphere for.\n\t * @param {Sphere} target - The target object that is used to store the method's result.\n\t * @return {Sphere|null} The geometry's bounding sphere. Returns `null` if no geometry has been found for the given ID.\n\t */\n\tgetBoundingSphereAt( geometryId, target ) {\n\n\t\tif ( geometryId >= this._geometryCount ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t// compute bounding sphere\n\t\tconst geometry = this.geometry;\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\tif ( geometryInfo.boundingSphere === null ) {\n\n\t\t\tconst sphere = new Sphere();\n\t\t\tthis.getBoundingBoxAt( geometryId, _box$1 );\n\t\t\t_box$1.getCenter( sphere.center );\n\n\t\t\tconst index = geometry.index;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet maxRadiusSq = 0;\n\t\t\tfor ( let i = geometryInfo.start, l = geometryInfo.start + geometryInfo.count; i < l; i ++ ) {\n\n\t\t\t\tlet iv = i;\n\t\t\t\tif ( index ) {\n\n\t\t\t\t\tiv = index.getX( iv );\n\n\t\t\t\t}\n\n\t\t\t\t_vector$5.fromBufferAttribute( position, iv );\n\t\t\t\tmaxRadiusSq = Math.max( maxRadiusSq, sphere.center.distanceToSquared( _vector$5 ) );\n\n\t\t\t}\n\n\t\t\tsphere.radius = Math.sqrt( maxRadiusSq );\n\t\t\tgeometryInfo.boundingSphere = sphere;\n\n\t\t}\n\n\t\ttarget.copy( geometryInfo.boundingSphere );\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Sets the given local transformation matrix to the defined instance.\n\t * Negatively scaled matrices are not supported.\n\t *\n\t * @param {number} instanceId - The ID of an instance to set the matrix of.\n\t * @param {Matrix4} matrix - A 4x4 matrix representing the local transformation of a single instance.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetMatrixAt( instanceId, matrix ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst matricesArray = this._matricesTexture.image.data;\n\t\tmatrix.toArray( matricesArray, instanceId * 16 );\n\t\tmatricesTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the local transformation matrix of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the matrix of.\n\t * @param {Matrix4} matrix - The target object that is used to store the method's result.\n\t * @return {Matrix4} The instance's local transformation matrix.\n\t */\n\tgetMatrixAt( instanceId, matrix ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\treturn matrix.fromArray( this._matricesTexture.image.data, instanceId * 16 );\n\n\t}\n\n\t/**\n\t * Sets the given color to the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to set the color of.\n\t * @param {Color} color - The color to set the instance to.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetColorAt( instanceId, color ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tif ( this._colorsTexture === null ) {\n\n\t\t\tthis._initColorsTexture();\n\n\t\t}\n\n\t\tcolor.toArray( this._colorsTexture.image.data, instanceId * 4 );\n\t\tthis._colorsTexture.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the color of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the color of.\n\t * @param {Color} color - The target object that is used to store the method's result.\n\t * @return {Color} The instance's color.\n\t */\n\tgetColorAt( instanceId, color ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\treturn color.fromArray( this._colorsTexture.image.data, instanceId * 4 );\n\n\t}\n\n\t/**\n\t * Sets the visibility of the instance.\n\t *\n\t * @param {number} instanceId - The id of the instance to set the visibility of.\n\t * @param {boolean} visible - Whether the instance is visible or not.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetVisibleAt( instanceId, visible ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\tif ( this._instanceInfo[ instanceId ].visible === visible ) {\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis._instanceInfo[ instanceId ].visible = visible;\n\t\tthis._visibilityChanged = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the visibility state of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the visibility state of.\n\t * @return {boolean} Whether the instance is visible or not.\n\t */\n\tgetVisibleAt( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\treturn this._instanceInfo[ instanceId ].visible;\n\n\t}\n\n\t/**\n\t * Sets the geometry ID of the instance at the given index.\n\t *\n\t * @param {number} instanceId - The ID of the instance to set the geometry ID of.\n\t * @param {number} geometryId - The geometry ID to be use by the instance.\n\t * @return {BatchedMesh} A reference to this batched mesh.\n\t */\n\tsetGeometryIdAt( instanceId, geometryId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\t\tthis.validateGeometryId( geometryId );\n\n\t\tthis._instanceInfo[ instanceId ].geometryIndex = geometryId;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the geometry ID of the defined instance.\n\t *\n\t * @param {number} instanceId - The ID of an instance to get the geometry ID of.\n\t * @return {number} The instance's geometry ID.\n\t */\n\tgetGeometryIdAt( instanceId ) {\n\n\t\tthis.validateInstanceId( instanceId );\n\n\t\treturn this._instanceInfo[ instanceId ].geometryIndex;\n\n\t}\n\n\t/**\n\t * Get the range representing the subset of triangles related to the attached geometry,\n\t * indicating the starting offset and count, or `null` if invalid.\n\t *\n\t * @param {number} geometryId - The id of the geometry to get the range of.\n\t * @param {Object} [target] - The target object that is used to store the method's result.\n\t * @return {{\n\t * \tvertexStart:number,vertexCount:number,reservedVertexCount:number,\n\t * \tindexStart:number,indexCount:number,reservedIndexCount:number,\n\t * \tstart:number,count:number\n\t * }} The result object with range data.\n\t */\n\tgetGeometryRangeAt( geometryId, target = {} ) {\n\n\t\tthis.validateGeometryId( geometryId );\n\n\t\tconst geometryInfo = this._geometryInfo[ geometryId ];\n\t\ttarget.vertexStart = geometryInfo.vertexStart;\n\t\ttarget.vertexCount = geometryInfo.vertexCount;\n\t\ttarget.reservedVertexCount = geometryInfo.reservedVertexCount;\n\n\t\ttarget.indexStart = geometryInfo.indexStart;\n\t\ttarget.indexCount = geometryInfo.indexCount;\n\t\ttarget.reservedIndexCount = geometryInfo.reservedIndexCount;\n\n\t\ttarget.start = geometryInfo.start;\n\t\ttarget.count = geometryInfo.count;\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Resizes the necessary buffers to support the provided number of instances.\n\t * If the provided arguments shrink the number of instances but there are not enough\n\t * unused Ids at the end of the list then an error is thrown.\n\t *\n\t * @param {number} maxInstanceCount - The max number of individual instances that can be added and rendered by the batch.\n\t*/\n\tsetInstanceCount( maxInstanceCount ) {\n\n\t\t// shrink the available instances as much as possible\n\t\tconst availableInstanceIds = this._availableInstanceIds;\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tavailableInstanceIds.sort( ascIdSort );\n\t\twhile ( availableInstanceIds[ availableInstanceIds.length - 1 ] === instanceInfo.length - 1 ) {\n\n\t\t\tinstanceInfo.pop();\n\t\t\tavailableInstanceIds.pop();\n\n\t\t}\n\n\t\t// throw an error if it can't be shrunk to the desired size\n\t\tif ( maxInstanceCount < instanceInfo.length ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Instance ids outside the range ${ maxInstanceCount } are being used. Cannot shrink instance count.` );\n\n\t\t}\n\n\t\t// copy the multi draw counts\n\t\tconst multiDrawCounts = new Int32Array( maxInstanceCount );\n\t\tconst multiDrawStarts = new Int32Array( maxInstanceCount );\n\t\tcopyArrayContents( this._multiDrawCounts, multiDrawCounts );\n\t\tcopyArrayContents( this._multiDrawStarts, multiDrawStarts );\n\n\t\tthis._multiDrawCounts = multiDrawCounts;\n\t\tthis._multiDrawStarts = multiDrawStarts;\n\t\tthis._maxInstanceCount = maxInstanceCount;\n\n\t\t// update texture data for instance sampling\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst matricesTexture = this._matricesTexture;\n\t\tconst colorsTexture = this._colorsTexture;\n\n\t\tindirectTexture.dispose();\n\t\tthis._initIndirectTexture();\n\t\tcopyArrayContents( indirectTexture.image.data, this._indirectTexture.image.data );\n\n\t\tmatricesTexture.dispose();\n\t\tthis._initMatricesTexture();\n\t\tcopyArrayContents( matricesTexture.image.data, this._matricesTexture.image.data );\n\n\t\tif ( colorsTexture ) {\n\n\t\t\tcolorsTexture.dispose();\n\t\t\tthis._initColorsTexture();\n\t\t\tcopyArrayContents( colorsTexture.image.data, this._colorsTexture.image.data );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Resizes the available space in the batch's vertex and index buffer attributes to the provided sizes.\n\t * If the provided arguments shrink the geometry buffers but there is not enough unused space at the\n\t * end of the geometry attributes then an error is thrown.\n\t *\n\t * @param {number} maxVertexCount - The maximum number of vertices to be used by all unique geometries to resize to.\n\t * @param {number} maxIndexCount - The maximum number of indices to be used by all unique geometries to resize to.\n\t*/\n\tsetGeometrySize( maxVertexCount, maxIndexCount ) {\n\n\t\t// Check if we can shrink to the requested vertex attribute size\n\t\tconst validRanges = [ ...this._geometryInfo ].filter( info => info.active );\n\t\tconst requiredVertexLength = Math.max( ...validRanges.map( range => range.vertexStart + range.reservedVertexCount ) );\n\t\tif ( requiredVertexLength > maxVertexCount ) {\n\n\t\t\tthrow new Error( `BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t}\n\n\t\t// Check if we can shrink to the requested index attribute size\n\t\tif ( this.geometry.index ) {\n\n\t\t\tconst requiredIndexLength = Math.max( ...validRanges.map( range => range.indexStart + range.reservedIndexCount ) );\n\t\t\tif ( requiredIndexLength > maxIndexCount ) {\n\n\t\t\t\tthrow new Error( `BatchedMesh: Geometry index values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\t// dispose of the previous geometry\n\t\tconst oldGeometry = this.geometry;\n\t\toldGeometry.dispose();\n\n\t\t// recreate the geometry needed based on the previous variant\n\t\tthis._maxVertexCount = maxVertexCount;\n\t\tthis._maxIndexCount = maxIndexCount;\n\n\t\tif ( this._geometryInitialized ) {\n\n\t\t\tthis._geometryInitialized = false;\n\t\t\tthis.geometry = new BufferGeometry();\n\t\t\tthis._initializeGeometry( oldGeometry );\n\n\t\t}\n\n\t\t// copy data from the previous geometry\n\t\tconst geometry = this.geometry;\n\t\tif ( oldGeometry.index ) {\n\n\t\t\tcopyArrayContents( oldGeometry.index.array, geometry.index.array );\n\n\t\t}\n\n\t\tfor ( const key in oldGeometry.attributes ) {\n\n\t\t\tcopyArrayContents( oldGeometry.attributes[ key ].array, geometry.attributes[ key ].array );\n\n\t\t}\n\n\t}\n\n\traycast( raycaster, intersects ) {\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst batchGeometry = this.geometry;\n\n\t\t// iterate over each geometry\n\t\t_mesh.material = this.material;\n\t\t_mesh.geometry.index = batchGeometry.index;\n\t\t_mesh.geometry.attributes = batchGeometry.attributes;\n\t\tif ( _mesh.geometry.boundingBox === null ) {\n\n\t\t\t_mesh.geometry.boundingBox = new Box3();\n\n\t\t}\n\n\t\tif ( _mesh.geometry.boundingSphere === null ) {\n\n\t\t\t_mesh.geometry.boundingSphere = new Sphere();\n\n\t\t}\n\n\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\tif ( ! instanceInfo[ i ].visible || ! instanceInfo[ i ].active ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t_mesh.geometry.setDrawRange( geometryInfo.start, geometryInfo.count );\n\n\t\t\t// get the intersects\n\t\t\tthis.getMatrixAt( i, _mesh.matrixWorld ).premultiply( matrixWorld );\n\t\t\tthis.getBoundingBoxAt( geometryId, _mesh.geometry.boundingBox );\n\t\t\tthis.getBoundingSphereAt( geometryId, _mesh.geometry.boundingSphere );\n\t\t\t_mesh.raycast( raycaster, _batchIntersects );\n\n\t\t\t// add batch id to the intersects\n\t\t\tfor ( let j = 0, l = _batchIntersects.length; j < l; j ++ ) {\n\n\t\t\t\tconst intersect = _batchIntersects[ j ];\n\t\t\t\tintersect.object = this;\n\t\t\t\tintersect.batchId = i;\n\t\t\t\tintersects.push( intersect );\n\n\t\t\t}\n\n\t\t\t_batchIntersects.length = 0;\n\n\t\t}\n\n\t\t_mesh.material = null;\n\t\t_mesh.geometry.index = null;\n\t\t_mesh.geometry.attributes = {};\n\t\t_mesh.geometry.setDrawRange( 0, Infinity );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.geometry = source.geometry.clone();\n\t\tthis.perObjectFrustumCulled = source.perObjectFrustumCulled;\n\t\tthis.sortObjects = source.sortObjects;\n\t\tthis.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;\n\t\tthis.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;\n\n\t\tthis._geometryInfo = source._geometryInfo.map( info => ( {\n\t\t\t...info,\n\n\t\t\tboundingBox: info.boundingBox !== null ? info.boundingBox.clone() : null,\n\t\t\tboundingSphere: info.boundingSphere !== null ? info.boundingSphere.clone() : null,\n\t\t} ) );\n\t\tthis._instanceInfo = source._instanceInfo.map( info => ( { ...info } ) );\n\n\t\tthis._availableInstanceIds = source._availableInstanceIds.slice();\n\t\tthis._availableGeometryIds = source._availableGeometryIds.slice();\n\n\t\tthis._nextIndexStart = source._nextIndexStart;\n\t\tthis._nextVertexStart = source._nextVertexStart;\n\t\tthis._geometryCount = source._geometryCount;\n\n\t\tthis._maxInstanceCount = source._maxInstanceCount;\n\t\tthis._maxVertexCount = source._maxVertexCount;\n\t\tthis._maxIndexCount = source._maxIndexCount;\n\n\t\tthis._geometryInitialized = source._geometryInitialized;\n\t\tthis._multiDrawCounts = source._multiDrawCounts.slice();\n\t\tthis._multiDrawStarts = source._multiDrawStarts.slice();\n\n\t\tthis._indirectTexture = source._indirectTexture.clone();\n\t\tthis._indirectTexture.image.data = this._indirectTexture.image.data.slice();\n\n\t\tthis._matricesTexture = source._matricesTexture.clone();\n\t\tthis._matricesTexture.image.data = this._matricesTexture.image.data.slice();\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture = source._colorsTexture.clone();\n\t\t\tthis._colorsTexture.image.data = this._colorsTexture.image.data.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\t// Assuming the geometry is not shared with other meshes\n\t\tthis.geometry.dispose();\n\n\t\tthis._matricesTexture.dispose();\n\t\tthis._matricesTexture = null;\n\n\t\tthis._indirectTexture.dispose();\n\t\tthis._indirectTexture = null;\n\n\t\tif ( this._colorsTexture !== null ) {\n\n\t\t\tthis._colorsTexture.dispose();\n\t\t\tthis._colorsTexture = null;\n\n\t\t}\n\n\t}\n\n\tonBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {\n\n\t\t// if visibility has not changed and frustum culling and object sorting is not required\n\t\t// then skip iterating over all items\n\t\tif ( ! this._visibilityChanged && ! this.perObjectFrustumCulled && ! this.sortObjects ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// the indexed version of the multi draw function requires specifying the start\n\t\t// offset in bytes.\n\t\tconst index = geometry.getIndex();\n\t\tconst bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;\n\n\t\tconst instanceInfo = this._instanceInfo;\n\t\tconst multiDrawStarts = this._multiDrawStarts;\n\t\tconst multiDrawCounts = this._multiDrawCounts;\n\t\tconst geometryInfoList = this._geometryInfo;\n\t\tconst perObjectFrustumCulled = this.perObjectFrustumCulled;\n\t\tconst indirectTexture = this._indirectTexture;\n\t\tconst indirectArray = indirectTexture.image.data;\n\n\t\tconst frustum = camera.isArrayCamera ? _frustumArray : _frustum;\n\t\t// prepare the frustum in the local frame\n\t\tif ( perObjectFrustumCulled && ! camera.isArrayCamera ) {\n\n\t\t\t_matrix$1\n\t\t\t\t.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse )\n\t\t\t\t.multiply( this.matrixWorld );\n\n\t\t\t_frustum.setFromProjectionMatrix(\n\t\t\t\t_matrix$1,\n\t\t\t\tcamera.coordinateSystem,\n\t\t\t\tcamera.reversedDepth\n\t\t\t);\n\n\t\t}\n\n\t\tlet multiDrawCount = 0;\n\t\tif ( this.sortObjects ) {\n\n\t\t\t// get the camera position in the local frame\n\t\t\t_matrix$1.copy( this.matrixWorld ).invert();\n\t\t\t_vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );\n\t\t\t_forward$1.set( 0, 0, -1 ).transformDirection( camera.matrixWorld ).transformDirection( _matrix$1 );\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\tculled = ! frustum.intersectsSphere( _sphere$2, camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\t// get the distance from camera used for sorting\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tconst z = _temp.subVectors( _sphere$2.center, _vector$5 ).dot( _forward$1 );\n\t\t\t\t\t\t_renderList.push( geometryInfo.start, geometryInfo.count, z, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Sort the draw ranges and prep for rendering\n\t\t\tconst list = _renderList.list;\n\t\t\tconst customSort = this.customSort;\n\t\t\tif ( customSort === null ) {\n\n\t\t\t\tlist.sort( material.transparent ? sortTransparent : sortOpaque );\n\n\t\t\t} else {\n\n\t\t\t\tcustomSort.call( this, list, camera );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = list.length; i < l; i ++ ) {\n\n\t\t\t\tconst item = list[ i ];\n\t\t\t\tmultiDrawStarts[ multiDrawCount ] = item.start * bytesPerElement;\n\t\t\t\tmultiDrawCounts[ multiDrawCount ] = item.count;\n\t\t\t\tindirectArray[ multiDrawCount ] = item.index;\n\t\t\t\tmultiDrawCount ++;\n\n\t\t\t}\n\n\t\t\t_renderList.reset();\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {\n\n\t\t\t\tif ( instanceInfo[ i ].visible && instanceInfo[ i ].active ) {\n\n\t\t\t\t\tconst geometryId = instanceInfo[ i ].geometryIndex;\n\n\t\t\t\t\t// determine whether the batched geometry is within the frustum\n\t\t\t\t\tlet culled = false;\n\t\t\t\t\tif ( perObjectFrustumCulled ) {\n\n\t\t\t\t\t\t// get the bounds in world space\n\t\t\t\t\t\tthis.getMatrixAt( i, _matrix$1 );\n\t\t\t\t\t\tthis.getBoundingSphereAt( geometryId, _sphere$2 ).applyMatrix4( _matrix$1 );\n\t\t\t\t\t\tculled = ! frustum.intersectsSphere( _sphere$2, camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! culled ) {\n\n\t\t\t\t\t\tconst geometryInfo = geometryInfoList[ geometryId ];\n\t\t\t\t\t\tmultiDrawStarts[ multiDrawCount ] = geometryInfo.start * bytesPerElement;\n\t\t\t\t\t\tmultiDrawCounts[ multiDrawCount ] = geometryInfo.count;\n\t\t\t\t\t\tindirectArray[ multiDrawCount ] = i;\n\t\t\t\t\t\tmultiDrawCount ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tindirectTexture.needsUpdate = true;\n\t\tthis._multiDrawCount = multiDrawCount;\n\t\tthis._visibilityChanged = false;\n\n\t}\n\n\tonBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {\n\n\t\tthis.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );\n\n\t}\n\n}\n\n/**\n * A material for rendering line primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0xffffff } );\n * ```\n *\n * @augments Material\n */\nclass LineBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new line basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineBasicMaterial = true;\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * Sets the color of the lines using data from a texture. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * Controls line thickness or lines.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}. WebGL and WebGPU\n\t\t * ignore this setting and always render line primitives with a\n\t\t * width of one pixel.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.linewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of line ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('butt'|'round'|'square')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of line joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vStart = /*@__PURE__*/ new Vector3();\nconst _vEnd = /*@__PURE__*/ new Vector3();\n\nconst _inverseMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _ray$1 = /*@__PURE__*/ new Ray();\nconst _sphere$1 = /*@__PURE__*/ new Sphere();\n\nconst _intersectPointOnRay = /*@__PURE__*/ new Vector3();\nconst _intersectPointOnSegment = /*@__PURE__*/ new Vector3();\n\n/**\n * A continuous line. The line are rendered by connecting consecutive\n * vertices with straight lines.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0x0000ff } );\n *\n * const points = [];\n * points.push( new THREE.Vector3( - 10, 0, 0 ) );\n * points.push( new THREE.Vector3( 0, 10, 0 ) );\n * points.push( new THREE.Vector3( 10, 0, 0 ) );\n *\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const line = new THREE.Line( geometry, material );\n * scene.add( line );\n * ```\n *\n * @augments Object3D\n */\nclass Line extends Object3D {\n\n\t/**\n\t * Constructs a new line.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array<Material>} [material] - The line material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLine = true;\n\n\t\tthis.type = 'Line';\n\n\t\t/**\n\t\t * The line geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The line material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default LineBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<String,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes an array of distance values which are necessary for rendering dashed lines.\n\t * For each vertex in the geometry, the method calculates the cumulative length from the\n\t * current point to the very beginning of the line.\n\t *\n\t * @return {Line} A reference to this line.\n\t */\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\tfor ( let i = 1, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t_vStart.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t_vEnd.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i ] += _vStart.distanceTo( _vEnd );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere$1.copy( geometry.boundingSphere );\n\t\t_sphere$1.applyMatrix4( matrixWorld );\n\t\t_sphere$1.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere$1 ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix$1.copy( matrixWorld ).invert();\n\t\t_ray$1.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$1 );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst a = index.getX( i );\n\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst a = index.getX( end - 1 );\n\t\t\t\tconst b = index.getX( start );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, a, b, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, i, i + 1, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray$1, localThresholdSq, end - 1, start, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, raycaster, ray, thresholdSq, a, b, i ) {\n\n\tconst positionAttribute = object.geometry.attributes.position;\n\n\t_vStart.fromBufferAttribute( positionAttribute, a );\n\t_vEnd.fromBufferAttribute( positionAttribute, b );\n\n\tconst distSq = ray.distanceSqToSegment( _vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment );\n\n\tif ( distSq > thresholdSq ) return;\n\n\t_intersectPointOnRay.applyMatrix4( object.matrixWorld ); // Move back to world space for distance calculation\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectPointOnRay );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\treturn {\n\n\t\tdistance: distance,\n\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t// point: raycaster.ray.at( distance ),\n\t\tpoint: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),\n\t\tindex: i,\n\t\tface: null,\n\t\tfaceIndex: null,\n\t\tbarycoord: null,\n\t\tobject: object\n\n\t};\n\n}\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\n/**\n * A series of lines drawn between pairs of vertices.\n *\n * @augments Line\n */\nclass LineSegments extends Line {\n\n\t/**\n\t * Constructs a new line segments.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array<Material>} [material] - The line material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineSegments = true;\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [];\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) {\n\n\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A continuous line. This is nearly the same as {@link Line} the only difference\n * is that the last vertex is connected with the first vertex in order to close\n * the line to form a loop.\n *\n * @augments Line\n */\nclass LineLoop extends Line {\n\n\t/**\n\t * Constructs a new line loop.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array<Material>} [material] - The line material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineLoop = true;\n\n\t\tthis.type = 'LineLoop';\n\n\t}\n\n}\n\n/**\n * A material for rendering point primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const vertices = [];\n *\n * for ( let i = 0; i < 10000; i ++ ) {\n * \tconst x = THREE.MathUtils.randFloatSpread( 2000 );\n * \tconst y = THREE.MathUtils.randFloatSpread( 2000 );\n * \tconst z = THREE.MathUtils.randFloatSpread( 2000 );\n *\n * \tvertices.push( x, y, z );\n * }\n *\n * const geometry = new THREE.BufferGeometry();\n * geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) );\n * const material = new THREE.PointsMaterial( { color: 0x888888 } );\n * const points = new THREE.Points( geometry, material );\n * scene.add( points );\n * ```\n *\n * @augments Material\n */\nclass PointsMaterial extends Material {\n\n\t/**\n\t * Constructs a new points material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointsMaterial = true;\n\n\t\tthis.type = 'PointsMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Defines the size of the points in pixels.\n\t\t *\n\t\t * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.size = 1;\n\n\t\t/**\n\t\t * Specifies whether size of individual points is attenuated by the camera depth (perspective camera only).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sizeAttenuation = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.size = source.size;\n\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _position$2 = /*@__PURE__*/ new Vector3();\n\n/**\n * A class for displaying points or point clouds.\n *\n * @augments Object3D\n */\nclass Points extends Object3D {\n\n\t/**\n\t * Constructs a new point cloud.\n\t *\n\t * @param {BufferGeometry} [geometry] - The points geometry.\n\t * @param {Material|Array<Material>} [material] - The points material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new PointsMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPoints = true;\n\n\t\tthis.type = 'Points';\n\n\t\t/**\n\t\t * The points geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The line material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default PointsMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<String,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this point cloud.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Points.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, il = end; i < il; i ++ ) {\n\n\t\t\t\tconst a = index.getX( i );\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, a );\n\n\t\t\t\ttestPoint( _position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end; i < l; i ++ ) {\n\n\t\t\t\t_position$2.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\ttestPoint( _position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Points#morphTargetDictionary} and {@link Points#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {\n\n\tconst rayPointDistanceSq = _ray.distanceSqToPoint( point );\n\n\tif ( rayPointDistanceSq < localThresholdSq ) {\n\n\t\tconst intersectPoint = new Vector3();\n\n\t\t_ray.closestPointToPoint( point, intersectPoint );\n\t\tintersectPoint.applyMatrix4( matrixWorld );\n\n\t\tconst distance = raycaster.ray.origin.distanceTo( intersectPoint );\n\n\t\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\t\tintersects.push( {\n\n\t\t\tdistance: distance,\n\t\t\tdistanceToRay: Math.sqrt( rayPointDistanceSq ),\n\t\t\tpoint: intersectPoint,\n\t\t\tindex: index,\n\t\t\tface: null,\n\t\t\tfaceIndex: null,\n\t\t\tbarycoord: null,\n\t\t\tobject: object\n\n\t\t} );\n\n\t}\n\n}\n\n/**\n * A texture for use with a video.\n *\n * ```js\n * // assuming you have created a HTML video element with id=\"video\"\n * const video = document.getElementById( 'video' );\n * const texture = new THREE.VideoTexture( video );\n * ```\n *\n * Note: When using video textures with {@link WebGPURenderer}, {@link Texture#colorSpace} must be\n * set to THREE.SRGBColorSpace.\n *\n * Note: After the initial use of a texture, its dimensions, format, and type\n * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one.\n *\n * @augments Texture\n */\nclass VideoTexture extends Texture {\n\n\t/**\n\t * Constructs a new video texture.\n\t *\n\t * @param {HTMLVideoElement} video - The video element to use as a data source for the texture.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( video, mapping, wrapS, wrapT, magFilter = LinearFilter, minFilter = LinearFilter, format, type, anisotropy ) {\n\n\t\tsuper( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isVideoTexture = true;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * The video frame request callback identifier, which is a positive integer.\n\t\t *\n\t\t * Value of 0 represents no scheduled rVFC.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t */\n\t\tthis._requestVideoFrameCallbackId = 0;\n\n\t\tconst scope = this;\n\n\t\tfunction updateVideo() {\n\n\t\t\tscope.needsUpdate = true;\n\t\t\tscope._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t\tif ( 'requestVideoFrameCallback' in video ) {\n\n\t\t\tthis._requestVideoFrameCallbackId = video.requestVideoFrameCallback( updateVideo );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.image ).copy( this );\n\n\t}\n\n\t/**\n\t * This method is called automatically by the renderer and sets {@link Texture#needsUpdate}\n\t * to `true` every time a new frame is available.\n\t *\n\t * Only relevant if `requestVideoFrameCallback` is not supported in the browser.\n\t */\n\tupdate() {\n\n\t\tconst video = this.image;\n\t\tconst hasVideoFrameCallback = 'requestVideoFrameCallback' in video;\n\n\t\tif ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) {\n\n\t\t\tthis.needsUpdate = true;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * @override\n\t */\n\tdispose() {\n\n\t\tif ( this._requestVideoFrameCallbackId !== 0 ) {\n\n\t\t\tthis.source.data.cancelVideoFrameCallback( this._requestVideoFrameCallbackId );\n\n\t\t}\n\n\t\tsuper.dispose();\n\n\t}\n\n}\n\n/**\n * This class can be used as an alternative way to define video data. Instead of using\n * an instance of `HTMLVideoElement` like with `VideoTexture`, `VideoFrameTexture` expects each frame is\n * defined manually via {@link VideoFrameTexture#setFrame}. A typical use case for this module is when\n * video frames are decoded with the WebCodecs API.\n *\n * ```js\n * const texture = new THREE.VideoFrameTexture();\n * texture.setFrame( frame );\n * ```\n *\n * @augments VideoTexture\n */\nclass VideoFrameTexture extends VideoTexture {\n\n\t/**\n\t * Constructs a new video frame texture.\n\t *\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( {}, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isVideoFrameTexture = true;\n\n\t}\n\n\t/**\n\t * This method overwritten with an empty implementation since\n\t * this type of texture is updated via `setFrame()`.\n\t */\n\tupdate() {}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this ); // restoring Texture.clone()\n\n\t}\n\n\t/**\n\t * Sets the current frame of the video. This will automatically update the texture\n\t * so the data can be used for rendering.\n\t *\n\t * @param {VideoFrame} frame - The video frame.\n\t */\n\tsetFrame( frame ) {\n\n\t\tthis.image = frame;\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * This class can only be used in combination with `copyFramebufferToTexture()` methods\n * of renderers. It extracts the contents of the current bound framebuffer and provides it\n * as a texture for further usage.\n *\n * ```js\n * const pixelRatio = window.devicePixelRatio;\n * const textureSize = 128 * pixelRatio;\n *\n * const frameTexture = new FramebufferTexture( textureSize, textureSize );\n *\n * // calculate start position for copying part of the frame data\n * const vector = new Vector2();\n * vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 );\n * vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 );\n *\n * renderer.render( scene, camera );\n *\n * // copy part of the rendered frame into the framebuffer texture\n * renderer.copyFramebufferToTexture( frameTexture, vector );\n * ```\n *\n * @augments Texture\n */\nclass FramebufferTexture extends Texture {\n\n\t/**\n\t * Constructs a new framebuffer texture.\n\t *\n\t * @param {number} [width] - The width of the texture.\n\t * @param {number} [height] - The height of the texture.\n\t */\n\tconstructor( width, height ) {\n\n\t\tsuper( { width, height } );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isFramebufferTexture = true;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers more than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default to disable filtering.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.magFilter = NearestFilter;\n\n\t\t/**\n\t\t * How the texture is sampled when a texel covers less than one pixel.\n\t\t *\n\t\t * Overwritten and set to `NearestFilter` by default to disable filtering.\n\t\t *\n\t\t * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)}\n\t\t * @default NearestFilter\n\t\t */\n\t\tthis.minFilter = NearestFilter;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * Creates a texture based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments Texture\n */\nclass CompressedTexture extends Texture {\n\n\t/**\n\t * Constructs a new compressed texture.\n\t *\n\t * @param {Array<Object>} mipmaps - This array holds for all mipmaps (including the bases mip)\n\t * the data and dimensions.\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {string} [colorSpace=NoColorSpace] - The color space.\n\t */\n\tconstructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {\n\n\t\tsuper( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedTexture = true;\n\n\t\t/**\n\t\t * The image property of a compressed texture just defines its dimensions.\n\t\t *\n\t\t * @type {{width:number,height:number}}\n\t\t */\n\t\tthis.image = { width: width, height: height };\n\n\t\t/**\n\t\t * This array holds for all mipmaps (including the bases mip) the data and dimensions.\n\t\t *\n\t\t * @type {Array<Object>}\n\t\t */\n\t\tthis.mipmaps = mipmaps;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default since it is not possible to\n\t\t * flip compressed textures.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default since it is not\n\t\t * possible to generate mipmaps for compressed data. Mipmaps\n\t\t * must be embedded in the compressed texture file.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t}\n\n}\n\n/**\n * Creates a texture 2D array based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments CompressedTexture\n */\nclass CompressedArrayTexture extends CompressedTexture {\n\n\t/**\n\t * Constructs a new compressed array texture.\n\t *\n\t * @param {Array<Object>} mipmaps - This array holds for all mipmaps (including the bases mip)\n\t * the data and dimensions.\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} depth - The depth of the texture.\n\t * @param {number} [format=RGBAFormat] - The min filter value.\n\t * @param {number} [type=UnsignedByteType] - The min filter value.\n\t */\n\tconstructor( mipmaps, width, height, depth, format, type ) {\n\n\t\tsuper( mipmaps, width, height, format, type );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedArrayTexture = true;\n\n\t\t/**\n\t\t * The image property of a compressed texture just defines its dimensions.\n\t\t *\n\t\t * @name CompressedArrayTexture#image\n\t\t * @type {{width:number,height:number,depth:number}}\n\t\t */\n\t\tthis.image.depth = depth;\n\n\t\t/**\n\t\t * This defines how the texture is wrapped in the depth and corresponds to\n\t\t * *W* in UVW mapping.\n\t\t *\n\t\t * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)}\n\t\t * @default ClampToEdgeWrapping\n\t\t */\n\t\tthis.wrapR = ClampToEdgeWrapping;\n\n\t\t/**\n\t\t * A set of all layers which need to be updated in the texture.\n\t\t *\n\t\t * @type {Set<number>}\n\t\t */\n\t\tthis.layerUpdates = new Set();\n\n\t}\n\n\t/**\n\t * Describes that a specific layer of the texture needs to be updated.\n\t * Normally when {@link Texture#needsUpdate} is set to `true`, the\n\t * entire compressed texture array is sent to the GPU. Marking specific\n\t * layers will only transmit subsets of all mipmaps associated with a\n\t * specific depth in the array which is often much more performant.\n\t *\n\t * @param {number} layerIndex - The layer index that should be updated.\n\t */\n\taddLayerUpdate( layerIndex ) {\n\n\t\tthis.layerUpdates.add( layerIndex );\n\n\t}\n\n\t/**\n\t * Resets the layer updates registry.\n\t */\n\tclearLayerUpdates() {\n\n\t\tthis.layerUpdates.clear();\n\n\t}\n\n}\n\n/**\n * Creates a cube texture based on data in compressed form.\n *\n * These texture are usually loaded with {@link CompressedTextureLoader}.\n *\n * @augments CompressedTexture\n */\nclass CompressedCubeTexture extends CompressedTexture {\n\n\t/**\n\t * Constructs a new compressed texture.\n\t *\n\t * @param {Array<CompressedTexture>} images - An array of compressed textures.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t */\n\tconstructor( images, format, type ) {\n\n\t\tsuper( undefined, images[ 0 ].width, images[ 0 ].height, format, type, CubeReflectionMapping );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCompressedCubeTexture = true;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubeTexture = true;\n\n\t\tthis.image = images;\n\n\t}\n\n}\n\n/**\n * Creates a texture from a canvas element.\n *\n * This is almost the same as the base texture class, except that it sets {@link Texture#needsUpdate}\n * to `true` immediately since a canvas can directly be used for rendering.\n *\n * @augments Texture\n */\nclass CanvasTexture extends Texture {\n\n\t/**\n\t * Constructs a new texture.\n\t *\n\t * @param {HTMLCanvasElement} [canvas] - The HTML canvas element.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value.\n\t * @param {number} [format=RGBAFormat] - The texture format.\n\t * @param {number} [type=UnsignedByteType] - The texture type.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t */\n\tconstructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {\n\n\t\tsuper( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCanvasTexture = true;\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n\n/**\n * This class can be used to automatically save the depth information of a\n * rendering into a texture.\n *\n * @augments Texture\n */\nclass DepthTexture extends Texture {\n\n\t/**\n\t * Constructs a new depth texture.\n\t *\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} [type=UnsignedIntType] - The texture type.\n\t * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.\n\t * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.\n\t * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.\n\t * @param {number} [magFilter=LinearFilter] - The mag filter value.\n\t * @param {number} [minFilter=LinearFilter] - The min filter value.\n\t * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.\n\t * @param {number} [format=DepthFormat] - The texture format.\n\t * @param {number} [depth=1] - The depth of the texture.\n\t */\n\tconstructor( width, height, type = UnsignedIntType, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, format = DepthFormat, depth = 1 ) {\n\n\t\tif ( format !== DepthFormat && format !== DepthStencilFormat ) {\n\n\t\t\tthrow new Error( 'DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat' );\n\n\t\t}\n\n\t\tconst image = { width: width, height: height, depth: depth };\n\n\t\tsuper( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDepthTexture = true;\n\n\t\t/**\n\t\t * If set to `true`, the texture is flipped along the vertical axis when\n\t\t * uploaded to the GPU.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flipY = false;\n\n\t\t/**\n\t\t * Whether to generate mipmaps (if possible) for a texture.\n\t\t *\n\t\t * Overwritten and set to `false` by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.generateMipmaps = false;\n\n\t\t/**\n\t\t * Code corresponding to the depth compare function.\n\t\t *\n\t\t * @type {?(NeverCompare|LessCompare|EqualCompare|LessEqualCompare|GreaterCompare|NotEqualCompare|GreaterEqualCompare|AlwaysCompare)}\n\t\t * @default null\n\t\t */\n\t\tthis.compareFunction = null;\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.source = new Source( Object.assign( {}, source.image ) ); // see #30540\n\t\tthis.compareFunction = source.compareFunction;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tif ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a capsule.\n *\n * ```js\n * const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const capsule = new THREE.Mesh( geometry, material );\n * scene.add( capsule );\n * ```\n *\n * @augments BufferGeometry\n */\nclass CapsuleGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new capsule geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the capsule.\n\t * @param {number} [height=1] - Height of the middle section.\n\t * @param {number} [capSegments=4] - Number of curve segments used to build each cap.\n\t * @param {number} [radialSegments=8] - Number of segmented faces around the circumference of the capsule. Must be an integer >= 3.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the middle section. Must be an integer >= 1.\n\t */\n\tconstructor( radius = 1, height = 1, capSegments = 4, radialSegments = 8, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CapsuleGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tcapSegments: capSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t};\n\n\t\theight = Math.max( 0, height );\n\t\tcapSegments = Math.max( 1, Math.floor( capSegments ) );\n\t\tradialSegments = Math.max( 3, Math.floor( radialSegments ) );\n\t\theightSegments = Math.max( 1, Math.floor( heightSegments ) );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst halfHeight = height / 2;\n\t\tconst capArcLength = ( Math.PI / 2 ) * radius;\n\t\tconst cylinderPartLength = height;\n\t\tconst totalArcLength = 2 * capArcLength + cylinderPartLength;\n\n\t\tconst numVerticalSegments = capSegments * 2 + heightSegments;\n\t\tconst verticesPerRow = radialSegments + 1;\n\n\t\tconst normal = new Vector3();\n\t\tconst vertex = new Vector3();\n\n\t\t// generate vertices, normals, and uvs\n\n\t\tfor ( let iy = 0; iy <= numVerticalSegments; iy ++ ) {\n\n\t\t\tlet currentArcLength = 0;\n\t\t\tlet profileY = 0;\n\t\t\tlet profileRadius = 0;\n\t\t\tlet normalYComponent = 0;\n\n\t\t\tif ( iy <= capSegments ) {\n\n\t\t\t\t// bottom cap\n\t\t\t\tconst segmentProgress = iy / capSegments;\n\t\t\t\tconst angle = ( segmentProgress * Math.PI ) / 2;\n\t\t\t\tprofileY = - halfHeight - radius * Math.cos( angle );\n\t\t\t\tprofileRadius = radius * Math.sin( angle );\n\t\t\t\tnormalYComponent = - radius * Math.cos( angle );\n\t\t\t\tcurrentArcLength = segmentProgress * capArcLength;\n\n\t\t\t} else if ( iy <= capSegments + heightSegments ) {\n\n\t\t\t\t// middle section\n\t\t\t\tconst segmentProgress = ( iy - capSegments ) / heightSegments;\n\t\t\t\tprofileY = - halfHeight + segmentProgress * height;\n\t\t\t\tprofileRadius = radius;\n\t\t\t\tnormalYComponent = 0;\n\t\t\t\tcurrentArcLength = capArcLength + segmentProgress * cylinderPartLength;\n\n\t\t\t} else {\n\n\t\t\t\t// top cap\n\t\t\t\tconst segmentProgress =\n\t\t\t\t\t( iy - capSegments - heightSegments ) / capSegments;\n\t\t\t\tconst angle = ( segmentProgress * Math.PI ) / 2;\n\t\t\t\tprofileY = halfHeight + radius * Math.sin( angle );\n\t\t\t\tprofileRadius = radius * Math.cos( angle );\n\t\t\t\tnormalYComponent = radius * Math.sin( angle );\n\t\t\t\tcurrentArcLength =\n\t\t\t\t\tcapArcLength + cylinderPartLength + segmentProgress * capArcLength;\n\n\t\t\t}\n\n\t\t\tconst v = Math.max( 0, Math.min( 1, currentArcLength / totalArcLength ) );\n\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / radialSegments;\n\n\t\t\t} else if ( iy === numVerticalSegments ) {\n\n\t\t\t\tuOffset = -0.5 / radialSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= radialSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / radialSegments;\n\t\t\t\tconst theta = u * Math.PI * 2;\n\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - profileRadius * cosTheta;\n\t\t\t\tvertex.y = profileY;\n\t\t\t\tvertex.z = profileRadius * sinTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.set(\n\t\t\t\t\t- profileRadius * cosTheta,\n\t\t\t\t\tnormalYComponent,\n\t\t\t\t\tprofileRadius * sinTheta\n\t\t\t\t);\n\t\t\t\tnormal.normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, v );\n\n\t\t\t}\n\n\t\t\tif ( iy > 0 ) {\n\n\t\t\t\tconst prevIndexRow = ( iy - 1 ) * verticesPerRow;\n\t\t\t\tfor ( let ix = 0; ix < radialSegments; ix ++ ) {\n\n\t\t\t\t\tconst i1 = prevIndexRow + ix;\n\t\t\t\t\tconst i2 = prevIndexRow + ix + 1;\n\t\t\t\t\tconst i3 = iy * verticesPerRow + ix;\n\t\t\t\t\tconst i4 = iy * verticesPerRow + ix + 1;\n\n\t\t\t\t\tindices.push( i1, i2, i3 );\n\t\t\t\t\tindices.push( i2, i4, i3 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CapsuleGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CapsuleGeometry( data.radius, data.height, data.capSegments, data.radialSegments, data.heightSegments );\n\n\t}\n\n}\n\n/**\n * A simple shape of Euclidean geometry. It is constructed from a\n * number of triangular segments that are oriented around a central point and\n * extend as far out as a given radius. It is built counter-clockwise from a\n * start angle and a given central angle. It can also be used to create\n * regular polygons, where the number of segments determines the number of\n * sides.\n *\n * ```js\n * const geometry = new THREE.CircleGeometry( 5, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const circle = new THREE.Mesh( geometry, material );\n * scene.add( circle )\n * ```\n *\n * @augments BufferGeometry\n */\nclass CircleGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new circle geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the circle.\n\t * @param {number} [segments=32] - Number of segments (triangles), minimum = `3`.\n\t * @param {number} [thetaStart=0] - Start angle for first segment in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta,\n\t * of the circular sector in radians. The default value results in a complete circle.\n\t */\n\tconstructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CircleGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tsegments: segments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tsegments = Math.max( 3, segments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// center point\n\n\t\tvertices.push( 0, 0, 0 );\n\t\tnormals.push( 0, 0, 1 );\n\t\tuvs.push( 0.5, 0.5 );\n\n\t\tfor ( let s = 0, i = 3; s <= segments; s ++, i += 3 ) {\n\n\t\t\tconst segment = thetaStart + s / segments * thetaLength;\n\n\t\t\t// vertex\n\n\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t// normal\n\n\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t// uvs\n\n\t\t\tuv.x = ( vertices[ i ] / radius + 1 ) / 2;\n\t\t\tuv.y = ( vertices[ i + 1 ] / radius + 1 ) / 2;\n\n\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tindices.push( i, i + 1, 0 );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CircleGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CircleGeometry( data.radius, data.segments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a cylinder.\n *\n * ```js\n * const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const cylinder = new THREE.Mesh( geometry, material );\n * scene.add( cylinder );\n * ```\n *\n * @augments BufferGeometry\n */\nclass CylinderGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new cylinder geometry.\n\t *\n\t * @param {number} [radiusTop=1] - Radius of the cylinder at the top.\n\t * @param {number} [radiusBottom=1] - Radius of the cylinder at the bottom.\n\t * @param {number} [height=1] - Height of the cylinder.\n\t * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cylinder.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cylinder.\n\t * @param {boolean} [openEnded=false] - Whether the base of the cylinder is open or capped.\n\t * @param {number} [thetaStart=0] - Start angle for first segment, in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.\n\t * The default value results in a complete cylinder.\n\t */\n\tconstructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'CylinderGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradiusTop: radiusTop,\n\t\t\tradiusBottom: radiusBottom,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tconst scope = this;\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\theightSegments = Math.floor( heightSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet index = 0;\n\t\tconst indexArray = [];\n\t\tconst halfHeight = height / 2;\n\t\tlet groupStart = 0;\n\n\t\t// generate geometry\n\n\t\tgenerateTorso();\n\n\t\tif ( openEnded === false ) {\n\n\t\t\tif ( radiusTop > 0 ) generateCap( true );\n\t\t\tif ( radiusBottom > 0 ) generateCap( false );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\tfunction generateTorso() {\n\n\t\t\tconst normal = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\t// this will be used to calculate the normal\n\t\t\tconst slope = ( radiusBottom - radiusTop ) / height;\n\n\t\t\t// generate vertices, normals and uvs\n\n\t\t\tfor ( let y = 0; y <= heightSegments; y ++ ) {\n\n\t\t\t\tconst indexRow = [];\n\n\t\t\t\tconst v = y / heightSegments;\n\n\t\t\t\t// calculate the radius of the current row\n\n\t\t\t\tconst radius = v * ( radiusBottom - radiusTop ) + radiusTop;\n\n\t\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\t\tconst u = x / radialSegments;\n\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\t\tconst sinTheta = Math.sin( theta );\n\t\t\t\t\tconst cosTheta = Math.cos( theta );\n\n\t\t\t\t\t// vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = - v * height + halfHeight;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t\t// normal\n\n\t\t\t\t\tnormal.set( sinTheta, slope, cosTheta ).normalize();\n\t\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\t// uv\n\n\t\t\t\t\tuvs.push( u, 1 - v );\n\n\t\t\t\t\t// save index of vertex in respective row\n\n\t\t\t\t\tindexRow.push( index ++ );\n\n\t\t\t\t}\n\n\t\t\t\t// now save vertices of the row in our index array\n\n\t\t\t\tindexArray.push( indexRow );\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tfor ( let y = 0; y < heightSegments; y ++ ) {\n\n\t\t\t\t\t// we use the index array to access the correct indices\n\n\t\t\t\t\tconst a = indexArray[ y ][ x ];\n\t\t\t\t\tconst b = indexArray[ y + 1 ][ x ];\n\t\t\t\t\tconst c = indexArray[ y + 1 ][ x + 1 ];\n\t\t\t\t\tconst d = indexArray[ y ][ x + 1 ];\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tif ( radiusTop > 0 || y !== 0 ) {\n\n\t\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( radiusBottom > 0 || y !== heightSegments - 1 ) {\n\n\t\t\t\t\t\tindices.push( b, c, d );\n\t\t\t\t\t\tgroupCount += 3;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, 0 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t\tfunction generateCap( top ) {\n\n\t\t\t// save the index of the first center vertex\n\t\t\tconst centerIndexStart = index;\n\n\t\t\tconst uv = new Vector2();\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tlet groupCount = 0;\n\n\t\t\tconst radius = ( top === true ) ? radiusTop : radiusBottom;\n\t\t\tconst sign = ( top === true ) ? 1 : -1;\n\n\t\t\t// first we generate the center vertex data of the cap.\n\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\tfor ( let x = 1; x <= radialSegments; x ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertices.push( 0, halfHeight * sign, 0 );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( 0.5, 0.5 );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// save the index of the last center vertex\n\t\t\tconst centerIndexEnd = index;\n\n\t\t\t// now we generate the surrounding vertices, normals and uvs\n\n\t\t\tfor ( let x = 0; x <= radialSegments; x ++ ) {\n\n\t\t\t\tconst u = x / radialSegments;\n\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\n\t\t\t\tconst cosTheta = Math.cos( theta );\n\t\t\t\tconst sinTheta = Math.sin( theta );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, sign, 0 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( cosTheta * 0.5 ) + 0.5;\n\t\t\t\tuv.y = ( sinTheta * 0.5 * sign ) + 0.5;\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// increase index\n\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\t// generate indices\n\n\t\t\tfor ( let x = 0; x < radialSegments; x ++ ) {\n\n\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\tif ( top === true ) {\n\n\t\t\t\t\t// face top\n\n\t\t\t\t\tindices.push( i, i + 1, c );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// face bottom\n\n\t\t\t\t\tindices.push( i + 1, i, c );\n\n\t\t\t\t}\n\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t\t// add a group to the geometry. this will ensure multi material support\n\n\t\t\tscope.addGroup( groupStart, groupCount, top === true ? 1 : 2 );\n\n\t\t\t// calculate new start value for groups\n\n\t\t\tgroupStart += groupCount;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {CylinderGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new CylinderGeometry( data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a cone.\n *\n * ```js\n * const geometry = new THREE.ConeGeometry( 5, 20, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const cone = new THREE.Mesh(geometry, material );\n * scene.add( cone );\n * ```\n *\n * @augments CylinderGeometry\n */\nclass ConeGeometry extends CylinderGeometry {\n\n\t/**\n\t * Constructs a new cone geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the cone base.\n\t * @param {number} [height=1] - Height of the cone.\n\t * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cone.\n\t * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cone.\n\t * @param {boolean} [openEnded=false] - Whether the base of the cone is open or capped.\n\t * @param {number} [thetaStart=0] - Start angle for first segment, in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians.\n\t * The default value results in a complete cone.\n\t */\n\tconstructor( radius = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper( 0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );\n\n\t\tthis.type = 'ConeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\theight: height,\n\t\t\tradialSegments: radialSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\topenEnded: openEnded,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {ConeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new ConeGeometry( data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A polyhedron is a solid in three dimensions with flat faces. This class\n * will take an array of vertices, project them onto a sphere, and then\n * divide them up to the desired level of detail.\n *\n * @augments BufferGeometry\n */\nclass PolyhedronGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new polyhedron geometry.\n\t *\n\t * @param {Array<number>} [vertices] - A flat array of vertices describing the base shape.\n\t * @param {Array<number>} [indices] - A flat array of indices describing the base shape.\n\t * @param {number} [radius=1] - The radius of the shape.\n\t * @param {number} [detail=0] - How many levels to subdivide the geometry. The more detail, the smoother the shape.\n\t */\n\tconstructor( vertices = [], indices = [], radius = 1, detail = 0 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PolyhedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tvertices: vertices,\n\t\t\tindices: indices,\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t\t// default buffer data\n\n\t\tconst vertexBuffer = [];\n\t\tconst uvBuffer = [];\n\n\t\t// the subdivision creates the vertex buffer data\n\n\t\tsubdivide( detail );\n\n\t\t// all vertices should lie on a conceptual sphere with a given radius\n\n\t\tapplyRadius( radius );\n\n\t\t// finally, create the uv data\n\n\t\tgenerateUVs();\n\n\t\t// build non-indexed geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertexBuffer, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( vertexBuffer.slice(), 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvBuffer, 2 ) );\n\n\t\tif ( detail === 0 ) {\n\n\t\t\tthis.computeVertexNormals(); // flat normals\n\n\t\t} else {\n\n\t\t\tthis.normalizeNormals(); // smooth normals\n\n\t\t}\n\n\t\t// helper functions\n\n\t\tfunction subdivide( detail ) {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\t// iterate over all faces and apply a subdivision with the given detail value\n\n\t\t\tfor ( let i = 0; i < indices.length; i += 3 ) {\n\n\t\t\t\t// get the vertices of the face\n\n\t\t\t\tgetVertexByIndex( indices[ i + 0 ], a );\n\t\t\t\tgetVertexByIndex( indices[ i + 1 ], b );\n\t\t\t\tgetVertexByIndex( indices[ i + 2 ], c );\n\n\t\t\t\t// perform subdivision\n\n\t\t\t\tsubdivideFace( a, b, c, detail );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction subdivideFace( a, b, c, detail ) {\n\n\t\t\tconst cols = detail + 1;\n\n\t\t\t// we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\tconst v = [];\n\n\t\t\t// construct all of the vertices for this subdivision\n\n\t\t\tfor ( let i = 0; i <= cols; i ++ ) {\n\n\t\t\t\tv[ i ] = [];\n\n\t\t\t\tconst aj = a.clone().lerp( c, i / cols );\n\t\t\t\tconst bj = b.clone().lerp( c, i / cols );\n\n\t\t\t\tconst rows = cols - i;\n\n\t\t\t\tfor ( let j = 0; j <= rows; j ++ ) {\n\n\t\t\t\t\tif ( j === 0 && i === cols ) {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tv[ i ][ j ] = aj.clone().lerp( bj, j / rows );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// construct all of the faces\n\n\t\t\tfor ( let i = 0; i < cols; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j < 2 * ( cols - i ) - 1; j ++ ) {\n\n\t\t\t\t\tconst k = Math.floor( j / 2 );\n\n\t\t\t\t\tif ( j % 2 === 0 ) {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\t\t\t\t\t\tpushVertex( v[ i ][ k ] );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tpushVertex( v[ i ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k + 1 ] );\n\t\t\t\t\t\tpushVertex( v[ i + 1 ][ k ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction applyRadius( radius ) {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\t// iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tvertex.normalize().multiplyScalar( radius );\n\n\t\t\t\tvertexBuffer[ i + 0 ] = vertex.x;\n\t\t\t\tvertexBuffer[ i + 1 ] = vertex.y;\n\t\t\t\tvertexBuffer[ i + 2 ] = vertex.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tconst vertex = new Vector3();\n\n\t\t\tfor ( let i = 0; i < vertexBuffer.length; i += 3 ) {\n\n\t\t\t\tvertex.x = vertexBuffer[ i + 0 ];\n\t\t\t\tvertex.y = vertexBuffer[ i + 1 ];\n\t\t\t\tvertex.z = vertexBuffer[ i + 2 ];\n\n\t\t\t\tconst u = azimuth( vertex ) / 2 / Math.PI + 0.5;\n\t\t\t\tconst v = inclination( vertex ) / Math.PI + 0.5;\n\t\t\t\tuvBuffer.push( u, 1 - v );\n\n\t\t\t}\n\n\t\t\tcorrectUVs();\n\n\t\t\tcorrectSeam();\n\n\t\t}\n\n\t\tfunction correctSeam() {\n\n\t\t\t// handle case when face straddles the seam, see #3269\n\n\t\t\tfor ( let i = 0; i < uvBuffer.length; i += 6 ) {\n\n\t\t\t\t// uv data of a single face\n\n\t\t\t\tconst x0 = uvBuffer[ i + 0 ];\n\t\t\t\tconst x1 = uvBuffer[ i + 2 ];\n\t\t\t\tconst x2 = uvBuffer[ i + 4 ];\n\n\t\t\t\tconst max = Math.max( x0, x1, x2 );\n\t\t\t\tconst min = Math.min( x0, x1, x2 );\n\n\t\t\t\t// 0.9 is somewhat arbitrary\n\n\t\t\t\tif ( max > 0.9 && min < 0.1 ) {\n\n\t\t\t\t\tif ( x0 < 0.2 ) uvBuffer[ i + 0 ] += 1;\n\t\t\t\t\tif ( x1 < 0.2 ) uvBuffer[ i + 2 ] += 1;\n\t\t\t\t\tif ( x2 < 0.2 ) uvBuffer[ i + 4 ] += 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction pushVertex( vertex ) {\n\n\t\t\tvertexBuffer.push( vertex.x, vertex.y, vertex.z );\n\n\t\t}\n\n\t\tfunction getVertexByIndex( index, vertex ) {\n\n\t\t\tconst stride = index * 3;\n\n\t\t\tvertex.x = vertices[ stride + 0 ];\n\t\t\tvertex.y = vertices[ stride + 1 ];\n\t\t\tvertex.z = vertices[ stride + 2 ];\n\n\t\t}\n\n\t\tfunction correctUVs() {\n\n\t\t\tconst a = new Vector3();\n\t\t\tconst b = new Vector3();\n\t\t\tconst c = new Vector3();\n\n\t\t\tconst centroid = new Vector3();\n\n\t\t\tconst uvA = new Vector2();\n\t\t\tconst uvB = new Vector2();\n\t\t\tconst uvC = new Vector2();\n\n\t\t\tfor ( let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6 ) {\n\n\t\t\t\ta.set( vertexBuffer[ i + 0 ], vertexBuffer[ i + 1 ], vertexBuffer[ i + 2 ] );\n\t\t\t\tb.set( vertexBuffer[ i + 3 ], vertexBuffer[ i + 4 ], vertexBuffer[ i + 5 ] );\n\t\t\t\tc.set( vertexBuffer[ i + 6 ], vertexBuffer[ i + 7 ], vertexBuffer[ i + 8 ] );\n\n\t\t\t\tuvA.set( uvBuffer[ j + 0 ], uvBuffer[ j + 1 ] );\n\t\t\t\tuvB.set( uvBuffer[ j + 2 ], uvBuffer[ j + 3 ] );\n\t\t\t\tuvC.set( uvBuffer[ j + 4 ], uvBuffer[ j + 5 ] );\n\n\t\t\t\tcentroid.copy( a ).add( b ).add( c ).divideScalar( 3 );\n\n\t\t\t\tconst azi = azimuth( centroid );\n\n\t\t\t\tcorrectUV( uvA, j + 0, a, azi );\n\t\t\t\tcorrectUV( uvB, j + 2, b, azi );\n\t\t\t\tcorrectUV( uvC, j + 4, c, azi );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction correctUV( uv, stride, vector, azimuth ) {\n\n\t\t\tif ( ( azimuth < 0 ) && ( uv.x === 1 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = uv.x - 1;\n\n\t\t\t}\n\n\t\t\tif ( ( vector.x === 0 ) && ( vector.z === 0 ) ) {\n\n\t\t\t\tuvBuffer[ stride ] = azimuth / 2 / Math.PI + 0.5;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Angle around the Y axis, counter-clockwise when looking from above.\n\n\t\tfunction azimuth( vector ) {\n\n\t\t\treturn Math.atan2( vector.z, - vector.x );\n\n\t\t}\n\n\n\t\t// Angle above the XZ plane.\n\n\t\tfunction inclination( vector ) {\n\n\t\t\treturn Math.atan2( - vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {PolyhedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new PolyhedronGeometry( data.vertices, data.indices, data.radius, data.details );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a dodecahedron.\n *\n * ```js\n * const geometry = new THREE.DodecahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const dodecahedron = new THREE.Mesh( geometry, material );\n * scene.add( dodecahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n */\nclass DodecahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new dodecahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the dodecahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a dodecahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\t\tconst r = 1 / t;\n\n\t\tconst vertices = [\n\n\t\t\t// (±1, ±1, ±1)\n\t\t\t-1, -1, -1,\t-1, -1, 1,\n\t\t\t-1, 1, -1, -1, 1, 1,\n\t\t\t1, -1, -1, 1, -1, 1,\n\t\t\t1, 1, -1, 1, 1, 1,\n\n\t\t\t// (0, ±1/φ, ±φ)\n\t\t\t0, - r, - t, 0, - r, t,\n\t\t\t0, r, - t, 0, r, t,\n\n\t\t\t// (±1/φ, ±φ, 0)\n\t\t\t- r, - t, 0, - r, t, 0,\n\t\t\tr, - t, 0, r, t, 0,\n\n\t\t\t// (±φ, 0, ±1/φ)\n\t\t\t- t, 0, - r, t, 0, - r,\n\t\t\t- t, 0, r, t, 0, r\n\t\t];\n\n\t\tconst indices = [\n\t\t\t3, 11, 7, \t3, 7, 15, \t3, 15, 13,\n\t\t\t7, 19, 17, \t7, 17, 6, \t7, 6, 15,\n\t\t\t17, 4, 8, \t17, 8, 10, \t17, 10, 6,\n\t\t\t8, 0, 16, \t8, 16, 2, \t8, 2, 10,\n\t\t\t0, 12, 1, \t0, 1, 18, \t0, 18, 16,\n\t\t\t6, 10, 2, \t6, 2, 13, \t6, 13, 15,\n\t\t\t2, 16, 18, \t2, 18, 3, \t2, 3, 13,\n\t\t\t18, 1, 9, \t18, 9, 11, \t18, 11, 3,\n\t\t\t4, 14, 12, \t4, 12, 0, \t4, 0, 8,\n\t\t\t11, 9, 5, \t11, 5, 19, \t11, 19, 7,\n\t\t\t19, 5, 14, \t19, 14, 4, \t19, 4, 17,\n\t\t\t1, 12, 14, \t1, 14, 5, \t1, 5, 9\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'DodecahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {DodecahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new DodecahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1$1 = /*@__PURE__*/ new Vector3();\nconst _normal = /*@__PURE__*/ new Vector3();\nconst _triangle = /*@__PURE__*/ new Triangle();\n\n/**\n * Can be used as a helper object to view the edges of a geometry.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry();\n * const edges = new THREE.EdgesGeometry( geometry );\n * const line = new THREE.LineSegments( edges );\n * scene.add( line );\n * ```\n *\n * Note: It is not yet possible to serialize/deserialize instances of this class.\n *\n * @augments BufferGeometry\n */\nclass EdgesGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new edges geometry.\n\t *\n\t * @param {?BufferGeometry} [geometry=null] - The geometry.\n\t * @param {number} [thresholdAngle=1] - An edge is only rendered if the angle (in degrees)\n\t * between the face normals of the adjoining faces exceeds this value.\n\t */\n\tconstructor( geometry = null, thresholdAngle = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'EdgesGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry,\n\t\t\tthresholdAngle: thresholdAngle\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\tconst precisionPoints = 4;\n\t\t\tconst precision = Math.pow( 10, precisionPoints );\n\t\t\tconst thresholdDot = Math.cos( DEG2RAD * thresholdAngle );\n\n\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\tconst positionAttr = geometry.getAttribute( 'position' );\n\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\n\t\t\tconst indexArr = [ 0, 0, 0 ];\n\t\t\tconst vertKeys = [ 'a', 'b', 'c' ];\n\t\t\tconst hashes = new Array( 3 );\n\n\t\t\tconst edgeData = {};\n\t\t\tconst vertices = [];\n\t\t\tfor ( let i = 0; i < indexCount; i += 3 ) {\n\n\t\t\t\tif ( indexAttr ) {\n\n\t\t\t\t\tindexArr[ 0 ] = indexAttr.getX( i );\n\t\t\t\t\tindexArr[ 1 ] = indexAttr.getX( i + 1 );\n\t\t\t\t\tindexArr[ 2 ] = indexAttr.getX( i + 2 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tindexArr[ 0 ] = i;\n\t\t\t\t\tindexArr[ 1 ] = i + 1;\n\t\t\t\t\tindexArr[ 2 ] = i + 2;\n\n\t\t\t\t}\n\n\t\t\t\tconst { a, b, c } = _triangle;\n\t\t\t\ta.fromBufferAttribute( positionAttr, indexArr[ 0 ] );\n\t\t\t\tb.fromBufferAttribute( positionAttr, indexArr[ 1 ] );\n\t\t\t\tc.fromBufferAttribute( positionAttr, indexArr[ 2 ] );\n\t\t\t\t_triangle.getNormal( _normal );\n\n\t\t\t\t// create hashes for the edge from the vertices\n\t\t\t\thashes[ 0 ] = `${ Math.round( a.x * precision ) },${ Math.round( a.y * precision ) },${ Math.round( a.z * precision ) }`;\n\t\t\t\thashes[ 1 ] = `${ Math.round( b.x * precision ) },${ Math.round( b.y * precision ) },${ Math.round( b.z * precision ) }`;\n\t\t\t\thashes[ 2 ] = `${ Math.round( c.x * precision ) },${ Math.round( c.y * precision ) },${ Math.round( c.z * precision ) }`;\n\n\t\t\t\t// skip degenerate triangles\n\t\t\t\tif ( hashes[ 0 ] === hashes[ 1 ] || hashes[ 1 ] === hashes[ 2 ] || hashes[ 2 ] === hashes[ 0 ] ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t// iterate over every edge\n\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\tconst jNext = ( j + 1 ) % 3;\n\t\t\t\t\tconst vecHash0 = hashes[ j ];\n\t\t\t\t\tconst vecHash1 = hashes[ jNext ];\n\t\t\t\t\tconst v0 = _triangle[ vertKeys[ j ] ];\n\t\t\t\t\tconst v1 = _triangle[ vertKeys[ jNext ] ];\n\n\t\t\t\t\tconst hash = `${ vecHash0 }_${ vecHash1 }`;\n\t\t\t\t\tconst reverseHash = `${ vecHash1 }_${ vecHash0 }`;\n\n\t\t\t\t\tif ( reverseHash in edgeData && edgeData[ reverseHash ] ) {\n\n\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\tif ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {\n\n\t\t\t\t\t\t\tvertices.push( v0.x, v0.y, v0.z );\n\t\t\t\t\t\t\tvertices.push( v1.x, v1.y, v1.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tedgeData[ reverseHash ] = null;\n\n\t\t\t\t\t} else if ( ! ( hash in edgeData ) ) {\n\n\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\tedgeData[ hash ] = {\n\n\t\t\t\t\t\t\tindex0: indexArr[ j ],\n\t\t\t\t\t\t\tindex1: indexArr[ jNext ],\n\t\t\t\t\t\t\tnormal: _normal.clone(),\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// iterate over all remaining, unmatched edges and add them to the vertex array\n\t\t\tfor ( const key in edgeData ) {\n\n\t\t\t\tif ( edgeData[ key ] ) {\n\n\t\t\t\t\tconst { index0, index1 } = edgeData[ key ];\n\t\t\t\t\t_v0.fromBufferAttribute( positionAttr, index0 );\n\t\t\t\t\t_v1$1.fromBufferAttribute( positionAttr, index1 );\n\n\t\t\t\t\tvertices.push( _v0.x, _v0.y, _v0.z );\n\t\t\t\t\tvertices.push( _v1$1.x, _v1$1.y, _v1$1.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * An abstract base class for creating an analytic curve object that contains methods\n * for interpolation.\n *\n * @abstract\n */\nclass Curve {\n\n\t/**\n\t * Constructs a new curve.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'Curve';\n\n\t\t/**\n\t\t * This value determines the amount of divisions when calculating the\n\t\t * cumulative segment lengths of a curve via {@link Curve#getLengths}. To ensure\n\t\t * precision when using methods like {@link Curve#getSpacedPoints}, it is\n\t\t * recommended to increase the value of this property if the curve is very large.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 200\n\t\t */\n\t\tthis.arcLengthDivisions = 200;\n\n\t\t/**\n\t\t * Must be set to `true` if the curve parameters have changed.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.needsUpdate = false;\n\n\t\t/**\n\t\t * An internal cache that holds precomputed curve length values.\n\t\t *\n\t\t * @private\n\t\t * @type {?Array<number>}\n\t\t * @default null\n\t\t */\n\t\tthis.cacheArcLengths = null;\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definition)\n\t * for the given interpolation factor.\n\t *\n\t * @abstract\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPoint( /* t, optionalTarget */ ) {\n\n\t\tconsole.warn( 'THREE.Curve: .getPoint() not implemented.' );\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definition)\n\t * for the given interpolation factor. Unlike {@link Curve#getPoint}, this method honors the length\n\t * of the curve which equidistant samples.\n\t *\n\t * @param {number} u - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPointAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getPoint( t, optionalTarget );\n\n\t}\n\n\t/**\n\t * This method samples the curve via {@link Curve#getPoint} and returns an array of points representing\n\t * the curve shape.\n\t *\n\t * @param {number} [divisions=5] - The number of divisions.\n\t * @return {Array<(Vector2|Vector3)>} An array holding the sampled curve values. The number of points is `divisions + 1`.\n\t */\n\tgetPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPoint( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t// Get sequence of points using getPointAt( u )\n\n\t/**\n\t * This method samples the curve via {@link Curve#getPointAt} and returns an array of points representing\n\t * the curve shape. Unlike {@link Curve#getPoints}, this method returns equi-spaced points across the entire\n\t * curve.\n\t *\n\t * @param {number} [divisions=5] - The number of divisions.\n\t * @return {Array<(Vector2|Vector3)>} An array holding the sampled curve values. The number of points is `divisions + 1`.\n\t */\n\tgetSpacedPoints( divisions = 5 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let d = 0; d <= divisions; d ++ ) {\n\n\t\t\tpoints.push( this.getPointAt( d / divisions ) );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\t/**\n\t * Returns the total arc length of the curve.\n\t *\n\t * @return {number} The length of the curve.\n\t */\n\tgetLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}\n\n\t/**\n\t * Returns an array of cumulative segment lengths of the curve.\n\t *\n\t * @param {number} [divisions=this.arcLengthDivisions] - The number of divisions.\n\t * @return {Array<number>} An array holding the cumulative segment lengths.\n\t */\n\tgetLengths( divisions = this.arcLengthDivisions ) {\n\n\t\tif ( this.cacheArcLengths &&\n\t\t\t( this.cacheArcLengths.length === divisions + 1 ) &&\n\t\t\t! this.needsUpdate ) {\n\n\t\t\treturn this.cacheArcLengths;\n\n\t\t}\n\n\t\tthis.needsUpdate = false;\n\n\t\tconst cache = [];\n\t\tlet current, last = this.getPoint( 0 );\n\t\tlet sum = 0;\n\n\t\tcache.push( 0 );\n\n\t\tfor ( let p = 1; p <= divisions; p ++ ) {\n\n\t\t\tcurrent = this.getPoint( p / divisions );\n\t\t\tsum += current.distanceTo( last );\n\t\t\tcache.push( sum );\n\t\t\tlast = current;\n\n\t\t}\n\n\t\tthis.cacheArcLengths = cache;\n\n\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\n\t}\n\n\t/**\n\t * Update the cumulative segment distance cache. The method must be called\n\t * every time curve parameters are changed. If an updated curve is part of a\n\t * composed curve like {@link CurvePath}, this method must be called on the\n\t * composed curve, too.\n\t */\n\tupdateArcLengths() {\n\n\t\tthis.needsUpdate = true;\n\t\tthis.getLengths();\n\n\t}\n\n\t/**\n\t * Given an interpolation factor in the range `[0,1]`, this method returns an updated\n\t * interpolation factor in the same range that can be ued to sample equidistant points\n\t * from a curve.\n\t *\n\t * @param {number} u - The interpolation factor.\n\t * @param {?number} distance - An optional distance on the curve.\n\t * @return {number} The updated interpolation factor.\n\t */\n\tgetUtoTmapping( u, distance = null ) {\n\n\t\tconst arcLengths = this.getLengths();\n\n\t\tlet i = 0;\n\t\tconst il = arcLengths.length;\n\n\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\tif ( distance ) {\n\n\t\t\ttargetArcLength = distance;\n\n\t\t} else {\n\n\t\t\ttargetArcLength = u * arcLengths[ il - 1 ];\n\n\t\t}\n\n\t\t// binary search for the index with largest value smaller than target u distance\n\n\t\tlet low = 0, high = il - 1, comparison;\n\n\t\twhile ( low <= high ) {\n\n\t\t\ti = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\tcomparison = arcLengths[ i ] - targetArcLength;\n\n\t\t\tif ( comparison < 0 ) {\n\n\t\t\t\tlow = i + 1;\n\n\t\t\t} else if ( comparison > 0 ) {\n\n\t\t\t\thigh = i - 1;\n\n\t\t\t} else {\n\n\t\t\t\thigh = i;\n\t\t\t\tbreak;\n\n\t\t\t\t// DONE\n\n\t\t\t}\n\n\t\t}\n\n\t\ti = high;\n\n\t\tif ( arcLengths[ i ] === targetArcLength ) {\n\n\t\t\treturn i / ( il - 1 );\n\n\t\t}\n\n\t\t// we could get finer grain at lengths, or use simple interpolation between two points\n\n\t\tconst lengthBefore = arcLengths[ i ];\n\t\tconst lengthAfter = arcLengths[ i + 1 ];\n\n\t\tconst segmentLength = lengthAfter - lengthBefore;\n\n\t\t// determine where we are between the 'before' and 'after' points\n\n\t\tconst segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength;\n\n\t\t// add that fractional amount to t\n\n\t\tconst t = ( i + segmentFraction ) / ( il - 1 );\n\n\t\treturn t;\n\n\t}\n\n\t/**\n\t * Returns a unit vector tangent for the given interpolation factor.\n\t * If the derived curve does not implement its tangent derivation,\n\t * two points a small delta apart will be used to find its gradient\n\t * which seems to give a reasonable approximation.\n\t *\n\t * @param {number} t - The interpolation factor.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The tangent vector.\n\t */\n\tgetTangent( t, optionalTarget ) {\n\n\t\tconst delta = 0.0001;\n\t\tlet t1 = t - delta;\n\t\tlet t2 = t + delta;\n\n\t\t// Capping in case of danger\n\n\t\tif ( t1 < 0 ) t1 = 0;\n\t\tif ( t2 > 1 ) t2 = 1;\n\n\t\tconst pt1 = this.getPoint( t1 );\n\t\tconst pt2 = this.getPoint( t2 );\n\n\t\tconst tangent = optionalTarget || ( ( pt1.isVector2 ) ? new Vector2() : new Vector3() );\n\n\t\ttangent.copy( pt2 ).sub( pt1 ).normalize();\n\n\t\treturn tangent;\n\n\t}\n\n\t/**\n\t * Same as {@link Curve#getTangent} but with equidistant samples.\n\t *\n\t * @param {number} u - The interpolation factor.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {(Vector2|Vector3)} The tangent vector.\n\t * @see {@link Curve#getPointAt}\n\t */\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\tconst t = this.getUtoTmapping( u );\n\t\treturn this.getTangent( t, optionalTarget );\n\n\t}\n\n\t/**\n\t * Generates the Frenet Frames. Requires a curve definition in 3D space. Used\n\t * in geometries like {@link TubeGeometry} or {@link ExtrudeGeometry}.\n\t *\n\t * @param {number} segments - The number of segments.\n\t * @param {boolean} [closed=false] - Whether the curve is closed or not.\n\t * @return {{tangents: Array<Vector3>, normals: Array<Vector3>, binormals: Array<Vector3>}} The Frenet Frames.\n\t */\n\tcomputeFrenetFrames( segments, closed = false ) {\n\n\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\n\t\tconst normal = new Vector3();\n\n\t\tconst tangents = [];\n\t\tconst normals = [];\n\t\tconst binormals = [];\n\n\t\tconst vec = new Vector3();\n\t\tconst mat = new Matrix4();\n\n\t\t// compute the tangent vectors for each segment on the curve\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst u = i / segments;\n\n\t\t\ttangents[ i ] = this.getTangentAt( u, new Vector3() );\n\n\t\t}\n\n\t\t// select an initial normal vector perpendicular to the first tangent vector,\n\t\t// and in the direction of the minimum tangent xyz component\n\n\t\tnormals[ 0 ] = new Vector3();\n\t\tbinormals[ 0 ] = new Vector3();\n\t\tlet min = Number.MAX_VALUE;\n\t\tconst tx = Math.abs( tangents[ 0 ].x );\n\t\tconst ty = Math.abs( tangents[ 0 ].y );\n\t\tconst tz = Math.abs( tangents[ 0 ].z );\n\n\t\tif ( tx <= min ) {\n\n\t\t\tmin = tx;\n\t\t\tnormal.set( 1, 0, 0 );\n\n\t\t}\n\n\t\tif ( ty <= min ) {\n\n\t\t\tmin = ty;\n\t\t\tnormal.set( 0, 1, 0 );\n\n\t\t}\n\n\t\tif ( tz <= min ) {\n\n\t\t\tnormal.set( 0, 0, 1 );\n\n\t\t}\n\n\t\tvec.crossVectors( tangents[ 0 ], normal ).normalize();\n\n\t\tnormals[ 0 ].crossVectors( tangents[ 0 ], vec );\n\t\tbinormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );\n\n\n\t\t// compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\tnormals[ i ] = normals[ i - 1 ].clone();\n\n\t\t\tbinormals[ i ] = binormals[ i - 1 ].clone();\n\n\t\t\tvec.crossVectors( tangents[ i - 1 ], tangents[ i ] );\n\n\t\t\tif ( vec.length() > Number.EPSILON ) {\n\n\t\t\t\tvec.normalize();\n\n\t\t\t\tconst theta = Math.acos( clamp( tangents[ i - 1 ].dot( tangents[ i ] ), -1, 1 ) ); // clamp for floating pt errors\n\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( vec, theta ) );\n\n\t\t\t}\n\n\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t}\n\n\t\t// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\t\tif ( closed === true ) {\n\n\t\t\tlet theta = Math.acos( clamp( normals[ 0 ].dot( normals[ segments ] ), -1, 1 ) );\n\t\t\ttheta /= segments;\n\n\t\t\tif ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ segments ] ) ) > 0 ) {\n\n\t\t\t\ttheta = - theta;\n\n\t\t\t}\n\n\t\t\tfor ( let i = 1; i <= segments; i ++ ) {\n\n\t\t\t\t// twist a little...\n\t\t\t\tnormals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );\n\t\t\t\tbinormals[ i ].crossVectors( tangents[ i ], normals[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\ttangents: tangents,\n\t\t\tnormals: normals,\n\t\t\tbinormals: binormals\n\t\t};\n\n\t}\n\n\t/**\n\t * Returns a new curve with copied values from this instance.\n\t *\n\t * @return {Curve} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given curve to this instance.\n\t *\n\t * @param {Curve} source - The curve to copy.\n\t * @return {Curve} A reference to this curve.\n\t */\n\tcopy( source ) {\n\n\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Serializes the curve into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized curve.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst data = {\n\t\t\tmetadata: {\n\t\t\t\tversion: 4.7,\n\t\t\t\ttype: 'Curve',\n\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t}\n\t\t};\n\n\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\tdata.type = this.type;\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Deserializes the curve from the given JSON.\n\t *\n\t * @param {Object} json - The JSON holding the serialized curve.\n\t * @return {Curve} A reference to this curve.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing an ellipse.\n *\n * ```js\n * const curve = new THREE.EllipseCurve(\n * \t0, 0,\n * \t10, 10,\n * \t0, 2 * Math.PI,\n * \tfalse,\n * \t0\n * );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const ellipse = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass EllipseCurve extends Curve {\n\n\t/**\n\t * Constructs a new ellipse curve.\n\t *\n\t * @param {number} [aX=0] - The X center of the ellipse.\n\t * @param {number} [aY=0] - The Y center of the ellipse.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x direction.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y direction.\n\t * @param {number} [aStartAngle=0] - The start angle of the curve in radians starting from the positive X axis.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle of the curve in radians starting from the positive X axis.\n\t * @param {boolean} [aClockwise=false] - Whether the ellipse is drawn clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t */\n\tconstructor( aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isEllipseCurve = true;\n\n\t\tthis.type = 'EllipseCurve';\n\n\t\t/**\n\t\t * The X center of the ellipse.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aX = aX;\n\n\t\t/**\n\t\t * The Y center of the ellipse.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aY = aY;\n\n\t\t/**\n\t\t * The radius of the ellipse in the x direction.\n\t\t * Setting the this value equal to the {@link EllipseCurve#yRadius} will result in a circle.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.xRadius = xRadius;\n\n\t\t/**\n\t\t * The radius of the ellipse in the y direction.\n\t\t * Setting the this value equal to the {@link EllipseCurve#xRadius} will result in a circle.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.yRadius = yRadius;\n\n\t\t/**\n\t\t * The start angle of the curve in radians starting from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aStartAngle = aStartAngle;\n\n\t\t/**\n\t\t * The end angle of the curve in radians starting from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Math.PI*2\n\t\t */\n\t\tthis.aEndAngle = aEndAngle;\n\n\t\t/**\n\t\t * Whether the ellipse is drawn clockwise or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.aClockwise = aClockwise;\n\n\t\t/**\n\t\t * The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.aRotation = aRotation;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst twoPi = Math.PI * 2;\n\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\tconst samePoints = Math.abs( deltaAngle ) < Number.EPSILON;\n\n\t\t// ensures that deltaAngle is 0 .. 2 PI\n\t\twhile ( deltaAngle < 0 ) deltaAngle += twoPi;\n\t\twhile ( deltaAngle > twoPi ) deltaAngle -= twoPi;\n\n\t\tif ( deltaAngle < Number.EPSILON ) {\n\n\t\t\tif ( samePoints ) {\n\n\t\t\t\tdeltaAngle = 0;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.aClockwise === true && ! samePoints ) {\n\n\t\t\tif ( deltaAngle === twoPi ) {\n\n\t\t\t\tdeltaAngle = - twoPi;\n\n\t\t\t} else {\n\n\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\tlet x = this.aX + this.xRadius * Math.cos( angle );\n\t\tlet y = this.aY + this.yRadius * Math.sin( angle );\n\n\t\tif ( this.aRotation !== 0 ) {\n\n\t\t\tconst cos = Math.cos( this.aRotation );\n\t\t\tconst sin = Math.sin( this.aRotation );\n\n\t\t\tconst tx = x - this.aX;\n\t\t\tconst ty = y - this.aY;\n\n\t\t\t// Rotate the point about the center of the ellipse.\n\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\ty = tx * sin + ty * cos + this.aY;\n\n\t\t}\n\n\t\treturn point.set( x, y );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.aX = source.aX;\n\t\tthis.aY = source.aY;\n\n\t\tthis.xRadius = source.xRadius;\n\t\tthis.yRadius = source.yRadius;\n\n\t\tthis.aStartAngle = source.aStartAngle;\n\t\tthis.aEndAngle = source.aEndAngle;\n\n\t\tthis.aClockwise = source.aClockwise;\n\n\t\tthis.aRotation = source.aRotation;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.aX = this.aX;\n\t\tdata.aY = this.aY;\n\n\t\tdata.xRadius = this.xRadius;\n\t\tdata.yRadius = this.yRadius;\n\n\t\tdata.aStartAngle = this.aStartAngle;\n\t\tdata.aEndAngle = this.aEndAngle;\n\n\t\tdata.aClockwise = this.aClockwise;\n\n\t\tdata.aRotation = this.aRotation;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.aX = json.aX;\n\t\tthis.aY = json.aY;\n\n\t\tthis.xRadius = json.xRadius;\n\t\tthis.yRadius = json.yRadius;\n\n\t\tthis.aStartAngle = json.aStartAngle;\n\t\tthis.aEndAngle = json.aEndAngle;\n\n\t\tthis.aClockwise = json.aClockwise;\n\n\t\tthis.aRotation = json.aRotation;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing an arc.\n *\n * @augments EllipseCurve\n */\nclass ArcCurve extends EllipseCurve {\n\n\t/**\n\t * Constructs a new arc curve.\n\t *\n\t * @param {number} [aX=0] - The X center of the ellipse.\n\t * @param {number} [aY=0] - The Y center of the ellipse.\n\t * @param {number} [aRadius=1] - The radius of the ellipse in the x direction.\n\t * @param {number} [aStartAngle=0] - The start angle of the curve in radians starting from the positive X axis.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle of the curve in radians starting from the positive X axis.\n\t * @param {boolean} [aClockwise=false] - Whether the ellipse is drawn clockwise or not.\n\t */\n\tconstructor( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tsuper( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isArcCurve = true;\n\n\t\tthis.type = 'ArcCurve';\n\n\t}\n\n}\n\nfunction CubicPoly() {\n\n\t/**\n\t * Centripetal CatmullRom Curve - which is useful for avoiding\n\t* cusps and self-intersections in non-uniform catmull rom curves.\n\t* http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n\t*\n\t* curve.type accepts centripetal(default), chordal and catmullrom\n\t* curve.tension is used for catmullrom which defaults to 0.5\n\t*/\n\n\t/*\n\tBased on an optimized c++ solution in\n\t- http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t- http://ideone.com/NoEbVM\n\n\tThis CubicPoly class could be used for reusing some variables and calculations,\n\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\twhich can be placed in CurveUtils.\n\t*/\n\n\tlet c0 = 0, c1 = 0, c2 = 0, c3 = 0;\n\n\t/*\n\t * Compute coefficients for a cubic polynomial\n\t *   p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t *   p(0) = x0, p(1) = x1\n\t *  and\n\t *   p'(0) = t0, p'(1) = t1.\n\t */\n\tfunction init( x0, x1, t0, t1 ) {\n\n\t\tc0 = x0;\n\t\tc1 = t0;\n\t\tc2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\n\t}\n\n\treturn {\n\n\t\tinitCatmullRom: function ( x0, x1, x2, x3, tension ) {\n\n\t\t\tinit( x1, x2, tension * ( x2 - x0 ), tension * ( x3 - x1 ) );\n\n\t\t},\n\n\t\tinitNonuniformCatmullRom: function ( x0, x1, x2, x3, dt0, dt1, dt2 ) {\n\n\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\tlet t1 = ( x1 - x0 ) / dt0 - ( x2 - x0 ) / ( dt0 + dt1 ) + ( x2 - x1 ) / dt1;\n\t\t\tlet t2 = ( x2 - x1 ) / dt1 - ( x3 - x1 ) / ( dt1 + dt2 ) + ( x3 - x2 ) / dt2;\n\n\t\t\t// rescale tangents for parametrization in [0,1]\n\t\t\tt1 *= dt1;\n\t\t\tt2 *= dt1;\n\n\t\t\tinit( x1, x2, t1, t2 );\n\n\t\t},\n\n\t\tcalc: function ( t ) {\n\n\t\t\tconst t2 = t * t;\n\t\t\tconst t3 = t2 * t;\n\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\n\t\t}\n\n\t};\n\n}\n\n//\n\nconst tmp = /*@__PURE__*/ new Vector3();\nconst px = /*@__PURE__*/ new CubicPoly();\nconst py = /*@__PURE__*/ new CubicPoly();\nconst pz = /*@__PURE__*/ new CubicPoly();\n\n/**\n * A curve representing a Catmull-Rom spline.\n *\n * ```js\n * //Create a closed wavey loop\n * const curve = new THREE.CatmullRomCurve3( [\n * \tnew THREE.Vector3( -10, 0, 10 ),\n * \tnew THREE.Vector3( -5, 5, 5 ),\n * \tnew THREE.Vector3( 0, 0, 0 ),\n * \tnew THREE.Vector3( 5, -5, 5 ),\n * \tnew THREE.Vector3( 10, 0, 10 )\n * ] );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass CatmullRomCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Catmull-Rom curve.\n\t *\n\t * @param {Array<Vector3>} [points] - An array of 3D points defining the curve.\n\t * @param {boolean} [closed=false] - Whether the curve is closed or not.\n\t * @param {('centripetal'|'chordal'|'catmullrom')} [curveType='centripetal'] - The curve type.\n\t * @param {number} [tension=0.5] - Tension of the curve.\n\t */\n\tconstructor( points = [], closed = false, curveType = 'centripetal', tension = 0.5 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCatmullRomCurve3 = true;\n\n\t\tthis.type = 'CatmullRomCurve3';\n\n\t\t/**\n\t\t * An array of 3D points defining the curve.\n\t\t *\n\t\t * @type {Array<Vector3>}\n\t\t */\n\t\tthis.points = points;\n\n\t\t/**\n\t\t * Whether the curve is closed or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.closed = closed;\n\n\t\t/**\n\t\t * The curve type.\n\t\t *\n\t\t * @type {('centripetal'|'chordal'|'catmullrom')}\n\t\t * @default 'centripetal'\n\t\t */\n\t\tthis.curveType = curveType;\n\n\t\t/**\n\t\t * Tension of the curve.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.5\n\t\t */\n\t\tthis.tension = tension;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst l = points.length;\n\n\t\tconst p = ( l - ( this.closed ? 0 : 1 ) ) * t;\n\t\tlet intPoint = Math.floor( p );\n\t\tlet weight = p - intPoint;\n\n\t\tif ( this.closed ) {\n\n\t\t\tintPoint += intPoint > 0 ? 0 : ( Math.floor( Math.abs( intPoint ) / l ) + 1 ) * l;\n\n\t\t} else if ( weight === 0 && intPoint === l - 1 ) {\n\n\t\t\tintPoint = l - 2;\n\t\t\tweight = 1;\n\n\t\t}\n\n\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\tif ( this.closed || intPoint > 0 ) {\n\n\t\t\tp0 = points[ ( intPoint - 1 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate first point\n\t\t\ttmp.subVectors( points[ 0 ], points[ 1 ] ).add( points[ 0 ] );\n\t\t\tp0 = tmp;\n\n\t\t}\n\n\t\tconst p1 = points[ intPoint % l ];\n\t\tconst p2 = points[ ( intPoint + 1 ) % l ];\n\n\t\tif ( this.closed || intPoint + 2 < l ) {\n\n\t\t\tp3 = points[ ( intPoint + 2 ) % l ];\n\n\t\t} else {\n\n\t\t\t// extrapolate last point\n\t\t\ttmp.subVectors( points[ l - 1 ], points[ l - 2 ] ).add( points[ l - 1 ] );\n\t\t\tp3 = tmp;\n\n\t\t}\n\n\t\tif ( this.curveType === 'centripetal' || this.curveType === 'chordal' ) {\n\n\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\tlet dt0 = Math.pow( p0.distanceToSquared( p1 ), pow );\n\t\t\tlet dt1 = Math.pow( p1.distanceToSquared( p2 ), pow );\n\t\t\tlet dt2 = Math.pow( p2.distanceToSquared( p3 ), pow );\n\n\t\t\t// safety check for repeated points\n\t\t\tif ( dt1 < 1e-4 ) dt1 = 1.0;\n\t\t\tif ( dt0 < 1e-4 ) dt0 = dt1;\n\t\t\tif ( dt2 < 1e-4 ) dt2 = dt1;\n\n\t\t\tpx.initNonuniformCatmullRom( p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2 );\n\t\t\tpy.initNonuniformCatmullRom( p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2 );\n\t\t\tpz.initNonuniformCatmullRom( p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2 );\n\n\t\t} else if ( this.curveType === 'catmullrom' ) {\n\n\t\t\tpx.initCatmullRom( p0.x, p1.x, p2.x, p3.x, this.tension );\n\t\t\tpy.initCatmullRom( p0.y, p1.y, p2.y, p3.y, this.tension );\n\t\t\tpz.initCatmullRom( p0.z, p1.z, p2.z, p3.z, this.tension );\n\n\t\t}\n\n\t\tpoint.set(\n\t\t\tpx.calc( weight ),\n\t\t\tpy.calc( weight ),\n\t\t\tpz.calc( weight )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\tthis.closed = source.closed;\n\t\tthis.curveType = source.curveType;\n\t\tthis.tension = source.tension;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\tdata.closed = this.closed;\n\t\tdata.curveType = this.curveType;\n\t\tdata.tension = this.tension;\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector3().fromArray( point ) );\n\n\t\t}\n\n\t\tthis.closed = json.closed;\n\t\tthis.curveType = json.curveType;\n\t\tthis.tension = json.tension;\n\n\t\treturn this;\n\n\t}\n\n}\n\n// Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve\n\n/**\n * Computes a point on a Catmull-Rom spline.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @param {number} p3 - The fourth control point.\n * @return {number} The calculated point on a Catmull-Rom spline.\n */\nfunction CatmullRom( t, p0, p1, p2, p3 ) {\n\n\tconst v0 = ( p2 - p0 ) * 0.5;\n\tconst v1 = ( p3 - p1 ) * 0.5;\n\tconst t2 = t * t;\n\tconst t3 = t * t2;\n\treturn ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( -3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n}\n\n//\n\nfunction QuadraticBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * p;\n\n}\n\nfunction QuadraticBezierP1( t, p ) {\n\n\treturn 2 * ( 1 - t ) * t * p;\n\n}\n\nfunction QuadraticBezierP2( t, p ) {\n\n\treturn t * t * p;\n\n}\n\n/**\n * Computes a point on a Quadratic Bezier curve.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @return {number} The calculated point on a Quadratic Bezier curve.\n */\nfunction QuadraticBezier( t, p0, p1, p2 ) {\n\n\treturn QuadraticBezierP0( t, p0 ) + QuadraticBezierP1( t, p1 ) +\n\t\tQuadraticBezierP2( t, p2 );\n\n}\n\n//\n\nfunction CubicBezierP0( t, p ) {\n\n\tconst k = 1 - t;\n\treturn k * k * k * p;\n\n}\n\nfunction CubicBezierP1( t, p ) {\n\n\tconst k = 1 - t;\n\treturn 3 * k * k * t * p;\n\n}\n\nfunction CubicBezierP2( t, p ) {\n\n\treturn 3 * ( 1 - t ) * t * t * p;\n\n}\n\nfunction CubicBezierP3( t, p ) {\n\n\treturn t * t * t * p;\n\n}\n\n/**\n * Computes a point on a Cubic Bezier curve.\n *\n * @param {number} t - The interpolation factor.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @param {number} p3 - The fourth control point.\n * @return {number} The calculated point on a Cubic Bezier curve.\n */\nfunction CubicBezier( t, p0, p1, p2, p3 ) {\n\n\treturn CubicBezierP0( t, p0 ) + CubicBezierP1( t, p1 ) + CubicBezierP2( t, p2 ) +\n\t\tCubicBezierP3( t, p3 );\n\n}\n\n/**\n * A curve representing a 2D Cubic Bezier curve.\n *\n * ```js\n * const curve = new THREE.CubicBezierCurve(\n * \tnew THREE.Vector2( - 0, 0 ),\n * \tnew THREE.Vector2( - 5, 15 ),\n * \tnew THREE.Vector2( 20, 15 ),\n * \tnew THREE.Vector2( 10, 0 )\n * );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass CubicBezierCurve extends Curve {\n\n\t/**\n\t * Constructs a new Cubic Bezier curve.\n\t *\n\t * @param {Vector2} [v0] - The start point.\n\t * @param {Vector2} [v1] - The first control point.\n\t * @param {Vector2} [v2] - The second control point.\n\t * @param {Vector2} [v3] - The end point.\n\t */\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubicBezierCurve = true;\n\n\t\tthis.type = 'CubicBezierCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The first control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The second control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v3 = v3;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D Cubic Bezier curve.\n *\n * @augments Curve\n */\nclass CubicBezierCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Cubic Bezier curve.\n\t *\n\t * @param {Vector3} [v0] - The start point.\n\t * @param {Vector3} [v1] - The first control point.\n\t * @param {Vector3} [v2] - The second control point.\n\t * @param {Vector3} [v3] - The end point.\n\t */\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCubicBezierCurve3 = true;\n\n\t\tthis.type = 'CubicBezierCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The first control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The second control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v3 = v3;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2, v3 = this.v3;\n\n\t\tpoint.set(\n\t\t\tCubicBezier( t, v0.x, v1.x, v2.x, v3.x ),\n\t\t\tCubicBezier( t, v0.y, v1.y, v2.y, v3.y ),\n\t\t\tCubicBezier( t, v0.z, v1.z, v2.z, v3.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\t\tthis.v3.copy( source.v3 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\t\tdata.v3 = this.v3.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\t\tthis.v3.fromArray( json.v3 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D line segment.\n *\n * @augments Curve\n */\nclass LineCurve extends Curve {\n\n\t/**\n\t * Constructs a new line curve.\n\t *\n\t * @param {Vector2} [v1] - The start point.\n\t * @param {Vector2} [v2] - The end point.\n\t */\n\tconstructor( v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineCurve = true;\n\n\t\tthis.type = 'LineCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the line.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the line. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the line.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector2() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D line segment.\n *\n * @augments Curve\n */\nclass LineCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new line curve.\n\t *\n\t * @param {Vector3} [v1] - The start point.\n\t * @param {Vector3} [v2] - The end point.\n\t */\n\tconstructor( v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineCurve3 = true;\n\n\t\tthis.type = 'LineCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the line.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the line. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the line.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tif ( t === 1 ) {\n\n\t\t\tpoint.copy( this.v2 );\n\n\t\t} else {\n\n\t\t\tpoint.copy( this.v2 ).sub( this.v1 );\n\t\t\tpoint.multiplyScalar( t ).add( this.v1 );\n\n\t\t}\n\n\t\treturn point;\n\n\t}\n\n\t// Line curve is linear, so we can overwrite default getPointAt\n\tgetPointAt( u, optionalTarget ) {\n\n\t\treturn this.getPoint( u, optionalTarget );\n\n\t}\n\n\tgetTangent( t, optionalTarget = new Vector3() ) {\n\n\t\treturn optionalTarget.subVectors( this.v2, this.v1 ).normalize();\n\n\t}\n\n\tgetTangentAt( u, optionalTarget ) {\n\n\t\treturn this.getTangent( u, optionalTarget );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D Quadratic Bezier curve.\n *\n * ```js\n * const curve = new THREE.QuadraticBezierCurve(\n * \tnew THREE.Vector2( - 10, 0 ),\n * \tnew THREE.Vector2( 20, 15 ),\n * \tnew THREE.Vector2( 10, 0 )\n * )\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const curveObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass QuadraticBezierCurve extends Curve {\n\n\t/**\n\t * Constructs a new Quadratic Bezier curve.\n\t *\n\t * @param {Vector2} [v0] - The start point.\n\t * @param {Vector2} [v1] - The control point.\n\t * @param {Vector2} [v2] - The end point.\n\t */\n\tconstructor( v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuadraticBezierCurve = true;\n\n\t\tthis.type = 'QuadraticBezierCurve';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The control point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 3D Quadratic Bezier curve.\n *\n * @augments Curve\n */\nclass QuadraticBezierCurve3 extends Curve {\n\n\t/**\n\t * Constructs a new Quadratic Bezier curve.\n\t *\n\t * @param {Vector3} [v0] - The start point.\n\t * @param {Vector3} [v1] - The control point.\n\t * @param {Vector3} [v2] - The end point.\n\t */\n\tconstructor( v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isQuadraticBezierCurve3 = true;\n\n\t\tthis.type = 'QuadraticBezierCurve3';\n\n\t\t/**\n\t\t * The start point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v0 = v0;\n\n\t\t/**\n\t\t * The control point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v1 = v1;\n\n\t\t/**\n\t\t * The end point.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.v2 = v2;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector3} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector3} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector3() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst v0 = this.v0, v1 = this.v1, v2 = this.v2;\n\n\t\tpoint.set(\n\t\t\tQuadraticBezier( t, v0.x, v1.x, v2.x ),\n\t\t\tQuadraticBezier( t, v0.y, v1.y, v2.y ),\n\t\t\tQuadraticBezier( t, v0.z, v1.z, v2.z )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.v0.copy( source.v0 );\n\t\tthis.v1.copy( source.v1 );\n\t\tthis.v2.copy( source.v2 );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.v0 = this.v0.toArray();\n\t\tdata.v1 = this.v1.toArray();\n\t\tdata.v2 = this.v2.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.v0.fromArray( json.v0 );\n\t\tthis.v1.fromArray( json.v1 );\n\t\tthis.v2.fromArray( json.v2 );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A curve representing a 2D spline curve.\n *\n * ```js\n * // Create a sine-like wave\n * const curve = new THREE.SplineCurve( [\n * \tnew THREE.Vector2( -10, 0 ),\n * \tnew THREE.Vector2( -5, 5 ),\n * \tnew THREE.Vector2( 0, 0 ),\n * \tnew THREE.Vector2( 5, -5 ),\n * \tnew THREE.Vector2( 10, 0 )\n * ] );\n *\n * const points = curve.getPoints( 50 );\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );\n *\n * // Create the final object to add to the scene\n * const splineObject = new THREE.Line( geometry, material );\n * ```\n *\n * @augments Curve\n */\nclass SplineCurve extends Curve {\n\n\t/**\n\t * Constructs a new 2D spline curve.\n\t *\n\t * @param {Array<Vector2>} [points] -  An array of 2D points defining the curve.\n\t */\n\tconstructor( points = [] ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSplineCurve = true;\n\n\t\tthis.type = 'SplineCurve';\n\n\t\t/**\n\t\t * An array of 2D points defining the curve.\n\t\t *\n\t\t * @type {Array<Vector2>}\n\t\t */\n\t\tthis.points = points;\n\n\t}\n\n\t/**\n\t * Returns a point on the curve.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {Vector2} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {Vector2} The position on the curve.\n\t */\n\tgetPoint( t, optionalTarget = new Vector2() ) {\n\n\t\tconst point = optionalTarget;\n\n\t\tconst points = this.points;\n\t\tconst p = ( points.length - 1 ) * t;\n\n\t\tconst intPoint = Math.floor( p );\n\t\tconst weight = p - intPoint;\n\n\t\tconst p0 = points[ intPoint === 0 ? intPoint : intPoint - 1 ];\n\t\tconst p1 = points[ intPoint ];\n\t\tconst p2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ];\n\t\tconst p3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ];\n\n\t\tpoint.set(\n\t\t\tCatmullRom( weight, p0.x, p1.x, p2.x, p3.x ),\n\t\t\tCatmullRom( weight, p0.y, p1.y, p2.y, p3.y )\n\t\t);\n\n\t\treturn point;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = source.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = source.points[ i ];\n\n\t\t\tthis.points.push( point.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.points = [];\n\n\t\tfor ( let i = 0, l = this.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = this.points[ i ];\n\t\t\tdata.points.push( point.toArray() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.points = [];\n\n\t\tfor ( let i = 0, l = json.points.length; i < l; i ++ ) {\n\n\t\t\tconst point = json.points[ i ];\n\t\t\tthis.points.push( new Vector2().fromArray( point ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nvar Curves = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tArcCurve: ArcCurve,\n\tCatmullRomCurve3: CatmullRomCurve3,\n\tCubicBezierCurve: CubicBezierCurve,\n\tCubicBezierCurve3: CubicBezierCurve3,\n\tEllipseCurve: EllipseCurve,\n\tLineCurve: LineCurve,\n\tLineCurve3: LineCurve3,\n\tQuadraticBezierCurve: QuadraticBezierCurve,\n\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\tSplineCurve: SplineCurve\n});\n\n/**\n * A base class extending {@link Curve}. `CurvePath` is simply an\n * array of connected curves, but retains the API of a curve.\n *\n * @augments Curve\n */\nclass CurvePath extends Curve {\n\n\t/**\n\t * Constructs a new curve path.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'CurvePath';\n\n\t\t/**\n\t\t * An array of curves defining the\n\t\t * path.\n\t\t *\n\t\t * @type {Array<Curve>}\n\t\t */\n\t\tthis.curves = [];\n\n\t\t/**\n\t\t * Whether the path should automatically be closed\n\t\t * by a line curve.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.autoClose = false;\n\n\t}\n\n\t/**\n\t * Adds a curve to this curve path.\n\t *\n\t * @param {Curve} curve - The curve to add.\n\t */\n\tadd( curve ) {\n\n\t\tthis.curves.push( curve );\n\n\t}\n\n\t/**\n\t * Adds a line curve to close the path.\n\t *\n\t * @return {CurvePath} A reference to this curve path.\n\t */\n\tclosePath() {\n\n\t\t// Add a line curve if start and end of lines are not connected\n\t\tconst startPoint = this.curves[ 0 ].getPoint( 0 );\n\t\tconst endPoint = this.curves[ this.curves.length - 1 ].getPoint( 1 );\n\n\t\tif ( ! startPoint.equals( endPoint ) ) {\n\n\t\t\tconst lineType = ( startPoint.isVector2 === true ) ? 'LineCurve' : 'LineCurve3';\n\t\t\tthis.curves.push( new Curves[ lineType ]( endPoint, startPoint ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This method returns a vector in 2D or 3D space (depending on the curve definitions)\n\t * for the given interpolation factor.\n\t *\n\t * @param {number} t - A interpolation factor representing a position on the curve. Must be in the range `[0,1]`.\n\t * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to.\n\t * @return {?(Vector2|Vector3)} The position on the curve. It can be a 2D or 3D vector depending on the curve definition.\n\t */\n\tgetPoint( t, optionalTarget ) {\n\n\t\t// To get accurate point with reference to\n\t\t// entire path distance at time t,\n\t\t// following has to be done:\n\n\t\t// 1. Length of each sub path have to be known\n\t\t// 2. Locate and identify type of curve\n\t\t// 3. Get t for the curve\n\t\t// 4. Return curve.getPointAt(t')\n\n\t\tconst d = t * this.getLength();\n\t\tconst curveLengths = this.getCurveLengths();\n\t\tlet i = 0;\n\n\t\t// To think about boundaries points.\n\n\t\twhile ( i < curveLengths.length ) {\n\n\t\t\tif ( curveLengths[ i ] >= d ) {\n\n\t\t\t\tconst diff = curveLengths[ i ] - d;\n\t\t\t\tconst curve = this.curves[ i ];\n\n\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\n\t\t\t\treturn curve.getPointAt( u, optionalTarget );\n\n\t\t\t}\n\n\t\t\ti ++;\n\n\t\t}\n\n\t\treturn null;\n\n\t\t// loop where sum != 0, sum > d , sum+1 <d\n\n\t}\n\n\tgetLength() {\n\n\t\t// We cannot use the default THREE.Curve getPoint() with getLength() because in\n\t\t// THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath\n\t\t// getPoint() depends on getLength\n\n\t\tconst lens = this.getCurveLengths();\n\t\treturn lens[ lens.length - 1 ];\n\n\t}\n\n\tupdateArcLengths() {\n\n\t\t// cacheLengths must be recalculated.\n\n\t\tthis.needsUpdate = true;\n\t\tthis.cacheLengths = null;\n\t\tthis.getCurveLengths();\n\n\t}\n\n\t/**\n\t * Returns list of cumulative curve lengths of the defined curves.\n\t *\n\t * @return {Array<number>} The curve lengths.\n\t */\n\tgetCurveLengths() {\n\n\t\t// Compute lengths and cache them\n\t\t// We cannot overwrite getLengths() because UtoT mapping uses it.\n\t\t// We use cache values if curves and cache array are same length\n\n\t\tif ( this.cacheLengths && this.cacheLengths.length === this.curves.length ) {\n\n\t\t\treturn this.cacheLengths;\n\n\t\t}\n\n\t\t// Get length of sub-curve\n\t\t// Push sums into cached array\n\n\t\tconst lengths = [];\n\t\tlet sums = 0;\n\n\t\tfor ( let i = 0, l = this.curves.length; i < l; i ++ ) {\n\n\t\t\tsums += this.curves[ i ].getLength();\n\t\t\tlengths.push( sums );\n\n\t\t}\n\n\t\tthis.cacheLengths = lengths;\n\n\t\treturn lengths;\n\n\t}\n\n\tgetSpacedPoints( divisions = 40 ) {\n\n\t\tconst points = [];\n\n\t\tfor ( let i = 0; i <= divisions; i ++ ) {\n\n\t\t\tpoints.push( this.getPoint( i / divisions ) );\n\n\t\t}\n\n\t\tif ( this.autoClose ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tgetPoints( divisions = 12 ) {\n\n\t\tconst points = [];\n\t\tlet last;\n\n\t\tfor ( let i = 0, curves = this.curves; i < curves.length; i ++ ) {\n\n\t\t\tconst curve = curves[ i ];\n\t\t\tconst resolution = curve.isEllipseCurve ? divisions * 2\n\t\t\t\t: ( curve.isLineCurve || curve.isLineCurve3 ) ? 1\n\t\t\t\t\t: curve.isSplineCurve ? divisions * curve.points.length\n\t\t\t\t\t\t: divisions;\n\n\t\t\tconst pts = curve.getPoints( resolution );\n\n\t\t\tfor ( let j = 0; j < pts.length; j ++ ) {\n\n\t\t\t\tconst point = pts[ j ];\n\n\t\t\t\tif ( last && last.equals( point ) ) continue; // ensures no consecutive points are duplicates\n\n\t\t\t\tpoints.push( point );\n\t\t\t\tlast = point;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( this.autoClose && points.length > 1 && ! points[ points.length - 1 ].equals( points[ 0 ] ) ) {\n\n\t\t\tpoints.push( points[ 0 ] );\n\n\t\t}\n\n\t\treturn points;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = source.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = source.curves[ i ];\n\n\t\t\tthis.curves.push( curve.clone() );\n\n\t\t}\n\n\t\tthis.autoClose = source.autoClose;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.autoClose = this.autoClose;\n\t\tdata.curves = [];\n\n\t\tfor ( let i = 0, l = this.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = this.curves[ i ];\n\t\t\tdata.curves.push( curve.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.autoClose = json.autoClose;\n\t\tthis.curves = [];\n\n\t\tfor ( let i = 0, l = json.curves.length; i < l; i ++ ) {\n\n\t\t\tconst curve = json.curves[ i ];\n\t\t\tthis.curves.push( new Curves[ curve.type ]().fromJSON( curve ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A 2D path representation. The class provides methods for creating paths\n * and contours of 2D shapes similar to the 2D Canvas API.\n *\n * ```js\n * const path = new THREE.Path();\n *\n * path.lineTo( 0, 0.8 );\n * path.quadraticCurveTo( 0, 1, 0.2, 1 );\n * path.lineTo( 1, 1 );\n *\n * const points = path.getPoints();\n *\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n * const material = new THREE.LineBasicMaterial( { color: 0xffffff } );\n *\n * const line = new THREE.Line( geometry, material );\n * scene.add( line );\n * ```\n *\n * @augments CurvePath\n */\nclass Path extends CurvePath {\n\n\t/**\n\t * Constructs a new path.\n\t *\n\t * @param {Array<Vector2>} [points] - An array of 2D points defining the path.\n\t */\n\tconstructor( points ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Path';\n\n\t\t/**\n\t\t * The current offset of the path. Any new curve added will start here.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.currentPoint = new Vector2();\n\n\t\tif ( points ) {\n\n\t\t\tthis.setFromPoints( points );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Creates a path from the given list of points. The points are added\n\t * to the path as instances of {@link LineCurve}.\n\t *\n\t * @param {Array<Vector2>} points - An array of 2D points.\n\t * @return {Path} A reference to this path.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.moveTo( points[ 0 ].x, points[ 0 ].y );\n\n\t\tfor ( let i = 1, l = points.length; i < l; i ++ ) {\n\n\t\t\tthis.lineTo( points[ i ].x, points[ i ].y );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Moves {@link Path#currentPoint} to the given point.\n\t *\n\t * @param {number} x - The x coordinate.\n\t * @param {number} y - The y coordinate.\n\t * @return {Path} A reference to this path.\n\t */\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPoint.set( x, y ); // TODO consider referencing vectors instead of copying?\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link LineCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} x - The x coordinate of the end point.\n\t * @param {number} y - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tlineTo( x, y ) {\n\n\t\tconst curve = new LineCurve( this.currentPoint.clone(), new Vector2( x, y ) );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link QuadraticBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCPx - The x coordinate of the control point.\n\t * @param {number} aCPy - The y coordinate of the control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tconst curve = new QuadraticBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCPx, aCPy ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link CubicBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCP1x - The x coordinate of the first control point.\n\t * @param {number} aCP1y - The y coordinate of the first control point.\n\t * @param {number} aCP2x - The x coordinate of the second control point.\n\t * @param {number} aCP2y - The y coordinate of the second control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {Path} A reference to this path.\n\t */\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tconst curve = new CubicBezierCurve(\n\t\t\tthis.currentPoint.clone(),\n\t\t\tnew Vector2( aCP1x, aCP1y ),\n\t\t\tnew Vector2( aCP2x, aCP2y ),\n\t\t\tnew Vector2( aX, aY )\n\t\t);\n\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.set( aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link SplineCurve} to the path by connecting\n\t * the current point with the given list of points.\n\t *\n\t * @param {Array<Vector2>} pts - An array of points in 2D space.\n\t * @return {Path} A reference to this path.\n\t */\n\tsplineThru( pts ) {\n\n\t\tconst npts = [ this.currentPoint.clone() ].concat( pts );\n\n\t\tconst curve = new SplineCurve( npts );\n\t\tthis.curves.push( curve );\n\n\t\tthis.currentPoint.copy( pts[ pts.length - 1 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an arc as an instance of {@link EllipseCurve} to the path, positioned relative\n\t * to the current point.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the arc offsetted from the previous curve.\n\t * @param {number} [aY=0] - The y coordinate of the center of the arc offsetted from the previous curve.\n\t * @param {number} [aRadius=1] - The radius of the arc.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.\n\t * @return {Path} A reference to this path.\n\t */\n\tarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absarc( aX + x0, aY + y0, aRadius,\n\t\t\taStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an absolutely positioned arc as an instance of {@link EllipseCurve} to the path.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the arc.\n\t * @param {number} [aY=0] - The y coordinate of the center of the arc.\n\t * @param {number} [aRadius=1] - The radius of the arc.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the arc clockwise or not.\n\t * @return {Path} A reference to this path.\n\t */\n\tabsarc( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) {\n\n\t\tthis.absellipse( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an ellipse as an instance of {@link EllipseCurve} to the path, positioned relative\n\t * to the current point\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the center of the ellipse offsetted from the previous curve.\n\t * @param {number} [aY=0] - The y coordinate of the center of the ellipse offsetted from the previous curve.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t * @return {Path} A reference to this path.\n\t */\n\tellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst x0 = this.currentPoint.x;\n\t\tconst y0 = this.currentPoint.y;\n\n\t\tthis.absellipse( aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an absolutely positioned ellipse as an instance of {@link EllipseCurve} to the path.\n\t *\n\t * @param {number} [aX=0] - The x coordinate of the absolute center of the ellipse.\n\t * @param {number} [aY=0] - The y coordinate of the absolute center of the ellipse.\n\t * @param {number} [xRadius=1] - The radius of the ellipse in the x axis.\n\t * @param {number} [yRadius=1] - The radius of the ellipse in the y axis.\n\t * @param {number} [aStartAngle=0] - The start angle in radians.\n\t * @param {number} [aEndAngle=Math.PI*2] - The end angle in radians.\n\t * @param {boolean} [aClockwise=false] - Whether to sweep the ellipse clockwise or not.\n\t * @param {number} [aRotation=0] - The rotation angle of the ellipse in radians, counterclockwise from the positive X axis.\n\t * @return {Path} A reference to this path.\n\t */\n\tabsellipse( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) {\n\n\t\tconst curve = new EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation );\n\n\t\tif ( this.curves.length > 0 ) {\n\n\t\t\t// if a previous curve is present, attempt to join\n\t\t\tconst firstPoint = curve.getPoint( 0 );\n\n\t\t\tif ( ! firstPoint.equals( this.currentPoint ) ) {\n\n\t\t\t\tthis.lineTo( firstPoint.x, firstPoint.y );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.curves.push( curve );\n\n\t\tconst lastPoint = curve.getPoint( 1 );\n\t\tthis.currentPoint.copy( lastPoint );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.currentPoint.copy( source.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.currentPoint = this.currentPoint.toArray();\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.currentPoint.fromArray( json.currentPoint );\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Defines an arbitrary 2d shape plane using paths with optional holes. It\n * can be used with {@link ExtrudeGeometry}, {@link ShapeGeometry}, to get\n * points, or to get triangulated faces.\n *\n * ```js\n * const heartShape = new THREE.Shape();\n *\n * heartShape.moveTo( 25, 25 );\n * heartShape.bezierCurveTo( 25, 25, 20, 0, 0, 0 );\n * heartShape.bezierCurveTo( - 30, 0, - 30, 35, - 30, 35 );\n * heartShape.bezierCurveTo( - 30, 55, - 10, 77, 25, 95 );\n * heartShape.bezierCurveTo( 60, 77, 80, 55, 80, 35 );\n * heartShape.bezierCurveTo( 80, 35, 80, 0, 50, 0 );\n * heartShape.bezierCurveTo( 35, 0, 25, 25, 25, 25 );\n *\n * const extrudeSettings = {\n * \tdepth: 8,\n * \tbevelEnabled: true,\n * \tbevelSegments: 2,\n * \tsteps: 2,\n * \tbevelSize: 1,\n * \tbevelThickness: 1\n * };\n *\n * const geometry = new THREE.ExtrudeGeometry( heartShape, extrudeSettings );\n * const mesh = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial() );\n * ```\n *\n * @augments Path\n */\nclass Shape extends Path {\n\n\t/**\n\t * Constructs a new shape.\n\t *\n\t * @param {Array<Vector2>} [points] - An array of 2D points defining the shape.\n\t */\n\tconstructor( points ) {\n\n\t\tsuper( points );\n\n\t\t/**\n\t\t * The UUID of the shape.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\tthis.type = 'Shape';\n\n\t\t/**\n\t\t * Defines the holes in the shape. Hole definitions must use the\n\t\t * opposite winding order (CW/CCW) than the outer shape.\n\t\t *\n\t\t * @type {Array<Path>}\n\t\t * @readonly\n\t\t */\n\t\tthis.holes = [];\n\n\t}\n\n\t/**\n\t * Returns an array representing each contour of the holes\n\t * as a list of 2D points.\n\t *\n\t * @param {number} divisions - The fineness of the result.\n\t * @return {Array<Array<Vector2>>} The holes as a series of 2D points.\n\t */\n\tgetPointsHoles( divisions ) {\n\n\t\tconst holesPts = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tholesPts[ i ] = this.holes[ i ].getPoints( divisions );\n\n\t\t}\n\n\t\treturn holesPts;\n\n\t}\n\n\t// get points of shape and holes (keypoints based on segments parameter)\n\n\t/**\n\t * Returns an object that holds contour data for the shape and its holes as\n\t * arrays of 2D points.\n\t *\n\t * @param {number} divisions - The fineness of the result.\n\t * @return {{shape:Array<Vector2>,holes:Array<Array<Vector2>>}} An object with contour data.\n\t */\n\textractPoints( divisions ) {\n\n\t\treturn {\n\n\t\t\tshape: this.getPoints( divisions ),\n\t\t\tholes: this.getPointsHoles( divisions )\n\n\t\t};\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = source.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = source.holes[ i ];\n\n\t\t\tthis.holes.push( hole.clone() );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.uuid = this.uuid;\n\t\tdata.holes = [];\n\n\t\tfor ( let i = 0, l = this.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = this.holes[ i ];\n\t\t\tdata.holes.push( hole.toJSON() );\n\n\t\t}\n\n\t\treturn data;\n\n\t}\n\n\tfromJSON( json ) {\n\n\t\tsuper.fromJSON( json );\n\n\t\tthis.uuid = json.uuid;\n\t\tthis.holes = [];\n\n\t\tfor ( let i = 0, l = json.holes.length; i < l; i ++ ) {\n\n\t\t\tconst hole = json.holes[ i ];\n\t\t\tthis.holes.push( new Path().fromJSON( hole ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\n/* eslint-disable */\n// copy of mapbox/earcut version 3.0.1\n// https://github.com/mapbox/earcut/tree/v3.0.1\n\nfunction earcut(data, holeIndices, dim = 2) {\n\n    const hasHoles = holeIndices && holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n    let outerNode = linkedList(data, 0, outerLen, dim, true);\n    const triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    let minX, minY, invSize;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length > 80 * dim) {\n        minX = Infinity;\n        minY = Infinity;\n        let maxX = -Infinity;\n        let maxY = -Infinity;\n\n        for (let i = dim; i < outerLen; i += dim) {\n            const x = data[i];\n            const y = data[i + 1];\n            if (x < minX) minX = x;\n            if (y < minY) minY = y;\n            if (x > maxX) maxX = x;\n            if (y > maxY) maxY = y;\n        }\n\n        // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n        invSize = Math.max(maxX - minX, maxY - minY);\n        invSize = invSize !== 0 ? 32767 / invSize : 0;\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    let last;\n\n    if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n        for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    } else {\n        for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    }\n\n    if (last && equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    let p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) break;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n    let stop = ear;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        const prev = ear.prev;\n        const next = ear.next;\n\n        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n            triangles.push(prev.i, ear.i, next.i); // cut off the triangle\n\n            removeNode(ear);\n\n            // skipping the next vertex leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(filterPoints(ear), triangles);\n                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, invSize);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    let p = c.next;\n    while (p !== a) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox\n    const x0 = Math.min(ax, bx, cx),\n        y0 = Math.min(ay, by, cy),\n        x1 = Math.max(ax, bx, cx),\n        y1 = Math.max(ay, by, cy);\n\n    // z-order range for the current triangle bbox;\n    const minZ = zOrder(x0, y0, minX, minY, invSize),\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    let p = ear.prevZ,\n        n = ear.nextZ;\n\n    // look for points inside the triangle in both directions\n    while (p && p.z >= minZ && n && n.z <= maxZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    // look for remaining points in decreasing z-order\n    while (p && p.z >= minZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n\n    // look for remaining points in increasing z-order\n    while (n && n.z <= maxZ) {\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles) {\n    let p = start;\n    do {\n        const a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n            triangles.push(a.i, p.i, b.i);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n    // look for a valid diagonal that divides the polygon into two\n    let a = start;\n    do {\n        let b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                let c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    const queue = [];\n\n    for (let i = 0, len = holeIndices.length; i < len; i++) {\n        const start = holeIndices[i] * dim;\n        const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n        const list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareXYSlope);\n\n    // process holes from left to right\n    for (let i = 0; i < queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n\n    return outerNode;\n}\n\nfunction compareXYSlope(a, b) {\n    let result = a.x - b.x;\n    // when the left-most point of 2 holes meet at a vertex, sort the holes counterclockwise so that when we find\n    // the bridge to the outer shell is always the point that they meet at.\n    if (result === 0) {\n        result = a.y - b.y;\n        if (result === 0) {\n            const aSlope = (a.next.y - a.y) / (a.next.x - a.x);\n            const bSlope = (b.next.y - b.y) / (b.next.x - b.x);\n            result = aSlope - bSlope;\n        }\n    }\n    return result;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n    const bridge = findHoleBridge(hole, outerNode);\n    if (!bridge) {\n        return outerNode;\n    }\n\n    const bridgeReverse = splitPolygon(bridge, hole);\n\n    // filter collinear points around the cuts\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    let p = outerNode;\n    const hx = hole.x;\n    const hy = hole.y;\n    let qx = -Infinity;\n    let m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    // unless they intersect at a vertex, then choose the vertex\n    if (equals(hole, p)) return p;\n    do {\n        if (equals(hole, p.next)) return p.next;\n        else if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n            const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x <= hx && x > qx) {\n                qx = x;\n                m = p.x < p.next.x ? p : p.next;\n                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    const stop = m;\n    const mx = m.x;\n    const my = m.y;\n    let tanMin = Infinity;\n\n    p = m;\n\n    do {\n        if (hx >= p.x && p.x >= mx && hx !== p.x &&\n                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n            const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if (locallyInside(p, hole) &&\n                (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    } while (p !== stop);\n\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n    let p = start;\n    do {\n        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    let numMerges;\n    let inSize = 1;\n\n    do {\n        let p = list;\n        let e;\n        list = null;\n        let tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            let q = p;\n            let pSize = 0;\n            for (let i = 0; i < inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n            let qSize = inSize;\n\n            while (pSize > 0 || (qSize > 0 && q)) {\n\n                if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges > 1);\n\n    return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = (x - minX) * invSize | 0;\n    y = (y - minY) * invSize | 0;\n\n    x = (x | (x << 8)) & 0x00FF00FF;\n    x = (x | (x << 4)) & 0x0F0F0F0F;\n    x = (x | (x << 2)) & 0x33333333;\n    x = (x | (x << 1)) & 0x55555555;\n\n    y = (y | (y << 8)) & 0x00FF00FF;\n    y = (y | (y << 4)) & 0x0F0F0F0F;\n    y = (y | (y << 2)) & 0x33333333;\n    y = (y | (y << 1)) & 0x55555555;\n\n    return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    let p = start,\n        leftmost = start;\n    do {\n        if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n           (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a point lies within a convex triangle but false if its equal to the first point of the triangle\nfunction pointInTriangleExceptFirst(ax, ay, bx, by, cx, cy, px, py) {\n    return !(ax === px && ay === py) && pointInTriangle(ax, ay, bx, by, cx, cy, px, py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n           (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n            equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    const o1 = sign(area(p1, q1, p2));\n    const o2 = sign(area(p1, q1, q2));\n    const o3 = sign(area(p2, q2, p1));\n    const o4 = sign(area(p2, q2, q1));\n\n    if (o1 !== o2 && o3 !== o4) return true; // general case\n\n    if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n    if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n    if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n    if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n    return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n    return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    let p = a;\n    do {\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) < 0 ?\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    let p = a;\n    let inside = false;\n    const px = (a.x + b.x) / 2;\n    const py = (a.y + b.y) / 2;\n    do {\n        if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n                (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    const a2 = createNode(a.i, a.x, a.y),\n        b2 = createNode(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    const p = createNode(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction createNode(i, x, y) {\n    return {\n        i, // vertex index in coordinates array\n        x, y, // vertex coordinates\n        prev: null, // previous and next vertex nodes in a polygon ring\n        next: null,\n        z: 0, // z-order curve value\n        prevZ: null, // previous and next nodes in z-order\n        nextZ: null,\n        steiner: false // indicates whether this is a steiner point\n    };\n}\n\nfunction signedArea(data, start, end, dim) {\n    let sum = 0;\n    for (let i = start, j = end - dim; i < end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\nclass Earcut {\n\n\t/**\n\t * Triangulates the given shape definition by returning an array of triangles.\n\t *\n\t * @param {Array<number>} data - An array with 2D points.\n\t * @param {Array<number>} holeIndices - An array with indices defining holes.\n\t * @param {number} [dim=2] - The number of coordinates per vertex in the input array.\n\t * @return {Array<number>} An array representing the triangulated faces. Each face is defined by three consecutive numbers\n\t * representing vertex indices.\n\t */\n\tstatic triangulate( data, holeIndices, dim = 2 ) {\n\n\t\treturn earcut( data, holeIndices, dim );\n\n\t}\n\n}\n\n/**\n * A class containing utility functions for shapes.\n *\n * @hideconstructor\n */\nclass ShapeUtils {\n\n\t/**\n\t * Calculate area of a ( 2D ) contour polygon.\n\t *\n\t * @param {Array<Vector2>} contour - An array of 2D points.\n\t * @return {number} The area.\n\t */\n\tstatic area( contour ) {\n\n\t\tconst n = contour.length;\n\t\tlet a = 0.0;\n\n\t\tfor ( let p = n - 1, q = 0; q < n; p = q ++ ) {\n\n\t\t\ta += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y;\n\n\t\t}\n\n\t\treturn a * 0.5;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given contour uses a clockwise winding order.\n\t *\n\t * @param {Array<Vector2>} pts - An array of 2D points defining a polygon.\n\t * @return {boolean} Whether the given contour uses a clockwise winding order or not.\n\t */\n\tstatic isClockWise( pts ) {\n\n\t\treturn ShapeUtils.area( pts ) < 0;\n\n\t}\n\n\t/**\n\t * Triangulates the given shape definition.\n\t *\n\t * @param {Array<Vector2>} contour - An array of 2D points defining the contour.\n\t * @param {Array<Array<Vector2>>} holes - An array that holds arrays of 2D points defining the holes.\n\t * @return {Array<Array<number>>} An array that holds for each face definition an array with three indices.\n\t */\n\tstatic triangulateShape( contour, holes ) {\n\n\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\t\tconst holeIndices = []; // array of hole indices\n\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\tremoveDupEndPts( contour );\n\t\taddContour( vertices, contour );\n\n\t\t//\n\n\t\tlet holeIndex = contour.length;\n\n\t\tholes.forEach( removeDupEndPts );\n\n\t\tfor ( let i = 0; i < holes.length; i ++ ) {\n\n\t\t\tholeIndices.push( holeIndex );\n\t\t\tholeIndex += holes[ i ].length;\n\t\t\taddContour( vertices, holes[ i ] );\n\n\t\t}\n\n\t\t//\n\n\t\tconst triangles = Earcut.triangulate( vertices, holeIndices );\n\n\t\t//\n\n\t\tfor ( let i = 0; i < triangles.length; i += 3 ) {\n\n\t\t\tfaces.push( triangles.slice( i, i + 3 ) );\n\n\t\t}\n\n\t\treturn faces;\n\n\t}\n\n}\n\nfunction removeDupEndPts( points ) {\n\n\tconst l = points.length;\n\n\tif ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {\n\n\t\tpoints.pop();\n\n\t}\n\n}\n\nfunction addContour( vertices, contour ) {\n\n\tfor ( let i = 0; i < contour.length; i ++ ) {\n\n\t\tvertices.push( contour[ i ].x );\n\t\tvertices.push( contour[ i ].y );\n\n\t}\n\n}\n\n/**\n * Creates extruded geometry from a path shape.\n *\n * ```js\n * const length = 12, width = 8;\n *\n * const shape = new THREE.Shape();\n * shape.moveTo( 0,0 );\n * shape.lineTo( 0, width );\n * shape.lineTo( length, width );\n * shape.lineTo( length, 0 );\n * shape.lineTo( 0, 0 );\n *\n * const geometry = new THREE.ExtrudeGeometry( shape );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const mesh = new THREE.Mesh( geometry, material ) ;\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n */\nclass ExtrudeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new extrude geometry.\n\t *\n\t * @param {Shape|Array<Shape>} [shapes] - A shape or an array of shapes.\n\t * @param {ExtrudeGeometry~Options} [options] - The extrude settings.\n\t */\n\tconstructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( -0.5, 0.5 ), new Vector2( -0.5, -0.5 ), new Vector2( 0.5, -0.5 ) ] ), options = {} ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ExtrudeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\toptions: options\n\t\t};\n\n\t\tshapes = Array.isArray( shapes ) ? shapes : [ shapes ];\n\n\t\tconst scope = this;\n\n\t\tconst verticesArray = [];\n\t\tconst uvArray = [];\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\t\t\taddShape( shape );\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( verticesArray, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvArray, 2 ) );\n\n\t\tthis.computeVertexNormals();\n\n\t\t// functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst placeholder = [];\n\n\t\t\t// options\n\n\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\tconst depth = options.depth !== undefined ? options.depth : 1;\n\n\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\n\t\t\tconst extrudePath = options.extrudePath;\n\n\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;\n\n\t\t\t//\n\n\t\t\tlet extrudePts, extrudeByPath = false;\n\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\tif ( extrudePath ) {\n\n\t\t\t\textrudePts = extrudePath.getSpacedPoints( steps );\n\n\t\t\t\textrudeByPath = true;\n\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\n\t\t\t\t// SETUP TNB variables\n\n\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\tsplineTube = extrudePath.computeFrenetFrames( steps, false );\n\n\t\t\t\t// console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\tbinormal = new Vector3();\n\t\t\t\tnormal = new Vector3();\n\t\t\t\tposition2 = new Vector3();\n\n\t\t\t}\n\n\t\t\t// Safeguards if bevels are not enabled\n\n\t\t\tif ( ! bevelEnabled ) {\n\n\t\t\t\tbevelSegments = 0;\n\t\t\t\tbevelThickness = 0;\n\t\t\t\tbevelSize = 0;\n\t\t\t\tbevelOffset = 0;\n\n\t\t\t}\n\n\t\t\t// Variables initialization\n\n\t\t\tconst shapePoints = shape.extractPoints( curveSegments );\n\n\t\t\tlet vertices = shapePoints.shape;\n\t\t\tconst holes = shapePoints.holes;\n\n\t\t\tconst reverse = ! ShapeUtils.isClockWise( vertices );\n\n\t\t\tif ( reverse ) {\n\n\t\t\t\tvertices = vertices.reverse();\n\n\t\t\t\t// Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\t\tif ( ShapeUtils.isClockWise( ahole ) ) {\n\n\t\t\t\t\t\tholes[ h ] = ahole.reverse();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/**Merges index-adjacent points that are within a threshold distance of each other. Array is modified in-place. Threshold distance is empirical, and scaled based on the magnitude of point coordinates.\n\t\t\t * @param {Array<Vector2>} points\n\t\t\t*/\n\t\t\tfunction mergeOverlappingPoints( points ) {\n\n\t\t\t\tconst THRESHOLD = 1e-10;\n\t\t\t\tconst THRESHOLD_SQ = THRESHOLD * THRESHOLD;\n\t\t\t\tlet prevPos = points[ 0 ];\n\t\t\t\tfor ( let i = 1; i <= points.length; i ++ ) {\n\n\t\t\t\t\tconst currentIndex = i % points.length;\n\t\t\t\t\tconst currentPos = points[ currentIndex ];\n\t\t\t\t\tconst dx = currentPos.x - prevPos.x;\n\t\t\t\t\tconst dy = currentPos.y - prevPos.y;\n\t\t\t\t\tconst distSq = dx * dx + dy * dy;\n\n\t\t\t\t\tconst scalingFactorSqrt = Math.max(\n\t\t\t\t\t\tMath.abs( currentPos.x ),\n\t\t\t\t\t\tMath.abs( currentPos.y ),\n\t\t\t\t\t\tMath.abs( prevPos.x ),\n\t\t\t\t\t\tMath.abs( prevPos.y )\n\t\t\t\t\t);\n\t\t\t\t\tconst thresholdSqScaled = THRESHOLD_SQ * scalingFactorSqrt * scalingFactorSqrt;\n\t\t\t\t\tif ( distSq <= thresholdSqScaled ) {\n\n\t\t\t\t\t\tpoints.splice( currentIndex, 1 );\n\t\t\t\t\t\ti --;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tprevPos = currentPos;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tmergeOverlappingPoints( vertices );\n\t\t\tholes.forEach( mergeOverlappingPoints );\n\n\t\t\tconst numHoles = holes.length;\n\n\t\t\t/* Vertices */\n\n\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\tfor ( let h = 0; h < numHoles; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\tvertices = vertices.concat( ahole );\n\n\t\t\t}\n\n\n\t\t\tfunction scalePt2( pt, vec, size ) {\n\n\t\t\t\tif ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );\n\n\t\t\t\treturn pt.clone().addScaledVector( vec, size );\n\n\t\t\t}\n\n\t\t\tconst vlen = vertices.length;\n\n\n\t\t\t// Find directions for point movement\n\n\n\t\t\tfunction getBevelVec( inPt, inPrev, inNext ) {\n\n\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t//   shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t//\n\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t//  adjacent edges of inPt at a distance of 1 unit on the left side.\n\n\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\n\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\n\t\t\t\tconst v_prev_lensq = ( v_prev_x * v_prev_x + v_prev_y * v_prev_y );\n\n\t\t\t\t// check for collinear edges\n\t\t\t\tconst collinear0 = ( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\tif ( Math.abs( collinear0 ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not collinear\n\n\t\t\t\t\t// length of vectors for normalizing\n\n\t\t\t\t\tconst v_prev_len = Math.sqrt( v_prev_lensq );\n\t\t\t\t\tconst v_next_len = Math.sqrt( v_next_x * v_next_x + v_next_y * v_next_y );\n\n\t\t\t\t\t// shift adjacent points by unit vectors to the left\n\n\t\t\t\t\tconst ptPrevShift_x = ( inPrev.x - v_prev_y / v_prev_len );\n\t\t\t\t\tconst ptPrevShift_y = ( inPrev.y + v_prev_x / v_prev_len );\n\n\t\t\t\t\tconst ptNextShift_x = ( inNext.x - v_next_y / v_next_len );\n\t\t\t\t\tconst ptNextShift_y = ( inNext.y + v_next_x / v_next_len );\n\n\t\t\t\t\t// scaling factor for v_prev to intersection point\n\n\t\t\t\t\tconst sf = ( ( ptNextShift_x - ptPrevShift_x ) * v_next_y -\n\t\t\t\t\t\t\t( ptNextShift_y - ptPrevShift_y ) * v_next_x ) /\n\t\t\t\t\t\t( v_prev_x * v_next_y - v_prev_y * v_next_x );\n\n\t\t\t\t\t// vector from inPt to intersection point\n\n\t\t\t\t\tv_trans_x = ( ptPrevShift_x + v_prev_x * sf - inPt.x );\n\t\t\t\t\tv_trans_y = ( ptPrevShift_y + v_prev_y * sf - inPt.y );\n\n\t\t\t\t\t// Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t//  but prevent crazy spikes\n\t\t\t\t\tconst v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y );\n\t\t\t\t\tif ( v_trans_lensq <= 2 ) {\n\n\t\t\t\t\t\treturn new Vector2( v_trans_x, v_trans_y );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_trans_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// handle special case of collinear edges\n\n\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\tif ( v_prev_x > Number.EPSILON ) {\n\n\t\t\t\t\t\tif ( v_next_x > Number.EPSILON ) {\n\n\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( v_prev_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\tif ( v_next_x < - Number.EPSILON ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( Math.sign( v_prev_y ) === Math.sign( v_next_y ) ) {\n\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( direction_eq ) {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\tv_trans_x = - v_prev_y;\n\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\tshrink_by = Math.sqrt( v_prev_lensq / 2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn new Vector2( v_trans_x / shrink_by, v_trans_y / shrink_by );\n\n\t\t\t}\n\n\n\t\t\tconst contourMovements = [];\n\n\t\t\tfor ( let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t//  (j)---(i)---(k)\n\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\tcontourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );\n\n\t\t\t}\n\n\t\t\tconst holesMovements = [];\n\t\t\tlet oneHoleMovements, verticesMovements = contourMovements.concat();\n\n\t\t\tfor ( let h = 0, hl = numHoles; h < hl; h ++ ) {\n\n\t\t\t\tconst ahole = holes[ h ];\n\n\t\t\t\toneHoleMovements = [];\n\n\t\t\t\tfor ( let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) {\n\n\t\t\t\t\tif ( j === il ) j = 0;\n\t\t\t\t\tif ( k === il ) k = 0;\n\n\t\t\t\t\t//  (j)---(i)---(k)\n\t\t\t\t\toneHoleMovements[ i ] = getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] );\n\n\t\t\t\t}\n\n\t\t\t\tholesMovements.push( oneHoleMovements );\n\t\t\t\tverticesMovements = verticesMovements.concat( oneHoleMovements );\n\n\t\t\t}\n\n\t\t\tlet faces;\n\n\t\t\tif ( bevelSegments === 0 ) {\n\n\t\t\t\tfaces = ShapeUtils.triangulateShape( contour, holes );\n\n\t\t\t} else {\n\n\t\t\t\tconst contractedContourVertices = [];\n\t\t\t\tconst expandedHoleVertices = [];\n\n\t\t\t\t// Loop bevelSegments, 1 for the front, 1 for the back\n\n\t\t\t\tfor ( let b = 0; b < bevelSegments; b ++ ) {\n\n\t\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t\t// contract shape\n\n\t\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\n\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\t\t\t\t\t\tif ( t === 0 ) contractedContourVertices.push( vert );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// expand holes\n\n\t\t\t\t\tfor ( let h = 0, hl = numHoles; h < hl; h ++ ) {\n\n\t\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\t\t\t\t\t\tconst oneHoleVertices = [];\n\t\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, - z );\n\t\t\t\t\t\t\tif ( t === 0 ) oneHoleVertices.push( vert );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( t === 0 ) expandedHoleVertices.push( oneHoleVertices );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfaces = ShapeUtils.triangulateShape( contractedContourVertices, expandedHoleVertices );\n\n\t\t\t}\n\n\t\t\tconst flen = faces.length;\n\n\t\t\tconst bs = bevelSize + bevelOffset;\n\n\t\t\t// Back facing vertices\n\n\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\tv( vert.x, vert.y, 0 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\n\t\t\t\t\tnormal.copy( splineTube.normals[ 0 ] ).multiplyScalar( vert.x );\n\t\t\t\t\tbinormal.copy( splineTube.binormals[ 0 ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\tposition2.copy( extrudePts[ 0 ] ).add( normal ).add( binormal );\n\n\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Add stepped vertices...\n\t\t\t// Including front facing vertices\n\n\t\t\tfor ( let s = 1; s <= steps; s ++ ) {\n\n\t\t\t\tfor ( let i = 0; i < vlen; i ++ ) {\n\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ];\n\n\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\tv( vert.x, vert.y, depth / steps * s );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\n\t\t\t\t\t\tnormal.copy( splineTube.normals[ s ] ).multiplyScalar( vert.x );\n\t\t\t\t\t\tbinormal.copy( splineTube.binormals[ s ] ).multiplyScalar( vert.y );\n\n\t\t\t\t\t\tposition2.copy( extrudePts[ s ] ).add( normal ).add( binormal );\n\n\t\t\t\t\t\tv( position2.x, position2.y, position2.z );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\t// Add bevel segments planes\n\n\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\t\t\tfor ( let b = bevelSegments - 1; b >= 0; b -- ) {\n\n\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\tconst z = bevelThickness * Math.cos( t * Math.PI / 2 );\n\t\t\t\tconst bs = bevelSize * Math.sin( t * Math.PI / 2 ) + bevelOffset;\n\n\t\t\t\t// contract shape\n\n\t\t\t\tfor ( let i = 0, il = contour.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst vert = scalePt2( contour[ i ], contourMovements[ i ], bs );\n\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t}\n\n\t\t\t\t// expand holes\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\toneHoleMovements = holesMovements[ h ];\n\n\t\t\t\t\tfor ( let i = 0, il = ahole.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs );\n\n\t\t\t\t\t\tif ( ! extrudeByPath ) {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y, depth + z );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tv( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t/* Faces */\n\n\t\t\t// Top and bottom faces\n\n\t\t\tbuildLidFaces();\n\n\t\t\t// Sides faces\n\n\t\t\tbuildSideFaces();\n\n\n\t\t\t/////  Internal functions\n\n\t\t\tfunction buildLidFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\tif ( bevelEnabled ) {\n\n\t\t\t\t\tlet layer = 0; // steps + 1\n\t\t\t\t\tlet offset = vlen * layer;\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ] + offset, face[ 1 ] + offset, face[ 0 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\toffset = vlen * layer;\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Bottom faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 2 ], face[ 1 ], face[ 0 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Top faces\n\n\t\t\t\t\tfor ( let i = 0; i < flen; i ++ ) {\n\n\t\t\t\t\t\tconst face = faces[ i ];\n\t\t\t\t\t\tf3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 0 );\n\n\t\t\t}\n\n\t\t\t// Create faces for the z-sides of the shape\n\n\t\t\tfunction buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}\n\n\t\t\tfunction sidewalls( contour, layeroffset ) {\n\n\t\t\t\tlet i = contour.length;\n\n\t\t\t\twhile ( -- i >= 0 ) {\n\n\t\t\t\t\tconst j = i;\n\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\tif ( k < 0 ) k = contour.length - 1;\n\n\t\t\t\t\t//console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\tfor ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {\n\n\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\tconst slen2 = vlen * ( s + 1 );\n\n\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\n\t\t\t\t\t\tf4( a, b, c, d );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfunction v( x, y, z ) {\n\n\t\t\t\tplaceholder.push( x );\n\t\t\t\tplaceholder.push( y );\n\t\t\t\tplaceholder.push( z );\n\n\t\t\t}\n\n\n\t\t\tfunction f3( a, b, c ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateTopUV( scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\n\t\t\t}\n\n\t\t\tfunction f4( a, b, c, d ) {\n\n\t\t\t\taddVertex( a );\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( d );\n\n\t\t\t\taddVertex( b );\n\t\t\t\taddVertex( c );\n\t\t\t\taddVertex( d );\n\n\n\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\tconst uvs = uvgen.generateSideWallUV( scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1 );\n\n\t\t\t\taddUV( uvs[ 0 ] );\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t\taddUV( uvs[ 1 ] );\n\t\t\t\taddUV( uvs[ 2 ] );\n\t\t\t\taddUV( uvs[ 3 ] );\n\n\t\t\t}\n\n\t\t\tfunction addVertex( index ) {\n\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 0 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 1 ] );\n\t\t\t\tverticesArray.push( placeholder[ index * 3 + 2 ] );\n\n\t\t\t}\n\n\n\t\t\tfunction addUV( vector2 ) {\n\n\t\t\t\tuvArray.push( vector2.x );\n\t\t\t\tuvArray.push( vector2.y );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\t\tconst options = this.parameters.options;\n\n\t\treturn toJSON$1( shapes, options, data );\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @param {Array<Shape>} shapes - An array of shapes.\n\t * @return {ExtrudeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\tconst extrudePath = data.options.extrudePath;\n\n\t\tif ( extrudePath !== undefined ) {\n\n\t\t\tdata.options.extrudePath = new Curves[ extrudePath.type ]().fromJSON( extrudePath );\n\n\t\t}\n\n\t\treturn new ExtrudeGeometry( geometryShapes, data.options );\n\n\t}\n\n}\n\nconst WorldUVGenerator = {\n\n\tgenerateTopUV: function ( geometry, vertices, indexA, indexB, indexC ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\n\t\treturn [\n\t\t\tnew Vector2( a_x, a_y ),\n\t\t\tnew Vector2( b_x, b_y ),\n\t\t\tnew Vector2( c_x, c_y )\n\t\t];\n\n\t},\n\n\tgenerateSideWallUV: function ( geometry, vertices, indexA, indexB, indexC, indexD ) {\n\n\t\tconst a_x = vertices[ indexA * 3 ];\n\t\tconst a_y = vertices[ indexA * 3 + 1 ];\n\t\tconst a_z = vertices[ indexA * 3 + 2 ];\n\t\tconst b_x = vertices[ indexB * 3 ];\n\t\tconst b_y = vertices[ indexB * 3 + 1 ];\n\t\tconst b_z = vertices[ indexB * 3 + 2 ];\n\t\tconst c_x = vertices[ indexC * 3 ];\n\t\tconst c_y = vertices[ indexC * 3 + 1 ];\n\t\tconst c_z = vertices[ indexC * 3 + 2 ];\n\t\tconst d_x = vertices[ indexD * 3 ];\n\t\tconst d_y = vertices[ indexD * 3 + 1 ];\n\t\tconst d_z = vertices[ indexD * 3 + 2 ];\n\n\t\tif ( Math.abs( a_y - b_y ) < Math.abs( a_x - b_x ) ) {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_x, 1 - a_z ),\n\t\t\t\tnew Vector2( b_x, 1 - b_z ),\n\t\t\t\tnew Vector2( c_x, 1 - c_z ),\n\t\t\t\tnew Vector2( d_x, 1 - d_z )\n\t\t\t];\n\n\t\t} else {\n\n\t\t\treturn [\n\t\t\t\tnew Vector2( a_y, 1 - a_z ),\n\t\t\t\tnew Vector2( b_y, 1 - b_z ),\n\t\t\t\tnew Vector2( c_y, 1 - c_z ),\n\t\t\t\tnew Vector2( d_y, 1 - d_z )\n\t\t\t];\n\n\t\t}\n\n\t}\n\n};\n\nfunction toJSON$1( shapes, options, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\tdata.options = Object.assign( {}, options );\n\n\tif ( options.extrudePath !== undefined ) data.options.extrudePath = options.extrudePath.toJSON();\n\n\treturn data;\n\n}\n\n/**\n * A geometry class for representing an icosahedron.\n *\n * ```js\n * const geometry = new THREE.IcosahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const icosahedron = new THREE.Mesh( geometry, material );\n * scene.add( icosahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n */\nclass IcosahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new icosahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the icosahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a icosahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst t = ( 1 + Math.sqrt( 5 ) ) / 2;\n\n\t\tconst vertices = [\n\t\t\t-1, t, 0, \t1, t, 0, \t-1, - t, 0, \t1, - t, 0,\n\t\t\t0, -1, t, \t0, 1, t,\t0, -1, - t, \t0, 1, - t,\n\t\t\tt, 0, -1, \tt, 0, 1, \t- t, 0, -1, \t- t, 0, 1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 11, 5, \t0, 5, 1, \t0, 1, 7, \t0, 7, 10, \t0, 10, 11,\n\t\t\t1, 5, 9, \t5, 11, 4,\t11, 10, 2,\t10, 7, 6,\t7, 1, 8,\n\t\t\t3, 9, 4, \t3, 4, 2,\t3, 2, 6,\t3, 6, 8,\t3, 8, 9,\n\t\t\t4, 9, 5, \t2, 4, 11,\t6, 2, 10,\t8, 6, 7,\t9, 8, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'IcosahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {IcosahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new IcosahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * Creates meshes with axial symmetry like vases. The lathe rotates around the Y axis.\n *\n * ```js\n * const points = [];\n * for ( let i = 0; i < 10; i ++ ) {\n * \tpoints.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );\n * }\n * const geometry = new THREE.LatheGeometry( points );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const lathe = new THREE.Mesh( geometry, material );\n * scene.add( lathe );\n * ```\n *\n * @augments BufferGeometry\n */\nclass LatheGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new lathe geometry.\n\t *\n\t * @param {Array<Vector2|Vector3>} [points] - An array of points in 2D space. The x-coordinate of each point\n\t * must be greater than zero.\n\t * @param {number} [segments=12] - The number of circumference segments to generate.\n\t * @param {number} [phiStart=0] - The starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The radian (0 to 2PI) range of the lathed section 2PI is a\n\t * closed lathe, less than 2PI is a portion.\n\t */\n\tconstructor( points = [ new Vector2( 0, -0.5 ), new Vector2( 0.5, 0 ), new Vector2( 0, 0.5 ) ], segments = 12, phiStart = 0, phiLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'LatheGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tpoints: points,\n\t\t\tsegments: segments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength\n\t\t};\n\n\t\tsegments = Math.floor( segments );\n\n\t\t// clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\tphiLength = clamp( phiLength, 0, Math.PI * 2 );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst uvs = [];\n\t\tconst initNormals = [];\n\t\tconst normals = [];\n\n\t\t// helper variables\n\n\t\tconst inverseSegments = 1.0 / segments;\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tconst normal = new Vector3();\n\t\tconst curNormal = new Vector3();\n\t\tconst prevNormal = new Vector3();\n\t\tlet dx = 0;\n\t\tlet dy = 0;\n\n\t\t// pre-compute normals for initial \"meridian\"\n\n\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\tswitch ( j ) {\n\n\t\t\t\tcase 0:\t\t\t\t// special handling for 1st vertex on path\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tprevNormal.copy( normal );\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ( points.length - 1 ):\t// special handling for last Vertex on path\n\n\t\t\t\t\tinitNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\t\t\t// default handling for all vertices in between\n\n\t\t\t\t\tdx = points[ j + 1 ].x - points[ j ].x;\n\t\t\t\t\tdy = points[ j + 1 ].y - points[ j ].y;\n\n\t\t\t\t\tnormal.x = dy * 1.0;\n\t\t\t\t\tnormal.y = - dx;\n\t\t\t\t\tnormal.z = dy * 0.0;\n\n\t\t\t\t\tcurNormal.copy( normal );\n\n\t\t\t\t\tnormal.x += prevNormal.x;\n\t\t\t\t\tnormal.y += prevNormal.y;\n\t\t\t\t\tnormal.z += prevNormal.z;\n\n\t\t\t\t\tnormal.normalize();\n\n\t\t\t\t\tinitNormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t\tprevNormal.copy( curNormal );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate vertices, uvs and normals\n\n\t\tfor ( let i = 0; i <= segments; i ++ ) {\n\n\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\n\t\t\tconst sin = Math.sin( phi );\n\t\t\tconst cos = Math.cos( phi );\n\n\t\t\tfor ( let j = 0; j <= ( points.length - 1 ); j ++ ) {\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = points[ j ].x * sin;\n\t\t\t\tvertex.y = points[ j ].y;\n\t\t\t\tvertex.z = points[ j ].x * cos;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = i / segments;\n\t\t\t\tuv.y = j / ( points.length - 1 );\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t// normal\n\n\t\t\t\tconst x = initNormals[ 3 * j + 0 ] * sin;\n\t\t\t\tconst y = initNormals[ 3 * j + 1 ];\n\t\t\t\tconst z = initNormals[ 3 * j + 0 ] * cos;\n\n\t\t\t\tnormals.push( x, y, z );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let i = 0; i < segments; i ++ ) {\n\n\t\t\tfor ( let j = 0; j < ( points.length - 1 ); j ++ ) {\n\n\t\t\t\tconst base = j + i * points.length;\n\n\t\t\t\tconst a = base;\n\t\t\t\tconst b = base + points.length;\n\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\tconst d = base + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( c, d, b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {LatheGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new LatheGeometry( data.points, data.segments, data.phiStart, data.phiLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an octahedron.\n *\n * ```js\n * const geometry = new THREE.OctahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const octahedron = new THREE.Mesh( geometry, material );\n * scene.add( octahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n */\nclass OctahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new octahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the octahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a octahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 0, 0, \t-1, 0, 0,\t0, 1, 0,\n\t\t\t0, -1, 0, \t0, 0, 1,\t0, 0, -1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t0, 2, 4,\t0, 4, 3,\t0, 3, 5,\n\t\t\t0, 5, 2,\t1, 2, 5,\t1, 5, 3,\n\t\t\t1, 3, 4,\t1, 4, 2\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'OctahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {OctahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new OctahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing a plane.\n *\n * ```js\n * const geometry = new THREE.PlaneGeometry( 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );\n * const plane = new THREE.Mesh( geometry, material );\n * scene.add( plane );\n * ```\n *\n * @augments BufferGeometry\n */\nclass PlaneGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new plane geometry.\n\t *\n\t * @param {number} [width=1] - The width along the X axis.\n\t * @param {number} [height=1] - The height along the Y axis\n\t * @param {number} [widthSegments=1] - The number of segments along the X axis.\n\t * @param {number} [heightSegments=1] - The number of segments along the Y axis.\n\t */\n\tconstructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'PlaneGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\twidth: width,\n\t\t\theight: height,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments\n\t\t};\n\n\t\tconst width_half = width / 2;\n\t\tconst height_half = height / 2;\n\n\t\tconst gridX = Math.floor( widthSegments );\n\t\tconst gridY = Math.floor( heightSegments );\n\n\t\tconst gridX1 = gridX + 1;\n\t\tconst gridY1 = gridY + 1;\n\n\t\tconst segment_width = width / gridX;\n\t\tconst segment_height = height / gridY;\n\n\t\t//\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\tfor ( let iy = 0; iy < gridY1; iy ++ ) {\n\n\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\tfor ( let ix = 0; ix < gridX1; ix ++ ) {\n\n\t\t\t\tconst x = ix * segment_width - width_half;\n\n\t\t\t\tvertices.push( x, - y, 0 );\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\tuvs.push( ix / gridX );\n\t\t\t\tuvs.push( 1 - ( iy / gridY ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let iy = 0; iy < gridY; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < gridX; ix ++ ) {\n\n\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\tconst b = ix + gridX1 * ( iy + 1 );\n\t\t\t\tconst c = ( ix + 1 ) + gridX1 * ( iy + 1 );\n\t\t\t\tconst d = ( ix + 1 ) + gridX1 * iy;\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {PlaneGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new PlaneGeometry( data.width, data.height, data.widthSegments, data.heightSegments );\n\n\t}\n\n}\n\n/**\n * A class for generating a two-dimensional ring geometry.\n *\n * ```js\n * const geometry = new THREE.RingGeometry( 1, 5, 32 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n */\nclass RingGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new ring geometry.\n\t *\n\t * @param {number} [innerRadius=0.5] - The inner radius of the ring.\n\t * @param {number} [outerRadius=1] - The outer radius of the ring.\n\t * @param {number} [thetaSegments=32] - Number of segments. A higher number means the ring will be more round. Minimum is `3`.\n\t * @param {number} [phiSegments=1] - Number of segments per ring segment. Minimum is `1`.\n\t * @param {number} [thetaStart=0] - Starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI*2] - Central angle in radians.\n\t */\n\tconstructor( innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'RingGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tinnerRadius: innerRadius,\n\t\t\touterRadius: outerRadius,\n\t\t\tthetaSegments: thetaSegments,\n\t\t\tphiSegments: phiSegments,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\tthetaSegments = Math.max( 3, thetaSegments );\n\t\tphiSegments = Math.max( 1, phiSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// some helper variables\n\n\t\tlet radius = innerRadius;\n\t\tconst radiusStep = ( ( outerRadius - innerRadius ) / phiSegments );\n\t\tconst vertex = new Vector3();\n\t\tconst uv = new Vector2();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= phiSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= thetaSegments; i ++ ) {\n\n\t\t\t\t// values are generate from the inside of the ring to the outside\n\n\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = radius * Math.cos( segment );\n\t\t\t\tvertex.y = radius * Math.sin( segment );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormals.push( 0, 0, 1 );\n\n\t\t\t\t// uv\n\n\t\t\t\tuv.x = ( vertex.x / outerRadius + 1 ) / 2;\n\t\t\t\tuv.y = ( vertex.y / outerRadius + 1 ) / 2;\n\n\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t}\n\n\t\t\t// increase the radius for next row of vertices\n\n\t\t\tradius += radiusStep;\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let j = 0; j < phiSegments; j ++ ) {\n\n\t\t\tconst thetaSegmentLevel = j * ( thetaSegments + 1 );\n\n\t\t\tfor ( let i = 0; i < thetaSegments; i ++ ) {\n\n\t\t\t\tconst segment = i + thetaSegmentLevel;\n\n\t\t\t\tconst a = segment;\n\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\tconst d = segment + 1;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {RingGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new RingGeometry( data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * Creates an one-sided polygonal geometry from one or more path shapes.\n *\n * ```js\n * const arcShape = new THREE.Shape()\n *\t.moveTo( 5, 1 )\n *\t.absarc( 1, 1, 4, 0, Math.PI * 2, false );\n *\n * const geometry = new THREE.ShapeGeometry( arcShape );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00, side: THREE.DoubleSide } );\n * const mesh = new THREE.Mesh( geometry, material ) ;\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n */\nclass ShapeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new shape geometry.\n\t *\n\t * @param {Shape|Array<Shape>} [shapes] - A shape or an array of shapes.\n\t * @param {number} [curveSegments=12] - Number of segments per shape.\n\t */\n\tconstructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( -0.5, -0.5 ), new Vector2( 0.5, -0.5 ) ] ), curveSegments = 12 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ShapeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tshapes: shapes,\n\t\t\tcurveSegments: curveSegments\n\t\t};\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tlet groupStart = 0;\n\t\tlet groupCount = 0;\n\n\t\t// allow single and array values for \"shapes\" parameter\n\n\t\tif ( Array.isArray( shapes ) === false ) {\n\n\t\t\taddShape( shapes );\n\n\t\t} else {\n\n\t\t\tfor ( let i = 0; i < shapes.length; i ++ ) {\n\n\t\t\t\taddShape( shapes[ i ] );\n\n\t\t\t\tthis.addGroup( groupStart, groupCount, i ); // enables MultiMaterial support\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t\tgroupCount = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\n\t\t// helper functions\n\n\t\tfunction addShape( shape ) {\n\n\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\tconst points = shape.extractPoints( curveSegments );\n\n\t\t\tlet shapeVertices = points.shape;\n\t\t\tconst shapeHoles = points.holes;\n\n\t\t\t// check direction of vertices\n\n\t\t\tif ( ShapeUtils.isClockWise( shapeVertices ) === false ) {\n\n\t\t\t\tshapeVertices = shapeVertices.reverse();\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\n\t\t\t\tif ( ShapeUtils.isClockWise( shapeHole ) === true ) {\n\n\t\t\t\t\tshapeHoles[ i ] = shapeHole.reverse();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst faces = ShapeUtils.triangulateShape( shapeVertices, shapeHoles );\n\n\t\t\t// join vertices of inner and outer paths to a single array\n\n\t\t\tfor ( let i = 0, l = shapeHoles.length; i < l; i ++ ) {\n\n\t\t\t\tconst shapeHole = shapeHoles[ i ];\n\t\t\t\tshapeVertices = shapeVertices.concat( shapeHole );\n\n\t\t\t}\n\n\t\t\t// vertices, normals, uvs\n\n\t\t\tfor ( let i = 0, l = shapeVertices.length; i < l; i ++ ) {\n\n\t\t\t\tconst vertex = shapeVertices[ i ];\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, 0 );\n\t\t\t\tnormals.push( 0, 0, 1 );\n\t\t\t\tuvs.push( vertex.x, vertex.y ); // world uvs\n\n\t\t\t}\n\n\t\t\t// indices\n\n\t\t\tfor ( let i = 0, l = faces.length; i < l; i ++ ) {\n\n\t\t\t\tconst face = faces[ i ];\n\n\t\t\t\tconst a = face[ 0 ] + indexOffset;\n\t\t\t\tconst b = face[ 1 ] + indexOffset;\n\t\t\t\tconst c = face[ 2 ] + indexOffset;\n\n\t\t\t\tindices.push( a, b, c );\n\t\t\t\tgroupCount += 3;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tconst shapes = this.parameters.shapes;\n\n\t\treturn toJSON( shapes, data );\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @param {Array<Shape>} shapes - An array of shapes.\n\t * @return {ShapeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data, shapes ) {\n\n\t\tconst geometryShapes = [];\n\n\t\tfor ( let j = 0, jl = data.shapes.length; j < jl; j ++ ) {\n\n\t\t\tconst shape = shapes[ data.shapes[ j ] ];\n\n\t\t\tgeometryShapes.push( shape );\n\n\t\t}\n\n\t\treturn new ShapeGeometry( geometryShapes, data.curveSegments );\n\n\t}\n\n}\n\nfunction toJSON( shapes, data ) {\n\n\tdata.shapes = [];\n\n\tif ( Array.isArray( shapes ) ) {\n\n\t\tfor ( let i = 0, l = shapes.length; i < l; i ++ ) {\n\n\t\t\tconst shape = shapes[ i ];\n\n\t\t\tdata.shapes.push( shape.uuid );\n\n\t\t}\n\n\t} else {\n\n\t\tdata.shapes.push( shapes.uuid );\n\n\t}\n\n\treturn data;\n\n}\n\n/**\n * A class for generating a sphere geometry.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry( 15, 32, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const sphere = new THREE.Mesh( geometry, material );\n * scene.add( sphere );\n * ```\n *\n * @augments BufferGeometry\n */\nclass SphereGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new sphere geometry.\n\t *\n\t * @param {number} [radius=1] - The sphere radius.\n\t * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`.\n\t * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`.\n\t * @param {number} [phiStart=0] - The horizontal starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size.\n\t * @param {number} [thetaStart=0] - The vertical starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size.\n\t */\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 && thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments && thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = -0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\t\t\t\tvertex.y = radius * Math.cos( thetaStart + v * thetaLength );\n\t\t\t\tvertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {SphereGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an tetrahedron.\n *\n * ```js\n * const geometry = new THREE.TetrahedronGeometry();\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const tetrahedron = new THREE.Mesh( geometry, material );\n * scene.add( tetrahedron );\n * ```\n *\n * @augments PolyhedronGeometry\n */\nclass TetrahedronGeometry extends PolyhedronGeometry {\n\n\t/**\n\t * Constructs a new tetrahedron geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the tetrahedron.\n\t * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a tetrahedron.\n\t */\n\tconstructor( radius = 1, detail = 0 ) {\n\n\t\tconst vertices = [\n\t\t\t1, 1, 1, \t-1, -1, 1, \t-1, 1, -1, \t1, -1, -1\n\t\t];\n\n\t\tconst indices = [\n\t\t\t2, 1, 0, \t0, 3, 2,\t1, 3, 0,\t2, 3, 1\n\t\t];\n\n\t\tsuper( vertices, indices, radius, detail );\n\n\t\tthis.type = 'TetrahedronGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\tdetail: detail\n\t\t};\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TetrahedronGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TetrahedronGeometry( data.radius, data.detail );\n\n\t}\n\n}\n\n/**\n * A geometry class for representing an torus.\n *\n * ```js\n * const geometry = new THREE.TorusGeometry( 10, 3, 16, 100 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const torus = new THREE.Mesh( geometry, material );\n * scene.add( torus );\n * ```\n *\n * @augments BufferGeometry\n */\nclass TorusGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new torus geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the torus, from the center of the torus to the center of the tube.\n\t * @param {number} [tube=0.4] - Radius of the tube. Must be smaller than `radius`.\n\t * @param {number} [radialSegments=12] - The number of radial segments.\n\t * @param {number} [tubularSegments=48] - The number of tubular segments.\n\t * @param {number} [arc=Math.PI*2] - Central angle in radians.\n\t */\n\tconstructor( radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\tradialSegments: radialSegments,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tarc: arc\n\t\t};\n\n\t\tradialSegments = Math.floor( radialSegments );\n\t\ttubularSegments = Math.floor( tubularSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst center = new Vector3();\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = ( radius + tube * Math.cos( v ) ) * Math.cos( u );\n\t\t\t\tvertex.y = ( radius + tube * Math.cos( v ) ) * Math.sin( u );\n\t\t\t\tvertex.z = tube * Math.sin( v );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tcenter.x = radius * Math.cos( u );\n\t\t\t\tcenter.y = radius * Math.sin( u );\n\t\t\t\tnormal.subVectors( vertex, center ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= radialSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= tubularSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( tubularSegments + 1 ) * j + i - 1;\n\t\t\t\tconst b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1;\n\t\t\t\tconst c = ( tubularSegments + 1 ) * ( j - 1 ) + i;\n\t\t\t\tconst d = ( tubularSegments + 1 ) * j + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TorusGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusGeometry( data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc );\n\n\t}\n\n}\n\n/**\n * Creates a torus knot, the particular shape of which is defined by a pair\n * of coprime integers, p and q. If p and q are not coprime, the result will\n * be a torus link.\n *\n * ```js\n * const geometry = new THREE.TorusKnotGeometry( 10, 3, 100, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const torusKnot = new THREE.Mesh( geometry, material );\n * scene.add( torusKnot );\n * ```\n *\n * @augments BufferGeometry\n */\nclass TorusKnotGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new torus knot geometry.\n\t *\n\t * @param {number} [radius=1] - Radius of the torus knot.\n\t * @param {number} [tube=0.4] - Radius of the tube.\n\t * @param {number} [tubularSegments=64] - The number of tubular segments.\n\t * @param {number} [radialSegments=8] - The number of radial segments.\n\t * @param {number} [p=2] - This value determines, how many times the geometry winds around its axis of rotational symmetry.\n\t * @param {number} [q=3] - This value determines, how many times the geometry winds around a circle in the interior of the torus.\n\t */\n\tconstructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TorusKnotGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\ttube: tube,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradialSegments: radialSegments,\n\t\t\tp: p,\n\t\t\tq: q\n\t\t};\n\n\t\ttubularSegments = Math.floor( tubularSegments );\n\t\tradialSegments = Math.floor( radialSegments );\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\tconst P1 = new Vector3();\n\t\tconst P2 = new Vector3();\n\n\t\tconst B = new Vector3();\n\t\tconst T = new Vector3();\n\t\tconst N = new Vector3();\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let i = 0; i <= tubularSegments; ++ i ) {\n\n\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segment\n\n\t\t\tconst u = i / tubularSegments * p * Math.PI * 2;\n\n\t\t\t// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\tcalculatePositionOnCurve( u, p, q, radius, P1 );\n\t\t\tcalculatePositionOnCurve( u + 0.01, p, q, radius, P2 );\n\n\t\t\t// calculate orthonormal basis\n\n\t\t\tT.subVectors( P2, P1 );\n\t\t\tN.addVectors( P2, P1 );\n\t\t\tB.crossVectors( T, N );\n\t\t\tN.crossVectors( B, T );\n\n\t\t\t// normalize B, N. T can be ignored, we don't use it\n\n\t\t\tB.normalize();\n\t\t\tN.normalize();\n\n\t\t\tfor ( let j = 0; j <= radialSegments; ++ j ) {\n\n\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\tconst cx = - tube * Math.cos( v );\n\t\t\t\tconst cy = tube * Math.sin( v );\n\n\t\t\t\t// now calculate the final vertex position.\n\t\t\t\t// first we orient the extrusion with our basis vectors, then we add it to the current position on the curve\n\n\t\t\t\tvertex.x = P1.x + ( cx * N.x + cy * B.x );\n\t\t\t\tvertex.y = P1.y + ( cx * N.y + cy * B.y );\n\t\t\t\tvertex.z = P1.z + ( cx * N.z + cy * B.z );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\tnormal.subVectors( vertex, P1 ).normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( i / tubularSegments );\n\t\t\t\tuvs.push( j / radialSegments );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// generate indices\n\n\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t// indices\n\n\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t// faces\n\n\t\t\t\tindices.push( a, b, d );\n\t\t\t\tindices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// this function calculates the current position on the torus curve\n\n\t\tfunction calculatePositionOnCurve( u, p, q, radius, position ) {\n\n\t\t\tconst cu = Math.cos( u );\n\t\t\tconst su = Math.sin( u );\n\t\t\tconst quOverP = q / p * u;\n\t\t\tconst cs = Math.cos( quOverP );\n\n\t\t\tposition.x = radius * ( 2 + cs ) * 0.5 * cu;\n\t\t\tposition.y = radius * ( 2 + cs ) * su * 0.5;\n\t\t\tposition.z = radius * Math.sin( quOverP ) * 0.5;\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TorusKnotGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new TorusKnotGeometry( data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q );\n\n\t}\n\n}\n\n/**\n * Creates a tube that extrudes along a 3D curve.\n *\n * ```js\n * class CustomSinCurve extends THREE.Curve {\n *\n * \tgetPoint( t, optionalTarget = new THREE.Vector3() ) {\n *\n * \t\tconst tx = t * 3 - 1.5;\n * \t\tconst ty = Math.sin( 2 * Math.PI * t );\n * \t\tconst tz = 0;\n *\n * \t\treturn optionalTarget.set( tx, ty, tz );\n * \t}\n *\n * }\n *\n * const path = new CustomSinCurve( 10 );\n * const geometry = new THREE.TubeGeometry( path, 20, 2, 8, false );\n * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments BufferGeometry\n */\nclass TubeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new tube geometry.\n\t *\n\t * @param {Curve} [path=QuadraticBezierCurve3] - A 3D curve defining the path of the tube.\n\t * @param {number} [tubularSegments=64] - The number of segments that make up the tube.\n\t * @param {number} [radius=1] -The radius of the tube.\n\t * @param {number} [radialSegments=8] - The number of segments that make up the cross-section.\n\t * @param {boolean} [closed=false] - Whether the tube is closed or not.\n\t */\n\tconstructor( path = new QuadraticBezierCurve3( new Vector3( -1, -1, 0 ), new Vector3( -1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'TubeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tpath: path,\n\t\t\ttubularSegments: tubularSegments,\n\t\t\tradius: radius,\n\t\t\tradialSegments: radialSegments,\n\t\t\tclosed: closed\n\t\t};\n\n\t\tconst frames = path.computeFrenetFrames( tubularSegments, closed );\n\n\t\t// expose internals\n\n\t\tthis.tangents = frames.tangents;\n\t\tthis.normals = frames.normals;\n\t\tthis.binormals = frames.binormals;\n\n\t\t// helper variables\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\t\tconst uv = new Vector2();\n\t\tlet P = new Vector3();\n\n\t\t// buffer\n\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\t\tconst indices = [];\n\n\t\t// create buffer data\n\n\t\tgenerateBufferData();\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t\t// functions\n\n\t\tfunction generateBufferData() {\n\n\t\t\tfor ( let i = 0; i < tubularSegments; i ++ ) {\n\n\t\t\t\tgenerateSegment( i );\n\n\t\t\t}\n\n\t\t\t// if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t// at the regular position on the given path\n\t\t\t//\n\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\t\t\tgenerateSegment( ( closed === false ) ? tubularSegments : 0 );\n\n\t\t\t// uvs are generated in a separate function.\n\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\tgenerateUVs();\n\n\t\t\t// finally create faces\n\n\t\t\tgenerateIndices();\n\n\t\t}\n\n\t\tfunction generateSegment( i ) {\n\n\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\n\t\t\tP = path.getPointAt( i / tubularSegments, P );\n\n\t\t\t// retrieve corresponding normal and binormal\n\n\t\t\tconst N = frames.normals[ i ];\n\t\t\tconst B = frames.binormals[ i ];\n\n\t\t\t// generate normals and vertices for the current segment\n\n\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\n\t\t\t\tconst sin = Math.sin( v );\n\t\t\t\tconst cos = - Math.cos( v );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.x = ( cos * N.x + sin * B.x );\n\t\t\t\tnormal.y = ( cos * N.y + sin * B.y );\n\t\t\t\tnormal.z = ( cos * N.z + sin * B.z );\n\t\t\t\tnormal.normalize();\n\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\tvertex.z = P.z + radius * normal.z;\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateIndices() {\n\n\t\t\tfor ( let j = 1; j <= tubularSegments; j ++ ) {\n\n\t\t\t\tfor ( let i = 1; i <= radialSegments; i ++ ) {\n\n\t\t\t\t\tconst a = ( radialSegments + 1 ) * ( j - 1 ) + ( i - 1 );\n\t\t\t\t\tconst b = ( radialSegments + 1 ) * j + ( i - 1 );\n\t\t\t\t\tconst c = ( radialSegments + 1 ) * j + i;\n\t\t\t\t\tconst d = ( radialSegments + 1 ) * ( j - 1 ) + i;\n\n\t\t\t\t\t// faces\n\n\t\t\t\t\tindices.push( a, b, d );\n\t\t\t\t\tindices.push( b, c, d );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction generateUVs() {\n\n\t\t\tfor ( let i = 0; i <= tubularSegments; i ++ ) {\n\n\t\t\t\tfor ( let j = 0; j <= radialSegments; j ++ ) {\n\n\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\tuv.y = j / radialSegments;\n\n\t\t\t\t\tuvs.push( uv.x, uv.y );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.path = this.parameters.path.toJSON();\n\n\t\treturn data;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {TubeGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\treturn new TubeGeometry(\n\t\t\tnew Curves[ data.path.type ]().fromJSON( data.path ),\n\t\t\tdata.tubularSegments,\n\t\t\tdata.radius,\n\t\t\tdata.radialSegments,\n\t\t\tdata.closed\n\t\t);\n\n\t}\n\n}\n\n/**\n * Can be used as a helper object to visualize a geometry as a wireframe.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry();\n *\n * const wireframe = new THREE.WireframeGeometry( geometry );\n *\n * const line = new THREE.LineSegments( wireframe );\n * line.material.depthWrite = false;\n * line.material.opacity = 0.25;\n * line.material.transparent = true;\n *\n * scene.add( line );\n * ```\n *\n * Note: It is not yet possible to serialize/deserialize instances of this class.\n *\n * @augments BufferGeometry\n */\nclass WireframeGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new wireframe geometry.\n\t *\n\t * @param {?BufferGeometry} [geometry=null] - The geometry.\n\t */\n\tconstructor( geometry = null ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'WireframeGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tgeometry: geometry\n\t\t};\n\n\t\tif ( geometry !== null ) {\n\n\t\t\t// buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst edges = new Set();\n\n\t\t\t// helper variables\n\n\t\t\tconst start = new Vector3();\n\t\t\tconst end = new Vector3();\n\n\t\t\tif ( geometry.index !== null ) {\n\n\t\t\t\t// indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst indices = geometry.index;\n\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\tif ( groups.length === 0 ) {\n\n\t\t\t\t\tgroups = [ { start: 0, count: indices.count, materialIndex: 0 } ];\n\n\t\t\t\t}\n\n\t\t\t\t// create a data structure that contains all edges without duplicates\n\n\t\t\t\tfor ( let o = 0, ol = groups.length; o < ol; ++ o ) {\n\n\t\t\t\t\tconst group = groups[ o ];\n\n\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\tfor ( let i = groupStart, l = ( groupStart + groupCount ); i < l; i += 3 ) {\n\n\t\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t\tconst index1 = indices.getX( i + j );\n\t\t\t\t\t\t\tconst index2 = indices.getX( i + ( j + 1 ) % 3 );\n\n\t\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// non-indexed BufferGeometry\n\n\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\tfor ( let i = 0, l = ( position.count / 3 ); i < l; i ++ ) {\n\n\t\t\t\t\tfor ( let j = 0; j < 3; j ++ ) {\n\n\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\n\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\tconst index2 = 3 * i + ( ( j + 1 ) % 3 );\n\n\t\t\t\t\t\tstart.fromBufferAttribute( position, index1 );\n\t\t\t\t\t\tend.fromBufferAttribute( position, index2 );\n\n\t\t\t\t\t\tif ( isUniqueEdge( start, end, edges ) === true ) {\n\n\t\t\t\t\t\t\tvertices.push( start.x, start.y, start.z );\n\t\t\t\t\t\t\tvertices.push( end.x, end.y, end.z );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// build geometry\n\n\t\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction isUniqueEdge( start, end, edges ) {\n\n\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\tif ( edges.has( hash1 ) === true || edges.has( hash2 ) === true ) {\n\n\t\treturn false;\n\n\t} else {\n\n\t\tedges.add( hash1 );\n\t\tedges.add( hash2 );\n\t\treturn true;\n\n\t}\n\n}\n\nvar Geometries = /*#__PURE__*/Object.freeze({\n\t__proto__: null,\n\tBoxGeometry: BoxGeometry,\n\tCapsuleGeometry: CapsuleGeometry,\n\tCircleGeometry: CircleGeometry,\n\tConeGeometry: ConeGeometry,\n\tCylinderGeometry: CylinderGeometry,\n\tDodecahedronGeometry: DodecahedronGeometry,\n\tEdgesGeometry: EdgesGeometry,\n\tExtrudeGeometry: ExtrudeGeometry,\n\tIcosahedronGeometry: IcosahedronGeometry,\n\tLatheGeometry: LatheGeometry,\n\tOctahedronGeometry: OctahedronGeometry,\n\tPlaneGeometry: PlaneGeometry,\n\tPolyhedronGeometry: PolyhedronGeometry,\n\tRingGeometry: RingGeometry,\n\tShapeGeometry: ShapeGeometry,\n\tSphereGeometry: SphereGeometry,\n\tTetrahedronGeometry: TetrahedronGeometry,\n\tTorusGeometry: TorusGeometry,\n\tTorusKnotGeometry: TorusKnotGeometry,\n\tTubeGeometry: TubeGeometry,\n\tWireframeGeometry: WireframeGeometry\n});\n\n/**\n * This material can receive shadows, but otherwise is completely transparent.\n *\n * ```js\n * const geometry = new THREE.PlaneGeometry( 2000, 2000 );\n * geometry.rotateX( - Math.PI / 2 );\n *\n * const material = new THREE.ShadowMaterial();\n * material.opacity = 0.2;\n *\n * const plane = new THREE.Mesh( geometry, material );\n * plane.position.y = -200;\n * plane.receiveShadow = true;\n * scene.add( plane );\n * ```\n *\n * @augments Material\n */\nclass ShadowMaterial extends Material {\n\n\t/**\n\t * Constructs a new shadow material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isShadowMaterial = true;\n\n\t\tthis.type = 'ShadowMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.color = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Overwritten since shadow materials are transparent\n\t\t * by default.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.transparent = true;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This class works just like {@link ShaderMaterial}, except that definitions\n * of built-in uniforms and attributes are not automatically prepended to the\n * GLSL shader code.\n *\n * `RawShaderMaterial` can only be used with {@link WebGLRenderer}.\n *\n * @augments ShaderMaterial\n */\nclass RawShaderMaterial extends ShaderMaterial {\n\n\t/**\n\t * Constructs a new raw shader material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper( parameters );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRawShaderMaterial = true;\n\n\t\tthis.type = 'RawShaderMaterial';\n\n\t}\n\n}\n\n/**\n * A standard physically based material, using Metallic-Roughness workflow.\n *\n * Physically based rendering (PBR) has recently become the standard in many\n * 3D applications, such as [Unity]{@link https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/},\n * [Unreal]{@link https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/} and\n * [3D Studio Max]{@link http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017}.\n *\n * This approach differs from older approaches in that instead of using\n * approximations for the way in which light interacts with a surface, a\n * physically correct model is used. The idea is that, instead of tweaking\n * materials to look good under specific lighting, a material can be created\n * that will react 'correctly' under all lighting scenarios.\n *\n * In practice this gives a more accurate and realistic looking result than\n * the {@link MeshLambertMaterial} or {@link MeshPhongMaterial}, at the cost of\n * being somewhat more computationally expensive. `MeshStandardMaterial` uses per-fragment\n * shading.\n *\n * Note that for best results you should always specify an environment map when using this material.\n *\n * For a non-technical introduction to the concept of PBR and how to set up a\n * PBR material, check out these articles by the people at [marmoset]{@link https://www.marmoset.co}:\n *\n * - [Basic Theory of Physically Based Rendering]{@link https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/}\n * - [Physically Based Rendering and You Can Too]{@link https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/}\n *\n * Technical details of the approach used in three.js (and most other PBR systems) can be found is this\n * [paper from Disney]{@link https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf}\n * (pdf), by Brent Burley.\n *\n * @augments Material\n */\nclass MeshStandardMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh standard material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshStandardMaterial = true;\n\n\t\tthis.type = 'MeshStandardMaterial';\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * How rough the material appears. `0.0` means a smooth mirror reflection, `1.0`\n\t\t * means fully diffuse. If `roughnessMap` is also provided,\n\t\t * both values are multiplied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.roughness = 1.0;\n\n\t\t/**\n\t\t * How much the material is like a metal. Non-metallic materials such as wood\n\t\t * or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between.\n\t\t * A value between `0.0` and `1.0` could be used for a rusty metal look.\n\t\t * If `metalnessMap` is also provided, both values are multiplied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.metalness = 0.0;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The green channel of this texture is used to alter the roughness of the\n\t\t * material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.roughnessMap = null;\n\n\t\t/**\n\t\t * The blue channel of this texture is used to alter the metalness of the\n\t\t * material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.metalnessMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map. To ensure a physically correct rendering, environment maps\n\t\t * are internally pre-processed with {@link PMREMGenerator}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * Scales the effect of the environment map by multiplying its color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.envMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'STANDARD': '' };\n\n\t\tthis.color.copy( source.color );\n\t\tthis.roughness = source.roughness;\n\t\tthis.metalness = source.metalness;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.roughnessMap = source.roughnessMap;\n\n\t\tthis.metalnessMap = source.metalnessMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.envMapIntensity = source.envMapIntensity;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * An extension of the {@link MeshStandardMaterial}, providing more advanced\n * physically-based rendering properties:\n *\n * - Anisotropy: Ability to represent the anisotropic property of materials\n * as observable with brushed metals.\n * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require\n * a clear, reflective layer on top of another layer that may be irregular or rough.\n * Clearcoat approximates this effect, without the need for a separate transparent surface.\n * - Iridescence: Allows to render the effect where hue varies  depending on the viewing\n * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the\n * wings of many insects.\n * - Physically-based transparency: One limitation of {@link Material#opacity} is that highly\n * transparent materials are less reflective. Physically-based transmission provides a more\n * realistic option for thin, transparent surfaces like glass.\n * - Advanced reflectivity: More flexible reflectivity for non-metallic materials.\n * - Sheen: Can be used for representing cloth and fabric materials.\n *\n * As a result of these complex shading features, `MeshPhysicalMaterial` has a\n * higher performance cost, per pixel, than other three.js materials. Most\n * effects are disabled by default, and add cost as they are enabled. For\n * best results, always specify an environment map when using this material.\n *\n * @augments MeshStandardMaterial\n */\nclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\n\t/**\n\t * Constructs a new mesh physical material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshPhysicalMaterial = true;\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.type = 'MeshPhysicalMaterial';\n\n\t\t/**\n\t\t * The rotation of the anisotropy in tangent, bitangent space, measured in radians\n\t\t * counter-clockwise from the tangent. When `anisotropyMap` is present, this\n\t\t * property provides additional rotation to the vectors in the texture.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.anisotropyRotation = 0;\n\n\t\t/**\n\t\t * Red and green channels represent the anisotropy direction in `[-1, 1]` tangent,\n\t\t * bitangent space, to be rotated by `anisotropyRotation`. The blue channel\n\t\t * contains strength as `[0, 1]` to be multiplied by `anisotropy`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.anisotropyMap = null;\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `clearcoat`,\n\t\t * for per-pixel control over a coating's intensity.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatMap = null;\n\n\t\t/**\n\t\t * Roughness of the clear coat layer, from `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.clearcoatRoughness = 0.0;\n\n\t\t/**\n\t\t * The green channel of this texture is multiplied against\n\t\t * `clearcoatRoughness`, for per-pixel control over a coating's roughness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatRoughnessMap = null;\n\n\t\t/**\n\t\t * How much `clearcoatNormalMap` affects the clear coat layer, from\n\t\t * `(0,0)` to `(1,1)`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.clearcoatNormalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * Can be used to enable independent normals for the clear coat layer.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.clearcoatNormalMap = null;\n\n\t\t/**\n\t\t * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1.5\n\t\t */\n\t\tthis.ior = 1.5;\n\n\t\t/**\n\t\t * Degree of reflectivity, from `0.0` to `1.0`. Default is `0.5`, which\n\t\t * corresponds to an index-of-refraction of `1.5`.\n\t\t *\n\t\t * This models the reflectivity of non-metallic materials. It has no effect\n\t\t * when `metalness` is `1.0`\n\t\t *\n\t\t * @name MeshPhysicalMaterial#reflectivity\n\t\t * @type {number}\n\t\t * @default 0.5\n\t\t */\n\t\tObject.defineProperty( this, 'reflectivity', {\n\t\t\tget: function () {\n\n\t\t\t\treturn ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );\n\n\t\t\t},\n\t\t\tset: function ( reflectivity ) {\n\n\t\t\t\tthis.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );\n\n\t\t\t}\n\t\t} );\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `iridescence`, for per-pixel\n\t\t * control over iridescence.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.iridescenceMap = null;\n\n\t\t/**\n\t\t * Strength of the iridescence RGB color shift effect, represented by an index-of-refraction.\n\t\t * Between `1.0` to `2.333`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1.3\n\t\t */\n\t\tthis.iridescenceIOR = 1.3;\n\n\t\t/**\n\t\t *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.\n\t\t Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`.\n\t\t *\n\t\t * @type {Array<number,number>}\n\t\t * @default [100,400]\n\t\t */\n\t\tthis.iridescenceThicknessRange = [ 100, 400 ];\n\n\t\t/**\n\t\t * A texture that defines the thickness of the iridescence layer, stored in the green channel.\n\t\t * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array:\n\t\t * - `0.0` in the green channel will result in thickness equal to first element of the array.\n\t\t * - `1.0` in the green channel will result in thickness equal to second element of the array.\n\t\t * - Values in-between will linearly interpolate between the elements of the array.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.iridescenceThicknessMap = null;\n\n\t\t/**\n\t\t * The sheen tint.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.sheenColor = new Color( 0x000000 );\n\n\t\t/**\n\t\t * The RGB channels of this texture are multiplied against  `sheenColor`, for per-pixel control\n\t\t * over sheen tint.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.sheenColorMap = null;\n\n\t\t/**\n\t\t * Roughness of the sheen layer, from `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.sheenRoughness = 1.0;\n\n\t\t/**\n\t\t * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control\n\t\t * over sheen roughness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.sheenRoughnessMap = null;\n\n\t\t/**\n\t\t * The red channel of this texture is multiplied against `transmission`, for per-pixel control over\n\t\t * optical transparency.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.transmissionMap = null;\n\n\t\t/**\n\t\t * The thickness of the volume beneath the surface. The value is given in the\n\t\t * coordinate space of the mesh. If the value is `0` the material is\n\t\t * thin-walled. Otherwise the material is a volume boundary.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.thickness = 0;\n\n\t\t/**\n\t\t * A texture that defines the thickness, stored in the green channel. This will\n\t\t * be multiplied by `thickness`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.thicknessMap = null;\n\n\t\t/**\n\t\t * Density of the medium given as the average distance that light travels in\n\t\t * the medium before interacting with a particle. The value is given in world\n\t\t * space units, and must be greater than zero.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.attenuationDistance = Infinity;\n\n\t\t/**\n\t\t * The color that white light turns into due to absorption when reaching the\n\t\t * attenuation distance.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.attenuationColor = new Color( 1, 1, 1 );\n\n\t\t/**\n\t\t * A float that scales the amount of specular reflection for non-metals only.\n\t\t * When set to zero, the model is effectively Lambertian. From `0.0` to `1.0`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.specularIntensity = 1.0;\n\n\t\t/**\n\t\t * The alpha channel of this texture is multiplied against `specularIntensity`,\n\t\t * for per-pixel control over specular intensity.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularIntensityMap = null;\n\n\t\t/**\n\t\t * Tints the specular reflection at normal incidence for non-metals only.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.specularColor = new Color( 1, 1, 1 );\n\n\t\t/**\n\t\t * The RGB channels of this texture are multiplied against `specularColor`,\n\t\t * for per-pixel control over specular color.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularColorMap = null;\n\n\t\tthis._anisotropy = 0;\n\t\tthis._clearcoat = 0;\n\t\tthis._dispersion = 0;\n\t\tthis._iridescence = 0;\n\t\tthis._sheen = 0.0;\n\t\tthis._transmission = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\t/**\n\t * The anisotropy strength.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget anisotropy() {\n\n\t\treturn this._anisotropy;\n\n\t}\n\n\tset anisotropy( value ) {\n\n\t\tif ( this._anisotropy > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._anisotropy = value;\n\n\t}\n\n\t/**\n\t * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use\n\t * clear coat related properties to enable multilayer materials that have a\n\t * thin translucent layer over the base layer.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget clearcoat() {\n\n\t\treturn this._clearcoat;\n\n\t}\n\n\tset clearcoat( value ) {\n\n\t\tif ( this._clearcoat > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._clearcoat = value;\n\n\t}\n\t/**\n\t * The intensity of the iridescence layer, simulating RGB color shift based on the angle between\n\t * the surface and the viewer, from `0.0` to `1.0`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget iridescence() {\n\n\t\treturn this._iridescence;\n\n\t}\n\n\tset iridescence( value ) {\n\n\t\tif ( this._iridescence > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._iridescence = value;\n\n\t}\n\n\t/**\n\t * Defines the strength of the angular separation of colors (chromatic aberration) transmitting\n\t * through a relatively clear volume. Any value zero or larger is valid, the typical range of\n\t * realistic values is `[0, 1]`. This property can be only be used with transmissive objects.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget dispersion() {\n\n\t\treturn this._dispersion;\n\n\t}\n\n\tset dispersion( value ) {\n\n\t\tif ( this._dispersion > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._dispersion = value;\n\n\t}\n\n\t/**\n\t * The intensity of the sheen layer, from `0.0` to `1.0`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget sheen() {\n\n\t\treturn this._sheen;\n\n\t}\n\n\tset sheen( value ) {\n\n\t\tif ( this._sheen > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._sheen = value;\n\n\t}\n\n\t/**\n\t * Degree of transmission (or optical transparency), from `0.0` to `1.0`.\n\t *\n\t * Thin, transparent or semitransparent, plastic or glass materials remain\n\t * largely reflective even if they are fully transmissive. The transmission\n\t * property can be used to model these materials.\n\t *\n\t * When transmission is non-zero, `opacity` should be  set to `1`.\n\t *\n\t * @type {number}\n\t * @default 0\n\t */\n\tget transmission() {\n\n\t\treturn this._transmission;\n\n\t}\n\n\tset transmission( value ) {\n\n\t\tif ( this._transmission > 0 !== value > 0 ) {\n\n\t\t\tthis.version ++;\n\n\t\t}\n\n\t\tthis._transmission = value;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = {\n\n\t\t\t'STANDARD': '',\n\t\t\t'PHYSICAL': ''\n\n\t\t};\n\n\t\tthis.anisotropy = source.anisotropy;\n\t\tthis.anisotropyRotation = source.anisotropyRotation;\n\t\tthis.anisotropyMap = source.anisotropyMap;\n\n\t\tthis.clearcoat = source.clearcoat;\n\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\tthis.clearcoatNormalScale.copy( source.clearcoatNormalScale );\n\n\t\tthis.dispersion = source.dispersion;\n\t\tthis.ior = source.ior;\n\n\t\tthis.iridescence = source.iridescence;\n\t\tthis.iridescenceMap = source.iridescenceMap;\n\t\tthis.iridescenceIOR = source.iridescenceIOR;\n\t\tthis.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];\n\t\tthis.iridescenceThicknessMap = source.iridescenceThicknessMap;\n\n\t\tthis.sheen = source.sheen;\n\t\tthis.sheenColor.copy( source.sheenColor );\n\t\tthis.sheenColorMap = source.sheenColorMap;\n\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\tthis.sheenRoughnessMap = source.sheenRoughnessMap;\n\n\t\tthis.transmission = source.transmission;\n\t\tthis.transmissionMap = source.transmissionMap;\n\n\t\tthis.thickness = source.thickness;\n\t\tthis.thicknessMap = source.thicknessMap;\n\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\tthis.attenuationColor.copy( source.attenuationColor );\n\n\t\tthis.specularIntensity = source.specularIntensity;\n\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\tthis.specularColor.copy( source.specularColor );\n\t\tthis.specularColorMap = source.specularColorMap;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for shiny surfaces with specular highlights.\n *\n * The material uses a non-physically based [Blinn-Phong]{@link https://en.wikipedia.org/wiki/Blinn-Phong_shading_model}\n * model for calculating reflectance. Unlike the Lambertian model used in the\n * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular\n * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading.\n *\n * Performance will generally be greater when using this material over the\n * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of\n * some graphical accuracy.\n *\n * @augments Material\n */\nclass MeshPhongMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh phong material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshPhongMaterial = true;\n\n\t\tthis.type = 'MeshPhongMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * Specular color of the material. The default color is set to `0x111111` (very dark grey)\n\t\t *\n\t\t * This defines how shiny the material is and the color of its shine.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.specular = new Color( 0x111111 );\n\n\t\t/**\n\t\t * How shiny the specular highlight is; a higher value gives a sharper highlight.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 30\n\t\t */\n\t\tthis.shininess = 30;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The specular map value affects both how much the specular surface\n\t\t * highlight contributes and how much of the environment map affects the\n\t\t * surface.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.specular.copy( source.specular );\n\t\tthis.shininess = source.shininess;\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material implementing toon shading.\n *\n * @augments Material\n */\nclass MeshToonMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh toon material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshToonMaterial = true;\n\n\t\tthis.defines = { 'TOON': '' };\n\n\t\tthis.type = 'MeshToonMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * Gradient map for toon shading. It's required to set\n\t\t * {@link Texture#minFilter} and {@link Texture#magFilter} to {@linkNearestFilter}\n\t\t * when using this type of texture.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.gradientMap = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\t\tthis.gradientMap = source.gradientMap;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material that maps the normal vectors to RGB colors.\n *\n * @augments Material\n */\nclass MeshNormalMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh normal material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshNormalMaterial = true;\n\n\t\tthis.type = 'MeshNormalMaterial';\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for non-shiny surfaces, without specular highlights.\n *\n * The material uses a non-physically based [Lambertian]{@link https://en.wikipedia.org/wiki/Lambertian_reflectance}\n * model for calculating reflectance. This can simulate some surfaces (such\n * as untreated wood or stone) well, but cannot simulate shiny surfaces with\n * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment\n * shading.\n *\n * Due to the simplicity of the reflectance and illumination models,\n * performance will be greater when using this material over the\n * {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or\n * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy.\n *\n * @augments Material\n */\nclass MeshLambertMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh lambert material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshLambertMaterial = true;\n\n\t\tthis.type = 'MeshLambertMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Emissive (light) color of the material, essentially a solid color\n\t\t * unaffected by other lighting.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.emissive = new Color( 0x000000 );\n\n\t\t/**\n\t\t * Intensity of the emissive light. Modulates the emissive color.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.emissiveIntensity = 1.0;\n\n\t\t/**\n\t\t * Set emissive (glow) map. The emissive map color is modulated by the\n\t\t * emissive color and the emissive intensity. If you have an emissive map,\n\t\t * be sure to set the emissive color to something other than black.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.emissiveMap = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.emissive.copy( source.emissive );\n\t\tthis.emissiveMap = source.emissiveMap;\n\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for drawing geometry by depth. Depth is based off of the camera\n * near and far plane. White is nearest, black is farthest.\n *\n * @augments Material\n */\nclass MeshDepthMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh depth material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshDepthMaterial = true;\n\n\t\tthis.type = 'MeshDepthMaterial';\n\n\t\t/**\n\t\t * Type for depth packing.\n\t\t *\n\t\t * @type {(BasicDepthPacking|RGBADepthPacking|RGBDepthPacking|RGDepthPacking)}\n\t\t * @default BasicDepthPacking\n\t\t */\n\t\tthis.depthPacking = BasicDepthPacking;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * WebGL and WebGPU ignore this property and always render\n\t\t * 1 pixel wide lines.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.depthPacking = source.depthPacking;\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material used internally for implementing shadow mapping with\n * point lights.\n *\n * Can also be used to customize the shadow casting of an object by assigning\n * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}.\n * The following examples demonstrates this approach in order to ensure\n * transparent parts of objects do no cast shadows.\n *\n * @augments Material\n */\nclass MeshDistanceMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh distance material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshDistanceMaterial = true;\n\n\t\tthis.type = 'MeshDistanceMaterial';\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.map = source.map;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This material is defined by a MatCap (or Lit Sphere) texture, which encodes the\n * material color and shading.\n *\n * `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes\n * baked lighting. It will cast a shadow onto an object that receives shadows\n * (and shadow clipping works), but it will not self-shadow or receive\n * shadows.\n *\n * @augments Material\n */\nclass MeshMatcapMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh matcap material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshMatcapMaterial = true;\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.type = 'MeshMatcapMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The matcap map.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.matcap = null;\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The texture to create a bump map. The black and white values map to the\n\t\t * perceived depth in relation to the lights. Bump doesn't actually affect\n\t\t * the geometry of the object, only the lighting. If a normal map is defined\n\t\t * this will be ignored.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.bumpMap = null;\n\n\t\t/**\n\t\t * How much the bump map affects the material. Typical range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.bumpScale = 1;\n\n\t\t/**\n\t\t * The texture to create a normal map. The RGB values affect the surface\n\t\t * normal for each pixel fragment and change the way the color is lit. Normal\n\t\t * maps do not change the actual shape of the surface, only the lighting. In\n\t\t * case the material has a normal map authored using the left handed\n\t\t * convention, the `y` component of `normalScale` should be negated to compensate\n\t\t * for the different handedness.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.normalMap = null;\n\n\t\t/**\n\t\t * The type of normal map.\n\t\t *\n\t\t * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)}\n\t\t * @default TangentSpaceNormalMap\n\t\t */\n\t\tthis.normalMapType = TangentSpaceNormalMap;\n\n\t\t/**\n\t\t * How much the normal map affects the material. Typical value range is `[0,1]`.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (1,1)\n\t\t */\n\t\tthis.normalScale = new Vector2( 1, 1 );\n\n\t\t/**\n\t\t * The displacement map affects the position of the mesh's vertices. Unlike\n\t\t * other maps which only affect the light and shade of the material the\n\t\t * displaced vertices can cast shadows, block other objects, and otherwise\n\t\t * act as real geometry. The displacement texture is an image where the value\n\t\t * of each pixel (white being the highest) is mapped against, and\n\t\t * repositions, the vertices of the mesh.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.displacementMap = null;\n\n\t\t/**\n\t\t * How much the displacement map affects the mesh (where black is no\n\t\t * displacement, and white is maximum displacement). Without a displacement\n\t\t * map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementScale = 1;\n\n\t\t/**\n\t\t * The offset of the displacement map's values on the mesh's vertices.\n\t\t * The bias is added to the scaled sample of the displacement map.\n\t\t * Without a displacement map set, this value is not applied.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.displacementBias = 0;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * Whether the material is rendered with flat shading or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.flatShading = false;\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.defines = { 'MATCAP': '' };\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.matcap = source.matcap;\n\n\t\tthis.map = source.map;\n\n\t\tthis.bumpMap = source.bumpMap;\n\t\tthis.bumpScale = source.bumpScale;\n\n\t\tthis.normalMap = source.normalMap;\n\t\tthis.normalMapType = source.normalMapType;\n\t\tthis.normalScale.copy( source.normalScale );\n\n\t\tthis.displacementMap = source.displacementMap;\n\t\tthis.displacementScale = source.displacementScale;\n\t\tthis.displacementBias = source.displacementBias;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.flatShading = source.flatShading;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * A material for rendering line primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const material = new THREE.LineDashedMaterial( {\n * \tcolor: 0xffffff,\n * \tscale: 1,\n * \tdashSize: 3,\n * \tgapSize: 1,\n * } );\n * ```\n *\n * @augments LineBasicMaterial\n */\nclass LineDashedMaterial extends LineBasicMaterial {\n\n\t/**\n\t * Constructs a new line dashed material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineDashedMaterial = true;\n\t\tthis.type = 'LineDashedMaterial';\n\n\t\t/**\n\t\t * The scale of the dashed part of a line.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.scale = 1;\n\n\t\t/**\n\t\t * The size of the dash. This is both the gap with the stroke.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 3\n\t\t */\n\t\tthis.dashSize = 3;\n\n\t\t/**\n\t\t * The size of the gap.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.gapSize = 1;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.scale = source.scale;\n\t\tthis.dashSize = source.dashSize;\n\t\tthis.gapSize = source.gapSize;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Converts an array to a specific type.\n *\n * @param {TypedArray|Array} array - The array to convert.\n * @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type.\n * @return {TypedArray} The converted array.\n */\nfunction convertArray( array, type ) {\n\n\tif ( ! array || array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototype.slice.call( array ); // create Array\n\n}\n\n/**\n * Returns `true` if the given object is a typed array.\n *\n * @param {any} object - The object to check.\n * @return {boolean} Whether the given object is a typed array.\n */\nfunction isTypedArray( object ) {\n\n\treturn ArrayBuffer.isView( object ) && ! ( object instanceof DataView );\n\n}\n\n/**\n * Returns an array by which times and values can be sorted.\n *\n * @param {Array<number>} times - The keyframe time values.\n * @return {Array<number>} The array.\n */\nfunction getKeyframeOrder( times ) {\n\n\tfunction compareTime( i, j ) {\n\n\t\treturn times[ i ] - times[ j ];\n\n\t}\n\n\tconst n = times.length;\n\tconst result = new Array( n );\n\tfor ( let i = 0; i !== n; ++ i ) result[ i ] = i;\n\n\tresult.sort( compareTime );\n\n\treturn result;\n\n}\n\n/**\n * Sorts the given array by the previously computed order via `getKeyframeOrder()`.\n *\n * @param {Array<number>} values - The values to sort.\n * @param {number} stride - The stride.\n * @param {Array<number>} order - The sort order.\n * @return {Array<number>} The sorted values.\n */\nfunction sortedArray( values, stride, order ) {\n\n\tconst nValues = values.length;\n\tconst result = new values.constructor( nValues );\n\n\tfor ( let i = 0, dstOffset = 0; dstOffset !== nValues; ++ i ) {\n\n\t\tconst srcOffset = order[ i ] * stride;\n\n\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\tresult[ dstOffset ++ ] = values[ srcOffset + j ];\n\n\t\t}\n\n\t}\n\n\treturn result;\n\n}\n\n/**\n * Used for parsing AOS keyframe formats.\n *\n * @param {Array<number>} jsonKeys - A list of JSON keyframes.\n * @param {Array<number>} times - This array will be filled with keyframe times by this function.\n * @param {Array<number>} values - This array will be filled with keyframe values by this function.\n * @param {string} valuePropertyName - The name of the property to use.\n */\nfunction flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\tlet i = 1, key = jsonKeys[ 0 ];\n\n\twhile ( key !== undefined && key[ valuePropertyName ] === undefined ) {\n\n\t\tkey = jsonKeys[ i ++ ];\n\n\t}\n\n\tif ( key === undefined ) return; // no data\n\n\tlet value = key[ valuePropertyName ];\n\tif ( value === undefined ) return; // no data\n\n\tif ( Array.isArray( value ) ) {\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( ...value ); // push all elements\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else if ( value.toArray !== undefined ) {\n\n\t\t// ...assume THREE.Math-ish\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalue.toArray( values, values.length );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t} else {\n\n\t\t// otherwise push as-is\n\n\t\tdo {\n\n\t\t\tvalue = key[ valuePropertyName ];\n\n\t\t\tif ( value !== undefined ) {\n\n\t\t\t\ttimes.push( key.time );\n\t\t\t\tvalues.push( value );\n\n\t\t\t}\n\n\t\t\tkey = jsonKeys[ i ++ ];\n\n\t\t} while ( key !== undefined );\n\n\t}\n\n}\n\n/**\n * Creates a new clip, containing only the segment of the original clip between the given frames.\n *\n * @param {AnimationClip} sourceClip - The values to sort.\n * @param {string} name - The name of the clip.\n * @param {number} startFrame - The start frame.\n * @param {number} endFrame - The end frame.\n * @param {number} [fps=30] - The FPS.\n * @return {AnimationClip} The new sub clip.\n */\nfunction subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\tconst clip = sourceClip.clone();\n\n\tclip.name = name;\n\n\tconst tracks = [];\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tconst track = clip.tracks[ i ];\n\t\tconst valueSize = track.getValueSize();\n\n\t\tconst times = [];\n\t\tconst values = [];\n\n\t\tfor ( let j = 0; j < track.times.length; ++ j ) {\n\n\t\t\tconst frame = track.times[ j ] * fps;\n\n\t\t\tif ( frame < startFrame || frame >= endFrame ) continue;\n\n\t\t\ttimes.push( track.times[ j ] );\n\n\t\t\tfor ( let k = 0; k < valueSize; ++ k ) {\n\n\t\t\t\tvalues.push( track.values[ j * valueSize + k ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( times.length === 0 ) continue;\n\n\t\ttrack.times = convertArray( times, track.times.constructor );\n\t\ttrack.values = convertArray( values, track.values.constructor );\n\n\t\ttracks.push( track );\n\n\t}\n\n\tclip.tracks = tracks;\n\n\t// find minimum .times value across all tracks in the trimmed clip\n\n\tlet minStartTime = Infinity;\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tif ( minStartTime > clip.tracks[ i ].times[ 0 ] ) {\n\n\t\t\tminStartTime = clip.tracks[ i ].times[ 0 ];\n\n\t\t}\n\n\t}\n\n\t// shift all tracks such that clip begins at t=0\n\n\tfor ( let i = 0; i < clip.tracks.length; ++ i ) {\n\n\t\tclip.tracks[ i ].shift( -1 * minStartTime );\n\n\t}\n\n\tclip.resetDuration();\n\n\treturn clip;\n\n}\n\n/**\n * Converts the keyframes of the given animation clip to an additive format.\n *\n * @param {AnimationClip} targetClip - The clip to make additive.\n * @param {number} [referenceFrame=0] - The reference frame.\n * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.\n * @param {number} [fps=30] - The FPS.\n * @return {AnimationClip} The updated clip which is now additive.\n */\nfunction makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\tif ( fps <= 0 ) fps = 30;\n\n\tconst numTracks = referenceClip.tracks.length;\n\tconst referenceTime = referenceFrame / fps;\n\n\t// Make each track's values relative to the values at the reference frame\n\tfor ( let i = 0; i < numTracks; ++ i ) {\n\n\t\tconst referenceTrack = referenceClip.tracks[ i ];\n\t\tconst referenceTrackType = referenceTrack.ValueTypeName;\n\n\t\t// Skip this track if it's non-numeric\n\t\tif ( referenceTrackType === 'bool' || referenceTrackType === 'string' ) continue;\n\n\t\t// Find the track in the target clip whose name and type matches the reference track\n\t\tconst targetTrack = targetClip.tracks.find( function ( track ) {\n\n\t\t\treturn track.name === referenceTrack.name\n\t\t\t\t&& track.ValueTypeName === referenceTrackType;\n\n\t\t} );\n\n\t\tif ( targetTrack === undefined ) continue;\n\n\t\tlet referenceOffset = 0;\n\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\tif ( referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\treferenceOffset = referenceValueSize / 3;\n\n\t\t}\n\n\t\tlet targetOffset = 0;\n\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\tif ( targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline ) {\n\n\t\t\ttargetOffset = targetValueSize / 3;\n\n\t\t}\n\n\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\tlet referenceValue;\n\n\t\t// Find the value to subtract out of the track\n\t\tif ( referenceTime <= referenceTrack.times[ 0 ] ) {\n\n\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else if ( referenceTime >= referenceTrack.times[ lastIndex ] ) {\n\n\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\treferenceValue = referenceTrack.values.slice( startIndex, endIndex );\n\n\t\t} else {\n\n\t\t\t// Interpolate to the reference value\n\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\tconst startIndex = referenceOffset;\n\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\tinterpolant.evaluate( referenceTime );\n\t\t\treferenceValue = interpolant.resultBuffer.slice( startIndex, endIndex );\n\n\t\t}\n\n\t\t// Conjugate the quaternion\n\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\tconst referenceQuat = new Quaternion().fromArray( referenceValue ).normalize().conjugate();\n\t\t\treferenceQuat.toArray( referenceValue );\n\n\t\t}\n\n\t\t// Subtract the reference value from all of the track values\n\n\t\tconst numTimes = targetTrack.times.length;\n\t\tfor ( let j = 0; j < numTimes; ++ j ) {\n\n\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\tif ( referenceTrackType === 'quaternion' ) {\n\n\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\tQuaternion.multiplyQuaternionsFlat(\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart,\n\t\t\t\t\treferenceValue,\n\t\t\t\t\t0,\n\t\t\t\t\ttargetTrack.values,\n\t\t\t\t\tvalueStart\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2;\n\n\t\t\t\t// Subtract each value for all other numeric track types\n\t\t\t\tfor ( let k = 0; k < valueEnd; ++ k ) {\n\n\t\t\t\t\ttargetTrack.values[ valueStart + k ] -= referenceValue[ k ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\n\treturn targetClip;\n\n}\n\n/**\n * A class with various methods to assist with animations.\n *\n * @hideconstructor\n */\nclass AnimationUtils {\n\n\t/**\n\t * Converts an array to a specific type\n\t *\n\t * @static\n\t * @param {TypedArray|Array} array - The array to convert.\n\t * @param {TypedArray.constructor} type - The constructor of a type array.\n\t * @return {TypedArray} The converted array\n\t */\n\tstatic convertArray( array, type ) {\n\n\t\treturn convertArray( array, type );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given object is a typed array.\n\t *\n\t * @static\n\t * @param {any} object - The object to check.\n\t * @return {boolean} Whether the given object is a typed array.\n\t */\n\tstatic isTypedArray( object ) {\n\n\t\treturn isTypedArray( object );\n\n\t}\n\n\t/**\n\t * Returns an array by which times and values can be sorted.\n\t *\n\t * @static\n\t * @param {Array<number>} times - The keyframe time values.\n\t * @return {Array<number>} The array.\n\t */\n\tstatic getKeyframeOrder( times ) {\n\n\t\treturn getKeyframeOrder( times );\n\n\t}\n\n\t/**\n\t * Sorts the given array by the previously computed order via `getKeyframeOrder()`.\n\t *\n\t * @static\n\t * @param {Array<number>} values - The values to sort.\n\t * @param {number} stride - The stride.\n\t * @param {Array<number>} order - The sort order.\n\t * @return {Array<number>} The sorted values.\n\t */\n\tstatic sortedArray( values, stride, order ) {\n\n\t\treturn sortedArray( values, stride, order );\n\n\t}\n\n\t/**\n\t * Used for parsing AOS keyframe formats.\n\t *\n\t * @static\n\t * @param {Array<number>} jsonKeys - A list of JSON keyframes.\n\t * @param {Array<number>} times - This array will be filled with keyframe times by this method.\n\t * @param {Array<number>} values - This array will be filled with keyframe values by this method.\n\t * @param {string} valuePropertyName - The name of the property to use.\n\t */\n\tstatic flattenJSON( jsonKeys, times, values, valuePropertyName ) {\n\n\t\tflattenJSON( jsonKeys, times, values, valuePropertyName );\n\n\t}\n\n\t/**\n\t * Creates a new clip, containing only the segment of the original clip between the given frames.\n\t *\n\t * @static\n\t * @param {AnimationClip} sourceClip - The values to sort.\n\t * @param {string} name - The name of the clip.\n\t * @param {number} startFrame - The start frame.\n\t * @param {number} endFrame - The end frame.\n\t * @param {number} [fps=30] - The FPS.\n\t * @return {AnimationClip} The new sub clip.\n\t */\n\tstatic subclip( sourceClip, name, startFrame, endFrame, fps = 30 ) {\n\n\t\treturn subclip( sourceClip, name, startFrame, endFrame, fps );\n\n\t}\n\n\t/**\n\t * Converts the keyframes of the given animation clip to an additive format.\n\t *\n\t * @static\n\t * @param {AnimationClip} targetClip - The clip to make additive.\n\t * @param {number} [referenceFrame=0] - The reference frame.\n\t * @param {AnimationClip} [referenceClip=targetClip] - The reference clip.\n\t * @param {number} [fps=30] - The FPS.\n\t * @return {AnimationClip} The updated clip which is now additive.\n\t */\n\tstatic makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {\n\n\t\treturn makeClipAdditive( targetClip, referenceFrame, referenceClip, fps );\n\n\t}\n\n}\n\n/**\n * Abstract base class of interpolants over parametric samples.\n *\n * The parameter domain is one dimensional, typically the time or a path\n * along a curve defined by the data.\n *\n * The sample values can have any dimensionality and derived classes may\n * apply special interpretations to the data.\n *\n * This class provides the interval seek in a Template Method, deferring\n * the actual interpolation to derived classes.\n *\n * Time complexity is O(1) for linear access crossing at most two points\n * and O(log N) for random access, where N is the number of positions.\n *\n * References: {@link http://www.oodesign.com/template-method-pattern.html}\n *\n * @abstract\n */\nclass Interpolant {\n\n\t/**\n\t * Constructs a new interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\t/**\n\t\t * The parameter positions.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.parameterPositions = parameterPositions;\n\n\t\t/**\n\t\t * A cache index.\n\t\t *\n\t\t * @private\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis._cachedIndex = 0;\n\n\t\t/**\n\t\t * The result buffer.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor( sampleSize );\n\n\t\t/**\n\t\t * The sample values.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.sampleValues = sampleValues;\n\n\t\t/**\n\t\t * The value size.\n\t\t *\n\t\t * @type {TypedArray}\n\t\t */\n\t\tthis.valueSize = sampleSize;\n\n\t\t/**\n\t\t * The interpolation settings.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.settings = null;\n\n\t\t/**\n\t\t * The default settings object.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.DefaultSettings_ = {};\n\n\t}\n\n\t/**\n\t * Evaluate the interpolant at position `t`.\n\t *\n\t * @param {number} t - The interpolation factor.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tevaluate( t ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet i1 = this._cachedIndex,\n\t\t\tt1 = pp[ i1 ],\n\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\tvalidate_interval: {\n\n\t\t\tseek: {\n\n\t\t\t\tlet right;\n\n\t\t\t\tlinear_scan: {\n\n\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\n\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\tforward_scan: if ( ! ( t < t1 ) ) {\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 + 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\t\t\t\tif ( t < t0 ) break forward_scan;\n\n\t\t\t\t\t\t\t\t// after end\n\n\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\tt1 = pp[ ++ i1 ];\n\n\t\t\t\t\t\t\tif ( t < t1 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the right side of the index\n\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//- slower code:\n\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\t\t\t\t\tif ( ! ( t >= t0 ) ) {\n\n\t\t\t\t\t\t// looping?\n\n\t\t\t\t\t\tconst t1global = pp[ 1 ];\n\n\t\t\t\t\t\tif ( t < t1global ) {\n\n\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\t\t\t\t\t\t\tt0 = t1global;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// linear reverse scan\n\n\t\t\t\t\t\tfor ( let giveUpAt = i1 - 2; ; ) {\n\n\t\t\t\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\t\t\t\t// before start\n\n\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( i1 === giveUpAt ) break; // this loop\n\n\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\tt0 = pp[ -- i1 - 1 ];\n\n\t\t\t\t\t\t\tif ( t >= t0 ) {\n\n\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\tbreak seek;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// prepare binary search on the left side of the index\n\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\tbreak linear_scan;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the interval is valid\n\n\t\t\t\t\tbreak validate_interval;\n\n\t\t\t\t} // linear scan\n\n\t\t\t\t// binary search\n\n\t\t\t\twhile ( i1 < right ) {\n\n\t\t\t\t\tconst mid = ( i1 + right ) >>> 1;\n\n\t\t\t\t\tif ( t < pp[ mid ] ) {\n\n\t\t\t\t\t\tright = mid;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ti1 = mid + 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tt1 = pp[ i1 ];\n\t\t\t\tt0 = pp[ i1 - 1 ];\n\n\t\t\t\t// check boundary cases, again\n\n\t\t\t\tif ( t0 === undefined ) {\n\n\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\treturn this.copySampleValue_( 0 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( t1 === undefined ) {\n\n\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t\t\t\t}\n\n\t\t\t} // seek\n\n\t\t\tthis._cachedIndex = i1;\n\n\t\t\tthis.intervalChanged_( i1, t0, t1 );\n\n\t\t} // validate_interval\n\n\t\treturn this.interpolate_( i1, t0, t, t1 );\n\n\t}\n\n\t/**\n\t * Returns the interpolation settings.\n\t *\n\t * @return {Object} The interpolation settings.\n\t */\n\tgetSettings_() {\n\n\t\treturn this.settings || this.DefaultSettings_;\n\n\t}\n\n\t/**\n\t * Copies a sample value to the result buffer.\n\t *\n\t * @param {number} index - An index into the sample value buffer.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tcopySampleValue_( index ) {\n\n\t\t// copies a sample value to the result buffer\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = index * stride;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\t/**\n\t * Copies a sample value to the result buffer.\n\t *\n\t * @abstract\n\t * @param {number} i1 - An index into the sample value buffer.\n\t * @param {number} t0 - The previous interpolation factor.\n\t * @param {number} t - The current interpolation factor.\n\t * @param {number} t1 - The next interpolation factor.\n\t * @return {TypedArray} The result buffer.\n\t */\n\tinterpolate_( /* i1, t0, t, t1 */ ) {\n\n\t\tthrow new Error( 'call to abstract method' );\n\t\t// implementations shall return this.resultBuffer\n\n\t}\n\n\t/**\n\t * Optional method that is executed when the interval has changed.\n\t *\n\t * @param {number} i1 - An index into the sample value buffer.\n\t * @param {number} t0 - The previous interpolation factor.\n\t * @param {number} t - The current interpolation factor.\n\t */\n\tintervalChanged_( /* i1, t0, t1 */ ) {\n\n\t\t// empty\n\n\t}\n\n}\n\n/**\n * Fast and simple cubic spline interpolant.\n *\n * It was derived from a Hermitian construction setting the first derivative\n * at each sample position to the linear slope between neighboring positions\n * over their parameter interval.\n *\n * @augments Interpolant\n */\nclass CubicInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new cubic interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\tthis._weightPrev = -0;\n\t\tthis._offsetPrev = -0;\n\t\tthis._weightNext = -0;\n\t\tthis._offsetNext = -0;\n\n\t\tthis.DefaultSettings_ = {\n\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\n\t\t};\n\n\t}\n\n\tintervalChanged_( i1, t0, t1 ) {\n\n\t\tconst pp = this.parameterPositions;\n\t\tlet iPrev = i1 - 2,\n\t\t\tiNext = i1 + 1,\n\n\t\t\ttPrev = pp[ iPrev ],\n\t\t\ttNext = pp[ iNext ];\n\n\t\tif ( tPrev === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingStart ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = 2 * t0 - t1;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\ttPrev = t0 + pp[ iPrev ] - pp[ iPrev + 1 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\tiPrev = i1;\n\t\t\t\t\ttPrev = t1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tNext === undefined ) {\n\n\t\t\tswitch ( this.getSettings_().endingEnd ) {\n\n\t\t\t\tcase ZeroSlopeEnding:\n\n\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\tiNext = i1;\n\t\t\t\t\ttNext = 2 * t1 - t0;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase WrapAroundEnding:\n\n\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\tiNext = 1;\n\t\t\t\t\ttNext = t1 + pp[ 1 ] - pp[ 0 ];\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // ZeroCurvatureEnding\n\n\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\ttNext = t0;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst halfDt = ( t1 - t0 ) * 0.5,\n\t\t\tstride = this.valueSize;\n\n\t\tthis._weightPrev = halfDt / ( t0 - tPrev );\n\t\tthis._weightNext = halfDt / ( tNext - t1 );\n\t\tthis._offsetPrev = iPrev * stride;\n\t\tthis._offsetNext = iNext * stride;\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\to1 = i1 * stride,\t\to0 = o1 - stride,\n\t\t\toP = this._offsetPrev, \toN = this._offsetNext,\n\t\t\twP = this._weightPrev,\twN = this._weightNext,\n\n\t\t\tp = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tpp = p * p,\n\t\t\tppp = pp * p;\n\n\t\t// evaluate polynomials\n\n\t\tconst sP = - wP * ppp + 2 * wP * pp - wP * p;\n\t\tconst s0 = ( 1 + wP ) * ppp + ( -1.5 - 2 * wP ) * pp + ( -0.5 + wP ) * p + 1;\n\t\tconst s1 = ( -1 - wN ) * ppp + ( 1.5 + wN ) * pp + 0.5 * p;\n\t\tconst sN = wN * ppp - wN * pp;\n\n\t\t// combine data linearly\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tsP * values[ oP + i ] +\n\t\t\t\t\ts0 * values[ o0 + i ] +\n\t\t\t\t\ts1 * values[ o1 + i ] +\n\t\t\t\t\tsN * values[ oN + i ];\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A basic linear interpolant.\n *\n * @augments Interpolant\n */\nclass LinearInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new linear interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\toffset1 = i1 * stride,\n\t\t\toffset0 = offset1 - stride,\n\n\t\t\tweight1 = ( t - t0 ) / ( t1 - t0 ),\n\t\t\tweight0 = 1 - weight1;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tresult[ i ] =\n\t\t\t\t\tvalues[ offset0 + i ] * weight0 +\n\t\t\t\t\tvalues[ offset1 + i ] * weight1;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * Interpolant that evaluates to the sample value at the position preceding\n * the parameter.\n *\n * @augments Interpolant\n */\nclass DiscreteInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new discrete interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1 /*, t0, t, t1 */ ) {\n\n\t\treturn this.copySampleValue_( i1 - 1 );\n\n\t}\n\n}\n\n/**\n * Represents s a timed sequence of keyframes, which are composed of lists of\n * times and related values, and which are used to animate a specific property\n * of an object.\n */\nclass KeyframeTrack {\n\n\t/**\n\t * Constructs a new keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<number|string|boolean>} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tif ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );\n\t\tif ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );\n\n\t\t/**\n\t\t * The track's name can refer to morph targets or bones or\n\t\t * possibly other values within an animated object. See {@link PropertyBinding#parseTrackName}\n\t\t * for the forms of strings that can be parsed for property binding.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * The keyframe times.\n\t\t *\n\t\t * @type {Float32Array}\n\t\t */\n\t\tthis.times = convertArray( times, this.TimeBufferType );\n\n\t\t/**\n\t\t * The keyframe values.\n\t\t *\n\t\t * @type {Float32Array}\n\t\t */\n\t\tthis.values = convertArray( values, this.ValueBufferType );\n\n\t\tthis.setInterpolation( interpolation || this.DefaultInterpolation );\n\n\t}\n\n\t/**\n\t * Converts the keyframe track to JSON.\n\t *\n\t * @static\n\t * @param {KeyframeTrack} track - The keyframe track to serialize.\n\t * @return {Object} The serialized keyframe track as JSON.\n\t */\n\tstatic toJSON( track ) {\n\n\t\tconst trackType = track.constructor;\n\n\t\tlet json;\n\n\t\t// derived classes can define a static toJSON method\n\t\tif ( trackType.toJSON !== this.toJSON ) {\n\n\t\t\tjson = trackType.toJSON( track );\n\n\t\t} else {\n\n\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\tjson = {\n\n\t\t\t\t'name': track.name,\n\t\t\t\t'times': convertArray( track.times, Array ),\n\t\t\t\t'values': convertArray( track.values, Array )\n\n\t\t\t};\n\n\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\tif ( interpolation !== track.DefaultInterpolation ) {\n\n\t\t\t\tjson.interpolation = interpolation;\n\n\t\t\t}\n\n\t\t}\n\n\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\treturn json;\n\n\t}\n\n\t/**\n\t * Factory method for creating a new discrete interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {DiscreteInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodDiscrete( result ) {\n\n\t\treturn new DiscreteInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Factory method for creating a new linear interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {LinearInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new LinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Factory method for creating a new smooth interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {CubicInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodSmooth( result ) {\n\n\t\treturn new CubicInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n\t/**\n\t * Defines the interpolation factor method for this keyframe track.\n\t *\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tsetInterpolation( interpolation ) {\n\n\t\tlet factoryMethod;\n\n\t\tswitch ( interpolation ) {\n\n\t\t\tcase InterpolateDiscrete:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateLinear:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\n\t\t\t\tbreak;\n\n\t\t\tcase InterpolateSmooth:\n\n\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( factoryMethod === undefined ) {\n\n\t\t\tconst message = 'unsupported interpolation for ' +\n\t\t\t\tthis.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\tif ( this.createInterpolant === undefined ) {\n\n\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\tif ( interpolation !== this.DefaultInterpolation ) {\n\n\t\t\t\t\tthis.setInterpolation( this.DefaultInterpolation );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( message ); // fatal, in this case\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconsole.warn( 'THREE.KeyframeTrack:', message );\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.createInterpolant = factoryMethod;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current interpolation type.\n\t *\n\t * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.\n\t */\n\tgetInterpolation() {\n\n\t\tswitch ( this.createInterpolant ) {\n\n\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\n\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\tcase this.InterpolantFactoryMethodLinear:\n\n\t\t\t\treturn InterpolateLinear;\n\n\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\n\t\t\t\treturn InterpolateSmooth;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the value size.\n\t *\n\t * @return {number} The value size.\n\t */\n\tgetValueSize() {\n\n\t\treturn this.values.length / this.times.length;\n\n\t}\n\n\t/**\n\t * Moves all keyframes either forward or backward in time.\n\t *\n\t * @param {number} timeOffset - The offset to move the time values.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tshift( timeOffset ) {\n\n\t\tif ( timeOffset !== 0.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] += timeOffset;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scale all keyframe times by a factor (useful for frame - seconds conversions).\n\t *\n\t * @param {number} timeScale - The time scale.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\tscale( timeScale ) {\n\n\t\tif ( timeScale !== 1.0 ) {\n\n\t\t\tconst times = this.times;\n\n\t\t\tfor ( let i = 0, n = times.length; i !== n; ++ i ) {\n\n\t\t\t\ttimes[ i ] *= timeScale;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes keyframes before and after animation without changing any values within the defined time range.\n\t *\n\t * Note: The method does not shift around keys to the start of the track time, because for interpolated\n\t * keys this will change their values\n\t *\n\t * @param {number} startTime - The start time.\n\t * @param {number} endTime - The end time.\n\t * @return {KeyframeTrack} A reference to this keyframe track.\n\t */\n\ttrim( startTime, endTime ) {\n\n\t\tconst times = this.times,\n\t\t\tnKeys = times.length;\n\n\t\tlet from = 0,\n\t\t\tto = nKeys - 1;\n\n\t\twhile ( from !== nKeys && times[ from ] < startTime ) {\n\n\t\t\t++ from;\n\n\t\t}\n\n\t\twhile ( to !== -1 && times[ to ] > endTime ) {\n\n\t\t\t-- to;\n\n\t\t}\n\n\t\t++ to; // inclusive -> exclusive bound\n\n\t\tif ( from !== 0 || to !== nKeys ) {\n\n\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\tif ( from >= to ) {\n\n\t\t\t\tto = Math.max( to, 1 );\n\t\t\t\tfrom = to - 1;\n\n\t\t\t}\n\n\t\t\tconst stride = this.getValueSize();\n\t\t\tthis.times = times.slice( from, to );\n\t\t\tthis.values = this.values.slice( from * stride, to * stride );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs minimal validation on the keyframe track. Returns `true` if the values\n\t * are valid.\n\t *\n\t * @return {boolean} Whether the keyframes are valid or not.\n\t */\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tconst valueSize = this.getValueSize();\n\t\tif ( valueSize - Math.floor( valueSize ) !== 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tconst times = this.times,\n\t\t\tvalues = this.values,\n\n\t\t\tnKeys = times.length;\n\n\t\tif ( nKeys === 0 ) {\n\n\t\t\tconsole.error( 'THREE.KeyframeTrack: Track is empty.', this );\n\t\t\tvalid = false;\n\n\t\t}\n\n\t\tlet prevTime = null;\n\n\t\tfor ( let i = 0; i !== nKeys; i ++ ) {\n\n\t\t\tconst currTime = times[ i ];\n\n\t\t\tif ( typeof currTime === 'number' && isNaN( currTime ) ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( prevTime !== null && prevTime > currTime ) {\n\n\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );\n\t\t\t\tvalid = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tprevTime = currTime;\n\n\t\t}\n\n\t\tif ( values !== undefined ) {\n\n\t\t\tif ( isTypedArray( values ) ) {\n\n\t\t\t\tfor ( let i = 0, n = values.length; i !== n; ++ i ) {\n\n\t\t\t\t\tconst value = values[ i ];\n\n\t\t\t\t\tif ( isNaN( value ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );\n\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t/**\n\t * Optimizes this keyframe track by removing equivalent sequential keys (which are\n\t * common in morph target sequences).\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\toptimize() {\n\n\t\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\n\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\tconst times = this.times.slice(),\n\t\t\tvalues = this.values.slice(),\n\t\t\tstride = this.getValueSize(),\n\n\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\n\t\t\tlastIndex = times.length - 1;\n\n\t\tlet writeIndex = 1;\n\n\t\tfor ( let i = 1; i < lastIndex; ++ i ) {\n\n\t\t\tlet keep = false;\n\n\t\t\tconst time = times[ i ];\n\t\t\tconst timeNext = times[ i + 1 ];\n\n\t\t\t// remove adjacent keyframes scheduled at the same time\n\n\t\t\tif ( time !== timeNext && ( i !== 1 || time !== times[ 0 ] ) ) {\n\n\t\t\t\tif ( ! smoothInterpolation ) {\n\n\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\n\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tconst value = values[ offset + j ];\n\n\t\t\t\t\t\tif ( value !== values[ offsetP + j ] ||\n\t\t\t\t\t\t\tvalue !== values[ offsetN + j ] ) {\n\n\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tkeep = true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// in-place compaction\n\n\t\t\tif ( keep ) {\n\n\t\t\t\tif ( i !== writeIndex ) {\n\n\t\t\t\t\ttimes[ writeIndex ] = times[ i ];\n\n\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\tfor ( let j = 0; j !== stride; ++ j ) {\n\n\t\t\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t++ writeIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// flush last keyframe (compaction looks ahead)\n\n\t\tif ( lastIndex > 0 ) {\n\n\t\t\ttimes[ writeIndex ] = times[ lastIndex ];\n\n\t\t\tfor ( let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j ) {\n\n\t\t\t\tvalues[ writeOffset + j ] = values[ readOffset + j ];\n\n\t\t\t}\n\n\t\t\t++ writeIndex;\n\n\t\t}\n\n\t\tif ( writeIndex !== times.length ) {\n\n\t\t\tthis.times = times.slice( 0, writeIndex );\n\t\t\tthis.values = values.slice( 0, writeIndex * stride );\n\n\t\t} else {\n\n\t\t\tthis.times = times;\n\t\t\tthis.values = values;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new keyframe track with copied values from this instance.\n\t *\n\t * @return {KeyframeTrack} A clone of this instance.\n\t */\n\tclone() {\n\n\t\tconst times = this.times.slice();\n\t\tconst values = this.values.slice();\n\n\t\tconst TypedKeyframeTrack = this.constructor;\n\t\tconst track = new TypedKeyframeTrack( this.name, times, values );\n\n\t\t// Interpolant argument to constructor is not saved, so copy the factory method directly.\n\t\ttrack.createInterpolant = this.createInterpolant;\n\n\t\treturn track;\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default ''\n */\nKeyframeTrack.prototype.ValueTypeName = '';\n\n/**\n * The time buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Float32Array.constructor\n */\nKeyframeTrack.prototype.TimeBufferType = Float32Array;\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Float32Array.constructor\n */\nKeyframeTrack.prototype.ValueBufferType = Float32Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateLinear\n */\nKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n/**\n * A track for boolean keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass BooleanKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new boolean keyframe track.\n\t *\n\t * This keyframe track type has no `interpolation` parameter because the\n\t * interpolation is always discrete.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<boolean>} values - A list of keyframe values.\n\t */\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'bool'\n */\nBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Array.constructor\n */\nBooleanKeyframeTrack.prototype.ValueBufferType = Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateDiscrete\n */\nBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for color keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass ColorKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new color keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<number>} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'color'\n */\nColorKeyframeTrack.prototype.ValueTypeName = 'color';\n\n/**\n * A track for numeric keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass NumberKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new number keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<number>} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'number'\n */\nNumberKeyframeTrack.prototype.ValueTypeName = 'number';\n\n/**\n * Spherical linear unit quaternion interpolant.\n *\n * @augments Interpolant\n */\nclass QuaternionLinearInterpolant extends Interpolant {\n\n\t/**\n\t * Constructs a new SLERP interpolant.\n\t *\n\t * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors.\n\t * @param {TypedArray} sampleValues - The sample values.\n\t * @param {number} sampleSize - The sample size\n\t * @param {TypedArray} [resultBuffer] - The result buffer.\n\t */\n\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t}\n\n\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer,\n\t\t\tvalues = this.sampleValues,\n\t\t\tstride = this.valueSize,\n\n\t\t\talpha = ( t - t0 ) / ( t1 - t0 );\n\n\t\tlet offset = i1 * stride;\n\n\t\tfor ( let end = offset + stride; offset !== end; offset += 4 ) {\n\n\t\t\tQuaternion.slerpFlat( result, 0, values, offset - stride, values, offset, alpha );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n}\n\n/**\n * A track for Quaternion keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass QuaternionKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new Quaternion keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<number>} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n\t/**\n\t * Overwritten so the method returns Quaternion based interpolant.\n\t *\n\t * @static\n\t * @param {TypedArray} [result] - The result buffer.\n\t * @return {QuaternionLinearInterpolant} The new interpolant.\n\t */\n\tInterpolantFactoryMethodLinear( result ) {\n\n\t\treturn new QuaternionLinearInterpolant( this.times, this.values, this.getValueSize(), result );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'quaternion'\n */\nQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion';\n// ValueBufferType is inherited\n// DefaultInterpolation is inherited;\nQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for string keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass StringKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new string keyframe track.\n\t *\n\t * This keyframe track type has no `interpolation` parameter because the\n\t * interpolation is always discrete.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<string>} values - A list of keyframe values.\n\t */\n\tconstructor( name, times, values ) {\n\n\t\tsuper( name, times, values );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'string'\n */\nStringKeyframeTrack.prototype.ValueTypeName = 'string';\n\n/**\n * The value buffer type of this keyframe track.\n *\n * @type {TypedArray|Array}\n * @default Array.constructor\n */\nStringKeyframeTrack.prototype.ValueBufferType = Array;\n\n/**\n * The default interpolation type of this keyframe track.\n *\n * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}\n * @default InterpolateDiscrete\n */\nStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\nStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n/**\n * A track for vector keyframe values.\n *\n * @augments KeyframeTrack\n */\nclass VectorKeyframeTrack extends KeyframeTrack {\n\n\t/**\n\t * Constructs a new vector keyframe track.\n\t *\n\t * @param {string} name - The keyframe track's name.\n\t * @param {Array<number>} times - A list of keyframe times.\n\t * @param {Array<number>} values - A list of keyframe values.\n\t * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.\n\t */\n\tconstructor( name, times, values, interpolation ) {\n\n\t\tsuper( name, times, values, interpolation );\n\n\t}\n\n}\n\n/**\n * The value type name.\n *\n * @type {String}\n * @default 'vector'\n */\nVectorKeyframeTrack.prototype.ValueTypeName = 'vector';\n\n/**\n * A reusable set of keyframe tracks which represent an animation.\n */\nclass AnimationClip {\n\n\t/**\n\t * Constructs a new animation clip.\n\t *\n\t * Note: Instead of instantiating an AnimationClip directly with the constructor, you can\n\t * use the static interface of this class for creating clips. In most cases though, animation clips\n\t * will automatically be created by loaders when importing animated 3D assets.\n\t *\n\t * @param {string} [name=''] - The clip's name.\n\t * @param {number} [duration=-1] - The clip's duration in seconds. If a negative value is passed,\n\t * the duration will be calculated from the passed keyframes.\n\t * @param {Array<KeyframeTrack>} tracks - An array of keyframe tracks.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation\n\t * is blended/combined when two or more animations are simultaneously played.\n\t */\n\tconstructor( name = '', duration = -1, tracks = [], blendMode = NormalAnimationBlendMode ) {\n\n\t\t/**\n\t\t * The clip's name.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t *  An array of keyframe tracks.\n\t\t *\n\t\t * @type {Array<KeyframeTrack>}\n\t\t */\n\t\tthis.tracks = tracks;\n\n\t\t/**\n\t\t * The clip's duration in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.duration = duration;\n\n\t\t/**\n\t\t * Defines how the animation is blended/combined when two or more animations\n\t\t * are simultaneously played.\n\t\t *\n\t\t * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)}\n\t\t */\n\t\tthis.blendMode = blendMode;\n\n\t\t/**\n\t\t * The UUID of the animation clip.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t// this means it should figure out its duration by scanning the tracks\n\t\tif ( this.duration < 0 ) {\n\n\t\t\tthis.resetDuration();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Factory method for creating an animation clip from the given JSON.\n\t *\n\t * @static\n\t * @param {Object} json - The serialized animation clip.\n\t * @return {AnimationClip} The new animation clip.\n\t */\n\tstatic parse( json ) {\n\n\t\tconst tracks = [],\n\t\t\tjsonTracks = json.tracks,\n\t\t\tframeTime = 1.0 / ( json.fps || 1.0 );\n\n\t\tfor ( let i = 0, n = jsonTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( parseKeyframeTrack( jsonTracks[ i ] ).scale( frameTime ) );\n\n\t\t}\n\n\t\tconst clip = new this( json.name, json.duration, tracks, json.blendMode );\n\t\tclip.uuid = json.uuid;\n\n\t\treturn clip;\n\n\t}\n\n\t/**\n\t * Serializes the given animation clip into JSON.\n\t *\n\t * @static\n\t * @param {AnimationClip} clip - The animation clip to serialize.\n\t * @return {Object} The JSON object.\n\t */\n\tstatic toJSON( clip ) {\n\n\t\tconst tracks = [],\n\t\t\tclipTracks = clip.tracks;\n\n\t\tconst json = {\n\n\t\t\t'name': clip.name,\n\t\t\t'duration': clip.duration,\n\t\t\t'tracks': tracks,\n\t\t\t'uuid': clip.uuid,\n\t\t\t'blendMode': clip.blendMode\n\n\t\t};\n\n\t\tfor ( let i = 0, n = clipTracks.length; i !== n; ++ i ) {\n\n\t\t\ttracks.push( KeyframeTrack.toJSON( clipTracks[ i ] ) );\n\n\t\t}\n\n\t\treturn json;\n\n\t}\n\n\t/**\n\t * Returns a new animation clip from the passed morph targets array of a\n\t * geometry, taking a name and the number of frames per second.\n\t *\n\t * Note: The fps parameter is required, but the animation speed can be\n\t * overridden via {@link AnimationAction#setDuration}.\n\t *\n\t * @static\n\t * @param {string} name - The name of the animation clip.\n\t * @param {Array<Object>} morphTargetSequence - A sequence of morph targets.\n\t * @param {number} fps - The Frames-Per-Second value.\n\t * @param {boolean} noLoop - Whether the clip should be no loop or not.\n\t * @return {AnimationClip} The new animation clip.\n\t */\n\tstatic CreateFromMorphTargetSequence( name, morphTargetSequence, fps, noLoop ) {\n\n\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < numMorphTargets; i ++ ) {\n\n\t\t\tlet times = [];\n\t\t\tlet values = [];\n\n\t\t\ttimes.push(\n\t\t\t\t( i + numMorphTargets - 1 ) % numMorphTargets,\n\t\t\t\ti,\n\t\t\t\t( i + 1 ) % numMorphTargets );\n\n\t\t\tvalues.push( 0, 1, 0 );\n\n\t\t\tconst order = getKeyframeOrder( times );\n\t\t\ttimes = sortedArray( times, 1, order );\n\t\t\tvalues = sortedArray( values, 1, order );\n\n\t\t\t// if there is a key at the first frame, duplicate it as the\n\t\t\t// last frame as well for perfect loop.\n\t\t\tif ( ! noLoop && times[ 0 ] === 0 ) {\n\n\t\t\t\ttimes.push( numMorphTargets );\n\t\t\t\tvalues.push( values[ 0 ] );\n\n\t\t\t}\n\n\t\t\ttracks.push(\n\t\t\t\tnew NumberKeyframeTrack(\n\t\t\t\t\t'.morphTargetInfluences[' + morphTargetSequence[ i ].name + ']',\n\t\t\t\t\ttimes, values\n\t\t\t\t).scale( 1.0 / fps ) );\n\n\t\t}\n\n\t\treturn new this( name, -1, tracks );\n\n\t}\n\n\t/**\n\t * Searches for an animation clip by name, taking as its first parameter\n\t * either an array of clips, or a mesh or geometry that contains an\n\t * array named \"animations\" property.\n\t *\n\t * @static\n\t * @param {(Array<AnimationClip>|Object3D)} objectOrClipArray - The array or object to search through.\n\t * @param {string} name - The name to search for.\n\t * @return {?AnimationClip} The found animation clip. Returns `null` if no clip has been found.\n\t */\n\tstatic findByName( objectOrClipArray, name ) {\n\n\t\tlet clipArray = objectOrClipArray;\n\n\t\tif ( ! Array.isArray( objectOrClipArray ) ) {\n\n\t\t\tconst o = objectOrClipArray;\n\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < clipArray.length; i ++ ) {\n\n\t\t\tif ( clipArray[ i ].name === name ) {\n\n\t\t\t\treturn clipArray[ i ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Returns an array of new AnimationClips created from the morph target\n\t * sequences of a geometry, trying to sort morph target names into\n\t * animation-group-based patterns like \"Walk_001, Walk_002, Run_001, Run_002...\".\n\t *\n\t * See {@link MD2Loader#parse} as an example for how the method should be used.\n\t *\n\t * @static\n\t * @param {Array<Object>} morphTargets - A sequence of morph targets.\n\t * @param {number} fps - The Frames-Per-Second value.\n\t * @param {boolean} noLoop - Whether the clip should be no loop or not.\n\t * @return {Array<AnimationClip>} An array of new animation clips.\n\t */\n\tstatic CreateClipsFromMorphTargetSequences( morphTargets, fps, noLoop ) {\n\n\t\tconst animationToMorphTargets = {};\n\n\t\t// tested with https://regex101.com/ on trick sequences\n\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/;\n\n\t\t// sort morph target names into animation groups based\n\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\t\tfor ( let i = 0, il = morphTargets.length; i < il; i ++ ) {\n\n\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\tconst parts = morphTarget.name.match( pattern );\n\n\t\t\tif ( parts && parts.length > 1 ) {\n\n\t\t\t\tconst name = parts[ 1 ];\n\n\t\t\t\tlet animationMorphTargets = animationToMorphTargets[ name ];\n\n\t\t\t\tif ( ! animationMorphTargets ) {\n\n\t\t\t\t\tanimationToMorphTargets[ name ] = animationMorphTargets = [];\n\n\t\t\t\t}\n\n\t\t\t\tanimationMorphTargets.push( morphTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst clips = [];\n\n\t\tfor ( const name in animationToMorphTargets ) {\n\n\t\t\tclips.push( this.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );\n\n\t\t}\n\n\t\treturn clips;\n\n\t}\n\n\t/**\n\t * Parses the `animation.hierarchy` format and returns a new animation clip.\n\t *\n\t * @static\n\t * @deprecated since r175.\n\t * @param {Object} animation - A serialized animation clip as JSON.\n\t * @param {Array<Bones>} bones - An array of bones.\n\t * @return {?AnimationClip} The new animation clip.\n\t */\n\tstatic parseAnimation( animation, bones ) {\n\n\t\tconsole.warn( 'THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185' );\n\n\t\tif ( ! animation ) {\n\n\t\t\tconsole.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst addNonemptyTrack = function ( trackType, trackName, animationKeys, propertyName, destTracks ) {\n\n\t\t\t// only return track if there are actually keys.\n\t\t\tif ( animationKeys.length !== 0 ) {\n\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tflattenJSON( animationKeys, times, values, propertyName );\n\n\t\t\t\t// empty keys are filtered out, so check again\n\t\t\t\tif ( times.length !== 0 ) {\n\n\t\t\t\t\tdestTracks.push( new trackType( trackName, times, values ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\tconst tracks = [];\n\n\t\tconst clipName = animation.name || 'default';\n\t\tconst fps = animation.fps || 30;\n\t\tconst blendMode = animation.blendMode;\n\n\t\t// automatic length determination in AnimationClip.\n\t\tlet duration = animation.length || -1;\n\n\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\tfor ( let h = 0; h < hierarchyTracks.length; h ++ ) {\n\n\t\t\tconst animationKeys = hierarchyTracks[ h ].keys;\n\n\t\t\t// skip empty tracks\n\t\t\tif ( ! animationKeys || animationKeys.length === 0 ) continue;\n\n\t\t\t// process morph targets\n\t\t\tif ( animationKeys[ 0 ].morphTargets ) {\n\n\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\tconst morphTargetNames = {};\n\n\t\t\t\tlet k;\n\n\t\t\t\tfor ( k = 0; k < animationKeys.length; k ++ ) {\n\n\t\t\t\t\tif ( animationKeys[ k ].morphTargets ) {\n\n\t\t\t\t\t\tfor ( let m = 0; m < animationKeys[ k ].morphTargets.length; m ++ ) {\n\n\t\t\t\t\t\t\tmorphTargetNames[ animationKeys[ k ].morphTargets[ m ] ] = -1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// create a track for each morph target with all zero\n\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t// the morphTarget is named.\n\t\t\t\tfor ( const morphTargetName in morphTargetNames ) {\n\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\n\t\t\t\t\tfor ( let m = 0; m !== animationKeys[ k ].morphTargets.length; ++ m ) {\n\n\t\t\t\t\t\tconst animationKey = animationKeys[ k ];\n\n\t\t\t\t\t\ttimes.push( animationKey.time );\n\t\t\t\t\t\tvalues.push( ( animationKey.morphTarget === morphTargetName ) ? 1 : 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttracks.push( new NumberKeyframeTrack( '.morphTargetInfluence[' + morphTargetName + ']', times, values ) );\n\n\t\t\t\t}\n\n\t\t\t\tduration = morphTargetNames.length * fps;\n\n\t\t\t} else {\n\n\t\t\t\t// ...assume skeletal animation\n\n\t\t\t\tconst boneName = '.bones[' + bones[ h ].name + ']';\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.position',\n\t\t\t\t\tanimationKeys, 'pos', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tQuaternionKeyframeTrack, boneName + '.quaternion',\n\t\t\t\t\tanimationKeys, 'rot', tracks );\n\n\t\t\t\taddNonemptyTrack(\n\t\t\t\t\tVectorKeyframeTrack, boneName + '.scale',\n\t\t\t\t\tanimationKeys, 'scl', tracks );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( tracks.length === 0 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst clip = new this( clipName, duration, tracks, blendMode );\n\n\t\treturn clip;\n\n\t}\n\n\t/**\n\t * Sets the duration of this clip to the duration of its longest keyframe track.\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\tresetDuration() {\n\n\t\tconst tracks = this.tracks;\n\t\tlet duration = 0;\n\n\t\tfor ( let i = 0, n = tracks.length; i !== n; ++ i ) {\n\n\t\t\tconst track = this.tracks[ i ];\n\n\t\t\tduration = Math.max( duration, track.times[ track.times.length - 1 ] );\n\n\t\t}\n\n\t\tthis.duration = duration;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Trims all tracks to the clip's duration.\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\ttrim() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].trim( 0, this.duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Performs minimal validation on each track in the clip. Returns `true` if all\n\t * tracks are valid.\n\t *\n\t * @return {boolean} Whether the clip's keyframes are valid or not.\n\t */\n\tvalidate() {\n\n\t\tlet valid = true;\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tvalid = valid && this.tracks[ i ].validate();\n\n\t\t}\n\n\t\treturn valid;\n\n\t}\n\n\t/**\n\t * Optimizes each track by removing equivalent sequential keys (which are\n\t * common in morph target sequences).\n\t *\n\t * @return {AnimationClip} A reference to this animation clip.\n\t */\n\toptimize() {\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\tthis.tracks[ i ].optimize();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new animation clip with copied values from this instance.\n\t *\n\t * @return {AnimationClip} A clone of this instance.\n\t */\n\tclone() {\n\n\t\tconst tracks = [];\n\n\t\tfor ( let i = 0; i < this.tracks.length; i ++ ) {\n\n\t\t\ttracks.push( this.tracks[ i ].clone() );\n\n\t\t}\n\n\t\treturn new this.constructor( this.name, this.duration, tracks, this.blendMode );\n\n\t}\n\n\t/**\n\t * Serializes this animation clip into JSON.\n\t *\n\t * @return {Object} The JSON object.\n\t */\n\ttoJSON() {\n\n\t\treturn this.constructor.toJSON( this );\n\n\t}\n\n}\n\nfunction getTrackTypeForValueTypeName( typeName ) {\n\n\tswitch ( typeName.toLowerCase() ) {\n\n\t\tcase 'scalar':\n\t\tcase 'double':\n\t\tcase 'float':\n\t\tcase 'number':\n\t\tcase 'integer':\n\n\t\t\treturn NumberKeyframeTrack;\n\n\t\tcase 'vector':\n\t\tcase 'vector2':\n\t\tcase 'vector3':\n\t\tcase 'vector4':\n\n\t\t\treturn VectorKeyframeTrack;\n\n\t\tcase 'color':\n\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tflattenJSON( json.keys, times, values, 'value' );\n\n\t\tjson.times = times;\n\t\tjson.values = values;\n\n\t}\n\n\t// derived classes can define a static parse method\n\tif ( trackType.parse !== undefined ) {\n\n\t\treturn trackType.parse( json );\n\n\t} else {\n\n\t\t// by default, we assume a constructor compatible with the base\n\t\treturn new trackType( json.name, json.times, json.values, json.interpolation );\n\n\t}\n\n}\n\n/**\n * @class\n * @classdesc A simple caching system, used internally by {@link FileLoader}.\n * To enable caching across all loaders that use {@link FileLoader}, add `THREE.Cache.enabled = true.` once in your app.\n * @hideconstructor\n */\nconst Cache = {\n\n\t/**\n\t * Whether caching is enabled or not.\n\t *\n\t * @static\n\t * @type {boolean}\n\t * @default false\n\t */\n\tenabled: false,\n\n\t/**\n\t * A dictionary that holds cached files.\n\t *\n\t * @static\n\t * @type {Object<string,Object>}\n\t */\n\tfiles: {},\n\n\t/**\n\t * Adds a cache entry with a key to reference the file. If this key already\n\t * holds a file, it is overwritten.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t * @param {Object} file -  The file to be cached.\n\t */\n\tadd: function ( key, file ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\tthis.files[ key ] = file;\n\n\t},\n\n\t/**\n\t * Gets the cached value for the given key.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t * @return {Object|undefined} The cached file. If the key does not exist `undefined` is returned.\n\t */\n\tget: function ( key ) {\n\n\t\tif ( this.enabled === false ) return;\n\n\t\t// console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\treturn this.files[ key ];\n\n\t},\n\n\t/**\n\t * Removes the cached file associated with the given key.\n\t *\n\t * @static\n\t * @param {string} key - The key to reference the cached file.\n\t */\n\tremove: function ( key ) {\n\n\t\tdelete this.files[ key ];\n\n\t},\n\n\t/**\n\t * Remove all values from the cache.\n\t *\n\t * @static\n\t */\n\tclear: function () {\n\n\t\tthis.files = {};\n\n\t}\n\n};\n\n/**\n * Handles and keeps track of loaded and pending data. A default global\n * instance of this class is created and used by loaders if not supplied\n * manually.\n *\n * In general that should be sufficient, however there are times when it can\n * be useful to have separate loaders - for example if you want to show\n * separate loading bars for objects and textures.\n *\n * ```js\n * const manager = new THREE.LoadingManager();\n * manager.onLoad = () => console.log( 'Loading complete!' );\n *\n * const loader1 = new OBJLoader( manager );\n * const loader2 = new ColladaLoader( manager );\n * ```\n */\nclass LoadingManager {\n\n\t/**\n\t * Constructs a new loading manager.\n\t *\n\t * @param {Function} [onLoad] - Executes when all items have been loaded.\n\t * @param {Function} [onProgress] - Executes when single items have been loaded.\n\t * @param {Function} [onError] - Executes when an error occurs.\n\t */\n\tconstructor( onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tlet isLoading = false;\n\t\tlet itemsLoaded = 0;\n\t\tlet itemsTotal = 0;\n\t\tlet urlModifier = undefined;\n\t\tconst handlers = [];\n\n\t\t// Refer to #5689 for the reason why we don't set .onStart\n\t\t// in the constructor\n\n\t\t/**\n\t\t * Executes when an item starts loading.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onStart = undefined;\n\n\t\t/**\n\t\t * Executes when all items have been loaded.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onLoad = onLoad;\n\n\t\t/**\n\t\t * Executes when single items have been loaded.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onProgress = onProgress;\n\n\t\t/**\n\t\t * Executes when an error occurs.\n\t\t *\n\t\t * @type {Function|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.onError = onError;\n\n\t\t/**\n\t\t * Used for aborting ongoing requests in loaders using this manager.\n\t\t *\n\t\t * @type {AbortController}\n\t\t */\n\t\tthis.abortController = new AbortController();\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * starts loading an item.\n\t\t *\n\t\t * @param {string} url - The URL to load.\n\t\t */\n\t\tthis.itemStart = function ( url ) {\n\n\t\t\titemsTotal ++;\n\n\t\t\tif ( isLoading === false ) {\n\n\t\t\t\tif ( scope.onStart !== undefined ) {\n\n\t\t\t\t\tscope.onStart( url, itemsLoaded, itemsTotal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tisLoading = true;\n\n\t\t};\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * ended loading an item.\n\t\t *\n\t\t * @param {string} url - The URL of the loaded item.\n\t\t */\n\t\tthis.itemEnd = function ( url ) {\n\n\t\t\titemsLoaded ++;\n\n\t\t\tif ( scope.onProgress !== undefined ) {\n\n\t\t\t\tscope.onProgress( url, itemsLoaded, itemsTotal );\n\n\t\t\t}\n\n\t\t\tif ( itemsLoaded === itemsTotal ) {\n\n\t\t\t\tisLoading = false;\n\n\t\t\t\tif ( scope.onLoad !== undefined ) {\n\n\t\t\t\t\tscope.onLoad();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * This should be called by any loader using the manager when the loader\n\t\t * encounters an error when loading an item.\n\t\t *\n\t\t * @param {string} url - The URL of the item that produces an error.\n\t\t */\n\t\tthis.itemError = function ( url ) {\n\n\t\t\tif ( scope.onError !== undefined ) {\n\n\t\t\t\tscope.onError( url );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Given a URL, uses the URL modifier callback (if any) and returns a\n\t\t * resolved URL. If no URL modifier is set, returns the original URL.\n\t\t *\n\t\t * @param {string} url - The URL to load.\n\t\t * @return {string} The resolved URL.\n\t\t */\n\t\tthis.resolveURL = function ( url ) {\n\n\t\t\tif ( urlModifier ) {\n\n\t\t\t\treturn urlModifier( url );\n\n\t\t\t}\n\n\t\t\treturn url;\n\n\t\t};\n\n\t\t/**\n\t\t * If provided, the callback will be passed each resource URL before a\n\t\t * request is sent. The callback may return the original URL, or a new URL to\n\t\t * override loading behavior. This behavior can be used to load assets from\n\t\t * .ZIP files, drag-and-drop APIs, and Data URIs.\n\t\t *\n\t\t * ```js\n\t\t * const blobs = {'fish.gltf': blob1, 'diffuse.png': blob2, 'normal.png': blob3};\n\t\t *\n\t\t * const manager = new THREE.LoadingManager();\n\t\t *\n\t\t * // Initialize loading manager with URL callback.\n\t\t * const objectURLs = [];\n\t\t * manager.setURLModifier( ( url ) => {\n\t\t *\n\t\t * \turl = URL.createObjectURL( blobs[ url ] );\n\t\t * \tobjectURLs.push( url );\n\t\t * \treturn url;\n\t\t *\n\t\t * } );\n\t\t *\n\t\t * // Load as usual, then revoke the blob URLs.\n\t\t * const loader = new GLTFLoader( manager );\n\t\t * loader.load( 'fish.gltf', (gltf) => {\n\t\t *\n\t\t * \tscene.add( gltf.scene );\n\t\t * \tobjectURLs.forEach( ( url ) => URL.revokeObjectURL( url ) );\n\t\t *\n\t\t * } );\n\t\t * ```\n\t\t *\n\t\t * @param {function(string):string} transform - URL modifier callback. Called with an URL and must return a resolved URL.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.setURLModifier = function ( transform ) {\n\n\t\t\turlModifier = transform;\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Registers a loader with the given regular expression. Can be used to\n\t\t * define what loader should be used in order to load specific files. A\n\t\t * typical use case is to overwrite the default loader for textures.\n\t\t *\n\t\t * ```js\n\t\t * // add handler for TGA textures\n\t\t * manager.addHandler( /\\.tga$/i, new TGALoader() );\n\t\t * ```\n\t\t *\n\t\t * @param {string} regex - A regular expression.\n\t\t * @param {Loader} loader - A loader that should handle matched cases.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.addHandler = function ( regex, loader ) {\n\n\t\t\thandlers.push( regex, loader );\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Removes the loader for the given regular expression.\n\t\t *\n\t\t * @param {string} regex - A regular expression.\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.removeHandler = function ( regex ) {\n\n\t\t\tconst index = handlers.indexOf( regex );\n\n\t\t\tif ( index !== -1 ) {\n\n\t\t\t\thandlers.splice( index, 2 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t};\n\n\t\t/**\n\t\t * Can be used to retrieve the registered loader for the given file path.\n\t\t *\n\t\t * @param {string} file - The file path.\n\t\t * @return {?Loader} The registered loader. Returns `null` if no loader was found.\n\t\t */\n\t\tthis.getHandler = function ( file ) {\n\n\t\t\tfor ( let i = 0, l = handlers.length; i < l; i += 2 ) {\n\n\t\t\t\tconst regex = handlers[ i ];\n\t\t\t\tconst loader = handlers[ i + 1 ];\n\n\t\t\t\tif ( regex.global ) regex.lastIndex = 0; // see #17920\n\n\t\t\t\tif ( regex.test( file ) ) {\n\n\t\t\t\t\treturn loader;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t};\n\n\t\t/**\n\t\t * Can be used to abort ongoing loading requests in loaders using this manager.\n\t\t * The abort only works if the loaders implement {@link Loader#abort} and `AbortSignal.any()`\n\t\t * is supported in the browser.\n\t\t *\n\t\t * @return {LoadingManager} A reference to this loading manager.\n\t\t */\n\t\tthis.abort = function () {\n\n\t\t\tthis.abortController.abort();\n\t\t\tthis.abortController = new AbortController();\n\n\t\t\treturn this;\n\n\t\t};\n\n\t}\n\n}\n\n/**\n * The global default loading manager.\n *\n * @constant\n * @type {LoadingManager}\n */\nconst DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();\n\n/**\n * Abstract base class for loaders.\n *\n * @abstract\n */\nclass Loader {\n\n\t/**\n\t * Constructs a new loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\t/**\n\t\t * The loading manager.\n\t\t *\n\t\t * @type {LoadingManager}\n\t\t * @default DefaultLoadingManager\n\t\t */\n\t\tthis.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;\n\n\t\t/**\n\t\t * The crossOrigin string to implement CORS for loading the url from a\n\t\t * different domain that allows CORS.\n\t\t *\n\t\t * @type {string}\n\t\t * @default 'anonymous'\n\t\t */\n\t\tthis.crossOrigin = 'anonymous';\n\n\t\t/**\n\t\t * Whether the XMLHttpRequest uses credentials.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.withCredentials = false;\n\n\t\t/**\n\t\t * The base path from which the asset will be loaded.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.path = '';\n\n\t\t/**\n\t\t * The base path from which additional resources like textures will be loaded.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.resourcePath = '';\n\n\t\t/**\n\t\t * The [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}\n\t\t * used in HTTP request.\n\t\t *\n\t\t * @type {Object<string, any>}\n\t\t */\n\t\tthis.requestHeader = {};\n\n\t}\n\n\t/**\n\t * This method needs to be implemented by all concrete loaders. It holds the\n\t * logic for loading assets from the backend.\n\t *\n\t * @abstract\n\t * @param {string} url - The path/URL of the file to be loaded.\n\t * @param {Function} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @param {onErrorCallback} [onError] - Executed when errors occur.\n\t */\n\tload( /* url, onLoad, onProgress, onError */ ) {}\n\n\t/**\n\t * A async version of {@link Loader#load}.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @return {Promise} A Promise that resolves when the asset has been loaded.\n\t */\n\tloadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\tscope.load( url, resolve, onProgress, reject );\n\n\t\t} );\n\n\t}\n\n\t/**\n\t * This method needs to be implemented by all concrete loaders. It holds the\n\t * logic for parsing the asset into three.js entities.\n\t *\n\t * @abstract\n\t * @param {any} data - The data to parse.\n\t */\n\tparse( /* data */ ) {}\n\n\t/**\n\t * Sets the `crossOrigin` String to implement CORS for loading the URL\n\t * from a different domain that allows CORS.\n\t *\n\t * @param {string} crossOrigin - The `crossOrigin` value.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetCrossOrigin( crossOrigin ) {\n\n\t\tthis.crossOrigin = crossOrigin;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Whether the XMLHttpRequest uses credentials such as cookies, authorization\n\t * headers or TLS client certificates, see [XMLHttpRequest.withCredentials]{@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials}.\n\t *\n\t * Note: This setting has no effect if you are loading files locally or from the same domain.\n\t *\n\t * @param {boolean} value - The `withCredentials` value.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetWithCredentials( value ) {\n\n\t\tthis.withCredentials = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the base path for the asset.\n\t *\n\t * @param {string} path - The base path.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetPath( path ) {\n\n\t\tthis.path = path;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the base path for dependent resources like textures.\n\t *\n\t * @param {string} resourcePath - The resource path.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetResourcePath( resourcePath ) {\n\n\t\tthis.resourcePath = resourcePath;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given request header.\n\t *\n\t * @param {Object} requestHeader - A [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}\n\t * for configuring the HTTP request.\n\t * @return {Loader} A reference to this instance.\n\t */\n\tsetRequestHeader( requestHeader ) {\n\n\t\tthis.requestHeader = requestHeader;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * This method can be implemented in loaders for aborting ongoing requests.\n\t *\n\t * @abstract\n\t * @return {Loader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Callback for onProgress in loaders.\n *\n * @callback onProgressCallback\n * @param {ProgressEvent} event - An instance of `ProgressEvent` that represents the current loading status.\n */\n\n/**\n * Callback for onError in loaders.\n *\n * @callback onErrorCallback\n * @param {Error} error - The error which occurred during the loading process.\n */\n\n/**\n * The default material name that is used by loaders\n * when creating materials for loaded 3D objects.\n *\n * Note: Not all loaders might honor this setting.\n *\n * @static\n * @type {string}\n * @default '__DEFAULT'\n */\nLoader.DEFAULT_MATERIAL_NAME = '__DEFAULT';\n\nconst loading = {};\n\nclass HttpError extends Error {\n\n\tconstructor( message, response ) {\n\n\t\tsuper( message );\n\t\tthis.response = response;\n\n\t}\n\n}\n\n/**\n * A low level class for loading resources with the Fetch API, used internally by\n * most loaders. It can also be used directly to load any file type that does\n * not have a loader.\n *\n * This loader supports caching. If you want to use it, add `THREE.Cache.enabled = true;`\n * once to your application.\n *\n * ```js\n * const loader = new THREE.FileLoader();\n * const data = await loader.loadAsync( 'example.txt' );\n * ```\n *\n * @augments Loader\n */\nclass FileLoader extends Loader {\n\n\t/**\n\t * Constructs a new file loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * The expected mime type. Valid values can be found\n\t\t * [here]{@link hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype}\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.mimeType = '';\n\n\t\t/**\n\t\t * The expected response type.\n\t\t *\n\t\t * @type {('arraybuffer'|'blob'|'document'|'json'|'')}\n\t\t * @default ''\n\t\t */\n\t\tthis.responseType = '';\n\n\t\t/**\n\t\t * Used for aborting requests.\n\t\t *\n\t\t * @private\n\t\t * @type {AbortController}\n\t\t */\n\t\tthis._abortController = new AbortController();\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded response to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(any)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.\n\t * @param {onErrorCallback} [onError] - Executed when errors occur.\n\t * @return {any|undefined} The cached resource if available.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst cached = Cache.get( `file:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tsetTimeout( () => {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\t// Check if request is duplicate\n\n\t\tif ( loading[ url ] !== undefined ) {\n\n\t\t\tloading[ url ].push( {\n\n\t\t\t\tonLoad: onLoad,\n\t\t\t\tonProgress: onProgress,\n\t\t\t\tonError: onError\n\n\t\t\t} );\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// Initialise array for duplicate requests\n\t\tloading[ url ] = [];\n\n\t\tloading[ url ].push( {\n\t\t\tonLoad: onLoad,\n\t\t\tonProgress: onProgress,\n\t\t\tonError: onError,\n\t\t} );\n\n\t\t// create request\n\t\tconst req = new Request( url, {\n\t\t\theaders: new Headers( this.requestHeader ),\n\t\t\tcredentials: this.withCredentials ? 'include' : 'same-origin',\n\t\t\tsignal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal\n\t\t} );\n\n\t\t// record states ( avoid data race )\n\t\tconst mimeType = this.mimeType;\n\t\tconst responseType = this.responseType;\n\n\t\t// start the fetch\n\t\tfetch( req )\n\t\t\t.then( response => {\n\n\t\t\t\tif ( response.status === 200 || response.status === 0 ) {\n\n\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\n\t\t\t\t\tif ( response.status === 0 ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.FileLoader: HTTP Status 0 received.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Workaround: Checking if response.body === undefined for Alipay browser #23548\n\n\t\t\t\t\tif ( typeof ReadableStream === 'undefined' || response.body === undefined || response.body.getReader === undefined ) {\n\n\t\t\t\t\t\treturn response;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t// Nginx needs X-File-Size check\n\t\t\t\t\t// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content\n\t\t\t\t\tconst contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );\n\t\t\t\t\tconst total = contentLength ? parseInt( contentLength ) : 0;\n\t\t\t\t\tconst lengthComputable = total !== 0;\n\t\t\t\t\tlet loaded = 0;\n\n\t\t\t\t\t// periodically read data into the new stream tracking while download progress\n\t\t\t\t\tconst stream = new ReadableStream( {\n\t\t\t\t\t\tstart( controller ) {\n\n\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\tfunction readData() {\n\n\t\t\t\t\t\t\t\treader.read().then( ( { done, value } ) => {\n\n\t\t\t\t\t\t\t\t\tif ( done ) {\n\n\t\t\t\t\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\tloaded += value.byteLength;\n\n\t\t\t\t\t\t\t\t\t\tconst event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );\n\t\t\t\t\t\t\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\t\t\t\t\t\t\tif ( callback.onProgress ) callback.onProgress( event );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tcontroller.enqueue( value );\n\t\t\t\t\t\t\t\t\t\treadData();\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, ( e ) => {\n\n\t\t\t\t\t\t\t\t\tcontroller.error( e );\n\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn new Response( stream );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new HttpError( `fetch for \"${response.url}\" responded with ${response.status}: ${response.statusText}`, response );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( response => {\n\n\t\t\t\tswitch ( responseType ) {\n\n\t\t\t\t\tcase 'arraybuffer':\n\n\t\t\t\t\t\treturn response.arrayBuffer();\n\n\t\t\t\t\tcase 'blob':\n\n\t\t\t\t\t\treturn response.blob();\n\n\t\t\t\t\tcase 'document':\n\n\t\t\t\t\t\treturn response.text()\n\t\t\t\t\t\t\t.then( text => {\n\n\t\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\t\treturn parser.parseFromString( text, mimeType );\n\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\tcase 'json':\n\n\t\t\t\t\t\treturn response.json();\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( mimeType === '' ) {\n\n\t\t\t\t\t\t\treturn response.text();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// sniff encoding\n\t\t\t\t\t\t\tconst re = /charset=\"?([^;\"\\s]*)\"?/i;\n\t\t\t\t\t\t\tconst exec = re.exec( mimeType );\n\t\t\t\t\t\t\tconst label = exec && exec[ 1 ] ? exec[ 1 ].toLowerCase() : undefined;\n\t\t\t\t\t\t\tconst decoder = new TextDecoder( label );\n\t\t\t\t\t\t\treturn response.arrayBuffer().then( ab => decoder.decode( ab ) );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.then( data => {\n\n\t\t\t\t// Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t// error response bodies as proper responses to requests.\n\t\t\t\tCache.add( `file:${url}`, data );\n\n\t\t\t\tconst callbacks = loading[ url ];\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onLoad ) callback.onLoad( data );\n\n\t\t\t\t}\n\n\t\t\t} )\n\t\t\t.catch( err => {\n\n\t\t\t\t// Abort errors and other errors are handled the same\n\n\t\t\t\tconst callbacks = loading[ url ];\n\n\t\t\t\tif ( callbacks === undefined ) {\n\n\t\t\t\t\t// When onLoad was called and url was deleted in `loading`\n\t\t\t\t\tthis.manager.itemError( url );\n\t\t\t\t\tthrow err;\n\n\t\t\t\t}\n\n\t\t\t\tdelete loading[ url ];\n\n\t\t\t\tfor ( let i = 0, il = callbacks.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\t\tif ( callback.onError ) callback.onError( err );\n\n\t\t\t\t}\n\n\t\t\t\tthis.manager.itemError( url );\n\n\t\t\t} )\n\t\t\t.finally( () => {\n\n\t\t\t\tthis.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\tthis.manager.itemStart( url );\n\n\t}\n\n\t/**\n\t * Sets the expected response type.\n\t *\n\t * @param {('arraybuffer'|'blob'|'document'|'json'|'')} value - The response type.\n\t * @return {FileLoader} A reference to this file loader.\n\t */\n\tsetResponseType( value ) {\n\n\t\tthis.responseType = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the expected mime type of the loaded file.\n\t *\n\t * @param {string} value - The mime type.\n\t * @return {FileLoader} A reference to this file loader.\n\t */\n\tsetMimeType( value ) {\n\n\t\tthis.mimeType = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Aborts ongoing fetch requests.\n\t *\n\t * @return {FileLoader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\tthis._abortController.abort();\n\t\tthis._abortController = new AbortController();\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Class for loading animation clips in the JSON format. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.AnimationLoader();\n * const animations = await loader.loadAsync( 'animations/animation.js' );\n * ```\n *\n * @augments Loader\n */\nclass AnimationLoader extends Loader {\n\n\t/**\n\t * Constructs a new animation loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded animations as an array\n\t * holding instances of {@link AnimationClip} to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Array<AnimationClip>)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns an array of animation clips.\n\t *\n\t * @param {Object} json - The serialized animation clips.\n\t * @return {Array<AnimationClip>} The parsed animation clips.\n\t */\n\tparse( json ) {\n\n\t\tconst animations = [];\n\n\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\tconst clip = AnimationClip.parse( json[ i ] );\n\n\t\t\tanimations.push( clip );\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n}\n\n/**\n * Abstract base class for loading compressed texture formats S3TC, ASTC or ETC.\n * Textures are internally loaded via {@link FileLoader}.\n *\n * Derived classes have to implement the `parse()` method which holds the parsing\n * for the respective format.\n *\n * @abstract\n * @augments Loader\n */\nclass CompressedTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new compressed texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded compressed texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(CompressedTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {CompressedTexture} The compressed texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst images = [];\n\n\t\tconst texture = new CompressedTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( url[ i ], function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\timages[ i ] = {\n\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t};\n\n\t\t\t\tloaded += 1;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\tif ( texDatas.mipmapCount === 1 ) texture.minFilter = LinearFilter;\n\n\t\t\t\t\ttexture.image = images;\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tif ( Array.isArray( url ) ) {\n\n\t\t\tfor ( let i = 0, il = url.length; i < il; ++ i ) {\n\n\t\t\t\tloadTexture( i );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// compressed cubemap texture stored in a single DDS file\n\n\t\t\tloader.load( url, function ( buffer ) {\n\n\t\t\t\tconst texDatas = scope.parse( buffer, true );\n\n\t\t\t\tif ( texDatas.isCubemap ) {\n\n\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\tfor ( let f = 0; f < faces; f ++ ) {\n\n\t\t\t\t\t\timages[ f ] = { mipmaps: [] };\n\n\t\t\t\t\t\tfor ( let i = 0; i < texDatas.mipmapCount; i ++ ) {\n\n\t\t\t\t\t\t\timages[ f ].mipmaps.push( texDatas.mipmaps[ f * texDatas.mipmapCount + i ] );\n\t\t\t\t\t\t\timages[ f ].format = texDatas.format;\n\t\t\t\t\t\t\timages[ f ].width = texDatas.width;\n\t\t\t\t\t\t\timages[ f ].height = texDatas.height;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.image = images;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\n\t\t\t\t}\n\n\t\t\t\tif ( texDatas.mipmapCount === 1 ) {\n\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t\t}\n\n\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\nconst _loading = new WeakMap();\n\n/**\n * A loader for loading images. The class loads images with the HTML `Image` API.\n *\n * ```js\n * const loader = new THREE.ImageLoader();\n * const image = await loader.loadAsync( 'image.png' );\n * ```\n * Please note that `ImageLoader` has dropped support for progress\n * events in `r84`. For an `ImageLoader` that supports progress events, see\n * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639}.\n *\n * @augments Loader\n */\nclass ImageLoader extends Loader {\n\n\t/**\n\t * Constructs a new image loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded image\n\t * to the `onLoad()` callback. The method also returns a new `Image` object which can\n\t * directly be used for texture creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Image)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {Image} The image.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( `image:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tif ( cached.complete === true ) {\n\n\t\t\t\tscope.manager.itemStart( url );\n\n\t\t\t\tsetTimeout( function () {\n\n\t\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t}, 0 );\n\n\t\t\t} else {\n\n\t\t\t\tlet arr = _loading.get( cached );\n\n\t\t\t\tif ( arr === undefined ) {\n\n\t\t\t\t\tarr = [];\n\t\t\t\t\t_loading.set( cached, arr );\n\n\t\t\t\t}\n\n\t\t\t\tarr.push( { onLoad, onError } );\n\n\t\t\t}\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst image = createElementNS( 'img' );\n\n\t\tfunction onImageLoad() {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onLoad ) onLoad( this );\n\n\t\t\t//\n\n\t\t\tconst callbacks = _loading.get( this ) || [];\n\n\t\t\tfor ( let i = 0; i < callbacks.length; i ++ ) {\n\n\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\tif ( callback.onLoad ) callback.onLoad( this );\n\n\t\t\t}\n\n\t\t\t_loading.delete( this );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction onImageError( event ) {\n\n\t\t\tremoveEventListeners();\n\n\t\t\tif ( onError ) onError( event );\n\n\t\t\tCache.remove( `image:${url}` );\n\n\t\t\t//\n\n\t\t\tconst callbacks = _loading.get( this ) || [];\n\n\t\t\tfor ( let i = 0; i < callbacks.length; i ++ ) {\n\n\t\t\t\tconst callback = callbacks[ i ];\n\t\t\t\tif ( callback.onError ) callback.onError( event );\n\n\t\t\t}\n\n\t\t\t_loading.delete( this );\n\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t}\n\n\t\tfunction removeEventListeners() {\n\n\t\t\timage.removeEventListener( 'load', onImageLoad, false );\n\t\t\timage.removeEventListener( 'error', onImageError, false );\n\n\t\t}\n\n\t\timage.addEventListener( 'load', onImageLoad, false );\n\t\timage.addEventListener( 'error', onImageError, false );\n\n\t\tif ( url.slice( 0, 5 ) !== 'data:' ) {\n\n\t\t\tif ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;\n\n\t\t}\n\n\t\tCache.add( `image:${url}`, image );\n\t\tscope.manager.itemStart( url );\n\n\t\timage.src = url;\n\n\t\treturn image;\n\n\t}\n\n}\n\n/**\n * Class for loading cube textures. Images are internally loaded via {@link ImageLoader}.\n *\n * The loader returns an instance of {@link CubeTexture} and expects the cube map to\n * be defined as six separate images representing the sides of a cube. Other cube map definitions\n * like vertical and horizontal cross, column and row layouts are not supported.\n *\n * Note that, by convention, cube maps are specified in a coordinate system\n * in which positive-x is to the right when looking up the positive-z axis --\n * in other words, using a left-handed coordinate system. Since three.js uses\n * a right-handed coordinate system, environment maps used in three.js will\n * have pos-x and neg-x swapped.\n *\n * The loaded cube texture is in sRGB color space. Meaning {@link Texture#colorSpace}\n * is set to `SRGBColorSpace` by default.\n *\n * ```js\n * const loader = new THREE.CubeTextureLoader().setPath( 'textures/cubeMaps/' );\n * const cubeTexture = await loader.loadAsync( [\n * \t'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'\n * ] );\n * scene.background = cubeTexture;\n * ```\n *\n * @augments Loader\n */\nclass CubeTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new cube texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the fully loaded cube texture\n\t * to the `onLoad()` callback. The method also returns a new cube texture object which can\n\t * directly be used for material creation. If you do it this way, the cube texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {Array<string>} urls - Array of 6 URLs to images, one for each side of the\n\t * cube texture. The urls should be specified in the following order: pos-x,\n\t * neg-x, pos-y, neg-y, pos-z, neg-z. An array of data URIs are allowed as well.\n\t * @param {function(CubeTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {CubeTexture} The cube texture.\n\t */\n\tload( urls, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new CubeTexture();\n\t\ttexture.colorSpace = SRGBColorSpace;\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tlet loaded = 0;\n\n\t\tfunction loadTexture( i ) {\n\n\t\t\tloader.load( urls[ i ], function ( image ) {\n\n\t\t\t\ttexture.images[ i ] = image;\n\n\t\t\t\tloaded ++;\n\n\t\t\t\tif ( loaded === 6 ) {\n\n\t\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\t\tif ( onLoad ) onLoad( texture );\n\n\t\t\t\t}\n\n\t\t\t}, undefined, onError );\n\n\t\t}\n\n\t\tfor ( let i = 0; i < urls.length; ++ i ) {\n\n\t\t\tloadTexture( i );\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract base class for loading binary texture formats RGBE, EXR or TGA.\n * Textures are internally loaded via {@link FileLoader}.\n *\n * Derived classes have to implement the `parse()` method which holds the parsing\n * for the respective format.\n *\n * @abstract\n * @augments Loader\n */\nclass DataTextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new data texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded data texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(DataTexture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {DataTexture} The data texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst texture = new DataTexture();\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setPath( this.path );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\tlet texData;\n\n\t\t\ttry {\n\n\t\t\t\ttexData = scope.parse( buffer );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) {\n\n\t\t\t\t\tonError( error );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( error );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( texData.image !== undefined ) {\n\n\t\t\t\ttexture.image = texData.image;\n\n\t\t\t} else if ( texData.data !== undefined ) {\n\n\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\ttexture.image.data = texData.data;\n\n\t\t\t}\n\n\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\n\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\n\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\tif ( texData.colorSpace !== undefined ) {\n\n\t\t\t\ttexture.colorSpace = texData.colorSpace;\n\n\t\t\t}\n\n\t\t\tif ( texData.flipY !== undefined ) {\n\n\t\t\t\ttexture.flipY = texData.flipY;\n\n\t\t\t}\n\n\t\t\tif ( texData.format !== undefined ) {\n\n\t\t\t\ttexture.format = texData.format;\n\n\t\t\t}\n\n\t\t\tif ( texData.type !== undefined ) {\n\n\t\t\t\ttexture.type = texData.type;\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmaps !== undefined ) {\n\n\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\n\t\t\t}\n\n\t\t\tif ( texData.mipmapCount === 1 ) {\n\n\t\t\t\ttexture.minFilter = LinearFilter;\n\n\t\t\t}\n\n\t\t\tif ( texData.generateMipmaps !== undefined ) {\n\n\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad ) onLoad( texture, texData );\n\n\t\t}, onProgress, onError );\n\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Class for loading textures. Images are internally\n * loaded via {@link ImageLoader}.\n *\n * ```js\n * const loader = new THREE.TextureLoader();\n * const texture = await loader.loadAsync( 'textures/land_ocean_ice_cloud_2048.jpg' );\n *\n * const material = new THREE.MeshBasicMaterial( { map:texture } );\n * ```\n * Please note that `TextureLoader` has dropped support for progress\n * events in `r84`. For a `TextureLoader` that supports progress events, see\n * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145}.\n *\n * @augments Loader\n */\nclass TextureLoader extends Loader {\n\n\t/**\n\t * Constructs a new texture loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the fully loaded texture\n\t * to the `onLoad()` callback. The method also returns a new texture object which can\n\t * directly be used for material creation. If you do it this way, the texture\n\t * may pop up in your scene once the respective loading process is finished.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Texture)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {Texture} The texture.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst texture = new Texture();\n\n\t\tconst loader = new ImageLoader( this.manager );\n\t\tloader.setCrossOrigin( this.crossOrigin );\n\t\tloader.setPath( this.path );\n\n\t\tloader.load( url, function ( image ) {\n\n\t\t\ttexture.image = image;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\tif ( onLoad !== undefined ) {\n\n\t\t\t\tonLoad( texture );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\treturn texture;\n\n\t}\n\n}\n\n/**\n * Abstract base class for lights - all other light types inherit the\n * properties and methods described here.\n *\n * @abstract\n * @augments Object3D\n */\nclass Light extends Object3D {\n\n\t/**\n\t * Constructs a new light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity = 1 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLight = true;\n\n\t\tthis.type = 'Light';\n\n\t\t/**\n\t\t * The light's color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color( color );\n\n\t\t/**\n\t\t * The light's intensity.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.intensity = intensity;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\t// Empty here in base class; some subclasses override.\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.color.copy( source.color );\n\t\tthis.intensity = source.intensity;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.color = this.color.getHex();\n\t\tdata.object.intensity = this.intensity;\n\n\t\tif ( this.groundColor !== undefined ) data.object.groundColor = this.groundColor.getHex();\n\n\t\tif ( this.distance !== undefined ) data.object.distance = this.distance;\n\t\tif ( this.angle !== undefined ) data.object.angle = this.angle;\n\t\tif ( this.decay !== undefined ) data.object.decay = this.decay;\n\t\tif ( this.penumbra !== undefined ) data.object.penumbra = this.penumbra;\n\n\t\tif ( this.shadow !== undefined ) data.object.shadow = this.shadow.toJSON();\n\t\tif ( this.target !== undefined ) data.object.target = this.target.uuid;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * A light source positioned directly above the scene, with color fading from\n * the sky color to the ground color.\n *\n * This light cannot be used to cast shadows.\n *\n * ```js\n * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass HemisphereLight extends Light {\n\n\t/**\n\t * Constructs a new hemisphere light.\n\t *\n\t * @param {(number|Color|string)} [skyColor=0xffffff] - The light's sky color.\n\t * @param {(number|Color|string)} [groundColor=0xffffff] - The light's ground color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( skyColor, groundColor, intensity ) {\n\n\t\tsuper( skyColor, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isHemisphereLight = true;\n\n\t\tthis.type = 'HemisphereLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The light's ground color.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.groundColor = new Color( groundColor );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.groundColor.copy( source.groundColor );\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld$1 = /*@__PURE__*/ new Vector3();\nconst _lookTarget$1 = /*@__PURE__*/ new Vector3();\n\n/**\n * Abstract base class for light shadow classes. These classes\n * represent the shadow configuration for different light types.\n *\n * @abstract\n */\nclass LightShadow {\n\n\t/**\n\t * Constructs a new light shadow.\n\t *\n\t * @param {Camera} camera - The light's view of the world.\n\t */\n\tconstructor( camera ) {\n\n\t\t/**\n\t\t * The light's view of the world.\n\t\t *\n\t\t * @type {Camera}\n\t\t */\n\t\tthis.camera = camera;\n\n\t\t/**\n\t\t * The intensity of the shadow. The default is `1`.\n\t\t * Valid values are in the range `[0, 1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.intensity = 1;\n\n\t\t/**\n\t\t * Shadow map bias, how much to add or subtract from the normalized depth\n\t\t * when deciding whether a surface is in shadow.\n\t\t *\n\t\t * The default is `0`. Very tiny adjustments here (in the order of `0.0001`)\n\t\t * may help reduce artifacts in shadows.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.bias = 0;\n\n\t\t/**\n\t\t * Defines how much the position used to query the shadow map is offset along\n\t\t * the object normal. The default is `0`. Increasing this value can be used to\n\t\t * reduce shadow acne especially in large scenes where light shines onto\n\t\t * geometry at a shallow angle. The cost is that shadows may appear distorted.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.normalBias = 0;\n\n\t\t/**\n\t\t * Setting this to values greater than 1 will blur the edges of the shadow.\n\t\t * High values will cause unwanted banding effects in the shadows - a greater\n\t\t * map size will allow for a higher value to be used here before these effects\n\t\t * become visible.\n\t\t *\n\t\t * The property has no effect when the shadow map type is `PCFSoftShadowMap` and\n\t\t * and it is recommended to increase softness by decreasing the shadow map size instead.\n\t\t *\n\t\t * The property has no effect when the shadow map type is `BasicShadowMap`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = 1;\n\n\t\t/**\n\t\t * The amount of samples to use when blurring a VSM shadow map.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 8\n\t\t */\n\t\tthis.blurSamples = 8;\n\n\t\t/**\n\t\t * Defines the width and height of the shadow map. Higher values give better quality\n\t\t * shadows at the cost of computation time. Values must be powers of two.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (512,512)\n\t\t */\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\t/**\n\t\t * The type of shadow texture. The default is `UnsignedByteType`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default UnsignedByteType\n\t\t */\n\t\tthis.mapType = UnsignedByteType;\n\n\t\t/**\n\t\t * The depth map generated using the internal camera; a location beyond a\n\t\t * pixel's depth is in shadow. Computed internally during rendering.\n\t\t *\n\t\t * @type {?RenderTarget}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The distribution map generated using the internal camera; an occlusion is\n\t\t * calculated based on the distribution of depths. Computed internally during\n\t\t * rendering.\n\t\t *\n\t\t * @type {?RenderTarget}\n\t\t * @default null\n\t\t */\n\t\tthis.mapPass = null;\n\n\t\t/**\n\t\t * Model to shadow camera space, to compute location and depth in shadow map.\n\t\t * This is computed internally during rendering.\n\t\t *\n\t\t * @type {Matrix4}\n\t\t */\n\t\tthis.matrix = new Matrix4();\n\n\t\t/**\n\t\t * Enables automatic updates of the light's shadow. If you do not require dynamic\n\t\t * lighting / shadows, you may set this to `false`.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoUpdate = true;\n\n\t\t/**\n\t\t * When set to `true`, shadow maps will be updated in the next `render` call.\n\t\t * If you have set {@link LightShadow#autoUpdate} to `false`, you will need to\n\t\t * set this property to `true` and then make a render call to update the light's shadow.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\t/**\n\t * Used internally by the renderer to get the number of viewports that need\n\t * to be rendered for this shadow.\n\t *\n\t * @return {number} The viewport count.\n\t */\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\t/**\n\t * Gets the shadow cameras frustum. Used internally by the renderer to cull objects.\n\t *\n\t * @return {Frustum} The shadow camera frustum.\n\t */\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\t/**\n\t * Update the matrices for the camera and shadow, used internally by the renderer.\n\t *\n\t * @param {Light} light - The light for which the shadow is being rendered.\n\t */\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld$1.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld$1 );\n\n\t\t_lookTarget$1.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget$1 );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix$1.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix$1, shadowCamera.coordinateSystem, shadowCamera.reversedDepth );\n\n\t\tif ( shadowCamera.reversedDepth ) {\n\n\t\t\tshadowMatrix.set(\n\t\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t0.0, 0.0, 1.0, 0.0,\n\t\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tshadowMatrix.set(\n\t\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t\t);\n\n\t\t}\n\n\t\tshadowMatrix.multiply( _projScreenMatrix$1 );\n\n\t}\n\n\t/**\n\t * Returns a viewport definition for the given viewport index.\n\t *\n\t * @param {number} viewportIndex - The viewport index.\n\t * @return {Vector4} The viewport.\n\t */\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\t/**\n\t * Returns the frame extends.\n\t *\n\t * @return {Vector2} The frame extends.\n\t */\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Copies the values of the given light shadow instance to this instance.\n\t *\n\t * @param {LightShadow} source - The light shadow to copy.\n\t * @return {LightShadow} A reference to this light shadow instance.\n\t */\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.intensity = source.intensity;\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.autoUpdate = source.autoUpdate;\n\t\tthis.needsUpdate = source.needsUpdate;\n\t\tthis.normalBias = source.normalBias;\n\t\tthis.blurSamples = source.blurSamples;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new light shadow instance with copied values from this instance.\n\t *\n\t * @return {LightShadow} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Serializes the light shadow into JSON.\n\t *\n\t * @return {Object} A JSON object representing the serialized light shadow.\n\t * @see {@link ObjectLoader#parse}\n\t */\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.intensity !== 1 ) object.intensity = this.intensity;\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\n/**\n * Represents the shadow configuration of directional lights.\n *\n * @augments LightShadow\n */\nclass SpotLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new spot light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 50, 1, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpotLightShadow = true;\n\n\t\t/**\n\t\t * Used to focus the shadow camera. The camera's field of view is set as a\n\t\t * percentage of the spotlight's field-of-view. Range is `[0, 1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.focus = 1;\n\n\t\t/**\n\t\t * Texture aspect ratio.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = 1;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst camera = this.camera;\n\n\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\tconst aspect = ( this.mapSize.width / this.mapSize.height ) * this.aspect;\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( fov !== camera.fov || aspect !== camera.aspect || far !== camera.far ) {\n\n\t\t\tcamera.fov = fov;\n\t\t\tcamera.aspect = aspect;\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\tsuper.updateMatrices( light );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.focus = source.focus;\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This light gets emitted from a single point in one direction, along a cone\n * that increases in size the further from the light it gets.\n *\n * This light can cast shadows - see the {@link SpotLightShadow} for details.\n *\n * ```js\n * // white spotlight shining from the side, modulated by a texture\n * const spotLight = new THREE.SpotLight( 0xffffff );\n * spotLight.position.set( 100, 1000, 100 );\n * spotLight.map = new THREE.TextureLoader().load( url );\n *\n * spotLight.castShadow = true;\n * spotLight.shadow.mapSize.width = 1024;\n * spotLight.shadow.mapSize.height = 1024;\n * spotLight.shadow.camera.near = 500;\n * spotLight.shadow.camera.far = 4000;\n * spotLight.shadow.camera.fov = 30;s\n * ```\n *\n * @augments Light\n */\nclass SpotLight extends Light {\n\n\t/**\n\t * Constructs a new spot light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n\t * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n\t * @param {number} [angle=Math.PI/3] - Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`.\n\t * @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`.\n\t * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n\t */\n\tconstructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSpotLight = true;\n\n\t\tthis.type = 'SpotLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The spot light points from its position to the\n\t\t * target's position.\n\t\t *\n\t\t * For the target's position to be changed to anything other\n\t\t * than the default, it must be added to the scene.\n\t\t *\n\t\t * It is also possible to set the target to be another 3D object\n\t\t * in the scene. The light will now track the target object.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.target = new Object3D();\n\n\t\t/**\n\t\t * Maximum range of the light. `0` means no limit.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.distance = distance;\n\n\t\t/**\n\t\t * Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Math.PI/3\n\t\t */\n\t\tthis.angle = angle;\n\n\t\t/**\n\t\t * Percent of the spotlight cone that is attenuated due to penumbra.\n\t\t * Value range is `[0,1]`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.penumbra = penumbra;\n\n\t\t/**\n\t\t * The amount the light dims along the distance of the light. In context of\n\t\t * physically-correct rendering the default value should not be changed.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2\n\t\t */\n\t\tthis.decay = decay;\n\n\t\t/**\n\t\t * A texture used to modulate the color of the light. The spot light\n\t\t * color is mixed with the RGB value of this texture, with a ratio\n\t\t * corresponding to its alpha value. The cookie-like masking effect is\n\t\t * reproduced using pixel values (0, 0, 0, 1-cookie_value).\n\t\t *\n\t\t * *Warning*: This property is disabled if {@link Object3D#castShadow} is set to `false`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {SpotLightShadow}\n\t\t */\n\t\tthis.shadow = new SpotLightShadow();\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t *  Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\treturn this.intensity * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / Math.PI;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.angle = source.angle;\n\t\tthis.penumbra = source.penumbra;\n\t\tthis.decay = source.decay;\n\n\t\tthis.target = source.target.clone();\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\n/**\n * Represents the shadow configuration of point lights.\n *\n * @augments LightShadow\n */\nclass PointLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new point light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointLightShadow = true;\n\n\t\tthis._frameExtents = new Vector2( 4, 2 );\n\n\t\tthis._viewportCount = 6;\n\n\t\tthis._viewports = [\n\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t//  xzXZ\n\t\t\t//   y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\n\t\t\t// positive X\n\t\t\tnew Vector4( 2, 1, 1, 1 ),\n\t\t\t// negative X\n\t\t\tnew Vector4( 0, 1, 1, 1 ),\n\t\t\t// positive Z\n\t\t\tnew Vector4( 3, 1, 1, 1 ),\n\t\t\t// negative Z\n\t\t\tnew Vector4( 1, 1, 1, 1 ),\n\t\t\t// positive Y\n\t\t\tnew Vector4( 3, 0, 1, 1 ),\n\t\t\t// negative Y\n\t\t\tnew Vector4( 1, 0, 1, 1 )\n\t\t];\n\n\t\tthis._cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( -1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, -1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, -1, 0 )\n\t\t];\n\n\t\tthis._cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, -1 )\n\t\t];\n\n\t}\n\n\t/**\n\t * Update the matrices for the camera and shadow, used internally by the renderer.\n\t *\n\t * @param {Light} light - The light for which the shadow is being rendered.\n\t * @param {number} [viewportIndex=0] - The viewport index.\n\t */\n\tupdateMatrices( light, viewportIndex = 0 ) {\n\n\t\tconst camera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( far !== camera.far ) {\n\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tcamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.copy( camera.position );\n\t\t_lookTarget.add( this._cubeDirections[ viewportIndex ] );\n\t\tcamera.up.copy( this._cubeUps[ viewportIndex ] );\n\t\tcamera.lookAt( _lookTarget );\n\t\tcamera.updateMatrixWorld();\n\n\t\tshadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix, camera.coordinateSystem, camera.reversedDepth );\n\n\t}\n\n}\n\n/**\n * A light that gets emitted from a single point in all directions. A common\n * use case for this is to replicate the light emitted from a bare\n * lightbulb.\n *\n * This light can cast shadows - see the {@link PointLightShadow} for details.\n *\n * ```js\n * const light = new THREE.PointLight( 0xff0000, 1, 100 );\n * light.position.set( 50, 50, 50 );\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass PointLight extends Light {\n\n\t/**\n\t * Constructs a new point light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd).\n\t * @param {number} [distance=0] - Maximum range of the light. `0` means no limit.\n\t * @param {number} [decay=2] - The amount the light dims along the distance of the light.\n\t */\n\tconstructor( color, intensity, distance = 0, decay = 2 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isPointLight = true;\n\n\t\tthis.type = 'PointLight';\n\n\t\t/**\n\t\t * When distance is zero, light will attenuate according to inverse-square\n\t\t * law to infinite distance. When distance is non-zero, light will attenuate\n\t\t * according to inverse-square law until near the distance cutoff, where it\n\t\t * will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not\n\t\t * physically correct.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.distance = distance;\n\n\t\t/**\n\t\t * The amount the light dims along the distance of the light. In context of\n\t\t * physically-correct rendering the default value should not be changed.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2\n\t\t */\n\t\tthis.decay = decay;\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {PointLightShadow}\n\t\t */\n\t\tthis.shadow = new PointLightShadow();\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t * Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\treturn this.intensity * 4 * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( 4 * Math.PI );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.distance = source.distance;\n\t\tthis.decay = source.decay;\n\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * Camera that uses [orthographic projection]{@link https://en.wikipedia.org/wiki/Orthographic_projection}.\n *\n * In this projection mode, an object's size in the rendered image stays\n * constant regardless of its distance from the camera. This can be useful\n * for rendering 2D scenes and UI elements, amongst other things.\n *\n * ```js\n * const camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );\n * scene.add( camera );\n * ```\n *\n * @augments Camera\n */\nclass OrthographicCamera extends Camera {\n\n\t/**\n\t * Constructs a new orthographic camera.\n\t *\n\t * @param {number} [left=-1] - The left plane of the camera's frustum.\n\t * @param {number} [right=1] - The right plane of the camera's frustum.\n\t * @param {number} [top=1] - The top plane of the camera's frustum.\n\t * @param {number} [bottom=-1] - The bottom plane of the camera's frustum.\n\t * @param {number} [near=0.1] - The camera's near plane.\n\t * @param {number} [far=2000] - The camera's far plane.\n\t */\n\tconstructor( left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isOrthographicCamera = true;\n\n\t\tthis.type = 'OrthographicCamera';\n\n\t\t/**\n\t\t * The zoom factor of the camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.zoom = 1;\n\n\t\t/**\n\t\t * Represents the frustum window specification. This property should not be edited\n\t\t * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}.\n\t\t *\n\t\t * @type {?Object}\n\t\t * @default null\n\t\t */\n\t\tthis.view = null;\n\n\t\t/**\n\t\t * The left plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.left = left;\n\n\t\t/**\n\t\t * The right plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.right = right;\n\n\t\t/**\n\t\t * The top plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.top = top;\n\n\t\t/**\n\t\t * The bottom plane of the camera's frustum.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.bottom = bottom;\n\n\t\t/**\n\t\t * The camera's near plane. The valid range is greater than `0`\n\t\t * and less than the current value of {@link OrthographicCamera#far}.\n\t\t *\n\t\t * Note that, unlike for the {@link PerspectiveCamera}, `0` is a\n\t\t * valid value for an orthographic camera's near plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.1\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * The camera's far plane. Must be greater than the\n\t\t * current value of {@link OrthographicCamera#near}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 2000\n\t\t */\n\t\tthis.far = far;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.left = source.left;\n\t\tthis.right = source.right;\n\t\tthis.top = source.top;\n\t\tthis.bottom = source.bottom;\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\n\t\tthis.zoom = source.zoom;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * @param {number} fullWidth - The full width of multiview setup.\n\t * @param {number} fullHeight - The full height of multiview setup.\n\t * @param {number} x - The horizontal offset of the subcamera.\n\t * @param {number} y - The vertical offset of the subcamera.\n\t * @param {number} width - The width of subcamera.\n\t * @param {number} height - The height of subcamera.\n\t * @see {@link PerspectiveCamera#setViewOffset}\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Removes the view offset from the projection matrix.\n\t */\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Updates the camera's projection matrix. Must be called after any change of\n\t * camera properties.\n\t */\n\tupdateProjectionMatrix() {\n\n\t\tconst dx = ( this.right - this.left ) / ( 2 * this.zoom );\n\t\tconst dy = ( this.top - this.bottom ) / ( 2 * this.zoom );\n\t\tconst cx = ( this.right + this.left ) / 2;\n\t\tconst cy = ( this.top + this.bottom ) / 2;\n\n\t\tlet left = cx - dx;\n\t\tlet right = cx + dx;\n\t\tlet top = cy + dy;\n\t\tlet bottom = cy - dy;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst scaleW = ( this.right - this.left ) / this.view.fullWidth / this.zoom;\n\t\t\tconst scaleH = ( this.top - this.bottom ) / this.view.fullHeight / this.zoom;\n\n\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\tright = left + scaleW * this.view.width;\n\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\tbottom = top - scaleH * this.view.height;\n\n\t\t}\n\n\t\tthis.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem, this.reversedDepth );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.zoom = this.zoom;\n\t\tdata.object.left = this.left;\n\t\tdata.object.right = this.right;\n\t\tdata.object.top = this.top;\n\t\tdata.object.bottom = this.bottom;\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Represents the shadow configuration of directional lights.\n *\n * @augments LightShadow\n */\nclass DirectionalLightShadow extends LightShadow {\n\n\t/**\n\t * Constructs a new directional light shadow.\n\t */\n\tconstructor() {\n\n\t\tsuper( new OrthographicCamera( -5, 5, 5, -5, 0.5, 500 ) );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDirectionalLightShadow = true;\n\n\t}\n\n}\n\n/**\n * A light that gets emitted in a specific direction. This light will behave\n * as though it is infinitely far away and the rays produced from it are all\n * parallel. The common use case for this is to simulate daylight; the sun is\n * far enough away that its position can be considered to be infinite, and\n * all light rays coming from it are parallel.\n *\n * A common point of confusion for directional lights is that setting the\n * rotation has no effect. This is because three.js's DirectionalLight is the\n * equivalent to what is often called a 'Target Direct Light' in other\n * applications.\n *\n * This means that its direction is calculated as pointing from the light's\n * {@link Object3D#position} to the {@link DirectionalLight#target} position\n * (as opposed to a 'Free Direct Light' that just has a rotation\n * component).\n *\n * This light can cast shadows - see the {@link DirectionalLightShadow} for details.\n *\n * ```js\n * // White directional light at half intensity shining from the top.\n * const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );\n * scene.add( directionalLight );\n * ```\n *\n * @augments Light\n */\nclass DirectionalLight extends Light {\n\n\t/**\n\t * Constructs a new directional light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isDirectionalLight = true;\n\n\t\tthis.type = 'DirectionalLight';\n\n\t\tthis.position.copy( Object3D.DEFAULT_UP );\n\t\tthis.updateMatrix();\n\n\t\t/**\n\t\t * The directional light points from its position to the\n\t\t * target's position.\n\t\t *\n\t\t * For the target's position to be changed to anything other\n\t\t * than the default, it must be added to the scene.\n\t\t *\n\t\t * It is also possible to set the target to be another 3D object\n\t\t * in the scene. The light will now track the target object.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.target = new Object3D();\n\n\t\t/**\n\t\t * This property holds the light's shadow configuration.\n\t\t *\n\t\t * @type {DirectionalLightShadow}\n\t\t */\n\t\tthis.shadow = new DirectionalLightShadow();\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shadow.dispose();\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.target = source.target.clone();\n\t\tthis.shadow = source.shadow.clone();\n\n\t\treturn this;\n\n\t}\n\n}\n\n/**\n * This light globally illuminates all objects in the scene equally.\n *\n * It cannot be used to cast shadows as it does not have a direction.\n *\n * ```js\n * const light = new THREE.AmbientLight( 0x404040 ); // soft white light\n * scene.add( light );\n * ```\n *\n * @augments Light\n */\nclass AmbientLight extends Light {\n\n\t/**\n\t * Constructs a new ambient light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( color, intensity ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isAmbientLight = true;\n\n\t\tthis.type = 'AmbientLight';\n\n\t}\n\n}\n\n/**\n * This class emits light uniformly across the face a rectangular plane.\n * This light type can be used to simulate light sources such as bright\n * windows or strip lighting.\n *\n * Important Notes:\n *\n * - There is no shadow support.\n * - Only PBR materials are supported.\n * - You have to include `RectAreaLightUniformsLib` (`WebGLRenderer`) or `RectAreaLightTexturesLib` (`WebGPURenderer`)\n * into your app and init the uniforms/textures.\n *\n * ```js\n * RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer\n * THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); //  only relevant for WebGPURenderer\n *\n * const intensity = 1; const width = 10; const height = 10;\n * const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height );\n * rectLight.position.set( 5, 5, 0 );\n * rectLight.lookAt( 0, 0, 0 );\n * scene.add( rectLight )\n * ```\n *\n * @augments Light\n */\nclass RectAreaLight extends Light {\n\n\t/**\n\t * Constructs a new area light.\n\t *\n\t * @param {(number|Color|string)} [color=0xffffff] - The light's color.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t * @param {number} [width=10] - The width of the light.\n\t * @param {number} [height=10] - The height of the light.\n\t */\n\tconstructor( color, intensity, width = 10, height = 10 ) {\n\n\t\tsuper( color, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRectAreaLight = true;\n\n\t\tthis.type = 'RectAreaLight';\n\n\t\t/**\n\t\t * The width of the light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.width = width;\n\n\t\t/**\n\t\t * The height of the light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 10\n\t\t */\n\t\tthis.height = height;\n\n\t}\n\n\t/**\n\t * The light's power. Power is the luminous power of the light measured in lumens (lm).\n\t * Changing the power will also change the light's intensity.\n\t *\n\t * @type {number}\n\t */\n\tget power() {\n\n\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\treturn this.intensity * this.width * this.height * Math.PI;\n\n\t}\n\n\tset power( power ) {\n\n\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\tthis.intensity = power / ( this.width * this.height * Math.PI );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.width = source.width;\n\t\tthis.height = source.height;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.width = this.width;\n\t\tdata.object.height = this.height;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Represents a third-order spherical harmonics (SH). Light probes use this class\n * to encode lighting information.\n *\n * - Primary reference: {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf}\n * - Secondary reference: {@link https://www.ppsloan.org/publications/StupidSH36.pdf}\n */\nclass SphericalHarmonics3 {\n\n\t/**\n\t * Constructs a new spherical harmonics.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSphericalHarmonics3 = true;\n\n\t\t/**\n\t\t * An array holding the (9) SH coefficients.\n\t\t *\n\t\t * @type {Array<Vector3>}\n\t\t */\n\t\tthis.coefficients = [];\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients.push( new Vector3() );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the given SH coefficients to this instance by copying\n\t * the values.\n\t *\n\t * @param {Array<Vector3>} coefficients - The SH coefficients.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tset( coefficients ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].copy( coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets all SH coefficients to `0`.\n\t *\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tzero() {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].set( 0, 0, 0 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the radiance in the direction of the given normal.\n\t *\n\t * @param {Vector3} normal - The normal vector (assumed to be unit length)\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The radiance.\n\t */\n\tgetAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.282095 );\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 0.488603 * y );\n\t\ttarget.addScaledVector( coeff[ 2 ], 0.488603 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 0.488603 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 1.092548 * ( x * y ) );\n\t\ttarget.addScaledVector( coeff[ 5 ], 1.092548 * ( y * z ) );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.315392 * ( 3.0 * z * z - 1.0 ) );\n\t\ttarget.addScaledVector( coeff[ 7 ], 1.092548 * ( x * z ) );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.546274 * ( x * x - y * y ) );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns the irradiance (radiance convolved with cosine lobe) in the\n\t * direction of the given normal.\n\t *\n\t * @param {Vector3} normal - The normal vector (assumed to be unit length)\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The irradiance.\n\t */\n\tgetIrradianceAt( normal, target ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\tconst coeff = this.coefficients;\n\n\t\t// band 0\n\t\ttarget.copy( coeff[ 0 ] ).multiplyScalar( 0.886227 ); // π * 0.282095\n\n\t\t// band 1\n\t\ttarget.addScaledVector( coeff[ 1 ], 2.0 * 0.511664 * y ); // ( 2 * π / 3 ) * 0.488603\n\t\ttarget.addScaledVector( coeff[ 2 ], 2.0 * 0.511664 * z );\n\t\ttarget.addScaledVector( coeff[ 3 ], 2.0 * 0.511664 * x );\n\n\t\t// band 2\n\t\ttarget.addScaledVector( coeff[ 4 ], 2.0 * 0.429043 * x * y ); // ( π / 4 ) * 1.092548\n\t\ttarget.addScaledVector( coeff[ 5 ], 2.0 * 0.429043 * y * z );\n\t\ttarget.addScaledVector( coeff[ 6 ], 0.743125 * z * z - 0.247708 ); // ( π / 4 ) * 0.315392 * 3\n\t\ttarget.addScaledVector( coeff[ 7 ], 2.0 * 0.429043 * x * z );\n\t\ttarget.addScaledVector( coeff[ 8 ], 0.429043 * ( x * x - y * y ) ); // ( π / 4 ) * 0.546274\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Adds the given SH to this instance.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to add.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tadd( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].add( sh.coefficients[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * A convenience method for performing {@link SphericalHarmonics3#add} and\n\t * {@link SphericalHarmonics3#scale} at once.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to add.\n\t * @param {number} s - The scale factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\taddScaledSH( sh, s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].addScaledVector( sh.coefficients[ i ], s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Scales this SH by the given scale factor.\n\t *\n\t * @param {number} s - The scale factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tscale( s ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].multiplyScalar( s );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linear interpolates between the given SH and this instance by the given\n\t * alpha factor.\n\t *\n\t * @param {SphericalHarmonics3} sh - The SH to interpolate with.\n\t * @param {number} alpha - The alpha factor.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tlerp( sh, alpha ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tthis.coefficients[ i ].lerp( sh.coefficients[ i ], alpha );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this spherical harmonics is equal with the given one.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics to test for equality.\n\t * @return {boolean} Whether this spherical harmonics is equal with the given one.\n\t */\n\tequals( sh ) {\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tif ( ! this.coefficients[ i ].equals( sh.coefficients[ i ] ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\t/**\n\t * Copies the values of the given spherical harmonics to this instance.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics to copy.\n\t * @return {SphericalHarmonics3} A reference to this spherical harmonics.\n\t */\n\tcopy( sh ) {\n\n\t\treturn this.set( sh.coefficients );\n\n\t}\n\n\t/**\n\t * Returns a new spherical harmonics with copied values from this instance.\n\t *\n\t * @return {SphericalHarmonics3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Sets the SH coefficients of this instance from the given array.\n\t *\n\t * @param {Array<number>} array - An array holding the SH coefficients.\n\t * @param {number} [offset=0] - The array offset where to start copying.\n\t * @return {SphericalHarmonics3} A clone of this instance.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].fromArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns an array with the SH coefficients, or copies them into the provided\n\t * array. The coefficients are represented as numbers.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array.\n\t * @param {number} [offset=0] - The array offset where to start copying.\n\t * @return {Array<number>} An array with flat SH coefficients.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tconst coefficients = this.coefficients;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) {\n\n\t\t\tcoefficients[ i ].toArray( array, offset + ( i * 3 ) );\n\n\t\t}\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Computes the SH basis for the given normal vector.\n\t *\n\t * @param {Vector3} normal - The normal.\n\t * @param {Array<number>} shBasis - The target array holding the SH basis.\n\t */\n\tstatic getBasisAt( normal, shBasis ) {\n\n\t\t// normal is assumed to be unit length\n\n\t\tconst x = normal.x, y = normal.y, z = normal.z;\n\n\t\t// band 0\n\t\tshBasis[ 0 ] = 0.282095;\n\n\t\t// band 1\n\t\tshBasis[ 1 ] = 0.488603 * y;\n\t\tshBasis[ 2 ] = 0.488603 * z;\n\t\tshBasis[ 3 ] = 0.488603 * x;\n\n\t\t// band 2\n\t\tshBasis[ 4 ] = 1.092548 * x * y;\n\t\tshBasis[ 5 ] = 1.092548 * y * z;\n\t\tshBasis[ 6 ] = 0.315392 * ( 3 * z * z - 1 );\n\t\tshBasis[ 7 ] = 1.092548 * x * z;\n\t\tshBasis[ 8 ] = 0.546274 * ( x * x - y * y );\n\n\t}\n\n}\n\n/**\n * Light probes are an alternative way of adding light to a 3D scene. Unlike\n * classical light sources (e.g. directional, point or spot lights), light\n * probes do not emit light. Instead they store information about light\n * passing through 3D space. During rendering, the light that hits a 3D\n * object is approximated by using the data from the light probe.\n *\n * Light probes are usually created from (radiance) environment maps. The\n * class {@link LightProbeGenerator} can be used to create light probes from\n * cube textures or render targets. However, light estimation data could also\n * be provided in other forms e.g. by WebXR. This enables the rendering of\n * augmented reality content that reacts to real world lighting.\n *\n * The current probe implementation in three.js supports so-called diffuse\n * light probes. This type of light probe is functionally equivalent to an\n * irradiance environment map.\n *\n * @augments Light\n */\nclass LightProbe extends Light {\n\n\t/**\n\t * Constructs a new light probe.\n\t *\n\t * @param {SphericalHarmonics3} sh - The spherical harmonics which represents encoded lighting information.\n\t * @param {number} [intensity=1] - The light's strength/intensity.\n\t */\n\tconstructor( sh = new SphericalHarmonics3(), intensity = 1 ) {\n\n\t\tsuper( undefined, intensity );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLightProbe = true;\n\n\t\t/**\n\t\t * A light probe uses spherical harmonics to encode lighting information.\n\t\t *\n\t\t * @type {SphericalHarmonics3}\n\t\t */\n\t\tthis.sh = sh;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.sh.copy( source.sh );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Deserializes the light prove from the given JSON.\n\t *\n\t * @param {Object} json - The JSON holding the serialized light probe.\n\t * @return {LightProbe} A reference to this light probe.\n\t */\n\tfromJSON( json ) {\n\n\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\t\tthis.sh.fromArray( json.sh );\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.sh = this.sh.toArray();\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Class for loading geometries. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.MaterialLoader();\n * const material = await loader.loadAsync( 'material.json' );\n * ```\n * This loader does not support node materials. Use {@link NodeMaterialLoader} instead.\n *\n * @augments Loader\n */\nclass MaterialLoader extends Loader {\n\n\t/**\n\t * Constructs a new material loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * A dictionary holding textures used by the material.\n\t\t *\n\t\t * @type {Object<string,Texture>}\n\t\t */\n\t\tthis.textures = {};\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded material to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Material)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns a material.\n\t *\n\t * @param {Object} json - The serialized material.\n\t * @return {Material} The parsed material.\n\t */\n\tparse( json ) {\n\n\t\tconst textures = this.textures;\n\n\t\tfunction getTexture( name ) {\n\n\t\t\tif ( textures[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.MaterialLoader: Undefined texture', name );\n\n\t\t\t}\n\n\t\t\treturn textures[ name ];\n\n\t\t}\n\n\t\tconst material = this.createMaterialFromType( json.type );\n\n\t\tif ( json.uuid !== undefined ) material.uuid = json.uuid;\n\t\tif ( json.name !== undefined ) material.name = json.name;\n\t\tif ( json.color !== undefined && material.color !== undefined ) material.color.setHex( json.color );\n\t\tif ( json.roughness !== undefined ) material.roughness = json.roughness;\n\t\tif ( json.metalness !== undefined ) material.metalness = json.metalness;\n\t\tif ( json.sheen !== undefined ) material.sheen = json.sheen;\n\t\tif ( json.sheenColor !== undefined ) material.sheenColor = new Color().setHex( json.sheenColor );\n\t\tif ( json.sheenRoughness !== undefined ) material.sheenRoughness = json.sheenRoughness;\n\t\tif ( json.emissive !== undefined && material.emissive !== undefined ) material.emissive.setHex( json.emissive );\n\t\tif ( json.specular !== undefined && material.specular !== undefined ) material.specular.setHex( json.specular );\n\t\tif ( json.specularIntensity !== undefined ) material.specularIntensity = json.specularIntensity;\n\t\tif ( json.specularColor !== undefined && material.specularColor !== undefined ) material.specularColor.setHex( json.specularColor );\n\t\tif ( json.shininess !== undefined ) material.shininess = json.shininess;\n\t\tif ( json.clearcoat !== undefined ) material.clearcoat = json.clearcoat;\n\t\tif ( json.clearcoatRoughness !== undefined ) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\tif ( json.dispersion !== undefined ) material.dispersion = json.dispersion;\n\t\tif ( json.iridescence !== undefined ) material.iridescence = json.iridescence;\n\t\tif ( json.iridescenceIOR !== undefined ) material.iridescenceIOR = json.iridescenceIOR;\n\t\tif ( json.iridescenceThicknessRange !== undefined ) material.iridescenceThicknessRange = json.iridescenceThicknessRange;\n\t\tif ( json.transmission !== undefined ) material.transmission = json.transmission;\n\t\tif ( json.thickness !== undefined ) material.thickness = json.thickness;\n\t\tif ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;\n\t\tif ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );\n\t\tif ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;\n\t\tif ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;\n\t\tif ( json.fog !== undefined ) material.fog = json.fog;\n\t\tif ( json.flatShading !== undefined ) material.flatShading = json.flatShading;\n\t\tif ( json.blending !== undefined ) material.blending = json.blending;\n\t\tif ( json.combine !== undefined ) material.combine = json.combine;\n\t\tif ( json.side !== undefined ) material.side = json.side;\n\t\tif ( json.shadowSide !== undefined ) material.shadowSide = json.shadowSide;\n\t\tif ( json.opacity !== undefined ) material.opacity = json.opacity;\n\t\tif ( json.transparent !== undefined ) material.transparent = json.transparent;\n\t\tif ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;\n\t\tif ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;\n\t\tif ( json.depthFunc !== undefined ) material.depthFunc = json.depthFunc;\n\t\tif ( json.depthTest !== undefined ) material.depthTest = json.depthTest;\n\t\tif ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;\n\t\tif ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;\n\t\tif ( json.blendSrc !== undefined ) material.blendSrc = json.blendSrc;\n\t\tif ( json.blendDst !== undefined ) material.blendDst = json.blendDst;\n\t\tif ( json.blendEquation !== undefined ) material.blendEquation = json.blendEquation;\n\t\tif ( json.blendSrcAlpha !== undefined ) material.blendSrcAlpha = json.blendSrcAlpha;\n\t\tif ( json.blendDstAlpha !== undefined ) material.blendDstAlpha = json.blendDstAlpha;\n\t\tif ( json.blendEquationAlpha !== undefined ) material.blendEquationAlpha = json.blendEquationAlpha;\n\t\tif ( json.blendColor !== undefined && material.blendColor !== undefined ) material.blendColor.setHex( json.blendColor );\n\t\tif ( json.blendAlpha !== undefined ) material.blendAlpha = json.blendAlpha;\n\t\tif ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask;\n\t\tif ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc;\n\t\tif ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef;\n\t\tif ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask;\n\t\tif ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail;\n\t\tif ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail;\n\t\tif ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass;\n\t\tif ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite;\n\n\t\tif ( json.wireframe !== undefined ) material.wireframe = json.wireframe;\n\t\tif ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\tif ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap;\n\t\tif ( json.wireframeLinejoin !== undefined ) material.wireframeLinejoin = json.wireframeLinejoin;\n\n\t\tif ( json.rotation !== undefined ) material.rotation = json.rotation;\n\n\t\tif ( json.linewidth !== undefined ) material.linewidth = json.linewidth;\n\t\tif ( json.dashSize !== undefined ) material.dashSize = json.dashSize;\n\t\tif ( json.gapSize !== undefined ) material.gapSize = json.gapSize;\n\t\tif ( json.scale !== undefined ) material.scale = json.scale;\n\n\t\tif ( json.polygonOffset !== undefined ) material.polygonOffset = json.polygonOffset;\n\t\tif ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\tif ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\n\t\tif ( json.dithering !== undefined ) material.dithering = json.dithering;\n\n\t\tif ( json.alphaToCoverage !== undefined ) material.alphaToCoverage = json.alphaToCoverage;\n\t\tif ( json.premultipliedAlpha !== undefined ) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\tif ( json.forceSinglePass !== undefined ) material.forceSinglePass = json.forceSinglePass;\n\n\t\tif ( json.visible !== undefined ) material.visible = json.visible;\n\n\t\tif ( json.toneMapped !== undefined ) material.toneMapped = json.toneMapped;\n\n\t\tif ( json.userData !== undefined ) material.userData = json.userData;\n\n\t\tif ( json.vertexColors !== undefined ) {\n\n\t\t\tif ( typeof json.vertexColors === 'number' ) {\n\n\t\t\t\tmaterial.vertexColors = ( json.vertexColors > 0 ) ? true : false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Shader Material\n\n\t\tif ( json.uniforms !== undefined ) {\n\n\t\t\tfor ( const name in json.uniforms ) {\n\n\t\t\t\tconst uniform = json.uniforms[ name ];\n\n\t\t\t\tmaterial.uniforms[ name ] = {};\n\n\t\t\t\tswitch ( uniform.type ) {\n\n\t\t\t\t\tcase 't':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = getTexture( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Color().setHex( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector2().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Vector4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix3().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = new Matrix4().fromArray( uniform.value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tmaterial.uniforms[ name ].value = uniform.value;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.defines !== undefined ) material.defines = json.defines;\n\t\tif ( json.vertexShader !== undefined ) material.vertexShader = json.vertexShader;\n\t\tif ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;\n\t\tif ( json.glslVersion !== undefined ) material.glslVersion = json.glslVersion;\n\n\t\tif ( json.extensions !== undefined ) {\n\n\t\t\tfor ( const key in json.extensions ) {\n\n\t\t\t\tmaterial.extensions[ key ] = json.extensions[ key ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json.lights !== undefined ) material.lights = json.lights;\n\t\tif ( json.clipping !== undefined ) material.clipping = json.clipping;\n\n\t\t// for PointsMaterial\n\n\t\tif ( json.size !== undefined ) material.size = json.size;\n\t\tif ( json.sizeAttenuation !== undefined ) material.sizeAttenuation = json.sizeAttenuation;\n\n\t\t// maps\n\n\t\tif ( json.map !== undefined ) material.map = getTexture( json.map );\n\t\tif ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );\n\n\t\tif ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );\n\n\t\tif ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );\n\t\tif ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale;\n\n\t\tif ( json.normalMap !== undefined ) material.normalMap = getTexture( json.normalMap );\n\t\tif ( json.normalMapType !== undefined ) material.normalMapType = json.normalMapType;\n\t\tif ( json.normalScale !== undefined ) {\n\n\t\t\tlet normalScale = json.normalScale;\n\n\t\t\tif ( Array.isArray( normalScale ) === false ) {\n\n\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\n\t\t\t\tnormalScale = [ normalScale, normalScale ];\n\n\t\t\t}\n\n\t\t\tmaterial.normalScale = new Vector2().fromArray( normalScale );\n\n\t\t}\n\n\t\tif ( json.displacementMap !== undefined ) material.displacementMap = getTexture( json.displacementMap );\n\t\tif ( json.displacementScale !== undefined ) material.displacementScale = json.displacementScale;\n\t\tif ( json.displacementBias !== undefined ) material.displacementBias = json.displacementBias;\n\n\t\tif ( json.roughnessMap !== undefined ) material.roughnessMap = getTexture( json.roughnessMap );\n\t\tif ( json.metalnessMap !== undefined ) material.metalnessMap = getTexture( json.metalnessMap );\n\n\t\tif ( json.emissiveMap !== undefined ) material.emissiveMap = getTexture( json.emissiveMap );\n\t\tif ( json.emissiveIntensity !== undefined ) material.emissiveIntensity = json.emissiveIntensity;\n\n\t\tif ( json.specularMap !== undefined ) material.specularMap = getTexture( json.specularMap );\n\t\tif ( json.specularIntensityMap !== undefined ) material.specularIntensityMap = getTexture( json.specularIntensityMap );\n\t\tif ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );\n\n\t\tif ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );\n\t\tif ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );\n\t\tif ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;\n\n\t\tif ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;\n\t\tif ( json.refractionRatio !== undefined ) material.refractionRatio = json.refractionRatio;\n\n\t\tif ( json.lightMap !== undefined ) material.lightMap = getTexture( json.lightMap );\n\t\tif ( json.lightMapIntensity !== undefined ) material.lightMapIntensity = json.lightMapIntensity;\n\n\t\tif ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap );\n\t\tif ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity;\n\n\t\tif ( json.gradientMap !== undefined ) material.gradientMap = getTexture( json.gradientMap );\n\n\t\tif ( json.clearcoatMap !== undefined ) material.clearcoatMap = getTexture( json.clearcoatMap );\n\t\tif ( json.clearcoatRoughnessMap !== undefined ) material.clearcoatRoughnessMap = getTexture( json.clearcoatRoughnessMap );\n\t\tif ( json.clearcoatNormalMap !== undefined ) material.clearcoatNormalMap = getTexture( json.clearcoatNormalMap );\n\t\tif ( json.clearcoatNormalScale !== undefined ) material.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );\n\n\t\tif ( json.iridescenceMap !== undefined ) material.iridescenceMap = getTexture( json.iridescenceMap );\n\t\tif ( json.iridescenceThicknessMap !== undefined ) material.iridescenceThicknessMap = getTexture( json.iridescenceThicknessMap );\n\n\t\tif ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );\n\t\tif ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );\n\n\t\tif ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );\n\n\t\tif ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );\n\t\tif ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );\n\n\t\treturn material;\n\n\t}\n\n\t/**\n\t * Textures are not embedded in the material JSON so they have\n\t * to be injected before the loading process starts.\n\t *\n\t * @param {Object} value - A dictionary holding textures for material properties.\n\t * @return {MaterialLoader} A reference to this material loader.\n\t */\n\tsetTextures( value ) {\n\n\t\tthis.textures = value;\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Creates a material for the given type.\n\t *\n\t * @param {string} type - The material type.\n\t * @return {Material} The new material.\n\t */\n\tcreateMaterialFromType( type ) {\n\n\t\treturn MaterialLoader.createMaterialFromType( type );\n\n\t}\n\n\t/**\n\t * Creates a material for the given type.\n\t *\n\t * @static\n\t * @param {string} type - The material type.\n\t * @return {Material} The new material.\n\t */\n\tstatic createMaterialFromType( type ) {\n\n\t\tconst materialLib = {\n\t\t\tShadowMaterial,\n\t\t\tSpriteMaterial,\n\t\t\tRawShaderMaterial,\n\t\t\tShaderMaterial,\n\t\t\tPointsMaterial,\n\t\t\tMeshPhysicalMaterial,\n\t\t\tMeshStandardMaterial,\n\t\t\tMeshPhongMaterial,\n\t\t\tMeshToonMaterial,\n\t\t\tMeshNormalMaterial,\n\t\t\tMeshLambertMaterial,\n\t\t\tMeshDepthMaterial,\n\t\t\tMeshDistanceMaterial,\n\t\t\tMeshBasicMaterial,\n\t\t\tMeshMatcapMaterial,\n\t\t\tLineDashedMaterial,\n\t\t\tLineBasicMaterial,\n\t\t\tMaterial\n\t\t};\n\n\t\treturn new materialLib[ type ]();\n\n\t}\n\n}\n\n/**\n * A class with loader utility functions.\n */\nclass LoaderUtils {\n\n\t/**\n\t * Extracts the base URL from the given URL.\n\t *\n\t * @param {string} url -The URL to extract the base URL from.\n\t * @return {string} The extracted base URL.\n\t */\n\tstatic extractUrlBase( url ) {\n\n\t\tconst index = url.lastIndexOf( '/' );\n\n\t\tif ( index === -1 ) return './';\n\n\t\treturn url.slice( 0, index + 1 );\n\n\t}\n\n\t/**\n\t * Resolves relative URLs against the given path. Absolute paths, data urls,\n\t * and blob URLs will be returned as is. Invalid URLs will return an empty\n\t * string.\n\t *\n\t * @param {string} url -The URL to resolve.\n\t * @param {string} path - The base path for relative URLs to be resolved against.\n\t * @return {string} The resolved URL.\n\t */\n\tstatic resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return '';\n\n\t\t// Host Relative URL\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t}\n\n\t\t// Absolute URL http://,https://,//\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url;\n\n\t\t// Data URI\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url;\n\n\t\t// Blob URL\n\t\tif ( /^blob:.*$/i.test( url ) ) return url;\n\n\t\t// Relative URL\n\t\treturn path + url;\n\n\t}\n\n}\n\n/**\n * An instanced version of a geometry.\n */\nclass InstancedBufferGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new instanced buffer geometry.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedBufferGeometry = true;\n\n\t\tthis.type = 'InstancedBufferGeometry';\n\n\t\t/**\n\t\t * The instance count.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.instanceCount = Infinity;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.instanceCount = source.instanceCount;\n\n\t\treturn this;\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst data = super.toJSON();\n\n\t\tdata.instanceCount = this.instanceCount;\n\n\t\tdata.isInstancedBufferGeometry = true;\n\n\t\treturn data;\n\n\t}\n\n}\n\n/**\n * Class for loading geometries. The files are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.BufferGeometryLoader();\n * const geometry = await loader.loadAsync( 'models/json/pressure.json' );\n *\n * const material = new THREE.MeshBasicMaterial( { color: 0xF5F5F5 } );\n * const object = new THREE.Mesh( geometry, material );\n * scene.add( object );\n * ```\n *\n * @augments Loader\n */\nclass BufferGeometryLoader extends Loader {\n\n\t/**\n\t * Constructs a new geometry loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded geometry to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(BufferGeometry)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( scope.manager );\n\t\tloader.setPath( scope.path );\n\t\tloader.setRequestHeader( scope.requestHeader );\n\t\tloader.setWithCredentials( scope.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\ttry {\n\n\t\t\t\tonLoad( scope.parse( JSON.parse( text ) ) );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Parses the given JSON object and returns a geometry.\n\t *\n\t * @param {Object} json - The serialized geometry.\n\t * @return {BufferGeometry} The parsed geometry.\n\t */\n\tparse( json ) {\n\n\t\tconst interleavedBufferMap = {};\n\t\tconst arrayBufferMap = {};\n\n\t\tfunction getInterleavedBuffer( json, uuid ) {\n\n\t\t\tif ( interleavedBufferMap[ uuid ] !== undefined ) return interleavedBufferMap[ uuid ];\n\n\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\tconst interleavedBuffer = interleavedBuffers[ uuid ];\n\n\t\t\tconst buffer = getArrayBuffer( json, interleavedBuffer.buffer );\n\n\t\t\tconst array = getTypedArray( interleavedBuffer.type, buffer );\n\t\t\tconst ib = new InterleavedBuffer( array, interleavedBuffer.stride );\n\t\t\tib.uuid = interleavedBuffer.uuid;\n\n\t\t\tinterleavedBufferMap[ uuid ] = ib;\n\n\t\t\treturn ib;\n\n\t\t}\n\n\t\tfunction getArrayBuffer( json, uuid ) {\n\n\t\t\tif ( arrayBufferMap[ uuid ] !== undefined ) return arrayBufferMap[ uuid ];\n\n\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\tconst arrayBuffer = arrayBuffers[ uuid ];\n\n\t\t\tconst ab = new Uint32Array( arrayBuffer ).buffer;\n\n\t\t\tarrayBufferMap[ uuid ] = ab;\n\n\t\t\treturn ab;\n\n\t\t}\n\n\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\n\t\tconst index = json.data.index;\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst typedArray = getTypedArray( index.type, index.array );\n\t\t\tgeometry.setIndex( new BufferAttribute( typedArray, 1 ) );\n\n\t\t}\n\n\t\tconst attributes = json.data.attributes;\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attribute = attributes[ key ];\n\t\t\tlet bufferAttribute;\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t} else {\n\n\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\tbufferAttribute = new bufferAttributeConstr( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t}\n\n\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\tif ( attribute.usage !== undefined ) bufferAttribute.setUsage( attribute.usage );\n\n\t\t\tgeometry.setAttribute( key, bufferAttribute );\n\n\t\t}\n\n\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\tif ( morphAttributes ) {\n\n\t\t\tfor ( const key in morphAttributes ) {\n\n\t\t\t\tconst attributeArray = morphAttributes[ key ];\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, il = attributeArray.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attribute = attributeArray[ i ];\n\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer( json.data, attribute.data );\n\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute( interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst typedArray = getTypedArray( attribute.type, attribute.array );\n\t\t\t\t\t\tbufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;\n\t\t\t\t\tarray.push( bufferAttribute );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.morphAttributes[ key ] = array;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\tgeometry.morphTargetsRelative = true;\n\n\t\t}\n\n\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\tif ( groups !== undefined ) {\n\n\t\t\tfor ( let i = 0, n = groups.length; i !== n; ++ i ) {\n\n\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\tgeometry.addGroup( group.start, group.count, group.materialIndex );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\tif ( boundingSphere !== undefined ) {\n\n\t\t\tgeometry.boundingSphere = new Sphere().fromJSON( boundingSphere );\n\n\t\t}\n\n\t\tif ( json.name ) geometry.name = json.name;\n\t\tif ( json.userData ) geometry.userData = json.userData;\n\n\t\treturn geometry;\n\n\t}\n\n}\n\n/**\n * A loader for loading a JSON resource in the [JSON Object/Scene format]{@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4}.\n * The files are internally loaded via {@link FileLoader}.\n *\n * ```js\n * const loader = new THREE.ObjectLoader();\n * const obj = await loader.loadAsync( 'models/json/example.json' );\n * scene.add( obj );\n *\n * // Alternatively, to parse a previously loaded JSON structure\n * const object = await loader.parseAsync( a_json_object );\n * scene.add( object );\n * ```\n *\n * @augments Loader\n */\nclass ObjectLoader extends Loader {\n\n\t/**\n\t * Constructs a new object loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded 3D object to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(Object3D)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tlet json = null;\n\n\t\t\ttry {\n\n\t\t\t\tjson = JSON.parse( text );\n\n\t\t\t} catch ( error ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( error );\n\n\t\t\t\tconsole.error( 'THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\t\tif ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\\'t load ' + url ) );\n\n\t\t\t\tconsole.error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tscope.parse( json, onLoad );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\t/**\n\t * Async version of {@link ObjectLoader#load}.\n\t *\n\t * @async\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @return {Promise<Object3D>} A Promise that resolves with the loaded 3D object.\n\t */\n\tasync loadAsync( url, onProgress ) {\n\n\t\tconst scope = this;\n\n\t\tconst path = ( this.path === '' ) ? LoaderUtils.extractUrlBase( url ) : this.path;\n\t\tthis.resourcePath = this.resourcePath || path;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\n\t\tconst text = await loader.loadAsync( url, onProgress );\n\n\t\tconst json = JSON.parse( text );\n\n\t\tconst metadata = json.metadata;\n\n\t\tif ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {\n\n\t\t\tthrow new Error( 'THREE.ObjectLoader: Can\\'t load ' + url );\n\n\t\t}\n\n\t\treturn await scope.parseAsync( json );\n\n\t}\n\n\t/**\n\t * Parses the given JSON. This is used internally by {@link ObjectLoader#load}\n\t * but can also be used directly to parse a previously loaded JSON structure.\n\t *\n\t * @param {Object} json - The serialized 3D object.\n\t * @param {onLoad} onLoad - Executed when all resources (e.g. textures) have been fully loaded.\n\t * @return {Object3D} The parsed 3D object.\n\t */\n\tparse( json, onLoad ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = this.parseImages( json.images, function () {\n\n\t\t\tif ( onLoad !== undefined ) onLoad( object );\n\n\t\t} );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\t//\n\n\t\tif ( onLoad !== undefined ) {\n\n\t\t\tlet hasImages = false;\n\n\t\t\tfor ( const uuid in images ) {\n\n\t\t\t\tif ( images[ uuid ].data instanceof HTMLImageElement ) {\n\n\t\t\t\t\thasImages = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( hasImages === false ) onLoad( object );\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\t/**\n\t * Async version of {@link ObjectLoader#parse}.\n\t *\n\t * @param {Object} json - The serialized 3D object.\n\t * @return {Promise<Object3D>} A Promise that resolves with the parsed 3D object.\n\t */\n\tasync parseAsync( json ) {\n\n\t\tconst animations = this.parseAnimations( json.animations );\n\t\tconst shapes = this.parseShapes( json.shapes );\n\t\tconst geometries = this.parseGeometries( json.geometries, shapes );\n\n\t\tconst images = await this.parseImagesAsync( json.images );\n\n\t\tconst textures = this.parseTextures( json.textures, images );\n\t\tconst materials = this.parseMaterials( json.materials, textures );\n\n\t\tconst object = this.parseObject( json.object, geometries, materials, textures, animations );\n\t\tconst skeletons = this.parseSkeletons( json.skeletons, object );\n\n\t\tthis.bindSkeletons( object, skeletons );\n\t\tthis.bindLightTargets( object );\n\n\t\treturn object;\n\n\t}\n\n\t// internals\n\n\tparseShapes( json ) {\n\n\t\tconst shapes = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst shape = new Shape().fromJSON( json[ i ] );\n\n\t\t\t\tshapes[ shape.uuid ] = shape;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n\tparseSkeletons( json, object ) {\n\n\t\tconst skeletons = {};\n\t\tconst bones = {};\n\n\t\t// generate bone lookup table\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isBone ) bones[ child.uuid ] = child;\n\n\t\t} );\n\n\t\t// create skeletons\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst skeleton = new Skeleton().fromJSON( json[ i ], bones );\n\n\t\t\t\tskeletons[ skeleton.uuid ] = skeleton;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn skeletons;\n\n\t}\n\n\tparseGeometries( json, shapes ) {\n\n\t\tconst geometries = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tlet geometry;\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tswitch ( data.type ) {\n\n\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\tcase 'InstancedBufferGeometry':\n\n\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse( data );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tif ( data.type in Geometries ) {\n\n\t\t\t\t\t\t\tgeometry = Geometries[ data.type ].fromJSON( data, shapes );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( `THREE.ObjectLoader: Unsupported geometry type \"${ data.type }\"` );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) geometry.name = data.name;\n\t\t\t\tif ( data.userData !== undefined ) geometry.userData = data.userData;\n\n\t\t\t\tgeometries[ data.uuid ] = geometry;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn geometries;\n\n\t}\n\n\tparseMaterials( json, textures ) {\n\n\t\tconst cache = {}; // MultiMaterial\n\t\tconst materials = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tconst loader = new MaterialLoader();\n\t\t\tloader.setTextures( textures );\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( cache[ data.uuid ] === undefined ) {\n\n\t\t\t\t\tcache[ data.uuid ] = loader.parse( data );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials[ data.uuid ] = cache[ data.uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn materials;\n\n\t}\n\n\tparseAnimations( json ) {\n\n\t\tconst animations = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0; i < json.length; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tconst clip = AnimationClip.parse( data );\n\n\t\t\t\tanimations[ clip.uuid ] = clip;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn animations;\n\n\t}\n\n\tparseImages( json, onLoad ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tfunction loadImage( url ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\treturn loader.load( url, function () {\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, undefined, function () {\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfunction deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn loadImage( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tconst manager = new LoadingManager( onLoad );\n\n\t\t\tloader = new ImageLoader( manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tasync parseImagesAsync( json ) {\n\n\t\tconst scope = this;\n\t\tconst images = {};\n\n\t\tlet loader;\n\n\t\tasync function deserializeImage( image ) {\n\n\t\t\tif ( typeof image === 'string' ) {\n\n\t\t\t\tconst url = image;\n\n\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test( url ) ? url : scope.resourcePath + url;\n\n\t\t\t\treturn await loader.loadAsync( path );\n\n\t\t\t} else {\n\n\t\t\t\tif ( image.data ) {\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdata: getTypedArray( image.type, image.data ),\n\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\theight: image.height\n\t\t\t\t\t};\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( json !== undefined && json.length > 0 ) {\n\n\t\t\tloader = new ImageLoader( this.manager );\n\t\t\tloader.setCrossOrigin( this.crossOrigin );\n\n\t\t\tfor ( let i = 0, il = json.length; i < il; i ++ ) {\n\n\t\t\t\tconst image = json[ i ];\n\t\t\t\tconst url = image.url;\n\n\t\t\t\tif ( Array.isArray( url ) ) {\n\n\t\t\t\t\t// load array of images e.g CubeTexture\n\n\t\t\t\t\tconst imageArray = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = url.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst currentUrl = url[ j ];\n\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage( currentUrl );\n\n\t\t\t\t\t\tif ( deserializedImage !== null ) {\n\n\t\t\t\t\t\t\tif ( deserializedImage instanceof HTMLImageElement ) {\n\n\t\t\t\t\t\t\t\timageArray.push( deserializedImage );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\n\t\t\t\t\t\t\t\timageArray.push( new DataTexture( deserializedImage.data, deserializedImage.width, deserializedImage.height ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\timages[ image.uuid ] = new Source( imageArray );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// load single image\n\n\t\t\t\t\tconst deserializedImage = await deserializeImage( image.url );\n\t\t\t\t\timages[ image.uuid ] = new Source( deserializedImage );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn images;\n\n\t}\n\n\tparseTextures( json, images ) {\n\n\t\tfunction parseConstant( value, type ) {\n\n\t\t\tif ( typeof value === 'number' ) return value;\n\n\t\t\tconsole.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );\n\n\t\t\treturn type[ value ];\n\n\t\t}\n\n\t\tconst textures = {};\n\n\t\tif ( json !== undefined ) {\n\n\t\t\tfor ( let i = 0, l = json.length; i < l; i ++ ) {\n\n\t\t\t\tconst data = json[ i ];\n\n\t\t\t\tif ( data.image === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No \"image\" specified for', data.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( images[ data.image ] === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined image', data.image );\n\n\t\t\t\t}\n\n\t\t\t\tconst source = images[ data.image ];\n\t\t\t\tconst image = source.data;\n\n\t\t\t\tlet texture;\n\n\t\t\t\tif ( Array.isArray( image ) ) {\n\n\t\t\t\t\ttexture = new CubeTexture();\n\n\t\t\t\t\tif ( image.length === 6 ) texture.needsUpdate = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( image && image.data ) {\n\n\t\t\t\t\t\ttexture = new DataTexture();\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttexture = new Texture();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( image ) texture.needsUpdate = true; // textures can have undefined image data\n\n\t\t\t\t}\n\n\t\t\t\ttexture.source = source;\n\n\t\t\t\ttexture.uuid = data.uuid;\n\n\t\t\t\tif ( data.name !== undefined ) texture.name = data.name;\n\n\t\t\t\tif ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping, TEXTURE_MAPPING );\n\t\t\t\tif ( data.channel !== undefined ) texture.channel = data.channel;\n\n\t\t\t\tif ( data.offset !== undefined ) texture.offset.fromArray( data.offset );\n\t\t\t\tif ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );\n\t\t\t\tif ( data.center !== undefined ) texture.center.fromArray( data.center );\n\t\t\t\tif ( data.rotation !== undefined ) texture.rotation = data.rotation;\n\n\t\t\t\tif ( data.wrap !== undefined ) {\n\n\t\t\t\t\ttexture.wrapS = parseConstant( data.wrap[ 0 ], TEXTURE_WRAPPING );\n\t\t\t\t\ttexture.wrapT = parseConstant( data.wrap[ 1 ], TEXTURE_WRAPPING );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.format !== undefined ) texture.format = data.format;\n\t\t\t\tif ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;\n\t\t\t\tif ( data.type !== undefined ) texture.type = data.type;\n\t\t\t\tif ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;\n\n\t\t\t\tif ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );\n\t\t\t\tif ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;\n\n\t\t\t\tif ( data.flipY !== undefined ) texture.flipY = data.flipY;\n\n\t\t\t\tif ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;\n\t\t\t\tif ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\tif ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\tif ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;\n\n\t\t\t\tif ( data.userData !== undefined ) texture.userData = data.userData;\n\n\t\t\t\ttextures[ data.uuid ] = texture;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn textures;\n\n\t}\n\n\tparseObject( data, geometries, materials, textures, animations ) {\n\n\t\tlet object;\n\n\t\tfunction getGeometry( name ) {\n\n\t\t\tif ( geometries[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined geometry', name );\n\n\t\t\t}\n\n\t\t\treturn geometries[ name ];\n\n\t\t}\n\n\t\tfunction getMaterial( name ) {\n\n\t\t\tif ( name === undefined ) return undefined;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor ( let i = 0, l = name.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst uuid = name[ i ];\n\n\t\t\t\t\tif ( materials[ uuid ] === undefined ) {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', uuid );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tarray.push( materials[ uuid ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn array;\n\n\t\t\t}\n\n\t\t\tif ( materials[ name ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined material', name );\n\n\t\t\t}\n\n\t\t\treturn materials[ name ];\n\n\t\t}\n\n\t\tfunction getTexture( uuid ) {\n\n\t\t\tif ( textures[ uuid ] === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.ObjectLoader: Undefined texture', uuid );\n\n\t\t\t}\n\n\t\t\treturn textures[ uuid ];\n\n\t\t}\n\n\t\tlet geometry, material;\n\n\t\tswitch ( data.type ) {\n\n\t\t\tcase 'Scene':\n\n\t\t\t\tobject = new Scene();\n\n\t\t\t\tif ( data.background !== undefined ) {\n\n\t\t\t\t\tif ( Number.isInteger( data.background ) ) {\n\n\t\t\t\t\t\tobject.background = new Color( data.background );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tobject.background = getTexture( data.background );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.environment !== undefined ) {\n\n\t\t\t\t\tobject.environment = getTexture( data.environment );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.fog !== undefined ) {\n\n\t\t\t\t\tif ( data.fog.type === 'Fog' ) {\n\n\t\t\t\t\t\tobject.fog = new Fog( data.fog.color, data.fog.near, data.fog.far );\n\n\t\t\t\t\t} else if ( data.fog.type === 'FogExp2' ) {\n\n\t\t\t\t\t\tobject.fog = new FogExp2( data.fog.color, data.fog.density );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( data.fog.name !== '' ) {\n\n\t\t\t\t\t\tobject.fog.name = data.fog.name;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;\n\t\t\t\tif ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;\n\t\t\t\tif ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );\n\n\t\t\t\tif ( data.environmentIntensity !== undefined ) object.environmentIntensity = data.environmentIntensity;\n\t\t\t\tif ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PerspectiveCamera':\n\n\t\t\t\tobject = new PerspectiveCamera( data.fov, data.aspect, data.near, data.far );\n\n\t\t\t\tif ( data.focus !== undefined ) object.focus = data.focus;\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.filmGauge !== undefined ) object.filmGauge = data.filmGauge;\n\t\t\t\tif ( data.filmOffset !== undefined ) object.filmOffset = data.filmOffset;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'OrthographicCamera':\n\n\t\t\t\tobject = new OrthographicCamera( data.left, data.right, data.top, data.bottom, data.near, data.far );\n\n\t\t\t\tif ( data.zoom !== undefined ) object.zoom = data.zoom;\n\t\t\t\tif ( data.view !== undefined ) object.view = Object.assign( {}, data.view );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'AmbientLight':\n\n\t\t\t\tobject = new AmbientLight( data.color, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'DirectionalLight':\n\n\t\t\t\tobject = new DirectionalLight( data.color, data.intensity );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointLight':\n\n\t\t\t\tobject = new PointLight( data.color, data.intensity, data.distance, data.decay );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'RectAreaLight':\n\n\t\t\t\tobject = new RectAreaLight( data.color, data.intensity, data.width, data.height );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SpotLight':\n\n\t\t\t\tobject = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );\n\t\t\t\tobject.target = data.target || '';\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'HemisphereLight':\n\n\t\t\t\tobject = new HemisphereLight( data.color, data.groundColor, data.intensity );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LightProbe':\n\n\t\t\t\tobject = new LightProbe().fromJSON( data );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'SkinnedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t \tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new SkinnedMesh( geometry, material );\n\n\t\t\t\tif ( data.bindMode !== undefined ) object.bindMode = data.bindMode;\n\t\t\t\tif ( data.bindMatrix !== undefined ) object.bindMatrix.fromArray( data.bindMatrix );\n\t\t\t\tif ( data.skeleton !== undefined ) object.skeleton = data.skeleton;\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Mesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new Mesh( geometry, material );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'InstancedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\t\t\t\tconst count = data.count;\n\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\tconst instanceColor = data.instanceColor;\n\n\t\t\t\tobject = new InstancedMesh( geometry, material, count );\n\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute( new Float32Array( instanceMatrix.array ), 16 );\n\t\t\t\tif ( instanceColor !== undefined ) object.instanceColor = new InstancedBufferAttribute( new Float32Array( instanceColor.array ), instanceColor.itemSize );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'BatchedMesh':\n\n\t\t\t\tgeometry = getGeometry( data.geometry );\n\t\t\t\tmaterial = getMaterial( data.material );\n\n\t\t\t\tobject = new BatchedMesh( data.maxInstanceCount, data.maxVertexCount, data.maxIndexCount, material );\n\t\t\t\tobject.geometry = geometry;\n\t\t\t\tobject.perObjectFrustumCulled = data.perObjectFrustumCulled;\n\t\t\t\tobject.sortObjects = data.sortObjects;\n\n\t\t\t\tobject._drawRanges = data.drawRanges;\n\t\t\t\tobject._reservedRanges = data.reservedRanges;\n\n\t\t\t\tobject._geometryInfo = data.geometryInfo.map( info => {\n\n\t\t\t\t\tlet box = null;\n\t\t\t\t\tlet sphere = null;\n\t\t\t\t\tif ( info.boundingBox !== undefined ) {\n\n\t\t\t\t\t\tbox = new Box3().fromJSON( info.boundingBox );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( info.boundingSphere !== undefined ) {\n\n\t\t\t\t\t\tsphere = new Sphere().fromJSON( info.boundingSphere );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...info,\n\t\t\t\t\t\tboundingBox: box,\n\t\t\t\t\t\tboundingSphere: sphere\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\t\t\t\tobject._instanceInfo = data.instanceInfo;\n\n\t\t\t\tobject._availableInstanceIds = data._availableInstanceIds;\n\t\t\t\tobject._availableGeometryIds = data._availableGeometryIds;\n\n\t\t\t\tobject._nextIndexStart = data.nextIndexStart;\n\t\t\t\tobject._nextVertexStart = data.nextVertexStart;\n\t\t\t\tobject._geometryCount = data.geometryCount;\n\n\t\t\t\tobject._maxInstanceCount = data.maxInstanceCount;\n\t\t\t\tobject._maxVertexCount = data.maxVertexCount;\n\t\t\t\tobject._maxIndexCount = data.maxIndexCount;\n\n\t\t\t\tobject._geometryInitialized = data.geometryInitialized;\n\n\t\t\t\tobject._matricesTexture = getTexture( data.matricesTexture.uuid );\n\n\t\t\t\tobject._indirectTexture = getTexture( data.indirectTexture.uuid );\n\n\t\t\t\tif ( data.colorsTexture !== undefined ) {\n\n\t\t\t\t\tobject._colorsTexture = getTexture( data.colorsTexture.uuid );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.boundingSphere !== undefined ) {\n\n\t\t\t\t\tobject.boundingSphere = new Sphere().fromJSON( data.boundingSphere );\n\n\t\t\t\t}\n\n\t\t\t\tif ( data.boundingBox !== undefined ) {\n\n\t\t\t\t\tobject.boundingBox = new Box3().fromJSON( data.boundingBox );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LOD':\n\n\t\t\t\tobject = new LOD();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Line':\n\n\t\t\t\tobject = new Line( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineLoop':\n\n\t\t\t\tobject = new LineLoop( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'LineSegments':\n\n\t\t\t\tobject = new LineSegments( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'PointCloud':\n\t\t\tcase 'Points':\n\n\t\t\t\tobject = new Points( getGeometry( data.geometry ), getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Sprite':\n\n\t\t\t\tobject = new Sprite( getMaterial( data.material ) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Group':\n\n\t\t\t\tobject = new Group();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'Bone':\n\n\t\t\t\tobject = new Bone();\n\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tobject = new Object3D();\n\n\t\t}\n\n\t\tobject.uuid = data.uuid;\n\n\t\tif ( data.name !== undefined ) object.name = data.name;\n\n\t\tif ( data.matrix !== undefined ) {\n\n\t\t\tobject.matrix.fromArray( data.matrix );\n\n\t\t\tif ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\tif ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );\n\n\t\t} else {\n\n\t\t\tif ( data.position !== undefined ) object.position.fromArray( data.position );\n\t\t\tif ( data.rotation !== undefined ) object.rotation.fromArray( data.rotation );\n\t\t\tif ( data.quaternion !== undefined ) object.quaternion.fromArray( data.quaternion );\n\t\t\tif ( data.scale !== undefined ) object.scale.fromArray( data.scale );\n\n\t\t}\n\n\t\tif ( data.up !== undefined ) object.up.fromArray( data.up );\n\n\t\tif ( data.castShadow !== undefined ) object.castShadow = data.castShadow;\n\t\tif ( data.receiveShadow !== undefined ) object.receiveShadow = data.receiveShadow;\n\n\t\tif ( data.shadow ) {\n\n\t\t\tif ( data.shadow.intensity !== undefined ) object.shadow.intensity = data.shadow.intensity;\n\t\t\tif ( data.shadow.bias !== undefined ) object.shadow.bias = data.shadow.bias;\n\t\t\tif ( data.shadow.normalBias !== undefined ) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\tif ( data.shadow.radius !== undefined ) object.shadow.radius = data.shadow.radius;\n\t\t\tif ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );\n\t\t\tif ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );\n\n\t\t}\n\n\t\tif ( data.visible !== undefined ) object.visible = data.visible;\n\t\tif ( data.frustumCulled !== undefined ) object.frustumCulled = data.frustumCulled;\n\t\tif ( data.renderOrder !== undefined ) object.renderOrder = data.renderOrder;\n\t\tif ( data.userData !== undefined ) object.userData = data.userData;\n\t\tif ( data.layers !== undefined ) object.layers.mask = data.layers;\n\n\t\tif ( data.children !== undefined ) {\n\n\t\t\tconst children = data.children;\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tobject.add( this.parseObject( children[ i ], geometries, materials, textures, animations ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.animations !== undefined ) {\n\n\t\t\tconst objectAnimations = data.animations;\n\n\t\t\tfor ( let i = 0; i < objectAnimations.length; i ++ ) {\n\n\t\t\t\tconst uuid = objectAnimations[ i ];\n\n\t\t\t\tobject.animations.push( animations[ uuid ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( data.type === 'LOD' ) {\n\n\t\t\tif ( data.autoUpdate !== undefined ) object.autoUpdate = data.autoUpdate;\n\n\t\t\tconst levels = data.levels;\n\n\t\t\tfor ( let l = 0; l < levels.length; l ++ ) {\n\n\t\t\t\tconst level = levels[ l ];\n\t\t\t\tconst child = object.getObjectByProperty( 'uuid', level.object );\n\n\t\t\t\tif ( child !== undefined ) {\n\n\t\t\t\t\tobject.addLevel( child, level.distance, level.hysteresis );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn object;\n\n\t}\n\n\tbindSkeletons( object, skeletons ) {\n\n\t\tif ( Object.keys( skeletons ).length === 0 ) return;\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isSkinnedMesh === true && child.skeleton !== undefined ) {\n\n\t\t\t\tconst skeleton = skeletons[ child.skeleton ];\n\n\t\t\t\tif ( skeleton === undefined ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.bind( skeleton, child.bindMatrix );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\tbindLightTargets( object ) {\n\n\t\tobject.traverse( function ( child ) {\n\n\t\t\tif ( child.isDirectionalLight || child.isSpotLight ) {\n\n\t\t\t\tconst uuid = child.target;\n\n\t\t\t\tconst target = object.getObjectByProperty( 'uuid', uuid );\n\n\t\t\t\tif ( target !== undefined ) {\n\n\t\t\t\t\tchild.target = target;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tchild.target = new Object3D();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n}\n\nconst TEXTURE_MAPPING = {\n\tUVMapping: UVMapping,\n\tCubeReflectionMapping: CubeReflectionMapping,\n\tCubeRefractionMapping: CubeRefractionMapping,\n\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\tCubeUVReflectionMapping: CubeUVReflectionMapping\n};\n\nconst TEXTURE_WRAPPING = {\n\tRepeatWrapping: RepeatWrapping,\n\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\tMirroredRepeatWrapping: MirroredRepeatWrapping\n};\n\nconst TEXTURE_FILTER = {\n\tNearestFilter: NearestFilter,\n\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\tLinearFilter: LinearFilter,\n\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n};\n\nconst _errorMap = new WeakMap();\n\n/**\n * A loader for loading images as an [ImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap}.\n * An `ImageBitmap` provides an asynchronous and resource efficient pathway to prepare\n * textures for rendering.\n *\n * Note that {@link Texture#flipY} and {@link Texture#premultiplyAlpha} are ignored with image bitmaps.\n * They needs these configuration on bitmap creation unlike regular images need them on uploading to GPU.\n *\n * You need to set the equivalent options via {@link ImageBitmapLoader#setOptions} instead.\n *\n * Also note that unlike {@link FileLoader}, this loader avoids multiple concurrent requests to the same URL only if `Cache` is enabled.\n *\n * ```js\n * const loader = new THREE.ImageBitmapLoader();\n * loader.setOptions( { imageOrientation: 'flipY' } ); // set options if needed\n * const imageBitmap = await loader.loadAsync( 'image.png' );\n *\n * const texture = new THREE.Texture( imageBitmap );\n * texture.needsUpdate = true;\n * ```\n *\n * @augments Loader\n */\nclass ImageBitmapLoader extends Loader {\n\n\t/**\n\t * Constructs a new image bitmap loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isImageBitmapLoader = true;\n\n\t\tif ( typeof createImageBitmap === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );\n\n\t\t}\n\n\t\tif ( typeof fetch === 'undefined' ) {\n\n\t\t\tconsole.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );\n\n\t\t}\n\n\t\t/**\n\t\t * Represents the loader options.\n\t\t *\n\t\t * @type {Object}\n\t\t * @default {premultiplyAlpha:'none'}\n\t\t */\n\t\tthis.options = { premultiplyAlpha: 'none' };\n\n\t\t/**\n\t\t * Used for aborting requests.\n\t\t *\n\t\t * @private\n\t\t * @type {AbortController}\n\t\t */\n\t\tthis._abortController = new AbortController();\n\n\t}\n\n\t/**\n\t * Sets the given loader options. The structure of the object must match the `options` parameter of\n\t * [createImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap}.\n\t *\n\t * @param {Object} options - The loader options to set.\n\t * @return {ImageBitmapLoader} A reference to this image bitmap loader.\n\t */\n\tsetOptions( options ) {\n\n\t\tthis.options = options;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and pass the loaded image bitmap to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Unsupported in this loader.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t * @return {ImageBitmap|undefined} The image bitmap.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tif ( url === undefined ) url = '';\n\n\t\tif ( this.path !== undefined ) url = this.path + url;\n\n\t\turl = this.manager.resolveURL( url );\n\n\t\tconst scope = this;\n\n\t\tconst cached = Cache.get( `image-bitmap:${url}` );\n\n\t\tif ( cached !== undefined ) {\n\n\t\t\tscope.manager.itemStart( url );\n\n\t\t\t// If cached is a promise, wait for it to resolve\n\t\t\tif ( cached.then ) {\n\n\t\t\t\tcached.then( imageBitmap => {\n\n\t\t\t\t\t// check if there is an error for the cached promise\n\n\t\t\t\t\tif ( _errorMap.has( cached ) === true ) {\n\n\t\t\t\t\t\tif ( onError ) onError( _errorMap.get( cached ) );\n\n\t\t\t\t\t\tscope.manager.itemError( url );\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t\treturn imageBitmap;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// If cached is not a promise (i.e., it's already an imageBitmap)\n\t\t\tsetTimeout( function () {\n\n\t\t\t\tif ( onLoad ) onLoad( cached );\n\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t}, 0 );\n\n\t\t\treturn cached;\n\n\t\t}\n\n\t\tconst fetchOptions = {};\n\t\tfetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';\n\t\tfetchOptions.headers = this.requestHeader;\n\t\tfetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;\n\n\t\tconst promise = fetch( url, fetchOptions ).then( function ( res ) {\n\n\t\t\treturn res.blob();\n\n\t\t} ).then( function ( blob ) {\n\n\t\t\treturn createImageBitmap( blob, Object.assign( scope.options, { colorSpaceConversion: 'none' } ) );\n\n\t\t} ).then( function ( imageBitmap ) {\n\n\t\t\tCache.add( `image-bitmap:${url}`, imageBitmap );\n\n\t\t\tif ( onLoad ) onLoad( imageBitmap );\n\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t\treturn imageBitmap;\n\n\t\t} ).catch( function ( e ) {\n\n\t\t\tif ( onError ) onError( e );\n\n\t\t\t_errorMap.set( promise, e );\n\n\t\t\tCache.remove( `image-bitmap:${url}` );\n\n\t\t\tscope.manager.itemError( url );\n\t\t\tscope.manager.itemEnd( url );\n\n\t\t} );\n\n\t\tCache.add( `image-bitmap:${url}`, promise );\n\t\tscope.manager.itemStart( url );\n\n\t}\n\n\t/**\n\t * Aborts ongoing fetch requests.\n\t *\n\t * @return {ImageBitmapLoader} A reference to this instance.\n\t */\n\tabort() {\n\n\t\tthis._abortController.abort();\n\t\tthis._abortController = new AbortController();\n\n\t\treturn this;\n\n\t}\n\n}\n\nlet _context;\n\n/**\n * Manages the global audio context in the engine.\n *\n * @hideconstructor\n */\nclass AudioContext {\n\n\t/**\n\t * Returns the global native audio context.\n\t *\n\t * @return {AudioContext} The native audio context.\n\t */\n\tstatic getContext() {\n\n\t\tif ( _context === undefined ) {\n\n\t\t\t_context = new ( window.AudioContext || window.webkitAudioContext )();\n\n\t\t}\n\n\t\treturn _context;\n\n\t}\n\n\t/**\n\t * Allows to set the global native audio context from outside.\n\t *\n\t * @param {AudioContext} value - The native context to set.\n\t */\n\tstatic setContext( value ) {\n\n\t\t_context = value;\n\n\t}\n\n}\n\n/**\n * Class for loading audio buffers. Audios are internally\n * loaded via {@link FileLoader}.\n *\n * ```js\n * const audioListener = new THREE.AudioListener();\n * const ambientSound = new THREE.Audio( audioListener );\n *\n * const loader = new THREE.AudioLoader();\n * const audioBuffer = await loader.loadAsync( 'audio/ambient_ocean.ogg' );\n *\n * ambientSound.setBuffer( audioBuffer );\n * ambientSound.play();\n * ```\n *\n * @augments Loader\n */\nclass AudioLoader extends Loader {\n\n\t/**\n\t * Constructs a new audio loader.\n\t *\n\t * @param {LoadingManager} [manager] - The loading manager.\n\t */\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\t/**\n\t * Starts loading from the given URL and passes the loaded audio buffer\n\t * to the `onLoad()` callback.\n\t *\n\t * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.\n\t * @param {function(AudioBuffer)} onLoad - Executed when the loading process has been finished.\n\t * @param {onProgressCallback} onProgress - Executed while the loading is in progress.\n\t * @param {onErrorCallback} onError - Executed when errors occur.\n\t */\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new FileLoader( this.manager );\n\t\tloader.setResponseType( 'arraybuffer' );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( buffer ) {\n\n\t\t\ttry {\n\n\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\tconst bufferCopy = buffer.slice( 0 );\n\n\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\tcontext.decodeAudioData( bufferCopy, function ( audioBuffer ) {\n\n\t\t\t\t\tonLoad( audioBuffer );\n\n\t\t\t\t} ).catch( handleError );\n\n\t\t\t} catch ( e ) {\n\n\t\t\t\thandleError( e );\n\n\t\t\t}\n\n\t\t}, onProgress, onError );\n\n\t\tfunction handleError( e ) {\n\n\t\t\tif ( onError ) {\n\n\t\t\t\tonError( e );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( e );\n\n\t\t\t}\n\n\t\t\tscope.manager.itemError( url );\n\n\t\t}\n\n\t}\n\n}\n\nconst _eyeRight = /*@__PURE__*/ new Matrix4();\nconst _eyeLeft = /*@__PURE__*/ new Matrix4();\nconst _projectionMatrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * A special type of camera that uses two perspective cameras with\n * stereoscopic projection. Can be used for rendering stereo effects\n * like [3D Anaglyph]{@link https://en.wikipedia.org/wiki/Anaglyph_3D} or\n * [Parallax Barrier]{@link https://en.wikipedia.org/wiki/parallax_barrier}.\n */\nclass StereoCamera {\n\n\t/**\n\t * Constructs a new stereo camera.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * The type property is used for detecting the object type\n\t\t * in context of serialization/deserialization.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.type = 'StereoCamera';\n\n\t\t/**\n\t\t * The aspect.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aspect = 1;\n\n\t\t/**\n\t\t * The eye separation which represents the distance\n\t\t * between the left and right camera.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.064\n\t\t */\n\t\tthis.eyeSep = 0.064;\n\n\t\t/**\n\t\t * The camera representing the left eye. This is added to layer `1` so objects to be\n\t\t * rendered by the left camera must also be added to this layer.\n\t\t *\n\t\t * @type {PerspectiveCamera}\n\t\t */\n\t\tthis.cameraL = new PerspectiveCamera();\n\t\tthis.cameraL.layers.enable( 1 );\n\t\tthis.cameraL.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The camera representing the right eye. This is added to layer `2` so objects to be\n\t\t * rendered by the right camera must also be added to this layer.\n\t\t *\n\t\t * @type {PerspectiveCamera}\n\t\t */\n\t\tthis.cameraR = new PerspectiveCamera();\n\t\tthis.cameraR.layers.enable( 2 );\n\t\tthis.cameraR.matrixAutoUpdate = false;\n\n\t\tthis._cache = {\n\t\t\tfocus: null,\n\t\t\tfov: null,\n\t\t\taspect: null,\n\t\t\tnear: null,\n\t\t\tfar: null,\n\t\t\tzoom: null,\n\t\t\teyeSep: null\n\t\t};\n\n\t}\n\n\t/**\n\t * Updates the stereo camera based on the given perspective camera.\n\t *\n\t * @param {PerspectiveCamera} camera - The perspective camera.\n\t */\n\tupdate( camera ) {\n\n\t\tconst cache = this._cache;\n\n\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov ||\n\t\t\tcache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near ||\n\t\t\tcache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tcache.focus = camera.focus;\n\t\t\tcache.fov = camera.fov;\n\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\tcache.near = camera.near;\n\t\t\tcache.far = camera.far;\n\t\t\tcache.zoom = camera.zoom;\n\t\t\tcache.eyeSep = this.eyeSep;\n\n\t\t\t// Off-axis stereoscopic effect based on\n\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t_projectionMatrix.copy( camera.projectionMatrix );\n\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\tconst ymax = ( cache.near * Math.tan( DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;\n\t\t\tlet xmin, xmax;\n\n\t\t\t// translate xOffset\n\n\t\t\t_eyeLeft.elements[ 12 ] = - eyeSepHalf;\n\t\t\t_eyeRight.elements[ 12 ] = eyeSepHalf;\n\n\t\t\t// for left eye\n\n\t\t\txmin = - ymax * cache.aspect + eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraL.projectionMatrix.copy( _projectionMatrix );\n\n\t\t\t// for right eye\n\n\t\t\txmin = - ymax * cache.aspect - eyeSepOnProjection;\n\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\n\t\t\t_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );\n\t\t\t_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );\n\n\t\t\tthis.cameraR.projectionMatrix.copy( _projectionMatrix );\n\n\t\t}\n\n\t\tthis.cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeLeft );\n\t\tthis.cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( _eyeRight );\n\n\t}\n\n}\n\n/**\n * This type of camera can be used in order to efficiently render a scene with a\n * predefined set of cameras. This is an important performance aspect for\n * rendering VR scenes.\n *\n * An instance of `ArrayCamera` always has an array of sub cameras. It's mandatory\n * to define for each sub camera the `viewport` property which determines the\n * part of the viewport that is rendered with this camera.\n *\n * @augments PerspectiveCamera\n */\nclass ArrayCamera extends PerspectiveCamera {\n\n\t/**\n\t * Constructs a new array camera.\n\t *\n\t * @param {Array<PerspectiveCamera>} [array=[]] - An array of perspective sub cameras.\n\t */\n\tconstructor( array = [] ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isArrayCamera = true;\n\n\t\t/**\n\t\t * Whether this camera is used with multiview rendering or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isMultiViewCamera = false;\n\n\t\t/**\n\t\t * An array of perspective sub cameras.\n\t\t *\n\t\t * @type {Array<PerspectiveCamera>}\n\t\t */\n\t\tthis.cameras = array;\n\n\t}\n\n}\n\n/**\n * Class for keeping track of time.\n */\nclass Clock {\n\n\t/**\n\t * Constructs a new clock.\n\t *\n\t * @param {boolean} [autoStart=true] - Whether to automatically start the clock when\n\t * `getDelta()` is called for the first time.\n\t */\n\tconstructor( autoStart = true ) {\n\n\t\t/**\n\t\t * If set to `true`, the clock starts automatically when `getDelta()` is called\n\t\t * for the first time.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoStart = autoStart;\n\n\t\t/**\n\t\t * Holds the time at which the clock's `start()` method was last called.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.startTime = 0;\n\n\t\t/**\n\t\t * Holds the time at which the clock's `start()`, `getElapsedTime()` or\n\t\t * `getDelta()` methods were last called.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.oldTime = 0;\n\n\t\t/**\n\t\t * Keeps track of the total time that the clock has been running.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.elapsedTime = 0;\n\n\t\t/**\n\t\t * Whether the clock is running or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.running = false;\n\n\t}\n\n\t/**\n\t * Starts the clock. When `autoStart` is set to `true`, the method is automatically\n\t * called by the class.\n\t */\n\tstart() {\n\n\t\tthis.startTime = performance.now();\n\n\t\tthis.oldTime = this.startTime;\n\t\tthis.elapsedTime = 0;\n\t\tthis.running = true;\n\n\t}\n\n\t/**\n\t * Stops the clock.\n\t */\n\tstop() {\n\n\t\tthis.getElapsedTime();\n\t\tthis.running = false;\n\t\tthis.autoStart = false;\n\n\t}\n\n\t/**\n\t * Returns the elapsed time in seconds.\n\t *\n\t * @return {number} The elapsed time.\n\t */\n\tgetElapsedTime() {\n\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\n\t}\n\n\t/**\n\t * Returns the delta time in seconds.\n\t *\n\t * @return {number} The delta time.\n\t */\n\tgetDelta() {\n\n\t\tlet diff = 0;\n\n\t\tif ( this.autoStart && ! this.running ) {\n\n\t\t\tthis.start();\n\t\t\treturn 0;\n\n\t\t}\n\n\t\tif ( this.running ) {\n\n\t\t\tconst newTime = performance.now();\n\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\n\t\t\tthis.elapsedTime += diff;\n\n\t\t}\n\n\t\treturn diff;\n\n\t}\n\n}\n\nconst _position$1 = /*@__PURE__*/ new Vector3();\nconst _quaternion$1 = /*@__PURE__*/ new Quaternion();\nconst _scale$1 = /*@__PURE__*/ new Vector3();\n\nconst _forward = /*@__PURE__*/ new Vector3();\nconst _up = /*@__PURE__*/ new Vector3();\n\n/**\n * The class represents a virtual listener of the all positional and non-positional audio effects\n * in the scene. A three.js application usually creates a single listener. It is a mandatory\n * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}.\n *\n * In most cases, the listener object is a child of the camera. So the 3D transformation of the\n * camera represents the 3D transformation of the listener.\n *\n * @augments Object3D\n */\nclass AudioListener extends Object3D {\n\n\t/**\n\t * Constructs a new audio listener.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.type = 'AudioListener';\n\n\t\t/**\n\t\t * The native audio context.\n\t\t *\n\t\t * @type {AudioContext}\n\t\t * @readonly\n\t\t */\n\t\tthis.context = AudioContext.getContext();\n\n\t\t/**\n\t\t * The gain node used for volume control.\n\t\t *\n\t\t * @type {GainNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( this.context.destination );\n\n\t\t/**\n\t\t * An optional filter.\n\t\t *\n\t\t * Defined via {@link AudioListener#setFilter}.\n\t\t *\n\t\t * @type {?AudioNode}\n\t\t * @default null\n\t\t * @readonly\n\t\t */\n\t\tthis.filter = null;\n\n\t\t/**\n\t\t * Time delta values required for `linearRampToValueAtTime()` usage.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t * @readonly\n\t\t */\n\t\tthis.timeDelta = 0;\n\n\t\t// private\n\n\t\tthis._clock = new Clock();\n\n\t}\n\n\t/**\n\t * Returns the listener's input node.\n\t *\n\t * This method is used by other audio nodes to connect to this listener.\n\t *\n\t * @return {GainNode} The input node.\n\t */\n\tgetInput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\t/**\n\t * Removes the current filter from this listener.\n\t *\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tremoveFilter() {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\t\t\tthis.gain.connect( this.context.destination );\n\t\t\tthis.filter = null;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current set filter.\n\t *\n\t * @return {?AudioNode} The filter.\n\t */\n\tgetFilter() {\n\n\t\treturn this.filter;\n\n\t}\n\n\t/**\n\t * Sets the given filter to this listener.\n\t *\n\t * @param {AudioNode} value - The filter to set.\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tsetFilter( value ) {\n\n\t\tif ( this.filter !== null ) {\n\n\t\t\tthis.gain.disconnect( this.filter );\n\t\t\tthis.filter.disconnect( this.context.destination );\n\n\t\t} else {\n\n\t\t\tthis.gain.disconnect( this.context.destination );\n\n\t\t}\n\n\t\tthis.filter = value;\n\t\tthis.gain.connect( this.filter );\n\t\tthis.filter.connect( this.context.destination );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the applications master volume.\n\t *\n\t * @return {number} The master volume.\n\t */\n\tgetMasterVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\t/**\n\t * Sets the applications master volume. This volume setting affects\n\t * all audio nodes in the scene.\n\t *\n\t * @param {number} value - The master volume to set.\n\t * @return {AudioListener} A reference to this listener.\n\t */\n\tsetMasterVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tconst listener = this.context.listener;\n\n\t\tthis.timeDelta = this._clock.getDelta();\n\n\t\tthis.matrixWorld.decompose( _position$1, _quaternion$1, _scale$1 );\n\n\t\t// the initial forward and up directions must be orthogonal\n\t\t_forward.set( 0, 0, -1 ).applyQuaternion( _quaternion$1 );\n\t\t_up.set( 0, 1, 0 ).applyQuaternion( _quaternion$1 );\n\n\t\tif ( listener.positionX ) {\n\n\t\t\t// code path for Chrome (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\n\t\t\tlistener.positionX.linearRampToValueAtTime( _position$1.x, endTime );\n\t\t\tlistener.positionY.linearRampToValueAtTime( _position$1.y, endTime );\n\t\t\tlistener.positionZ.linearRampToValueAtTime( _position$1.z, endTime );\n\t\t\tlistener.forwardX.linearRampToValueAtTime( _forward.x, endTime );\n\t\t\tlistener.forwardY.linearRampToValueAtTime( _forward.y, endTime );\n\t\t\tlistener.forwardZ.linearRampToValueAtTime( _forward.z, endTime );\n\t\t\tlistener.upX.linearRampToValueAtTime( _up.x, endTime );\n\t\t\tlistener.upY.linearRampToValueAtTime( _up.y, endTime );\n\t\t\tlistener.upZ.linearRampToValueAtTime( _up.z, endTime );\n\n\t\t} else {\n\n\t\t\tlistener.setPosition( _position$1.x, _position$1.y, _position$1.z );\n\t\t\tlistener.setOrientation( _forward.x, _forward.y, _forward.z, _up.x, _up.y, _up.z );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Represents a non-positional ( global ) audio object.\n *\n * This and related audio modules make use of the [Web Audio API]{@link https://www.w3.org/TR/webaudio-1.1/}.\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create a global audio source\n * const sound = new THREE.Audio( listener );\n *\n * // load a sound and set it as the Audio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setLoop( true );\n * \tsound.setVolume( 0.5 );\n * \tsound.play();\n * });\n * ```\n *\n * @augments Object3D\n */\nclass Audio extends Object3D {\n\n\t/**\n\t * Constructs a new audio.\n\t *\n\t * @param {AudioListener} listener - The global audio listener.\n\t */\n\tconstructor( listener ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'Audio';\n\n\t\t/**\n\t\t * The global audio listener.\n\t\t *\n\t\t * @type {AudioListener}\n\t\t * @readonly\n\t\t */\n\t\tthis.listener = listener;\n\n\t\t/**\n\t\t * The audio context.\n\t\t *\n\t\t * @type {AudioContext}\n\t\t * @readonly\n\t\t */\n\t\tthis.context = listener.context;\n\n\t\t/**\n\t\t * The gain node used for volume control.\n\t\t *\n\t\t * @type {GainNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.gain = this.context.createGain();\n\t\tthis.gain.connect( listener.getInput() );\n\n\t\t/**\n\t\t * Whether to start playback automatically or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.autoplay = false;\n\n\t\t/**\n\t\t * A reference to an audio buffer.\n\t\t *\n\t\t * Defined via {@link Audio#setBuffer}.\n\t\t *\n\t\t * @type {?AudioBuffer}\n\t\t * @default null\n\t\t * @readonly\n\t\t */\n\t\tthis.buffer = null;\n\n\t\t/**\n\t\t * Modify pitch, measured in cents. +/- 100 is a semitone.\n\t\t * +/- 1200 is an octave.\n\t\t *\n\t\t * Defined via {@link Audio#setDetune}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t * @readonly\n\t\t */\n\t\tthis.detune = 0;\n\n\t\t/**\n\t\t * Whether the audio should loop or not.\n\t\t *\n\t\t * Defined via {@link Audio#setLoop}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t * @readonly\n\t\t */\n\t\tthis.loop = false;\n\n\t\t/**\n\t\t * Defines where in the audio buffer the replay should\n\t\t * start, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.loopStart = 0;\n\n\t\t/**\n\t\t * Defines where in the audio buffer the replay should\n\t\t * stop, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.loopEnd = 0;\n\n\t\t/**\n\t\t * An offset to the time within the audio buffer the playback\n\t\t * should begin, in seconds.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.offset = 0;\n\n\t\t/**\n\t\t * Overrides the default duration of the audio.\n\t\t *\n\t\t * @type {undefined|number}\n\t\t * @default undefined\n\t\t */\n\t\tthis.duration = undefined;\n\n\t\t/**\n\t\t * The playback speed.\n\t\t *\n\t\t * Defined via {@link Audio#setPlaybackRate}.\n\t\t *\n\t\t * @type {number}\n\t\t * @readonly\n\t\t * @default 1\n\t\t */\n\t\tthis.playbackRate = 1;\n\n\t\t/**\n\t\t * Indicates whether the audio is playing or not.\n\t\t *\n\t\t * This flag will be automatically set when using {@link Audio#play},\n\t\t * {@link Audio#pause}, {@link Audio#stop}.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isPlaying = false;\n\n\t\t/**\n\t\t * Indicates whether the audio playback can be controlled\n\t\t * with method like {@link Audio#play} or {@link Audio#pause}.\n\t\t *\n\t\t * This flag will be automatically set when audio sources are\n\t\t * defined.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.hasPlaybackControl = true;\n\n\t\t/**\n\t\t * Holds a reference to the current audio source.\n\t\t *\n\t\t * The property is automatically by one of the `set*()` methods.\n\t\t *\n\t\t * @type {?AudioNode}\n\t\t * @readonly\n\t\t * @default null\n\t\t */\n\t\tthis.source = null;\n\n\t\t/**\n\t\t * Defines the source type.\n\t\t *\n\t\t * The property is automatically by one of the `set*()` methods.\n\t\t *\n\t\t * @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')}\n\t\t * @readonly\n\t\t * @default 'empty'\n\t\t */\n\t\tthis.sourceType = 'empty';\n\n\t\tthis._startedAt = 0;\n\t\tthis._progress = 0;\n\t\tthis._connected = false;\n\n\t\t/**\n\t\t * Can be used to apply a variety of low-order filters to create\n\t\t * more complex sound effects e.g. via `BiquadFilterNode`.\n\t\t *\n\t\t * The property is automatically set by {@link Audio#setFilters}.\n\t\t *\n\t\t * @type {Array<AudioNode>}\n\t\t * @readonly\n\t\t */\n\t\tthis.filters = [];\n\n\t}\n\n\t/**\n\t * Returns the output audio node.\n\t *\n\t * @return {GainNode} The output node.\n\t */\n\tgetOutput() {\n\n\t\treturn this.gain;\n\n\t}\n\n\t/**\n\t * Sets the given audio node as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `audioNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {AudioNode} audioNode - The audio node like an instance of `OscillatorNode`.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetNodeSource( audioNode ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'audioNode';\n\t\tthis.source = audioNode;\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given media element as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `mediaNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {HTMLMediaElement} mediaElement - The media element.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetMediaElementSource( mediaElement ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaNode';\n\t\tthis.source = this.context.createMediaElementSource( mediaElement );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given media stream as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `mediaStreamNode` and {@link Audio#hasPlaybackControl} to `false`.\n\t *\n\t * @param {MediaStream} mediaStream - The media stream.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetMediaStreamSource( mediaStream ) {\n\n\t\tthis.hasPlaybackControl = false;\n\t\tthis.sourceType = 'mediaStreamNode';\n\t\tthis.source = this.context.createMediaStreamSource( mediaStream );\n\t\tthis.connect();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given audio buffer as the source of this instance.\n\t *\n\t * {@link Audio#sourceType} is set to `buffer` and {@link Audio#hasPlaybackControl} to `true`.\n\t *\n\t * @param {AudioBuffer} audioBuffer - The audio buffer.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetBuffer( audioBuffer ) {\n\n\t\tthis.buffer = audioBuffer;\n\t\tthis.sourceType = 'buffer';\n\n\t\tif ( this.autoplay ) this.play();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Starts the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [delay=0] - The delay, in seconds, at which the audio should start playing.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tplay( delay = 0 ) {\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: Audio is already playing.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._startedAt = this.context.currentTime + delay;\n\n\t\tconst source = this.context.createBufferSource();\n\t\tsource.buffer = this.buffer;\n\t\tsource.loop = this.loop;\n\t\tsource.loopStart = this.loopStart;\n\t\tsource.loopEnd = this.loopEnd;\n\t\tsource.onended = this.onEnded.bind( this );\n\t\tsource.start( this._startedAt, this._progress + this.offset, this.duration );\n\n\t\tthis.isPlaying = true;\n\n\t\tthis.source = source;\n\n\t\tthis.setDetune( this.detune );\n\t\tthis.setPlaybackRate( this.playbackRate );\n\n\t\treturn this.connect();\n\n\t}\n\n\t/**\n\t * Pauses the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tpause() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\t// update current progress\n\n\t\t\tthis._progress += Math.max( this.context.currentTime - this._startedAt, 0 ) * this.playbackRate;\n\n\t\t\tif ( this.loop === true ) {\n\n\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\n\t\t\t\tthis._progress = this._progress % ( this.duration || this.buffer.duration );\n\n\t\t\t}\n\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\n\t\t\tthis.isPlaying = false;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops the playback of the audio.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [delay=0] - The delay, in seconds, at which the audio should stop playing.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tstop( delay = 0 ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._progress = 0;\n\n\t\tif ( this.source !== null ) {\n\n\t\t\tthis.source.stop( this.context.currentTime + delay );\n\t\t\tthis.source.onended = null;\n\n\t\t}\n\n\t\tthis.isPlaying = false;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Connects to the audio source. This is used internally on\n\t * initialisation and when setting / removing filters.\n\t *\n\t * @return {Audio} A reference to this instance.\n\t */\n\tconnect() {\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.connect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].connect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].connect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.connect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Disconnects to the audio source. This is used internally on\n\t * initialisation and when setting / removing filters.\n\t *\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tdisconnect() {\n\n\t\tif ( this._connected === false ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.filters.length > 0 ) {\n\n\t\t\tthis.source.disconnect( this.filters[ 0 ] );\n\n\t\t\tfor ( let i = 1, l = this.filters.length; i < l; i ++ ) {\n\n\t\t\t\tthis.filters[ i - 1 ].disconnect( this.filters[ i ] );\n\n\t\t\t}\n\n\t\t\tthis.filters[ this.filters.length - 1 ].disconnect( this.getOutput() );\n\n\t\t} else {\n\n\t\t\tthis.source.disconnect( this.getOutput() );\n\n\t\t}\n\n\t\tthis._connected = false;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current set filters.\n\t *\n\t * @return {Array<AudioNode>} The list of filters.\n\t */\n\tgetFilters() {\n\n\t\treturn this.filters;\n\n\t}\n\n\t/**\n\t * Sets an array of filters and connects them with the audio source.\n\t *\n\t * @param {Array<AudioNode>} [value] - A list of filters.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetFilters( value ) {\n\n\t\tif ( ! value ) value = [];\n\n\t\tif ( this._connected === true ) {\n\n\t\t\tthis.disconnect();\n\t\t\tthis.filters = value.slice();\n\t\t\tthis.connect();\n\n\t\t} else {\n\n\t\t\tthis.filters = value.slice();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Defines the detuning of oscillation in cents.\n\t *\n\t * @param {number} value - The detuning of oscillation in cents.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetDetune( value ) {\n\n\t\tthis.detune = value;\n\n\t\tif ( this.isPlaying === true && this.source.detune !== undefined ) {\n\n\t\t\tthis.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the detuning of oscillation in cents.\n\t *\n\t * @return {number} The detuning of oscillation in cents.\n\t */\n\tgetDetune() {\n\n\t\treturn this.detune;\n\n\t}\n\n\t/**\n\t * Returns the first filter in the list of filters.\n\t *\n\t * @return {AudioNode|undefined} The first filter in the list of filters.\n\t */\n\tgetFilter() {\n\n\t\treturn this.getFilters()[ 0 ];\n\n\t}\n\n\t/**\n\t * Applies a single filter node to the audio.\n\t *\n\t * @param {AudioNode} [filter] - The filter to set.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetFilter( filter ) {\n\n\t\treturn this.setFilters( filter ? [ filter ] : [] );\n\n\t}\n\n\t/**\n\t * Sets the playback rate.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {number} [value] - The playback rate to set.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tsetPlaybackRate( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.playbackRate = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.playbackRate.setTargetAtTime( this.playbackRate, this.context.currentTime, 0.01 );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current playback rate.\n\n\t * @return {number} The playback rate.\n\t */\n\tgetPlaybackRate() {\n\n\t\treturn this.playbackRate;\n\n\t}\n\n\t/**\n\t * Automatically called when playback finished.\n\t */\n\tonEnded() {\n\n\t\tthis.isPlaying = false;\n\t\tthis._progress = 0;\n\n\t}\n\n\t/**\n\t * Returns the loop flag.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @return {boolean} Whether the audio should loop or not.\n\t */\n\tgetLoop() {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn this.loop;\n\n\t}\n\n\t/**\n\t * Sets the loop flag.\n\t *\n\t * Can only be used with compatible audio sources that allow playback control.\n\t *\n\t * @param {boolean} value - Whether the audio should loop or not.\n\t * @return {Audio|undefined} A reference to this instance.\n\t */\n\tsetLoop( value ) {\n\n\t\tif ( this.hasPlaybackControl === false ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: this Audio has no playback control.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis.loop = value;\n\n\t\tif ( this.isPlaying === true ) {\n\n\t\t\tthis.source.loop = this.loop;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the loop start value which defines where in the audio buffer the replay should\n\t * start, in seconds.\n\t *\n\t * @param {number} value - The loop start value.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetLoopStart( value ) {\n\n\t\tthis.loopStart = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the loop end value which defines where in the audio buffer the replay should\n\t * stop, in seconds.\n\t *\n\t * @param {number} value - The loop end value.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetLoopEnd( value ) {\n\n\t\tthis.loopEnd = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the volume.\n\t *\n\t * @return {number} The volume.\n\t */\n\tgetVolume() {\n\n\t\treturn this.gain.gain.value;\n\n\t}\n\n\t/**\n\t * Sets the volume.\n\t *\n\t * @param {number} value - The volume to set.\n\t * @return {Audio} A reference to this instance.\n\t */\n\tsetVolume( value ) {\n\n\t\tthis.gain.gain.setTargetAtTime( value, this.context.currentTime, 0.01 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.sourceType !== 'buffer' ) {\n\n\t\t\tconsole.warn( 'THREE.Audio: Audio source type cannot be copied.' );\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tthis.autoplay = source.autoplay;\n\n\t\tthis.buffer = source.buffer;\n\t\tthis.detune = source.detune;\n\t\tthis.loop = source.loop;\n\t\tthis.loopStart = source.loopStart;\n\t\tthis.loopEnd = source.loopEnd;\n\t\tthis.offset = source.offset;\n\t\tthis.duration = source.duration;\n\t\tthis.playbackRate = source.playbackRate;\n\t\tthis.hasPlaybackControl = source.hasPlaybackControl;\n\t\tthis.sourceType = source.sourceType;\n\n\t\tthis.filters = source.filters.slice();\n\n\t\treturn this;\n\n\t}\n\n\tclone( recursive ) {\n\n\t\treturn new this.constructor( this.listener ).copy( this, recursive );\n\n\t}\n\n}\n\nconst _position = /*@__PURE__*/ new Vector3();\nconst _quaternion = /*@__PURE__*/ new Quaternion();\nconst _scale = /*@__PURE__*/ new Vector3();\nconst _orientation = /*@__PURE__*/ new Vector3();\n\n/**\n * Represents a positional audio object.\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create the PositionalAudio object (passing in the listener)\n * const sound = new THREE.PositionalAudio( listener );\n *\n * // load a sound and set it as the PositionalAudio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/song.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setRefDistance( 20 );\n * \tsound.play();\n * });\n *\n * // create an object for the sound to play from\n * const sphere = new THREE.SphereGeometry( 20, 32, 16 );\n * const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } );\n * const mesh = new THREE.Mesh( sphere, material );\n * scene.add( mesh );\n *\n * // finally add the sound to the mesh\n * mesh.add( sound );\n *\n * @augments Audio\n */\nclass PositionalAudio extends Audio {\n\n\t/**\n\t * Constructs a positional audio.\n\t *\n\t * @param {AudioListener} listener - The global audio listener.\n\t */\n\tconstructor( listener ) {\n\n\t\tsuper( listener );\n\n\t\t/**\n\t\t * The panner node represents the location, direction, and behavior of an audio\n\t\t * source in 3D space.\n\t\t *\n\t\t * @type {PannerNode}\n\t\t * @readonly\n\t\t */\n\t\tthis.panner = this.context.createPanner();\n\t\tthis.panner.panningModel = 'HRTF';\n\t\tthis.panner.connect( this.gain );\n\n\t}\n\n\tconnect() {\n\n\t\tsuper.connect();\n\n\t\tthis.panner.connect( this.gain );\n\n\t\treturn this;\n\n\t}\n\n\tdisconnect() {\n\n\t\tsuper.disconnect();\n\n\t\tthis.panner.disconnect( this.gain );\n\n\t\treturn this;\n\n\t}\n\n\tgetOutput() {\n\n\t\treturn this.panner;\n\n\t}\n\n\t/**\n\t * Returns the current reference distance.\n\t *\n\t * @return {number} The reference distance.\n\t */\n\tgetRefDistance() {\n\n\t\treturn this.panner.refDistance;\n\n\t}\n\n\t/**\n\t * Defines the reference distance for reducing volume as the audio source moves\n\t * further from the listener – i.e. the distance at which the volume reduction\n\t * starts taking effect.\n\t *\n\t * @param {number} value - The reference distance to set.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetRefDistance( value ) {\n\n\t\tthis.panner.refDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current rolloff factor.\n\t *\n\t * @return {number} The rolloff factor.\n\t */\n\tgetRolloffFactor() {\n\n\t\treturn this.panner.rolloffFactor;\n\n\t}\n\n\t/**\n\t * Defines how quickly the volume is reduced as the source moves away from the listener.\n\t *\n\t * @param {number} value - The rolloff factor.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetRolloffFactor( value ) {\n\n\t\tthis.panner.rolloffFactor = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current distance model.\n\t *\n\t * @return {('linear'|'inverse'|'exponential')} The distance model.\n\t */\n\tgetDistanceModel() {\n\n\t\treturn this.panner.distanceModel;\n\n\t}\n\n\t/**\n\t * Defines which algorithm to use to reduce the volume of the audio source\n\t * as it moves away from the listener.\n\t *\n\t * Read [the spec]{@link https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype}\n\t * for more details.\n\t *\n\t * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetDistanceModel( value ) {\n\n\t\tthis.panner.distanceModel = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the current max distance.\n\t *\n\t * @return {number} The max distance.\n\t */\n\tgetMaxDistance() {\n\n\t\treturn this.panner.maxDistance;\n\n\t}\n\n\t/**\n\t * Defines the maximum distance between the audio source and the listener,\n\t * after which the volume is not reduced any further.\n\t *\n\t * This value is used only by the `linear` distance model.\n\t *\n\t * @param {number} value - The max distance.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetMaxDistance( value ) {\n\n\t\tthis.panner.maxDistance = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the directional cone in which the audio can be listened.\n\t *\n\t * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction.\n\t * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter.\n\t * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard.\n\t * @return {PositionalAudio} A reference to this instance.\n\t */\n\tsetDirectionalCone( coneInnerAngle, coneOuterAngle, coneOuterGain ) {\n\n\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\tthis.panner.coneOuterGain = coneOuterGain;\n\n\t\treturn this;\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tif ( this.hasPlaybackControl === true && this.isPlaying === false ) return;\n\n\t\tthis.matrixWorld.decompose( _position, _quaternion, _scale );\n\n\t\t_orientation.set( 0, 0, 1 ).applyQuaternion( _quaternion );\n\n\t\tconst panner = this.panner;\n\n\t\tif ( panner.positionX ) {\n\n\t\t\t// code path for Chrome and Firefox (see #14393)\n\n\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\n\t\t\tpanner.positionX.linearRampToValueAtTime( _position.x, endTime );\n\t\t\tpanner.positionY.linearRampToValueAtTime( _position.y, endTime );\n\t\t\tpanner.positionZ.linearRampToValueAtTime( _position.z, endTime );\n\t\t\tpanner.orientationX.linearRampToValueAtTime( _orientation.x, endTime );\n\t\t\tpanner.orientationY.linearRampToValueAtTime( _orientation.y, endTime );\n\t\t\tpanner.orientationZ.linearRampToValueAtTime( _orientation.z, endTime );\n\n\t\t} else {\n\n\t\t\tpanner.setPosition( _position.x, _position.y, _position.z );\n\t\t\tpanner.setOrientation( _orientation.x, _orientation.y, _orientation.z );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * This class can be used to analyse audio data.\n *\n * ```js\n * // create an AudioListener and add it to the camera\n * const listener = new THREE.AudioListener();\n * camera.add( listener );\n *\n * // create an Audio source\n * const sound = new THREE.Audio( listener );\n *\n * // load a sound and set it as the Audio object's buffer\n * const audioLoader = new THREE.AudioLoader();\n * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {\n * \tsound.setBuffer( buffer );\n * \tsound.setLoop(true);\n * \tsound.setVolume(0.5);\n * \tsound.play();\n * });\n *\n * // create an AudioAnalyser, passing in the sound and desired fftSize\n * const analyser = new THREE.AudioAnalyser( sound, 32 );\n *\n * // get the average frequency of the sound\n * const data = analyser.getAverageFrequency();\n * ```\n */\nclass AudioAnalyser {\n\n\t/**\n\t * Constructs a new audio analyzer.\n\t *\n\t * @param {Audio} audio - The audio to analyze.\n\t * @param {number} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data.\n\t */\n\tconstructor( audio, fftSize = 2048 ) {\n\n\t\t/**\n\t\t * The global audio listener.\n\t\t *\n\t\t * @type {AnalyserNode}\n\t\t */\n\t\tthis.analyser = audio.context.createAnalyser();\n\t\tthis.analyser.fftSize = fftSize;\n\n\t\t/**\n\t\t * Holds the analyzed data.\n\t\t *\n\t\t * @type {Uint8Array}\n\t\t */\n\t\tthis.data = new Uint8Array( this.analyser.frequencyBinCount );\n\n\t\taudio.getOutput().connect( this.analyser );\n\n\t}\n\n\t/**\n\t * Returns an array with frequency data of the audio.\n\t *\n\t * Each item in the array represents the decibel value for a specific frequency.\n\t * The frequencies are spread linearly from 0 to 1/2 of the sample rate.\n\t * For example, for 48000 sample rate, the last item of the array will represent\n\t * the decibel value for 24000 Hz.\n\t *\n\t * @return {Uint8Array} The frequency data.\n\t */\n\tgetFrequencyData() {\n\n\t\tthis.analyser.getByteFrequencyData( this.data );\n\n\t\treturn this.data;\n\n\t}\n\n\t/**\n\t * Returns the average of the frequencies returned by {@link AudioAnalyser#getFrequencyData}.\n\t *\n\t * @return {number} The average frequency.\n\t */\n\tgetAverageFrequency() {\n\n\t\tlet value = 0;\n\t\tconst data = this.getFrequencyData();\n\n\t\tfor ( let i = 0; i < data.length; i ++ ) {\n\n\t\t\tvalue += data[ i ];\n\n\t\t}\n\n\t\treturn value / data.length;\n\n\t}\n\n}\n\n/**\n * Buffered scene graph property that allows weighted accumulation; used internally.\n */\nclass PropertyMixer {\n\n\t/**\n\t * Constructs a new property mixer.\n\t *\n\t * @param {PropertyBinding} binding - The property binding.\n\t * @param {string} typeName - The keyframe track type name.\n\t * @param {number} valueSize - The keyframe track value size.\n\t */\n\tconstructor( binding, typeName, valueSize ) {\n\n\t\t/**\n\t\t * The property binding.\n\t\t *\n\t\t * @type {PropertyBinding}\n\t\t */\n\t\tthis.binding = binding;\n\n\t\t/**\n\t\t * The keyframe track value size.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.valueSize = valueSize;\n\n\t\tlet mixFunction,\n\t\t\tmixFunctionAdditive,\n\t\t\tsetIdentity;\n\n\t\t// buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t//\n\t\t// interpolators can use .buffer as their .result\n\t\t// the data then goes to 'incoming'\n\t\t//\n\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t// the cumulative result and are compared to detect\n\t\t// changes\n\t\t//\n\t\t// 'orig' stores the original state of the property\n\t\t//\n\t\t// 'add' is used for additive cumulative results\n\t\t//\n\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t// to store intermediate quaternion multiplication results\n\n\t\tswitch ( typeName ) {\n\n\t\t\tcase 'quaternion':\n\t\t\t\tmixFunction = this._slerp;\n\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 6 );\n\t\t\t\tthis._workIndex = 5;\n\t\t\t\tbreak;\n\n\t\t\tcase 'string':\n\t\t\tcase 'bool':\n\t\t\t\tmixFunction = this._select;\n\n\t\t\t\t// Use the regular mix function and for additive on these types,\n\t\t\t\t// additive is not relevant for non-numeric types\n\t\t\t\tmixFunctionAdditive = this._select;\n\n\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\n\t\t\t\tthis.buffer = new Array( valueSize * 5 );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tmixFunction = this._lerp;\n\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\n\t\t\t\tthis.buffer = new Float64Array( valueSize * 5 );\n\n\t\t}\n\n\t\tthis._mixBufferRegion = mixFunction;\n\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\tthis._setIdentity = setIdentity;\n\t\tthis._origIndex = 3;\n\t\tthis._addIndex = 4;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.cumulativeWeight = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.useCount = 0;\n\n\t\t/**\n\t\t * TODO\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.referenceCount = 0;\n\n\t}\n\n\t/**\n\t * Accumulates data in the `incoming` region into `accu<i>`.\n\t *\n\t * @param {number} accuIndex - The accumulation index.\n\t * @param {number} weight - The weight.\n\t */\n\taccumulate( accuIndex, weight ) {\n\n\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t// the weight and shouldn't have made the call in the first place\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = accuIndex * stride + stride;\n\n\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\tif ( currentWeight === 0 ) {\n\n\t\t\t// accuN := incoming * weight\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ offset + i ] = buffer[ i ];\n\n\t\t\t}\n\n\t\t\tcurrentWeight = weight;\n\n\t\t} else {\n\n\t\t\t// accuN := accuN + incoming * weight\n\n\t\t\tcurrentWeight += weight;\n\t\t\tconst mix = weight / currentWeight;\n\t\t\tthis._mixBufferRegion( buffer, offset, 0, mix, stride );\n\n\t\t}\n\n\t\tthis.cumulativeWeight = currentWeight;\n\n\t}\n\n\t/**\n\t * Accumulates data in the `incoming` region into `add`.\n\t *\n\t * @param {number} weight - The weight.\n\t */\n\taccumulateAdditive( weight ) {\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\t\t\toffset = stride * this._addIndex;\n\n\t\tif ( this.cumulativeWeightAdditive === 0 ) {\n\n\t\t\t// add = identity\n\n\t\t\tthis._setIdentity();\n\n\t\t}\n\n\t\t// add := add + incoming * weight\n\n\t\tthis._mixBufferRegionAdditive( buffer, offset, 0, weight, stride );\n\t\tthis.cumulativeWeightAdditive += weight;\n\n\t}\n\n\t/**\n\t * Applies the state of `accu<i>` to the binding when accus differ.\n\t *\n\t * @param {number} accuIndex - The accumulation index.\n\t */\n\tapply( accuIndex ) {\n\n\t\tconst stride = this.valueSize,\n\t\t\tbuffer = this.buffer,\n\t\t\toffset = accuIndex * stride + stride,\n\n\t\t\tweight = this.cumulativeWeight,\n\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\n\t\t\tbinding = this.binding;\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\tif ( weight < 1 ) {\n\n\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\n\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\tthis._mixBufferRegion(\n\t\t\t\tbuffer, offset, originalValueOffset, 1 - weight, stride );\n\n\t\t}\n\n\t\tif ( weightAdditive > 0 ) {\n\n\t\t\t// accuN := accuN + additive accuN\n\n\t\t\tthis._mixBufferRegionAdditive( buffer, offset, this._addIndex * stride, 1, stride );\n\n\t\t}\n\n\t\tfor ( let i = stride, e = stride + stride; i !== e; ++ i ) {\n\n\t\t\tif ( buffer[ i ] !== buffer[ i + stride ] ) {\n\n\t\t\t\t// value has changed -> update scene graph\n\n\t\t\t\tbinding.setValue( buffer, offset );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\n\t/**\n\t * Remembers the state of the bound property and copy it to both accus.\n\t */\n\tsaveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}\n\n\t/**\n\t * Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding.\n\t */\n\trestoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}\n\n\t// internals\n\n\t_setAdditiveIdentityNumeric() {\n\n\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\tfor ( let i = startIndex; i < endIndex; i ++ ) {\n\n\t\t\tthis.buffer[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\t_setAdditiveIdentityQuaternion() {\n\n\t\tthis._setAdditiveIdentityNumeric();\n\t\tthis.buffer[ this._addIndex * this.valueSize + 3 ] = 1;\n\n\t}\n\n\t_setAdditiveIdentityOther() {\n\n\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\tfor ( let i = 0; i < this.valueSize; i ++ ) {\n\n\t\t\tthis.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];\n\n\t\t}\n\n\t}\n\n\n\t// mix functions\n\n\t_select( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tif ( t >= 0.5 ) {\n\n\t\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\t\tbuffer[ dstOffset + i ] = buffer[ srcOffset + i ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_slerp( buffer, dstOffset, srcOffset, t ) {\n\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t );\n\n\t}\n\n\t_slerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst workOffset = this._workIndex * stride;\n\n\t\t// Store result in intermediate buffer offset\n\t\tQuaternion.multiplyQuaternionsFlat( buffer, workOffset, buffer, dstOffset, buffer, srcOffset );\n\n\t\t// Slerp to the intermediate result\n\t\tQuaternion.slerpFlat( buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t );\n\n\t}\n\n\t_lerp( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tconst s = 1 - t;\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] * s + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n\t_lerpAdditive( buffer, dstOffset, srcOffset, t, stride ) {\n\n\t\tfor ( let i = 0; i !== stride; ++ i ) {\n\n\t\t\tconst j = dstOffset + i;\n\n\t\t\tbuffer[ j ] = buffer[ j ] + buffer[ srcOffset + i ] * t;\n\n\t\t}\n\n\t}\n\n}\n\n// Characters [].:/ are reserved for track binding syntax.\nconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\nconst _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' );\n\n// Attempts to allow node names from any language. ES5's `\\w` regexp matches\n// only latin characters, and the unicode \\p{L} is not yet supported. So\n// instead, we exclude reserved characters and match everything else.\nconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\nconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\\\.', '' ) + ']';\n\n// Parent directories, delimited by '/' or ':'. Currently unused, but must\n// be matched to parse the rest of the track name.\nconst _directoryRe = /*@__PURE__*/ /((?:WC+[\\/:])*)/.source.replace( 'WC', _wordChar );\n\n// Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\nconst _nodeRe = /*@__PURE__*/ /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );\n\n// Object on target node, and accessor. May not contain reserved\n// characters. Accessor may contain any character except closing bracket.\nconst _objectRe = /*@__PURE__*/ /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace( 'WC', _wordChar );\n\n// Property and accessor. May not contain reserved characters. Accessor may\n// contain any non-bracket characters.\nconst _propertyRe = /*@__PURE__*/ /\\.(WC+)(?:\\[(.+)\\])?/.source.replace( 'WC', _wordChar );\n\nconst _trackRe = new RegExp( ''\n\t+ '^'\n\t+ _directoryRe\n\t+ _nodeRe\n\t+ _objectRe\n\t+ _propertyRe\n\t+ '$'\n);\n\nconst _supportedObjectNames = [ 'material', 'materials', 'bones', 'map' ];\n\nclass Composite {\n\n\tconstructor( targetGroup, path, optionalParsedPath ) {\n\n\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName( path );\n\n\t\tthis._targetGroup = targetGroup;\n\t\tthis._bindings = targetGroup.subscribe_( path, parsedPath );\n\n\t}\n\n\tgetValue( array, offset ) {\n\n\t\tthis.bind(); // bind all binding\n\n\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\tbinding = this._bindings[ firstValidIndex ];\n\n\t\t// and only call .getValue on the first\n\t\tif ( binding !== undefined ) binding.getValue( array, offset );\n\n\t}\n\n\tsetValue( array, offset ) {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].setValue( array, offset );\n\n\t\t}\n\n\t}\n\n\tbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].bind();\n\n\t\t}\n\n\t}\n\n\tunbind() {\n\n\t\tconst bindings = this._bindings;\n\n\t\tfor ( let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tbindings[ i ].unbind();\n\n\t\t}\n\n\t}\n\n}\n\n// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\n\n\n/**\n * This holds a reference to a real property in the scene graph; used internally.\n */\nclass PropertyBinding {\n\n\t/**\n\t * Constructs a new property binding.\n\t *\n\t * @param {Object} rootNode - The root node.\n\t * @param {string} path - The path.\n\t * @param {?Object} [parsedPath] - The parsed path.\n\t */\n\tconstructor( rootNode, path, parsedPath ) {\n\n\t\t/**\n\t\t * The object path to the animated property.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.path = path;\n\n\t\t/**\n\t\t * An object holding information about the path.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );\n\n\t\t/**\n\t\t * The object owns the animated property.\n\t\t *\n\t\t * @type {?Object}\n\t\t */\n\t\tthis.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );\n\n\t\t/**\n\t\t * The root node.\n\t\t *\n\t\t * @type {Object3D|Skeleton}\n\t\t */\n\t\tthis.rootNode = rootNode;\n\n\t\t// initial state of these methods that calls 'bind'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n\n\t/**\n\t * Factory method for creating a property binding from the given parameters.\n\t *\n\t * @static\n\t * @param {Object} root - The root node.\n\t * @param {string} path - The path.\n\t * @param {?Object} [parsedPath] - The parsed path.\n\t * @return {PropertyBinding|Composite} The created property binding or composite.\n\t */\n\tstatic create( root, path, parsedPath ) {\n\n\t\tif ( ! ( root && root.isAnimationObjectGroup ) ) {\n\n\t\t\treturn new PropertyBinding( root, path, parsedPath );\n\n\t\t} else {\n\n\t\t\treturn new PropertyBinding.Composite( root, path, parsedPath );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Replaces spaces with underscores and removes unsupported characters from\n\t * node names, to ensure compatibility with parseTrackName().\n\t *\n\t * @param {string} name - Node name to be sanitized.\n\t * @return {string} The sanitized node name.\n\t */\n\tstatic sanitizeNodeName( name ) {\n\n\t\treturn name.replace( /\\s/g, '_' ).replace( _reservedRe, '' );\n\n\t}\n\n\t/**\n\t * Parses the given track name (an object path to an animated property) and\n\t * returns an object with information about the path. Matches strings in the following forms:\n\t *\n\t * - nodeName.property\n\t * - nodeName.property[accessor]\n\t * - nodeName.material.property[accessor]\n\t * - uuid.property[accessor]\n\t * - uuid.objectName[objectIndex].propertyName[propertyIndex]\n\t * - parentName/nodeName.property\n\t * - parentName/parentName/nodeName.property[index]\n\t * - .bone[Armature.DEF_cog].position\n\t * - scene:helium_balloon_model:helium_balloon_model.position\n\t *\n\t * @static\n\t * @param {string} trackName - The track name to parse.\n\t * @return {Object} The parsed track name as an object.\n\t */\n\tstatic parseTrackName( trackName ) {\n\n\t\tconst matches = _trackRe.exec( trackName );\n\n\t\tif ( matches === null ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName );\n\n\t\t}\n\n\t\tconst results = {\n\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\tnodeName: matches[ 2 ],\n\t\t\tobjectName: matches[ 3 ],\n\t\t\tobjectIndex: matches[ 4 ],\n\t\t\tpropertyName: matches[ 5 ], // required\n\t\t\tpropertyIndex: matches[ 6 ]\n\t\t};\n\n\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' );\n\n\t\tif ( lastDot !== undefined && lastDot !== -1 ) {\n\n\t\t\tconst objectName = results.nodeName.substring( lastDot + 1 );\n\n\t\t\t// Object names must be checked against an allowlist. Otherwise, there\n\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t// include '.' characters).\n\t\t\tif ( _supportedObjectNames.indexOf( objectName ) !== -1 ) {\n\n\t\t\t\tresults.nodeName = results.nodeName.substring( 0, lastDot );\n\t\t\t\tresults.objectName = objectName;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( results.propertyName === null || results.propertyName.length === 0 ) {\n\n\t\t\tthrow new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName );\n\n\t\t}\n\n\t\treturn results;\n\n\t}\n\n\t/**\n\t * Searches for a node in the hierarchy of the given root object by the given\n\t * node name.\n\t *\n\t * @static\n\t * @param {Object} root - The root object.\n\t * @param {string|number} nodeName - The name of the node.\n\t * @return {?Object} The found node. Returns `null` if no object was found.\n\t */\n\tstatic findNode( root, nodeName ) {\n\n\t\tif ( nodeName === undefined || nodeName === '' || nodeName === '.' || nodeName === -1 || nodeName === root.name || nodeName === root.uuid ) {\n\n\t\t\treturn root;\n\n\t\t}\n\n\t\t// search into skeleton bones.\n\t\tif ( root.skeleton ) {\n\n\t\t\tconst bone = root.skeleton.getBoneByName( nodeName );\n\n\t\t\tif ( bone !== undefined ) {\n\n\t\t\t\treturn bone;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// search into node subtree.\n\t\tif ( root.children ) {\n\n\t\t\tconst searchNodeSubtree = function ( children ) {\n\n\t\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\t\tconst childNode = children[ i ];\n\n\t\t\t\t\tif ( childNode.name === nodeName || childNode.uuid === nodeName ) {\n\n\t\t\t\t\t\treturn childNode;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst result = searchNodeSubtree( childNode.children );\n\n\t\t\t\t\tif ( result ) return result;\n\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\n\t\t\t};\n\n\t\t\tconst subTreeNode = searchNodeSubtree( root.children );\n\n\t\t\tif ( subTreeNode ) {\n\n\t\t\t\treturn subTreeNode;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t// these are used to \"bind\" a nonexistent property\n\t_getValue_unavailable() {}\n\t_setValue_unavailable() {}\n\n\t// Getters\n\n\t_getValue_direct( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.targetObject[ this.propertyName ];\n\n\t}\n\n\t_getValue_array( buffer, offset ) {\n\n\t\tconst source = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = source.length; i !== n; ++ i ) {\n\n\t\t\tbuffer[ offset ++ ] = source[ i ];\n\n\t\t}\n\n\t}\n\n\t_getValue_arrayElement( buffer, offset ) {\n\n\t\tbuffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];\n\n\t}\n\n\t_getValue_toArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.toArray( buffer, offset );\n\n\t}\n\n\t// Direct\n\n\t_setValue_direct( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_direct_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_direct_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.targetObject[ this.propertyName ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// EntireArray\n\n\t_setValue_array( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t}\n\n\t_setValue_array_setNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tconst dest = this.resolvedProperty;\n\n\t\tfor ( let i = 0, n = dest.length; i !== n; ++ i ) {\n\n\t\t\tdest[ i ] = buffer[ offset ++ ];\n\n\t\t}\n\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// ArrayElement\n\n\t_setValue_arrayElement( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\n\t}\n\n\t_setValue_arrayElement_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_arrayElement_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty[ this.propertyIndex ] = buffer[ offset ];\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t// HasToFromArray\n\n\t_setValue_fromArray( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\n\t}\n\n\t_setValue_fromArray_setNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.needsUpdate = true;\n\n\t}\n\n\t_setValue_fromArray_setMatrixWorldNeedsUpdate( buffer, offset ) {\n\n\t\tthis.resolvedProperty.fromArray( buffer, offset );\n\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\n\t}\n\n\t_getValue_unbound( targetArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.getValue( targetArray, offset );\n\n\t}\n\n\t_setValue_unbound( sourceArray, offset ) {\n\n\t\tthis.bind();\n\t\tthis.setValue( sourceArray, offset );\n\n\t}\n\n\t/**\n\t * Creates a getter / setter pair for the property tracked by this binding.\n\t */\n\tbind() {\n\n\t\tlet targetObject = this.node;\n\t\tconst parsedPath = this.parsedPath;\n\n\t\tconst objectName = parsedPath.objectName;\n\t\tconst propertyName = parsedPath.propertyName;\n\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\tif ( ! targetObject ) {\n\n\t\t\ttargetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName );\n\n\t\t\tthis.node = targetObject;\n\n\t\t}\n\n\t\t// set fail state so we can just 'return' on error\n\t\tthis.getValue = this._getValue_unavailable;\n\t\tthis.setValue = this._setValue_unavailable;\n\n\t\t// ensure there is a value node\n\t\tif ( ! targetObject ) {\n\n\t\t\tconsole.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( objectName ) {\n\n\t\t\tlet objectIndex = parsedPath.objectIndex;\n\n\t\t\t// special cases were we need to reach deeper into the hierarchy to get the face materials....\n\t\t\tswitch ( objectName ) {\n\n\t\t\t\tcase 'materials':\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.materials ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.materials;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'bones':\n\n\t\t\t\t\tif ( ! targetObject.skeleton ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t// and convert the integer string to a true integer.\n\n\t\t\t\t\ttargetObject = targetObject.skeleton.bones;\n\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tfor ( let i = 0; i < targetObject.length; i ++ ) {\n\n\t\t\t\t\t\tif ( targetObject[ i ].name === objectIndex ) {\n\n\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'map':\n\n\t\t\t\t\tif ( 'map' in targetObject ) {\n\n\t\t\t\t\t\ttargetObject = targetObject.map;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! targetObject.material.map ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject.material.map;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( targetObject[ objectName ] === undefined ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[ objectName ];\n\n\t\t\t}\n\n\n\t\t\tif ( objectIndex !== undefined ) {\n\n\t\t\t\tif ( targetObject[ objectIndex ] === undefined ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\ttargetObject = targetObject[ objectIndex ];\n\n\t\t\t}\n\n\t\t}\n\n\t\t// resolve property\n\t\tconst nodeProperty = targetObject[ propertyName ];\n\n\t\tif ( nodeProperty === undefined ) {\n\n\t\t\tconst nodeName = parsedPath.nodeName;\n\n\t\t\tconsole.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +\n\t\t\t\t'.' + propertyName + ' but it wasn\\'t found.', targetObject );\n\t\t\treturn;\n\n\t\t}\n\n\t\t// determine versioning scheme\n\t\tlet versioning = this.Versioning.None;\n\n\t\tthis.targetObject = targetObject;\n\n\t\tif ( targetObject.isMaterial === true ) {\n\n\t\t\tversioning = this.Versioning.NeedsUpdate;\n\n\t\t} else if ( targetObject.isObject3D === true ) {\n\n\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\n\t\t}\n\n\t\t// determine how the property gets bound\n\t\tlet bindingType = this.BindingType.Direct;\n\n\t\tif ( propertyIndex !== undefined ) {\n\n\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\n\t\t\tif ( propertyName === 'morphTargetInfluences' ) {\n\n\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\n\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\tif ( ! targetObject.geometry ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! targetObject.geometry.morphAttributes ) {\n\n\t\t\t\t\tconsole.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tif ( targetObject.morphTargetDictionary[ propertyIndex ] !== undefined ) {\n\n\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[ propertyIndex ];\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbindingType = this.BindingType.ArrayElement;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\tthis.propertyIndex = propertyIndex;\n\n\t\t} else if ( nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined ) {\n\n\t\t\t// must use copy for Object3D.Euler/Quaternion\n\n\t\t\tbindingType = this.BindingType.HasFromToArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else if ( Array.isArray( nodeProperty ) ) {\n\n\t\t\tbindingType = this.BindingType.EntireArray;\n\n\t\t\tthis.resolvedProperty = nodeProperty;\n\n\t\t} else {\n\n\t\t\tthis.propertyName = propertyName;\n\n\t\t}\n\n\t\t// select getter / setter\n\t\tthis.getValue = this.GetterByBindingType[ bindingType ];\n\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[ bindingType ][ versioning ];\n\n\t}\n\n\t/**\n\t * Unbinds the property.\n\t */\n\tunbind() {\n\n\t\tthis.node = null;\n\n\t\t// back to the prototype version of getValue / setValue\n\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\t\tthis.getValue = this._getValue_unbound;\n\t\tthis.setValue = this._setValue_unbound;\n\n\t}\n\n}\n\nPropertyBinding.Composite = Composite;\n\nPropertyBinding.prototype.BindingType = {\n\tDirect: 0,\n\tEntireArray: 1,\n\tArrayElement: 2,\n\tHasFromToArray: 3\n};\n\nPropertyBinding.prototype.Versioning = {\n\tNone: 0,\n\tNeedsUpdate: 1,\n\tMatrixWorldNeedsUpdate: 2\n};\n\nPropertyBinding.prototype.GetterByBindingType = [\n\n\tPropertyBinding.prototype._getValue_direct,\n\tPropertyBinding.prototype._getValue_array,\n\tPropertyBinding.prototype._getValue_arrayElement,\n\tPropertyBinding.prototype._getValue_toArray,\n\n];\n\nPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [\n\n\t[\n\t\t// Direct\n\t\tPropertyBinding.prototype._setValue_direct,\n\t\tPropertyBinding.prototype._setValue_direct_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// EntireArray\n\n\t\tPropertyBinding.prototype._setValue_array,\n\t\tPropertyBinding.prototype._setValue_array_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// ArrayElement\n\t\tPropertyBinding.prototype._setValue_arrayElement,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate,\n\n\t], [\n\n\t\t// HasToFromArray\n\t\tPropertyBinding.prototype._setValue_fromArray,\n\t\tPropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,\n\t\tPropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate,\n\n\t]\n\n];\n\n/**\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * - Add objects you would otherwise pass as 'root' to the\n * constructor or the .clipAction method of AnimationMixer.\n * - Instead pass this object as 'root'.\n * - You can also add and remove objects later when the mixer is running.\n *\n * Note:\n *\n * - Objects of this class appear as one object to the mixer,\n * so cache control of the individual objects must be done on the group.\n *\n * Limitation:\n *\n * - The animated properties must be compatible among the all objects in the group.\n * - A single property can either be controlled through a target group or directly, but not both.\n */\nclass AnimationObjectGroup {\n\n\t/**\n\t * Constructs a new animation group.\n\t *\n\t * @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isAnimationObjectGroup = true;\n\n\t\t/**\n\t\t * The UUID of the 3D object.\n\t\t *\n\t\t * @type {string}\n\t\t * @readonly\n\t\t */\n\t\tthis.uuid = generateUUID();\n\n\t\t// cached objects followed by the active ones\n\t\tthis._objects = Array.prototype.slice.call( arguments );\n\n\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t// note: read by PropertyBinding.Composite\n\n\t\tconst indices = {};\n\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tindices[ arguments[ i ].uuid ] = i;\n\n\t\t}\n\n\t\tthis._paths = []; // inside: string\n\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tobjects: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._objects.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tget bindingsPerObject() {\n\n\t\t\t\treturn scope._bindings.length;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t/**\n\t * Adds an arbitrary number of objects to this animation group.\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to add.\n\t */\n\tadd() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tpaths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet knownObject = undefined,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid;\n\t\t\tlet index = indicesByUUID[ uuid ];\n\n\t\t\tif ( index === undefined ) {\n\n\t\t\t\t// unknown object -> add it to the ACTIVE region\n\n\t\t\t\tindex = nObjects ++;\n\t\t\t\tindicesByUUID[ uuid ] = index;\n\t\t\t\tobjects.push( object );\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tbindings[ j ].push( new PropertyBinding( object, paths[ j ], parsedPaths[ j ] ) );\n\n\t\t\t\t}\n\n\t\t\t} else if ( index < nCachedObjects ) {\n\n\t\t\t\tknownObject = objects[ index ];\n\n\t\t\t\t// move existing object to the ACTIVE region\n\n\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ];\n\n\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = firstActiveIndex;\n\t\t\t\tobjects[ firstActiveIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ];\n\n\t\t\t\t\tlet binding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\n\t\t\t\t\tif ( binding === undefined ) {\n\n\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t// or may not exist\n\n\t\t\t\t\t\tbinding = new PropertyBinding( object, paths[ j ], parsedPaths[ j ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t} else if ( objects[ index ] !== knownObject ) {\n\n\t\t\t\tconsole.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +\n\t\t\t\t\t'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );\n\n\t\t\t} // else the object is already where we want it to be\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t/**\n\t * Removes an arbitrary number of objects to this animation group\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to remove.\n\t */\n\tremove() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined && index >= nCachedObjects ) {\n\n\t\t\t\t// move existing object into the CACHED region\n\n\t\t\t\tconst lastCachedIndex = nCachedObjects ++,\n\t\t\t\t\tfirstActiveObject = objects[ lastCachedIndex ];\n\n\t\t\t\tindicesByUUID[ firstActiveObject.uuid ] = index;\n\t\t\t\tobjects[ index ] = firstActiveObject;\n\n\t\t\t\tindicesByUUID[ uuid ] = lastCachedIndex;\n\t\t\t\tobjects[ lastCachedIndex ] = object;\n\n\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\tfirstActive = bindingsForPath[ lastCachedIndex ],\n\t\t\t\t\t\tbinding = bindingsForPath[ index ];\n\n\t\t\t\t\tbindingsForPath[ index ] = firstActive;\n\t\t\t\t\tbindingsForPath[ lastCachedIndex ] = binding;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for the passed 3D objects of this animation group.\n\t *\n\t * @param {...Object3D} arguments - The 3D objects to uncache.\n\t */\n\tuncache() {\n\n\t\tconst objects = this._objects,\n\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\tbindings = this._bindings,\n\t\t\tnBindings = bindings.length;\n\n\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\tnObjects = objects.length;\n\n\t\tfor ( let i = 0, n = arguments.length; i !== n; ++ i ) {\n\n\t\t\tconst object = arguments[ i ],\n\t\t\t\tuuid = object.uuid,\n\t\t\t\tindex = indicesByUUID[ uuid ];\n\n\t\t\tif ( index !== undefined ) {\n\n\t\t\t\tdelete indicesByUUID[ uuid ];\n\n\t\t\t\tif ( index < nCachedObjects ) {\n\n\t\t\t\t\t// object is cached, shrink the CACHED region\n\n\t\t\t\t\tconst firstActiveIndex = -- nCachedObjects,\n\t\t\t\t\t\tlastCachedObject = objects[ firstActiveIndex ],\n\t\t\t\t\t\tlastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\t// last cached object takes this object's place\n\t\t\t\t\tindicesByUUID[ lastCachedObject.uuid ] = index;\n\t\t\t\t\tobjects[ index ] = lastCachedObject;\n\n\t\t\t\t\t// last object goes to the activated slot and pop\n\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = firstActiveIndex;\n\t\t\t\t\tobjects[ firstActiveIndex ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ],\n\t\t\t\t\t\t\tlastCached = bindingsForPath[ firstActiveIndex ],\n\t\t\t\t\t\t\tlast = bindingsForPath[ lastIndex ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = lastCached;\n\t\t\t\t\t\tbindingsForPath[ firstActiveIndex ] = last;\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// object is active, just swap with the last and pop\n\n\t\t\t\t\tconst lastIndex = -- nObjects,\n\t\t\t\t\t\tlastObject = objects[ lastIndex ];\n\n\t\t\t\t\tif ( lastIndex > 0 ) {\n\n\t\t\t\t\t\tindicesByUUID[ lastObject.uuid ] = index;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobjects[ index ] = lastObject;\n\t\t\t\t\tobjects.pop();\n\n\t\t\t\t\t// accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor ( let j = 0, m = nBindings; j !== m; ++ j ) {\n\n\t\t\t\t\t\tconst bindingsForPath = bindings[ j ];\n\n\t\t\t\t\t\tbindingsForPath[ index ] = bindingsForPath[ lastIndex ];\n\t\t\t\t\t\tbindingsForPath.pop();\n\n\t\t\t\t\t}\n\n\t\t\t\t} // cached or active\n\n\t\t\t} // if object is known\n\n\t\t} // for arguments\n\n\t\tthis.nCachedObjects_ = nCachedObjects;\n\n\t}\n\n\t// Internal interface used by befriended PropertyBinding.Composite:\n\n\tsubscribe_( path, parsedPath ) {\n\n\t\t// returns an array of bindings for the given path that is changed\n\t\t// according to the contained objects in the group\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\tlet index = indicesByPath[ path ];\n\t\tconst bindings = this._bindings;\n\n\t\tif ( index !== undefined ) return bindings[ index ];\n\n\t\tconst paths = this._paths,\n\t\t\tparsedPaths = this._parsedPaths,\n\t\t\tobjects = this._objects,\n\t\t\tnObjects = objects.length,\n\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\tbindingsForPath = new Array( nObjects );\n\n\t\tindex = bindings.length;\n\n\t\tindicesByPath[ path ] = index;\n\n\t\tpaths.push( path );\n\t\tparsedPaths.push( parsedPath );\n\t\tbindings.push( bindingsForPath );\n\n\t\tfor ( let i = nCachedObjects, n = objects.length; i !== n; ++ i ) {\n\n\t\t\tconst object = objects[ i ];\n\t\t\tbindingsForPath[ i ] = new PropertyBinding( object, path, parsedPath );\n\n\t\t}\n\n\t\treturn bindingsForPath;\n\n\t}\n\n\tunsubscribe_( path ) {\n\n\t\t// tells the group to forget about a property path and no longer\n\t\t// update the array previously obtained with 'subscribe_'\n\n\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\tindex = indicesByPath[ path ];\n\n\t\tif ( index !== undefined ) {\n\n\t\t\tconst paths = this._paths,\n\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\tbindings = this._bindings,\n\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\tlastBindings = bindings[ lastBindingsIndex ],\n\t\t\t\tlastBindingsPath = path[ lastBindingsIndex ];\n\n\t\t\tindicesByPath[ lastBindingsPath ] = index;\n\n\t\t\tbindings[ index ] = lastBindings;\n\t\t\tbindings.pop();\n\n\t\t\tparsedPaths[ index ] = parsedPaths[ lastBindingsIndex ];\n\t\t\tparsedPaths.pop();\n\n\t\t\tpaths[ index ] = paths[ lastBindingsIndex ];\n\t\t\tpaths.pop();\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * An instance of `AnimationAction` schedules the playback of an animation which is\n * stored in {@link AnimationClip}.\n */\nclass AnimationAction {\n\n\t/**\n\t * Constructs a new animation action.\n\t *\n\t * @param {AnimationMixer} mixer - The mixer that is controlled by this action.\n\t * @param {AnimationClip} clip - The animation clip that holds the actual keyframes.\n\t * @param {?Object3D} [localRoot=null] - The root object on which this action is performed.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode.\n\t */\n\tconstructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) {\n\n\t\tthis._mixer = mixer;\n\t\tthis._clip = clip;\n\t\tthis._localRoot = localRoot;\n\n\t\t/**\n\t\t * Defines how the animation is blended/combined when two or more animations\n\t\t * are simultaneously played.\n\t\t *\n\t\t * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)}\n\t\t */\n\t\tthis.blendMode = blendMode;\n\n\t\tconst tracks = clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tinterpolants = new Array( nTracks );\n\n\t\tconst interpolantSettings = {\n\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t};\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst interpolant = tracks[ i ].createInterpolant( null );\n\t\t\tinterpolants[ i ] = interpolant;\n\t\t\tinterpolant.settings = interpolantSettings;\n\n\t\t}\n\n\t\tthis._interpolantSettings = interpolantSettings;\n\n\t\tthis._interpolants = interpolants; // bound by the mixer\n\n\t\t// inside: PropertyMixer (managed by the mixer)\n\t\tthis._propertyBindings = new Array( nTracks );\n\n\t\tthis._cacheIndex = null; // for the memory manager\n\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\tthis._timeScaleInterpolant = null;\n\t\tthis._weightInterpolant = null;\n\n\t\t/**\n\t\t * The loop mode, set via {@link AnimationAction#setLoop}.\n\t\t *\n\t\t * @type {(LoopRepeat|LoopOnce|LoopPingPong)}\n\t\t * @default LoopRepeat\n\t\t */\n\t\tthis.loop = LoopRepeat;\n\t\tthis._loopCount = -1;\n\n\t\t// global mixer time when the action is to be started\n\t\t// it's set back to 'null' upon start of the action\n\t\tthis._startTime = null;\n\n\t\t/**\n\t\t * The local time of this action (in seconds, starting with `0`).\n\t\t *\n\t\t * The value gets clamped or wrapped to `[0,clip.duration]` (according to the\n\t\t * loop state).\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.time = 0;\n\n\t\t/**\n\t\t * Scaling factor for the {@link AnimationAction#time}. A value of `0` causes the\n\t\t * animation to pause. Negative values cause the animation to play backwards.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.timeScale = 1;\n\t\tthis._effectiveTimeScale = 1;\n\n\t\t/**\n\t\t * The degree of influence of this action (in the interval `[0, 1]`). Values\n\t\t * between `0` (no impact) and `1` (full impact) can be used to blend between\n\t\t * several actions.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.weight = 1;\n\t\tthis._effectiveWeight = 1;\n\n\t\t/**\n\t\t * The number of repetitions of the performed clip over the course of this action.\n\t\t * Can be set via {@link AnimationAction#setLoop}.\n\t\t *\n\t\t * Setting this number has no effect if {@link AnimationAction#loop} is set to\n\t\t * `THREE:LoopOnce`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.repetitions = Infinity;\n\n\t\t/**\n\t\t * If set to `true`, the playback of the action is paused.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.paused = false;\n\n\t\t/**\n\t\t * If set to `false`, the action is disabled so it has no impact.\n\t\t *\n\t\t * When the action is re-enabled, the animation continues from its current\n\t\t * time (setting `enabled` to `false` doesn't reset the action).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.enabled = true;\n\n\t\t/**\n\t\t * If set to true the animation will automatically be paused on its last frame.\n\t\t *\n\t\t * If set to false, {@link AnimationAction#enabled} will automatically be switched\n\t\t * to `false` when the last loop of the action has finished, so that this action has\n\t\t * no further impact.\n\t\t *\n\t\t * Note: This member has no impact if the action is interrupted (it\n\t\t * has only an effect if its last loop has really finished).\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.clampWhenFinished = false;\n\n\t\t/**\n\t\t * Enables smooth interpolation without separate clips for start, loop and end.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.zeroSlopeAtStart = true;\n\n\t\t/**\n\t\t * Enables smooth interpolation without separate clips for start, loop and end.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.zeroSlopeAtEnd = true;\n\n\t}\n\n\t/**\n\t * Starts the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tplay() {\n\n\t\tthis._mixer._activateAction( this );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstop() {\n\n\t\tthis._mixer._deactivateAction( this );\n\n\t\treturn this.reset();\n\n\t}\n\n\t/**\n\t * Resets the playback of the animation.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\treset() {\n\n\t\tthis.paused = false;\n\t\tthis.enabled = true;\n\n\t\tthis.time = 0; // restart clip\n\t\tthis._loopCount = -1;// forget previous loops\n\t\tthis._startTime = null;// forget scheduling\n\n\t\treturn this.stopFading().stopWarping();\n\n\t}\n\n\t/**\n\t * Returns `true` if the animation is running.\n\t *\n\t * @return {boolean} Whether the animation is running or not.\n\t */\n\tisRunning() {\n\n\t\treturn this.enabled && ! this.paused && this.timeScale !== 0 &&\n\t\t\tthis._startTime === null && this._mixer._isActiveAction( this );\n\n\t}\n\n\t/**\n\t * Returns `true` when {@link AnimationAction#play} has been called.\n\t *\n\t * @return {boolean} Whether the animation is scheduled or not.\n\t */\n\tisScheduled() {\n\n\t\treturn this._mixer._isActiveAction( this );\n\n\t}\n\n\t/**\n\t * Defines the time when the animation should start.\n\t *\n\t * @param {number} time - The start time in seconds.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstartAt( time ) {\n\n\t\tthis._startTime = time;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Configures the loop settings for this action.\n\t *\n\t * @param {(LoopRepeat|LoopOnce|LoopPingPong)} mode - The loop mode.\n\t * @param {number} repetitions - The number of repetitions.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetLoop( mode, repetitions ) {\n\n\t\tthis.loop = mode;\n\t\tthis.repetitions = repetitions;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the effective weight of this action.\n\t *\n\t * An action has no effect and thus an effective weight of zero when the\n\t * action is disabled.\n\t *\n\t * @param {number} weight - The weight to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetEffectiveWeight( weight ) {\n\n\t\tthis.weight = weight;\n\n\t\t// note: same logic as when updated at runtime\n\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\n\t\treturn this.stopFading();\n\n\t}\n\n\t/**\n\t * Returns the effective weight of this action.\n\t *\n\t * @return {number} The effective weight.\n\t */\n\tgetEffectiveWeight() {\n\n\t\treturn this._effectiveWeight;\n\n\t}\n\n\t/**\n\t * Fades the animation in by increasing its weight gradually from `0` to `1`,\n\t * within the passed time interval.\n\t *\n\t * @param {number} duration - The duration of the fade.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tfadeIn( duration ) {\n\n\t\treturn this._scheduleFading( duration, 0, 1 );\n\n\t}\n\n\t/**\n\t * Fades the animation out by decreasing its weight gradually from `1` to `0`,\n\t * within the passed time interval.\n\t *\n\t * @param {number} duration - The duration of the fade.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tfadeOut( duration ) {\n\n\t\treturn this._scheduleFading( duration, 1, 0 );\n\n\t}\n\n\t/**\n\t * Causes this action to fade in and the given action to fade out,\n\t * within the passed time interval.\n\t *\n\t * @param {AnimationAction} fadeOutAction - The animation action to fade out.\n\t * @param {number} duration - The duration of the fade.\n\t * @param {boolean} [warp=false] - Whether warping should be used or not.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tcrossFadeFrom( fadeOutAction, duration, warp = false ) {\n\n\t\tfadeOutAction.fadeOut( duration );\n\t\tthis.fadeIn( duration );\n\n\t\tif ( warp === true ) {\n\n\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\n\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\n\t\t\tfadeOutAction.warp( 1.0, startEndRatio, duration );\n\t\t\tthis.warp( endStartRatio, 1.0, duration );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Causes this action to fade out and the given action to fade in,\n\t * within the passed time interval.\n\t *\n\t * @param {AnimationAction} fadeInAction - The animation action to fade in.\n\t * @param {number} duration - The duration of the fade.\n\t * @param {boolean} [warp=false] - Whether warping should be used or not.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tcrossFadeTo( fadeInAction, duration, warp = false ) {\n\n\t\treturn fadeInAction.crossFadeFrom( this, duration, warp );\n\n\t}\n\n\t/**\n\t * Stops any fading which is applied to this action.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstopFading() {\n\n\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\tif ( weightInterpolant !== null ) {\n\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( weightInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the effective time scale of this action.\n\t *\n\t * An action has no effect and thus an effective time scale of zero when the\n\t * action is paused.\n\t *\n\t * @param {number} timeScale - The time scale to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetEffectiveTimeScale( timeScale ) {\n\n\t\tthis.timeScale = timeScale;\n\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Returns the effective time scale of this action.\n\t *\n\t * @return {number} The effective time scale.\n\t */\n\tgetEffectiveTimeScale() {\n\n\t\treturn this._effectiveTimeScale;\n\n\t}\n\n\t/**\n\t * Sets the duration for a single loop of this action.\n\t *\n\t * @param {number} duration - The duration to set.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsetDuration( duration ) {\n\n\t\tthis.timeScale = this._clip.duration / duration;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Synchronizes this action with the passed other action.\n\t *\n\t * @param {AnimationAction} action - The action to sync with.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tsyncWith( action ) {\n\n\t\tthis.time = action.time;\n\t\tthis.timeScale = action.timeScale;\n\n\t\treturn this.stopWarping();\n\n\t}\n\n\t/**\n\t * Decelerates this animation's speed to `0` within the passed time interval.\n\t *\n\t * @param {number} duration - The duration.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\thalt( duration ) {\n\n\t\treturn this.warp( this._effectiveTimeScale, 0, duration );\n\n\t}\n\n\t/**\n\t * Changes the playback speed, within the passed time interval, by modifying\n\t * {@link AnimationAction#timeScale} gradually from `startTimeScale` to\n\t * `endTimeScale`.\n\t *\n\t * @param {number} startTimeScale - The start time scale.\n\t * @param {number} endTimeScale - The end time scale.\n\t * @param {number} duration - The duration.\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\twarp( startTimeScale, endTimeScale, duration ) {\n\n\t\tconst mixer = this._mixer,\n\t\t\tnow = mixer.time,\n\t\t\ttimeScale = this.timeScale;\n\n\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._timeScaleInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\ttimes[ 1 ] = now + duration;\n\n\t\tvalues[ 0 ] = startTimeScale / timeScale;\n\t\tvalues[ 1 ] = endTimeScale / timeScale;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Stops any scheduled warping which is applied to this action.\n\t *\n\t * @return {AnimationAction} A reference to this animation action.\n\t */\n\tstopWarping() {\n\n\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\tif ( timeScaleInterpolant !== null ) {\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._mixer._takeBackControlInterpolant( timeScaleInterpolant );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the animation mixer of this animation action.\n\t *\n\t * @return {AnimationMixer} The animation mixer.\n\t */\n\tgetMixer() {\n\n\t\treturn this._mixer;\n\n\t}\n\n\t/**\n\t * Returns the animation clip of this animation action.\n\t *\n\t * @return {AnimationClip} The animation clip.\n\t */\n\tgetClip() {\n\n\t\treturn this._clip;\n\n\t}\n\n\t/**\n\t * Returns the root object of this animation action.\n\t *\n\t * @return {Object3D} The root object.\n\t */\n\tgetRoot() {\n\n\t\treturn this._localRoot || this._mixer._root;\n\n\t}\n\n\t// Interna\n\n\t_update( time, deltaTime, timeDirection, accuIndex ) {\n\n\t\t// called by the mixer\n\n\t\tif ( ! this.enabled ) {\n\n\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\n\t\t\tthis._updateWeight( time );\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst startTime = this._startTime;\n\n\t\tif ( startTime !== null ) {\n\n\t\t\t// check for scheduled start of action\n\n\t\t\tconst timeRunning = ( time - startTime ) * timeDirection;\n\t\t\tif ( timeRunning < 0 || timeDirection === 0 ) {\n\n\t\t\t\tdeltaTime = 0;\n\n\t\t\t} else {\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// apply time scale and advance time\n\n\t\tdeltaTime *= this._updateTimeScale( time );\n\t\tconst clipTime = this._updateTime( deltaTime );\n\n\t\t// note: _updateTime may disable the action resulting in\n\t\t// an effective weight of 0\n\n\t\tconst weight = this._updateWeight( time );\n\n\t\tif ( weight > 0 ) {\n\n\t\t\tconst interpolants = this._interpolants;\n\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\tswitch ( this.blendMode ) {\n\n\t\t\t\tcase AdditiveAnimationBlendMode:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulateAdditive( weight );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\tdefault:\n\n\t\t\t\t\tfor ( let j = 0, m = interpolants.length; j !== m; ++ j ) {\n\n\t\t\t\t\t\tinterpolants[ j ].evaluate( clipTime );\n\t\t\t\t\t\tpropertyMixers[ j ].accumulate( accuIndex, weight );\n\n\t\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_updateWeight( time ) {\n\n\t\tlet weight = 0;\n\n\t\tif ( this.enabled ) {\n\n\t\t\tweight = this.weight;\n\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\tif ( interpolantValue === 0 ) {\n\n\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\tthis.enabled = false;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveWeight = weight;\n\t\treturn weight;\n\n\t}\n\n\t_updateTimeScale( time ) {\n\n\t\tlet timeScale = 0;\n\n\t\tif ( ! this.paused ) {\n\n\t\t\ttimeScale = this.timeScale;\n\n\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\tif ( interpolant !== null ) {\n\n\t\t\t\tconst interpolantValue = interpolant.evaluate( time )[ 0 ];\n\n\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\tif ( time > interpolant.parameterPositions[ 1 ] ) {\n\n\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\tif ( timeScale === 0 ) {\n\n\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\tthis.paused = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\tthis.timeScale = timeScale;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._effectiveTimeScale = timeScale;\n\t\treturn timeScale;\n\n\t}\n\n\t_updateTime( deltaTime ) {\n\n\t\tconst duration = this._clip.duration;\n\t\tconst loop = this.loop;\n\n\t\tlet time = this.time + deltaTime;\n\t\tlet loopCount = this._loopCount;\n\n\t\tconst pingPong = ( loop === LoopPingPong );\n\n\t\tif ( deltaTime === 0 ) {\n\n\t\t\tif ( loopCount === -1 ) return time;\n\n\t\t\treturn ( pingPong && ( loopCount & 1 ) === 1 ) ? duration - time : time;\n\n\t\t}\n\n\t\tif ( loop === LoopOnce ) {\n\n\t\t\tif ( loopCount === -1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tthis._loopCount = 0;\n\t\t\t\tthis._setEndings( true, true, false );\n\n\t\t\t}\n\n\t\t\thandle_stop: {\n\n\t\t\t\tif ( time >= duration ) {\n\n\t\t\t\t\ttime = duration;\n\n\t\t\t\t} else if ( time < 0 ) {\n\n\t\t\t\t\ttime = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tbreak handle_stop;\n\n\t\t\t\t}\n\n\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\telse this.enabled = false;\n\n\t\t\t\tthis.time = time;\n\n\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\tdirection: deltaTime < 0 ? -1 : 1\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t} else { // repetitive Repeat or PingPong\n\n\t\t\tif ( loopCount === -1 ) {\n\n\t\t\t\t// just started\n\n\t\t\t\tif ( deltaTime >= 0 ) {\n\n\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\tthis._setEndings( true, this.repetitions === 0, pingPong );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t// so leave loopCount at -1\n\n\t\t\t\t\tthis._setEndings( this.repetitions === 0, true, pingPong );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( time >= duration || time < 0 ) {\n\n\t\t\t\t// wrap around\n\n\t\t\t\tconst loopDelta = Math.floor( time / duration ); // signed\n\t\t\t\ttime -= duration * loopDelta;\n\n\t\t\t\tloopCount += Math.abs( loopDelta );\n\n\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\tif ( pending <= 0 ) {\n\n\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\n\t\t\t\t\tif ( this.clampWhenFinished ) this.paused = true;\n\t\t\t\t\telse this.enabled = false;\n\n\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'finished', action: this,\n\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : -1\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// keep running\n\n\t\t\t\t\tif ( pending === 1 ) {\n\n\t\t\t\t\t\t// entering the last round\n\n\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\t\t\t\t\t\tthis._setEndings( atStart, ! atStart, pingPong );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis._setEndings( false, false, pingPong );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._loopCount = loopCount;\n\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent( {\n\t\t\t\t\t\ttype: 'loop', action: this, loopDelta: loopDelta\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tthis.time = time;\n\n\t\t\t}\n\n\t\t\tif ( pingPong && ( loopCount & 1 ) === 1 ) {\n\n\t\t\t\t// invert time for the \"pong round\"\n\n\t\t\t\treturn duration - time;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn time;\n\n\t}\n\n\t_setEndings( atStart, atEnd, pingPong ) {\n\n\t\tconst settings = this._interpolantSettings;\n\n\t\tif ( pingPong ) {\n\n\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\n\t\t} else {\n\n\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\n\t\t\tif ( atStart ) {\n\n\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t\tif ( atEnd ) {\n\n\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\n\t\t\t} else {\n\n\t\t\t\tsettings.endingEnd \t = WrapAroundEnding;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_scheduleFading( duration, weightNow, weightThen ) {\n\n\t\tconst mixer = this._mixer, now = mixer.time;\n\t\tlet interpolant = this._weightInterpolant;\n\n\t\tif ( interpolant === null ) {\n\n\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\tthis._weightInterpolant = interpolant;\n\n\t\t}\n\n\t\tconst times = interpolant.parameterPositions,\n\t\t\tvalues = interpolant.sampleValues;\n\n\t\ttimes[ 0 ] = now;\n\t\tvalues[ 0 ] = weightNow;\n\t\ttimes[ 1 ] = now + duration;\n\t\tvalues[ 1 ] = weightThen;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _controlInterpolantsResultBuffer = new Float32Array( 1 );\n\n/**\n * `AnimationMixer` is a player for animations on a particular object in\n * the scene. When multiple objects in the scene are animated independently,\n * one `AnimationMixer` may be used for each object.\n */\nclass AnimationMixer extends EventDispatcher {\n\n\t/**\n\t * Constructs a new animation mixer.\n\t *\n\t * @param {Object3D} root - The object whose animations shall be played by this mixer.\n\t */\n\tconstructor( root ) {\n\n\t\tsuper();\n\n\t\tthis._root = root;\n\t\tthis._initMemoryManager();\n\t\tthis._accuIndex = 0;\n\n\t\t/**\n\t\t * The global mixer time (in seconds; starting with `0` on the mixer's creation).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.time = 0;\n\n\t\t/**\n\t\t * A scaling factor for the global time.\n\t\t *\n\t\t * Note: Setting this member to `0` and later back to `1` is a\n\t\t * possibility to pause/unpause all actions that are controlled by this\n\t\t * mixer.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.timeScale = 1.0;\n\n\t}\n\n\t_bindAction( action, prototypeAction ) {\n\n\t\tconst root = action._localRoot || this._root,\n\t\t\ttracks = action._clip.tracks,\n\t\t\tnTracks = tracks.length,\n\t\t\tbindings = action._propertyBindings,\n\t\t\tinterpolants = action._interpolants,\n\t\t\trootUuid = root.uuid,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\n\t\tlet bindingsByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingsByName === undefined ) {\n\n\t\t\tbindingsByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingsByName;\n\n\t\t}\n\n\t\tfor ( let i = 0; i !== nTracks; ++ i ) {\n\n\t\t\tconst track = tracks[ i ],\n\t\t\t\ttrackName = track.name;\n\n\t\t\tlet binding = bindingsByName[ trackName ];\n\n\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t} else {\n\n\t\t\t\tbinding = bindings[ i ];\n\n\t\t\t\tif ( binding !== undefined ) {\n\n\t\t\t\t\t// existing binding, make sure the cache knows\n\n\t\t\t\t\tif ( binding._cacheIndex === null ) {\n\n\t\t\t\t\t\t++ binding.referenceCount;\n\t\t\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst path = prototypeAction && prototypeAction.\n\t\t\t\t\t_propertyBindings[ i ].binding.parsedPath;\n\n\t\t\t\tbinding = new PropertyMixer(\n\t\t\t\t\tPropertyBinding.create( root, trackName, path ),\n\t\t\t\t\ttrack.ValueTypeName, track.getValueSize() );\n\n\t\t\t\t++ binding.referenceCount;\n\t\t\t\tthis._addInactiveBinding( binding, rootUuid, trackName );\n\n\t\t\t\tbindings[ i ] = binding;\n\n\t\t\t}\n\n\t\t\tinterpolants[ i ].resultBuffer = binding.buffer;\n\n\t\t}\n\n\t}\n\n\t_activateAction( action ) {\n\n\t\tif ( ! this._isActiveAction( action ) ) {\n\n\t\t\tif ( action._cacheIndex === null ) {\n\n\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t// appears to be still using it -> rebind\n\n\t\t\t\tconst rootUuid = ( action._localRoot || this._root ).uuid,\n\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\t\t\tthis._bindAction( action,\n\t\t\t\t\tactionsForClip && actionsForClip.knownActions[ 0 ] );\n\n\t\t\t\tthis._addInactiveAction( action, clipUuid, rootUuid );\n\n\t\t\t}\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// increment reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( binding.useCount ++ === 0 ) {\n\n\t\t\t\t\tthis._lendBinding( binding );\n\t\t\t\t\tbinding.saveOriginalState();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._lendAction( action );\n\n\t\t}\n\n\t}\n\n\t_deactivateAction( action ) {\n\n\t\tif ( this._isActiveAction( action ) ) {\n\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\t// decrement reference counts / sort out state\n\t\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\t\tconst binding = bindings[ i ];\n\n\t\t\t\tif ( -- binding.useCount === 0 ) {\n\n\t\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\t\tthis._takeBackBinding( binding );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis._takeBackAction( action );\n\n\t\t}\n\n\t}\n\n\t// Memory manager\n\n\t_initMemoryManager() {\n\n\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\t\tthis._nActiveActions = 0;\n\n\t\tthis._actionsByClip = {};\n\t\t// inside:\n\t\t// {\n\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t// }\n\n\n\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\t\tthis._nActiveBindings = 0;\n\n\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\n\t\tthis._controlInterpolants = []; // same game as above\n\t\tthis._nActiveControlInterpolants = 0;\n\n\t\tconst scope = this;\n\n\t\tthis.stats = {\n\n\t\t\tactions: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._actions.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveActions;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tbindings: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._bindings.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveBindings;\n\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontrolInterpolants: {\n\t\t\t\tget total() {\n\n\t\t\t\t\treturn scope._controlInterpolants.length;\n\n\t\t\t\t},\n\t\t\t\tget inUse() {\n\n\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t// Memory management for AnimationAction objects\n\n\t_isActiveAction( action ) {\n\n\t\tconst index = action._cacheIndex;\n\t\treturn index !== null && index < this._nActiveActions;\n\n\t}\n\n\t_addInactiveAction( action, clipUuid, rootUuid ) {\n\n\t\tconst actions = this._actions,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tlet actionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip === undefined ) {\n\n\t\t\tactionsForClip = {\n\n\t\t\t\tknownActions: [ action ],\n\t\t\t\tactionByRoot: {}\n\n\t\t\t};\n\n\t\t\taction._byClipCacheIndex = 0;\n\n\t\t\tactionsByClip[ clipUuid ] = actionsForClip;\n\n\t\t} else {\n\n\t\t\tconst knownActions = actionsForClip.knownActions;\n\n\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\tknownActions.push( action );\n\n\t\t}\n\n\t\taction._cacheIndex = actions.length;\n\t\tactions.push( action );\n\n\t\tactionsForClip.actionByRoot[ rootUuid ] = action;\n\n\t}\n\n\t_removeInactiveAction( action ) {\n\n\t\tconst actions = this._actions,\n\t\t\tlastInactiveAction = actions[ actions.length - 1 ],\n\t\t\tcacheIndex = action._cacheIndex;\n\n\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\tactions.pop();\n\n\t\taction._cacheIndex = null;\n\n\n\t\tconst clipUuid = action._clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ],\n\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\n\t\t\tlastKnownAction =\n\t\t\t\tknownActionsForClip[ knownActionsForClip.length - 1 ],\n\n\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\n\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\tknownActionsForClip[ byClipCacheIndex ] = lastKnownAction;\n\t\tknownActionsForClip.pop();\n\n\t\taction._byClipCacheIndex = null;\n\n\n\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\trootUuid = ( action._localRoot || this._root ).uuid;\n\n\t\tdelete actionByRoot[ rootUuid ];\n\n\t\tif ( knownActionsForClip.length === 0 ) {\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t\tthis._removeInactiveBindingsForAction( action );\n\n\t}\n\n\t_removeInactiveBindingsForAction( action ) {\n\n\t\tconst bindings = action._propertyBindings;\n\n\t\tfor ( let i = 0, n = bindings.length; i !== n; ++ i ) {\n\n\t\t\tconst binding = bindings[ i ];\n\n\t\t\tif ( -- binding.referenceCount === 0 ) {\n\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_lendAction( action ) {\n\n\t\t// [ active actions |  inactive actions  ]\n\t\t// [  active actions >| inactive actions ]\n\t\t//                 s        a\n\t\t//                  <-swap->\n\t\t//                 a        s\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveActions ++,\n\n\t\t\tfirstInactiveAction = actions[ lastActiveIndex ];\n\n\t\taction._cacheIndex = lastActiveIndex;\n\t\tactions[ lastActiveIndex ] = action;\n\n\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = firstInactiveAction;\n\n\t}\n\n\t_takeBackAction( action ) {\n\n\t\t// [  active actions  | inactive actions ]\n\t\t// [ active actions |< inactive actions  ]\n\t\t//        a        s\n\t\t//         <-swap->\n\t\t//        s        a\n\n\t\tconst actions = this._actions,\n\t\t\tprevIndex = action._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveActions,\n\n\t\t\tlastActiveAction = actions[ firstInactiveIndex ];\n\n\t\taction._cacheIndex = firstInactiveIndex;\n\t\tactions[ firstInactiveIndex ] = action;\n\n\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\tactions[ prevIndex ] = lastActiveAction;\n\n\t}\n\n\t// Memory management for PropertyMixer objects\n\n\t_addInactiveBinding( binding, rootUuid, trackName ) {\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindings = this._bindings;\n\n\t\tlet bindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName === undefined ) {\n\n\t\t\tbindingByName = {};\n\t\t\tbindingsByRoot[ rootUuid ] = bindingByName;\n\n\t\t}\n\n\t\tbindingByName[ trackName ] = binding;\n\n\t\tbinding._cacheIndex = bindings.length;\n\t\tbindings.push( binding );\n\n\t}\n\n\t_removeInactiveBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tpropBinding = binding.binding,\n\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\ttrackName = propBinding.path,\n\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ],\n\n\t\t\tlastInactiveBinding = bindings[ bindings.length - 1 ],\n\t\t\tcacheIndex = binding._cacheIndex;\n\n\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\tbindings[ cacheIndex ] = lastInactiveBinding;\n\t\tbindings.pop();\n\n\t\tdelete bindingByName[ trackName ];\n\n\t\tif ( Object.keys( bindingByName ).length === 0 ) {\n\n\t\t\tdelete bindingsByRoot[ rootUuid ];\n\n\t\t}\n\n\t}\n\n\t_lendBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tlastActiveIndex = this._nActiveBindings ++,\n\n\t\t\tfirstInactiveBinding = bindings[ lastActiveIndex ];\n\n\t\tbinding._cacheIndex = lastActiveIndex;\n\t\tbindings[ lastActiveIndex ] = binding;\n\n\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = firstInactiveBinding;\n\n\t}\n\n\t_takeBackBinding( binding ) {\n\n\t\tconst bindings = this._bindings,\n\t\t\tprevIndex = binding._cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveBindings,\n\n\t\t\tlastActiveBinding = bindings[ firstInactiveIndex ];\n\n\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\tbindings[ firstInactiveIndex ] = binding;\n\n\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\tbindings[ prevIndex ] = lastActiveBinding;\n\n\t}\n\n\n\t// Memory management of Interpolants for weight and time scale\n\n\t_lendControlInterpolant() {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tlastActiveIndex = this._nActiveControlInterpolants ++;\n\n\t\tlet interpolant = interpolants[ lastActiveIndex ];\n\n\t\tif ( interpolant === undefined ) {\n\n\t\t\tinterpolant = new LinearInterpolant(\n\t\t\t\tnew Float32Array( 2 ), new Float32Array( 2 ),\n\t\t\t\t1, _controlInterpolantsResultBuffer );\n\n\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\tinterpolants[ lastActiveIndex ] = interpolant;\n\n\t\t}\n\n\t\treturn interpolant;\n\n\t}\n\n\t_takeBackControlInterpolant( interpolant ) {\n\n\t\tconst interpolants = this._controlInterpolants,\n\t\t\tprevIndex = interpolant.__cacheIndex,\n\n\t\t\tfirstInactiveIndex = -- this._nActiveControlInterpolants,\n\n\t\t\tlastActiveInterpolant = interpolants[ firstInactiveIndex ];\n\n\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\tinterpolants[ firstInactiveIndex ] = interpolant;\n\n\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\tinterpolants[ prevIndex ] = lastActiveInterpolant;\n\n\t}\n\n\t/**\n\t * Returns an instance of {@link AnimationAction} for the passed clip.\n\t *\n\t * If an action fitting the clip and root parameters doesn't yet exist, it\n\t * will be created by this method. Calling this method several times with the\n\t * same clip and root parameters always returns the same action.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode.\n\t * @return {?AnimationAction} The animation action.\n\t */\n\tclipAction( clip, optionalRoot, blendMode ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid;\n\n\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName( root, clip ) : clip;\n\n\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\n\t\tconst actionsForClip = this._actionsByClip[ clipUuid ];\n\t\tlet prototypeAction = null;\n\n\t\tif ( blendMode === undefined ) {\n\n\t\t\tif ( clipObject !== null ) {\n\n\t\t\t\tblendMode = clipObject.blendMode;\n\n\t\t\t} else {\n\n\t\t\t\tblendMode = NormalAnimationBlendMode;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\tconst existingAction = actionsForClip.actionByRoot[ rootUuid ];\n\n\t\t\tif ( existingAction !== undefined && existingAction.blendMode === blendMode ) {\n\n\t\t\t\treturn existingAction;\n\n\t\t\t}\n\n\t\t\t// we know the clip, so we don't have to parse all\n\t\t\t// the bindings again but can just copy\n\t\t\tprototypeAction = actionsForClip.knownActions[ 0 ];\n\n\t\t\t// also, take the clip from the prototype action\n\t\t\tif ( clipObject === null )\n\t\t\t\tclipObject = prototypeAction._clip;\n\n\t\t}\n\n\t\t// clip must be known when specified via string\n\t\tif ( clipObject === null ) return null;\n\n\t\t// allocate all resources required to run it\n\t\tconst newAction = new AnimationAction( this, clipObject, optionalRoot, blendMode );\n\n\t\tthis._bindAction( newAction, prototypeAction );\n\n\t\t// and make the action known to the memory manager\n\t\tthis._addInactiveAction( newAction, clipUuid, rootUuid );\n\n\t\treturn newAction;\n\n\t}\n\n\t/**\n\t * Returns an existing animation action for the passed clip.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t * @return {?AnimationAction} The animation action. Returns `null` if no action was found.\n\t */\n\texistingAction( clip, optionalRoot ) {\n\n\t\tconst root = optionalRoot || this._root,\n\t\t\trootUuid = root.uuid,\n\n\t\t\tclipObject = typeof clip === 'string' ?\n\t\t\t\tAnimationClip.findByName( root, clip ) : clip,\n\n\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\n\t\t\tactionsForClip = this._actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\treturn actionsForClip.actionByRoot[ rootUuid ] || null;\n\n\t\t}\n\n\t\treturn null;\n\n\t}\n\n\t/**\n\t * Deactivates all previously scheduled actions on this mixer.\n\t *\n\t * @return {AnimationMixer} A reference to thi animation mixer.\n\t */\n\tstopAllAction() {\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions;\n\n\t\tfor ( let i = nActions - 1; i >= 0; -- i ) {\n\n\t\t\tactions[ i ].stop();\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Advances the global mixer time and updates the animation.\n\t *\n\t * This is usually done in the render loop by passing the delta\n\t * time from {@link Clock} or {@link Timer}.\n\t *\n\t * @param {number} deltaTime - The delta time in seconds.\n\t * @return {AnimationMixer} A reference to thi animation mixer.\n\t */\n\tupdate( deltaTime ) {\n\n\t\tdeltaTime *= this.timeScale;\n\n\t\tconst actions = this._actions,\n\t\t\tnActions = this._nActiveActions,\n\n\t\t\ttime = this.time += deltaTime,\n\t\t\ttimeDirection = Math.sign( deltaTime ),\n\n\t\t\taccuIndex = this._accuIndex ^= 1;\n\n\t\t// run active actions\n\n\t\tfor ( let i = 0; i !== nActions; ++ i ) {\n\n\t\t\tconst action = actions[ i ];\n\n\t\t\taction._update( time, deltaTime, timeDirection, accuIndex );\n\n\t\t}\n\n\t\t// update scene graph\n\n\t\tconst bindings = this._bindings,\n\t\t\tnBindings = this._nActiveBindings;\n\n\t\tfor ( let i = 0; i !== nBindings; ++ i ) {\n\n\t\t\tbindings[ i ].apply( accuIndex );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the global mixer to a specific time and updates the animation accordingly.\n\t *\n\t * This is useful when you need to jump to an exact time in an animation. The\n\t * input parameter will be scaled by {@link AnimationMixer#timeScale}\n\t *\n\t * @param {number} time - The time to set in seconds.\n\t * @return {AnimationMixer} A reference to thi animation mixer.\n\t */\n\tsetTime( time ) {\n\n\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\t\tfor ( let i = 0; i < this._actions.length; i ++ ) {\n\n\t\t\tthis._actions[ i ].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\n\t\t}\n\n\t\treturn this.update( time ); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\n\t}\n\n\t/**\n\t * Returns this mixer's root object.\n\t *\n\t * @return {Object3D} The mixer's root object.\n\t */\n\tgetRoot() {\n\n\t\treturn this._root;\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for a clip. Before using this method make\n\t * sure to call {@link AnimationAction#stop} for all related actions.\n\t *\n\t * @param {AnimationClip} clip - The clip to uncache.\n\t */\n\tuncacheClip( clip ) {\n\n\t\tconst actions = this._actions,\n\t\t\tclipUuid = clip.uuid,\n\t\t\tactionsByClip = this._actionsByClip,\n\t\t\tactionsForClip = actionsByClip[ clipUuid ];\n\n\t\tif ( actionsForClip !== undefined ) {\n\n\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t// iteration state and also require updating the state we can\n\t\t\t// just throw away\n\n\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\tfor ( let i = 0, n = actionsToRemove.length; i !== n; ++ i ) {\n\n\t\t\t\tconst action = actionsToRemove[ i ];\n\n\t\t\t\tthis._deactivateAction( action );\n\n\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\tlastInactiveAction = actions[ actions.length - 1 ];\n\n\t\t\t\taction._cacheIndex = null;\n\t\t\t\taction._byClipCacheIndex = null;\n\n\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\tactions[ cacheIndex ] = lastInactiveAction;\n\t\t\t\tactions.pop();\n\n\t\t\t\tthis._removeInactiveBindingsForAction( action );\n\n\t\t\t}\n\n\t\t\tdelete actionsByClip[ clipUuid ];\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for a root object. Before using this\n\t * method make sure to call {@link AnimationAction#stop} for all related\n\t * actions or alternatively {@link AnimationMixer#stopAllAction} when the\n\t * mixer operates on a single root.\n\t *\n\t * @param {Object3D} root - The root object to uncache.\n\t */\n\tuncacheRoot( root ) {\n\n\t\tconst rootUuid = root.uuid,\n\t\t\tactionsByClip = this._actionsByClip;\n\n\t\tfor ( const clipUuid in actionsByClip ) {\n\n\t\t\tconst actionByRoot = actionsByClip[ clipUuid ].actionByRoot,\n\t\t\t\taction = actionByRoot[ rootUuid ];\n\n\t\t\tif ( action !== undefined ) {\n\n\t\t\t\tthis._deactivateAction( action );\n\t\t\t\tthis._removeInactiveAction( action );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\tbindingByName = bindingsByRoot[ rootUuid ];\n\n\t\tif ( bindingByName !== undefined ) {\n\n\t\t\tfor ( const trackName in bindingByName ) {\n\n\t\t\t\tconst binding = bindingByName[ trackName ];\n\t\t\t\tbinding.restoreOriginalState();\n\t\t\t\tthis._removeInactiveBinding( binding );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Deallocates all memory resources for an action. The action is identified by the\n\t * given clip and an optional root object. Before using this method make\n\t * sure to call {@link AnimationAction#stop} to deactivate the action.\n\t *\n\t * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip.\n\t * @param {Object3D} [optionalRoot] - An alternative root object.\n\t */\n\tuncacheAction( clip, optionalRoot ) {\n\n\t\tconst action = this.existingAction( clip, optionalRoot );\n\n\t\tif ( action !== null ) {\n\n\t\t\tthis._deactivateAction( action );\n\t\t\tthis._removeInactiveAction( action );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Represents a 3D render target.\n *\n * @augments RenderTarget\n */\nclass RenderTarget3D extends RenderTarget {\n\n\t/**\n\t * Constructs a new 3D render target.\n\t *\n\t * @param {number} [width=1] - The width of the render target.\n\t * @param {number} [height=1] - The height of the render target.\n\t * @param {number} [depth=1] - The height of the render target.\n\t * @param {RenderTarget~Options} [options] - The configuration object.\n\t */\n\tconstructor( width = 1, height = 1, depth = 1, options = {} ) {\n\n\t\tsuper( width, height, options );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isRenderTarget3D = true;\n\n\t\tthis.depth = depth;\n\n\t\t/**\n\t\t * Overwritten with a different texture type.\n\t\t *\n\t\t * @type {Data3DTexture}\n\t\t */\n\t\tthis.texture = new Data3DTexture( null, width, height, depth );\n\t\tthis._setTextureOptions( options );\n\n\t\tthis.texture.isRenderTargetTexture = true;\n\n\t}\n\n}\n\n/**\n * Represents a uniform which is a global shader variable. They are passed to shader programs.\n *\n * When declaring a uniform of a {@link ShaderMaterial}, it is declared by value or by object.\n * ```js\n * uniforms: {\n * \ttime: { value: 1.0 },\n * \tresolution: new Uniform( new Vector2() )\n * };\n * ```\n * Since this class can only be used in context of {@link ShaderMaterial}, it is only supported\n * in {@link WebGLRenderer}.\n */\nclass Uniform {\n\n\t/**\n\t * Constructs a new uniform.\n\t *\n\t * @param {any} value - The uniform value.\n\t */\n\tconstructor( value ) {\n\n\t\t/**\n\t\t * The uniform value.\n\t\t *\n\t\t * @type {any}\n\t\t */\n\t\tthis.value = value;\n\n\t}\n\n\t/**\n\t * Returns a new uniform with copied values from this instance.\n\t * If the value has a `clone()` method, the value is cloned as well.\n\t *\n\t * @return {Uniform} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );\n\n\t}\n\n}\n\nlet _id = 0;\n\n/**\n * A class for managing multiple uniforms in a single group. The renderer will process\n * such a definition as a single UBO.\n *\n * Since this class can only be used in context of {@link ShaderMaterial}, it is only supported\n * in {@link WebGLRenderer}.\n *\n * @augments EventDispatcher\n */\nclass UniformsGroup extends EventDispatcher {\n\n\t/**\n\t * Constructs a new uniforms group.\n\t */\n\tconstructor() {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isUniformsGroup = true;\n\n\t\t/**\n\t\t * The ID of the 3D object.\n\t\t *\n\t\t * @name UniformsGroup#id\n\t\t * @type {number}\n\t\t * @readonly\n\t\t */\n\t\tObject.defineProperty( this, 'id', { value: _id ++ } );\n\n\t\t/**\n\t\t * The name of the uniforms group.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The buffer usage.\n\t\t *\n\t\t * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)}\n\t\t * @default StaticDrawUsage\n\t\t */\n\t\tthis.usage = StaticDrawUsage;\n\n\t\t/**\n\t\t * An array holding the uniforms.\n\t\t *\n\t\t * @type {Array<Uniform>}\n\t\t */\n\t\tthis.uniforms = [];\n\n\t}\n\n\t/**\n\t * Adds the given uniform to this uniforms group.\n\t *\n\t * @param {Uniform} uniform - The uniform to add.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tadd( uniform ) {\n\n\t\tthis.uniforms.push( uniform );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Removes the given uniform from this uniforms group.\n\t *\n\t * @param {Uniform} uniform - The uniform to remove.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tremove( uniform ) {\n\n\t\tconst index = this.uniforms.indexOf( uniform );\n\n\t\tif ( index !== -1 ) this.uniforms.splice( index, 1 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the name of this uniforms group.\n\t *\n\t * @param {string} name - The name to set.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tsetName( name ) {\n\n\t\tthis.name = name;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the usage of this uniforms group.\n\t *\n\t * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tsetUsage( value ) {\n\n\t\tthis.usage = value;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t *\n\t * @fires Texture#dispose\n\t */\n\tdispose() {\n\n\t\tthis.dispatchEvent( { type: 'dispose' } );\n\n\t}\n\n\t/**\n\t * Copies the values of the given uniforms group to this instance.\n\t *\n\t * @param {UniformsGroup} source - The uniforms group to copy.\n\t * @return {UniformsGroup} A reference to this uniforms group.\n\t */\n\tcopy( source ) {\n\n\t\tthis.name = source.name;\n\t\tthis.usage = source.usage;\n\n\t\tconst uniformsSource = source.uniforms;\n\n\t\tthis.uniforms.length = 0;\n\n\t\tfor ( let i = 0, l = uniformsSource.length; i < l; i ++ ) {\n\n\t\t\tconst uniforms = Array.isArray( uniformsSource[ i ] ) ? uniformsSource[ i ] : [ uniformsSource[ i ] ];\n\n\t\t\tfor ( let j = 0; j < uniforms.length; j ++ ) {\n\n\t\t\t\tthis.uniforms.push( uniforms[ j ].clone() );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new uniforms group with copied values from this instance.\n\t *\n\t * @return {UniformsGroup} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * An instanced version of an interleaved buffer.\n *\n * @augments InterleavedBuffer\n */\nclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\n\t/**\n\t * Constructs a new instanced interleaved buffer.\n\t *\n\t * @param {TypedArray} array - A typed array with a shared buffer storing attribute data.\n\t * @param {number} stride - The number of typed-array elements per vertex.\n\t * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated.\n\t */\n\tconstructor( array, stride, meshPerAttribute = 1 ) {\n\n\t\tsuper( array, stride );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isInstancedInterleavedBuffer = true;\n\n\t\t/**\n\t\t * Defines how often a value of this buffer attribute should be repeated,\n\t\t * see {@link InstancedBufferAttribute#meshPerAttribute}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.meshPerAttribute = meshPerAttribute;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\n\t\treturn this;\n\n\t}\n\n\tclone( data ) {\n\n\t\tconst ib = super.clone( data );\n\n\t\tib.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn ib;\n\n\t}\n\n\ttoJSON( data ) {\n\n\t\tconst json = super.toJSON( data );\n\n\t\tjson.isInstancedInterleavedBuffer = true;\n\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\n\t\treturn json;\n\n\t}\n\n}\n\n/**\n * An alternative version of a buffer attribute with more control over the VBO.\n *\n * The renderer does not construct a VBO for this kind of attribute. Instead, it uses\n * whatever VBO is passed in constructor and can later be altered via the `buffer` property.\n *\n * The most common use case for this class is when some kind of GPGPU calculation interferes\n * or even produces the VBOs in question.\n *\n * Notice that this class can only be used with {@link WebGLRenderer}.\n */\nclass GLBufferAttribute {\n\n\t/**\n\t * Constructs a new GL buffer attribute.\n\t *\n\t * @param {WebGLBuffer} buffer - The native WebGL buffer.\n\t * @param {number} type - The native data type (e.g. `gl.FLOAT`).\n\t * @param {number} itemSize - The item size.\n\t * @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.\n\t * @param {number} count - The expected number of vertices in VBO.\n\t * @param {boolean} [normalized=false] - Whether the data are normalized or not.\n\t */\n\tconstructor( buffer, type, itemSize, elementSize, count, normalized = false ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isGLBufferAttribute = true;\n\n\t\t/**\n\t\t * The name of the buffer attribute.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tthis.name = '';\n\n\t\t/**\n\t\t * The native WebGL buffer.\n\t\t *\n\t\t * @type {WebGLBuffer}\n\t\t */\n\t\tthis.buffer = buffer;\n\n\t\t/**\n\t\t * The native data type.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.type = type;\n\n\t\t/**\n\t\t * The item size, see {@link BufferAttribute#itemSize}.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.itemSize = itemSize;\n\n\t\t/**\n\t\t * The corresponding size (in bytes) for the given `type` parameter.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.elementSize = elementSize;\n\n\t\t/**\n\t\t * The expected number of vertices in VBO.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.count = count;\n\n\t\t/**\n\t\t * Applies to integer data only. Indicates how the underlying data in the buffer maps to\n\t\t * the values in the GLSL code. For instance, if `buffer` contains data of `gl.UNSIGNED_SHORT`,\n\t\t * and `normalized` is `true`, the values `0 - +65535` in the buffer data will be mapped to\n\t\t * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted\n\t\t * to floats unmodified, i.e. `65535` becomes `65535.0f`.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.normalized = normalized;\n\n\t\t/**\n\t\t * A version number, incremented every time the `needsUpdate` is set to `true`.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.version = 0;\n\n\t}\n\n\t/**\n\t * Flag to indicate that this attribute has changed and should be re-sent to\n\t * the GPU. Set this to `true` when you modify the value of the array.\n\t *\n\t * @type {number}\n\t * @default false\n\t * @param {boolean} value\n\t */\n\tset needsUpdate( value ) {\n\n\t\tif ( value === true ) this.version ++;\n\n\t}\n\n\t/**\n\t * Sets the given native WebGL buffer.\n\t *\n\t * @param {WebGLBuffer} buffer - The buffer to set.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetBuffer( buffer ) {\n\n\t\tthis.buffer = buffer;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the given native data type and element size.\n\t *\n\t * @param {number} type - The native data type (e.g. `gl.FLOAT`).\n\t * @param {number} elementSize - The corresponding size (in bytes) for the given `type` parameter.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetType( type, elementSize ) {\n\n\t\tthis.type = type;\n\t\tthis.elementSize = elementSize;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the item size.\n\t *\n\t * @param {number} itemSize - The item size.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetItemSize( itemSize ) {\n\n\t\tthis.itemSize = itemSize;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the count (the expected number of vertices in VBO).\n\t *\n\t * @param {number} count - The count.\n\t * @return {BufferAttribute} A reference to this instance.\n\t */\n\tsetCount( count ) {\n\n\t\tthis.count = count;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _matrix = /*@__PURE__*/ new Matrix4();\n\n/**\n * This class is designed to assist with raycasting. Raycasting is used for\n * mouse picking (working out what objects in the 3d space the mouse is over)\n * amongst other things.\n */\nclass Raycaster {\n\n\t/**\n\t * Constructs a new raycaster.\n\t *\n\t * @param {Vector3} origin - The origin vector where the ray casts from.\n\t * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n\t * @param {number} [near=0] - All results returned are further away than near. Near can't be negative.\n\t * @param {number} [far=Infinity] - All results returned are closer than far. Far can't be lower than near.\n\t */\n\tconstructor( origin, direction, near = 0, far = Infinity ) {\n\n\t\t/**\n\t\t * The ray used for raycasting.\n\t\t *\n\t\t * @type {Ray}\n\t\t */\n\t\tthis.ray = new Ray( origin, direction );\n\n\t\t/**\n\t\t * All results returned are further away than near. Near can't be negative.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.near = near;\n\n\t\t/**\n\t\t * All results returned are further away than near. Near can't be negative.\n\t\t *\n\t\t * @type {number}\n\t\t * @default Infinity\n\t\t */\n\t\tthis.far = far;\n\n\t\t/**\n\t\t * The camera to use when raycasting against view-dependent objects such as\n\t\t * billboarded objects like sprites. This field can be set manually or\n\t\t * is set when calling `setFromCamera()`.\n\t\t *\n\t\t * @type {?Camera}\n\t\t * @default null\n\t\t */\n\t\tthis.camera = null;\n\n\t\t/**\n\t\t * Allows to selectively ignore 3D objects when performing intersection tests.\n\t\t * The following code example ensures that only 3D objects on layer `1` will be\n\t\t * honored by raycaster.\n\t\t * ```js\n\t\t * raycaster.layers.set( 1 );\n\t\t * object.layers.enable( 1 );\n\t\t * ```\n\t\t *\n\t\t * @type {Layers}\n\t\t */\n\t\tthis.layers = new Layers();\n\n\n\t\t/**\n\t\t * A parameter object that configures the raycasting. It has the structure:\n\t\t *\n\t\t * ```\n\t\t * {\n\t\t * \tMesh: {},\n\t\t * \tLine: { threshold: 1 },\n\t\t * \tLOD: {},\n\t\t * \tPoints: { threshold: 1 },\n\t\t * \tSprite: {}\n\t\t * }\n\t\t * ```\n\t\t * Where `threshold` is the precision of the raycaster when intersecting objects, in world units.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.params = {\n\t\t\tMesh: {},\n\t\t\tLine: { threshold: 1 },\n\t\t\tLOD: {},\n\t\t\tPoints: { threshold: 1 },\n\t\t\tSprite: {}\n\t\t};\n\n\t}\n\n\t/**\n\t * Updates the ray with a new origin and direction by copying the values from the arguments.\n\t *\n\t * @param {Vector3} origin - The origin vector where the ray casts from.\n\t * @param {Vector3} direction - The (normalized) direction vector that gives direction to the ray.\n\t */\n\tset( origin, direction ) {\n\n\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\n\t\tthis.ray.set( origin, direction );\n\n\t}\n\n\t/**\n\t * Uses the given coordinates and camera to compute a new origin and direction for the internal ray.\n\t *\n\t * @param {Vector2} coords - 2D coordinates of the mouse, in normalized device coordinates (NDC).\n\t * X and Y components should be between `-1` and `1`.\n\t * @param {Camera} camera - The camera from which the ray should originate.\n\t */\n\tsetFromCamera( coords, camera ) {\n\n\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\tthis.ray.origin.setFromMatrixPosition( camera.matrixWorld );\n\t\t\tthis.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();\n\t\t\tthis.camera = camera;\n\n\t\t} else if ( camera.isOrthographicCamera ) {\n\n\t\t\tthis.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera\n\t\t\tthis.ray.direction.set( 0, 0, -1 ).transformDirection( camera.matrixWorld );\n\t\t\tthis.camera = camera;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Uses the given WebXR controller to compute a new origin and direction for the internal ray.\n\t *\n\t * @param {WebXRController} controller - The controller to copy the position and direction from.\n\t * @return {Raycaster} A reference to this raycaster.\n\t */\n\tsetFromXRController( controller ) {\n\n\t\t_matrix.identity().extractRotation( controller.matrixWorld );\n\n\t\tthis.ray.origin.setFromMatrixPosition( controller.matrixWorld );\n\t\tthis.ray.direction.set( 0, 0, -1 ).applyMatrix4( _matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The intersection point of a raycaster intersection test.\n\t * @typedef {Object} Raycaster~Intersection\n\t * @property {number} distance - The distance from the ray's origin to the intersection point.\n\t * @property {number} distanceToRay -  Some 3D objects e.g. {@link Points} provide the distance of the\n\t * intersection to the nearest point on the ray. For other objects it will be `undefined`.\n\t * @property {Vector3} point - The intersection point, in world coordinates.\n\t * @property {Object} face - The face that has been intersected.\n\t * @property {number} faceIndex - The face index.\n\t * @property {Object3D} object - The 3D object that has been intersected.\n\t * @property {Vector2} uv - U,V coordinates at point of intersection.\n\t * @property {Vector2} uv1 - Second set of U,V coordinates at point of intersection.\n\t * @property {Vector3} uv1 - Interpolated normal vector at point of intersection.\n\t * @property {number} instanceId - The index number of the instance where the ray\n\t * intersects the {@link InstancedMesh}.\n\t */\n\n\t/**\n\t * Checks all intersection between the ray and the object with or without the\n\t * descendants. Intersections are returned sorted by distance, closest first.\n\t *\n\t * `Raycaster` delegates to the `raycast()` method of the passed 3D object, when\n\t * evaluating whether the ray intersects the object or not. This allows meshes to respond\n\t * differently to ray casting than lines or points.\n\t *\n\t * Note that for meshes, faces must be pointed towards the origin of the ray in order\n\t * to be detected; intersections of the ray passing through the back of a face will not\n\t * be detected. To raycast against both faces of an object, you'll want to set  {@link Material#side}\n\t * to `THREE.DoubleSide`.\n\t *\n\t * @param {Object3D} object - The 3D object to check for intersection with the ray.\n\t * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n\t * Otherwise it only checks intersection with the object.\n\t * @param {Array<Raycaster~Intersection>} [intersects=[]] The target array that holds the result of the method.\n\t * @return {Array<Raycaster~Intersection>} An array holding the intersection points.\n\t */\n\tintersectObject( object, recursive = true, intersects = [] ) {\n\n\t\tintersect( object, this, intersects, recursive );\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n\t/**\n\t * Checks all intersection between the ray and the objects with or without\n\t * the descendants. Intersections are returned sorted by distance, closest first.\n\t *\n\t * @param {Array<Object3D>} objects - The 3D objects to check for intersection with the ray.\n\t * @param {boolean} [recursive=true] - If set to `true`, it also checks all descendants.\n\t * Otherwise it only checks intersection with the object.\n\t * @param {Array<Raycaster~Intersection>} [intersects=[]] The target array that holds the result of the method.\n\t * @return {Array<Raycaster~Intersection>} An array holding the intersection points.\n\t */\n\tintersectObjects( objects, recursive = true, intersects = [] ) {\n\n\t\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\t\tintersect( objects[ i ], this, intersects, recursive );\n\n\t\t}\n\n\t\tintersects.sort( ascSort );\n\n\t\treturn intersects;\n\n\t}\n\n}\n\nfunction ascSort( a, b ) {\n\n\treturn a.distance - b.distance;\n\n}\n\nfunction intersect( object, raycaster, intersects, recursive ) {\n\n\tlet propagate = true;\n\n\tif ( object.layers.test( raycaster.layers ) ) {\n\n\t\tconst result = object.raycast( raycaster, intersects );\n\n\t\tif ( result === false ) propagate = false;\n\n\t}\n\n\tif ( propagate === true && recursive === true ) {\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\tintersect( children[ i ], raycaster, intersects, true );\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * This class is an alternative to {@link Clock} with a different API design and behavior.\n * The goal is to avoid the conceptual flaws that became apparent in `Clock` over time.\n *\n * - `Timer` has an `update()` method that updates its internal state. That makes it possible to\n * call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values.\n * - The class can make use of the Page Visibility API to avoid large time delta values when the app\n * is inactive (e.g. tab switched or browser hidden).\n *\n * ```js\n * const timer = new Timer();\n * timer.connect( document ); // use Page Visibility API\n * ```\n */\nclass Timer {\n\n\t/**\n\t * Constructs a new timer.\n\t */\n\tconstructor() {\n\n\t\tthis._previousTime = 0;\n\t\tthis._currentTime = 0;\n\t\tthis._startTime = performance.now();\n\n\t\tthis._delta = 0;\n\t\tthis._elapsed = 0;\n\n\t\tthis._timescale = 1;\n\n\t\tthis._document = null;\n\t\tthis._pageVisibilityHandler = null;\n\n\t}\n\n\t/**\n\t * Connect the timer to the given document.Calling this method is not mandatory to\n\t * use the timer but enables the usage of the Page Visibility API to avoid large time\n\t * delta values.\n\t *\n\t * @param {Document} document - The document.\n\t */\n\tconnect( document ) {\n\n\t\tthis._document = document;\n\n\t\t// use Page Visibility API to avoid large time delta values\n\n\t\tif ( document.hidden !== undefined ) {\n\n\t\t\tthis._pageVisibilityHandler = handleVisibilityChange.bind( this );\n\n\t\t\tdocument.addEventListener( 'visibilitychange', this._pageVisibilityHandler, false );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.\n\t */\n\tdisconnect() {\n\n\t\tif ( this._pageVisibilityHandler !== null ) {\n\n\t\t\tthis._document.removeEventListener( 'visibilitychange', this._pageVisibilityHandler );\n\t\t\tthis._pageVisibilityHandler = null;\n\n\t\t}\n\n\t\tthis._document = null;\n\n\t}\n\n\t/**\n\t * Returns the time delta in seconds.\n\t *\n\t * @return {number} The time delta in second.\n\t */\n\tgetDelta() {\n\n\t\treturn this._delta / 1000;\n\n\t}\n\n\t/**\n\t * Returns the elapsed time in seconds.\n\t *\n\t * @return {number} The elapsed time in second.\n\t */\n\tgetElapsed() {\n\n\t\treturn this._elapsed / 1000;\n\n\t}\n\n\t/**\n\t * Returns the timescale.\n\t *\n\t * @return {number} The timescale.\n\t */\n\tgetTimescale() {\n\n\t\treturn this._timescale;\n\n\t}\n\n\t/**\n\t * Sets the given timescale which scale the time delta computation\n\t * in `update()`.\n\t *\n\t * @param {number} timescale - The timescale to set.\n\t * @return {Timer} A reference to this timer.\n\t */\n\tsetTimescale( timescale ) {\n\n\t\tthis._timescale = timescale;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Resets the time computation for the current simulation step.\n\t *\n\t * @return {Timer} A reference to this timer.\n\t */\n\treset() {\n\n\t\tthis._currentTime = performance.now() - this._startTime;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Can be used to free all internal resources. Usually called when\n\t * the timer instance isn't required anymore.\n\t */\n\tdispose() {\n\n\t\tthis.disconnect();\n\n\t}\n\n\t/**\n\t * Updates the internal state of the timer. This method should be called\n\t * once per simulation step and before you perform queries against the timer\n\t * (e.g. via `getDelta()`).\n\t *\n\t * @param {number} timestamp - The current time in milliseconds. Can be obtained\n\t * from the `requestAnimationFrame` callback argument. If not provided, the current\n\t * time will be determined with `performance.now`.\n\t * @return {Timer} A reference to this timer.\n\t */\n\tupdate( timestamp ) {\n\n\t\tif ( this._pageVisibilityHandler !== null && this._document.hidden === true ) {\n\n\t\t\tthis._delta = 0;\n\n\t\t} else {\n\n\t\t\tthis._previousTime = this._currentTime;\n\t\t\tthis._currentTime = ( timestamp !== undefined ? timestamp : performance.now() ) - this._startTime;\n\n\t\t\tthis._delta = ( this._currentTime - this._previousTime ) * this._timescale;\n\t\t\tthis._elapsed += this._delta; // _elapsed is the accumulation of all previous deltas\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nfunction handleVisibilityChange() {\n\n\tif ( this._document.hidden === false ) this.reset();\n\n}\n\n/**\n * This class can be used to represent points in 3D space as\n * [Spherical coordinates]{@link https://en.wikipedia.org/wiki/Spherical_coordinate_system}.\n */\nclass Spherical {\n\n\t/**\n\t * Constructs a new spherical.\n\t *\n\t * @param {number} [radius=1] - The radius, or the Euclidean distance (straight-line distance) from the point to the origin.\n\t * @param {number} [phi=0] - The polar angle in radians from the y (up) axis.\n\t * @param {number} [theta=0] - The equator/azimuthal angle in radians around the y (up) axis.\n\t */\n\tconstructor( radius = 1, phi = 0, theta = 0 ) {\n\n\t\t/**\n\t\t * The radius, or the Euclidean distance (straight-line distance) from the point to the origin.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = radius;\n\n\t\t/**\n\t\t * The polar angle in radians from the y (up) axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.phi = phi;\n\n\t\t/**\n\t\t * The equator/azimuthal angle in radians around the y (up) axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.theta = theta;\n\n\t}\n\n\t/**\n\t * Sets the spherical components by copying the given values.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} phi - The polar angle.\n\t * @param {number} theta - The azimuthal angle.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tset( radius, phi, theta ) {\n\n\t\tthis.radius = radius;\n\t\tthis.phi = phi;\n\t\tthis.theta = theta;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given spherical to this instance.\n\t *\n\t * @param {Spherical} other - The spherical to copy.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.phi = other.phi;\n\t\tthis.theta = other.theta;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Restricts the polar angle [page:.phi phi] to be between `0.000001` and pi -\n\t * `0.000001`.\n\t *\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tmakeSafe() {\n\n\t\tconst EPS = 0.000001;\n\t\tthis.phi = clamp( this.phi, EPS, Math.PI - EPS );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the spherical components from the given vector which is assumed to hold\n\t * Cartesian coordinates.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\t/**\n\t * Sets the spherical components from the given Cartesian coordinates.\n\t *\n\t * @param {number} x - The x value.\n\t * @param {number} y - The y value.\n\t * @param {number} z - The z value.\n\t * @return {Spherical} A reference to this spherical.\n\t */\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + y * y + z * z );\n\n\t\tif ( this.radius === 0 ) {\n\n\t\t\tthis.theta = 0;\n\t\t\tthis.phi = 0;\n\n\t\t} else {\n\n\t\t\tthis.theta = Math.atan2( x, z );\n\t\t\tthis.phi = Math.acos( clamp( y / this.radius, -1, 1 ) );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new spherical with copied values from this instance.\n\t *\n\t * @return {Spherical} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * This class can be used to represent points in 3D space as\n * [Cylindrical coordinates]{@link https://en.wikipedia.org/wiki/Cylindrical_coordinate_system}.\n */\nclass Cylindrical {\n\n\t/**\n\t * Constructs a new cylindrical.\n\t *\n\t * @param {number} [radius=1] - The distance from the origin to a point in the x-z plane.\n\t * @param {number} [theta=0] - A counterclockwise angle in the x-z plane measured in radians from the positive z-axis.\n\t * @param {number} [y=0] - The height above the x-z plane.\n\t */\n\tconstructor( radius = 1, theta = 0, y = 0 ) {\n\n\t\t/**\n\t\t * The distance from the origin to a point in the x-z plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.radius = radius;\n\n\t\t/**\n\t\t * A counterclockwise angle in the x-z plane measured in radians from the positive z-axis.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.theta = theta;\n\n\t\t/**\n\t\t * The height above the x-z plane.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0\n\t\t */\n\t\tthis.y = y;\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components by copying the given values.\n\t *\n\t * @param {number} radius - The radius.\n\t * @param {number} theta - The theta angle.\n\t * @param {number} y - The height value.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tset( radius, theta, y ) {\n\n\t\tthis.radius = radius;\n\t\tthis.theta = theta;\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given cylindrical to this instance.\n\t *\n\t * @param {Cylindrical} other - The cylindrical to copy.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tcopy( other ) {\n\n\t\tthis.radius = other.radius;\n\t\tthis.theta = other.theta;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components from the given vector which is assumed to hold\n\t * Cartesian coordinates.\n\t *\n\t * @param {Vector3} v - The vector to set.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tsetFromVector3( v ) {\n\n\t\treturn this.setFromCartesianCoords( v.x, v.y, v.z );\n\n\t}\n\n\t/**\n\t * Sets the cylindrical components from the given Cartesian coordinates.\n\t *\n\t * @param {number} x - The x value.\n\t * @param {number} y - The x value.\n\t * @param {number} z - The x value.\n\t * @return {Cylindrical} A reference to this cylindrical.\n\t */\n\tsetFromCartesianCoords( x, y, z ) {\n\n\t\tthis.radius = Math.sqrt( x * x + z * z );\n\t\tthis.theta = Math.atan2( x, z );\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new cylindrical with copied values from this instance.\n\t *\n\t * @return {Cylindrical} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n/**\n * Represents a 2x2 matrix.\n *\n * A Note on Row-Major and Column-Major Ordering:\n *\n * The constructor and {@link Matrix2#set} method take arguments in\n * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}\n * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order.\n * This means that calling:\n * ```js\n * const m = new THREE.Matrix2();\n * m.set( 11, 12,\n *        21, 22 );\n * ```\n * will result in the elements array containing:\n * ```js\n * m.elements = [ 11, 21,\n *                12, 22 ];\n * ```\n * and internally all calculations are performed using column-major ordering.\n * However, as the actual ordering makes no difference mathematically and\n * most people are used to thinking about matrices in row-major order, the\n * three.js documentation shows matrices in row-major order. Just bear in\n * mind that if you are reading the source code, you'll have to take the\n * transpose of any matrices outlined here to make sense of the calculations.\n */\nclass Matrix2 {\n\n\t/**\n\t * Constructs a new 2x2 matrix. The arguments are supposed to be\n\t * in row-major order. If no arguments are provided, the constructor\n\t * initializes the matrix as an identity matrix.\n\t *\n\t * @param {number} [n11] - 1-1 matrix element.\n\t * @param {number} [n12] - 1-2 matrix element.\n\t * @param {number} [n21] - 2-1 matrix element.\n\t * @param {number} [n22] - 2-2 matrix element.\n\t */\n\tconstructor( n11, n12, n21, n22 ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tMatrix2.prototype.isMatrix2 = true;\n\n\t\t/**\n\t\t * A column-major list of matrix values.\n\t\t *\n\t\t * @type {Array<number>}\n\t\t */\n\t\tthis.elements = [\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t];\n\n\t\tif ( n11 !== undefined ) {\n\n\t\t\tthis.set( n11, n12, n21, n22 );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets this matrix to the 2x2 identity matrix.\n\t *\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tidentity() {\n\n\t\tthis.set(\n\t\t\t1, 0,\n\t\t\t0, 1,\n\t\t);\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix from the given array.\n\t *\n\t * @param {Array<number>} array - The matrix elements in column-major order.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\t\tthis.elements[ i ] = array[ i + offset ];\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the elements of the matrix.The arguments are supposed to be\n\t * in row-major order.\n\t *\n\t * @param {number} n11 - 1-1 matrix element.\n\t * @param {number} n12 - 1-2 matrix element.\n\t * @param {number} n21 - 2-1 matrix element.\n\t * @param {number} n22 - 2-2 matrix element.\n\t * @return {Matrix2} A reference to this matrix.\n\t */\n\tset( n11, n12, n21, n22 ) {\n\n\t\tconst te = this.elements;\n\n\t\tte[ 0 ] = n11; te[ 2 ] = n12;\n\t\tte[ 1 ] = n21; te[ 3 ] = n22;\n\n\t\treturn this;\n\n\t}\n\n}\n\nconst _vector$4 = /*@__PURE__*/ new Vector2();\n\n/**\n * Represents an axis-aligned bounding box (AABB) in 2D space.\n */\nclass Box2 {\n\n\t/**\n\t * Constructs a new bounding box.\n\t *\n\t * @param {Vector2} [min=(Infinity,Infinity)] - A vector representing the lower boundary of the box.\n\t * @param {Vector2} [max=(-Infinity,-Infinity)] - A vector representing the upper boundary of the box.\n\t */\n\tconstructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isBox2 = true;\n\n\t\t/**\n\t\t * The lower boundary of the box.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.min = min;\n\n\t\t/**\n\t\t * The upper boundary of the box.\n\t\t *\n\t\t * @type {Vector2}\n\t\t */\n\t\tthis.max = max;\n\n\t}\n\n\t/**\n\t * Sets the lower and upper boundaries of this box.\n\t * Please note that this method only copies the values from the given objects.\n\t *\n\t * @param {Vector2} min - The lower boundary of the box.\n\t * @param {Vector2} max - The upper boundary of the box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tset( min, max ) {\n\n\t\tthis.min.copy( min );\n\t\tthis.max.copy( max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the upper and lower bounds of this box so it encloses the position data\n\t * in the given array.\n\t *\n\t * @param {Array<Vector2>} points - An array holding 2D position data as instances of {@link Vector2}.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tsetFromPoints( points ) {\n\n\t\tthis.makeEmpty();\n\n\t\tfor ( let i = 0, il = points.length; i < il; i ++ ) {\n\n\t\t\tthis.expandByPoint( points[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Centers this box on the given center vector and sets this box's width, height and\n\t * depth to the given size values.\n\t *\n\t * @param {Vector2} center - The center of the box.\n\t * @param {Vector2} size - The x and y dimensions of the box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tsetFromCenterAndSize( center, size ) {\n\n\t\tconst halfSize = _vector$4.copy( size ).multiplyScalar( 0.5 );\n\t\tthis.min.copy( center ).sub( halfSize );\n\t\tthis.max.copy( center ).add( halfSize );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new box with copied values from this instance.\n\t *\n\t * @return {Box2} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given box to this instance.\n\t *\n\t * @param {Box2} box - The box to copy.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tcopy( box ) {\n\n\t\tthis.min.copy( box.min );\n\t\tthis.max.copy( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Makes this box empty which means in encloses a zero space in 2D.\n\t *\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tmakeEmpty() {\n\n\t\tthis.min.x = this.min.y = + Infinity;\n\t\tthis.max.x = this.max.y = - Infinity;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns true if this box includes zero points within its bounds.\n\t * Note that a box with equal lower and upper bounds still includes one\n\t * point, the one both bounds share.\n\t *\n\t * @return {boolean} Whether this box is empty or not.\n\t */\n\tisEmpty() {\n\n\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\n\t\treturn ( this.max.x < this.min.x ) || ( this.max.y < this.min.y );\n\n\t}\n\n\t/**\n\t * Returns the center point of this box.\n\t *\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.addVectors( this.min, this.max ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the dimensions of this box.\n\t *\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The size.\n\t */\n\tgetSize( target ) {\n\n\t\treturn this.isEmpty() ? target.set( 0, 0 ) : target.subVectors( this.max, this.min );\n\n\t}\n\n\t/**\n\t * Expands the boundaries of this box to include the given point.\n\t *\n\t * @param {Vector2} point - The point that should be included by the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByPoint( point ) {\n\n\t\tthis.min.min( point );\n\t\tthis.max.max( point );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands this box equilaterally by the given vector. The width of this\n\t * box will be expanded by the x component of the vector in both\n\t * directions. The height of this box will be expanded by the y component of\n\t * the vector in both directions.\n\t *\n\t * @param {Vector2} vector - The vector that should expand the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByVector( vector ) {\n\n\t\tthis.min.sub( vector );\n\t\tthis.max.add( vector );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Expands each dimension of the box by the given scalar. If negative, the\n\t * dimensions of the box will be contracted.\n\t *\n\t * @param {number} scalar - The scalar value that should expand the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\texpandByScalar( scalar ) {\n\n\t\tthis.min.addScalar( - scalar );\n\t\tthis.max.addScalar( scalar );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point lies within or on the boundaries of this box.\n\t *\n\t * @param {Vector2} point - The point to test.\n\t * @return {boolean} Whether the bounding box contains the given point or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn point.x >= this.min.x && point.x <= this.max.x &&\n\t\t\tpoint.y >= this.min.y && point.y <= this.max.y;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box includes the entirety of the given bounding box.\n\t * If this box and the given one are identical, this function also returns `true`.\n\t *\n\t * @param {Box2} box - The bounding box to test.\n\t * @return {boolean} Whether the bounding box contains the given bounding box or not.\n\t */\n\tcontainsBox( box ) {\n\n\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x &&\n\t\t\tthis.min.y <= box.min.y && box.max.y <= this.max.y;\n\n\t}\n\n\t/**\n\t * Returns a point as a proportion of this box's width and height.\n\t *\n\t * @param {Vector2} point - A point in 2D space.\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} A point as a proportion of this box's width and height.\n\t */\n\tgetParameter( point, target ) {\n\n\t\t// This can potentially have a divide by zero if the box\n\t\t// has a size dimension of 0.\n\n\t\treturn target.set(\n\t\t\t( point.x - this.min.x ) / ( this.max.x - this.min.x ),\n\t\t\t( point.y - this.min.y ) / ( this.max.y - this.min.y )\n\t\t);\n\n\t}\n\n\t/**\n\t * Returns `true` if the given bounding box intersects with this bounding box.\n\t *\n\t * @param {Box2} box - The bounding box to test.\n\t * @return {boolean} Whether the given bounding box intersects with this bounding box.\n\t */\n\tintersectsBox( box ) {\n\n\t\t// using 4 splitting planes to rule out intersections\n\n\t\treturn box.max.x >= this.min.x && box.min.x <= this.max.x &&\n\t\t\tbox.max.y >= this.min.y && box.min.y <= this.max.y;\n\n\t}\n\n\t/**\n\t * Clamps the given point within the bounds of this box.\n\t *\n\t * @param {Vector2} point - The point to clamp.\n\t * @param {Vector2} target - The target vector that is used to store the method's result.\n\t * @return {Vector2} The clamped point.\n\t */\n\tclampPoint( point, target ) {\n\n\t\treturn target.copy( point ).clamp( this.min, this.max );\n\n\t}\n\n\t/**\n\t * Returns the euclidean distance from any edge of this box to the specified point. If\n\t * the given point lies inside of this box, the distance will be `0`.\n\t *\n\t * @param {Vector2} point - The point to compute the distance to.\n\t * @return {number} The euclidean distance.\n\t */\n\tdistanceToPoint( point ) {\n\n\t\treturn this.clampPoint( point, _vector$4 ).distanceTo( point );\n\n\t}\n\n\t/**\n\t * Computes the intersection of this bounding box and the given one, setting the upper\n\t * bound of this box to the lesser of the two boxes' upper bounds and the\n\t * lower bound of this box to the greater of the two boxes' lower bounds. If\n\t * there's no overlap, makes this box empty.\n\t *\n\t * @param {Box2} box - The bounding box to intersect with.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tintersect( box ) {\n\n\t\tthis.min.max( box.min );\n\t\tthis.max.min( box.max );\n\n\t\tif ( this.isEmpty() ) this.makeEmpty();\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the union of this box and another and the given one, setting the upper\n\t * bound of this box to the greater of the two boxes' upper bounds and the\n\t * lower bound of this box to the lesser of the two boxes' lower bounds.\n\t *\n\t * @param {Box2} box - The bounding box that will be unioned with this instance.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\tunion( box ) {\n\n\t\tthis.min.min( box.min );\n\t\tthis.max.max( box.max );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given offset to both the upper and lower bounds of this bounding box,\n\t * effectively moving it in 2D space.\n\t *\n\t * @param {Vector2} offset - The offset that should be used to translate the bounding box.\n\t * @return {Box2} A reference to this bounding box.\n\t */\n\ttranslate( offset ) {\n\n\t\tthis.min.add( offset );\n\t\tthis.max.add( offset );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this bounding box is equal with the given one.\n\t *\n\t * @param {Box2} box - The box to test for equality.\n\t * @return {boolean} Whether this bounding box is equal with the given one.\n\t */\n\tequals( box ) {\n\n\t\treturn box.min.equals( this.min ) && box.max.equals( this.max );\n\n\t}\n\n}\n\nconst _startP = /*@__PURE__*/ new Vector3();\nconst _startEnd = /*@__PURE__*/ new Vector3();\n\nconst _d1 = /*@__PURE__*/ new Vector3();\nconst _d2 = /*@__PURE__*/ new Vector3();\nconst _r = /*@__PURE__*/ new Vector3();\nconst _c1 = /*@__PURE__*/ new Vector3();\nconst _c2 = /*@__PURE__*/ new Vector3();\n\n/**\n * An analytical line segment in 3D space represented by a start and end point.\n */\nclass Line3 {\n\n\t/**\n\t * Constructs a new line segment.\n\t *\n\t * @param {Vector3} [start=(0,0,0)] - Start of the line segment.\n\t * @param {Vector3} [end=(0,0,0)] - End of the line segment.\n\t */\n\tconstructor( start = new Vector3(), end = new Vector3() ) {\n\n\t\t/**\n\t\t * Start of the line segment.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.start = start;\n\n\t\t/**\n\t\t * End of the line segment.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.end = end;\n\n\t}\n\n\t/**\n\t * Sets the start and end values by copying the given vectors.\n\t *\n\t * @param {Vector3} start - The start point.\n\t * @param {Vector3} end - The end point.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tset( start, end ) {\n\n\t\tthis.start.copy( start );\n\t\tthis.end.copy( end );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Copies the values of the given line segment to this instance.\n\t *\n\t * @param {Line3} line - The line segment to copy.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tcopy( line ) {\n\n\t\tthis.start.copy( line.start );\n\t\tthis.end.copy( line.end );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the center of the line segment.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The center point.\n\t */\n\tgetCenter( target ) {\n\n\t\treturn target.addVectors( this.start, this.end ).multiplyScalar( 0.5 );\n\n\t}\n\n\t/**\n\t * Returns the delta vector of the line segment's start and end point.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The delta vector.\n\t */\n\tdelta( target ) {\n\n\t\treturn target.subVectors( this.end, this.start );\n\n\t}\n\n\t/**\n\t * Returns the squared Euclidean distance between the line' start and end point.\n\t *\n\t * @return {number} The squared Euclidean distance.\n\t */\n\tdistanceSq() {\n\n\t\treturn this.start.distanceToSquared( this.end );\n\n\t}\n\n\t/**\n\t * Returns the Euclidean distance between the line' start and end point.\n\t *\n\t * @return {number} The Euclidean distance.\n\t */\n\tdistance() {\n\n\t\treturn this.start.distanceTo( this.end );\n\n\t}\n\n\t/**\n\t * Returns a vector at a certain position along the line segment.\n\t *\n\t * @param {number} t - A value between `[0,1]` to represent a position along the line segment.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The delta vector.\n\t */\n\tat( t, target ) {\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\t/**\n\t * Returns a point parameter based on the closest point as projected on the line segment.\n\t *\n\t * @param {Vector3} point - The point for which to return a point parameter.\n\t * @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.\n\t * @return {number} The point parameter.\n\t */\n\tclosestPointToPointParameter( point, clampToLine ) {\n\n\t\t_startP.subVectors( point, this.start );\n\t\t_startEnd.subVectors( this.end, this.start );\n\n\t\tconst startEnd2 = _startEnd.dot( _startEnd );\n\t\tconst startEnd_startP = _startEnd.dot( _startP );\n\n\t\tlet t = startEnd_startP / startEnd2;\n\n\t\tif ( clampToLine ) {\n\n\t\t\tt = clamp( t, 0, 1 );\n\n\t\t}\n\n\t\treturn t;\n\n\t}\n\n\t/**\n\t * Returns the closest point on the line for a given point.\n\t *\n\t * @param {Vector3} point - The point to compute the closest point on the line for.\n\t * @param {boolean} clampToLine - Whether to clamp the result to the range `[0,1]` or not.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the line.\n\t */\n\tclosestPointToPoint( point, clampToLine, target ) {\n\n\t\tconst t = this.closestPointToPointParameter( point, clampToLine );\n\n\t\treturn this.delta( target ).multiplyScalar( t ).add( this.start );\n\n\t}\n\n\t/**\n\t * Returns the closest squared distance between this line segment and the given one.\n\t *\n\t * @param {Line3} line - The line segment to compute the closest squared distance to.\n\t * @param {Vector3} [c1] - The closest point on this line segment.\n\t * @param {Vector3} [c2] - The closest point on the given line segment.\n\t * @return {number} The squared distance between this line segment and the given one.\n\t */\n\tdistanceSqToLine3( line, c1 = _c1, c2 = _c2 ) {\n\n\t\t// from Real-Time Collision Detection by Christer Ericson, chapter 5.1.9\n\n\t\t// Computes closest points C1 and C2 of S1(s)=P1+s*(Q1-P1) and\n\t\t// S2(t)=P2+t*(Q2-P2), returning s and t. Function result is squared\n\t\t// distance between between S1(s) and S2(t)\n\n\t\tconst EPSILON = 1e-8 * 1e-8; // must be squared since we compare squared length\n\t\tlet s, t;\n\n\t\tconst p1 = this.start;\n\t\tconst p2 = line.start;\n\t\tconst q1 = this.end;\n\t\tconst q2 = line.end;\n\n\t\t_d1.subVectors( q1, p1 ); // Direction vector of segment S1\n\t\t_d2.subVectors( q2, p2 ); // Direction vector of segment S2\n\t\t_r.subVectors( p1, p2 );\n\n\t\tconst a = _d1.dot( _d1 ); // Squared length of segment S1, always nonnegative\n\t\tconst e = _d2.dot( _d2 ); // Squared length of segment S2, always nonnegative\n\t\tconst f = _d2.dot( _r );\n\n\t\t// Check if either or both segments degenerate into points\n\n\t\tif ( a <= EPSILON && e <= EPSILON ) {\n\n\t\t\t// Both segments degenerate into points\n\n\t\t\tc1.copy( p1 );\n\t\t\tc2.copy( p2 );\n\n\t\t\tc1.sub( c2 );\n\n\t\t\treturn c1.dot( c1 );\n\n\t\t}\n\n\t\tif ( a <= EPSILON ) {\n\n\t\t\t// First segment degenerates into a point\n\n\t\t\ts = 0;\n\t\t\tt = f / e; // s = 0 => t = (b*s + f) / e = f / e\n\t\t\tt = clamp( t, 0, 1 );\n\n\n\t\t} else {\n\n\t\t\tconst c = _d1.dot( _r );\n\n\t\t\tif ( e <= EPSILON ) {\n\n\t\t\t\t// Second segment degenerates into a point\n\n\t\t\t\tt = 0;\n\t\t\t\ts = clamp( - c / a, 0, 1 ); // t = 0 => s = (b*t - c) / a = -c / a\n\n\t\t\t} else {\n\n\t\t\t\t// The general nondegenerate case starts here\n\n\t\t\t\tconst b = _d1.dot( _d2 );\n\t\t\t\tconst denom = a * e - b * b; // Always nonnegative\n\n\t\t\t\t// If segments not parallel, compute closest point on L1 to L2 and\n\t\t\t\t// clamp to segment S1. Else pick arbitrary s (here 0)\n\n\t\t\t\tif ( denom !== 0 ) {\n\n\t\t\t\t\ts = clamp( ( b * f - c * e ) / denom, 0, 1 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\ts = 0;\n\n\t\t\t\t}\n\n\t\t\t\t// Compute point on L2 closest to S1(s) using\n\t\t\t\t// t = Dot((P1 + D1*s) - P2,D2) / Dot(D2,D2) = (b*s + f) / e\n\n\t\t\t\tt = ( b * s + f ) / e;\n\n\t\t\t\t// If t in [0,1] done. Else clamp t, recompute s for the new value\n\t\t\t\t// of t using s = Dot((P2 + D2*t) - P1,D1) / Dot(D1,D1)= (t*b - c) / a\n\t\t\t\t// and clamp s to [0, 1]\n\n\t\t\t\tif ( t < 0 ) {\n\n\t\t\t\t\tt = 0.;\n\t\t\t\t\ts = clamp( - c / a, 0, 1 );\n\n\t\t\t\t} else if ( t > 1 ) {\n\n\t\t\t\t\tt = 1;\n\t\t\t\t\ts = clamp( ( b - c ) / a, 0, 1 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tc1.copy( p1 ).add( _d1.multiplyScalar( s ) );\n\t\tc2.copy( p2 ).add( _d2.multiplyScalar( t ) );\n\n\t\tc1.sub( c2 );\n\n\t\treturn c1.dot( c1 );\n\n\t}\n\n\t/**\n\t * Applies a 4x4 transformation matrix to this line segment.\n\t *\n\t * @param {Matrix4} matrix - The transformation matrix.\n\t * @return {Line3} A reference to this line segment.\n\t */\n\tapplyMatrix4( matrix ) {\n\n\t\tthis.start.applyMatrix4( matrix );\n\t\tthis.end.applyMatrix4( matrix );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this line segment is equal with the given one.\n\t *\n\t * @param {Line3} line - The line segment to test for equality.\n\t * @return {boolean} Whether this line segment is equal with the given one.\n\t */\n\tequals( line ) {\n\n\t\treturn line.start.equals( this.start ) && line.end.equals( this.end );\n\n\t}\n\n\t/**\n\t * Returns a new line segment with copied values from this instance.\n\t *\n\t * @return {Line3} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nconst _vector$3 = /*@__PURE__*/ new Vector3();\n\n/**\n * This displays a cone shaped helper object for a {@link SpotLight}.\n *\n * ```js\n * const spotLight = new THREE.SpotLight( 0xffffff );\n * spotLight.position.set( 10, 10, 10 );\n * scene.add( spotLight );\n *\n * const spotLightHelper = new THREE.SpotLightHelper( spotLight );\n * scene.add( spotLightHelper );\n * ```\n *\n * @augments Object3D\n */\nclass SpotLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new spot light helper.\n\t *\n\t * @param {HemisphereLight} light - The light to be visualized.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {SpotLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'SpotLightHelper';\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t-1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, -1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t// update the local matrix based on the parent and light target transforms\n\t\tif ( this.parent ) {\n\n\t\t\tthis.parent.updateWorldMatrix( true );\n\n\t\t\tthis.matrix\n\t\t\t\t.copy( this.parent.matrixWorld )\n\t\t\t\t.invert()\n\t\t\t\t.multiply( this.light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tthis.matrix.copy( this.light.matrixWorld );\n\n\t\t}\n\n\t\tthis.matrixWorld.copy( this.light.matrixWorld );\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector$3.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector$3 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\nconst _vector$2 = /*@__PURE__*/ new Vector3();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\nconst _matrixWorldInv = /*@__PURE__*/ new Matrix4();\n\n/**\n * A helper object to assist with visualizing a {@link Skeleton}.\n *\n * ```js\n * const helper = new THREE.SkeletonHelper( skinnedMesh );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass SkeletonHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new skeleton helper.\n\t *\n\t * @param {Object3D} object -  Usually an instance of {@link SkinnedMesh}. However, any 3D object\n\t * can be used if it represents a hierarchy of bones (see {@link Bone}).\n\t */\n\tconstructor( object ) {\n\n\t\tconst bones = getBoneList( object );\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tfor ( let i = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tcolors.push( 0, 0, 0 );\n\t\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isSkeletonHelper = true;\n\n\t\tthis.type = 'SkeletonHelper';\n\n\t\t/**\n\t\t * The object being visualized.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.root = object;\n\n\t\t/**\n\t\t * The list of bones that the helper visualizes.\n\t\t *\n\t\t * @type {Array<Bone>}\n\t\t */\n\t\tthis.bones = bones;\n\n\t\tthis.matrix = object.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t// colors\n\n\t\tconst color1 = new Color( 0x0000ff );\n\t\tconst color2 = new Color( 0x00ff00 );\n\n\t\tthis.setColors( color1, color2 );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst bones = this.bones;\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t_matrixWorldInv.copy( this.root.matrixWorld ).invert();\n\n\t\tfor ( let i = 0, j = 0; i < bones.length; i ++ ) {\n\n\t\t\tconst bone = bones[ i ];\n\n\t\t\tif ( bone.parent && bone.parent.isBone ) {\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\t_boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld );\n\t\t\t\t_vector$2.setFromMatrixPosition( _boneMatrix );\n\t\t\t\tposition.setXYZ( j + 1, _vector$2.x, _vector$2.y, _vector$2.z );\n\n\t\t\t\tj += 2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Defines the colors of the helper.\n\t *\n\t * @param {Color} color1 - The first line color for each bone.\n\t * @param {Color} color2 - The second line color for each bone.\n\t * @return {SkeletonHelper} A reference to this helper.\n\t */\n\tsetColors( color1, color2 ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\tfor ( let i = 0; i < colorAttribute.count; i += 2 ) {\n\n\t\t\tcolorAttribute.setXYZ( i, color1.r, color1.g, color1.b );\n\t\t\tcolorAttribute.setXYZ( i + 1, color2.r, color2.g, color2.b );\n\n\t\t}\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction getBoneList( object ) {\n\n\tconst boneList = [];\n\n\tif ( object.isBone === true ) {\n\n\t\tboneList.push( object );\n\n\t}\n\n\tfor ( let i = 0; i < object.children.length; i ++ ) {\n\n\t\tboneList.push( ...getBoneList( object.children[ i ] ) );\n\n\t}\n\n\treturn boneList;\n\n}\n\n/**\n * This displays a helper object consisting of a spherical mesh for\n * visualizing an instance of {@link PointLight}.\n *\n * ```js\n * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );\n * pointLight.position.set( 10, 10, 10 );\n * scene.add( pointLight );\n *\n * const sphereSize = 1;\n * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );\n * scene.add( pointLightHelper );\n * ```\n *\n * @augments Mesh\n */\nclass PointLightHelper extends Mesh {\n\n\t/**\n\t * Constructs a new point light helper.\n\t *\n\t * @param {PointLight} light - The light to be visualized.\n\t * @param {number} [sphereSize=1] - The size of the sphere helper.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {HemisphereLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\n\t\t/*\n\t// TODO: delete this comment?\n\tconst distanceGeometry = new THREE.IcosahedronGeometry( 1, 2 );\n\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\n\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\n\tconst d = light.distance;\n\n\tif ( d === 0.0 ) {\n\n\t\tthis.lightDistance.visible = false;\n\n\t} else {\n\n\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t}\n\n\tthis.add( this.lightDistance );\n\t*/\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\nconst _vector$1 = /*@__PURE__*/ new Vector3();\nconst _color1 = /*@__PURE__*/ new Color();\nconst _color2 = /*@__PURE__*/ new Color();\n\n/**\n * Creates a visual aid consisting of a spherical mesh for a\n * given {@link HemisphereLight}.\n *\n * ```js\n * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );\n * const helper = new THREE.HemisphereLightHelper( light, 5 );\n * scene.add( helper );\n * ```\n *\n * @augments Object3D\n */\nclass HemisphereLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new hemisphere light helper.\n\t *\n\t * @param {HemisphereLight} light - The light to be visualized.\n\t * @param {number} [size=1] - The size of the mesh used to visualize the light.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {HemisphereLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'HemisphereLightHelper';\n\n\t\tconst geometry = new OctahedronGeometry( size );\n\t\tgeometry.rotateY( Math.PI * 0.5 );\n\n\t\tthis.material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\t\tif ( this.color === undefined ) this.material.vertexColors = true;\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\t\tconst colors = new Float32Array( position.count * 3 );\n\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( colors, 3 ) );\n\n\t\tthis.add( new Mesh( geometry, this.material ) );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tconst mesh = this.children[ 0 ];\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tconst colors = mesh.geometry.getAttribute( 'color' );\n\n\t\t\t_color1.copy( this.light.color );\n\t\t\t_color2.copy( this.light.groundColor );\n\n\t\t\tfor ( let i = 0, l = colors.count; i < l; i ++ ) {\n\n\t\t\t\tconst color = ( i < ( l / 2 ) ) ? _color1 : _color2;\n\n\t\t\t\tcolors.setXYZ( i, color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t\tcolors.needsUpdate = true;\n\n\t\t}\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tmesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );\n\n\t}\n\n}\n\n/**\n * The helper is an object to define grids. Grids are two-dimensional\n * arrays of lines.\n *\n * ```js\n * const size = 10;\n * const divisions = 10;\n *\n * const gridHelper = new THREE.GridHelper( size, divisions );\n * scene.add( gridHelper );\n * ```\n *\n * @augments LineSegments\n */\nclass GridHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new grid helper.\n\t *\n\t * @param {number} [size=10] - The size of the grid.\n\t * @param {number} [divisions=10] - The number of divisions across the grid.\n\t * @param {number|Color|string} [color1=0x444444] - The color of the center line.\n\t * @param {number|Color|string} [color2=0x888888] - The color of the lines of the grid.\n\t */\n\tconstructor( size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst center = divisions / 2;\n\t\tconst step = size / divisions;\n\t\tconst halfSize = size / 2;\n\n\t\tconst vertices = [], colors = [];\n\n\t\tfor ( let i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) {\n\n\t\t\tvertices.push( - halfSize, 0, k, halfSize, 0, k );\n\t\t\tvertices.push( k, 0, - halfSize, k, 0, halfSize );\n\n\t\t\tconst color = i === center ? color1 : color2;\n\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\t\t\tcolor.toArray( colors, j ); j += 3;\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'GridHelper';\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * This helper is an object to define polar grids. Grids are\n * two-dimensional arrays of lines.\n *\n * ```js\n * const radius = 10;\n * const sectors = 16;\n * const rings = 8;\n * const divisions = 64;\n *\n * const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass PolarGridHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new polar grid helper.\n\t *\n\t * @param {number} [radius=10] - The radius of the polar grid. This can be any positive number.\n\t * @param {number} [sectors=16] - The number of sectors the grid will be divided into. This can be any positive integer.\n\t * @param {number} [rings=16] - The number of rings. This can be any positive integer.\n\t * @param {number} [divisions=64] - The number of line segments used for each circle. This can be any positive integer.\n\t * @param {number|Color|string} [color1=0x444444] - The first color used for grid elements.\n\t * @param {number|Color|string} [color2=0x888888] -  The second color used for grid elements.\n\t */\n\tconstructor( radius = 10, sectors = 16, rings = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888 ) {\n\n\t\tcolor1 = new Color( color1 );\n\t\tcolor2 = new Color( color2 );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\t// create the sectors\n\n\t\tif ( sectors > 1 ) {\n\n\t\t\tfor ( let i = 0; i < sectors; i ++ ) {\n\n\t\t\t\tconst v = ( i / sectors ) * ( Math.PI * 2 );\n\n\t\t\t\tconst x = Math.sin( v ) * radius;\n\t\t\t\tconst z = Math.cos( v ) * radius;\n\n\t\t\t\tvertices.push( 0, 0, 0 );\n\t\t\t\tvertices.push( x, 0, z );\n\n\t\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// create the rings\n\n\t\tfor ( let i = 0; i < rings; i ++ ) {\n\n\t\t\tconst color = ( i & 1 ) ? color1 : color2;\n\n\t\t\tconst r = radius - ( radius / rings * i );\n\n\t\t\tfor ( let j = 0; j < divisions; j ++ ) {\n\n\t\t\t\t// first vertex\n\n\t\t\t\tlet v = ( j / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tlet x = Math.sin( v ) * r;\n\t\t\t\tlet z = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t\t// second vertex\n\n\t\t\t\tv = ( ( j + 1 ) / divisions ) * ( Math.PI * 2 );\n\n\t\t\t\tx = Math.sin( v ) * r;\n\t\t\t\tz = Math.cos( v ) * r;\n\n\t\t\t\tvertices.push( x, 0, z );\n\t\t\t\tcolors.push( color.r, color.g, color.b );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'PolarGridHelper';\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\n/**\n * Helper object to assist with visualizing a {@link DirectionalLight}'s\n * effect on the scene. This consists of plane and a line representing the\n * light's position and direction.\n *\n * ```js\n * const light = new THREE.DirectionalLight( 0xFFFFFF );\n * scene.add( light );\n *\n * const helper = new THREE.DirectionalLightHelper( light, 5 );\n * scene.add( helper );\n * ```\n *\n * @augments Object3D\n */\nclass DirectionalLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new directional light helper.\n\t *\n\t * @param {DirectionalLight} light - The light to be visualized.\n\t * @param {number} [size=1] - The dimensions of the plane.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, size, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {DirectionalLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrix = light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'DirectionalLightHelper';\n\n\t\tif ( size === undefined ) size = 1;\n\n\t\tlet geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [\n\t\t\t- size, size, 0,\n\t\t\tsize, size, 0,\n\t\t\tsize, - size, 0,\n\t\t\t- size, - size, 0,\n\t\t\t- size, size, 0\n\t\t], 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\t/**\n\t\t * Contains the line showing the location of the directional light.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.lightPlane = new Line( geometry, material );\n\t\tthis.add( this.lightPlane );\n\n\t\tgeometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) );\n\n\t\t/**\n\t\t * Represents the target line of the directional light.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.targetLine = new Line( geometry, material );\n\t\tthis.add( this.targetLine );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.lightPlane.geometry.dispose();\n\t\tthis.lightPlane.material.dispose();\n\t\tthis.targetLine.geometry.dispose();\n\t\tthis.targetLine.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t_v1.setFromMatrixPosition( this.light.matrixWorld );\n\t\t_v2.setFromMatrixPosition( this.light.target.matrixWorld );\n\t\t_v3.subVectors( _v2, _v1 );\n\n\t\tthis.lightPlane.lookAt( _v2 );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.lightPlane.material.color.set( this.color );\n\t\t\tthis.targetLine.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.lightPlane.material.color.copy( this.light.color );\n\t\t\tthis.targetLine.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\tthis.targetLine.lookAt( _v2 );\n\t\tthis.targetLine.scale.z = _v3.length();\n\n\t}\n\n}\n\nconst _vector = /*@__PURE__*/ new Vector3();\nconst _camera = /*@__PURE__*/ new Camera();\n\n/**\n * This helps with visualizing what a camera contains in its frustum. It\n * visualizes the frustum of a camera using a line segments.\n *\n * Based on frustum visualization in [lightgl.js shadowmap example]{@link https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html}.\n *\n * `CameraHelper` must be a child of the scene.\n *\n * ```js\n * const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );\n * const helper = new THREE.CameraHelper( camera );\n * scene.add( helper );\n * ```\n *\n * @augments LineSegments\n */\nclass CameraHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new arrow helper.\n\t *\n\t * @param {Camera} camera - The camera to visualize.\n\t */\n\tconstructor( camera ) {\n\n\t\tconst geometry = new BufferGeometry();\n\t\tconst material = new LineBasicMaterial( { color: 0xffffff, vertexColors: true, toneMapped: false } );\n\n\t\tconst vertices = [];\n\t\tconst colors = [];\n\n\t\tconst pointMap = {};\n\n\t\t// near\n\n\t\taddLine( 'n1', 'n2' );\n\t\taddLine( 'n2', 'n4' );\n\t\taddLine( 'n4', 'n3' );\n\t\taddLine( 'n3', 'n1' );\n\n\t\t// far\n\n\t\taddLine( 'f1', 'f2' );\n\t\taddLine( 'f2', 'f4' );\n\t\taddLine( 'f4', 'f3' );\n\t\taddLine( 'f3', 'f1' );\n\n\t\t// sides\n\n\t\taddLine( 'n1', 'f1' );\n\t\taddLine( 'n2', 'f2' );\n\t\taddLine( 'n3', 'f3' );\n\t\taddLine( 'n4', 'f4' );\n\n\t\t// cone\n\n\t\taddLine( 'p', 'n1' );\n\t\taddLine( 'p', 'n2' );\n\t\taddLine( 'p', 'n3' );\n\t\taddLine( 'p', 'n4' );\n\n\t\t// up\n\n\t\taddLine( 'u1', 'u2' );\n\t\taddLine( 'u2', 'u3' );\n\t\taddLine( 'u3', 'u1' );\n\n\t\t// target\n\n\t\taddLine( 'c', 't' );\n\t\taddLine( 'p', 'c' );\n\n\t\t// cross\n\n\t\taddLine( 'cn1', 'cn2' );\n\t\taddLine( 'cn3', 'cn4' );\n\n\t\taddLine( 'cf1', 'cf2' );\n\t\taddLine( 'cf3', 'cf4' );\n\n\t\tfunction addLine( a, b ) {\n\n\t\t\taddPoint( a );\n\t\t\taddPoint( b );\n\n\t\t}\n\n\t\tfunction addPoint( id ) {\n\n\t\t\tvertices.push( 0, 0, 0 );\n\t\t\tcolors.push( 0, 0, 0 );\n\n\t\t\tif ( pointMap[ id ] === undefined ) {\n\n\t\t\t\tpointMap[ id ] = [];\n\n\t\t\t}\n\n\t\t\tpointMap[ id ].push( ( vertices.length / 3 ) - 1 );\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'CameraHelper';\n\n\t\t/**\n\t\t * The camera being visualized.\n\t\t *\n\t\t * @type {Camera}\n\t\t */\n\t\tthis.camera = camera;\n\t\tif ( this.camera.updateProjectionMatrix ) this.camera.updateProjectionMatrix();\n\n\t\tthis.matrix = camera.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * This contains the points used to visualize the camera.\n\t\t *\n\t\t * @type {Object<string,Array<number>>}\n\t\t */\n\t\tthis.pointMap = pointMap;\n\n\t\tthis.update();\n\n\t\t// colors\n\n\t\tconst colorFrustum = new Color( 0xffaa00 );\n\t\tconst colorCone = new Color( 0xff0000 );\n\t\tconst colorUp = new Color( 0x00aaff );\n\t\tconst colorTarget = new Color( 0xffffff );\n\t\tconst colorCross = new Color( 0x333333 );\n\n\t\tthis.setColors( colorFrustum, colorCone, colorUp, colorTarget, colorCross );\n\n\t}\n\n\t/**\n\t * Defines the colors of the helper.\n\t *\n\t * @param {Color} frustum - The frustum line color.\n\t * @param {Color} cone - The cone line color.\n\t * @param {Color} up - The up line color.\n\t * @param {Color} target - The target line color.\n\t * @param {Color} cross - The cross line color.\n\t * @return {CameraHelper} A reference to this helper.\n\t */\n\tsetColors( frustum, cone, up, target, cross ) {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst colorAttribute = geometry.getAttribute( 'color' );\n\n\t\t// near\n\n\t\tcolorAttribute.setXYZ( 0, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 1, frustum.r, frustum.g, frustum.b ); // n1, n2\n\t\tcolorAttribute.setXYZ( 2, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 3, frustum.r, frustum.g, frustum.b ); // n2, n4\n\t\tcolorAttribute.setXYZ( 4, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 5, frustum.r, frustum.g, frustum.b ); // n4, n3\n\t\tcolorAttribute.setXYZ( 6, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 7, frustum.r, frustum.g, frustum.b ); // n3, n1\n\n\t\t// far\n\n\t\tcolorAttribute.setXYZ( 8, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 9, frustum.r, frustum.g, frustum.b ); // f1, f2\n\t\tcolorAttribute.setXYZ( 10, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 11, frustum.r, frustum.g, frustum.b ); // f2, f4\n\t\tcolorAttribute.setXYZ( 12, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 13, frustum.r, frustum.g, frustum.b ); // f4, f3\n\t\tcolorAttribute.setXYZ( 14, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 15, frustum.r, frustum.g, frustum.b ); // f3, f1\n\n\t\t// sides\n\n\t\tcolorAttribute.setXYZ( 16, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 17, frustum.r, frustum.g, frustum.b ); // n1, f1\n\t\tcolorAttribute.setXYZ( 18, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 19, frustum.r, frustum.g, frustum.b ); // n2, f2\n\t\tcolorAttribute.setXYZ( 20, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 21, frustum.r, frustum.g, frustum.b ); // n3, f3\n\t\tcolorAttribute.setXYZ( 22, frustum.r, frustum.g, frustum.b ); colorAttribute.setXYZ( 23, frustum.r, frustum.g, frustum.b ); // n4, f4\n\n\t\t// cone\n\n\t\tcolorAttribute.setXYZ( 24, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 25, cone.r, cone.g, cone.b ); // p, n1\n\t\tcolorAttribute.setXYZ( 26, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 27, cone.r, cone.g, cone.b ); // p, n2\n\t\tcolorAttribute.setXYZ( 28, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 29, cone.r, cone.g, cone.b ); // p, n3\n\t\tcolorAttribute.setXYZ( 30, cone.r, cone.g, cone.b ); colorAttribute.setXYZ( 31, cone.r, cone.g, cone.b ); // p, n4\n\n\t\t// up\n\n\t\tcolorAttribute.setXYZ( 32, up.r, up.g, up.b ); colorAttribute.setXYZ( 33, up.r, up.g, up.b ); // u1, u2\n\t\tcolorAttribute.setXYZ( 34, up.r, up.g, up.b ); colorAttribute.setXYZ( 35, up.r, up.g, up.b ); // u2, u3\n\t\tcolorAttribute.setXYZ( 36, up.r, up.g, up.b ); colorAttribute.setXYZ( 37, up.r, up.g, up.b ); // u3, u1\n\n\t\t// target\n\n\t\tcolorAttribute.setXYZ( 38, target.r, target.g, target.b ); colorAttribute.setXYZ( 39, target.r, target.g, target.b ); // c, t\n\t\tcolorAttribute.setXYZ( 40, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 41, cross.r, cross.g, cross.b ); // p, c\n\n\t\t// cross\n\n\t\tcolorAttribute.setXYZ( 42, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 43, cross.r, cross.g, cross.b ); // cn1, cn2\n\t\tcolorAttribute.setXYZ( 44, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 45, cross.r, cross.g, cross.b ); // cn3, cn4\n\n\t\tcolorAttribute.setXYZ( 46, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 47, cross.r, cross.g, cross.b ); // cf1, cf2\n\t\tcolorAttribute.setXYZ( 48, cross.r, cross.g, cross.b ); colorAttribute.setXYZ( 49, cross.r, cross.g, cross.b ); // cf3, cf4\n\n\t\tcolorAttribute.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Updates the helper based on the projection matrix of the camera.\n\t */\n\tupdate() {\n\n\t\tconst geometry = this.geometry;\n\t\tconst pointMap = this.pointMap;\n\n\t\tconst w = 1, h = 1;\n\n\t\tlet nearZ, farZ;\n\n\t\t// we need just camera projection matrix inverse\n\t\t// world matrix must be identity\n\n\t\t_camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );\n\n\t\t// Adjust z values based on coordinate system\n\n\t\tif ( this.camera.reversedDepth === true ) {\n\n\t\t\tnearZ = 1;\n\t\t\tfarZ = 0;\n\n\t\t} else {\n\n\t\t\tif ( this.camera.coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\t\tnearZ = -1;\n\t\t\t\tfarZ = 1;\n\n\t\t\t} else if ( this.camera.coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\t\tnearZ = 0;\n\t\t\t\tfarZ = 1;\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.CameraHelper.update(): Invalid coordinate system: ' + this.camera.coordinateSystem );\n\n\t\t\t}\n\n\t\t}\n\n\n\t\t// center / target\n\t\tsetPoint( 'c', pointMap, geometry, _camera, 0, 0, nearZ );\n\t\tsetPoint( 't', pointMap, geometry, _camera, 0, 0, farZ );\n\n\t\t// near\n\n\t\tsetPoint( 'n1', pointMap, geometry, _camera, - w, - h, nearZ );\n\t\tsetPoint( 'n2', pointMap, geometry, _camera, w, - h, nearZ );\n\t\tsetPoint( 'n3', pointMap, geometry, _camera, - w, h, nearZ );\n\t\tsetPoint( 'n4', pointMap, geometry, _camera, w, h, nearZ );\n\n\t\t// far\n\n\t\tsetPoint( 'f1', pointMap, geometry, _camera, - w, - h, farZ );\n\t\tsetPoint( 'f2', pointMap, geometry, _camera, w, - h, farZ );\n\t\tsetPoint( 'f3', pointMap, geometry, _camera, - w, h, farZ );\n\t\tsetPoint( 'f4', pointMap, geometry, _camera, w, h, farZ );\n\n\t\t// up\n\n\t\tsetPoint( 'u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, nearZ );\n\t\tsetPoint( 'u2', pointMap, geometry, _camera, - w * 0.7, h * 1.1, nearZ );\n\t\tsetPoint( 'u3', pointMap, geometry, _camera, 0, h * 2, nearZ );\n\n\t\t// cross\n\n\t\tsetPoint( 'cf1', pointMap, geometry, _camera, - w, 0, farZ );\n\t\tsetPoint( 'cf2', pointMap, geometry, _camera, w, 0, farZ );\n\t\tsetPoint( 'cf3', pointMap, geometry, _camera, 0, - h, farZ );\n\t\tsetPoint( 'cf4', pointMap, geometry, _camera, 0, h, farZ );\n\n\t\tsetPoint( 'cn1', pointMap, geometry, _camera, - w, 0, nearZ );\n\t\tsetPoint( 'cn2', pointMap, geometry, _camera, w, 0, nearZ );\n\t\tsetPoint( 'cn3', pointMap, geometry, _camera, 0, - h, nearZ );\n\t\tsetPoint( 'cn4', pointMap, geometry, _camera, 0, h, nearZ );\n\n\t\tgeometry.getAttribute( 'position' ).needsUpdate = true;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n\nfunction setPoint( point, pointMap, geometry, camera, x, y, z ) {\n\n\t_vector.set( x, y, z ).unproject( camera );\n\n\tconst points = pointMap[ point ];\n\n\tif ( points !== undefined ) {\n\n\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\tfor ( let i = 0, l = points.length; i < l; i ++ ) {\n\n\t\t\tposition.setXYZ( points[ i ], _vector.x, _vector.y, _vector.z );\n\n\t\t}\n\n\t}\n\n}\n\nconst _box = /*@__PURE__*/ new Box3();\n\n/**\n * Helper object to graphically show the world-axis-aligned bounding box\n * around an object. The actual bounding box is handled with {@link Box3},\n * this is just a visual helper for debugging. It can be automatically\n * resized with {@link BoxHelper#update} when the object it's created from\n * is transformed. Note that the object must have a geometry for this to work,\n * so it won't work with sprites.\n *\n * ```js\n * const sphere = new THREE.SphereGeometry();\n * const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );\n * const box = new THREE.BoxHelper( object, 0xffff00 );\n * scene.add( box );\n * ```\n *\n * @augments LineSegments\n */\nclass BoxHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new box helper.\n\t *\n\t * @param {Object3D} [object] - The 3D object to show the world-axis-aligned bounding box.\n\t * @param {number|Color|string} [color=0xffff00] - The box's color.\n\t */\n\tconstructor( object, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\t\tconst positions = new Float32Array( 8 * 3 );\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\t\tgeometry.setAttribute( 'position', new BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\t/**\n\t\t * The 3D object being visualized.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.object = object;\n\t\tthis.type = 'BoxHelper';\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Updates the helper's geometry to match the dimensions of the object,\n\t * including any children.\n\t */\n\tupdate() {\n\n\t\tif ( this.object !== undefined ) {\n\n\t\t\t_box.setFromObject( this.object );\n\n\t\t}\n\n\t\tif ( _box.isEmpty() ) return;\n\n\t\tconst min = _box.min;\n\t\tconst max = _box.max;\n\n\t\t/*\n\t\t\t5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/\n\n\t\tconst position = this.geometry.attributes.position;\n\t\tconst array = position.array;\n\n\t\tarray[ 0 ] = max.x; array[ 1 ] = max.y; array[ 2 ] = max.z;\n\t\tarray[ 3 ] = min.x; array[ 4 ] = max.y; array[ 5 ] = max.z;\n\t\tarray[ 6 ] = min.x; array[ 7 ] = min.y; array[ 8 ] = max.z;\n\t\tarray[ 9 ] = max.x; array[ 10 ] = min.y; array[ 11 ] = max.z;\n\t\tarray[ 12 ] = max.x; array[ 13 ] = max.y; array[ 14 ] = min.z;\n\t\tarray[ 15 ] = min.x; array[ 16 ] = max.y; array[ 17 ] = min.z;\n\t\tarray[ 18 ] = min.x; array[ 19 ] = min.y; array[ 20 ] = min.z;\n\t\tarray[ 21 ] = max.x; array[ 22 ] = min.y; array[ 23 ] = min.z;\n\n\t\tposition.needsUpdate = true;\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\t/**\n\t * Updates the wireframe box for the passed object.\n\t *\n\t * @param {Object3D} object - The 3D object to create the helper for.\n\t * @return {BoxHelper} A reference to this instance.\n\t */\n\tsetFromObject( object ) {\n\n\t\tthis.object = object;\n\t\tthis.update();\n\n\t\treturn this;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.object = source.object;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * A helper object to visualize an instance of {@link Box3}.\n *\n * ```js\n * const box = new THREE.Box3();\n * box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) );\n *\n * const helper = new THREE.Box3Helper( box, 0xffff00 );\n * scene.add( helper )\n * ```\n *\n * @augments LineSegments\n */\nclass Box3Helper extends LineSegments {\n\n\t/**\n\t * Constructs a new box3 helper.\n\t *\n\t * @param {Box3} box - The box to visualize.\n\t * @param {number|Color|string} [color=0xffff00] - The box's color.\n\t */\n\tconstructor( box, color = 0xffff00 ) {\n\n\t\tconst indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );\n\n\t\tconst positions = [ 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1 ];\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tgeometry.setIndex( new BufferAttribute( indices, 1 ) );\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\t/**\n\t\t * The box being visualized.\n\t\t *\n\t\t * @type {Box3}\n\t\t */\n\t\tthis.box = box;\n\n\t\tthis.type = 'Box3Helper';\n\n\t\tthis.geometry.computeBoundingSphere();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tconst box = this.box;\n\n\t\tif ( box.isEmpty() ) return;\n\n\t\tbox.getCenter( this.position );\n\n\t\tbox.getSize( this.scale );\n\n\t\tthis.scale.multiplyScalar( 0.5 );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * A helper object to visualize an instance of {@link Plane}.\n *\n * ```js\n * const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 );\n * const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 );\n * scene.add( helper );\n * ```\n *\n * @augments Line\n */\nclass PlaneHelper extends Line {\n\n\t/**\n\t * Constructs a new plane helper.\n\t *\n\t * @param {Plane} plane - The plane to be visualized.\n\t * @param {number} [size=1] - The side length of plane helper.\n\t * @param {number|Color|string} [hex=0xffff00] - The helper's color.\n\t */\n\tconstructor( plane, size = 1, hex = 0xffff00 ) {\n\n\t\tconst color = hex;\n\n\t\tconst positions = [ 1, -1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0 ];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\t\tgeometry.computeBoundingSphere();\n\n\t\tsuper( geometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\n\t\tthis.type = 'PlaneHelper';\n\n\t\t/**\n\t\t * The plane being visualized.\n\t\t *\n\t\t * @type {Plane}\n\t\t */\n\t\tthis.plane = plane;\n\n\t\t/**\n\t\t * The side length of plane helper.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.size = size;\n\n\t\tconst positions2 = [ 1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0 ];\n\n\t\tconst geometry2 = new BufferGeometry();\n\t\tgeometry2.setAttribute( 'position', new Float32BufferAttribute( positions2, 3 ) );\n\t\tgeometry2.computeBoundingSphere();\n\n\t\tthis.add( new Mesh( geometry2, new MeshBasicMaterial( { color: color, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false } ) ) );\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tthis.position.set( 0, 0, 0 );\n\n\t\tthis.scale.set( 0.5 * this.size, 0.5 * this.size, 1 );\n\n\t\tthis.lookAt( this.plane.normal );\n\n\t\tthis.translateZ( - this.plane.constant );\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\t\tthis.children[ 0 ].geometry.dispose();\n\t\tthis.children[ 0 ].material.dispose();\n\n\t}\n\n}\n\nconst _axis = /*@__PURE__*/ new Vector3();\nlet _lineGeometry, _coneGeometry;\n\n/**\n * An 3D arrow object for visualizing directions.\n *\n * ```js\n * const dir = new THREE.Vector3( 1, 2, 0 );\n *\n * //normalize the direction vector (convert to vector of length 1)\n * dir.normalize();\n *\n * const origin = new THREE.Vector3( 0, 0, 0 );\n * const length = 1;\n * const hex = 0xffff00;\n *\n * const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex );\n * scene.add( arrowHelper );\n * ```\n *\n * @augments Object3D\n */\nclass ArrowHelper extends Object3D {\n\n\t/**\n\t * Constructs a new arrow helper.\n\t *\n\t * @param {Vector3} [dir=(0, 0, 1)] - The (normalized) direction vector.\n\t * @param {Vector3} [origin=(0, 0, 0)] - Point at which the arrow starts.\n\t * @param {number} [length=1] - Length of the arrow in world units.\n\t * @param {(number|Color|string)} [color=0xffff00] - Color of the arrow.\n\t * @param {number} [headLength=length*0.2] - The length of the head of the arrow.\n\t * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow.\n\t */\n\tconstructor( dir = new Vector3( 0, 0, 1 ), origin = new Vector3( 0, 0, 0 ), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'ArrowHelper';\n\n\t\tif ( _lineGeometry === undefined ) {\n\n\t\t\t_lineGeometry = new BufferGeometry();\n\t\t\t_lineGeometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 1, 0 ], 3 ) );\n\n\t\t\t_coneGeometry = new ConeGeometry( 0.5, 1, 5, 1 );\n\t\t\t_coneGeometry.translate( 0, -0.5, 0 );\n\n\t\t}\n\n\t\tthis.position.copy( origin );\n\n\t\t/**\n\t\t * The line part of the arrow helper.\n\t\t *\n\t\t * @type {Line}\n\t\t */\n\t\tthis.line = new Line( _lineGeometry, new LineBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.line.matrixAutoUpdate = false;\n\t\tthis.add( this.line );\n\n\t\t/**\n\t\t * The cone part of the arrow helper.\n\t\t *\n\t\t * @type {Mesh}\n\t\t */\n\t\tthis.cone = new Mesh( _coneGeometry, new MeshBasicMaterial( { color: color, toneMapped: false } ) );\n\t\tthis.cone.matrixAutoUpdate = false;\n\t\tthis.add( this.cone );\n\n\t\tthis.setDirection( dir );\n\t\tthis.setLength( length, headLength, headWidth );\n\n\t}\n\n\t/**\n\t * Sets the direction of the helper.\n\t *\n\t * @param {Vector3} dir - The normalized direction vector.\n\t */\n\tsetDirection( dir ) {\n\n\t\t// dir is assumed to be normalized\n\n\t\tif ( dir.y > 0.99999 ) {\n\n\t\t\tthis.quaternion.set( 0, 0, 0, 1 );\n\n\t\t} else if ( dir.y < -0.99999 ) {\n\n\t\t\tthis.quaternion.set( 1, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_axis.set( dir.z, 0, - dir.x ).normalize();\n\n\t\t\tconst radians = Math.acos( dir.y );\n\n\t\t\tthis.quaternion.setFromAxisAngle( _axis, radians );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the length of the helper.\n\t *\n\t * @param {number} length - Length of the arrow in world units.\n\t * @param {number} [headLength=length*0.2] - The length of the head of the arrow.\n\t * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow.\n\t */\n\tsetLength( length, headLength = length * 0.2, headWidth = headLength * 0.2 ) {\n\n\t\tthis.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458\n\t\tthis.line.updateMatrix();\n\n\t\tthis.cone.scale.set( headWidth, headLength, headWidth );\n\t\tthis.cone.position.y = length;\n\t\tthis.cone.updateMatrix();\n\n\t}\n\n\t/**\n\t * Sets the color of the helper.\n\t *\n\t * @param {number|Color|string} color - The color to set.\n\t */\n\tsetColor( color ) {\n\n\t\tthis.line.material.color.set( color );\n\t\tthis.cone.material.color.set( color );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source, false );\n\n\t\tthis.line.copy( source.line );\n\t\tthis.cone.copy( source.cone );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.line.geometry.dispose();\n\t\tthis.line.material.dispose();\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n}\n\n/**\n * An axis object to visualize the 3 axes in a simple way.\n * The X axis is red. The Y axis is green. The Z axis is blue.\n *\n * ```js\n * const axesHelper = new THREE.AxesHelper( 5 );\n * scene.add( axesHelper );\n * ```\n *\n * @augments LineSegments\n */\nclass AxesHelper extends LineSegments {\n\n\t/**\n\t * Constructs a new axes helper.\n\t *\n\t * @param {number} [size=1] - Size of the lines representing the axes.\n\t */\n\tconstructor( size = 1 ) {\n\n\t\tconst vertices = [\n\t\t\t0, 0, 0,\tsize, 0, 0,\n\t\t\t0, 0, 0,\t0, size, 0,\n\t\t\t0, 0, 0,\t0, 0, size\n\t\t];\n\n\t\tconst colors = [\n\t\t\t1, 0, 0,\t1, 0.6, 0,\n\t\t\t0, 1, 0,\t0.6, 1, 0,\n\t\t\t0, 0, 1,\t0, 0.6, 1\n\t\t];\n\n\t\tconst geometry = new BufferGeometry();\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tgeometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { vertexColors: true, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\tthis.type = 'AxesHelper';\n\n\t}\n\n\t/**\n\t * Defines the colors of the axes helper.\n\t *\n\t * @param {number|Color|string} xAxisColor - The color for the x axis.\n\t * @param {number|Color|string} yAxisColor - The color for the y axis.\n\t * @param {number|Color|string} zAxisColor - The color for the z axis.\n\t * @return {AxesHelper} A reference to this axes helper.\n\t */\n\tsetColors( xAxisColor, yAxisColor, zAxisColor ) {\n\n\t\tconst color = new Color();\n\t\tconst array = this.geometry.attributes.color.array;\n\n\t\tcolor.set( xAxisColor );\n\t\tcolor.toArray( array, 0 );\n\t\tcolor.toArray( array, 3 );\n\n\t\tcolor.set( yAxisColor );\n\t\tcolor.toArray( array, 6 );\n\t\tcolor.toArray( array, 9 );\n\n\t\tcolor.set( zAxisColor );\n\t\tcolor.toArray( array, 12 );\n\t\tcolor.toArray( array, 15 );\n\n\t\tthis.geometry.attributes.color.needsUpdate = true;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n}\n\n/**\n * This class is used to convert a series of paths to an array of\n * shapes. It is specifically used in context of fonts and SVG.\n */\nclass ShapePath {\n\n\t/**\n\t * Constructs a new shape path.\n\t */\n\tconstructor() {\n\n\t\tthis.type = 'ShapePath';\n\n\t\t/**\n\t\t * The color of the shape.\n\t\t *\n\t\t * @type {Color}\n\t\t */\n\t\tthis.color = new Color();\n\n\t\t/**\n\t\t * The paths that have been generated for this shape.\n\t\t *\n\t\t * @type {Array<Path>}\n\t\t * @default null\n\t\t */\n\t\tthis.subPaths = [];\n\n\t\t/**\n\t\t * The current path that is being generated.\n\t\t *\n\t\t * @type {?Path}\n\t\t * @default null\n\t\t */\n\t\tthis.currentPath = null;\n\n\t}\n\n\t/**\n\t * Creates a new path and moves it current point to the given one.\n\t *\n\t * @param {number} x - The x coordinate.\n\t * @param {number} y - The y coordinate.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tmoveTo( x, y ) {\n\n\t\tthis.currentPath = new Path();\n\t\tthis.subPaths.push( this.currentPath );\n\t\tthis.currentPath.moveTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link LineCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} x - The x coordinate of the end point.\n\t * @param {number} y - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tlineTo( x, y ) {\n\n\t\tthis.currentPath.lineTo( x, y );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link QuadraticBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCPx - The x coordinate of the control point.\n\t * @param {number} aCPy - The y coordinate of the control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tquadraticCurveTo( aCPx, aCPy, aX, aY ) {\n\n\t\tthis.currentPath.quadraticCurveTo( aCPx, aCPy, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link CubicBezierCurve} to the path by connecting\n\t * the current point with the given one.\n\t *\n\t * @param {number} aCP1x - The x coordinate of the first control point.\n\t * @param {number} aCP1y - The y coordinate of the first control point.\n\t * @param {number} aCP2x - The x coordinate of the second control point.\n\t * @param {number} aCP2y - The y coordinate of the second control point.\n\t * @param {number} aX - The x coordinate of the end point.\n\t * @param {number} aY - The y coordinate of the end point.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tbezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY ) {\n\n\t\tthis.currentPath.bezierCurveTo( aCP1x, aCP1y, aCP2x, aCP2y, aX, aY );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds an instance of {@link SplineCurve} to the path by connecting\n\t * the current point with the given list of points.\n\t *\n\t * @param {Array<Vector2>} pts - An array of points in 2D space.\n\t * @return {ShapePath} A reference to this shape path.\n\t */\n\tsplineThru( pts ) {\n\n\t\tthis.currentPath.splineThru( pts );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Converts the paths into an array of shapes.\n\t *\n\t * @param {boolean} isCCW - By default solid shapes are  defined clockwise (CW) and holes are defined counterclockwise (CCW).\n\t * If this flag is set to `true`, then those are flipped.\n\t * @return {Array<Shape>} An array of shapes.\n\t */\n\ttoShapes( isCCW ) {\n\n\t\tfunction toShapesNoHoles( inSubpaths ) {\n\n\t\t\tconst shapes = [];\n\n\t\t\tfor ( let i = 0, l = inSubpaths.length; i < l; i ++ ) {\n\n\t\t\t\tconst tmpPath = inSubpaths[ i ];\n\n\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\n\t\t\t\tshapes.push( tmpShape );\n\n\t\t\t}\n\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tfunction isPointInsidePolygon( inPt, inPolygon ) {\n\n\t\t\tconst polyLen = inPolygon.length;\n\n\t\t\t// inPt on polygon contour => immediate success    or\n\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t//  with the horizontal line through inPt, left of inPt\n\t\t\t//  not counting lowerY endpoints of edges and whole edges on that line\n\t\t\tlet inside = false;\n\t\t\tfor ( let p = polyLen - 1, q = 0; q < polyLen; p = q ++ ) {\n\n\t\t\t\tlet edgeLowPt = inPolygon[ p ];\n\t\t\t\tlet edgeHighPt = inPolygon[ q ];\n\n\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\tif ( Math.abs( edgeDy ) > Number.EPSILON ) {\n\n\t\t\t\t\t// not parallel\n\t\t\t\t\tif ( edgeDy < 0 ) {\n\n\t\t\t\t\t\tedgeLowPt = inPolygon[ q ]; edgeDx = - edgeDx;\n\t\t\t\t\t\tedgeHighPt = inPolygon[ p ]; edgeDy = - edgeDy;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( inPt.y < edgeLowPt.y ) || ( inPt.y > edgeHighPt.y ) ) \t\tcontinue;\n\n\t\t\t\t\tif ( inPt.y === edgeLowPt.y ) {\n\n\t\t\t\t\t\tif ( inPt.x === edgeLowPt.x )\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst perpEdge = edgeDy * ( inPt.x - edgeLowPt.x ) - edgeDx * ( inPt.y - edgeLowPt.y );\n\t\t\t\t\t\tif ( perpEdge === 0 )\t\t\t\treturn\ttrue;\t\t// inPt is on contour ?\n\t\t\t\t\t\tif ( perpEdge < 0 ) \t\t\t\tcontinue;\n\t\t\t\t\t\tinside = ! inside;\t\t// true intersection left of inPt\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// parallel or collinear\n\t\t\t\t\tif ( inPt.y !== edgeLowPt.y ) \t\tcontinue;\t\t\t// parallel\n\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\t\t\t\t\tif ( ( ( edgeHighPt.x <= inPt.x ) && ( inPt.x <= edgeLowPt.x ) ) ||\n\t\t\t\t\t\t ( ( edgeLowPt.x <= inPt.x ) && ( inPt.x <= edgeHighPt.x ) ) )\t\treturn\ttrue;\t// inPt: Point on contour !\n\t\t\t\t\t// continue;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn\tinside;\n\n\t\t}\n\n\t\tconst isClockWise = ShapeUtils.isClockWise;\n\n\t\tconst subPaths = this.subPaths;\n\t\tif ( subPaths.length === 0 ) return [];\n\n\t\tlet solid, tmpPath, tmpShape;\n\t\tconst shapes = [];\n\n\t\tif ( subPaths.length === 1 ) {\n\n\t\t\ttmpPath = subPaths[ 0 ];\n\t\t\ttmpShape = new Shape();\n\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\tshapes.push( tmpShape );\n\t\t\treturn shapes;\n\n\t\t}\n\n\t\tlet holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );\n\t\tholesFirst = isCCW ? ! holesFirst : holesFirst;\n\n\t\t// console.log(\"Holes first\", holesFirst);\n\n\t\tconst betterShapeHoles = [];\n\t\tconst newShapes = [];\n\t\tlet newShapeHoles = [];\n\t\tlet mainIdx = 0;\n\t\tlet tmpPoints;\n\n\t\tnewShapes[ mainIdx ] = undefined;\n\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\tfor ( let i = 0, l = subPaths.length; i < l; i ++ ) {\n\n\t\t\ttmpPath = subPaths[ i ];\n\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\tsolid = isClockWise( tmpPoints );\n\t\t\tsolid = isCCW ? ! solid : solid;\n\n\t\t\tif ( solid ) {\n\n\t\t\t\tif ( ( ! holesFirst ) && ( newShapes[ mainIdx ] ) )\tmainIdx ++;\n\n\t\t\t\tnewShapes[ mainIdx ] = { s: new Shape(), p: tmpPoints };\n\t\t\t\tnewShapes[ mainIdx ].s.curves = tmpPath.curves;\n\n\t\t\t\tif ( holesFirst )\tmainIdx ++;\n\t\t\t\tnewShapeHoles[ mainIdx ] = [];\n\n\t\t\t\t//console.log('cw', i);\n\n\t\t\t} else {\n\n\t\t\t\tnewShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );\n\n\t\t\t\t//console.log('ccw', i);\n\n\t\t\t}\n\n\t\t}\n\n\t\t// only Holes? -> probably all Shapes with wrong orientation\n\t\tif ( ! newShapes[ 0 ] )\treturn\ttoShapesNoHoles( subPaths );\n\n\n\t\tif ( newShapes.length > 1 ) {\n\n\t\t\tlet ambiguous = false;\n\t\t\tlet toChange = 0;\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tbetterShapeHoles[ sIdx ] = [];\n\n\t\t\t}\n\n\t\t\tfor ( let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx ++ ) {\n\n\t\t\t\tconst sho = newShapeHoles[ sIdx ];\n\n\t\t\t\tfor ( let hIdx = 0; hIdx < sho.length; hIdx ++ ) {\n\n\t\t\t\t\tconst ho = sho[ hIdx ];\n\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\tfor ( let s2Idx = 0; s2Idx < newShapes.length; s2Idx ++ ) {\n\n\t\t\t\t\t\tif ( isPointInsidePolygon( ho.p, newShapes[ s2Idx ].p ) ) {\n\n\t\t\t\t\t\t\tif ( sIdx !== s2Idx )\ttoChange ++;\n\n\t\t\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\tbetterShapeHoles[ s2Idx ].push( ho );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tambiguous = true;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hole_unassigned ) {\n\n\t\t\t\t\t\tbetterShapeHoles[ sIdx ].push( ho );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( toChange > 0 && ambiguous === false ) {\n\n\t\t\t\tnewShapeHoles = betterShapeHoles;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet tmpHoles;\n\n\t\tfor ( let i = 0, il = newShapes.length; i < il; i ++ ) {\n\n\t\t\ttmpShape = newShapes[ i ].s;\n\t\t\tshapes.push( tmpShape );\n\t\t\ttmpHoles = newShapeHoles[ i ];\n\n\t\t\tfor ( let j = 0, jl = tmpHoles.length; j < jl; j ++ ) {\n\n\t\t\t\ttmpShape.holes.push( tmpHoles[ j ].h );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//console.log(\"shape\", shapes);\n\n\t\treturn shapes;\n\n\t}\n\n}\n\n/**\n * Abstract base class for controls.\n *\n * @abstract\n * @augments EventDispatcher\n */\nclass Controls extends EventDispatcher {\n\n\t/**\n\t * Constructs a new controls instance.\n\t *\n\t * @param {Object3D} object - The object that is managed by the controls.\n\t * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.\n\t */\n\tconstructor( object, domElement = null ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The object that is managed by the controls.\n\t\t *\n\t\t * @type {Object3D}\n\t\t */\n\t\tthis.object = object;\n\n\t\t/**\n\t\t * The HTML element used for event listeners.\n\t\t *\n\t\t * @type {?HTMLDOMElement}\n\t\t * @default null\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Whether the controls responds to user input or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.enabled = true;\n\n\t\t/**\n\t\t * The internal state of the controls.\n\t\t *\n\t\t * @type {number}\n\t\t * @default -1\n\t\t */\n\t\tthis.state = -1;\n\n\t\t/**\n\t\t * This object defines the keyboard input of the controls.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.keys = {};\n\n\t\t/**\n\t\t * This object defines what type of actions are assigned to the available mouse buttons.\n\t\t * It depends on the control implementation what kind of mouse buttons and actions are supported.\n\t\t *\n\t\t * @type {{LEFT: ?number, MIDDLE: ?number, RIGHT: ?number}}\n\t\t */\n\t\tthis.mouseButtons = { LEFT: null, MIDDLE: null, RIGHT: null };\n\n\t\t/**\n\t\t * This object defines what type of actions are assigned to what kind of touch interaction.\n\t\t * It depends on the control implementation what kind of touch interaction and actions are supported.\n\t\t *\n\t\t * @type {{ONE: ?number, TWO: ?number}}\n\t\t */\n\t\tthis.touches = { ONE: null, TWO: null };\n\n\t}\n\n\t/**\n\t * Connects the controls to the DOM. This method has so called \"side effects\" since\n\t * it adds the module's event listeners to the DOM.\n\t *\n\t * @param {HTMLDOMElement} element - The DOM element to connect to.\n\t */\n\tconnect( element ) {\n\n\t\tif ( element === undefined ) {\n\n\t\t\tconsole.warn( 'THREE.Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( this.domElement !== null ) this.disconnect();\n\n\t\tthis.domElement = element;\n\n\t}\n\n\t/**\n\t * Disconnects the controls from the DOM.\n\t */\n\tdisconnect() {}\n\n\t/**\n\t * Call this method if you no longer want use to the controls. It frees all internal\n\t * resources and removes all event listeners.\n\t */\n\tdispose() {}\n\n\t/**\n\t * Controls should implement this method if they have to update their internal state\n\t * per simulation step.\n\t *\n\t * @param {number} [delta] - The time delta in seconds.\n\t */\n\tupdate( /* delta */ ) {}\n\n}\n\n/**\n * Scales the texture as large as possible within its surface without cropping\n * or stretching the texture. The method preserves the original aspect ratio of\n * the texture. Akin to CSS `object-fit: contain`\n *\n * @param {Texture} texture - The texture.\n * @param {number} aspect - The texture's aspect ratio.\n * @return {Texture} The updated texture.\n */\nfunction contain( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect > aspect ) {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t} else {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t}\n\n\treturn texture;\n\n}\n\n/**\n * Scales the texture to the smallest possible size to fill the surface, leaving\n * no empty space. The method preserves the original aspect ratio of the texture.\n * Akin to CSS `object-fit: cover`.\n *\n * @param {Texture} texture - The texture.\n * @param {number} aspect - The texture's aspect ratio.\n * @return {Texture} The updated texture.\n */\nfunction cover( texture, aspect ) {\n\n\tconst imageAspect = ( texture.image && texture.image.width ) ? texture.image.width / texture.image.height : 1;\n\n\tif ( imageAspect > aspect ) {\n\n\t\ttexture.repeat.x = aspect / imageAspect;\n\t\ttexture.repeat.y = 1;\n\n\t\ttexture.offset.x = ( 1 - texture.repeat.x ) / 2;\n\t\ttexture.offset.y = 0;\n\n\t} else {\n\n\t\ttexture.repeat.x = 1;\n\t\ttexture.repeat.y = imageAspect / aspect;\n\n\t\ttexture.offset.x = 0;\n\t\ttexture.offset.y = ( 1 - texture.repeat.y ) / 2;\n\n\t}\n\n\treturn texture;\n\n}\n\n/**\n * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.\n *\n * @param {Texture} texture - The texture.\n * @return {Texture} The updated texture.\n */\nfunction fill( texture ) {\n\n\ttexture.repeat.x = 1;\n\ttexture.repeat.y = 1;\n\n\ttexture.offset.x = 0;\n\ttexture.offset.y = 0;\n\n\treturn texture;\n\n}\n\n/**\n * Determines how many bytes must be used to represent the texture.\n *\n * @param {number} width - The width of the texture.\n * @param {number} height - The height of the texture.\n * @param {number} format - The texture's format.\n * @param {number} type - The texture's type.\n * @return {number} The byte length.\n */\nfunction getByteLength( width, height, format, type ) {\n\n\tconst typeByteLength = getTextureTypeByteLength( type );\n\n\tswitch ( format ) {\n\n\t\t// https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml\n\t\tcase AlphaFormat:\n\t\t\treturn width * height;\n\t\tcase RedFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RedIntegerFormat:\n\t\t\treturn ( ( width * height ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGIntegerFormat:\n\t\t\treturn ( ( width * height * 2 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBFormat:\n\t\t\treturn ( ( width * height * 3 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\t\tcase RGBAIntegerFormat:\n\t\t\treturn ( ( width * height * 4 ) / typeByteLength.components ) * typeByteLength.byteLength;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/\n\t\tcase RGB_S3TC_DXT1_Format:\n\t\tcase RGBA_S3TC_DXT1_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_S3TC_DXT3_Format:\n\t\tcase RGBA_S3TC_DXT5_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_pvrtc/\n\t\tcase RGB_PVRTC_2BPPV1_Format:\n\t\tcase RGBA_PVRTC_2BPPV1_Format:\n\t\t\treturn ( Math.max( width, 16 ) * Math.max( height, 8 ) ) / 4;\n\t\tcase RGB_PVRTC_4BPPV1_Format:\n\t\tcase RGBA_PVRTC_4BPPV1_Format:\n\t\t\treturn ( Math.max( width, 8 ) * Math.max( height, 8 ) ) / 2;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_etc/\n\t\tcase RGB_ETC1_Format:\n\t\tcase RGB_ETC2_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 8;\n\t\tcase RGBA_ETC2_EAC_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/\n\t\tcase RGBA_ASTC_4x4_Format:\n\t\t\treturn Math.floor( ( width + 3 ) / 4 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x4_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 3 ) / 4 ) * 16;\n\t\tcase RGBA_ASTC_5x5_Format:\n\t\t\treturn Math.floor( ( width + 4 ) / 5 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x5_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_6x6_Format:\n\t\t\treturn Math.floor( ( width + 5 ) / 6 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x5_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_8x6_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_8x8_Format:\n\t\t\treturn Math.floor( ( width + 7 ) / 8 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x5_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 4 ) / 5 ) * 16;\n\t\tcase RGBA_ASTC_10x6_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 5 ) / 6 ) * 16;\n\t\tcase RGBA_ASTC_10x8_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 7 ) / 8 ) * 16;\n\t\tcase RGBA_ASTC_10x10_Format:\n\t\t\treturn Math.floor( ( width + 9 ) / 10 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x10_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 9 ) / 10 ) * 16;\n\t\tcase RGBA_ASTC_12x12_Format:\n\t\t\treturn Math.floor( ( width + 11 ) / 12 ) * Math.floor( ( height + 11 ) / 12 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_bptc/\n\t\tcase RGBA_BPTC_Format:\n\t\tcase RGB_BPTC_SIGNED_Format:\n\t\tcase RGB_BPTC_UNSIGNED_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t\t// https://registry.khronos.org/webgl/extensions/EXT_texture_compression_rgtc/\n\t\tcase RED_RGTC1_Format:\n\t\tcase SIGNED_RED_RGTC1_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 8;\n\t\tcase RED_GREEN_RGTC2_Format:\n\t\tcase SIGNED_RED_GREEN_RGTC2_Format:\n\t\t\treturn Math.ceil( width / 4 ) * Math.ceil( height / 4 ) * 16;\n\n\t}\n\n\tthrow new Error(\n\t\t`Unable to determine texture byte length for ${format} format.`,\n\t);\n\n}\n\nfunction getTextureTypeByteLength( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase UnsignedByteType:\n\t\tcase ByteType:\n\t\t\treturn { byteLength: 1, components: 1 };\n\t\tcase UnsignedShortType:\n\t\tcase ShortType:\n\t\tcase HalfFloatType:\n\t\t\treturn { byteLength: 2, components: 1 };\n\t\tcase UnsignedShort4444Type:\n\t\tcase UnsignedShort5551Type:\n\t\t\treturn { byteLength: 2, components: 4 };\n\t\tcase UnsignedIntType:\n\t\tcase IntType:\n\t\tcase FloatType:\n\t\t\treturn { byteLength: 4, components: 1 };\n\t\tcase UnsignedInt5999Type:\n\t\t\treturn { byteLength: 4, components: 3 };\n\n\t}\n\n\tthrow new Error( `Unknown texture type ${type}.` );\n\n}\n\n/**\n * A class containing utility functions for textures.\n *\n * @hideconstructor\n */\nclass TextureUtils {\n\n\t/**\n\t * Scales the texture as large as possible within its surface without cropping\n\t * or stretching the texture. The method preserves the original aspect ratio of\n\t * the texture. Akin to CSS `object-fit: contain`\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @param {number} aspect - The texture's aspect ratio.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic contain( texture, aspect ) {\n\n\t\treturn contain( texture, aspect );\n\n\t}\n\n\t/**\n\t * Scales the texture to the smallest possible size to fill the surface, leaving\n\t * no empty space. The method preserves the original aspect ratio of the texture.\n\t * Akin to CSS `object-fit: cover`.\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @param {number} aspect - The texture's aspect ratio.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic cover( texture, aspect ) {\n\n\t\treturn cover( texture, aspect );\n\n\t}\n\n\t/**\n\t * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.\n\t *\n\t * @param {Texture} texture - The texture.\n\t * @return {Texture} The updated texture.\n\t */\n\tstatic fill( texture ) {\n\n\t\treturn fill( texture );\n\n\t}\n\n\t/**\n\t * Determines how many bytes must be used to represent the texture.\n\t *\n\t * @param {number} width - The width of the texture.\n\t * @param {number} height - The height of the texture.\n\t * @param {number} format - The texture's format.\n\t * @param {number} type - The texture's type.\n\t * @return {number} The byte length.\n\t */\n\tstatic getByteLength( width, height, format, type ) {\n\n\t\treturn getByteLength( width, height, format, type );\n\n\t}\n\n}\n\nif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {\n\t\trevision: REVISION,\n\t} } ) );\n\n}\n\nif ( typeof window !== 'undefined' ) {\n\n\tif ( window.__THREE__ ) {\n\n\t\tconsole.warn( 'WARNING: Multiple instances of Three.js being imported.' );\n\n\t} else {\n\n\t\twindow.__THREE__ = REVISION;\n\n\t}\n\n}\n\nexport { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, arrayNeedsUint32, cloneUniforms, createCanvasElement, createElementNS, getByteLength, getUnlitUniformColorSpace, mergeUniforms, probeAsync, warnOnce };\n","/**\n * @license\n * Copyright 2010-2025 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\nimport { Matrix3, Vector2, Color, mergeUniforms, Vector3, CubeUVReflectionMapping, Mesh, BoxGeometry, ShaderMaterial, BackSide, cloneUniforms, Euler, Matrix4, ColorManagement, SRGBTransfer, PlaneGeometry, FrontSide, getUnlitUniformColorSpace, IntType, HalfFloatType, UnsignedByteType, FloatType, RGBAFormat, Plane, EquirectangularReflectionMapping, EquirectangularRefractionMapping, WebGLCubeRenderTarget, CubeReflectionMapping, CubeRefractionMapping, OrthographicCamera, PerspectiveCamera, NoToneMapping, MeshBasicMaterial, NoBlending, WebGLRenderTarget, BufferGeometry, BufferAttribute, LinearSRGBColorSpace, LinearFilter, warnOnce, Uint32BufferAttribute, Uint16BufferAttribute, arrayNeedsUint32, Vector4, DataArrayTexture, CubeTexture, Data3DTexture, LessEqualCompare, DepthTexture, Texture, GLSL3, PCFShadowMap, PCFSoftShadowMap, VSMShadowMap, CustomToneMapping, NeutralToneMapping, AgXToneMapping, ACESFilmicToneMapping, CineonToneMapping, ReinhardToneMapping, LinearToneMapping, LinearTransfer, AddOperation, MixOperation, MultiplyOperation, UniformsUtils, DoubleSide, NormalBlending, TangentSpaceNormalMap, ObjectSpaceNormalMap, Layers, Frustum, MeshDepthMaterial, RGBADepthPacking, MeshDistanceMaterial, NearestFilter, LessEqualDepth, ReverseSubtractEquation, SubtractEquation, AddEquation, OneMinusConstantAlphaFactor, ConstantAlphaFactor, OneMinusConstantColorFactor, ConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, DstAlphaFactor, DstColorFactor, SrcAlphaSaturateFactor, SrcAlphaFactor, SrcColorFactor, OneFactor, ZeroFactor, NotEqualDepth, GreaterDepth, GreaterEqualDepth, EqualDepth, LessDepth, AlwaysDepth, NeverDepth, CullFaceNone, CullFaceBack, CullFaceFront, CustomBlending, MultiplyBlending, SubtractiveBlending, AdditiveBlending, MinEquation, MaxEquation, MirroredRepeatWrapping, ClampToEdgeWrapping, RepeatWrapping, LinearMipmapLinearFilter, LinearMipmapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NotEqualCompare, GreaterCompare, GreaterEqualCompare, EqualCompare, LessCompare, AlwaysCompare, NeverCompare, NoColorSpace, DepthStencilFormat, getByteLength, DepthFormat, UnsignedIntType, UnsignedInt248Type, UnsignedShortType, createElementNS, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedInt5999Type, ByteType, ShortType, AlphaFormat, RGBFormat, RedFormat, RedIntegerFormat, RGFormat, RGIntegerFormat, RGBAIntegerFormat, RGB_S3TC_DXT1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_PVRTC_4BPPV1_Format, RGB_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_PVRTC_2BPPV1_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGBA_ETC2_EAC_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_BPTC_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RED_RGTC1_Format, SIGNED_RED_RGTC1_Format, RED_GREEN_RGTC2_Format, SIGNED_RED_GREEN_RGTC2_Format, EventDispatcher, ArrayCamera, WebXRController, RAD2DEG, createCanvasElement, SRGBColorSpace, REVISION, WebGLCoordinateSystem, probeAsync } from './three.core.js';\nexport { AdditiveAnimationBlendMode, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxHelper, BufferGeometryLoader, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CircleGeometry, Clock, ColorKeyframeTrack, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, Controls, CubeCamera, CubeTextureLoader, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceFrontBack, Curve, CurvePath, CylinderGeometry, Cylindrical, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualStencilFunc, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Fog, FogExp2, FramebufferTexture, FrustumArray, GLBufferAttribute, GLSL1, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialLoader, MathUtils, Matrix2, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NeverStencilFunc, NormalAnimationBlendMode, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, OctahedronGeometry, Path, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RGBDepthPacking, RGBIntegerFormat, RGDepthPacking, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RenderTarget, RenderTarget3D, ReplaceStencilOp, RingGeometry, Scene, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, TOUCH, TetrahedronGeometry, TextureLoader, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, ZeroStencilOp } from './three.core.js';\n\nfunction WebGLAnimation() {\n\n\tlet context = null;\n\tlet isAnimating = false;\n\tlet animationLoop = null;\n\tlet requestId = null;\n\n\tfunction onAnimationFrame( time, frame ) {\n\n\t\tanimationLoop( time, frame );\n\n\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t}\n\n\treturn {\n\n\t\tstart: function () {\n\n\t\t\tif ( isAnimating === true ) return;\n\t\t\tif ( animationLoop === null ) return;\n\n\t\t\trequestId = context.requestAnimationFrame( onAnimationFrame );\n\n\t\t\tisAnimating = true;\n\n\t\t},\n\n\t\tstop: function () {\n\n\t\t\tcontext.cancelAnimationFrame( requestId );\n\n\t\t\tisAnimating = false;\n\n\t\t},\n\n\t\tsetAnimationLoop: function ( callback ) {\n\n\t\t\tanimationLoop = callback;\n\n\t\t},\n\n\t\tsetContext: function ( value ) {\n\n\t\t\tcontext = value;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLAttributes( gl ) {\n\n\tconst buffers = new WeakMap();\n\n\tfunction createBuffer( attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst usage = attribute.usage;\n\t\tconst size = array.byteLength;\n\n\t\tconst buffer = gl.createBuffer();\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\t\tgl.bufferData( bufferType, array, usage );\n\n\t\tattribute.onUploadCallback();\n\n\t\tlet type;\n\n\t\tif ( array instanceof Float32Array ) {\n\n\t\t\ttype = gl.FLOAT;\n\n\t\t} else if ( typeof Float16Array !== 'undefined' && array instanceof Float16Array ) {\n\n\t\t\ttype = gl.HALF_FLOAT;\n\n\t\t} else if ( array instanceof Uint16Array ) {\n\n\t\t\tif ( attribute.isFloat16BufferAttribute ) {\n\n\t\t\t\ttype = gl.HALF_FLOAT;\n\n\t\t\t} else {\n\n\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\n\t\t\t}\n\n\t\t} else if ( array instanceof Int16Array ) {\n\n\t\t\ttype = gl.SHORT;\n\n\t\t} else if ( array instanceof Uint32Array ) {\n\n\t\t\ttype = gl.UNSIGNED_INT;\n\n\t\t} else if ( array instanceof Int32Array ) {\n\n\t\t\ttype = gl.INT;\n\n\t\t} else if ( array instanceof Int8Array ) {\n\n\t\t\ttype = gl.BYTE;\n\n\t\t} else if ( array instanceof Uint8Array ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else if ( array instanceof Uint8ClampedArray ) {\n\n\t\t\ttype = gl.UNSIGNED_BYTE;\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.WebGLAttributes: Unsupported buffer data format: ' + array );\n\n\t\t}\n\n\t\treturn {\n\t\t\tbuffer: buffer,\n\t\t\ttype: type,\n\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\tversion: attribute.version,\n\t\t\tsize: size\n\t\t};\n\n\t}\n\n\tfunction updateBuffer( buffer, attribute, bufferType ) {\n\n\t\tconst array = attribute.array;\n\t\tconst updateRanges = attribute.updateRanges;\n\n\t\tgl.bindBuffer( bufferType, buffer );\n\n\t\tif ( updateRanges.length === 0 ) {\n\n\t\t\t// Not using update ranges\n\t\t\tgl.bufferSubData( bufferType, 0, array );\n\n\t\t} else {\n\n\t\t\t// Before applying update ranges, we merge any adjacent / overlapping\n\t\t\t// ranges to reduce load on `gl.bufferSubData`. Empirically, this has led\n\t\t\t// to performance improvements for applications which make heavy use of\n\t\t\t// update ranges. Likely due to GPU command overhead.\n\t\t\t//\n\t\t\t// Note that to reduce garbage collection between frames, we merge the\n\t\t\t// update ranges in-place. This is safe because this method will clear the\n\t\t\t// update ranges once updated.\n\n\t\t\tupdateRanges.sort( ( a, b ) => a.start - b.start );\n\n\t\t\t// To merge the update ranges in-place, we work from left to right in the\n\t\t\t// existing updateRanges array, merging ranges. This may result in a final\n\t\t\t// array which is smaller than the original. This index tracks the last\n\t\t\t// index representing a merged range, any data after this index can be\n\t\t\t// trimmed once the merge algorithm is completed.\n\t\t\tlet mergeIndex = 0;\n\n\t\t\tfor ( let i = 1; i < updateRanges.length; i ++ ) {\n\n\t\t\t\tconst previousRange = updateRanges[ mergeIndex ];\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\t// We add one here to merge adjacent ranges. This is safe because ranges\n\t\t\t\t// operate over positive integers.\n\t\t\t\tif ( range.start <= previousRange.start + previousRange.count + 1 ) {\n\n\t\t\t\t\tpreviousRange.count = Math.max(\n\t\t\t\t\t\tpreviousRange.count,\n\t\t\t\t\t\trange.start + range.count - previousRange.start\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t++ mergeIndex;\n\t\t\t\t\tupdateRanges[ mergeIndex ] = range;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Trim the array to only contain the merged ranges.\n\t\t\tupdateRanges.length = mergeIndex + 1;\n\n\t\t\tfor ( let i = 0, l = updateRanges.length; i < l; i ++ ) {\n\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\tgl.bufferSubData( bufferType, range.start * array.BYTES_PER_ELEMENT,\n\t\t\t\t\tarray, range.start, range.count );\n\n\t\t\t}\n\n\t\t\tattribute.clearUpdateRanges();\n\n\t\t}\n\n\t\tattribute.onUploadCallback();\n\n\t}\n\n\t//\n\n\tfunction get( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\treturn buffers.get( attribute );\n\n\t}\n\n\tfunction remove( attribute ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data ) {\n\n\t\t\tgl.deleteBuffer( data.buffer );\n\n\t\t\tbuffers.delete( attribute );\n\n\t\t}\n\n\t}\n\n\tfunction update( attribute, bufferType ) {\n\n\t\tif ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;\n\n\t\tif ( attribute.isGLBufferAttribute ) {\n\n\t\t\tconst cached = buffers.get( attribute );\n\n\t\t\tif ( ! cached || cached.version < attribute.version ) {\n\n\t\t\t\tbuffers.set( attribute, {\n\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\tversion: attribute.version\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst data = buffers.get( attribute );\n\n\t\tif ( data === undefined ) {\n\n\t\t\tbuffers.set( attribute, createBuffer( attribute, bufferType ) );\n\n\t\t} else if ( data.version < attribute.version ) {\n\n\t\t\tif ( data.size !== attribute.array.byteLength ) {\n\n\t\t\t\tthrow 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.' );\n\n\t\t\t}\n\n\t\t\tupdateBuffer( data.buffer, attribute, bufferType );\n\n\t\t\tdata.version = attribute.version;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update\n\n\t};\n\n}\n\nvar alphahash_fragment = \"#ifdef USE_ALPHAHASH\\n\\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\\n#endif\";\n\nvar 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\";\n\nvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\\n#endif\";\n\nvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\nvar 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\";\n\nvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\nvar 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\";\n\nvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\nvar 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\";\n\nvar batching_vertex = \"#ifdef USE_BATCHING\\n\\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\\n#endif\";\n\nvar begin_vertex = \"vec3 transformed = vec3( position );\\n#ifdef USE_ALPHAHASH\\n\\tvPosition = vec3( position );\\n#endif\";\n\nvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\nvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\nvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\nvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\nvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\nvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\\n#endif\";\n\nvar 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\";\n\nvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\nvar colorspace_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\nvar 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}\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\nvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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}\";\n\nvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\nvar lights_lambert_fragment = \"LambertMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularStrength = specularStrength;\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\nvar 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\";\n\nvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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}\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\nvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\nvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\tvFragDepth = 1.0 + gl_Position.w;\\n\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n#endif\";\n\nvar 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\";\n\nvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\nvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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;\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = nonPerturbedNormal;\\n#endif\";\n\nvar 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\";\n\nvar 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\";\n\nvar iridescence_pars_fragment = \"#ifdef USE_IRIDESCENCEMAP\\n\\tuniform sampler2D iridescenceMap;\\n#endif\\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\\n\\tuniform sampler2D iridescenceThicknessMap;\\n#endif\";\n\nvar 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 );\";\n\nvar 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}\";\n\nvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\nvar 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;\";\n\nvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\nvar 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\";\n\nvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\nvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\nvar 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\\tfloat depth = unpackRGBAToDepth( texture2D( depths, uv ) );\\n\\t\\t#ifdef USE_REVERSEDEPTHBUF\\n\\t\\t\\treturn step( depth, compare );\\n\\t\\t#else\\n\\t\\t\\treturn step( compare, depth );\\n\\t\\t#endif\\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\\t#ifdef USE_REVERSEDEPTHBUF\\n\\t\\t\\tfloat hard_shadow = step( distribution.x, compare );\\n\\t\\t#else\\n\\t\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\t#endif\\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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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}\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\nvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\nvar 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; }\";\n\nvar 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\";\n\nvar 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\\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\\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#else\\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#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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nvar 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\";\n\nconst vertex$h = \"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}\";\n\nconst fragment$h = \"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}\";\n\nconst vertex$g = \"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}\";\n\nconst fragment$g = \"#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}\";\n\nconst vertex$f = \"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}\";\n\nconst fragment$f = \"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}\";\n\nconst vertex$e = \"#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}\";\n\nconst fragment$e = \"#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\\t#ifdef USE_REVERSEDEPTHBUF\\n\\t\\tfloat fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\\n\\t#else\\n\\t\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\\n\\t#endif\\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}\";\n\nconst vertex$d = \"#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}\";\n\nconst fragment$d = \"#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}\";\n\nconst vertex$c = \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\";\n\nconst fragment$c = \"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}\";\n\nconst vertex$b = \"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}\";\n\nconst fragment$b = \"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}\";\n\nconst vertex$a = \"#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}\";\n\nconst fragment$a = \"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}\";\n\nconst vertex$9 = \"#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}\";\n\nconst fragment$9 = \"#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}\";\n\nconst vertex$8 = \"#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}\";\n\nconst fragment$8 = \"#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}\";\n\nconst vertex$7 = \"#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}\";\n\nconst fragment$7 = \"#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}\";\n\nconst vertex$6 = \"#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}\";\n\nconst fragment$6 = \"#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}\";\n\nconst vertex$5 = \"#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}\";\n\nconst fragment$5 = \"#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}\";\n\nconst vertex$4 = \"#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}\";\n\nconst fragment$4 = \"#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}\";\n\nconst vertex$3 = \"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}\";\n\nconst fragment$3 = \"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}\";\n\nconst vertex$2 = \"#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}\";\n\nconst fragment$2 = \"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}\";\n\nconst vertex$1 = \"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}\";\n\nconst fragment$1 = \"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}\";\n\nconst ShaderChunk = {\n\talphahash_fragment: alphahash_fragment,\n\talphahash_pars_fragment: alphahash_pars_fragment,\n\talphamap_fragment: alphamap_fragment,\n\talphamap_pars_fragment: alphamap_pars_fragment,\n\talphatest_fragment: alphatest_fragment,\n\talphatest_pars_fragment: alphatest_pars_fragment,\n\taomap_fragment: aomap_fragment,\n\taomap_pars_fragment: aomap_pars_fragment,\n\tbatching_pars_vertex: batching_pars_vertex,\n\tbatching_vertex: batching_vertex,\n\tbegin_vertex: begin_vertex,\n\tbeginnormal_vertex: beginnormal_vertex,\n\tbsdfs: bsdfs,\n\tiridescence_fragment: iridescence_fragment,\n\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\tclipping_planes_fragment: clipping_planes_fragment,\n\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\tclipping_planes_vertex: clipping_planes_vertex,\n\tcolor_fragment: color_fragment,\n\tcolor_pars_fragment: color_pars_fragment,\n\tcolor_pars_vertex: color_pars_vertex,\n\tcolor_vertex: color_vertex,\n\tcommon: common,\n\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\tdefaultnormal_vertex: defaultnormal_vertex,\n\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\tdisplacementmap_vertex: displacementmap_vertex,\n\temissivemap_fragment: emissivemap_fragment,\n\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\tcolorspace_fragment: colorspace_fragment,\n\tcolorspace_pars_fragment: colorspace_pars_fragment,\n\tenvmap_fragment: envmap_fragment,\n\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\tenvmap_pars_fragment: envmap_pars_fragment,\n\tenvmap_pars_vertex: envmap_pars_vertex,\n\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\tenvmap_vertex: envmap_vertex,\n\tfog_vertex: fog_vertex,\n\tfog_pars_vertex: fog_pars_vertex,\n\tfog_fragment: fog_fragment,\n\tfog_pars_fragment: fog_pars_fragment,\n\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\tlightmap_pars_fragment: lightmap_pars_fragment,\n\tlights_lambert_fragment: lights_lambert_fragment,\n\tlights_lambert_pars_fragment: lights_lambert_pars_fragment,\n\tlights_pars_begin: lights_pars_begin,\n\tlights_toon_fragment: lights_toon_fragment,\n\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\tlights_phong_fragment: lights_phong_fragment,\n\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\tlights_physical_fragment: lights_physical_fragment,\n\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\tlights_fragment_begin: lights_fragment_begin,\n\tlights_fragment_maps: lights_fragment_maps,\n\tlights_fragment_end: lights_fragment_end,\n\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\tmap_fragment: map_fragment,\n\tmap_pars_fragment: map_pars_fragment,\n\tmap_particle_fragment: map_particle_fragment,\n\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\tmetalnessmap_fragment: metalnessmap_fragment,\n\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\tmorphinstance_vertex: morphinstance_vertex,\n\tmorphcolor_vertex: morphcolor_vertex,\n\tmorphnormal_vertex: morphnormal_vertex,\n\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\tmorphtarget_vertex: morphtarget_vertex,\n\tnormal_fragment_begin: normal_fragment_begin,\n\tnormal_fragment_maps: normal_fragment_maps,\n\tnormal_pars_fragment: normal_pars_fragment,\n\tnormal_pars_vertex: normal_pars_vertex,\n\tnormal_vertex: normal_vertex,\n\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\tiridescence_pars_fragment: iridescence_pars_fragment,\n\topaque_fragment: opaque_fragment,\n\tpacking: packing,\n\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\tproject_vertex: project_vertex,\n\tdithering_fragment: dithering_fragment,\n\tdithering_pars_fragment: dithering_pars_fragment,\n\troughnessmap_fragment: roughnessmap_fragment,\n\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\tshadowmap_vertex: shadowmap_vertex,\n\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\tskinbase_vertex: skinbase_vertex,\n\tskinning_pars_vertex: skinning_pars_vertex,\n\tskinning_vertex: skinning_vertex,\n\tskinnormal_vertex: skinnormal_vertex,\n\tspecularmap_fragment: specularmap_fragment,\n\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\ttonemapping_fragment: tonemapping_fragment,\n\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\ttransmission_fragment: transmission_fragment,\n\ttransmission_pars_fragment: transmission_pars_fragment,\n\tuv_pars_fragment: uv_pars_fragment,\n\tuv_pars_vertex: uv_pars_vertex,\n\tuv_vertex: uv_vertex,\n\tworldpos_vertex: worldpos_vertex,\n\n\tbackground_vert: vertex$h,\n\tbackground_frag: fragment$h,\n\tbackgroundCube_vert: vertex$g,\n\tbackgroundCube_frag: fragment$g,\n\tcube_vert: vertex$f,\n\tcube_frag: fragment$f,\n\tdepth_vert: vertex$e,\n\tdepth_frag: fragment$e,\n\tdistanceRGBA_vert: vertex$d,\n\tdistanceRGBA_frag: fragment$d,\n\tequirect_vert: vertex$c,\n\tequirect_frag: fragment$c,\n\tlinedashed_vert: vertex$b,\n\tlinedashed_frag: fragment$b,\n\tmeshbasic_vert: vertex$a,\n\tmeshbasic_frag: fragment$a,\n\tmeshlambert_vert: vertex$9,\n\tmeshlambert_frag: fragment$9,\n\tmeshmatcap_vert: vertex$8,\n\tmeshmatcap_frag: fragment$8,\n\tmeshnormal_vert: vertex$7,\n\tmeshnormal_frag: fragment$7,\n\tmeshphong_vert: vertex$6,\n\tmeshphong_frag: fragment$6,\n\tmeshphysical_vert: vertex$5,\n\tmeshphysical_frag: fragment$5,\n\tmeshtoon_vert: vertex$4,\n\tmeshtoon_frag: fragment$4,\n\tpoints_vert: vertex$3,\n\tpoints_frag: fragment$3,\n\tshadow_vert: vertex$2,\n\tshadow_frag: fragment$2,\n\tsprite_vert: vertex$1,\n\tsprite_frag: fragment$1\n};\n\n// Uniforms library for shared webgl shaders\nconst UniformsLib = {\n\n\tcommon: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\n\t\talphaTest: { value: 0 }\n\n\t},\n\n\tspecularmap: {\n\n\t\tspecularMap: { value: null },\n\t\tspecularMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tenvmap: {\n\n\t\tenvMap: { value: null },\n\t\tenvMapRotation: { value: /*@__PURE__*/ new Matrix3() },\n\t\tflipEnvMap: { value: -1 },\n\t\treflectivity: { value: 1.0 }, // basic, lambert, phong\n\t\tior: { value: 1.5 }, // physical\n\t\trefractionRatio: { value: 0.98 }, // basic, lambert, phong\n\n\t},\n\n\taomap: {\n\n\t\taoMap: { value: null },\n\t\taoMapIntensity: { value: 1 },\n\t\taoMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tlightmap: {\n\n\t\tlightMap: { value: null },\n\t\tlightMapIntensity: { value: 1 },\n\t\tlightMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tbumpmap: {\n\n\t\tbumpMap: { value: null },\n\t\tbumpMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tbumpScale: { value: 1 }\n\n\t},\n\n\tnormalmap: {\n\n\t\tnormalMap: { value: null },\n\t\tnormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tnormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }\n\n\t},\n\n\tdisplacementmap: {\n\n\t\tdisplacementMap: { value: null },\n\t\tdisplacementMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\tdisplacementScale: { value: 1 },\n\t\tdisplacementBias: { value: 0 }\n\n\t},\n\n\temissivemap: {\n\n\t\temissiveMap: { value: null },\n\t\temissiveMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tmetalnessmap: {\n\n\t\tmetalnessMap: { value: null },\n\t\tmetalnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\troughnessmap: {\n\n\t\troughnessMap: { value: null },\n\t\troughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tgradientmap: {\n\n\t\tgradientMap: { value: null }\n\n\t},\n\n\tfog: {\n\n\t\tfogDensity: { value: 0.00025 },\n\t\tfogNear: { value: 1 },\n\t\tfogFar: { value: 2000 },\n\t\tfogColor: { value: /*@__PURE__*/ new Color( 0xffffff ) }\n\n\t},\n\n\tlights: {\n\n\t\tambientLightColor: { value: [] },\n\n\t\tlightProbe: { value: [] },\n\n\t\tdirectionalLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tcolor: {}\n\t\t} },\n\n\t\tdirectionalLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tdirectionalShadowMap: { value: [] },\n\t\tdirectionalShadowMatrix: { value: [] },\n\n\t\tspotLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdirection: {},\n\t\t\tdistance: {},\n\t\t\tconeCos: {},\n\t\t\tpenumbraCos: {},\n\t\t\tdecay: {}\n\t\t} },\n\n\t\tspotLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {}\n\t\t} },\n\n\t\tspotLightMap: { value: [] },\n\t\tspotShadowMap: { value: [] },\n\t\tspotLightMatrix: { value: [] },\n\n\t\tpointLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\tdecay: {},\n\t\t\tdistance: {}\n\t\t} },\n\n\t\tpointLightShadows: { value: [], properties: {\n\t\t\tshadowIntensity: 1,\n\t\t\tshadowBias: {},\n\t\t\tshadowNormalBias: {},\n\t\t\tshadowRadius: {},\n\t\t\tshadowMapSize: {},\n\t\t\tshadowCameraNear: {},\n\t\t\tshadowCameraFar: {}\n\t\t} },\n\n\t\tpointShadowMap: { value: [] },\n\t\tpointShadowMatrix: { value: [] },\n\n\t\themisphereLights: { value: [], properties: {\n\t\t\tdirection: {},\n\t\t\tskyColor: {},\n\t\t\tgroundColor: {}\n\t\t} },\n\n\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\trectAreaLights: { value: [], properties: {\n\t\t\tcolor: {},\n\t\t\tposition: {},\n\t\t\twidth: {},\n\t\t\theight: {}\n\t\t} },\n\n\t\tltc_1: { value: null },\n\t\tltc_2: { value: null }\n\n\t},\n\n\tpoints: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tsize: { value: 1.0 },\n\t\tscale: { value: 1.0 },\n\t\tmap: { value: null },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 },\n\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() }\n\n\t},\n\n\tsprite: {\n\n\t\tdiffuse: { value: /*@__PURE__*/ new Color( 0xffffff ) },\n\t\topacity: { value: 1.0 },\n\t\tcenter: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },\n\t\trotation: { value: 0.0 },\n\t\tmap: { value: null },\n\t\tmapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaMap: { value: null },\n\t\talphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\talphaTest: { value: 0 }\n\n\t}\n\n};\n\nconst ShaderLib = {\n\n\tbasic: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\n\t},\n\n\tlambert: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\n\t},\n\n\tphong: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.specularmap,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\tspecular: { value: /*@__PURE__*/ new Color( 0x111111 ) },\n\t\t\t\tshininess: { value: 30 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\tfragmentShader: ShaderChunk.meshphong_frag\n\n\t},\n\n\tstandard: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.envmap,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.roughnessmap,\n\t\t\tUniformsLib.metalnessmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\t\troughness: { value: 1.0 },\n\t\t\t\tmetalness: { value: 0.0 },\n\t\t\t\tenvMapIntensity: { value: 1 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\n\t},\n\n\ttoon: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.aomap,\n\t\t\tUniformsLib.lightmap,\n\t\t\tUniformsLib.emissivemap,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.gradientmap,\n\t\t\tUniformsLib.fog,\n\t\t\tUniformsLib.lights,\n\t\t\t{\n\t\t\t\temissive: { value: /*@__PURE__*/ new Color( 0x000000 ) }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\n\t},\n\n\tmatcap: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tmatcap: { value: null }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\n\t},\n\n\tpoints: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.points,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.points_vert,\n\t\tfragmentShader: ShaderChunk.points_frag\n\n\t},\n\n\tdashed: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tscale: { value: 1 },\n\t\t\t\tdashSize: { value: 1 },\n\t\t\t\ttotalSize: { value: 2 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\tfragmentShader: ShaderChunk.linedashed_frag\n\n\t},\n\n\tdepth: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.depth_vert,\n\t\tfragmentShader: ShaderChunk.depth_frag\n\n\t},\n\n\tnormal: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.bumpmap,\n\t\t\tUniformsLib.normalmap,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\n\t},\n\n\tsprite: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.sprite,\n\t\t\tUniformsLib.fog\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\tfragmentShader: ShaderChunk.sprite_frag\n\n\t},\n\n\tbackground: {\n\n\t\tuniforms: {\n\t\t\tuvTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tt2D: { value: null },\n\t\t\tbackgroundIntensity: { value: 1 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.background_vert,\n\t\tfragmentShader: ShaderChunk.background_frag\n\n\t},\n\n\tbackgroundCube: {\n\n\t\tuniforms: {\n\t\t\tenvMap: { value: null },\n\t\t\tflipEnvMap: { value: -1 },\n\t\t\tbackgroundBlurriness: { value: 0 },\n\t\t\tbackgroundIntensity: { value: 1 },\n\t\t\tbackgroundRotation: { value: /*@__PURE__*/ new Matrix3() }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.backgroundCube_vert,\n\t\tfragmentShader: ShaderChunk.backgroundCube_frag\n\n\t},\n\n\tcube: {\n\n\t\tuniforms: {\n\t\t\ttCube: { value: null },\n\t\t\ttFlip: { value: -1 },\n\t\t\topacity: { value: 1.0 }\n\t\t},\n\n\t\tvertexShader: ShaderChunk.cube_vert,\n\t\tfragmentShader: ShaderChunk.cube_frag\n\n\t},\n\n\tequirect: {\n\n\t\tuniforms: {\n\t\t\ttEquirect: { value: null },\n\t\t},\n\n\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\tfragmentShader: ShaderChunk.equirect_frag\n\n\t},\n\n\tdistanceRGBA: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.common,\n\t\t\tUniformsLib.displacementmap,\n\t\t\t{\n\t\t\t\treferencePosition: { value: /*@__PURE__*/ new Vector3() },\n\t\t\t\tnearDistance: { value: 1 },\n\t\t\t\tfarDistance: { value: 1000 }\n\t\t\t}\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\n\t},\n\n\tshadow: {\n\n\t\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\t\tUniformsLib.lights,\n\t\t\tUniformsLib.fog,\n\t\t\t{\n\t\t\t\tcolor: { value: /*@__PURE__*/ new Color( 0x00000 ) },\n\t\t\t\topacity: { value: 1.0 }\n\t\t\t},\n\t\t] ),\n\n\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\tfragmentShader: ShaderChunk.shadow_frag\n\n\t}\n\n};\n\nShaderLib.physical = {\n\n\tuniforms: /*@__PURE__*/ mergeUniforms( [\n\t\tShaderLib.standard.uniforms,\n\t\t{\n\t\t\tclearcoat: { value: 0 },\n\t\t\tclearcoatMap: { value: null },\n\t\t\tclearcoatMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalMap: { value: null },\n\t\t\tclearcoatNormalMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tclearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) },\n\t\t\tclearcoatRoughness: { value: 0 },\n\t\t\tclearcoatRoughnessMap: { value: null },\n\t\t\tclearcoatRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tdispersion: { value: 0 },\n\t\t\tiridescence: { value: 0 },\n\t\t\tiridescenceMap: { value: null },\n\t\t\tiridescenceMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tiridescenceIOR: { value: 1.3 },\n\t\t\tiridescenceThicknessMinimum: { value: 100 },\n\t\t\tiridescenceThicknessMaximum: { value: 400 },\n\t\t\tiridescenceThicknessMap: { value: null },\n\t\t\tiridescenceThicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheen: { value: 0 },\n\t\t\tsheenColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tsheenColorMap: { value: null },\n\t\t\tsheenColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tsheenRoughness: { value: 1 },\n\t\t\tsheenRoughnessMap: { value: null },\n\t\t\tsheenRoughnessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmission: { value: 0 },\n\t\t\ttransmissionMap: { value: null },\n\t\t\ttransmissionMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\ttransmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() },\n\t\t\ttransmissionSamplerMap: { value: null },\n\t\t\tthickness: { value: 0 },\n\t\t\tthicknessMap: { value: null },\n\t\t\tthicknessMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tattenuationDistance: { value: 0 },\n\t\t\tattenuationColor: { value: /*@__PURE__*/ new Color( 0x000000 ) },\n\t\t\tspecularColor: { value: /*@__PURE__*/ new Color( 1, 1, 1 ) },\n\t\t\tspecularColorMap: { value: null },\n\t\t\tspecularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tspecularIntensity: { value: 1 },\n\t\t\tspecularIntensityMap: { value: null },\n\t\t\tspecularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t\tanisotropyVector: { value: /*@__PURE__*/ new Vector2() },\n\t\t\tanisotropyMap: { value: null },\n\t\t\tanisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },\n\t\t}\n\t] ),\n\n\tvertexShader: ShaderChunk.meshphysical_vert,\n\tfragmentShader: ShaderChunk.meshphysical_frag\n\n};\n\nconst _rgb = { r: 0, b: 0, g: 0 };\nconst _e1$1 = /*@__PURE__*/ new Euler();\nconst _m1$1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {\n\n\tconst clearColor = new Color( 0x000000 );\n\tlet clearAlpha = alpha === true ? 0 : 1;\n\n\tlet planeMesh;\n\tlet boxMesh;\n\n\tlet currentBackground = null;\n\tlet currentBackgroundVersion = 0;\n\tlet currentTonemapping = null;\n\n\tfunction getBackground( scene ) {\n\n\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\tif ( background && background.isTexture ) {\n\n\t\t\tconst usePMREM = scene.backgroundBlurriness > 0; // use PMREM if the user wants to blur the background\n\t\t\tbackground = ( usePMREM ? cubeuvmaps : cubemaps ).get( background );\n\n\t\t}\n\n\t\treturn background;\n\n\t}\n\n\tfunction render( scene ) {\n\n\t\tlet forceClear = false;\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background === null ) {\n\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t} else if ( background && background.isColor ) {\n\n\t\t\tsetClear( background, 1 );\n\t\t\tforceClear = true;\n\n\t\t}\n\n\t\tconst environmentBlendMode = renderer.xr.getEnvironmentBlendMode();\n\n\t\tif ( environmentBlendMode === 'additive' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 1, premultipliedAlpha );\n\n\t\t} else if ( environmentBlendMode === 'alpha-blend' ) {\n\n\t\t\tstate.buffers.color.setClear( 0, 0, 0, 0, premultipliedAlpha );\n\n\t\t}\n\n\t\tif ( renderer.autoClear || forceClear ) {\n\n\t\t\t// buffers might not be writable which is required to ensure a correct clear\n\n\t\t\tstate.buffers.depth.setTest( true );\n\t\t\tstate.buffers.depth.setMask( true );\n\t\t\tstate.buffers.color.setMask( true );\n\n\t\t\trenderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\n\t\t}\n\n\t}\n\n\tfunction addToRenderList( renderList, scene ) {\n\n\t\tconst background = getBackground( scene );\n\n\t\tif ( background && ( background.isCubeTexture || background.mapping === CubeUVReflectionMapping ) ) {\n\n\t\t\tif ( boxMesh === undefined ) {\n\n\t\t\t\tboxMesh = new Mesh(\n\t\t\t\t\tnew BoxGeometry( 1, 1, 1 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.backgroundCube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.backgroundCube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false,\n\t\t\t\t\t\tallowOverride: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'normal' );\n\t\t\t\tboxMesh.geometry.deleteAttribute( 'uv' );\n\n\t\t\t\tboxMesh.onBeforeRender = function ( renderer, scene, camera ) {\n\n\t\t\t\t\tthis.matrixWorld.copyPosition( camera.matrixWorld );\n\n\t\t\t\t};\n\n\t\t\t\t// add \"envMap\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( boxMesh.material, 'envMap', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( boxMesh );\n\n\t\t\t}\n\n\t\t\t_e1$1.copy( scene.backgroundRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1$1.x *= -1; _e1$1.y *= -1; _e1$1.z *= -1;\n\n\t\t\tif ( background.isCubeTexture && background.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1$1.y *= -1;\n\t\t\t\t_e1$1.z *= -1;\n\n\t\t\t}\n\n\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\tboxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? -1 : 1;\n\t\t\tboxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;\n\t\t\tboxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tboxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );\n\t\t\tboxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tboxMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tboxMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null );\n\n\t\t} else if ( background && background.isTexture ) {\n\n\t\t\tif ( planeMesh === undefined ) {\n\n\t\t\t\tplaneMesh = new Mesh(\n\t\t\t\t\tnew PlaneGeometry( 2, 2 ),\n\t\t\t\t\tnew ShaderMaterial( {\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms( ShaderLib.background.uniforms ),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false,\n\t\t\t\t\t\tallowOverride: false\n\t\t\t\t\t} )\n\t\t\t\t);\n\n\t\t\t\tplaneMesh.geometry.deleteAttribute( 'normal' );\n\n\t\t\t\t// add \"map\" material property so the renderer can evaluate it like for built-in materials\n\t\t\t\tObject.defineProperty( planeMesh.material, 'map', {\n\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\tobjects.update( planeMesh );\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\t\t\tplaneMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;\n\t\t\tplaneMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;\n\n\t\t\tif ( background.matrixAutoUpdate === true ) {\n\n\t\t\t\tbackground.updateMatrix();\n\n\t\t\t}\n\n\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy( background.matrix );\n\n\t\t\tif ( currentBackground !== background ||\n\t\t\t\tcurrentBackgroundVersion !== background.version ||\n\t\t\t\tcurrentTonemapping !== renderer.toneMapping ) {\n\n\t\t\t\tplaneMesh.material.needsUpdate = true;\n\n\t\t\t\tcurrentBackground = background;\n\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t\tplaneMesh.layers.enableAll();\n\n\t\t\t// push to the pre-sorted opaque render list\n\t\t\trenderList.unshift( planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null );\n\n\t\t}\n\n\t}\n\n\tfunction setClear( color, alpha ) {\n\n\t\tcolor.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) );\n\n\t\tstate.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha );\n\n\t}\n\n\tfunction dispose() {\n\n\t\tif ( boxMesh !== undefined ) {\n\n\t\t\tboxMesh.geometry.dispose();\n\t\t\tboxMesh.material.dispose();\n\n\t\t\tboxMesh = undefined;\n\n\t\t}\n\n\t\tif ( planeMesh !== undefined ) {\n\n\t\t\tplaneMesh.geometry.dispose();\n\t\t\tplaneMesh.material.dispose();\n\n\t\t\tplaneMesh = undefined;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\tgetClearColor: function () {\n\n\t\t\treturn clearColor;\n\n\t\t},\n\t\tsetClearColor: function ( color, alpha = 1 ) {\n\n\t\t\tclearColor.set( color );\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\tgetClearAlpha: function () {\n\n\t\t\treturn clearAlpha;\n\n\t\t},\n\t\tsetClearAlpha: function ( alpha ) {\n\n\t\t\tclearAlpha = alpha;\n\t\t\tsetClear( clearColor, clearAlpha );\n\n\t\t},\n\t\trender: render,\n\t\taddToRenderList: addToRenderList,\n\t\tdispose: dispose\n\n\t};\n\n}\n\nfunction WebGLBindingStates( gl, attributes ) {\n\n\tconst maxVertexAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\n\tconst bindingStates = {};\n\n\tconst defaultState = createBindingState( null );\n\tlet currentState = defaultState;\n\tlet forceUpdate = false;\n\n\tfunction setup( object, material, program, geometry, index ) {\n\n\t\tlet updateBuffers = false;\n\n\t\tconst state = getBindingState( geometry, program, material );\n\n\t\tif ( currentState !== state ) {\n\n\t\t\tcurrentState = state;\n\t\t\tbindVertexArrayObject( currentState.object );\n\n\t\t}\n\n\t\tupdateBuffers = needsUpdate( object, geometry, program, index );\n\n\t\tif ( updateBuffers ) saveCache( object, geometry, program, index );\n\n\t\tif ( index !== null ) {\n\n\t\t\tattributes.update( index, gl.ELEMENT_ARRAY_BUFFER );\n\n\t\t}\n\n\t\tif ( updateBuffers || forceUpdate ) {\n\n\t\t\tforceUpdate = false;\n\n\t\t\tsetupVertexAttributes( object, material, program, geometry );\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tgl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, attributes.get( index ).buffer );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createVertexArrayObject() {\n\n\t\treturn gl.createVertexArray();\n\n\t}\n\n\tfunction bindVertexArrayObject( vao ) {\n\n\t\treturn gl.bindVertexArray( vao );\n\n\t}\n\n\tfunction deleteVertexArrayObject( vao ) {\n\n\t\treturn gl.deleteVertexArray( vao );\n\n\t}\n\n\tfunction getBindingState( geometry, program, material ) {\n\n\t\tconst wireframe = ( material.wireframe === true );\n\n\t\tlet programMap = bindingStates[ geometry.id ];\n\n\t\tif ( programMap === undefined ) {\n\n\t\t\tprogramMap = {};\n\t\t\tbindingStates[ geometry.id ] = programMap;\n\n\t\t}\n\n\t\tlet stateMap = programMap[ program.id ];\n\n\t\tif ( stateMap === undefined ) {\n\n\t\t\tstateMap = {};\n\t\t\tprogramMap[ program.id ] = stateMap;\n\n\t\t}\n\n\t\tlet state = stateMap[ wireframe ];\n\n\t\tif ( state === undefined ) {\n\n\t\t\tstate = createBindingState( createVertexArrayObject() );\n\t\t\tstateMap[ wireframe ] = state;\n\n\t\t}\n\n\t\treturn state;\n\n\t}\n\n\tfunction createBindingState( vao ) {\n\n\t\tconst newAttributes = [];\n\t\tconst enabledAttributes = [];\n\t\tconst attributeDivisors = [];\n\n\t\tfor ( let i = 0; i < maxVertexAttributes; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\t\t\tenabledAttributes[ i ] = 0;\n\t\t\tattributeDivisors[ i ] = 0;\n\n\t\t}\n\n\t\treturn {\n\n\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\tgeometry: null,\n\t\t\tprogram: null,\n\t\t\twireframe: false,\n\n\t\t\tnewAttributes: newAttributes,\n\t\t\tenabledAttributes: enabledAttributes,\n\t\t\tattributeDivisors: attributeDivisors,\n\t\t\tobject: vao,\n\t\t\tattributes: {},\n\t\t\tindex: null\n\n\t\t};\n\n\t}\n\n\tfunction needsUpdate( object, geometry, program, index ) {\n\n\t\tconst cachedAttributes = currentState.attributes;\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tconst cachedAttribute = cachedAttributes[ name ];\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( cachedAttribute === undefined ) return true;\n\n\t\t\t\tif ( cachedAttribute.attribute !== geometryAttribute ) return true;\n\n\t\t\t\tif ( geometryAttribute && cachedAttribute.data !== geometryAttribute.data ) return true;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( currentState.attributesNum !== attributesNum ) return true;\n\n\t\tif ( currentState.index !== index ) return true;\n\n\t\treturn false;\n\n\t}\n\n\tfunction saveCache( object, geometry, program, index ) {\n\n\t\tconst cache = {};\n\t\tconst attributes = geometry.attributes;\n\t\tlet attributesNum = 0;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet attribute = attributes[ name ];\n\n\t\t\t\tif ( attribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) attribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) attribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tconst data = {};\n\t\t\t\tdata.attribute = attribute;\n\n\t\t\t\tif ( attribute && attribute.data ) {\n\n\t\t\t\t\tdata.data = attribute.data;\n\n\t\t\t\t}\n\n\t\t\t\tcache[ name ] = data;\n\n\t\t\t\tattributesNum ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tcurrentState.attributes = cache;\n\t\tcurrentState.attributesNum = attributesNum;\n\n\t\tcurrentState.index = index;\n\n\t}\n\n\tfunction initAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\n\t\tfor ( let i = 0, il = newAttributes.length; i < il; i ++ ) {\n\n\t\t\tnewAttributes[ i ] = 0;\n\n\t\t}\n\n\t}\n\n\tfunction enableAttribute( attribute ) {\n\n\t\tenableAttributeAndDivisor( attribute, 0 );\n\n\t}\n\n\tfunction enableAttributeAndDivisor( attribute, meshPerAttribute ) {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\tconst attributeDivisors = currentState.attributeDivisors;\n\n\t\tnewAttributes[ attribute ] = 1;\n\n\t\tif ( enabledAttributes[ attribute ] === 0 ) {\n\n\t\t\tgl.enableVertexAttribArray( attribute );\n\t\t\tenabledAttributes[ attribute ] = 1;\n\n\t\t}\n\n\t\tif ( attributeDivisors[ attribute ] !== meshPerAttribute ) {\n\n\t\t\tgl.vertexAttribDivisor( attribute, meshPerAttribute );\n\t\t\tattributeDivisors[ attribute ] = meshPerAttribute;\n\n\t\t}\n\n\t}\n\n\tfunction disableUnusedAttributes() {\n\n\t\tconst newAttributes = currentState.newAttributes;\n\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\tfor ( let i = 0, il = enabledAttributes.length; i < il; i ++ ) {\n\n\t\t\tif ( enabledAttributes[ i ] !== newAttributes[ i ] ) {\n\n\t\t\t\tgl.disableVertexAttribArray( i );\n\t\t\t\tenabledAttributes[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {\n\n\t\tif ( integer === true ) {\n\n\t\t\tgl.vertexAttribIPointer( index, size, type, stride, offset );\n\n\t\t} else {\n\n\t\t\tgl.vertexAttribPointer( index, size, type, normalized, stride, offset );\n\n\t\t}\n\n\t}\n\n\tfunction setupVertexAttributes( object, material, program, geometry ) {\n\n\t\tinitAttributes();\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\tconst programAttributes = program.getAttributes();\n\n\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\tfor ( const name in programAttributes ) {\n\n\t\t\tconst programAttribute = programAttributes[ name ];\n\n\t\t\tif ( programAttribute.location >= 0 ) {\n\n\t\t\t\tlet geometryAttribute = geometryAttributes[ name ];\n\n\t\t\t\tif ( geometryAttribute === undefined ) {\n\n\t\t\t\t\tif ( name === 'instanceMatrix' && object.instanceMatrix ) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\tif ( name === 'instanceColor' && object.instanceColor ) geometryAttribute = object.instanceColor;\n\n\t\t\t\t}\n\n\t\t\t\tif ( geometryAttribute !== undefined ) {\n\n\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\n\t\t\t\t\tconst attribute = attributes.get( geometryAttribute );\n\n\t\t\t\t\t// TODO Attribute may not be available on context restore\n\n\t\t\t\t\tif ( attribute === undefined ) continue;\n\n\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\t// check for integer attributes\n\n\t\t\t\t\tconst integer = ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType );\n\n\t\t\t\t\tif ( geometryAttribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\tif ( data.isInstancedInterleavedBuffer ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, data.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tstride * bytesPerElement,\n\t\t\t\t\t\t\t\t( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( geometryAttribute.isInstancedBufferAttribute ) {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttributeAndDivisor( programAttribute.location + i, geometryAttribute.meshPerAttribute );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined ) {\n\n\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\t\tenableAttribute( programAttribute.location + i );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgl.bindBuffer( gl.ARRAY_BUFFER, buffer );\n\n\t\t\t\t\t\tfor ( let i = 0; i < programAttribute.locationSize; i ++ ) {\n\n\t\t\t\t\t\t\tvertexAttribPointer(\n\t\t\t\t\t\t\t\tprogramAttribute.location + i,\n\t\t\t\t\t\t\t\tsize / programAttribute.locationSize,\n\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\tnormalized,\n\t\t\t\t\t\t\t\tsize * bytesPerElement,\n\t\t\t\t\t\t\t\t( size / programAttribute.locationSize ) * i * bytesPerElement,\n\t\t\t\t\t\t\t\tinteger\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( materialDefaultAttributeValues !== undefined ) {\n\n\t\t\t\t\tconst value = materialDefaultAttributeValues[ name ];\n\n\t\t\t\t\tif ( value !== undefined ) {\n\n\t\t\t\t\t\tswitch ( value.length ) {\n\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tgl.vertexAttrib2fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tgl.vertexAttrib3fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\tgl.vertexAttrib4fv( programAttribute.location, value );\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tgl.vertexAttrib1fv( programAttribute.location, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tdisableUnusedAttributes();\n\n\t}\n\n\tfunction dispose() {\n\n\t\treset();\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tfor ( const programId in programMap ) {\n\n\t\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[ programId ];\n\n\t\t\t}\n\n\t\t\tdelete bindingStates[ geometryId ];\n\n\t\t}\n\n\t}\n\n\tfunction releaseStatesOfGeometry( geometry ) {\n\n\t\tif ( bindingStates[ geometry.id ] === undefined ) return;\n\n\t\tconst programMap = bindingStates[ geometry.id ];\n\n\t\tfor ( const programId in programMap ) {\n\n\t\t\tconst stateMap = programMap[ programId ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ programId ];\n\n\t\t}\n\n\t\tdelete bindingStates[ geometry.id ];\n\n\t}\n\n\tfunction releaseStatesOfProgram( program ) {\n\n\t\tfor ( const geometryId in bindingStates ) {\n\n\t\t\tconst programMap = bindingStates[ geometryId ];\n\n\t\t\tif ( programMap[ program.id ] === undefined ) continue;\n\n\t\t\tconst stateMap = programMap[ program.id ];\n\n\t\t\tfor ( const wireframe in stateMap ) {\n\n\t\t\t\tdeleteVertexArrayObject( stateMap[ wireframe ].object );\n\n\t\t\t\tdelete stateMap[ wireframe ];\n\n\t\t\t}\n\n\t\t\tdelete programMap[ program.id ];\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\tresetDefaultState();\n\t\tforceUpdate = true;\n\n\t\tif ( currentState === defaultState ) return;\n\n\t\tcurrentState = defaultState;\n\t\tbindVertexArrayObject( currentState.object );\n\n\t}\n\n\t// for backward-compatibility\n\n\tfunction resetDefaultState() {\n\n\t\tdefaultState.geometry = null;\n\t\tdefaultState.program = null;\n\t\tdefaultState.wireframe = false;\n\n\t}\n\n\treturn {\n\n\t\tsetup: setup,\n\t\treset: reset,\n\t\tresetDefaultState: resetDefaultState,\n\t\tdispose: dispose,\n\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\n\t\tinitAttributes: initAttributes,\n\t\tenableAttribute: enableAttribute,\n\t\tdisableUnusedAttributes: disableUnusedAttributes\n\n\t};\n\n}\n\nfunction WebGLBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawArrays( mode, start, count );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawArraysInstanced( mode, start, count, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\t\textension.multiDrawArraysWEBGL( mode, starts, 0, counts, 0, drawCount );\n\n\t\tlet elementCount = 0;\n\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\telementCount += counts[ i ];\n\n\t\t}\n\n\t\tinfo.update( elementCount, mode, 1 );\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ], counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawArraysInstancedWEBGL( mode, starts, 0, counts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ] * primcount[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLCapabilities( gl, extensions, parameters, utils ) {\n\n\tlet maxAnisotropy;\n\n\tfunction getMaxAnisotropy() {\n\n\t\tif ( maxAnisotropy !== undefined ) return maxAnisotropy;\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\n\t\t\tmaxAnisotropy = gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );\n\n\t\t} else {\n\n\t\t\tmaxAnisotropy = 0;\n\n\t\t}\n\n\t\treturn maxAnisotropy;\n\n\t}\n\n\tfunction textureFormatReadable( textureFormat ) {\n\n\t\tif ( textureFormat !== RGBAFormat && utils.convert( textureFormat ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction textureTypeReadable( textureType ) {\n\n\t\tconst halfFloatSupportedByExt = ( textureType === HalfFloatType ) && ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) );\n\n\t\tif ( textureType !== UnsignedByteType && utils.convert( textureType ) !== gl.getParameter( gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\ttextureType !== FloatType && ! halfFloatSupportedByExt ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tfunction getMaxPrecision( precision ) {\n\n\t\tif ( precision === 'highp' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.HIGH_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.HIGH_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'highp';\n\n\t\t\t}\n\n\t\t\tprecision = 'mediump';\n\n\t\t}\n\n\t\tif ( precision === 'mediump' ) {\n\n\t\t\tif ( gl.getShaderPrecisionFormat( gl.VERTEX_SHADER, gl.MEDIUM_FLOAT ).precision > 0 &&\n\t\t\t\tgl.getShaderPrecisionFormat( gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT ).precision > 0 ) {\n\n\t\t\t\treturn 'mediump';\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'lowp';\n\n\t}\n\n\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\tconst maxPrecision = getMaxPrecision( precision );\n\n\tif ( maxPrecision !== precision ) {\n\n\t\tconsole.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );\n\t\tprecision = maxPrecision;\n\n\t}\n\n\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\tconst reversedDepthBuffer = parameters.reversedDepthBuffer === true && extensions.has( 'EXT_clip_control' );\n\n\tconst maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS );\n\tconst maxVertexTextures = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS );\n\tconst maxTextureSize = gl.getParameter( gl.MAX_TEXTURE_SIZE );\n\tconst maxCubemapSize = gl.getParameter( gl.MAX_CUBE_MAP_TEXTURE_SIZE );\n\n\tconst maxAttributes = gl.getParameter( gl.MAX_VERTEX_ATTRIBS );\n\tconst maxVertexUniforms = gl.getParameter( gl.MAX_VERTEX_UNIFORM_VECTORS );\n\tconst maxVaryings = gl.getParameter( gl.MAX_VARYING_VECTORS );\n\tconst maxFragmentUniforms = gl.getParameter( gl.MAX_FRAGMENT_UNIFORM_VECTORS );\n\n\tconst vertexTextures = maxVertexTextures > 0;\n\n\tconst maxSamples = gl.getParameter( gl.MAX_SAMPLES );\n\n\treturn {\n\n\t\tisWebGL2: true, // keeping this for backwards compatibility\n\n\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\tgetMaxPrecision: getMaxPrecision,\n\n\t\ttextureFormatReadable: textureFormatReadable,\n\t\ttextureTypeReadable: textureTypeReadable,\n\n\t\tprecision: precision,\n\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\treversedDepthBuffer: reversedDepthBuffer,\n\n\t\tmaxTextures: maxTextures,\n\t\tmaxVertexTextures: maxVertexTextures,\n\t\tmaxTextureSize: maxTextureSize,\n\t\tmaxCubemapSize: maxCubemapSize,\n\n\t\tmaxAttributes: maxAttributes,\n\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\tmaxVaryings: maxVaryings,\n\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\n\t\tvertexTextures: vertexTextures,\n\n\t\tmaxSamples: maxSamples\n\n\t};\n\n}\n\nfunction WebGLClipping( properties ) {\n\n\tconst scope = this;\n\n\tlet globalState = null,\n\t\tnumGlobalPlanes = 0,\n\t\tlocalClippingEnabled = false,\n\t\trenderingShadows = false;\n\n\tconst plane = new Plane(),\n\t\tviewNormalMatrix = new Matrix3(),\n\n\t\tuniform = { value: null, needsUpdate: false };\n\n\tthis.uniform = uniform;\n\tthis.numPlanes = 0;\n\tthis.numIntersection = 0;\n\n\tthis.init = function ( planes, enableLocalClipping ) {\n\n\t\tconst enabled =\n\t\t\tplanes.length !== 0 ||\n\t\t\tenableLocalClipping ||\n\t\t\t// enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 ||\n\t\t\tlocalClippingEnabled;\n\n\t\tlocalClippingEnabled = enableLocalClipping;\n\n\t\tnumGlobalPlanes = planes.length;\n\n\t\treturn enabled;\n\n\t};\n\n\tthis.beginShadows = function () {\n\n\t\trenderingShadows = true;\n\t\tprojectPlanes( null );\n\n\t};\n\n\tthis.endShadows = function () {\n\n\t\trenderingShadows = false;\n\n\t};\n\n\tthis.setGlobalState = function ( planes, camera ) {\n\n\t\tglobalState = projectPlanes( planes, camera, 0 );\n\n\t};\n\n\tthis.setState = function ( material, camera, useCache ) {\n\n\t\tconst planes = material.clippingPlanes,\n\t\t\tclipIntersection = material.clipIntersection,\n\t\t\tclipShadows = material.clipShadows;\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tif ( ! localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && ! clipShadows ) {\n\n\t\t\t// there's no local clipping\n\n\t\t\tif ( renderingShadows ) {\n\n\t\t\t\t// there's no global clipping\n\n\t\t\t\tprojectPlanes( null );\n\n\t\t\t} else {\n\n\t\t\t\tresetGlobalState();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\tlGlobal = nGlobal * 4;\n\n\t\t\tlet dstArray = materialProperties.clippingState || null;\n\n\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\tdstArray = projectPlanes( planes, camera, lGlobal, useCache );\n\n\t\t\tfor ( let i = 0; i !== lGlobal; ++ i ) {\n\n\t\t\t\tdstArray[ i ] = globalState[ i ];\n\n\t\t\t}\n\n\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\tthis.numPlanes += nGlobal;\n\n\t\t}\n\n\n\t};\n\n\tfunction resetGlobalState() {\n\n\t\tif ( uniform.value !== globalState ) {\n\n\t\t\tuniform.value = globalState;\n\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\n\t\t}\n\n\t\tscope.numPlanes = numGlobalPlanes;\n\t\tscope.numIntersection = 0;\n\n\t}\n\n\tfunction projectPlanes( planes, camera, dstOffset, skipTransform ) {\n\n\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\tlet dstArray = null;\n\n\t\tif ( nPlanes !== 0 ) {\n\n\t\t\tdstArray = uniform.value;\n\n\t\t\tif ( skipTransform !== true || dstArray === null ) {\n\n\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\n\t\t\t\tviewNormalMatrix.getNormalMatrix( viewMatrix );\n\n\t\t\t\tif ( dstArray === null || dstArray.length < flatSize ) {\n\n\t\t\t\t\tdstArray = new Float32Array( flatSize );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, i4 = dstOffset; i !== nPlanes; ++ i, i4 += 4 ) {\n\n\t\t\t\t\tplane.copy( planes[ i ] ).applyMatrix4( viewMatrix, viewNormalMatrix );\n\n\t\t\t\t\tplane.normal.toArray( dstArray, i4 );\n\t\t\t\t\tdstArray[ i4 + 3 ] = plane.constant;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tuniform.value = dstArray;\n\t\t\tuniform.needsUpdate = true;\n\n\t\t}\n\n\t\tscope.numPlanes = nPlanes;\n\t\tscope.numIntersection = 0;\n\n\t\treturn dstArray;\n\n\t}\n\n}\n\nfunction WebGLCubeMaps( renderer ) {\n\n\tlet cubemaps = new WeakMap();\n\n\tfunction mapTextureMapping( texture, mapping ) {\n\n\t\tif ( mapping === EquirectangularReflectionMapping ) {\n\n\t\t\ttexture.mapping = CubeReflectionMapping;\n\n\t\t} else if ( mapping === EquirectangularRefractionMapping ) {\n\n\t\t\ttexture.mapping = CubeRefractionMapping;\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tif ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping ) {\n\n\t\t\t\tif ( cubemaps.has( texture ) ) {\n\n\t\t\t\t\tconst cubemap = cubemaps.get( texture ).texture;\n\t\t\t\t\treturn mapTextureMapping( cubemap, texture.mapping );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\tif ( image && image.height > 0 ) {\n\n\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget( image.height );\n\t\t\t\t\t\trenderTarget.fromEquirectangularTexture( renderer, texture );\n\t\t\t\t\t\tcubemaps.set( texture, renderTarget );\n\n\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\treturn mapTextureMapping( renderTarget.texture, texture.mapping );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemap = cubemaps.get( texture );\n\n\t\tif ( cubemap !== undefined ) {\n\n\t\t\tcubemaps.delete( texture );\n\t\t\tcubemap.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubemaps = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nconst LOD_MIN = 4;\n\n// The standard deviations (radians) associated with the extra mips. These are\n// chosen to approximate a Trowbridge-Reitz distribution function times the\n// geometric shadowing function. These sigma values squared must match the\n// variance #defines in cube_uv_reflection_fragment.glsl.js.\nconst EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];\n\n// The maximum length of the blur for loop. Smaller sigmas will use fewer\n// samples and exit early, but not recompile the shader.\nconst MAX_SAMPLES = 20;\n\nconst _flatCamera = /*@__PURE__*/ new OrthographicCamera();\nconst _clearColor = /*@__PURE__*/ new Color();\nlet _oldTarget = null;\nlet _oldActiveCubeFace = 0;\nlet _oldActiveMipmapLevel = 0;\nlet _oldXrEnabled = false;\n\n// Golden Ratio\nconst PHI = ( 1 + Math.sqrt( 5 ) ) / 2;\nconst INV_PHI = 1 / PHI;\n\n// Vertices of a dodecahedron (except the opposites, which represent the\n// same axis), used as axis directions evenly spread on a sphere.\nconst _axisDirections = [\n\t/*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),\n\t/*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),\n\t/*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),\n\t/*@__PURE__*/ new Vector3( -1, 1, -1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, -1 ),\n\t/*@__PURE__*/ new Vector3( -1, 1, 1 ),\n\t/*@__PURE__*/ new Vector3( 1, 1, 1 ) ];\n\nconst _origin = /*@__PURE__*/ new Vector3();\n\n/**\n * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n * (PMREM) from a cubeMap environment texture. This allows different levels of\n * blur to be quickly accessed based on material roughness. It is packed into a\n * special CubeUV format that allows us to perform custom interpolation so that\n * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n * higher roughness levels. In this way we maintain resolution to smoothly\n * interpolate diffuse lighting while limiting sampling computation.\n *\n * Paper: Fast, Accurate Image-Based Lighting:\n * {@link https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view}\n*/\nclass PMREMGenerator {\n\n\t/**\n\t * Constructs a new PMREM generator.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t */\n\tconstructor( renderer ) {\n\n\t\tthis._renderer = renderer;\n\t\tthis._pingPongRenderTarget = null;\n\n\t\tthis._lodMax = 0;\n\t\tthis._cubeSize = 0;\n\t\tthis._lodPlanes = [];\n\t\tthis._sizeLods = [];\n\t\tthis._sigmas = [];\n\n\t\tthis._blurMaterial = null;\n\t\tthis._cubemapMaterial = null;\n\t\tthis._equirectMaterial = null;\n\n\t\tthis._compileMaterial( this._blurMaterial );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t * and far planes ensure the scene is rendered in its entirety.\n\t *\n\t * @param {Scene} scene - The scene to be captured.\n\t * @param {number} [sigma=0] - The blur radius in radians.\n\t * @param {number} [near=0.1] - The near plane distance.\n\t * @param {number} [far=100] - The far plane distance.\n\t * @param {Object} [options={}] - The configuration options.\n\t * @param {number} [options.size=256] - The texture size of the PMREM.\n\t * @param {Vector3} [options.renderTarget=origin] - The position of the internal cube camera that renders the scene.\n\t * @return {WebGLRenderTarget} The resulting PMREM.\n\t */\n\tfromScene( scene, sigma = 0, near = 0.1, far = 100, options = {} ) {\n\n\t\tconst {\n\t\t\tsize = 256,\n\t\t\tposition = _origin,\n\t\t} = options;\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tthis._setSize( size );\n\n\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\t\tcubeUVRenderTarget.depthBuffer = true;\n\n\t\tthis._sceneToCubeUV( scene, near, far, cubeUVRenderTarget, position );\n\n\t\tif ( sigma > 0 ) {\n\n\t\t\tthis._blur( cubeUVRenderTarget, 0, 0, sigma );\n\n\t\t}\n\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t * or HDR. The ideal input image size is 1k (1024 x 512),\n\t * as this matches best with the 256 x 256 cubemap output.\n\t *\n\t * @param {Texture} equirectangular - The equirectangular texture to be converted.\n\t * @param {?WebGLRenderTarget} [renderTarget=null] - The render target to use.\n\t * @return {WebGLRenderTarget} The resulting PMREM.\n\t */\n\tfromEquirectangular( equirectangular, renderTarget = null ) {\n\n\t\treturn this._fromTexture( equirectangular, renderTarget );\n\n\t}\n\n\t/**\n\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t * or HDR. The ideal input cube size is 256 x 256,\n\t * as this matches best with the 256 x 256 cubemap output.\n\t *\n\t * @param {Texture} cubemap - The cubemap texture to be converted.\n\t * @param {?WebGLRenderTarget} [renderTarget=null] - The render target to use.\n\t * @return {WebGLRenderTarget} The resulting PMREM.\n\t */\n\tfromCubemap( cubemap, renderTarget = null ) {\n\n\t\treturn this._fromTexture( cubemap, renderTarget );\n\n\t}\n\n\t/**\n\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileCubemapShader() {\n\n\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\t\t\tthis._compileMaterial( this._cubemapMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t * your texture's network fetch for increased concurrency.\n\t */\n\tcompileEquirectangularShader() {\n\n\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\t\t\tthis._compileMaterial( this._equirectMaterial );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t * one of them will cause any others to also become unusable.\n\t */\n\tdispose() {\n\n\t\tthis._dispose();\n\n\t\tif ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();\n\t\tif ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();\n\n\t}\n\n\t// private interface\n\n\t_setSize( cubeSize ) {\n\n\t\tthis._lodMax = Math.floor( Math.log2( cubeSize ) );\n\t\tthis._cubeSize = Math.pow( 2, this._lodMax );\n\n\t}\n\n\t_dispose() {\n\n\t\tif ( this._blurMaterial !== null ) this._blurMaterial.dispose();\n\n\t\tif ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();\n\n\t\tfor ( let i = 0; i < this._lodPlanes.length; i ++ ) {\n\n\t\t\tthis._lodPlanes[ i ].dispose();\n\n\t\t}\n\n\t}\n\n\t_cleanup( outputTarget ) {\n\n\t\tthis._renderer.setRenderTarget( _oldTarget, _oldActiveCubeFace, _oldActiveMipmapLevel );\n\t\tthis._renderer.xr.enabled = _oldXrEnabled;\n\n\t\toutputTarget.scissorTest = false;\n\t\t_setViewport( outputTarget, 0, 0, outputTarget.width, outputTarget.height );\n\n\t}\n\n\t_fromTexture( texture, renderTarget ) {\n\n\t\tif ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping ) {\n\n\t\t\tthis._setSize( texture.image.length === 0 ? 16 : ( texture.image[ 0 ].width || texture.image[ 0 ].image.width ) );\n\n\t\t} else { // Equirectangular\n\n\t\t\tthis._setSize( texture.image.width / 4 );\n\n\t\t}\n\n\t\t_oldTarget = this._renderer.getRenderTarget();\n\t\t_oldActiveCubeFace = this._renderer.getActiveCubeFace();\n\t\t_oldActiveMipmapLevel = this._renderer.getActiveMipmapLevel();\n\t\t_oldXrEnabled = this._renderer.xr.enabled;\n\n\t\tthis._renderer.xr.enabled = false;\n\n\t\tconst cubeUVRenderTarget = renderTarget || this._allocateTargets();\n\t\tthis._textureToCubeUV( texture, cubeUVRenderTarget );\n\t\tthis._applyPMREM( cubeUVRenderTarget );\n\t\tthis._cleanup( cubeUVRenderTarget );\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_allocateTargets() {\n\n\t\tconst width = 3 * Math.max( this._cubeSize, 16 * 7 );\n\t\tconst height = 4 * this._cubeSize;\n\n\t\tconst params = {\n\t\t\tmagFilter: LinearFilter,\n\t\t\tminFilter: LinearFilter,\n\t\t\tgenerateMipmaps: false,\n\t\t\ttype: HalfFloatType,\n\t\t\tformat: RGBAFormat,\n\t\t\tcolorSpace: LinearSRGBColorSpace,\n\t\t\tdepthBuffer: false\n\t\t};\n\n\t\tconst cubeUVRenderTarget = _createRenderTarget( width, height, params );\n\n\t\tif ( this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width || this._pingPongRenderTarget.height !== height ) {\n\n\t\t\tif ( this._pingPongRenderTarget !== null ) {\n\n\t\t\t\tthis._dispose();\n\n\t\t\t}\n\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget( width, height, params );\n\n\t\t\tconst { _lodMax } = this;\n\t\t\t( { sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes( _lodMax ) );\n\n\t\t\tthis._blurMaterial = _getBlurShader( _lodMax, width, height );\n\n\t\t}\n\n\t\treturn cubeUVRenderTarget;\n\n\t}\n\n\t_compileMaterial( material ) {\n\n\t\tconst tmpMesh = new Mesh( this._lodPlanes[ 0 ], material );\n\t\tthis._renderer.compile( tmpMesh, _flatCamera );\n\n\t}\n\n\t_sceneToCubeUV( scene, near, far, cubeUVRenderTarget, position ) {\n\n\t\tconst fov = 90;\n\t\tconst aspect = 1;\n\t\tconst cubeCamera = new PerspectiveCamera( fov, aspect, near, far );\n\t\tconst upSign = [ 1, -1, 1, 1, 1, 1 ];\n\t\tconst forwardSign = [ 1, 1, 1, -1, -1, -1 ];\n\t\tconst renderer = this._renderer;\n\n\t\tconst originalAutoClear = renderer.autoClear;\n\t\tconst toneMapping = renderer.toneMapping;\n\t\trenderer.getClearColor( _clearColor );\n\n\t\trenderer.toneMapping = NoToneMapping;\n\t\trenderer.autoClear = false;\n\n\t\t// https://github.com/mrdoob/three.js/issues/31413#issuecomment-3095966812\n\t\tconst reversedDepthBuffer = renderer.state.buffers.depth.getReversed();\n\n\t\tif ( reversedDepthBuffer ) {\n\n\t\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\t\t\trenderer.clearDepth();\n\t\t\trenderer.setRenderTarget( null );\n\n\t\t}\n\n\t\tconst backgroundMaterial = new MeshBasicMaterial( {\n\t\t\tname: 'PMREM.Background',\n\t\t\tside: BackSide,\n\t\t\tdepthWrite: false,\n\t\t\tdepthTest: false,\n\t\t} );\n\n\t\tconst backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial );\n\n\t\tlet useSolidColor = false;\n\t\tconst background = scene.background;\n\n\t\tif ( background ) {\n\n\t\t\tif ( background.isColor ) {\n\n\t\t\t\tbackgroundMaterial.color.copy( background );\n\t\t\t\tscene.background = null;\n\t\t\t\tuseSolidColor = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tbackgroundMaterial.color.copy( _clearColor );\n\t\t\tuseSolidColor = true;\n\n\t\t}\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst col = i % 3;\n\n\t\t\tif ( col === 0 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.position.set( position.x, position.y, position.z );\n\t\t\t\tcubeCamera.lookAt( position.x + forwardSign[ i ], position.y, position.z );\n\n\t\t\t} else if ( col === 1 ) {\n\n\t\t\t\tcubeCamera.up.set( 0, 0, upSign[ i ] );\n\t\t\t\tcubeCamera.position.set( position.x, position.y, position.z );\n\t\t\t\tcubeCamera.lookAt( position.x, position.y + forwardSign[ i ], position.z );\n\n\n\t\t\t} else {\n\n\t\t\t\tcubeCamera.up.set( 0, upSign[ i ], 0 );\n\t\t\t\tcubeCamera.position.set( position.x, position.y, position.z );\n\t\t\t\tcubeCamera.lookAt( position.x, position.y, position.z + forwardSign[ i ] );\n\n\t\t\t}\n\n\t\t\tconst size = this._cubeSize;\n\n\t\t\t_setViewport( cubeUVRenderTarget, col * size, i > 2 ? size : 0, size, size );\n\n\t\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\n\t\t\tif ( useSolidColor ) {\n\n\t\t\t\trenderer.render( backgroundBox, cubeCamera );\n\n\t\t\t}\n\n\t\t\trenderer.render( scene, cubeCamera );\n\n\t\t}\n\n\t\tbackgroundBox.geometry.dispose();\n\t\tbackgroundBox.material.dispose();\n\n\t\trenderer.toneMapping = toneMapping;\n\t\trenderer.autoClear = originalAutoClear;\n\t\tscene.background = background;\n\n\t}\n\n\t_textureToCubeUV( texture, cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\n\t\tconst isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );\n\n\t\tif ( isCubeTexture ) {\n\n\t\t\tif ( this._cubemapMaterial === null ) {\n\n\t\t\t\tthis._cubemapMaterial = _getCubemapMaterial();\n\n\t\t\t}\n\n\t\t\tthis._cubemapMaterial.uniforms.flipEnvMap.value = ( texture.isRenderTargetTexture === false ) ? -1 : 1;\n\n\t\t} else {\n\n\t\t\tif ( this._equirectMaterial === null ) {\n\n\t\t\t\tthis._equirectMaterial = _getEquirectMaterial();\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial;\n\t\tconst mesh = new Mesh( this._lodPlanes[ 0 ], material );\n\n\t\tconst uniforms = material.uniforms;\n\n\t\tuniforms[ 'envMap' ].value = texture;\n\n\t\tconst size = this._cubeSize;\n\n\t\t_setViewport( cubeUVRenderTarget, 0, 0, 3 * size, 2 * size );\n\n\t\trenderer.setRenderTarget( cubeUVRenderTarget );\n\t\trenderer.render( mesh, _flatCamera );\n\n\t}\n\n\t_applyPMREM( cubeUVRenderTarget ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst autoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\t\tconst n = this._lodPlanes.length;\n\n\t\tfor ( let i = 1; i < n; i ++ ) {\n\n\t\t\tconst sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );\n\n\t\t\tconst poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];\n\n\t\t\tthis._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );\n\n\t\t}\n\n\t\trenderer.autoClear = autoClear;\n\n\t}\n\n\t/**\n\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t * accurate at the poles, but still does a decent job.\n\t *\n\t * @private\n\t * @param {WebGLRenderTarget} cubeUVRenderTarget\n\t * @param {number} lodIn\n\t * @param {number} lodOut\n\t * @param {number} sigma\n\t * @param {Vector3} [poleAxis]\n\t */\n\t_blur( cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis ) {\n\n\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\tthis._halfBlur(\n\t\t\tcubeUVRenderTarget,\n\t\t\tpingPongRenderTarget,\n\t\t\tlodIn,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'latitudinal',\n\t\t\tpoleAxis );\n\n\t\tthis._halfBlur(\n\t\t\tpingPongRenderTarget,\n\t\t\tcubeUVRenderTarget,\n\t\t\tlodOut,\n\t\t\tlodOut,\n\t\t\tsigma,\n\t\t\t'longitudinal',\n\t\t\tpoleAxis );\n\n\t}\n\n\t_halfBlur( targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis ) {\n\n\t\tconst renderer = this._renderer;\n\t\tconst blurMaterial = this._blurMaterial;\n\n\t\tif ( direction !== 'latitudinal' && direction !== 'longitudinal' ) {\n\n\t\t\tconsole.error(\n\t\t\t\t'blur direction must be either latitudinal or longitudinal!' );\n\n\t\t}\n\n\t\t// Number of standard deviations at which to cut off the discrete approximation.\n\t\tconst STANDARD_DEVIATIONS = 3;\n\n\t\tconst blurMesh = new Mesh( this._lodPlanes[ lodOut ], blurMaterial );\n\t\tconst blurUniforms = blurMaterial.uniforms;\n\n\t\tconst pixels = this._sizeLods[ lodIn ] - 1;\n\t\tconst radiansPerPixel = isFinite( sigmaRadians ) ? Math.PI / ( 2 * pixels ) : 2 * Math.PI / ( 2 * MAX_SAMPLES - 1 );\n\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\tconst samples = isFinite( sigmaRadians ) ? 1 + Math.floor( STANDARD_DEVIATIONS * sigmaPixels ) : MAX_SAMPLES;\n\n\t\tif ( samples > MAX_SAMPLES ) {\n\n\t\t\tconsole.warn( `sigmaRadians, ${\n\t\t\t\tsigmaRadians}, is too large and will clip, as it requested ${\n\t\t\t\tsamples} samples when the maximum is set to ${MAX_SAMPLES}` );\n\n\t\t}\n\n\t\tconst weights = [];\n\t\tlet sum = 0;\n\n\t\tfor ( let i = 0; i < MAX_SAMPLES; ++ i ) {\n\n\t\t\tconst x = i / sigmaPixels;\n\t\t\tconst weight = Math.exp( - x * x / 2 );\n\t\t\tweights.push( weight );\n\n\t\t\tif ( i === 0 ) {\n\n\t\t\t\tsum += weight;\n\n\t\t\t} else if ( i < samples ) {\n\n\t\t\t\tsum += 2 * weight;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfor ( let i = 0; i < weights.length; i ++ ) {\n\n\t\t\tweights[ i ] = weights[ i ] / sum;\n\n\t\t}\n\n\t\tblurUniforms[ 'envMap' ].value = targetIn.texture;\n\t\tblurUniforms[ 'samples' ].value = samples;\n\t\tblurUniforms[ 'weights' ].value = weights;\n\t\tblurUniforms[ 'latitudinal' ].value = direction === 'latitudinal';\n\n\t\tif ( poleAxis ) {\n\n\t\t\tblurUniforms[ 'poleAxis' ].value = poleAxis;\n\n\t\t}\n\n\t\tconst { _lodMax } = this;\n\t\tblurUniforms[ 'dTheta' ].value = radiansPerPixel;\n\t\tblurUniforms[ 'mipInt' ].value = _lodMax - lodIn;\n\n\t\tconst outputSize = this._sizeLods[ lodOut ];\n\t\tconst x = 3 * outputSize * ( lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0 );\n\t\tconst y = 4 * ( this._cubeSize - outputSize );\n\n\t\t_setViewport( targetOut, x, y, 3 * outputSize, 2 * outputSize );\n\t\trenderer.setRenderTarget( targetOut );\n\t\trenderer.render( blurMesh, _flatCamera );\n\n\t}\n\n}\n\n\n\nfunction _createPlanes( lodMax ) {\n\n\tconst lodPlanes = [];\n\tconst sizeLods = [];\n\tconst sigmas = [];\n\n\tlet lod = lodMax;\n\n\tconst totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;\n\n\tfor ( let i = 0; i < totalLods; i ++ ) {\n\n\t\tconst sizeLod = Math.pow( 2, lod );\n\t\tsizeLods.push( sizeLod );\n\t\tlet sigma = 1.0 / sizeLod;\n\n\t\tif ( i > lodMax - LOD_MIN ) {\n\n\t\t\tsigma = EXTRA_LOD_SIGMA[ i - lodMax + LOD_MIN - 1 ];\n\n\t\t} else if ( i === 0 ) {\n\n\t\t\tsigma = 0;\n\n\t\t}\n\n\t\tsigmas.push( sigma );\n\n\t\tconst texelSize = 1.0 / ( sizeLod - 2 );\n\t\tconst min = - texelSize;\n\t\tconst max = 1 + texelSize;\n\t\tconst uv1 = [ min, min, max, min, max, max, min, min, max, max, min, max ];\n\n\t\tconst cubeFaces = 6;\n\t\tconst vertices = 6;\n\t\tconst positionSize = 3;\n\t\tconst uvSize = 2;\n\t\tconst faceIndexSize = 1;\n\n\t\tconst position = new Float32Array( positionSize * vertices * cubeFaces );\n\t\tconst uv = new Float32Array( uvSize * vertices * cubeFaces );\n\t\tconst faceIndex = new Float32Array( faceIndexSize * vertices * cubeFaces );\n\n\t\tfor ( let face = 0; face < cubeFaces; face ++ ) {\n\n\t\t\tconst x = ( face % 3 ) * 2 / 3 - 1;\n\t\t\tconst y = face > 2 ? 0 : -1;\n\t\t\tconst coordinates = [\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y, 0,\n\t\t\t\tx + 2 / 3, y + 1, 0,\n\t\t\t\tx, y + 1, 0\n\t\t\t];\n\t\t\tposition.set( coordinates, positionSize * vertices * face );\n\t\t\tuv.set( uv1, uvSize * vertices * face );\n\t\t\tconst fill = [ face, face, face, face, face, face ];\n\t\t\tfaceIndex.set( fill, faceIndexSize * vertices * face );\n\n\t\t}\n\n\t\tconst planes = new BufferGeometry();\n\t\tplanes.setAttribute( 'position', new BufferAttribute( position, positionSize ) );\n\t\tplanes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );\n\t\tplanes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );\n\t\tlodPlanes.push( planes );\n\n\t\tif ( lod > LOD_MIN ) {\n\n\t\t\tlod --;\n\n\t\t}\n\n\t}\n\n\treturn { lodPlanes, sizeLods, sigmas };\n\n}\n\nfunction _createRenderTarget( width, height, params ) {\n\n\tconst cubeUVRenderTarget = new WebGLRenderTarget( width, height, params );\n\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\tcubeUVRenderTarget.scissorTest = true;\n\treturn cubeUVRenderTarget;\n\n}\n\nfunction _setViewport( target, x, y, width, height ) {\n\n\ttarget.viewport.set( x, y, width, height );\n\ttarget.scissor.set( x, y, width, height );\n\n}\n\nfunction _getBlurShader( lodMax, width, height ) {\n\n\tconst weights = new Float32Array( MAX_SAMPLES );\n\tconst poleAxis = new Vector3( 0, 1, 0 );\n\tconst shaderMaterial = new ShaderMaterial( {\n\n\t\tname: 'SphericalGaussianBlur',\n\n\t\tdefines: {\n\t\t\t'n': MAX_SAMPLES,\n\t\t\t'CUBEUV_TEXEL_WIDTH': 1.0 / width,\n\t\t\t'CUBEUV_TEXEL_HEIGHT': 1.0 / height,\n\t\t\t'CUBEUV_MAX_MIP': `${lodMax}.0`,\n\t\t},\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'samples': { value: 1 },\n\t\t\t'weights': { value: weights },\n\t\t\t'latitudinal': { value: false },\n\t\t\t'dTheta': { value: 0 },\n\t\t\t'mipInt': { value: 0 },\n\t\t\t'poleAxis': { value: poleAxis }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n\treturn shaderMaterial;\n\n}\n\nfunction _getEquirectMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'EquirectangularToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCubemapMaterial() {\n\n\treturn new ShaderMaterial( {\n\n\t\tname: 'CubemapToCubeUV',\n\n\t\tuniforms: {\n\t\t\t'envMap': { value: null },\n\t\t\t'flipEnvMap': { value: -1 }\n\t\t},\n\n\t\tvertexShader: _getCommonVertexShader(),\n\n\t\tfragmentShader: /* glsl */`\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`,\n\n\t\tblending: NoBlending,\n\t\tdepthTest: false,\n\t\tdepthWrite: false\n\n\t} );\n\n}\n\nfunction _getCommonVertexShader() {\n\n\treturn /* glsl */`\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`;\n\n}\n\nfunction WebGLCubeUVMaps( renderer ) {\n\n\tlet cubeUVmaps = new WeakMap();\n\n\tlet pmremGenerator = null;\n\n\tfunction get( texture ) {\n\n\t\tif ( texture && texture.isTexture ) {\n\n\t\t\tconst mapping = texture.mapping;\n\n\t\t\tconst isEquirectMap = ( mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping );\n\t\t\tconst isCubeMap = ( mapping === CubeReflectionMapping || mapping === CubeRefractionMapping );\n\n\t\t\t// equirect/cube map to cubeUV conversion\n\n\t\t\tif ( isEquirectMap || isCubeMap ) {\n\n\t\t\t\tlet renderTarget = cubeUVmaps.get( texture );\n\n\t\t\t\tconst currentPMREMVersion = renderTarget !== undefined ? renderTarget.texture.pmremVersion : 0;\n\n\t\t\t\tif ( texture.isRenderTargetTexture && texture.pmremVersion !== currentPMREMVersion ) {\n\n\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture, renderTarget ) : pmremGenerator.fromCubemap( texture, renderTarget );\n\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( renderTarget !== undefined ) {\n\n\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif ( ( isEquirectMap && image && image.height > 0 ) || ( isCubeMap && image && isCubeTextureComplete( image ) ) ) {\n\n\t\t\t\t\t\t\tif ( pmremGenerator === null ) pmremGenerator = new PMREMGenerator( renderer );\n\n\t\t\t\t\t\t\trenderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular( texture ) : pmremGenerator.fromCubemap( texture );\n\t\t\t\t\t\t\trenderTarget.texture.pmremVersion = texture.pmremVersion;\n\n\t\t\t\t\t\t\tcubeUVmaps.set( texture, renderTarget );\n\n\t\t\t\t\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tfunction isCubeTextureComplete( image ) {\n\n\t\tlet count = 0;\n\t\tconst length = 6;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tif ( image[ i ] !== undefined ) count ++;\n\n\t\t}\n\n\t\treturn count === length;\n\n\n\t}\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tconst cubemapUV = cubeUVmaps.get( texture );\n\n\t\tif ( cubemapUV !== undefined ) {\n\n\t\t\tcubeUVmaps.delete( texture );\n\t\t\tcubemapUV.dispose();\n\n\t\t}\n\n\t}\n\n\tfunction dispose() {\n\n\t\tcubeUVmaps = new WeakMap();\n\n\t\tif ( pmremGenerator !== null ) {\n\n\t\t\tpmremGenerator.dispose();\n\t\t\tpmremGenerator = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLExtensions( gl ) {\n\n\tconst extensions = {};\n\n\tfunction getExtension( name ) {\n\n\t\tif ( extensions[ name ] !== undefined ) {\n\n\t\t\treturn extensions[ name ];\n\n\t\t}\n\n\t\tlet extension;\n\n\t\tswitch ( name ) {\n\n\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\textension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\textension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );\n\t\t\t\tbreak;\n\n\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\textension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\textension = gl.getExtension( name );\n\n\t\t}\n\n\t\textensions[ name ] = extension;\n\n\t\treturn extension;\n\n\t}\n\n\treturn {\n\n\t\thas: function ( name ) {\n\n\t\t\treturn getExtension( name ) !== null;\n\n\t\t},\n\n\t\tinit: function () {\n\n\t\t\tgetExtension( 'EXT_color_buffer_float' );\n\t\t\tgetExtension( 'WEBGL_clip_cull_distance' );\n\t\t\tgetExtension( 'OES_texture_float_linear' );\n\t\t\tgetExtension( 'EXT_color_buffer_half_float' );\n\t\t\tgetExtension( 'WEBGL_multisampled_render_to_texture' );\n\t\t\tgetExtension( 'WEBGL_render_shared_exponent' );\n\n\t\t},\n\n\t\tget: function ( name ) {\n\n\t\t\tconst extension = getExtension( name );\n\n\t\t\tif ( extension === null ) {\n\n\t\t\t\twarnOnce( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );\n\n\t\t\t}\n\n\t\t\treturn extension;\n\n\t\t}\n\n\t};\n\n}\n\nfunction WebGLGeometries( gl, attributes, info, bindingStates ) {\n\n\tconst geometries = {};\n\tconst wireframeAttributes = new WeakMap();\n\n\tfunction onGeometryDispose( event ) {\n\n\t\tconst geometry = event.target;\n\n\t\tif ( geometry.index !== null ) {\n\n\t\t\tattributes.remove( geometry.index );\n\n\t\t}\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tattributes.remove( geometry.attributes[ name ] );\n\n\t\t}\n\n\t\tgeometry.removeEventListener( 'dispose', onGeometryDispose );\n\n\t\tdelete geometries[ geometry.id ];\n\n\t\tconst attribute = wireframeAttributes.get( geometry );\n\n\t\tif ( attribute ) {\n\n\t\t\tattributes.remove( attribute );\n\t\t\twireframeAttributes.delete( geometry );\n\n\t\t}\n\n\t\tbindingStates.releaseStatesOfGeometry( geometry );\n\n\t\tif ( geometry.isInstancedBufferGeometry === true ) {\n\n\t\t\tdelete geometry._maxInstanceCount;\n\n\t\t}\n\n\t\t//\n\n\t\tinfo.memory.geometries --;\n\n\t}\n\n\tfunction get( object, geometry ) {\n\n\t\tif ( geometries[ geometry.id ] === true ) return geometry;\n\n\t\tgeometry.addEventListener( 'dispose', onGeometryDispose );\n\n\t\tgeometries[ geometry.id ] = true;\n\n\t\tinfo.memory.geometries ++;\n\n\t\treturn geometry;\n\n\t}\n\n\tfunction update( geometry ) {\n\n\t\tconst geometryAttributes = geometry.attributes;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\tfor ( const name in geometryAttributes ) {\n\n\t\t\tattributes.update( geometryAttributes[ name ], gl.ARRAY_BUFFER );\n\n\t\t}\n\n\t}\n\n\tfunction updateWireframeAttribute( geometry ) {\n\n\t\tconst indices = [];\n\n\t\tconst geometryIndex = geometry.index;\n\t\tconst geometryPosition = geometry.attributes.position;\n\t\tlet version = 0;\n\n\t\tif ( geometryIndex !== null ) {\n\n\t\t\tconst array = geometryIndex.array;\n\t\t\tversion = geometryIndex.version;\n\n\t\t\tfor ( let i = 0, l = array.length; i < l; i += 3 ) {\n\n\t\t\t\tconst a = array[ i + 0 ];\n\t\t\t\tconst b = array[ i + 1 ];\n\t\t\t\tconst c = array[ i + 2 ];\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else if ( geometryPosition !== undefined ) {\n\n\t\t\tconst array = geometryPosition.array;\n\t\t\tversion = geometryPosition.version;\n\n\t\t\tfor ( let i = 0, l = ( array.length / 3 ) - 1; i < l; i += 3 ) {\n\n\t\t\t\tconst a = i + 0;\n\t\t\t\tconst b = i + 1;\n\t\t\t\tconst c = i + 2;\n\n\t\t\t\tindices.push( a, b, b, c, c, a );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst attribute = new ( arrayNeedsUint32( indices ) ? Uint32BufferAttribute : Uint16BufferAttribute )( indices, 1 );\n\t\tattribute.version = version;\n\n\t\t// Updating index buffer in VAO now. See WebGLBindingStates\n\n\t\t//\n\n\t\tconst previousAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( previousAttribute ) attributes.remove( previousAttribute );\n\n\t\t//\n\n\t\twireframeAttributes.set( geometry, attribute );\n\n\t}\n\n\tfunction getWireframeAttribute( geometry ) {\n\n\t\tconst currentAttribute = wireframeAttributes.get( geometry );\n\n\t\tif ( currentAttribute ) {\n\n\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\tif ( geometryIndex !== null ) {\n\n\t\t\t\t// if the attribute is obsolete, create a new one\n\n\t\t\t\tif ( currentAttribute.version < geometryIndex.version ) {\n\n\t\t\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tupdateWireframeAttribute( geometry );\n\n\t\t}\n\n\t\treturn wireframeAttributes.get( geometry );\n\n\t}\n\n\treturn {\n\n\t\tget: get,\n\t\tupdate: update,\n\n\t\tgetWireframeAttribute: getWireframeAttribute\n\n\t};\n\n}\n\nfunction WebGLIndexedBufferRenderer( gl, extensions, info ) {\n\n\tlet mode;\n\n\tfunction setMode( value ) {\n\n\t\tmode = value;\n\n\t}\n\n\tlet type, bytesPerElement;\n\n\tfunction setIndex( value ) {\n\n\t\ttype = value.type;\n\t\tbytesPerElement = value.bytesPerElement;\n\n\t}\n\n\tfunction render( start, count ) {\n\n\t\tgl.drawElements( mode, count, type, start * bytesPerElement );\n\n\t\tinfo.update( count, mode, 1 );\n\n\t}\n\n\tfunction renderInstances( start, count, primcount ) {\n\n\t\tif ( primcount === 0 ) return;\n\n\t\tgl.drawElementsInstanced( mode, count, type, start * bytesPerElement, primcount );\n\n\t\tinfo.update( count, mode, primcount );\n\n\t}\n\n\tfunction renderMultiDraw( starts, counts, drawCount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\t\textension.multiDrawElementsWEBGL( mode, counts, 0, type, starts, 0, drawCount );\n\n\t\tlet elementCount = 0;\n\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\telementCount += counts[ i ];\n\n\t\t}\n\n\t\tinfo.update( elementCount, mode, 1 );\n\n\n\t}\n\n\tfunction renderMultiDrawInstances( starts, counts, drawCount, primcount ) {\n\n\t\tif ( drawCount === 0 ) return;\n\n\t\tconst extension = extensions.get( 'WEBGL_multi_draw' );\n\n\t\tif ( extension === null ) {\n\n\t\t\tfor ( let i = 0; i < starts.length; i ++ ) {\n\n\t\t\t\trenderInstances( starts[ i ] / bytesPerElement, counts[ i ], primcount[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\textension.multiDrawElementsInstancedWEBGL( mode, counts, 0, type, starts, 0, primcount, 0, drawCount );\n\n\t\t\tlet elementCount = 0;\n\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\telementCount += counts[ i ] * primcount[ i ];\n\n\t\t\t}\n\n\t\t\tinfo.update( elementCount, mode, 1 );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tthis.setMode = setMode;\n\tthis.setIndex = setIndex;\n\tthis.render = render;\n\tthis.renderInstances = renderInstances;\n\tthis.renderMultiDraw = renderMultiDraw;\n\tthis.renderMultiDrawInstances = renderMultiDrawInstances;\n\n}\n\nfunction WebGLInfo( gl ) {\n\n\tconst memory = {\n\t\tgeometries: 0,\n\t\ttextures: 0\n\t};\n\n\tconst render = {\n\t\tframe: 0,\n\t\tcalls: 0,\n\t\ttriangles: 0,\n\t\tpoints: 0,\n\t\tlines: 0\n\t};\n\n\tfunction update( count, mode, instanceCount ) {\n\n\t\trender.calls ++;\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase gl.TRIANGLES:\n\t\t\t\trender.triangles += instanceCount * ( count / 3 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINES:\n\t\t\t\trender.lines += instanceCount * ( count / 2 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_STRIP:\n\t\t\t\trender.lines += instanceCount * ( count - 1 );\n\t\t\t\tbreak;\n\n\t\t\tcase gl.LINE_LOOP:\n\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tcase gl.POINTS:\n\t\t\t\trender.points += instanceCount * count;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.error( 'THREE.WebGLInfo: Unknown draw mode:', mode );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\tfunction reset() {\n\n\t\trender.calls = 0;\n\t\trender.triangles = 0;\n\t\trender.points = 0;\n\t\trender.lines = 0;\n\n\t}\n\n\treturn {\n\t\tmemory: memory,\n\t\trender: render,\n\t\tprograms: null,\n\t\tautoReset: true,\n\t\treset: reset,\n\t\tupdate: update\n\t};\n\n}\n\nfunction WebGLMorphtargets( gl, capabilities, textures ) {\n\n\tconst morphTextures = new WeakMap();\n\tconst morph = new Vector4();\n\n\tfunction update( object, geometry, program ) {\n\n\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\t// the following encodes morph targets into an array of data textures. Each layer represents a single morph target.\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet entry = morphTextures.get( geometry );\n\n\t\tif ( entry === undefined || entry.count !== morphTargetsCount ) {\n\n\t\t\tif ( entry !== undefined ) entry.texture.dispose();\n\n\t\t\tconst hasMorphPosition = geometry.morphAttributes.position !== undefined;\n\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\t\t\tconst hasMorphColors = geometry.morphAttributes.color !== undefined;\n\n\t\t\tconst morphTargets = geometry.morphAttributes.position || [];\n\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\t\t\tconst morphColors = geometry.morphAttributes.color || [];\n\n\t\t\tlet vertexDataCount = 0;\n\n\t\t\tif ( hasMorphPosition === true ) vertexDataCount = 1;\n\t\t\tif ( hasMorphNormals === true ) vertexDataCount = 2;\n\t\t\tif ( hasMorphColors === true ) vertexDataCount = 3;\n\n\t\t\tlet width = geometry.attributes.position.count * vertexDataCount;\n\t\t\tlet height = 1;\n\n\t\t\tif ( width > capabilities.maxTextureSize ) {\n\n\t\t\t\theight = Math.ceil( width / capabilities.maxTextureSize );\n\t\t\t\twidth = capabilities.maxTextureSize;\n\n\t\t\t}\n\n\t\t\tconst buffer = new Float32Array( width * height * 4 * morphTargetsCount );\n\n\t\t\tconst texture = new DataArrayTexture( buffer, width, height, morphTargetsCount );\n\t\t\ttexture.type = FloatType;\n\t\t\ttexture.needsUpdate = true;\n\n\t\t\t// fill buffer\n\n\t\t\tconst vertexDataStride = vertexDataCount * 4;\n\n\t\t\tfor ( let i = 0; i < morphTargetsCount; i ++ ) {\n\n\t\t\t\tconst morphTarget = morphTargets[ i ];\n\t\t\t\tconst morphNormal = morphNormals[ i ];\n\t\t\t\tconst morphColor = morphColors[ i ];\n\n\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\tfor ( let j = 0; j < morphTarget.count; j ++ ) {\n\n\t\t\t\t\tconst stride = j * vertexDataStride;\n\n\t\t\t\t\tif ( hasMorphPosition === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphTarget, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 0 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 1 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 2 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 3 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphNormals === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphNormal, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 4 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 5 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 6 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 7 ] = 0;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( hasMorphColors === true ) {\n\n\t\t\t\t\t\tmorph.fromBufferAttribute( morphColor, j );\n\n\t\t\t\t\t\tbuffer[ offset + stride + 8 ] = morph.x;\n\t\t\t\t\t\tbuffer[ offset + stride + 9 ] = morph.y;\n\t\t\t\t\t\tbuffer[ offset + stride + 10 ] = morph.z;\n\t\t\t\t\t\tbuffer[ offset + stride + 11 ] = ( morphColor.itemSize === 4 ) ? morph.w : 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tentry = {\n\t\t\t\tcount: morphTargetsCount,\n\t\t\t\ttexture: texture,\n\t\t\t\tsize: new Vector2( width, height )\n\t\t\t};\n\n\t\t\tmorphTextures.set( geometry, entry );\n\n\t\t\tfunction disposeTexture() {\n\n\t\t\t\ttexture.dispose();\n\n\t\t\t\tmorphTextures.delete( geometry );\n\n\t\t\t\tgeometry.removeEventListener( 'dispose', disposeTexture );\n\n\t\t\t}\n\n\t\t\tgeometry.addEventListener( 'dispose', disposeTexture );\n\n\t\t}\n\n\t\t//\n\t\tif ( object.isInstancedMesh === true && object.morphTexture !== null ) {\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );\n\n\t\t} else {\n\n\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\tfor ( let i = 0; i < objectInfluences.length; i ++ ) {\n\n\t\t\t\tmorphInfluencesSum += objectInfluences[ i ];\n\n\t\t\t}\n\n\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\n\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );\n\t\t\tprogram.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );\n\n\t\t}\n\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );\n\t\tprogram.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update\n\n\t};\n\n}\n\nfunction WebGLObjects( gl, geometries, attributes, info ) {\n\n\tlet updateMap = new WeakMap();\n\n\tfunction update( object ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\tconst geometry = object.geometry;\n\t\tconst buffergeometry = geometries.get( object, geometry );\n\n\t\t// Update once per frame\n\n\t\tif ( updateMap.get( buffergeometry ) !== frame ) {\n\n\t\t\tgeometries.update( buffergeometry );\n\n\t\t\tupdateMap.set( buffergeometry, frame );\n\n\t\t}\n\n\t\tif ( object.isInstancedMesh ) {\n\n\t\t\tif ( object.hasEventListener( 'dispose', onInstancedMeshDispose ) === false ) {\n\n\t\t\t\tobject.addEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\t\t}\n\n\t\t\tif ( updateMap.get( object ) !== frame ) {\n\n\t\t\t\tattributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );\n\n\t\t\t\tif ( object.instanceColor !== null ) {\n\n\t\t\t\t\tattributes.update( object.instanceColor, gl.ARRAY_BUFFER );\n\n\t\t\t\t}\n\n\t\t\t\tupdateMap.set( object, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\tconst skeleton = object.skeleton;\n\n\t\t\tif ( updateMap.get( skeleton ) !== frame ) {\n\n\t\t\t\tskeleton.update();\n\n\t\t\t\tupdateMap.set( skeleton, frame );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn buffergeometry;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tupdateMap = new WeakMap();\n\n\t}\n\n\tfunction onInstancedMeshDispose( event ) {\n\n\t\tconst instancedMesh = event.target;\n\n\t\tinstancedMesh.removeEventListener( 'dispose', onInstancedMeshDispose );\n\n\t\tattributes.remove( instancedMesh.instanceMatrix );\n\n\t\tif ( instancedMesh.instanceColor !== null ) attributes.remove( instancedMesh.instanceColor );\n\n\t}\n\n\treturn {\n\n\t\tupdate: update,\n\t\tdispose: dispose\n\n\t};\n\n}\n\n/**\n * Uniforms of a program.\n * Those form a tree structure with a special top-level container for the root,\n * which you get by calling 'new WebGLUniforms( gl, program )'.\n *\n *\n * Properties of inner nodes including the top-level container:\n *\n * .seq - array of nested uniforms\n * .map - nested uniforms by name\n *\n *\n * Methods of all nodes except the top-level container:\n *\n * .setValue( gl, value, [textures] )\n *\n * \t\tuploads a uniform value(s)\n *  \tthe 'textures' parameter is needed for sampler uniforms\n *\n *\n * Static methods of the top-level container (textures factorizations):\n *\n * .upload( gl, seq, values, textures )\n *\n * \t\tsets uniforms in 'seq' to 'values[id].value'\n *\n * .seqWithValue( seq, values ) : filteredSeq\n *\n * \t\tfilters 'seq' entries with corresponding entry in values\n *\n *\n * Methods of the top-level container (textures factorizations):\n *\n * .setValue( gl, name, value, textures )\n *\n * \t\tsets uniform with  name 'name' to 'value'\n *\n * .setOptional( gl, obj, prop )\n *\n * \t\tlike .set for an optional property of the object\n *\n */\n\n\nconst emptyTexture = /*@__PURE__*/ new Texture();\n\nconst emptyShadowTexture = /*@__PURE__*/ new DepthTexture( 1, 1 );\n\nconst emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();\nconst empty3dTexture = /*@__PURE__*/ new Data3DTexture();\nconst emptyCubeTexture = /*@__PURE__*/ new CubeTexture();\n\n// --- Utilities ---\n\n// Array Caches (provide typed arrays for temporary by size)\n\nconst arrayCacheF32 = [];\nconst arrayCacheI32 = [];\n\n// Float32Array caches used for uploading Matrix uniforms\n\nconst mat4array = new Float32Array( 16 );\nconst mat3array = new Float32Array( 9 );\nconst mat2array = new Float32Array( 4 );\n\n// Flattening for arrays of vectors and matrices\n\nfunction flatten( array, nBlocks, blockSize ) {\n\n\tconst firstElem = array[ 0 ];\n\n\tif ( firstElem <= 0 || firstElem > 0 ) return array;\n\t// unoptimized: ! isNaN( firstElem )\n\t// see http://jacksondunstan.com/articles/983\n\n\tconst n = nBlocks * blockSize;\n\tlet r = arrayCacheF32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Float32Array( n );\n\t\tarrayCacheF32[ n ] = r;\n\n\t}\n\n\tif ( nBlocks !== 0 ) {\n\n\t\tfirstElem.toArray( r, 0 );\n\n\t\tfor ( let i = 1, offset = 0; i !== nBlocks; ++ i ) {\n\n\t\t\toffset += blockSize;\n\t\t\tarray[ i ].toArray( r, offset );\n\n\t\t}\n\n\t}\n\n\treturn r;\n\n}\n\nfunction arraysEqual( a, b ) {\n\n\tif ( a.length !== b.length ) return false;\n\n\tfor ( let i = 0, l = a.length; i < l; i ++ ) {\n\n\t\tif ( a[ i ] !== b[ i ] ) return false;\n\n\t}\n\n\treturn true;\n\n}\n\nfunction copyArray( a, b ) {\n\n\tfor ( let i = 0, l = b.length; i < l; i ++ ) {\n\n\t\ta[ i ] = b[ i ];\n\n\t}\n\n}\n\n// Texture unit allocation\n\nfunction allocTexUnits( textures, n ) {\n\n\tlet r = arrayCacheI32[ n ];\n\n\tif ( r === undefined ) {\n\n\t\tr = new Int32Array( n );\n\t\tarrayCacheI32[ n ] = r;\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\tr[ i ] = textures.allocateTextureUnit();\n\n\t}\n\n\treturn r;\n\n}\n\n// --- Setters ---\n\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n\n// Single scalar\n\nfunction setValueV1f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1f( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single float vector (from flat array or THREE.VectorN)\n\nfunction setValueV2f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2f( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3f( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else if ( v.r !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.r || cache[ 1 ] !== v.g || cache[ 2 ] !== v.b ) {\n\n\t\t\tgl.uniform3f( this.addr, v.r, v.g, v.b );\n\n\t\t\tcache[ 0 ] = v.r;\n\t\t\tcache[ 1 ] = v.g;\n\t\t\tcache[ 2 ] = v.b;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4f( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4f( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4fv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single matrix (from flat array or THREE.MatrixN)\n\nfunction setValueM2( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix2fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat2array.set( elements );\n\n\t\tgl.uniformMatrix2fv( this.addr, false, mat2array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM3( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix3fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat3array.set( elements );\n\n\t\tgl.uniformMatrix3fv( this.addr, false, mat3array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\nfunction setValueM4( gl, v ) {\n\n\tconst cache = this.cache;\n\tconst elements = v.elements;\n\n\tif ( elements === undefined ) {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniformMatrix4fv( this.addr, false, v );\n\n\t\tcopyArray( cache, v );\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, elements ) ) return;\n\n\t\tmat4array.set( elements );\n\n\t\tgl.uniformMatrix4fv( this.addr, false, mat4array );\n\n\t\tcopyArray( cache, elements );\n\n\t}\n\n}\n\n// Single integer / boolean\n\nfunction setValueV1i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1i( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single integer / boolean vector (from flat array or THREE.VectorN)\n\nfunction setValueV2i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2i( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3i( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4i( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4i( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4iv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n// Single unsigned integer\n\nfunction setValueV1ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( cache[ 0 ] === v ) return;\n\n\tgl.uniform1ui( this.addr, v );\n\n\tcache[ 0 ] = v;\n\n}\n\n// Single unsigned integer vector (from flat array or THREE.VectorN)\n\nfunction setValueV2ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {\n\n\t\t\tgl.uniform2ui( this.addr, v.x, v.y );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform2uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV3ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {\n\n\t\t\tgl.uniform3ui( this.addr, v.x, v.y, v.z );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform3uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\nfunction setValueV4ui( gl, v ) {\n\n\tconst cache = this.cache;\n\n\tif ( v.x !== undefined ) {\n\n\t\tif ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {\n\n\t\t\tgl.uniform4ui( this.addr, v.x, v.y, v.z, v.w );\n\n\t\t\tcache[ 0 ] = v.x;\n\t\t\tcache[ 1 ] = v.y;\n\t\t\tcache[ 2 ] = v.z;\n\t\t\tcache[ 3 ] = v.w;\n\n\t\t}\n\n\t} else {\n\n\t\tif ( arraysEqual( cache, v ) ) return;\n\n\t\tgl.uniform4uiv( this.addr, v );\n\n\t\tcopyArray( cache, v );\n\n\t}\n\n}\n\n\n// Single texture (2D / Cube)\n\nfunction setValueT1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\tlet emptyTexture2D;\n\n\tif ( this.type === gl.SAMPLER_2D_SHADOW ) {\n\n\t\temptyShadowTexture.compareFunction = LessEqualCompare; // #28670\n\t\temptyTexture2D = emptyShadowTexture;\n\n\t} else {\n\n\t\temptyTexture2D = emptyTexture;\n\n\t}\n\n\ttextures.setTexture2D( v || emptyTexture2D, unit );\n\n}\n\nfunction setValueT3D1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture3D( v || empty3dTexture, unit );\n\n}\n\nfunction setValueT6( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTextureCube( v || emptyCubeTexture, unit );\n\n}\n\nfunction setValueT2DArray1( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\tconst unit = textures.allocateTextureUnit();\n\n\tif ( cache[ 0 ] !== unit ) {\n\n\t\tgl.uniform1i( this.addr, unit );\n\t\tcache[ 0 ] = unit;\n\n\t}\n\n\ttextures.setTexture2DArray( v || emptyArrayTexture, unit );\n\n}\n\n// Helper to pick the right setter for the singular case\n\nfunction getSingularSetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1f; // FLOAT\n\t\tcase 0x8b50: return setValueV2f; // _VEC2\n\t\tcase 0x8b51: return setValueV3f; // _VEC3\n\t\tcase 0x8b52: return setValueV4f; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2; // _MAT2\n\t\tcase 0x8b5b: return setValueM3; // _MAT3\n\t\tcase 0x8b5c: return setValueM4; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1i; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2i; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3i; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4i; // _VEC4\n\n\t\tcase 0x1405: return setValueV1ui; // UINT\n\t\tcase 0x8dc6: return setValueV2ui; // _VEC2\n\t\tcase 0x8dc7: return setValueV3ui; // _VEC3\n\t\tcase 0x8dc8: return setValueV4ui; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3D1;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArray1;\n\n\t}\n\n}\n\n\n// Array of scalars\n\nfunction setValueV1fArray( gl, v ) {\n\n\tgl.uniform1fv( this.addr, v );\n\n}\n\n// Array of vectors (from flat array or array of THREE.VectorN)\n\nfunction setValueV2fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 2 );\n\n\tgl.uniform2fv( this.addr, data );\n\n}\n\nfunction setValueV3fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 3 );\n\n\tgl.uniform3fv( this.addr, data );\n\n}\n\nfunction setValueV4fArray( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniform4fv( this.addr, data );\n\n}\n\n// Array of matrices (from flat array or array of THREE.MatrixN)\n\nfunction setValueM2Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 4 );\n\n\tgl.uniformMatrix2fv( this.addr, false, data );\n\n}\n\nfunction setValueM3Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 9 );\n\n\tgl.uniformMatrix3fv( this.addr, false, data );\n\n}\n\nfunction setValueM4Array( gl, v ) {\n\n\tconst data = flatten( v, this.size, 16 );\n\n\tgl.uniformMatrix4fv( this.addr, false, data );\n\n}\n\n// Array of integer / boolean\n\nfunction setValueV1iArray( gl, v ) {\n\n\tgl.uniform1iv( this.addr, v );\n\n}\n\n// Array of integer / boolean vectors (from flat array)\n\nfunction setValueV2iArray( gl, v ) {\n\n\tgl.uniform2iv( this.addr, v );\n\n}\n\nfunction setValueV3iArray( gl, v ) {\n\n\tgl.uniform3iv( this.addr, v );\n\n}\n\nfunction setValueV4iArray( gl, v ) {\n\n\tgl.uniform4iv( this.addr, v );\n\n}\n\n// Array of unsigned integer\n\nfunction setValueV1uiArray( gl, v ) {\n\n\tgl.uniform1uiv( this.addr, v );\n\n}\n\n// Array of unsigned integer vectors (from flat array)\n\nfunction setValueV2uiArray( gl, v ) {\n\n\tgl.uniform2uiv( this.addr, v );\n\n}\n\nfunction setValueV3uiArray( gl, v ) {\n\n\tgl.uniform3uiv( this.addr, v );\n\n}\n\nfunction setValueV4uiArray( gl, v ) {\n\n\tgl.uniform4uiv( this.addr, v );\n\n}\n\n\n// Array of textures (2D / 3D / Cube / 2DArray)\n\nfunction setValueT1Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2D( v[ i ] || emptyTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT3DArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture3D( v[ i ] || empty3dTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT6Array( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );\n\n\t}\n\n}\n\nfunction setValueT2DArrayArray( gl, v, textures ) {\n\n\tconst cache = this.cache;\n\n\tconst n = v.length;\n\n\tconst units = allocTexUnits( textures, n );\n\n\tif ( ! arraysEqual( cache, units ) ) {\n\n\t\tgl.uniform1iv( this.addr, units );\n\n\t\tcopyArray( cache, units );\n\n\t}\n\n\tfor ( let i = 0; i !== n; ++ i ) {\n\n\t\ttextures.setTexture2DArray( v[ i ] || emptyArrayTexture, units[ i ] );\n\n\t}\n\n}\n\n\n// Helper to pick the right setter for a pure (bottom-level) array\n\nfunction getPureArraySetter( type ) {\n\n\tswitch ( type ) {\n\n\t\tcase 0x1406: return setValueV1fArray; // FLOAT\n\t\tcase 0x8b50: return setValueV2fArray; // _VEC2\n\t\tcase 0x8b51: return setValueV3fArray; // _VEC3\n\t\tcase 0x8b52: return setValueV4fArray; // _VEC4\n\n\t\tcase 0x8b5a: return setValueM2Array; // _MAT2\n\t\tcase 0x8b5b: return setValueM3Array; // _MAT3\n\t\tcase 0x8b5c: return setValueM4Array; // _MAT4\n\n\t\tcase 0x1404: case 0x8b56: return setValueV1iArray; // INT, BOOL\n\t\tcase 0x8b53: case 0x8b57: return setValueV2iArray; // _VEC2\n\t\tcase 0x8b54: case 0x8b58: return setValueV3iArray; // _VEC3\n\t\tcase 0x8b55: case 0x8b59: return setValueV4iArray; // _VEC4\n\n\t\tcase 0x1405: return setValueV1uiArray; // UINT\n\t\tcase 0x8dc6: return setValueV2uiArray; // _VEC2\n\t\tcase 0x8dc7: return setValueV3uiArray; // _VEC3\n\t\tcase 0x8dc8: return setValueV4uiArray; // _VEC4\n\n\t\tcase 0x8b5e: // SAMPLER_2D\n\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\t\tcase 0x8dca: // INT_SAMPLER_2D\n\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\t\tcase 0x8b62: // SAMPLER_2D_SHADOW\n\t\t\treturn setValueT1Array;\n\n\t\tcase 0x8b5f: // SAMPLER_3D\n\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\t\tcase 0x8dd3: // UNSIGNED_INT_SAMPLER_3D\n\t\t\treturn setValueT3DArray;\n\n\t\tcase 0x8b60: // SAMPLER_CUBE\n\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\t\tcase 0x8dc5: // SAMPLER_CUBE_SHADOW\n\t\t\treturn setValueT6Array;\n\n\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\t\tcase 0x8dc4: // SAMPLER_2D_ARRAY_SHADOW\n\t\t\treturn setValueT2DArrayArray;\n\n\t}\n\n}\n\n// --- Uniform Classes ---\n\nclass SingleUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.setValue = getSingularSetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass PureArrayUniform {\n\n\tconstructor( id, activeInfo, addr ) {\n\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.type = activeInfo.type;\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter( activeInfo.type );\n\n\t\t// this.path = activeInfo.name; // DEBUG\n\n\t}\n\n}\n\nclass StructuredUniform {\n\n\tconstructor( id ) {\n\n\t\tthis.id = id;\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t}\n\n\tsetValue( gl, value, textures ) {\n\n\t\tconst seq = this.seq;\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tu.setValue( gl, value[ u.id ], textures );\n\n\t\t}\n\n\t}\n\n}\n\n// --- Top-level ---\n\n// Parser - builds up the property tree from the path strings\n\nconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g;\n\n// extracts\n// \t- the identifier (member name or array index)\n//  - followed by an optional right bracket (found when array index)\n//  - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\n\nfunction addUniform( container, uniformObject ) {\n\n\tcontainer.seq.push( uniformObject );\n\tcontainer.map[ uniformObject.id ] = uniformObject;\n\n}\n\nfunction parseUniform( activeInfo, addr, container ) {\n\n\tconst path = activeInfo.name,\n\t\tpathLength = path.length;\n\n\t// reset RegExp object, because of the early exit of a previous run\n\tRePathPart.lastIndex = 0;\n\n\twhile ( true ) {\n\n\t\tconst match = RePathPart.exec( path ),\n\t\t\tmatchEnd = RePathPart.lastIndex;\n\n\t\tlet id = match[ 1 ];\n\t\tconst idIsIndex = match[ 2 ] === ']',\n\t\t\tsubscript = match[ 3 ];\n\n\t\tif ( idIsIndex ) id = id | 0; // convert to integer\n\n\t\tif ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) {\n\n\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\n\t\t\taddUniform( container, subscript === undefined ?\n\t\t\t\tnew SingleUniform( id, activeInfo, addr ) :\n\t\t\t\tnew PureArrayUniform( id, activeInfo, addr ) );\n\n\t\t\tbreak;\n\n\t\t} else {\n\n\t\t\t// step into inner node / create it in case it doesn't exist\n\n\t\t\tconst map = container.map;\n\t\t\tlet next = map[ id ];\n\n\t\t\tif ( next === undefined ) {\n\n\t\t\t\tnext = new StructuredUniform( id );\n\t\t\t\taddUniform( container, next );\n\n\t\t\t}\n\n\t\t\tcontainer = next;\n\n\t\t}\n\n\t}\n\n}\n\n// Root Container\n\nclass WebGLUniforms {\n\n\tconstructor( gl, program ) {\n\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\n\t\tconst n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );\n\n\t\tfor ( let i = 0; i < n; ++ i ) {\n\n\t\t\tconst info = gl.getActiveUniform( program, i ),\n\t\t\t\taddr = gl.getUniformLocation( program, info.name );\n\n\t\t\tparseUniform( info, addr, this );\n\n\t\t}\n\n\t}\n\n\tsetValue( gl, name, value, textures ) {\n\n\t\tconst u = this.map[ name ];\n\n\t\tif ( u !== undefined ) u.setValue( gl, value, textures );\n\n\t}\n\n\tsetOptional( gl, object, name ) {\n\n\t\tconst v = object[ name ];\n\n\t\tif ( v !== undefined ) this.setValue( gl, name, v );\n\n\t}\n\n\tstatic upload( gl, seq, values, textures ) {\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ],\n\t\t\t\tv = values[ u.id ];\n\n\t\t\tif ( v.needsUpdate !== false ) {\n\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\t\tu.setValue( gl, v.value, textures );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tstatic seqWithValue( seq, values ) {\n\n\t\tconst r = [];\n\n\t\tfor ( let i = 0, n = seq.length; i !== n; ++ i ) {\n\n\t\t\tconst u = seq[ i ];\n\t\t\tif ( u.id in values ) r.push( u );\n\n\t\t}\n\n\t\treturn r;\n\n\t}\n\n}\n\nfunction WebGLShader( gl, type, string ) {\n\n\tconst shader = gl.createShader( type );\n\n\tgl.shaderSource( shader, string );\n\tgl.compileShader( shader );\n\n\treturn shader;\n\n}\n\n// From https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/\nconst COMPLETION_STATUS_KHR = 0x91B1;\n\nlet programIdCount = 0;\n\nfunction handleSource( string, errorLine ) {\n\n\tconst lines = string.split( '\\n' );\n\tconst lines2 = [];\n\n\tconst from = Math.max( errorLine - 6, 0 );\n\tconst to = Math.min( errorLine + 6, lines.length );\n\n\tfor ( let i = from; i < to; i ++ ) {\n\n\t\tconst line = i + 1;\n\t\tlines2.push( `${line === errorLine ? '>' : ' '} ${line}: ${lines[ i ]}` );\n\n\t}\n\n\treturn lines2.join( '\\n' );\n\n}\n\nconst _m0 = /*@__PURE__*/ new Matrix3();\n\nfunction getEncodingComponents( colorSpace ) {\n\n\tColorManagement._getMatrix( _m0, ColorManagement.workingColorSpace, colorSpace );\n\n\tconst encodingMatrix = `mat3( ${ _m0.elements.map( ( v ) => v.toFixed( 4 ) ) } )`;\n\n\tswitch ( ColorManagement.getTransfer( colorSpace ) ) {\n\n\t\tcase LinearTransfer:\n\t\t\treturn [ encodingMatrix, 'LinearTransferOETF' ];\n\n\t\tcase SRGBTransfer:\n\t\t\treturn [ encodingMatrix, 'sRGBTransferOETF' ];\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported color space: ', colorSpace );\n\t\t\treturn [ encodingMatrix, 'LinearTransferOETF' ];\n\n\t}\n\n}\n\nfunction getShaderErrors( gl, shader, type ) {\n\n\tconst status = gl.getShaderParameter( shader, gl.COMPILE_STATUS );\n\n\tconst shaderInfoLog = gl.getShaderInfoLog( shader ) || '';\n\tconst errors = shaderInfoLog.trim();\n\n\tif ( status && errors === '' ) return '';\n\n\tconst errorMatches = /ERROR: 0:(\\d+)/.exec( errors );\n\tif ( errorMatches ) {\n\n\t\t// --enable-privileged-webgl-extension\n\t\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\tconst errorLine = parseInt( errorMatches[ 1 ] );\n\t\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + handleSource( gl.getShaderSource( shader ), errorLine );\n\n\t} else {\n\n\t\treturn errors;\n\n\t}\n\n}\n\nfunction getTexelEncodingFunction( functionName, colorSpace ) {\n\n\tconst components = getEncodingComponents( colorSpace );\n\n\treturn [\n\n\t\t`vec4 ${functionName}( vec4 value ) {`,\n\n\t\t`\treturn ${components[ 1 ]}( vec4( value.rgb * ${components[ 0 ]}, value.a ) );`,\n\n\t\t'}',\n\n\t].join( '\\n' );\n\n}\n\nfunction getToneMappingFunction( functionName, toneMapping ) {\n\n\tlet toneMappingName;\n\n\tswitch ( toneMapping ) {\n\n\t\tcase LinearToneMapping:\n\t\t\ttoneMappingName = 'Linear';\n\t\t\tbreak;\n\n\t\tcase ReinhardToneMapping:\n\t\t\ttoneMappingName = 'Reinhard';\n\t\t\tbreak;\n\n\t\tcase CineonToneMapping:\n\t\t\ttoneMappingName = 'Cineon';\n\t\t\tbreak;\n\n\t\tcase ACESFilmicToneMapping:\n\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\tbreak;\n\n\t\tcase AgXToneMapping:\n\t\t\ttoneMappingName = 'AgX';\n\t\t\tbreak;\n\n\t\tcase NeutralToneMapping:\n\t\t\ttoneMappingName = 'Neutral';\n\t\t\tbreak;\n\n\t\tcase CustomToneMapping:\n\t\t\ttoneMappingName = 'Custom';\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconsole.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );\n\t\t\ttoneMappingName = 'Linear';\n\n\t}\n\n\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\n}\n\nconst _v0 = /*@__PURE__*/ new Vector3();\n\nfunction getLuminanceFunction() {\n\n\tColorManagement.getLuminanceCoefficients( _v0 );\n\n\tconst r = _v0.x.toFixed( 4 );\n\tconst g = _v0.y.toFixed( 4 );\n\tconst b = _v0.z.toFixed( 4 );\n\n\treturn [\n\n\t\t'float luminance( const in vec3 rgb ) {',\n\n\t\t`\tconst vec3 weights = vec3( ${ r }, ${ g }, ${ b } );`,\n\n\t\t'\treturn dot( weights, rgb );',\n\n\t\t'}'\n\n\t].join( '\\n' );\n\n}\n\nfunction generateVertexExtensions( parameters ) {\n\n\tconst chunks = [\n\t\tparameters.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : '',\n\t\tparameters.extensionMultiDraw ? '#extension GL_ANGLE_multi_draw : require' : '',\n\t];\n\n\treturn chunks.filter( filterEmptyLine ).join( '\\n' );\n\n}\n\nfunction generateDefines( defines ) {\n\n\tconst chunks = [];\n\n\tfor ( const name in defines ) {\n\n\t\tconst value = defines[ name ];\n\n\t\tif ( value === false ) continue;\n\n\t\tchunks.push( '#define ' + name + ' ' + value );\n\n\t}\n\n\treturn chunks.join( '\\n' );\n\n}\n\nfunction fetchAttributeLocations( gl, program ) {\n\n\tconst attributes = {};\n\n\tconst n = gl.getProgramParameter( program, gl.ACTIVE_ATTRIBUTES );\n\n\tfor ( let i = 0; i < n; i ++ ) {\n\n\t\tconst info = gl.getActiveAttrib( program, i );\n\t\tconst name = info.name;\n\n\t\tlet locationSize = 1;\n\t\tif ( info.type === gl.FLOAT_MAT2 ) locationSize = 2;\n\t\tif ( info.type === gl.FLOAT_MAT3 ) locationSize = 3;\n\t\tif ( info.type === gl.FLOAT_MAT4 ) locationSize = 4;\n\n\t\t// console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\tattributes[ name ] = {\n\t\t\ttype: info.type,\n\t\t\tlocation: gl.getAttribLocation( program, name ),\n\t\t\tlocationSize: locationSize\n\t\t};\n\n\t}\n\n\treturn attributes;\n\n}\n\nfunction filterEmptyLine( string ) {\n\n\treturn string !== '';\n\n}\n\nfunction replaceLightNums( string, parameters ) {\n\n\tconst numSpotLightCoords = parameters.numSpotLightShadows + parameters.numSpotLightMaps - parameters.numSpotLightShadowsWithMaps;\n\n\treturn string\n\t\t.replace( /NUM_DIR_LIGHTS/g, parameters.numDirLights )\n\t\t.replace( /NUM_SPOT_LIGHTS/g, parameters.numSpotLights )\n\t\t.replace( /NUM_SPOT_LIGHT_MAPS/g, parameters.numSpotLightMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_COORDS/g, numSpotLightCoords )\n\t\t.replace( /NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights )\n\t\t.replace( /NUM_POINT_LIGHTS/g, parameters.numPointLights )\n\t\t.replace( /NUM_HEMI_LIGHTS/g, parameters.numHemiLights )\n\t\t.replace( /NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g, parameters.numSpotLightShadowsWithMaps )\n\t\t.replace( /NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows )\n\t\t.replace( /NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows );\n\n}\n\nfunction replaceClippingPlaneNums( string, parameters ) {\n\n\treturn string\n\t\t.replace( /NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes )\n\t\t.replace( /UNION_CLIPPING_PLANES/g, ( parameters.numClippingPlanes - parameters.numClipIntersection ) );\n\n}\n\n// Resolve Includes\n\nconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\nfunction resolveIncludes( string ) {\n\n\treturn string.replace( includePattern, includeReplacer );\n\n}\n\nconst shaderChunkMap = new Map();\n\nfunction includeReplacer( match, include ) {\n\n\tlet string = ShaderChunk[ include ];\n\n\tif ( string === undefined ) {\n\n\t\tconst newInclude = shaderChunkMap.get( include );\n\n\t\tif ( newInclude !== undefined ) {\n\n\t\t\tstring = ShaderChunk[ newInclude ];\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Shader chunk \"%s\" has been deprecated. Use \"%s\" instead.', include, newInclude );\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Can not resolve #include <' + include + '>' );\n\n\t\t}\n\n\t}\n\n\treturn resolveIncludes( string );\n\n}\n\n// Unroll Loops\n\nconst unrollLoopPattern = /#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;\n\nfunction unrollLoops( string ) {\n\n\treturn string.replace( unrollLoopPattern, loopReplacer );\n\n}\n\nfunction loopReplacer( match, start, end, snippet ) {\n\n\tlet string = '';\n\n\tfor ( let i = parseInt( start ); i < parseInt( end ); i ++ ) {\n\n\t\tstring += snippet\n\t\t\t.replace( /\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]' )\n\t\t\t.replace( /UNROLLED_LOOP_INDEX/g, i );\n\n\t}\n\n\treturn string;\n\n}\n\n//\n\nfunction generatePrecision( parameters ) {\n\n\tlet precisionstring = `precision ${parameters.precision} float;\n\tprecision ${parameters.precision} int;\n\tprecision ${parameters.precision} sampler2D;\n\tprecision ${parameters.precision} samplerCube;\n\tprecision ${parameters.precision} sampler3D;\n\tprecision ${parameters.precision} sampler2DArray;\n\tprecision ${parameters.precision} sampler2DShadow;\n\tprecision ${parameters.precision} samplerCubeShadow;\n\tprecision ${parameters.precision} sampler2DArrayShadow;\n\tprecision ${parameters.precision} isampler2D;\n\tprecision ${parameters.precision} isampler3D;\n\tprecision ${parameters.precision} isamplerCube;\n\tprecision ${parameters.precision} isampler2DArray;\n\tprecision ${parameters.precision} usampler2D;\n\tprecision ${parameters.precision} usampler3D;\n\tprecision ${parameters.precision} usamplerCube;\n\tprecision ${parameters.precision} usampler2DArray;\n\t`;\n\n\tif ( parameters.precision === 'highp' ) {\n\n\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\n\t} else if ( parameters.precision === 'mediump' ) {\n\n\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\n\t} else if ( parameters.precision === 'lowp' ) {\n\n\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\n\t}\n\n\treturn precisionstring;\n\n}\n\nfunction generateShadowMapTypeDefine( parameters ) {\n\n\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\tif ( parameters.shadowMapType === PCFShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\n\t} else if ( parameters.shadowMapType === PCFSoftShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\n\t} else if ( parameters.shadowMapType === VSMShadowMap ) {\n\n\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\n\t}\n\n\treturn shadowMapTypeDefine;\n\n}\n\nfunction generateEnvMapTypeDefine( parameters ) {\n\n\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeReflectionMapping:\n\t\t\tcase CubeRefractionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\tbreak;\n\n\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapTypeDefine;\n\n}\n\nfunction generateEnvMapModeDefine( parameters ) {\n\n\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.envMapMode ) {\n\n\t\t\tcase CubeRefractionMapping:\n\n\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapModeDefine;\n\n}\n\nfunction generateEnvMapBlendingDefine( parameters ) {\n\n\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\tif ( parameters.envMap ) {\n\n\t\tswitch ( parameters.combine ) {\n\n\t\t\tcase MultiplyOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\tbreak;\n\n\t\t\tcase MixOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\tbreak;\n\n\t\t\tcase AddOperation:\n\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}\n\n\treturn envMapBlendingDefine;\n\n}\n\nfunction generateCubeUVSize( parameters ) {\n\n\tconst imageHeight = parameters.envMapCubeUVHeight;\n\n\tif ( imageHeight === null ) return null;\n\n\tconst maxMip = Math.log2( imageHeight ) - 2;\n\n\tconst texelHeight = 1.0 / imageHeight;\n\n\tconst texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) );\n\n\treturn { texelWidth, texelHeight, maxMip };\n\n}\n\nfunction WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {\n\n\t// TODO Send this event to Three.js DevTools\n\t// console.log( 'WebGLProgram', cacheKey );\n\n\tconst gl = renderer.getContext();\n\n\tconst defines = parameters.defines;\n\n\tlet vertexShader = parameters.vertexShader;\n\tlet fragmentShader = parameters.fragmentShader;\n\n\tconst shadowMapTypeDefine = generateShadowMapTypeDefine( parameters );\n\tconst envMapTypeDefine = generateEnvMapTypeDefine( parameters );\n\tconst envMapModeDefine = generateEnvMapModeDefine( parameters );\n\tconst envMapBlendingDefine = generateEnvMapBlendingDefine( parameters );\n\tconst envMapCubeUVSize = generateCubeUVSize( parameters );\n\n\tconst customVertexExtensions = generateVertexExtensions( parameters );\n\n\tconst customDefines = generateDefines( defines );\n\n\tconst program = gl.createProgram();\n\n\tlet prefixVertex, prefixFragment;\n\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\tif ( parameters.isRawShaderMaterial ) {\n\n\t\tprefixVertex = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixVertex.length > 0 ) {\n\n\t\t\tprefixVertex += '\\n';\n\n\t\t}\n\n\t\tprefixFragment = [\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tif ( prefixFragment.length > 0 ) {\n\n\t\t\tprefixFragment += '\\n';\n\n\t\t}\n\n\t} else {\n\n\t\tprefixVertex = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.extensionClipCullDistance ? '#define USE_CLIP_DISTANCE' : '',\n\t\t\tparameters.batching ? '#define USE_BATCHING' : '',\n\t\t\tparameters.batchingColor ? '#define USE_BATCHING_COLOR' : '',\n\t\t\tparameters.instancing ? '#define USE_INSTANCING' : '',\n\t\t\tparameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',\n\t\t\tparameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\t//\n\n\t\t\tparameters.mapUv ? '#define MAP_UV ' + parameters.mapUv : '',\n\t\t\tparameters.alphaMapUv ? '#define ALPHAMAP_UV ' + parameters.alphaMapUv : '',\n\t\t\tparameters.lightMapUv ? '#define LIGHTMAP_UV ' + parameters.lightMapUv : '',\n\t\t\tparameters.aoMapUv ? '#define AOMAP_UV ' + parameters.aoMapUv : '',\n\t\t\tparameters.emissiveMapUv ? '#define EMISSIVEMAP_UV ' + parameters.emissiveMapUv : '',\n\t\t\tparameters.bumpMapUv ? '#define BUMPMAP_UV ' + parameters.bumpMapUv : '',\n\t\t\tparameters.normalMapUv ? '#define NORMALMAP_UV ' + parameters.normalMapUv : '',\n\t\t\tparameters.displacementMapUv ? '#define DISPLACEMENTMAP_UV ' + parameters.displacementMapUv : '',\n\n\t\t\tparameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',\n\t\t\tparameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',\n\n\t\t\tparameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',\n\n\t\t\tparameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',\n\t\t\tparameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',\n\t\t\tparameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',\n\n\t\t\tparameters.iridescenceMapUv ? '#define IRIDESCENCEMAP_UV ' + parameters.iridescenceMapUv : '',\n\t\t\tparameters.iridescenceThicknessMapUv ? '#define IRIDESCENCE_THICKNESSMAP_UV ' + parameters.iridescenceThicknessMapUv : '',\n\n\t\t\tparameters.sheenColorMapUv ? '#define SHEEN_COLORMAP_UV ' + parameters.sheenColorMapUv : '',\n\t\t\tparameters.sheenRoughnessMapUv ? '#define SHEEN_ROUGHNESSMAP_UV ' + parameters.sheenRoughnessMapUv : '',\n\n\t\t\tparameters.specularMapUv ? '#define SPECULARMAP_UV ' + parameters.specularMapUv : '',\n\t\t\tparameters.specularColorMapUv ? '#define SPECULAR_COLORMAP_UV ' + parameters.specularColorMapUv : '',\n\t\t\tparameters.specularIntensityMapUv ? '#define SPECULAR_INTENSITYMAP_UV ' + parameters.specularIntensityMapUv : '',\n\n\t\t\tparameters.transmissionMapUv ? '#define TRANSMISSIONMAP_UV ' + parameters.transmissionMapUv : '',\n\t\t\tparameters.thicknessMapUv ? '#define THICKNESSMAP_UV ' + parameters.thicknessMapUv : '',\n\n\t\t\t//\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.skinning ? '#define USE_SKINNING' : '',\n\n\t\t\tparameters.morphTargets ? '#define USE_MORPHTARGETS' : '',\n\t\t\tparameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '',\n\t\t\t( parameters.morphColors ) ? '#define USE_MORPHCOLORS' : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_TEXTURE_STRIDE ' + parameters.morphTextureStride : '',\n\t\t\t( parameters.morphTargetsCount > 0 ) ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '',\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\tparameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 modelMatrix;',\n\t\t\t'uniform mat4 modelViewMatrix;',\n\t\t\t'uniform mat4 projectionMatrix;',\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform mat3 normalMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t'#ifdef USE_INSTANCING',\n\n\t\t\t'\tattribute mat4 instanceMatrix;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_COLOR',\n\n\t\t\t'\tattribute vec3 instanceColor;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_INSTANCING_MORPH',\n\n\t\t\t'\tuniform sampler2D morphTexture;',\n\n\t\t\t'#endif',\n\n\t\t\t'attribute vec3 position;',\n\t\t\t'attribute vec3 normal;',\n\t\t\t'attribute vec2 uv;',\n\n\t\t\t'#ifdef USE_UV1',\n\n\t\t\t'\tattribute vec2 uv1;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV2',\n\n\t\t\t'\tattribute vec2 uv2;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_UV3',\n\n\t\t\t'\tattribute vec2 uv3;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_TANGENT',\n\n\t\t\t'\tattribute vec4 tangent;',\n\n\t\t\t'#endif',\n\n\t\t\t'#if defined( USE_COLOR_ALPHA )',\n\n\t\t\t'\tattribute vec4 color;',\n\n\t\t\t'#elif defined( USE_COLOR )',\n\n\t\t\t'\tattribute vec3 color;',\n\n\t\t\t'#endif',\n\n\t\t\t'#ifdef USE_SKINNING',\n\n\t\t\t'\tattribute vec4 skinIndex;',\n\t\t\t'\tattribute vec4 skinWeight;',\n\n\t\t\t'#endif',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t\tprefixFragment = [\n\n\t\t\tgeneratePrecision( parameters ),\n\n\t\t\t'#define SHADER_TYPE ' + parameters.shaderType,\n\t\t\t'#define SHADER_NAME ' + parameters.shaderName,\n\n\t\t\tcustomDefines,\n\n\t\t\tparameters.useFog && parameters.fog ? '#define USE_FOG' : '',\n\t\t\tparameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',\n\n\t\t\tparameters.alphaToCoverage ? '#define ALPHA_TO_COVERAGE' : '',\n\t\t\tparameters.map ? '#define USE_MAP' : '',\n\t\t\tparameters.matcap ? '#define USE_MATCAP' : '',\n\t\t\tparameters.envMap ? '#define USE_ENVMAP' : '',\n\t\t\tparameters.envMap ? '#define ' + envMapTypeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapModeDefine : '',\n\t\t\tparameters.envMap ? '#define ' + envMapBlendingDefine : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_WIDTH ' + envMapCubeUVSize.texelWidth : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_TEXEL_HEIGHT ' + envMapCubeUVSize.texelHeight : '',\n\t\t\tenvMapCubeUVSize ? '#define CUBEUV_MAX_MIP ' + envMapCubeUVSize.maxMip + '.0' : '',\n\t\t\tparameters.lightMap ? '#define USE_LIGHTMAP' : '',\n\t\t\tparameters.aoMap ? '#define USE_AOMAP' : '',\n\t\t\tparameters.bumpMap ? '#define USE_BUMPMAP' : '',\n\t\t\tparameters.normalMap ? '#define USE_NORMALMAP' : '',\n\t\t\tparameters.normalMapObjectSpace ? '#define USE_NORMALMAP_OBJECTSPACE' : '',\n\t\t\tparameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',\n\t\t\tparameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',\n\n\t\t\tparameters.anisotropy ? '#define USE_ANISOTROPY' : '',\n\t\t\tparameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',\n\n\t\t\tparameters.clearcoat ? '#define USE_CLEARCOAT' : '',\n\t\t\tparameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',\n\t\t\tparameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',\n\t\t\tparameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',\n\n\t\t\tparameters.dispersion ? '#define USE_DISPERSION' : '',\n\n\t\t\tparameters.iridescence ? '#define USE_IRIDESCENCE' : '',\n\t\t\tparameters.iridescenceMap ? '#define USE_IRIDESCENCEMAP' : '',\n\t\t\tparameters.iridescenceThicknessMap ? '#define USE_IRIDESCENCE_THICKNESSMAP' : '',\n\n\t\t\tparameters.specularMap ? '#define USE_SPECULARMAP' : '',\n\t\t\tparameters.specularColorMap ? '#define USE_SPECULAR_COLORMAP' : '',\n\t\t\tparameters.specularIntensityMap ? '#define USE_SPECULAR_INTENSITYMAP' : '',\n\n\t\t\tparameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',\n\t\t\tparameters.metalnessMap ? '#define USE_METALNESSMAP' : '',\n\n\t\t\tparameters.alphaMap ? '#define USE_ALPHAMAP' : '',\n\t\t\tparameters.alphaTest ? '#define USE_ALPHATEST' : '',\n\t\t\tparameters.alphaHash ? '#define USE_ALPHAHASH' : '',\n\n\t\t\tparameters.sheen ? '#define USE_SHEEN' : '',\n\t\t\tparameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',\n\t\t\tparameters.sheenRoughnessMap ? '#define USE_SHEEN_ROUGHNESSMAP' : '',\n\n\t\t\tparameters.transmission ? '#define USE_TRANSMISSION' : '',\n\t\t\tparameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',\n\t\t\tparameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',\n\n\t\t\tparameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',\n\t\t\tparameters.vertexColors || parameters.instancingColor || parameters.batchingColor ? '#define USE_COLOR' : '',\n\t\t\tparameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',\n\t\t\tparameters.vertexUv1s ? '#define USE_UV1' : '',\n\t\t\tparameters.vertexUv2s ? '#define USE_UV2' : '',\n\t\t\tparameters.vertexUv3s ? '#define USE_UV3' : '',\n\n\t\t\tparameters.pointsUvs ? '#define USE_POINTS_UV' : '',\n\n\t\t\tparameters.gradientMap ? '#define USE_GRADIENTMAP' : '',\n\n\t\t\tparameters.flatShading ? '#define FLAT_SHADED' : '',\n\n\t\t\tparameters.doubleSided ? '#define DOUBLE_SIDED' : '',\n\t\t\tparameters.flipSided ? '#define FLIP_SIDED' : '',\n\n\t\t\tparameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',\n\t\t\tparameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '',\n\n\t\t\tparameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',\n\n\t\t\tparameters.numLightProbes > 0 ? '#define USE_LIGHT_PROBES' : '',\n\n\t\t\tparameters.decodeVideoTexture ? '#define DECODE_VIDEO_TEXTURE' : '',\n\t\t\tparameters.decodeVideoTextureEmissive ? '#define DECODE_VIDEO_TEXTURE_EMISSIVE' : '',\n\n\t\t\tparameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',\n\t\t\tparameters.reversedDepthBuffer ? '#define USE_REVERSEDEPTHBUF' : '',\n\n\t\t\t'uniform mat4 viewMatrix;',\n\t\t\t'uniform vec3 cameraPosition;',\n\t\t\t'uniform bool isOrthographic;',\n\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '',\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\t( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '',\n\n\t\t\tparameters.dithering ? '#define DITHERING' : '',\n\t\t\tparameters.opaque ? '#define OPAQUE' : '',\n\n\t\t\tShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tgetTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),\n\t\t\tgetLuminanceFunction(),\n\n\t\t\tparameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',\n\n\t\t\t'\\n'\n\n\t\t].filter( filterEmptyLine ).join( '\\n' );\n\n\t}\n\n\tvertexShader = resolveIncludes( vertexShader );\n\tvertexShader = replaceLightNums( vertexShader, parameters );\n\tvertexShader = replaceClippingPlaneNums( vertexShader, parameters );\n\n\tfragmentShader = resolveIncludes( fragmentShader );\n\tfragmentShader = replaceLightNums( fragmentShader, parameters );\n\tfragmentShader = replaceClippingPlaneNums( fragmentShader, parameters );\n\n\tvertexShader = unrollLoops( vertexShader );\n\tfragmentShader = unrollLoops( fragmentShader );\n\n\tif ( parameters.isRawShaderMaterial !== true ) {\n\n\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\n\t\tversionString = '#version 300 es\\n';\n\n\t\tprefixVertex = [\n\t\t\tcustomVertexExtensions,\n\t\t\t'#define attribute in',\n\t\t\t'#define varying out',\n\t\t\t'#define texture2D texture'\n\t\t].join( '\\n' ) + '\\n' + prefixVertex;\n\n\t\tprefixFragment = [\n\t\t\t'#define varying in',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : 'layout(location = 0) out highp vec4 pc_fragColor;',\n\t\t\t( parameters.glslVersion === GLSL3 ) ? '' : '#define gl_FragColor pc_fragColor',\n\t\t\t'#define gl_FragDepthEXT gl_FragDepth',\n\t\t\t'#define texture2D texture',\n\t\t\t'#define textureCube texture',\n\t\t\t'#define texture2DProj textureProj',\n\t\t\t'#define texture2DLodEXT textureLod',\n\t\t\t'#define texture2DProjLodEXT textureProjLod',\n\t\t\t'#define textureCubeLodEXT textureLod',\n\t\t\t'#define texture2DGradEXT textureGrad',\n\t\t\t'#define texture2DProjGradEXT textureProjGrad',\n\t\t\t'#define textureCubeGradEXT textureGrad'\n\t\t].join( '\\n' ) + '\\n' + prefixFragment;\n\n\t}\n\n\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader;\n\n\t// console.log( '*VERTEX*', vertexGlsl );\n\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\tconst glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );\n\tconst glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );\n\n\tgl.attachShader( program, glVertexShader );\n\tgl.attachShader( program, glFragmentShader );\n\n\t// Force a particular attribute to index 0.\n\n\tif ( parameters.index0AttributeName !== undefined ) {\n\n\t\tgl.bindAttribLocation( program, 0, parameters.index0AttributeName );\n\n\t} else if ( parameters.morphTargets === true ) {\n\n\t\t// programs with morphTargets displace position out of attribute 0\n\t\tgl.bindAttribLocation( program, 0, 'position' );\n\n\t}\n\n\tgl.linkProgram( program );\n\n\tfunction onFirstUse( self ) {\n\n\t\t// check for link errors\n\t\tif ( renderer.debug.checkShaderErrors ) {\n\n\t\t\tconst programInfoLog = gl.getProgramInfoLog( program ) || '';\n\t\t\tconst vertexShaderInfoLog = gl.getShaderInfoLog( glVertexShader ) || '';\n\t\t\tconst fragmentShaderInfoLog = gl.getShaderInfoLog( glFragmentShader ) || '';\n\n\t\t\tconst programLog = programInfoLog.trim();\n\t\t\tconst vertexLog = vertexShaderInfoLog.trim();\n\t\t\tconst fragmentLog = fragmentShaderInfoLog.trim();\n\n\t\t\tlet runnable = true;\n\t\t\tlet haveDiagnostics = true;\n\n\t\t\tif ( gl.getProgramParameter( program, gl.LINK_STATUS ) === false ) {\n\n\t\t\t\trunnable = false;\n\n\t\t\t\tif ( typeof renderer.debug.onShaderError === 'function' ) {\n\n\t\t\t\t\trenderer.debug.onShaderError( gl, program, glVertexShader, glFragmentShader );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// default error reporting\n\n\t\t\t\t\tconst vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );\n\t\t\t\t\tconst fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );\n\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +\n\t\t\t\t\t\t'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\\n\\n' +\n\t\t\t\t\t\t'Material Name: ' + self.name + '\\n' +\n\t\t\t\t\t\t'Material Type: ' + self.type + '\\n\\n' +\n\t\t\t\t\t\t'Program Info Log: ' + programLog + '\\n' +\n\t\t\t\t\t\tvertexErrors + '\\n' +\n\t\t\t\t\t\tfragmentErrors\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t} else if ( programLog !== '' ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram: Program Info Log:', programLog );\n\n\t\t\t} else if ( vertexLog === '' || fragmentLog === '' ) {\n\n\t\t\t\thaveDiagnostics = false;\n\n\t\t\t}\n\n\t\t\tif ( haveDiagnostics ) {\n\n\t\t\t\tself.diagnostics = {\n\n\t\t\t\t\trunnable: runnable,\n\n\t\t\t\t\tprogramLog: programLog,\n\n\t\t\t\t\tvertexShader: {\n\n\t\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\t\tprefix: prefixVertex\n\n\t\t\t\t\t},\n\n\t\t\t\t\tfragmentShader: {\n\n\t\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\t\tprefix: prefixFragment\n\n\t\t\t\t\t}\n\n\t\t\t\t};\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Clean up\n\n\t\t// Crashes in iOS9 and iOS10. #18402\n\t\t// gl.detachShader( program, glVertexShader );\n\t\t// gl.detachShader( program, glFragmentShader );\n\n\t\tgl.deleteShader( glVertexShader );\n\t\tgl.deleteShader( glFragmentShader );\n\n\t\tcachedUniforms = new WebGLUniforms( gl, program );\n\t\tcachedAttributes = fetchAttributeLocations( gl, program );\n\n\t}\n\n\t// set up caching for uniform locations\n\n\tlet cachedUniforms;\n\n\tthis.getUniforms = function () {\n\n\t\tif ( cachedUniforms === undefined ) {\n\n\t\t\t// Populates cachedUniforms and cachedAttributes\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedUniforms;\n\n\t};\n\n\t// set up caching for attribute locations\n\n\tlet cachedAttributes;\n\n\tthis.getAttributes = function () {\n\n\t\tif ( cachedAttributes === undefined ) {\n\n\t\t\t// Populates cachedAttributes and cachedUniforms\n\t\t\tonFirstUse( this );\n\n\t\t}\n\n\t\treturn cachedAttributes;\n\n\t};\n\n\t// indicate when the program is ready to be used. if the KHR_parallel_shader_compile extension isn't supported,\n\t// flag the program as ready immediately. It may cause a stall when it's first used.\n\n\tlet programReady = ( parameters.rendererExtensionParallelShaderCompile === false );\n\n\tthis.isReady = function () {\n\n\t\tif ( programReady === false ) {\n\n\t\t\tprogramReady = gl.getProgramParameter( program, COMPLETION_STATUS_KHR );\n\n\t\t}\n\n\t\treturn programReady;\n\n\t};\n\n\t// free resource\n\n\tthis.destroy = function () {\n\n\t\tbindingStates.releaseStatesOfProgram( this );\n\n\t\tgl.deleteProgram( program );\n\t\tthis.program = undefined;\n\n\t};\n\n\t//\n\n\tthis.type = parameters.shaderType;\n\tthis.name = parameters.shaderName;\n\tthis.id = programIdCount ++;\n\tthis.cacheKey = cacheKey;\n\tthis.usedTimes = 1;\n\tthis.program = program;\n\tthis.vertexShader = glVertexShader;\n\tthis.fragmentShader = glFragmentShader;\n\n\treturn this;\n\n}\n\nlet _id = 0;\n\nclass WebGLShaderCache {\n\n\tconstructor() {\n\n\t\tthis.shaderCache = new Map();\n\t\tthis.materialCache = new Map();\n\n\t}\n\n\tupdate( material ) {\n\n\t\tconst vertexShader = material.vertexShader;\n\t\tconst fragmentShader = material.fragmentShader;\n\n\t\tconst vertexShaderStage = this._getShaderStage( vertexShader );\n\t\tconst fragmentShaderStage = this._getShaderStage( fragmentShader );\n\n\t\tconst materialShaders = this._getShaderCacheForMaterial( material );\n\n\t\tif ( materialShaders.has( vertexShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( vertexShaderStage );\n\t\t\tvertexShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\tif ( materialShaders.has( fragmentShaderStage ) === false ) {\n\n\t\t\tmaterialShaders.add( fragmentShaderStage );\n\t\t\tfragmentShaderStage.usedTimes ++;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tremove( material ) {\n\n\t\tconst materialShaders = this.materialCache.get( material );\n\n\t\tfor ( const shaderStage of materialShaders ) {\n\n\t\t\tshaderStage.usedTimes --;\n\n\t\t\tif ( shaderStage.usedTimes === 0 ) this.shaderCache.delete( shaderStage.code );\n\n\t\t}\n\n\t\tthis.materialCache.delete( material );\n\n\t\treturn this;\n\n\t}\n\n\tgetVertexShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.vertexShader ).id;\n\n\t}\n\n\tgetFragmentShaderID( material ) {\n\n\t\treturn this._getShaderStage( material.fragmentShader ).id;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.shaderCache.clear();\n\t\tthis.materialCache.clear();\n\n\t}\n\n\t_getShaderCacheForMaterial( material ) {\n\n\t\tconst cache = this.materialCache;\n\t\tlet set = cache.get( material );\n\n\t\tif ( set === undefined ) {\n\n\t\t\tset = new Set();\n\t\t\tcache.set( material, set );\n\n\t\t}\n\n\t\treturn set;\n\n\t}\n\n\t_getShaderStage( code ) {\n\n\t\tconst cache = this.shaderCache;\n\t\tlet stage = cache.get( code );\n\n\t\tif ( stage === undefined ) {\n\n\t\t\tstage = new WebGLShaderStage( code );\n\t\t\tcache.set( code, stage );\n\n\t\t}\n\n\t\treturn stage;\n\n\t}\n\n}\n\nclass WebGLShaderStage {\n\n\tconstructor( code ) {\n\n\t\tthis.id = _id ++;\n\n\t\tthis.code = code;\n\t\tthis.usedTimes = 0;\n\n\t}\n\n}\n\nfunction WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping ) {\n\n\tconst _programLayers = new Layers();\n\tconst _customShaders = new WebGLShaderCache();\n\tconst _activeChannels = new Set();\n\tconst programs = [];\n\n\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\tconst SUPPORTS_VERTEX_TEXTURES = capabilities.vertexTextures;\n\n\tlet precision = capabilities.precision;\n\n\tconst shaderIDs = {\n\t\tMeshDepthMaterial: 'depth',\n\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\tMeshNormalMaterial: 'normal',\n\t\tMeshBasicMaterial: 'basic',\n\t\tMeshLambertMaterial: 'lambert',\n\t\tMeshPhongMaterial: 'phong',\n\t\tMeshToonMaterial: 'toon',\n\t\tMeshStandardMaterial: 'physical',\n\t\tMeshPhysicalMaterial: 'physical',\n\t\tMeshMatcapMaterial: 'matcap',\n\t\tLineBasicMaterial: 'basic',\n\t\tLineDashedMaterial: 'dashed',\n\t\tPointsMaterial: 'points',\n\t\tShadowMaterial: 'shadow',\n\t\tSpriteMaterial: 'sprite'\n\t};\n\n\tfunction getChannel( value ) {\n\n\t\t_activeChannels.add( value );\n\n\t\tif ( value === 0 ) return 'uv';\n\n\t\treturn `uv${ value }`;\n\n\t}\n\n\tfunction getParameters( material, lights, shadows, scene, object ) {\n\n\t\tconst fog = scene.fog;\n\t\tconst geometry = object.geometry;\n\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\n\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\tconst envMapCubeUVHeight = ( !! envMap ) && ( envMap.mapping === CubeUVReflectionMapping ) ? envMap.image.height : null;\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\n\t\t// heuristics to create shader parameters according to lights in the scene\n\t\t// (not to blow over maxLights budget)\n\n\t\tif ( material.precision !== null ) {\n\n\t\t\tprecision = capabilities.getMaxPrecision( material.precision );\n\n\t\t\tif ( precision !== material.precision ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\tlet morphTextureStride = 0;\n\n\t\tif ( geometry.morphAttributes.position !== undefined ) morphTextureStride = 1;\n\t\tif ( geometry.morphAttributes.normal !== undefined ) morphTextureStride = 2;\n\t\tif ( geometry.morphAttributes.color !== undefined ) morphTextureStride = 3;\n\n\t\t//\n\n\t\tlet vertexShader, fragmentShader;\n\t\tlet customVertexShaderID, customFragmentShaderID;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\n\t\t\tvertexShader = shader.vertexShader;\n\t\t\tfragmentShader = shader.fragmentShader;\n\n\t\t} else {\n\n\t\t\tvertexShader = material.vertexShader;\n\t\t\tfragmentShader = material.fragmentShader;\n\n\t\t\t_customShaders.update( material );\n\n\t\t\tcustomVertexShaderID = _customShaders.getVertexShaderID( material );\n\t\t\tcustomFragmentShaderID = _customShaders.getFragmentShaderID( material );\n\n\t\t}\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst reversedDepthBuffer = renderer.state.buffers.depth.getReversed();\n\n\t\tconst IS_INSTANCEDMESH = object.isInstancedMesh === true;\n\t\tconst IS_BATCHEDMESH = object.isBatchedMesh === true;\n\n\t\tconst HAS_MAP = !! material.map;\n\t\tconst HAS_MATCAP = !! material.matcap;\n\t\tconst HAS_ENVMAP = !! envMap;\n\t\tconst HAS_AOMAP = !! material.aoMap;\n\t\tconst HAS_LIGHTMAP = !! material.lightMap;\n\t\tconst HAS_BUMPMAP = !! material.bumpMap;\n\t\tconst HAS_NORMALMAP = !! material.normalMap;\n\t\tconst HAS_DISPLACEMENTMAP = !! material.displacementMap;\n\t\tconst HAS_EMISSIVEMAP = !! material.emissiveMap;\n\n\t\tconst HAS_METALNESSMAP = !! material.metalnessMap;\n\t\tconst HAS_ROUGHNESSMAP = !! material.roughnessMap;\n\n\t\tconst HAS_ANISOTROPY = material.anisotropy > 0;\n\t\tconst HAS_CLEARCOAT = material.clearcoat > 0;\n\t\tconst HAS_DISPERSION = material.dispersion > 0;\n\t\tconst HAS_IRIDESCENCE = material.iridescence > 0;\n\t\tconst HAS_SHEEN = material.sheen > 0;\n\t\tconst HAS_TRANSMISSION = material.transmission > 0;\n\n\t\tconst HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;\n\n\t\tconst HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;\n\t\tconst HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;\n\t\tconst HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;\n\n\t\tconst HAS_IRIDESCENCEMAP = HAS_IRIDESCENCE && !! material.iridescenceMap;\n\t\tconst HAS_IRIDESCENCE_THICKNESSMAP = HAS_IRIDESCENCE && !! material.iridescenceThicknessMap;\n\n\t\tconst HAS_SHEEN_COLORMAP = HAS_SHEEN && !! material.sheenColorMap;\n\t\tconst HAS_SHEEN_ROUGHNESSMAP = HAS_SHEEN && !! material.sheenRoughnessMap;\n\n\t\tconst HAS_SPECULARMAP = !! material.specularMap;\n\t\tconst HAS_SPECULAR_COLORMAP = !! material.specularColorMap;\n\t\tconst HAS_SPECULAR_INTENSITYMAP = !! material.specularIntensityMap;\n\n\t\tconst HAS_TRANSMISSIONMAP = HAS_TRANSMISSION && !! material.transmissionMap;\n\t\tconst HAS_THICKNESSMAP = HAS_TRANSMISSION && !! material.thicknessMap;\n\n\t\tconst HAS_GRADIENTMAP = !! material.gradientMap;\n\n\t\tconst HAS_ALPHAMAP = !! material.alphaMap;\n\n\t\tconst HAS_ALPHATEST = material.alphaTest > 0;\n\n\t\tconst HAS_ALPHAHASH = !! material.alphaHash;\n\n\t\tconst HAS_EXTENSIONS = !! material.extensions;\n\n\t\tlet toneMapping = NoToneMapping;\n\n\t\tif ( material.toneMapped ) {\n\n\t\t\tif ( currentRenderTarget === null || currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\ttoneMapping = renderer.toneMapping;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst parameters = {\n\n\t\t\tshaderID: shaderID,\n\t\t\tshaderType: material.type,\n\t\t\tshaderName: material.name,\n\n\t\t\tvertexShader: vertexShader,\n\t\t\tfragmentShader: fragmentShader,\n\t\t\tdefines: material.defines,\n\n\t\t\tcustomVertexShaderID: customVertexShaderID,\n\t\t\tcustomFragmentShaderID: customFragmentShaderID,\n\n\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\tglslVersion: material.glslVersion,\n\n\t\t\tprecision: precision,\n\n\t\t\tbatching: IS_BATCHEDMESH,\n\t\t\tbatchingColor: IS_BATCHEDMESH && object._colorsTexture !== null,\n\t\t\tinstancing: IS_INSTANCEDMESH,\n\t\t\tinstancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,\n\t\t\tinstancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,\n\n\t\t\tsupportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,\n\t\t\toutputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),\n\t\t\talphaToCoverage: !! material.alphaToCoverage,\n\n\t\t\tmap: HAS_MAP,\n\t\t\tmatcap: HAS_MATCAP,\n\t\t\tenvMap: HAS_ENVMAP,\n\t\t\tenvMapMode: HAS_ENVMAP && envMap.mapping,\n\t\t\tenvMapCubeUVHeight: envMapCubeUVHeight,\n\t\t\taoMap: HAS_AOMAP,\n\t\t\tlightMap: HAS_LIGHTMAP,\n\t\t\tbumpMap: HAS_BUMPMAP,\n\t\t\tnormalMap: HAS_NORMALMAP,\n\t\t\tdisplacementMap: SUPPORTS_VERTEX_TEXTURES && HAS_DISPLACEMENTMAP,\n\t\t\temissiveMap: HAS_EMISSIVEMAP,\n\n\t\t\tnormalMapObjectSpace: HAS_NORMALMAP && material.normalMapType === ObjectSpaceNormalMap,\n\t\t\tnormalMapTangentSpace: HAS_NORMALMAP && material.normalMapType === TangentSpaceNormalMap,\n\n\t\t\tmetalnessMap: HAS_METALNESSMAP,\n\t\t\troughnessMap: HAS_ROUGHNESSMAP,\n\n\t\t\tanisotropy: HAS_ANISOTROPY,\n\t\t\tanisotropyMap: HAS_ANISOTROPYMAP,\n\n\t\t\tclearcoat: HAS_CLEARCOAT,\n\t\t\tclearcoatMap: HAS_CLEARCOATMAP,\n\t\t\tclearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,\n\t\t\tclearcoatRoughnessMap: HAS_CLEARCOAT_ROUGHNESSMAP,\n\n\t\t\tdispersion: HAS_DISPERSION,\n\n\t\t\tiridescence: HAS_IRIDESCENCE,\n\t\t\tiridescenceMap: HAS_IRIDESCENCEMAP,\n\t\t\tiridescenceThicknessMap: HAS_IRIDESCENCE_THICKNESSMAP,\n\n\t\t\tsheen: HAS_SHEEN,\n\t\t\tsheenColorMap: HAS_SHEEN_COLORMAP,\n\t\t\tsheenRoughnessMap: HAS_SHEEN_ROUGHNESSMAP,\n\n\t\t\tspecularMap: HAS_SPECULARMAP,\n\t\t\tspecularColorMap: HAS_SPECULAR_COLORMAP,\n\t\t\tspecularIntensityMap: HAS_SPECULAR_INTENSITYMAP,\n\n\t\t\ttransmission: HAS_TRANSMISSION,\n\t\t\ttransmissionMap: HAS_TRANSMISSIONMAP,\n\t\t\tthicknessMap: HAS_THICKNESSMAP,\n\n\t\t\tgradientMap: HAS_GRADIENTMAP,\n\n\t\t\topaque: material.transparent === false && material.blending === NormalBlending && material.alphaToCoverage === false,\n\n\t\t\talphaMap: HAS_ALPHAMAP,\n\t\t\talphaTest: HAS_ALPHATEST,\n\t\t\talphaHash: HAS_ALPHAHASH,\n\n\t\t\tcombine: material.combine,\n\n\t\t\t//\n\n\t\t\tmapUv: HAS_MAP && getChannel( material.map.channel ),\n\t\t\taoMapUv: HAS_AOMAP && getChannel( material.aoMap.channel ),\n\t\t\tlightMapUv: HAS_LIGHTMAP && getChannel( material.lightMap.channel ),\n\t\t\tbumpMapUv: HAS_BUMPMAP && getChannel( material.bumpMap.channel ),\n\t\t\tnormalMapUv: HAS_NORMALMAP && getChannel( material.normalMap.channel ),\n\t\t\tdisplacementMapUv: HAS_DISPLACEMENTMAP && getChannel( material.displacementMap.channel ),\n\t\t\temissiveMapUv: HAS_EMISSIVEMAP && getChannel( material.emissiveMap.channel ),\n\n\t\t\tmetalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),\n\t\t\troughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),\n\n\t\t\tanisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),\n\n\t\t\tclearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),\n\t\t\tclearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),\n\t\t\tclearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),\n\n\t\t\tiridescenceMapUv: HAS_IRIDESCENCEMAP && getChannel( material.iridescenceMap.channel ),\n\t\t\tiridescenceThicknessMapUv: HAS_IRIDESCENCE_THICKNESSMAP && getChannel( material.iridescenceThicknessMap.channel ),\n\n\t\t\tsheenColorMapUv: HAS_SHEEN_COLORMAP && getChannel( material.sheenColorMap.channel ),\n\t\t\tsheenRoughnessMapUv: HAS_SHEEN_ROUGHNESSMAP && getChannel( material.sheenRoughnessMap.channel ),\n\n\t\t\tspecularMapUv: HAS_SPECULARMAP && getChannel( material.specularMap.channel ),\n\t\t\tspecularColorMapUv: HAS_SPECULAR_COLORMAP && getChannel( material.specularColorMap.channel ),\n\t\t\tspecularIntensityMapUv: HAS_SPECULAR_INTENSITYMAP && getChannel( material.specularIntensityMap.channel ),\n\n\t\t\ttransmissionMapUv: HAS_TRANSMISSIONMAP && getChannel( material.transmissionMap.channel ),\n\t\t\tthicknessMapUv: HAS_THICKNESSMAP && getChannel( material.thicknessMap.channel ),\n\n\t\t\talphaMapUv: HAS_ALPHAMAP && getChannel( material.alphaMap.channel ),\n\n\t\t\t//\n\n\t\t\tvertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),\n\t\t\tvertexColors: material.vertexColors,\n\t\t\tvertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,\n\n\t\t\tpointsUvs: object.isPoints === true && !! geometry.attributes.uv && ( HAS_MAP || HAS_ALPHAMAP ),\n\n\t\t\tfog: !! fog,\n\t\t\tuseFog: material.fog === true,\n\t\t\tfogExp2: ( !! fog && fog.isFogExp2 ),\n\n\t\t\tflatShading: ( material.flatShading === true && material.wireframe === false ),\n\n\t\t\tsizeAttenuation: material.sizeAttenuation === true,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\treversedDepthBuffer: reversedDepthBuffer,\n\n\t\t\tskinning: object.isSkinnedMesh === true,\n\n\t\t\tmorphTargets: geometry.morphAttributes.position !== undefined,\n\t\t\tmorphNormals: geometry.morphAttributes.normal !== undefined,\n\t\t\tmorphColors: geometry.morphAttributes.color !== undefined,\n\t\t\tmorphTargetsCount: morphTargetsCount,\n\t\t\tmorphTextureStride: morphTextureStride,\n\n\t\t\tnumDirLights: lights.directional.length,\n\t\t\tnumPointLights: lights.point.length,\n\t\t\tnumSpotLights: lights.spot.length,\n\t\t\tnumSpotLightMaps: lights.spotLightMap.length,\n\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\tnumHemiLights: lights.hemi.length,\n\n\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\t\t\tnumSpotLightShadowsWithMaps: lights.numSpotLightShadowsWithMaps,\n\n\t\t\tnumLightProbes: lights.numLightProbes,\n\n\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\tnumClipIntersection: clipping.numIntersection,\n\n\t\t\tdithering: material.dithering,\n\n\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\tshadowMapType: renderer.shadowMap.type,\n\n\t\t\ttoneMapping: toneMapping,\n\n\t\t\tdecodeVideoTexture: HAS_MAP && ( material.map.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.map.colorSpace ) === SRGBTransfer ),\n\t\t\tdecodeVideoTextureEmissive: HAS_EMISSIVEMAP && ( material.emissiveMap.isVideoTexture === true ) && ( ColorManagement.getTransfer( material.emissiveMap.colorSpace ) === SRGBTransfer ),\n\n\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\n\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\tflipSided: material.side === BackSide,\n\n\t\t\tuseDepthPacking: material.depthPacking >= 0,\n\t\t\tdepthPacking: material.depthPacking || 0,\n\n\t\t\tindex0AttributeName: material.index0AttributeName,\n\n\t\t\textensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance === true && extensions.has( 'WEBGL_clip_cull_distance' ),\n\t\t\textensionMultiDraw: ( HAS_EXTENSIONS && material.extensions.multiDraw === true || IS_BATCHEDMESH ) && extensions.has( 'WEBGL_multi_draw' ),\n\n\t\t\trendererExtensionParallelShaderCompile: extensions.has( 'KHR_parallel_shader_compile' ),\n\n\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\n\t\t};\n\n\t\t// the usage of getChannel() determines the active texture channels for this shader\n\n\t\tparameters.vertexUv1s = _activeChannels.has( 1 );\n\t\tparameters.vertexUv2s = _activeChannels.has( 2 );\n\t\tparameters.vertexUv3s = _activeChannels.has( 3 );\n\n\t\t_activeChannels.clear();\n\n\t\treturn parameters;\n\n\t}\n\n\tfunction getProgramCacheKey( parameters ) {\n\n\t\tconst array = [];\n\n\t\tif ( parameters.shaderID ) {\n\n\t\t\tarray.push( parameters.shaderID );\n\n\t\t} else {\n\n\t\t\tarray.push( parameters.customVertexShaderID );\n\t\t\tarray.push( parameters.customFragmentShaderID );\n\n\t\t}\n\n\t\tif ( parameters.defines !== undefined ) {\n\n\t\t\tfor ( const name in parameters.defines ) {\n\n\t\t\t\tarray.push( name );\n\t\t\t\tarray.push( parameters.defines[ name ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( parameters.isRawShaderMaterial === false ) {\n\n\t\t\tgetProgramCacheKeyParameters( array, parameters );\n\t\t\tgetProgramCacheKeyBooleans( array, parameters );\n\t\t\tarray.push( renderer.outputColorSpace );\n\n\t\t}\n\n\t\tarray.push( parameters.customProgramCacheKey );\n\n\t\treturn array.join();\n\n\t}\n\n\tfunction getProgramCacheKeyParameters( array, parameters ) {\n\n\t\tarray.push( parameters.precision );\n\t\tarray.push( parameters.outputColorSpace );\n\t\tarray.push( parameters.envMapMode );\n\t\tarray.push( parameters.envMapCubeUVHeight );\n\t\tarray.push( parameters.mapUv );\n\t\tarray.push( parameters.alphaMapUv );\n\t\tarray.push( parameters.lightMapUv );\n\t\tarray.push( parameters.aoMapUv );\n\t\tarray.push( parameters.bumpMapUv );\n\t\tarray.push( parameters.normalMapUv );\n\t\tarray.push( parameters.displacementMapUv );\n\t\tarray.push( parameters.emissiveMapUv );\n\t\tarray.push( parameters.metalnessMapUv );\n\t\tarray.push( parameters.roughnessMapUv );\n\t\tarray.push( parameters.anisotropyMapUv );\n\t\tarray.push( parameters.clearcoatMapUv );\n\t\tarray.push( parameters.clearcoatNormalMapUv );\n\t\tarray.push( parameters.clearcoatRoughnessMapUv );\n\t\tarray.push( parameters.iridescenceMapUv );\n\t\tarray.push( parameters.iridescenceThicknessMapUv );\n\t\tarray.push( parameters.sheenColorMapUv );\n\t\tarray.push( parameters.sheenRoughnessMapUv );\n\t\tarray.push( parameters.specularMapUv );\n\t\tarray.push( parameters.specularColorMapUv );\n\t\tarray.push( parameters.specularIntensityMapUv );\n\t\tarray.push( parameters.transmissionMapUv );\n\t\tarray.push( parameters.thicknessMapUv );\n\t\tarray.push( parameters.combine );\n\t\tarray.push( parameters.fogExp2 );\n\t\tarray.push( parameters.sizeAttenuation );\n\t\tarray.push( parameters.morphTargetsCount );\n\t\tarray.push( parameters.morphAttributeCount );\n\t\tarray.push( parameters.numDirLights );\n\t\tarray.push( parameters.numPointLights );\n\t\tarray.push( parameters.numSpotLights );\n\t\tarray.push( parameters.numSpotLightMaps );\n\t\tarray.push( parameters.numHemiLights );\n\t\tarray.push( parameters.numRectAreaLights );\n\t\tarray.push( parameters.numDirLightShadows );\n\t\tarray.push( parameters.numPointLightShadows );\n\t\tarray.push( parameters.numSpotLightShadows );\n\t\tarray.push( parameters.numSpotLightShadowsWithMaps );\n\t\tarray.push( parameters.numLightProbes );\n\t\tarray.push( parameters.shadowMapType );\n\t\tarray.push( parameters.toneMapping );\n\t\tarray.push( parameters.numClippingPlanes );\n\t\tarray.push( parameters.numClipIntersection );\n\t\tarray.push( parameters.depthPacking );\n\n\t}\n\n\tfunction getProgramCacheKeyBooleans( array, parameters ) {\n\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.supportsVertexTextures )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.instancing )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.instancingColor )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.instancingMorph )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.matcap )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.envMap )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.normalMapObjectSpace )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.normalMapTangentSpace )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.clearcoat )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.iridescence )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.alphaTest )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.vertexColors )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.vertexAlphas )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.vertexUv1s )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.vertexUv2s )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.vertexUv3s )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.vertexTangents )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.anisotropy )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.alphaHash )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.batching )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.dispersion )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.batchingColor )\n\t\t\t_programLayers.enable( 21 );\n\t\tif ( parameters.gradientMap )\n\t\t\t_programLayers.enable( 22 );\n\n\t\tarray.push( _programLayers.mask );\n\t\t_programLayers.disableAll();\n\n\t\tif ( parameters.fog )\n\t\t\t_programLayers.enable( 0 );\n\t\tif ( parameters.useFog )\n\t\t\t_programLayers.enable( 1 );\n\t\tif ( parameters.flatShading )\n\t\t\t_programLayers.enable( 2 );\n\t\tif ( parameters.logarithmicDepthBuffer )\n\t\t\t_programLayers.enable( 3 );\n\t\tif ( parameters.reversedDepthBuffer )\n\t\t\t_programLayers.enable( 4 );\n\t\tif ( parameters.skinning )\n\t\t\t_programLayers.enable( 5 );\n\t\tif ( parameters.morphTargets )\n\t\t\t_programLayers.enable( 6 );\n\t\tif ( parameters.morphNormals )\n\t\t\t_programLayers.enable( 7 );\n\t\tif ( parameters.morphColors )\n\t\t\t_programLayers.enable( 8 );\n\t\tif ( parameters.premultipliedAlpha )\n\t\t\t_programLayers.enable( 9 );\n\t\tif ( parameters.shadowMapEnabled )\n\t\t\t_programLayers.enable( 10 );\n\t\tif ( parameters.doubleSided )\n\t\t\t_programLayers.enable( 11 );\n\t\tif ( parameters.flipSided )\n\t\t\t_programLayers.enable( 12 );\n\t\tif ( parameters.useDepthPacking )\n\t\t\t_programLayers.enable( 13 );\n\t\tif ( parameters.dithering )\n\t\t\t_programLayers.enable( 14 );\n\t\tif ( parameters.transmission )\n\t\t\t_programLayers.enable( 15 );\n\t\tif ( parameters.sheen )\n\t\t\t_programLayers.enable( 16 );\n\t\tif ( parameters.opaque )\n\t\t\t_programLayers.enable( 17 );\n\t\tif ( parameters.pointsUvs )\n\t\t\t_programLayers.enable( 18 );\n\t\tif ( parameters.decodeVideoTexture )\n\t\t\t_programLayers.enable( 19 );\n\t\tif ( parameters.decodeVideoTextureEmissive )\n\t\t\t_programLayers.enable( 20 );\n\t\tif ( parameters.alphaToCoverage )\n\t\t\t_programLayers.enable( 21 );\n\n\t\tarray.push( _programLayers.mask );\n\n\t}\n\n\tfunction getUniforms( material ) {\n\n\t\tconst shaderID = shaderIDs[ material.type ];\n\t\tlet uniforms;\n\n\t\tif ( shaderID ) {\n\n\t\t\tconst shader = ShaderLib[ shaderID ];\n\t\t\tuniforms = UniformsUtils.clone( shader.uniforms );\n\n\t\t} else {\n\n\t\t\tuniforms = material.uniforms;\n\n\t\t}\n\n\t\treturn uniforms;\n\n\t}\n\n\tfunction acquireProgram( parameters, cacheKey ) {\n\n\t\tlet program;\n\n\t\t// Check if code has been already compiled\n\t\tfor ( let p = 0, pl = programs.length; p < pl; p ++ ) {\n\n\t\t\tconst preexistingProgram = programs[ p ];\n\n\t\t\tif ( preexistingProgram.cacheKey === cacheKey ) {\n\n\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t++ program.usedTimes;\n\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( program === undefined ) {\n\n\t\t\tprogram = new WebGLProgram( renderer, cacheKey, parameters, bindingStates );\n\t\t\tprograms.push( program );\n\n\t\t}\n\n\t\treturn program;\n\n\t}\n\n\tfunction releaseProgram( program ) {\n\n\t\tif ( -- program.usedTimes === 0 ) {\n\n\t\t\t// Remove from unordered set\n\t\t\tconst i = programs.indexOf( program );\n\t\t\tprograms[ i ] = programs[ programs.length - 1 ];\n\t\t\tprograms.pop();\n\n\t\t\t// Free WebGL resources\n\t\t\tprogram.destroy();\n\n\t\t}\n\n\t}\n\n\tfunction releaseShaderCache( material ) {\n\n\t\t_customShaders.remove( material );\n\n\t}\n\n\tfunction dispose() {\n\n\t\t_customShaders.dispose();\n\n\t}\n\n\treturn {\n\t\tgetParameters: getParameters,\n\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\tgetUniforms: getUniforms,\n\t\tacquireProgram: acquireProgram,\n\t\treleaseProgram: releaseProgram,\n\t\treleaseShaderCache: releaseShaderCache,\n\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\tprograms: programs,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction WebGLProperties() {\n\n\tlet properties = new WeakMap();\n\n\tfunction has( object ) {\n\n\t\treturn properties.has( object );\n\n\t}\n\n\tfunction get( object ) {\n\n\t\tlet map = properties.get( object );\n\n\t\tif ( map === undefined ) {\n\n\t\t\tmap = {};\n\t\t\tproperties.set( object, map );\n\n\t\t}\n\n\t\treturn map;\n\n\t}\n\n\tfunction remove( object ) {\n\n\t\tproperties.delete( object );\n\n\t}\n\n\tfunction update( object, key, value ) {\n\n\t\tproperties.get( object )[ key ] = value;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tproperties = new WeakMap();\n\n\t}\n\n\treturn {\n\t\thas: has,\n\t\tget: get,\n\t\tremove: remove,\n\t\tupdate: update,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction painterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.material.id !== b.material.id ) {\n\n\t\treturn a.material.id - b.material.id;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn a.z - b.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\nfunction reversePainterSortStable( a, b ) {\n\n\tif ( a.groupOrder !== b.groupOrder ) {\n\n\t\treturn a.groupOrder - b.groupOrder;\n\n\t} else if ( a.renderOrder !== b.renderOrder ) {\n\n\t\treturn a.renderOrder - b.renderOrder;\n\n\t} else if ( a.z !== b.z ) {\n\n\t\treturn b.z - a.z;\n\n\t} else {\n\n\t\treturn a.id - b.id;\n\n\t}\n\n}\n\n\nfunction WebGLRenderList() {\n\n\tconst renderItems = [];\n\tlet renderItemsIndex = 0;\n\n\tconst opaque = [];\n\tconst transmissive = [];\n\tconst transparent = [];\n\n\tfunction init() {\n\n\t\trenderItemsIndex = 0;\n\n\t\topaque.length = 0;\n\t\ttransmissive.length = 0;\n\t\ttransparent.length = 0;\n\n\t}\n\n\tfunction getNextRenderItem( object, geometry, material, groupOrder, z, group ) {\n\n\t\tlet renderItem = renderItems[ renderItemsIndex ];\n\n\t\tif ( renderItem === undefined ) {\n\n\t\t\trenderItem = {\n\t\t\t\tid: object.id,\n\t\t\t\tobject: object,\n\t\t\t\tgeometry: geometry,\n\t\t\t\tmaterial: material,\n\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\tz: z,\n\t\t\t\tgroup: group\n\t\t\t};\n\n\t\t\trenderItems[ renderItemsIndex ] = renderItem;\n\n\t\t} else {\n\n\t\t\trenderItem.id = object.id;\n\t\t\trenderItem.object = object;\n\t\t\trenderItem.geometry = geometry;\n\t\t\trenderItem.material = material;\n\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\trenderItem.z = z;\n\t\t\trenderItem.group = group;\n\n\t\t}\n\n\t\trenderItemsIndex ++;\n\n\t\treturn renderItem;\n\n\t}\n\n\tfunction push( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.push( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.push( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.push( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction unshift( object, geometry, material, groupOrder, z, group ) {\n\n\t\tconst renderItem = getNextRenderItem( object, geometry, material, groupOrder, z, group );\n\n\t\tif ( material.transmission > 0.0 ) {\n\n\t\t\ttransmissive.unshift( renderItem );\n\n\t\t} else if ( material.transparent === true ) {\n\n\t\t\ttransparent.unshift( renderItem );\n\n\t\t} else {\n\n\t\t\topaque.unshift( renderItem );\n\n\t\t}\n\n\t}\n\n\tfunction sort( customOpaqueSort, customTransparentSort ) {\n\n\t\tif ( opaque.length > 1 ) opaque.sort( customOpaqueSort || painterSortStable );\n\t\tif ( transmissive.length > 1 ) transmissive.sort( customTransparentSort || reversePainterSortStable );\n\t\tif ( transparent.length > 1 ) transparent.sort( customTransparentSort || reversePainterSortStable );\n\n\t}\n\n\tfunction finish() {\n\n\t\t// Clear references from inactive renderItems in the list\n\n\t\tfor ( let i = renderItemsIndex, il = renderItems.length; i < il; i ++ ) {\n\n\t\t\tconst renderItem = renderItems[ i ];\n\n\t\t\tif ( renderItem.id === null ) break;\n\n\t\t\trenderItem.id = null;\n\t\t\trenderItem.object = null;\n\t\t\trenderItem.geometry = null;\n\t\t\trenderItem.material = null;\n\t\t\trenderItem.group = null;\n\n\t\t}\n\n\t}\n\n\treturn {\n\n\t\topaque: opaque,\n\t\ttransmissive: transmissive,\n\t\ttransparent: transparent,\n\n\t\tinit: init,\n\t\tpush: push,\n\t\tunshift: unshift,\n\t\tfinish: finish,\n\n\t\tsort: sort\n\t};\n\n}\n\nfunction WebGLRenderLists() {\n\n\tlet lists = new WeakMap();\n\n\tfunction get( scene, renderCallDepth ) {\n\n\t\tconst listArray = lists.get( scene );\n\t\tlet list;\n\n\t\tif ( listArray === undefined ) {\n\n\t\t\tlist = new WebGLRenderList();\n\t\t\tlists.set( scene, [ list ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= listArray.length ) {\n\n\t\t\t\tlist = new WebGLRenderList();\n\t\t\t\tlistArray.push( list );\n\n\t\t\t} else {\n\n\t\t\t\tlist = listArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn list;\n\n\t}\n\n\tfunction dispose() {\n\n\t\tlists = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nfunction UniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\nfunction ShadowUniformsCache() {\n\n\tconst lights = {};\n\n\treturn {\n\n\t\tget: function ( light ) {\n\n\t\t\tif ( lights[ light.id ] !== undefined ) {\n\n\t\t\t\treturn lights[ light.id ];\n\n\t\t\t}\n\n\t\t\tlet uniforms;\n\n\t\t\tswitch ( light.type ) {\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tuniforms = {\n\t\t\t\t\t\tshadowIntensity: 1,\n\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t};\n\t\t\t\t\tbreak;\n\n\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\n\t\t\t}\n\n\t\t\tlights[ light.id ] = uniforms;\n\n\t\t\treturn uniforms;\n\n\t\t}\n\n\t};\n\n}\n\n\n\nlet nextVersion = 0;\n\nfunction shadowCastingAndTexturingLightsFirst( lightA, lightB ) {\n\n\treturn ( lightB.castShadow ? 2 : 0 ) - ( lightA.castShadow ? 2 : 0 ) + ( lightB.map ? 1 : 0 ) - ( lightA.map ? 1 : 0 );\n\n}\n\nfunction WebGLLights( extensions ) {\n\n\tconst cache = new UniformsCache();\n\n\tconst shadowCache = ShadowUniformsCache();\n\n\tconst state = {\n\n\t\tversion: 0,\n\n\t\thash: {\n\t\t\tdirectionalLength: -1,\n\t\t\tpointLength: -1,\n\t\t\tspotLength: -1,\n\t\t\trectAreaLength: -1,\n\t\t\themiLength: -1,\n\n\t\t\tnumDirectionalShadows: -1,\n\t\t\tnumPointShadows: -1,\n\t\t\tnumSpotShadows: -1,\n\t\t\tnumSpotMaps: -1,\n\n\t\t\tnumLightProbes: -1\n\t\t},\n\n\t\tambient: [ 0, 0, 0 ],\n\t\tprobe: [],\n\t\tdirectional: [],\n\t\tdirectionalShadow: [],\n\t\tdirectionalShadowMap: [],\n\t\tdirectionalShadowMatrix: [],\n\t\tspot: [],\n\t\tspotLightMap: [],\n\t\tspotShadow: [],\n\t\tspotShadowMap: [],\n\t\tspotLightMatrix: [],\n\t\trectArea: [],\n\t\trectAreaLTC1: null,\n\t\trectAreaLTC2: null,\n\t\tpoint: [],\n\t\tpointShadow: [],\n\t\tpointShadowMap: [],\n\t\tpointShadowMatrix: [],\n\t\themi: [],\n\t\tnumSpotLightShadowsWithMaps: 0,\n\t\tnumLightProbes: 0\n\n\t};\n\n\tfor ( let i = 0; i < 9; i ++ ) state.probe.push( new Vector3() );\n\n\tconst vector3 = new Vector3();\n\tconst matrix4 = new Matrix4();\n\tconst matrix42 = new Matrix4();\n\n\tfunction setup( lights ) {\n\n\t\tlet r = 0, g = 0, b = 0;\n\n\t\tfor ( let i = 0; i < 9; i ++ ) state.probe[ i ].set( 0, 0, 0 );\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tlet numDirectionalShadows = 0;\n\t\tlet numPointShadows = 0;\n\t\tlet numSpotShadows = 0;\n\t\tlet numSpotMaps = 0;\n\t\tlet numSpotShadowsWithMaps = 0;\n\n\t\tlet numLightProbes = 0;\n\n\t\t// ordering : [shadow casting + map texturing, map texturing, shadow casting, none ]\n\t\tlights.sort( shadowCastingAndTexturingLightsFirst );\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tconst color = light.color;\n\t\t\tconst intensity = light.intensity;\n\t\t\tconst distance = light.distance;\n\n\t\t\tconst shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;\n\n\t\t\tif ( light.isAmbientLight ) {\n\n\t\t\t\tr += color.r * intensity;\n\t\t\t\tg += color.g * intensity;\n\t\t\t\tb += color.b * intensity;\n\n\t\t\t} else if ( light.isLightProbe ) {\n\n\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\tstate.probe[ j ].addScaledVector( light.sh.coefficients[ j ], intensity );\n\n\t\t\t\t}\n\n\t\t\t\tnumLightProbes ++;\n\n\t\t\t} else if ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.directionalShadow[ directionalLength ] = shadowUniforms;\n\t\t\t\t\tstate.directionalShadowMap[ directionalLength ] = shadowMap;\n\t\t\t\t\tstate.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumDirectionalShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.directional[ directionalLength ] = uniforms;\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\t\t\t\tuniforms.distance = distance;\n\n\t\t\t\tuniforms.coneCos = Math.cos( light.angle );\n\t\t\t\tuniforms.penumbraCos = Math.cos( light.angle * ( 1 - light.penumbra ) );\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tstate.spot[ spotLength ] = uniforms;\n\n\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\tif ( light.map ) {\n\n\t\t\t\t\tstate.spotLightMap[ numSpotMaps ] = light.map;\n\t\t\t\t\tnumSpotMaps ++;\n\n\t\t\t\t\t// make sure the lightMatrix is up to date\n\t\t\t\t\t// TODO : do it if required only\n\t\t\t\t\tshadow.updateMatrices( light );\n\n\t\t\t\t\tif ( light.castShadow ) numSpotShadowsWithMaps ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.spotLightMatrix[ spotLength ] = shadow.matrix;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\n\t\t\t\t\tstate.spotShadow[ spotLength ] = shadowUniforms;\n\t\t\t\t\tstate.spotShadowMap[ spotLength ] = shadowMap;\n\n\t\t\t\t\tnumSpotShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( color ).multiplyScalar( intensity );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tstate.rectArea[ rectAreaLength ] = uniforms;\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.color.copy( light.color ).multiplyScalar( light.intensity );\n\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\tif ( light.castShadow ) {\n\n\t\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\t\tconst shadowUniforms = shadowCache.get( light );\n\n\t\t\t\t\tshadowUniforms.shadowIntensity = shadow.intensity;\n\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\n\t\t\t\t\tstate.pointShadow[ pointLength ] = shadowUniforms;\n\t\t\t\t\tstate.pointShadowMap[ pointLength ] = shadowMap;\n\t\t\t\t\tstate.pointShadowMatrix[ pointLength ] = light.shadow.matrix;\n\n\t\t\t\t\tnumPointShadows ++;\n\n\t\t\t\t}\n\n\t\t\t\tstate.point[ pointLength ] = uniforms;\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = cache.get( light );\n\n\t\t\t\tuniforms.skyColor.copy( light.color ).multiplyScalar( intensity );\n\t\t\t\tuniforms.groundColor.copy( light.groundColor ).multiplyScalar( intensity );\n\n\t\t\t\tstate.hemi[ hemiLength ] = uniforms;\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( rectAreaLength > 0 ) {\n\n\t\t\tif ( extensions.has( 'OES_texture_float_linear' ) === true ) {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\n\t\t\t} else {\n\n\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.ambient[ 0 ] = r;\n\t\tstate.ambient[ 1 ] = g;\n\t\tstate.ambient[ 2 ] = b;\n\n\t\tconst hash = state.hash;\n\n\t\tif ( hash.directionalLength !== directionalLength ||\n\t\t\thash.pointLength !== pointLength ||\n\t\t\thash.spotLength !== spotLength ||\n\t\t\thash.rectAreaLength !== rectAreaLength ||\n\t\t\thash.hemiLength !== hemiLength ||\n\t\t\thash.numDirectionalShadows !== numDirectionalShadows ||\n\t\t\thash.numPointShadows !== numPointShadows ||\n\t\t\thash.numSpotShadows !== numSpotShadows ||\n\t\t\thash.numSpotMaps !== numSpotMaps ||\n\t\t\thash.numLightProbes !== numLightProbes ) {\n\n\t\t\tstate.directional.length = directionalLength;\n\t\t\tstate.spot.length = spotLength;\n\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\tstate.point.length = pointLength;\n\t\t\tstate.hemi.length = hemiLength;\n\n\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\tstate.spotLightMatrix.length = numSpotShadows + numSpotMaps - numSpotShadowsWithMaps;\n\t\t\tstate.spotLightMap.length = numSpotMaps;\n\t\t\tstate.numSpotLightShadowsWithMaps = numSpotShadowsWithMaps;\n\t\t\tstate.numLightProbes = numLightProbes;\n\n\t\t\thash.directionalLength = directionalLength;\n\t\t\thash.pointLength = pointLength;\n\t\t\thash.spotLength = spotLength;\n\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\thash.hemiLength = hemiLength;\n\n\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\thash.numPointShadows = numPointShadows;\n\t\t\thash.numSpotShadows = numSpotShadows;\n\t\t\thash.numSpotMaps = numSpotMaps;\n\n\t\t\thash.numLightProbes = numLightProbes;\n\n\t\t\tstate.version = nextVersion ++;\n\n\t\t}\n\n\t}\n\n\tfunction setupView( lights, camera ) {\n\n\t\tlet directionalLength = 0;\n\t\tlet pointLength = 0;\n\t\tlet spotLength = 0;\n\t\tlet rectAreaLength = 0;\n\t\tlet hemiLength = 0;\n\n\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\n\t\t\tif ( light.isDirectionalLight ) {\n\n\t\t\t\tconst uniforms = state.directional[ directionalLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tdirectionalLength ++;\n\n\t\t\t} else if ( light.isSpotLight ) {\n\n\t\t\t\tconst uniforms = state.spot[ spotLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tvector3.setFromMatrixPosition( light.target.matrixWorld );\n\t\t\t\tuniforms.direction.sub( vector3 );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\tspotLength ++;\n\n\t\t\t} else if ( light.isRectAreaLight ) {\n\n\t\t\t\tconst uniforms = state.rectArea[ rectAreaLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\t// extract local rotation of light to derive width/height half vectors\n\t\t\t\tmatrix42.identity();\n\t\t\t\tmatrix4.copy( light.matrixWorld );\n\t\t\t\tmatrix4.premultiply( viewMatrix );\n\t\t\t\tmatrix42.extractRotation( matrix4 );\n\n\t\t\t\tuniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );\n\t\t\t\tuniforms.halfHeight.set( 0.0, light.height * 0.5, 0.0 );\n\n\t\t\t\tuniforms.halfWidth.applyMatrix4( matrix42 );\n\t\t\t\tuniforms.halfHeight.applyMatrix4( matrix42 );\n\n\t\t\t\trectAreaLength ++;\n\n\t\t\t} else if ( light.isPointLight ) {\n\n\t\t\t\tconst uniforms = state.point[ pointLength ];\n\n\t\t\t\tuniforms.position.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.position.applyMatrix4( viewMatrix );\n\n\t\t\t\tpointLength ++;\n\n\t\t\t} else if ( light.isHemisphereLight ) {\n\n\t\t\t\tconst uniforms = state.hemi[ hemiLength ];\n\n\t\t\t\tuniforms.direction.setFromMatrixPosition( light.matrixWorld );\n\t\t\t\tuniforms.direction.transformDirection( viewMatrix );\n\n\t\t\t\themiLength ++;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn {\n\t\tsetup: setup,\n\t\tsetupView: setupView,\n\t\tstate: state\n\t};\n\n}\n\nfunction WebGLRenderState( extensions ) {\n\n\tconst lights = new WebGLLights( extensions );\n\n\tconst lightsArray = [];\n\tconst shadowsArray = [];\n\n\tfunction init( camera ) {\n\n\t\tstate.camera = camera;\n\n\t\tlightsArray.length = 0;\n\t\tshadowsArray.length = 0;\n\n\t}\n\n\tfunction pushLight( light ) {\n\n\t\tlightsArray.push( light );\n\n\t}\n\n\tfunction pushShadow( shadowLight ) {\n\n\t\tshadowsArray.push( shadowLight );\n\n\t}\n\n\tfunction setupLights() {\n\n\t\tlights.setup( lightsArray );\n\n\t}\n\n\tfunction setupLightsView( camera ) {\n\n\t\tlights.setupView( lightsArray, camera );\n\n\t}\n\n\tconst state = {\n\t\tlightsArray: lightsArray,\n\t\tshadowsArray: shadowsArray,\n\n\t\tcamera: null,\n\n\t\tlights: lights,\n\n\t\ttransmissionRenderTarget: {}\n\t};\n\n\treturn {\n\t\tinit: init,\n\t\tstate: state,\n\t\tsetupLights: setupLights,\n\t\tsetupLightsView: setupLightsView,\n\n\t\tpushLight: pushLight,\n\t\tpushShadow: pushShadow\n\t};\n\n}\n\nfunction WebGLRenderStates( extensions ) {\n\n\tlet renderStates = new WeakMap();\n\n\tfunction get( scene, renderCallDepth = 0 ) {\n\n\t\tconst renderStateArray = renderStates.get( scene );\n\t\tlet renderState;\n\n\t\tif ( renderStateArray === undefined ) {\n\n\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\trenderStates.set( scene, [ renderState ] );\n\n\t\t} else {\n\n\t\t\tif ( renderCallDepth >= renderStateArray.length ) {\n\n\t\t\t\trenderState = new WebGLRenderState( extensions );\n\t\t\t\trenderStateArray.push( renderState );\n\n\t\t\t} else {\n\n\t\t\t\trenderState = renderStateArray[ renderCallDepth ];\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn renderState;\n\n\t}\n\n\tfunction dispose() {\n\n\t\trenderStates = new WeakMap();\n\n\t}\n\n\treturn {\n\t\tget: get,\n\t\tdispose: dispose\n\t};\n\n}\n\nconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\nconst fragment = \"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}\";\n\nfunction WebGLShadowMap( renderer, objects, capabilities ) {\n\n\tlet _frustum = new Frustum();\n\n\tconst _shadowMapSize = new Vector2(),\n\t\t_viewportSize = new Vector2(),\n\n\t\t_viewport = new Vector4(),\n\n\t\t_depthMaterial = new MeshDepthMaterial( { depthPacking: RGBADepthPacking } ),\n\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\n\t\t_materialCache = {},\n\n\t\t_maxTextureSize = capabilities.maxTextureSize;\n\n\tconst shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide };\n\n\tconst shadowMaterialVertical = new ShaderMaterial( {\n\t\tdefines: {\n\t\t\tVSM_SAMPLES: 8\n\t\t},\n\t\tuniforms: {\n\t\t\tshadow_pass: { value: null },\n\t\t\tresolution: { value: new Vector2() },\n\t\t\tradius: { value: 4.0 }\n\t\t},\n\n\t\tvertexShader: vertex,\n\t\tfragmentShader: fragment\n\n\t} );\n\n\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\n\tconst fullScreenTri = new BufferGeometry();\n\tfullScreenTri.setAttribute(\n\t\t'position',\n\t\tnew BufferAttribute(\n\t\t\tnew Float32Array( [ -1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5 ] ),\n\t\t\t3\n\t\t)\n\t);\n\n\tconst fullScreenMesh = new Mesh( fullScreenTri, shadowMaterialVertical );\n\n\tconst scope = this;\n\n\tthis.enabled = false;\n\n\tthis.autoUpdate = true;\n\tthis.needsUpdate = false;\n\n\tthis.type = PCFShadowMap;\n\tlet _previousType = this.type;\n\n\tthis.render = function ( lights, scene, camera ) {\n\n\t\tif ( scope.enabled === false ) return;\n\t\tif ( scope.autoUpdate === false && scope.needsUpdate === false ) return;\n\n\t\tif ( lights.length === 0 ) return;\n\n\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\tconst activeCubeFace = renderer.getActiveCubeFace();\n\t\tconst activeMipmapLevel = renderer.getActiveMipmapLevel();\n\n\t\tconst _state = renderer.state;\n\n\t\t// Set GL state for depth map.\n\t\t_state.setBlending( NoBlending );\n\n\t\tif ( _state.buffers.depth.getReversed() ) {\n\n\t\t\t_state.buffers.color.setClear( 0, 0, 0, 0 );\n\n\t\t} else {\n\n\t\t\t_state.buffers.color.setClear( 1, 1, 1, 1 );\n\n\t\t}\n\n\t\t_state.buffers.depth.setTest( true );\n\t\t_state.setScissorTest( false );\n\n\t\t// check for shadow map type changes\n\n\t\tconst toVSM = ( _previousType !== VSMShadowMap && this.type === VSMShadowMap );\n\t\tconst fromVSM = ( _previousType === VSMShadowMap && this.type !== VSMShadowMap );\n\n\t\t// render depth map\n\n\t\tfor ( let i = 0, il = lights.length; i < il; i ++ ) {\n\n\t\t\tconst light = lights[ i ];\n\t\t\tconst shadow = light.shadow;\n\n\t\t\tif ( shadow === undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tif ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;\n\n\t\t\t_shadowMapSize.copy( shadow.mapSize );\n\n\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t_shadowMapSize.multiply( shadowFrameExtents );\n\n\t\t\t_viewportSize.copy( shadow.mapSize );\n\n\t\t\tif ( _shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\tif ( _shadowMapSize.x > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.x = Math.floor( _maxTextureSize / shadowFrameExtents.x );\n\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\n\t\t\t\t}\n\n\t\t\t\tif ( _shadowMapSize.y > _maxTextureSize ) {\n\n\t\t\t\t\t_viewportSize.y = Math.floor( _maxTextureSize / shadowFrameExtents.y );\n\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( shadow.map === null || toVSM === true || fromVSM === true ) {\n\n\t\t\t\tconst pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};\n\n\t\t\t\tif ( shadow.map !== null ) {\n\n\t\t\t\t\tshadow.map.dispose();\n\n\t\t\t\t}\n\n\t\t\t\tshadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );\n\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\n\t\t\t\tshadow.camera.updateProjectionMatrix();\n\n\t\t\t}\n\n\t\t\trenderer.setRenderTarget( shadow.map );\n\t\t\trenderer.clear();\n\n\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\tfor ( let vp = 0; vp < viewportCount; vp ++ ) {\n\n\t\t\t\tconst viewport = shadow.getViewport( vp );\n\n\t\t\t\t_viewport.set(\n\t\t\t\t\t_viewportSize.x * viewport.x,\n\t\t\t\t\t_viewportSize.y * viewport.y,\n\t\t\t\t\t_viewportSize.x * viewport.z,\n\t\t\t\t\t_viewportSize.y * viewport.w\n\t\t\t\t);\n\n\t\t\t\t_state.viewport( _viewport );\n\n\t\t\t\tshadow.updateMatrices( light, vp );\n\n\t\t\t\t_frustum = shadow.getFrustum();\n\n\t\t\t\trenderObject( scene, camera, shadow.camera, light, this.type );\n\n\t\t\t}\n\n\t\t\t// do blur pass for VSM\n\n\t\t\tif ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {\n\n\t\t\t\tVSMPass( shadow, camera );\n\n\t\t\t}\n\n\t\t\tshadow.needsUpdate = false;\n\n\t\t}\n\n\t\t_previousType = this.type;\n\n\t\tscope.needsUpdate = false;\n\n\t\trenderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );\n\n\t};\n\n\tfunction VSMPass( shadow, camera ) {\n\n\t\tconst geometry = objects.update( fullScreenMesh );\n\n\t\tif ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {\n\n\t\t\tshadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples;\n\t\t\tshadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples;\n\n\t\t\tshadowMaterialVertical.needsUpdate = true;\n\t\t\tshadowMaterialHorizontal.needsUpdate = true;\n\n\t\t}\n\n\t\tif ( shadow.mapPass === null ) {\n\n\t\t\tshadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );\n\n\t\t}\n\n\t\t// vertical pass\n\n\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.mapPass );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );\n\n\t\t// horizontal pass\n\n\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\trenderer.setRenderTarget( shadow.map );\n\t\trenderer.clear();\n\t\trenderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );\n\n\t}\n\n\tfunction getDepthMaterial( object, material, light, type ) {\n\n\t\tlet result = null;\n\n\t\tconst customMaterial = ( light.isPointLight === true ) ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\tif ( customMaterial !== undefined ) {\n\n\t\t\tresult = customMaterial;\n\n\t\t} else {\n\n\t\t\tresult = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;\n\n\t\t\tif ( ( renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||\n\t\t\t\t( material.displacementMap && material.displacementScale !== 0 ) ||\n\t\t\t\t( material.alphaMap && material.alphaTest > 0 ) ||\n\t\t\t\t( material.map && material.alphaTest > 0 ) ||\n\t\t\t\t( material.alphaToCoverage === true ) ) {\n\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\n\t\t\t\tconst keyA = result.uuid, keyB = material.uuid;\n\n\t\t\t\tlet materialsForVariant = _materialCache[ keyA ];\n\n\t\t\t\tif ( materialsForVariant === undefined ) {\n\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[ keyA ] = materialsForVariant;\n\n\t\t\t\t}\n\n\t\t\t\tlet cachedMaterial = materialsForVariant[ keyB ];\n\n\t\t\t\tif ( cachedMaterial === undefined ) {\n\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[ keyB ] = cachedMaterial;\n\t\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\n\t\t\t}\n\n\t\t}\n\n\t\tresult.visible = material.visible;\n\t\tresult.wireframe = material.wireframe;\n\n\t\tif ( type === VSMShadowMap ) {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : material.side;\n\n\t\t} else {\n\n\t\t\tresult.side = ( material.shadowSide !== null ) ? material.shadowSide : shadowSide[ material.side ];\n\n\t\t}\n\n\t\tresult.alphaMap = material.alphaMap;\n\t\tresult.alphaTest = ( material.alphaToCoverage === true ) ? 0.5 : material.alphaTest; // approximate alphaToCoverage by using a fixed alphaTest value\n\t\tresult.map = material.map;\n\n\t\tresult.clipShadows = material.clipShadows;\n\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\tresult.clipIntersection = material.clipIntersection;\n\n\t\tresult.displacementMap = material.displacementMap;\n\t\tresult.displacementScale = material.displacementScale;\n\t\tresult.displacementBias = material.displacementBias;\n\n\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\tresult.linewidth = material.linewidth;\n\n\t\tif ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {\n\n\t\t\tconst materialProperties = renderer.properties.get( result );\n\t\t\tmaterialProperties.light = light;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tfunction renderObject( object, camera, shadowCamera, light, type ) {\n\n\t\tif ( object.visible === false ) return;\n\n\t\tconst visible = object.layers.test( camera.layers );\n\n\t\tif ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {\n\n\t\t\tif ( ( object.castShadow || ( object.receiveShadow && type === VSMShadowMap ) ) && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) {\n\n\t\t\t\tobject.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );\n\n\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\tfor ( let k = 0, kl = groups.length; k < kl; k ++ ) {\n\n\t\t\t\t\t\tconst group = groups[ k ];\n\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, groupMaterial, light, type );\n\n\t\t\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );\n\n\t\t\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\tconst depthMaterial = getDepthMaterial( object, material, light, type );\n\n\t\t\t\t\tobject.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t\trenderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );\n\n\t\t\t\t\tobject.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst children = object.children;\n\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\trenderObject( children[ i ], camera, shadowCamera, light, type );\n\n\t\t}\n\n\t}\n\n\tfunction onMaterialDispose( event ) {\n\n\t\tconst material = event.target;\n\n\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t// make sure to remove the unique distance/depth materials used for shadow map rendering\n\n\t\tfor ( const id in _materialCache ) {\n\n\t\t\tconst cache = _materialCache[ id ];\n\n\t\t\tconst uuid = event.target.uuid;\n\n\t\t\tif ( uuid in cache ) {\n\n\t\t\t\tconst shadowMaterial = cache[ uuid ];\n\t\t\t\tshadowMaterial.dispose();\n\t\t\t\tdelete cache[ uuid ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nconst reversedFuncs = {\n\t[ NeverDepth ]: AlwaysDepth,\n\t[ LessDepth ]: GreaterDepth,\n\t[ EqualDepth ]: NotEqualDepth,\n\t[ LessEqualDepth ]: GreaterEqualDepth,\n\n\t[ AlwaysDepth ]: NeverDepth,\n\t[ GreaterDepth ]: LessDepth,\n\t[ NotEqualDepth ]: EqualDepth,\n\t[ GreaterEqualDepth ]: LessEqualDepth,\n};\n\nfunction WebGLState( gl, extensions ) {\n\n\tfunction ColorBuffer() {\n\n\t\tlet locked = false;\n\n\t\tconst color = new Vector4();\n\t\tlet currentColorMask = null;\n\t\tconst currentColorClear = new Vector4( 0, 0, 0, 0 );\n\n\t\treturn {\n\n\t\t\tsetMask: function ( colorMask ) {\n\n\t\t\t\tif ( currentColorMask !== colorMask && ! locked ) {\n\n\t\t\t\t\tgl.colorMask( colorMask, colorMask, colorMask, colorMask );\n\t\t\t\t\tcurrentColorMask = colorMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( r, g, b, a, premultipliedAlpha ) {\n\n\t\t\t\tif ( premultipliedAlpha === true ) {\n\n\t\t\t\t\tr *= a; g *= a; b *= a;\n\n\t\t\t\t}\n\n\t\t\t\tcolor.set( r, g, b, a );\n\n\t\t\t\tif ( currentColorClear.equals( color ) === false ) {\n\n\t\t\t\t\tgl.clearColor( r, g, b, a );\n\t\t\t\t\tcurrentColorClear.copy( color );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentColorMask = null;\n\t\t\t\tcurrentColorClear.set( -1, 0, 0, 0 ); // set to invalid state\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction DepthBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentReversed = false;\n\t\tlet currentDepthMask = null;\n\t\tlet currentDepthFunc = null;\n\t\tlet currentDepthClear = null;\n\n\t\treturn {\n\n\t\t\tsetReversed: function ( reversed ) {\n\n\t\t\t\tif ( currentReversed !== reversed ) {\n\n\t\t\t\t\tconst ext = extensions.get( 'EXT_clip_control' );\n\n\t\t\t\t\tif ( reversed ) {\n\n\t\t\t\t\t\text.clipControlEXT( ext.LOWER_LEFT_EXT, ext.ZERO_TO_ONE_EXT );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\text.clipControlEXT( ext.LOWER_LEFT_EXT, ext.NEGATIVE_ONE_TO_ONE_EXT );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentReversed = reversed;\n\n\t\t\t\t\tconst oldDepth = currentDepthClear;\n\t\t\t\t\tcurrentDepthClear = null;\n\t\t\t\t\tthis.setClear( oldDepth );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tgetReversed: function () {\n\n\t\t\t\treturn currentReversed;\n\n\t\t\t},\n\n\t\t\tsetTest: function ( depthTest ) {\n\n\t\t\t\tif ( depthTest ) {\n\n\t\t\t\t\tenable( gl.DEPTH_TEST );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdisable( gl.DEPTH_TEST );\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( depthMask ) {\n\n\t\t\t\tif ( currentDepthMask !== depthMask && ! locked ) {\n\n\t\t\t\t\tgl.depthMask( depthMask );\n\t\t\t\t\tcurrentDepthMask = depthMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( depthFunc ) {\n\n\t\t\t\tif ( currentReversed ) depthFunc = reversedFuncs[ depthFunc ];\n\n\t\t\t\tif ( currentDepthFunc !== depthFunc ) {\n\n\t\t\t\t\tswitch ( depthFunc ) {\n\n\t\t\t\t\t\tcase NeverDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NEVER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AlwaysDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.ALWAYS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LESS );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase LessEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.EQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase GreaterDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.GREATER );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase NotEqualDepth:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.NOTEQUAL );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t\tgl.depthFunc( gl.LEQUAL );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( depth ) {\n\n\t\t\t\tif ( currentDepthClear !== depth ) {\n\n\t\t\t\t\tif ( currentReversed ) {\n\n\t\t\t\t\t\tdepth = 1 - depth;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl.clearDepth( depth );\n\t\t\t\t\tcurrentDepthClear = depth;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentDepthMask = null;\n\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\tcurrentDepthClear = null;\n\t\t\t\tcurrentReversed = false;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\tfunction StencilBuffer() {\n\n\t\tlet locked = false;\n\n\t\tlet currentStencilMask = null;\n\t\tlet currentStencilFunc = null;\n\t\tlet currentStencilRef = null;\n\t\tlet currentStencilFuncMask = null;\n\t\tlet currentStencilFail = null;\n\t\tlet currentStencilZFail = null;\n\t\tlet currentStencilZPass = null;\n\t\tlet currentStencilClear = null;\n\n\t\treturn {\n\n\t\t\tsetTest: function ( stencilTest ) {\n\n\t\t\t\tif ( ! locked ) {\n\n\t\t\t\t\tif ( stencilTest ) {\n\n\t\t\t\t\t\tenable( gl.STENCIL_TEST );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tdisable( gl.STENCIL_TEST );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetMask: function ( stencilMask ) {\n\n\t\t\t\tif ( currentStencilMask !== stencilMask && ! locked ) {\n\n\t\t\t\t\tgl.stencilMask( stencilMask );\n\t\t\t\t\tcurrentStencilMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetFunc: function ( stencilFunc, stencilRef, stencilMask ) {\n\n\t\t\t\tif ( currentStencilFunc !== stencilFunc ||\n\t\t\t\t     currentStencilRef !== stencilRef ||\n\t\t\t\t     currentStencilFuncMask !== stencilMask ) {\n\n\t\t\t\t\tgl.stencilFunc( stencilFunc, stencilRef, stencilMask );\n\n\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetOp: function ( stencilFail, stencilZFail, stencilZPass ) {\n\n\t\t\t\tif ( currentStencilFail !== stencilFail ||\n\t\t\t\t     currentStencilZFail !== stencilZFail ||\n\t\t\t\t     currentStencilZPass !== stencilZPass ) {\n\n\t\t\t\t\tgl.stencilOp( stencilFail, stencilZFail, stencilZPass );\n\n\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\tsetLocked: function ( lock ) {\n\n\t\t\t\tlocked = lock;\n\n\t\t\t},\n\n\t\t\tsetClear: function ( stencil ) {\n\n\t\t\t\tif ( currentStencilClear !== stencil ) {\n\n\t\t\t\t\tgl.clearStencil( stencil );\n\t\t\t\t\tcurrentStencilClear = stencil;\n\n\t\t\t\t}\n\n\t\t\t},\n\n\t\t\treset: function () {\n\n\t\t\t\tlocked = false;\n\n\t\t\t\tcurrentStencilMask = null;\n\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\tcurrentStencilRef = null;\n\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\tcurrentStencilFail = null;\n\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\tcurrentStencilClear = null;\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n\t//\n\n\tconst colorBuffer = new ColorBuffer();\n\tconst depthBuffer = new DepthBuffer();\n\tconst stencilBuffer = new StencilBuffer();\n\n\tconst uboBindings = new WeakMap();\n\tconst uboProgramMap = new WeakMap();\n\n\tlet enabledCapabilities = {};\n\n\tlet currentBoundFramebuffers = {};\n\tlet currentDrawbuffers = new WeakMap();\n\tlet defaultDrawbuffers = [];\n\n\tlet currentProgram = null;\n\n\tlet currentBlendingEnabled = false;\n\tlet currentBlending = null;\n\tlet currentBlendEquation = null;\n\tlet currentBlendSrc = null;\n\tlet currentBlendDst = null;\n\tlet currentBlendEquationAlpha = null;\n\tlet currentBlendSrcAlpha = null;\n\tlet currentBlendDstAlpha = null;\n\tlet currentBlendColor = new Color( 0, 0, 0 );\n\tlet currentBlendAlpha = 0;\n\tlet currentPremultipledAlpha = false;\n\n\tlet currentFlipSided = null;\n\tlet currentCullFace = null;\n\n\tlet currentLineWidth = null;\n\n\tlet currentPolygonOffsetFactor = null;\n\tlet currentPolygonOffsetUnits = null;\n\n\tconst maxTextures = gl.getParameter( gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS );\n\n\tlet lineWidthAvailable = false;\n\tlet version = 0;\n\tconst glVersion = gl.getParameter( gl.VERSION );\n\n\tif ( glVersion.indexOf( 'WebGL' ) !== -1 ) {\n\n\t\tversion = parseFloat( /^WebGL (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 1.0 );\n\n\t} else if ( glVersion.indexOf( 'OpenGL ES' ) !== -1 ) {\n\n\t\tversion = parseFloat( /^OpenGL ES (\\d)/.exec( glVersion )[ 1 ] );\n\t\tlineWidthAvailable = ( version >= 2.0 );\n\n\t}\n\n\tlet currentTextureSlot = null;\n\tlet currentBoundTextures = {};\n\n\tconst scissorParam = gl.getParameter( gl.SCISSOR_BOX );\n\tconst viewportParam = gl.getParameter( gl.VIEWPORT );\n\n\tconst currentScissor = new Vector4().fromArray( scissorParam );\n\tconst currentViewport = new Vector4().fromArray( viewportParam );\n\n\tfunction createTexture( type, target, count, dimensions ) {\n\n\t\tconst data = new Uint8Array( 4 ); // 4 is required to match default unpack alignment of 4.\n\t\tconst texture = gl.createTexture();\n\n\t\tgl.bindTexture( type, texture );\n\t\tgl.texParameteri( type, gl.TEXTURE_MIN_FILTER, gl.NEAREST );\n\t\tgl.texParameteri( type, gl.TEXTURE_MAG_FILTER, gl.NEAREST );\n\n\t\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\t\tif ( type === gl.TEXTURE_3D || type === gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tgl.texImage3D( target, 0, gl.RGBA, 1, 1, dimensions, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t} else {\n\n\t\t\t\tgl.texImage2D( target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn texture;\n\n\t}\n\n\tconst emptyTextures = {};\n\temptyTextures[ gl.TEXTURE_2D ] = createTexture( gl.TEXTURE_2D, gl.TEXTURE_2D, 1 );\n\temptyTextures[ gl.TEXTURE_CUBE_MAP ] = createTexture( gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6 );\n\temptyTextures[ gl.TEXTURE_2D_ARRAY ] = createTexture( gl.TEXTURE_2D_ARRAY, gl.TEXTURE_2D_ARRAY, 1, 1 );\n\temptyTextures[ gl.TEXTURE_3D ] = createTexture( gl.TEXTURE_3D, gl.TEXTURE_3D, 1, 1 );\n\n\t// init\n\n\tcolorBuffer.setClear( 0, 0, 0, 1 );\n\tdepthBuffer.setClear( 1 );\n\tstencilBuffer.setClear( 0 );\n\n\tenable( gl.DEPTH_TEST );\n\tdepthBuffer.setFunc( LessEqualDepth );\n\n\tsetFlipSided( false );\n\tsetCullFace( CullFaceBack );\n\tenable( gl.CULL_FACE );\n\n\tsetBlending( NoBlending );\n\n\t//\n\n\tfunction enable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== true ) {\n\n\t\t\tgl.enable( id );\n\t\t\tenabledCapabilities[ id ] = true;\n\n\t\t}\n\n\t}\n\n\tfunction disable( id ) {\n\n\t\tif ( enabledCapabilities[ id ] !== false ) {\n\n\t\t\tgl.disable( id );\n\t\t\tenabledCapabilities[ id ] = false;\n\n\t\t}\n\n\t}\n\n\tfunction bindFramebuffer( target, framebuffer ) {\n\n\t\tif ( currentBoundFramebuffers[ target ] !== framebuffer ) {\n\n\t\t\tgl.bindFramebuffer( target, framebuffer );\n\n\t\t\tcurrentBoundFramebuffers[ target ] = framebuffer;\n\n\t\t\t// gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER\n\n\t\t\tif ( target === gl.DRAW_FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\tif ( target === gl.FRAMEBUFFER ) {\n\n\t\t\t\tcurrentBoundFramebuffers[ gl.DRAW_FRAMEBUFFER ] = framebuffer;\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction drawBuffers( renderTarget, framebuffer ) {\n\n\t\tlet drawBuffers = defaultDrawbuffers;\n\n\t\tlet needsUpdate = false;\n\n\t\tif ( renderTarget ) {\n\n\t\t\tdrawBuffers = currentDrawbuffers.get( framebuffer );\n\n\t\t\tif ( drawBuffers === undefined ) {\n\n\t\t\t\tdrawBuffers = [];\n\t\t\t\tcurrentDrawbuffers.set( framebuffer, drawBuffers );\n\n\t\t\t}\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tif ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tdrawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;\n\n\t\t\t\t}\n\n\t\t\t\tdrawBuffers.length = textures.length;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( drawBuffers[ 0 ] !== gl.BACK ) {\n\n\t\t\t\tdrawBuffers[ 0 ] = gl.BACK;\n\n\t\t\t\tneedsUpdate = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\tgl.drawBuffers( drawBuffers );\n\n\t\t}\n\n\t}\n\n\tfunction useProgram( program ) {\n\n\t\tif ( currentProgram !== program ) {\n\n\t\t\tgl.useProgram( program );\n\n\t\t\tcurrentProgram = program;\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tconst equationToGL = {\n\t\t[ AddEquation ]: gl.FUNC_ADD,\n\t\t[ SubtractEquation ]: gl.FUNC_SUBTRACT,\n\t\t[ ReverseSubtractEquation ]: gl.FUNC_REVERSE_SUBTRACT\n\t};\n\n\tequationToGL[ MinEquation ] = gl.MIN;\n\tequationToGL[ MaxEquation ] = gl.MAX;\n\n\tconst factorToGL = {\n\t\t[ ZeroFactor ]: gl.ZERO,\n\t\t[ OneFactor ]: gl.ONE,\n\t\t[ SrcColorFactor ]: gl.SRC_COLOR,\n\t\t[ SrcAlphaFactor ]: gl.SRC_ALPHA,\n\t\t[ SrcAlphaSaturateFactor ]: gl.SRC_ALPHA_SATURATE,\n\t\t[ DstColorFactor ]: gl.DST_COLOR,\n\t\t[ DstAlphaFactor ]: gl.DST_ALPHA,\n\t\t[ OneMinusSrcColorFactor ]: gl.ONE_MINUS_SRC_COLOR,\n\t\t[ OneMinusSrcAlphaFactor ]: gl.ONE_MINUS_SRC_ALPHA,\n\t\t[ OneMinusDstColorFactor ]: gl.ONE_MINUS_DST_COLOR,\n\t\t[ OneMinusDstAlphaFactor ]: gl.ONE_MINUS_DST_ALPHA,\n\t\t[ ConstantColorFactor ]: gl.CONSTANT_COLOR,\n\t\t[ OneMinusConstantColorFactor ]: gl.ONE_MINUS_CONSTANT_COLOR,\n\t\t[ ConstantAlphaFactor ]: gl.CONSTANT_ALPHA,\n\t\t[ OneMinusConstantAlphaFactor ]: gl.ONE_MINUS_CONSTANT_ALPHA\n\t};\n\n\tfunction setBlending( blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, blendColor, blendAlpha, premultipliedAlpha ) {\n\n\t\tif ( blending === NoBlending ) {\n\n\t\t\tif ( currentBlendingEnabled === true ) {\n\n\t\t\t\tdisable( gl.BLEND );\n\t\t\t\tcurrentBlendingEnabled = false;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( currentBlendingEnabled === false ) {\n\n\t\t\tenable( gl.BLEND );\n\t\t\tcurrentBlendingEnabled = true;\n\n\t\t}\n\n\t\tif ( blending !== CustomBlending ) {\n\n\t\t\tif ( blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha ) {\n\n\t\t\t\tif ( currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation ) {\n\n\t\t\t\t\tgl.blendEquation( gl.FUNC_ADD );\n\n\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\n\t\t\t\t}\n\n\t\t\t\tif ( premultipliedAlpha ) {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFunc( gl.ONE, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ZERO, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tswitch ( blending ) {\n\n\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\tgl.blendFuncSeparate( gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tconsole.error( 'THREE.WebGLState: Invalid blending: ', blending );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\tcurrentBlendDst = null;\n\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\tcurrentBlendDstAlpha = null;\n\t\t\t\tcurrentBlendColor.set( 0, 0, 0 );\n\t\t\t\tcurrentBlendAlpha = 0;\n\n\t\t\t\tcurrentBlending = blending;\n\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\n\t\t\t}\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// custom blending\n\n\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\tif ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {\n\n\t\t\tgl.blendEquationSeparate( equationToGL[ blendEquation ], equationToGL[ blendEquationAlpha ] );\n\n\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\n\t\t}\n\n\t\tif ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {\n\n\t\t\tgl.blendFuncSeparate( factorToGL[ blendSrc ], factorToGL[ blendDst ], factorToGL[ blendSrcAlpha ], factorToGL[ blendDstAlpha ] );\n\n\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\tcurrentBlendDst = blendDst;\n\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\n\t\t}\n\n\t\tif ( blendColor.equals( currentBlendColor ) === false || blendAlpha !== currentBlendAlpha ) {\n\n\t\t\tgl.blendColor( blendColor.r, blendColor.g, blendColor.b, blendAlpha );\n\n\t\t\tcurrentBlendColor.copy( blendColor );\n\t\t\tcurrentBlendAlpha = blendAlpha;\n\n\t\t}\n\n\t\tcurrentBlending = blending;\n\t\tcurrentPremultipledAlpha = false;\n\n\t}\n\n\tfunction setMaterial( material, frontFaceCW ) {\n\n\t\tmaterial.side === DoubleSide\n\t\t\t? disable( gl.CULL_FACE )\n\t\t\t: enable( gl.CULL_FACE );\n\n\t\tlet flipSided = ( material.side === BackSide );\n\t\tif ( frontFaceCW ) flipSided = ! flipSided;\n\n\t\tsetFlipSided( flipSided );\n\n\t\t( material.blending === NormalBlending && material.transparent === false )\n\t\t\t? setBlending( NoBlending )\n\t\t\t: setBlending( material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.blendColor, material.blendAlpha, material.premultipliedAlpha );\n\n\t\tdepthBuffer.setFunc( material.depthFunc );\n\t\tdepthBuffer.setTest( material.depthTest );\n\t\tdepthBuffer.setMask( material.depthWrite );\n\t\tcolorBuffer.setMask( material.colorWrite );\n\n\t\tconst stencilWrite = material.stencilWrite;\n\t\tstencilBuffer.setTest( stencilWrite );\n\t\tif ( stencilWrite ) {\n\n\t\t\tstencilBuffer.setMask( material.stencilWriteMask );\n\t\t\tstencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask );\n\t\t\tstencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass );\n\n\t\t}\n\n\t\tsetPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits );\n\n\t\tmaterial.alphaToCoverage === true\n\t\t\t? enable( gl.SAMPLE_ALPHA_TO_COVERAGE )\n\t\t\t: disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t}\n\n\t//\n\n\tfunction setFlipSided( flipSided ) {\n\n\t\tif ( currentFlipSided !== flipSided ) {\n\n\t\t\tif ( flipSided ) {\n\n\t\t\t\tgl.frontFace( gl.CW );\n\n\t\t\t} else {\n\n\t\t\t\tgl.frontFace( gl.CCW );\n\n\t\t\t}\n\n\t\t\tcurrentFlipSided = flipSided;\n\n\t\t}\n\n\t}\n\n\tfunction setCullFace( cullFace ) {\n\n\t\tif ( cullFace !== CullFaceNone ) {\n\n\t\t\tenable( gl.CULL_FACE );\n\n\t\t\tif ( cullFace !== currentCullFace ) {\n\n\t\t\t\tif ( cullFace === CullFaceBack ) {\n\n\t\t\t\t\tgl.cullFace( gl.BACK );\n\n\t\t\t\t} else if ( cullFace === CullFaceFront ) {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tgl.cullFace( gl.FRONT_AND_BACK );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.CULL_FACE );\n\n\t\t}\n\n\t\tcurrentCullFace = cullFace;\n\n\t}\n\n\tfunction setLineWidth( width ) {\n\n\t\tif ( width !== currentLineWidth ) {\n\n\t\t\tif ( lineWidthAvailable ) gl.lineWidth( width );\n\n\t\t\tcurrentLineWidth = width;\n\n\t\t}\n\n\t}\n\n\tfunction setPolygonOffset( polygonOffset, factor, units ) {\n\n\t\tif ( polygonOffset ) {\n\n\t\t\tenable( gl.POLYGON_OFFSET_FILL );\n\n\t\t\tif ( currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units ) {\n\n\t\t\t\tgl.polygonOffset( factor, units );\n\n\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\tcurrentPolygonOffsetUnits = units;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tdisable( gl.POLYGON_OFFSET_FILL );\n\n\t\t}\n\n\t}\n\n\tfunction setScissorTest( scissorTest ) {\n\n\t\tif ( scissorTest ) {\n\n\t\t\tenable( gl.SCISSOR_TEST );\n\n\t\t} else {\n\n\t\t\tdisable( gl.SCISSOR_TEST );\n\n\t\t}\n\n\t}\n\n\t// texture\n\n\tfunction activeTexture( webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\tgl.activeTexture( webglSlot );\n\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t}\n\n\t}\n\n\tfunction bindTexture( webglType, webglTexture, webglSlot ) {\n\n\t\tif ( webglSlot === undefined ) {\n\n\t\t\tif ( currentTextureSlot === null ) {\n\n\t\t\t\twebglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\t} else {\n\n\t\t\t\twebglSlot = currentTextureSlot;\n\n\t\t\t}\n\n\t\t}\n\n\t\tlet boundTexture = currentBoundTextures[ webglSlot ];\n\n\t\tif ( boundTexture === undefined ) {\n\n\t\t\tboundTexture = { type: undefined, texture: undefined };\n\t\t\tcurrentBoundTextures[ webglSlot ] = boundTexture;\n\n\t\t}\n\n\t\tif ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {\n\n\t\t\tif ( currentTextureSlot !== webglSlot ) {\n\n\t\t\t\tgl.activeTexture( webglSlot );\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\n\t\t\t}\n\n\t\t\tgl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );\n\n\t\t\tboundTexture.type = webglType;\n\t\t\tboundTexture.texture = webglTexture;\n\n\t\t}\n\n\t}\n\n\tfunction unbindTexture() {\n\n\t\tconst boundTexture = currentBoundTextures[ currentTextureSlot ];\n\n\t\tif ( boundTexture !== undefined && boundTexture.type !== undefined ) {\n\n\t\t\tgl.bindTexture( boundTexture.type, null );\n\n\t\t\tboundTexture.type = undefined;\n\t\t\tboundTexture.texture = undefined;\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage2D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexImage3D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage2D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texSubImage3D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage2D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction compressedTexSubImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.compressedTexSubImage3D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage2D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texStorage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texStorage3D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage2D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage2D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\tfunction texImage3D() {\n\n\t\ttry {\n\n\t\t\tgl.texImage3D( ...arguments );\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLState:', error );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction scissor( scissor ) {\n\n\t\tif ( currentScissor.equals( scissor ) === false ) {\n\n\t\t\tgl.scissor( scissor.x, scissor.y, scissor.z, scissor.w );\n\t\t\tcurrentScissor.copy( scissor );\n\n\t\t}\n\n\t}\n\n\tfunction viewport( viewport ) {\n\n\t\tif ( currentViewport.equals( viewport ) === false ) {\n\n\t\t\tgl.viewport( viewport.x, viewport.y, viewport.z, viewport.w );\n\t\t\tcurrentViewport.copy( viewport );\n\n\t\t}\n\n\t}\n\n\tfunction updateUBOMapping( uniformsGroup, program ) {\n\n\t\tlet mapping = uboProgramMap.get( program );\n\n\t\tif ( mapping === undefined ) {\n\n\t\t\tmapping = new WeakMap();\n\n\t\t\tuboProgramMap.set( program, mapping );\n\n\t\t}\n\n\t\tlet blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( blockIndex === undefined ) {\n\n\t\t\tblockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name );\n\n\t\t\tmapping.set( uniformsGroup, blockIndex );\n\n\t\t}\n\n\t}\n\n\tfunction uniformBlockBinding( uniformsGroup, program ) {\n\n\t\tconst mapping = uboProgramMap.get( program );\n\t\tconst blockIndex = mapping.get( uniformsGroup );\n\n\t\tif ( uboBindings.get( program ) !== blockIndex ) {\n\n\t\t\t// bind shader specific block index to global block point\n\t\t\tgl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );\n\n\t\t\tuboBindings.set( program, blockIndex );\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction reset() {\n\n\t\t// reset state\n\n\t\tgl.disable( gl.BLEND );\n\t\tgl.disable( gl.CULL_FACE );\n\t\tgl.disable( gl.DEPTH_TEST );\n\t\tgl.disable( gl.POLYGON_OFFSET_FILL );\n\t\tgl.disable( gl.SCISSOR_TEST );\n\t\tgl.disable( gl.STENCIL_TEST );\n\t\tgl.disable( gl.SAMPLE_ALPHA_TO_COVERAGE );\n\n\t\tgl.blendEquation( gl.FUNC_ADD );\n\t\tgl.blendFunc( gl.ONE, gl.ZERO );\n\t\tgl.blendFuncSeparate( gl.ONE, gl.ZERO, gl.ONE, gl.ZERO );\n\t\tgl.blendColor( 0, 0, 0, 0 );\n\n\t\tgl.colorMask( true, true, true, true );\n\t\tgl.clearColor( 0, 0, 0, 0 );\n\n\t\tgl.depthMask( true );\n\t\tgl.depthFunc( gl.LESS );\n\n\t\tdepthBuffer.setReversed( false );\n\n\t\tgl.clearDepth( 1 );\n\n\t\tgl.stencilMask( 0xffffffff );\n\t\tgl.stencilFunc( gl.ALWAYS, 0, 0xffffffff );\n\t\tgl.stencilOp( gl.KEEP, gl.KEEP, gl.KEEP );\n\t\tgl.clearStencil( 0 );\n\n\t\tgl.cullFace( gl.BACK );\n\t\tgl.frontFace( gl.CCW );\n\n\t\tgl.polygonOffset( 0, 0 );\n\n\t\tgl.activeTexture( gl.TEXTURE0 );\n\n\t\tgl.bindFramebuffer( gl.FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.DRAW_FRAMEBUFFER, null );\n\t\tgl.bindFramebuffer( gl.READ_FRAMEBUFFER, null );\n\n\t\tgl.useProgram( null );\n\n\t\tgl.lineWidth( 1 );\n\n\t\tgl.scissor( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tgl.viewport( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\t// reset internals\n\n\t\tenabledCapabilities = {};\n\n\t\tcurrentTextureSlot = null;\n\t\tcurrentBoundTextures = {};\n\n\t\tcurrentBoundFramebuffers = {};\n\t\tcurrentDrawbuffers = new WeakMap();\n\t\tdefaultDrawbuffers = [];\n\n\t\tcurrentProgram = null;\n\n\t\tcurrentBlendingEnabled = false;\n\t\tcurrentBlending = null;\n\t\tcurrentBlendEquation = null;\n\t\tcurrentBlendSrc = null;\n\t\tcurrentBlendDst = null;\n\t\tcurrentBlendEquationAlpha = null;\n\t\tcurrentBlendSrcAlpha = null;\n\t\tcurrentBlendDstAlpha = null;\n\t\tcurrentBlendColor = new Color( 0, 0, 0 );\n\t\tcurrentBlendAlpha = 0;\n\t\tcurrentPremultipledAlpha = false;\n\n\t\tcurrentFlipSided = null;\n\t\tcurrentCullFace = null;\n\n\t\tcurrentLineWidth = null;\n\n\t\tcurrentPolygonOffsetFactor = null;\n\t\tcurrentPolygonOffsetUnits = null;\n\n\t\tcurrentScissor.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\t\tcurrentViewport.set( 0, 0, gl.canvas.width, gl.canvas.height );\n\n\t\tcolorBuffer.reset();\n\t\tdepthBuffer.reset();\n\t\tstencilBuffer.reset();\n\n\t}\n\n\treturn {\n\n\t\tbuffers: {\n\t\t\tcolor: colorBuffer,\n\t\t\tdepth: depthBuffer,\n\t\t\tstencil: stencilBuffer\n\t\t},\n\n\t\tenable: enable,\n\t\tdisable: disable,\n\n\t\tbindFramebuffer: bindFramebuffer,\n\t\tdrawBuffers: drawBuffers,\n\n\t\tuseProgram: useProgram,\n\n\t\tsetBlending: setBlending,\n\t\tsetMaterial: setMaterial,\n\n\t\tsetFlipSided: setFlipSided,\n\t\tsetCullFace: setCullFace,\n\n\t\tsetLineWidth: setLineWidth,\n\t\tsetPolygonOffset: setPolygonOffset,\n\n\t\tsetScissorTest: setScissorTest,\n\n\t\tactiveTexture: activeTexture,\n\t\tbindTexture: bindTexture,\n\t\tunbindTexture: unbindTexture,\n\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\tcompressedTexImage3D: compressedTexImage3D,\n\t\ttexImage2D: texImage2D,\n\t\ttexImage3D: texImage3D,\n\n\t\tupdateUBOMapping: updateUBOMapping,\n\t\tuniformBlockBinding: uniformBlockBinding,\n\n\t\ttexStorage2D: texStorage2D,\n\t\ttexStorage3D: texStorage3D,\n\t\ttexSubImage2D: texSubImage2D,\n\t\ttexSubImage3D: texSubImage3D,\n\t\tcompressedTexSubImage2D: compressedTexSubImage2D,\n\t\tcompressedTexSubImage3D: compressedTexSubImage3D,\n\n\t\tscissor: scissor,\n\t\tviewport: viewport,\n\n\t\treset: reset\n\n\t};\n\n}\n\nfunction WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info ) {\n\n\tconst multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;\n\tconst supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );\n\n\tconst _imageDimensions = new Vector2();\n\tconst _videoTextures = new WeakMap();\n\tlet _canvas;\n\n\tconst _sources = new WeakMap(); // maps WebglTexture objects to instances of Source\n\n\t// cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\tlet useOffscreenCanvas = false;\n\n\ttry {\n\n\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\t&& ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;\n\n\t} catch ( err ) {\n\n\t\t// Ignore any errors\n\n\t}\n\n\tfunction createCanvas( width, height ) {\n\n\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\n\t\treturn useOffscreenCanvas ?\n\t\t\t// eslint-disable-next-line compat/compat\n\t\t\tnew OffscreenCanvas( width, height ) : createElementNS( 'canvas' );\n\n\t}\n\n\tfunction resizeImage( image, needsNewCanvas, maxSize ) {\n\n\t\tlet scale = 1;\n\n\t\tconst dimensions = getDimensions( image );\n\n\t\t// handle case if texture exceeds max size\n\n\t\tif ( dimensions.width > maxSize || dimensions.height > maxSize ) {\n\n\t\t\tscale = maxSize / Math.max( dimensions.width, dimensions.height );\n\n\t\t}\n\n\t\t// only perform resize if necessary\n\n\t\tif ( scale < 1 ) {\n\n\t\t\t// only perform resize for certain image types\n\n\t\t\tif ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||\n\t\t\t\t( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||\n\t\t\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||\n\t\t\t\t( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {\n\n\t\t\t\tconst width = Math.floor( scale * dimensions.width );\n\t\t\t\tconst height = Math.floor( scale * dimensions.height );\n\n\t\t\t\tif ( _canvas === undefined ) _canvas = createCanvas( width, height );\n\n\t\t\t\t// cube textures can't reuse the same canvas\n\n\t\t\t\tconst canvas = needsNewCanvas ? createCanvas( width, height ) : _canvas;\n\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );\n\n\t\t\t\treturn canvas;\n\n\t\t\t} else {\n\n\t\t\t\tif ( 'data' in image ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );\n\n\t\t\t\t}\n\n\t\t\t\treturn image;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction textureNeedsGenerateMipmaps( texture ) {\n\n\t\treturn texture.generateMipmaps;\n\n\t}\n\n\tfunction generateMipmap( target ) {\n\n\t\t_gl.generateMipmap( target );\n\n\t}\n\n\tfunction getTargetType( texture ) {\n\n\t\tif ( texture.isWebGLCubeRenderTarget ) return _gl.TEXTURE_CUBE_MAP;\n\t\tif ( texture.isWebGL3DRenderTarget ) return _gl.TEXTURE_3D;\n\t\tif ( texture.isWebGLArrayRenderTarget || texture.isCompressedArrayTexture ) return _gl.TEXTURE_2D_ARRAY;\n\t\treturn _gl.TEXTURE_2D;\n\n\t}\n\n\tfunction getInternalFormat( internalFormatName, glFormat, glType, colorSpace, forceLinearTransfer = false ) {\n\n\t\tif ( internalFormatName !== null ) {\n\n\t\t\tif ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'' );\n\n\t\t}\n\n\t\tlet internalFormat = glFormat;\n\n\t\tif ( glFormat === _gl.RED ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.R32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.R16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RED_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.R8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.R16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.R32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.R8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.R16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.R32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG ) {\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RG32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RG16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RG_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RG32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGB_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGB8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RGB16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RGB32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RGB8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RGB16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RGB32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGBA_INTEGER ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RGBA8UI;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RGBA16UI;\n\t\t\tif ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RGBA32UI;\n\t\t\tif ( glType === _gl.BYTE ) internalFormat = _gl.RGBA8I;\n\t\t\tif ( glType === _gl.SHORT ) internalFormat = _gl.RGBA16I;\n\t\t\tif ( glType === _gl.INT ) internalFormat = _gl.RGBA32I;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGB ) {\n\n\t\t\tif ( glType === _gl.UNSIGNED_INT_5_9_9_9_REV ) internalFormat = _gl.RGB9_E5;\n\n\t\t}\n\n\t\tif ( glFormat === _gl.RGBA ) {\n\n\t\t\tconst transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );\n\n\t\t\tif ( glType === _gl.FLOAT ) internalFormat = _gl.RGBA32F;\n\t\t\tif ( glType === _gl.HALF_FLOAT ) internalFormat = _gl.RGBA16F;\n\t\t\tif ( glType === _gl.UNSIGNED_BYTE ) internalFormat = ( transfer === SRGBTransfer ) ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_4_4_4_4 ) internalFormat = _gl.RGBA4;\n\t\t\tif ( glType === _gl.UNSIGNED_SHORT_5_5_5_1 ) internalFormat = _gl.RGB5_A1;\n\n\t\t}\n\n\t\tif ( internalFormat === _gl.R16F || internalFormat === _gl.R32F ||\n\t\t\tinternalFormat === _gl.RG16F || internalFormat === _gl.RG32F ||\n\t\t\tinternalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F ) {\n\n\t\t\textensions.get( 'EXT_color_buffer_float' );\n\n\t\t}\n\n\t\treturn internalFormat;\n\n\t}\n\n\tfunction getInternalDepthFormat( useStencil, depthType ) {\n\n\t\tlet glInternalFormat;\n\t\tif ( useStencil ) {\n\n\t\t\tif ( depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\n\t\t\t} else if ( depthType === FloatType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH32F_STENCIL8;\n\n\t\t\t} else if ( depthType === UnsignedShortType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\t\t\t\tconsole.warn( 'DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.' );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( depthType === null || depthType === UnsignedIntType || depthType === UnsignedInt248Type ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\n\t\t\t} else if ( depthType === FloatType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\n\t\t\t} else if ( depthType === UnsignedShortType ) {\n\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn glInternalFormat;\n\n\t}\n\n\tfunction getMipLevels( texture, image ) {\n\n\t\tif ( textureNeedsGenerateMipmaps( texture ) === true || ( texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter ) ) {\n\n\t\t\treturn Math.log2( Math.max( image.width, image.height ) ) + 1;\n\n\t\t} else if ( texture.mipmaps !== undefined && texture.mipmaps.length > 0 ) {\n\n\t\t\t// user-defined mipmaps\n\n\t\t\treturn texture.mipmaps.length;\n\n\t\t} else if ( texture.isCompressedTexture && Array.isArray( texture.image ) ) {\n\n\t\t\treturn image.mipmaps.length;\n\n\t\t} else {\n\n\t\t\t// texture without mipmaps (only base level)\n\n\t\t\treturn 1;\n\n\t\t}\n\n\t}\n\n\t//\n\n\tfunction onTextureDispose( event ) {\n\n\t\tconst texture = event.target;\n\n\t\ttexture.removeEventListener( 'dispose', onTextureDispose );\n\n\t\tdeallocateTexture( texture );\n\n\t\tif ( texture.isVideoTexture ) {\n\n\t\t\t_videoTextures.delete( texture );\n\n\t\t}\n\n\t}\n\n\tfunction onRenderTargetDispose( event ) {\n\n\t\tconst renderTarget = event.target;\n\n\t\trenderTarget.removeEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tdeallocateRenderTarget( renderTarget );\n\n\t}\n\n\t//\n\n\tfunction deallocateTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( textureProperties.__webglInit === undefined ) return;\n\n\t\t// check if it's necessary to remove the WebGLTexture object\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures ) {\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\t\t\twebglTexture.usedTimes --;\n\n\t\t\t// the WebGLTexture object is not used anymore, remove it\n\n\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\tdeleteTexture( texture );\n\n\t\t\t}\n\n\t\t\t// remove the weak map entry if no WebGLTexture uses the source anymore\n\n\t\t\tif ( Object.keys( webglTextures ).length === 0 ) {\n\n\t\t\t\t_sources.delete( source );\n\n\t\t\t}\n\n\t\t}\n\n\t\tproperties.remove( texture );\n\n\t}\n\n\tfunction deleteTexture( texture ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\t\t_gl.deleteTexture( textureProperties.__webglTexture );\n\n\t\tconst source = texture.source;\n\t\tconst webglTextures = _sources.get( source );\n\t\tdelete webglTextures[ textureProperties.__cacheKey ];\n\n\t\tinfo.memory.textures --;\n\n\t}\n\n\tfunction deallocateRenderTarget( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\trenderTarget.depthTexture.dispose();\n\n\t\t\tproperties.remove( renderTarget.depthTexture );\n\n\t\t}\n\n\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer[ i ] ) ) {\n\n\t\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer[ i ].length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ][ level ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer[ i ] );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( Array.isArray( renderTargetProperties.__webglFramebuffer ) ) {\n\n\t\t\t\tfor ( let level = 0; level < renderTargetProperties.__webglFramebuffer.length; level ++ ) _gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer[ level ] );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.deleteFramebuffer( renderTargetProperties.__webglFramebuffer );\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthbuffer );\n\t\t\tif ( renderTargetProperties.__webglMultisampledFramebuffer ) _gl.deleteFramebuffer( renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer ) {\n\n\t\t\t\tfor ( let i = 0; i < renderTargetProperties.__webglColorRenderbuffer.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTargetProperties.__webglColorRenderbuffer[ i ] ) _gl.deleteRenderbuffer( renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( renderTargetProperties.__webglDepthRenderbuffer ) _gl.deleteRenderbuffer( renderTargetProperties.__webglDepthRenderbuffer );\n\n\t\t}\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\tif ( attachmentProperties.__webglTexture ) {\n\n\t\t\t\t_gl.deleteTexture( attachmentProperties.__webglTexture );\n\n\t\t\t\tinfo.memory.textures --;\n\n\t\t\t}\n\n\t\t\tproperties.remove( textures[ i ] );\n\n\t\t}\n\n\t\tproperties.remove( renderTarget );\n\n\t}\n\n\t//\n\n\tlet textureUnits = 0;\n\n\tfunction resetTextureUnits() {\n\n\t\ttextureUnits = 0;\n\n\t}\n\n\tfunction allocateTextureUnit() {\n\n\t\tconst textureUnit = textureUnits;\n\n\t\tif ( textureUnit >= capabilities.maxTextures ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );\n\n\t\t}\n\n\t\ttextureUnits += 1;\n\n\t\treturn textureUnit;\n\n\t}\n\n\tfunction getTextureCacheKey( texture ) {\n\n\t\tconst array = [];\n\n\t\tarray.push( texture.wrapS );\n\t\tarray.push( texture.wrapT );\n\t\tarray.push( texture.wrapR || 0 );\n\t\tarray.push( texture.magFilter );\n\t\tarray.push( texture.minFilter );\n\t\tarray.push( texture.anisotropy );\n\t\tarray.push( texture.internalFormat );\n\t\tarray.push( texture.format );\n\t\tarray.push( texture.type );\n\t\tarray.push( texture.generateMipmaps );\n\t\tarray.push( texture.premultiplyAlpha );\n\t\tarray.push( texture.flipY );\n\t\tarray.push( texture.unpackAlignment );\n\t\tarray.push( texture.colorSpace );\n\n\t\treturn array.join();\n\n\t}\n\n\t//\n\n\tfunction setTexture2D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isVideoTexture ) updateVideoTexture( texture );\n\n\t\tif ( texture.isRenderTargetTexture === false && texture.isExternalTexture !== true && texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tconst image = texture.image;\n\n\t\t\tif ( image === null ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' );\n\n\t\t\t} else if ( image.complete === false ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );\n\n\t\t\t} else {\n\n\t\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t} else if ( texture.isExternalTexture ) {\n\n\t\t\ttextureProperties.__webglTexture = texture.sourceTexture ? texture.sourceTexture : null;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture2DArray( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTexture3D( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_3D, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tfunction setTextureCube( texture, slot ) {\n\n\t\tconst textureProperties = properties.get( texture );\n\n\t\tif ( texture.version > 0 && textureProperties.__version !== texture.version ) {\n\n\t\t\tuploadCubeTexture( textureProperties, texture, slot );\n\t\t\treturn;\n\n\t\t}\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t}\n\n\tconst wrappingToGL = {\n\t\t[ RepeatWrapping ]: _gl.REPEAT,\n\t\t[ ClampToEdgeWrapping ]: _gl.CLAMP_TO_EDGE,\n\t\t[ MirroredRepeatWrapping ]: _gl.MIRRORED_REPEAT\n\t};\n\n\tconst filterToGL = {\n\t\t[ NearestFilter ]: _gl.NEAREST,\n\t\t[ NearestMipmapNearestFilter ]: _gl.NEAREST_MIPMAP_NEAREST,\n\t\t[ NearestMipmapLinearFilter ]: _gl.NEAREST_MIPMAP_LINEAR,\n\n\t\t[ LinearFilter ]: _gl.LINEAR,\n\t\t[ LinearMipmapNearestFilter ]: _gl.LINEAR_MIPMAP_NEAREST,\n\t\t[ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR\n\t};\n\n\tconst compareToGL = {\n\t\t[ NeverCompare ]: _gl.NEVER,\n\t\t[ AlwaysCompare ]: _gl.ALWAYS,\n\t\t[ LessCompare ]: _gl.LESS,\n\t\t[ LessEqualCompare ]: _gl.LEQUAL,\n\t\t[ EqualCompare ]: _gl.EQUAL,\n\t\t[ GreaterEqualCompare ]: _gl.GEQUAL,\n\t\t[ GreaterCompare ]: _gl.GREATER,\n\t\t[ NotEqualCompare ]: _gl.NOTEQUAL\n\t};\n\n\tfunction setTextureParameters( textureType, texture ) {\n\n\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false &&\n\t\t\t( texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter ||\n\t\t\ttexture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter ) ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[ texture.wrapS ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[ texture.wrapT ] );\n\n\t\tif ( textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[ texture.wrapR ] );\n\n\t\t}\n\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[ texture.magFilter ] );\n\t\t_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[ texture.minFilter ] );\n\n\t\tif ( texture.compareFunction ) {\n\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );\n\t\t\t_gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );\n\n\t\t}\n\n\t\tif ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {\n\n\t\t\tif ( texture.magFilter === NearestFilter ) return;\n\t\t\tif ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;\n\t\t\tif ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension\n\n\t\t\tif ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {\n\n\t\t\t\tconst extension = extensions.get( 'EXT_texture_filter_anisotropic' );\n\t\t\t\t_gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );\n\t\t\t\tproperties.get( texture ).__currentAnisotropy = texture.anisotropy;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction initTexture( textureProperties, texture ) {\n\n\t\tlet forceUpload = false;\n\n\t\tif ( textureProperties.__webglInit === undefined ) {\n\n\t\t\ttextureProperties.__webglInit = true;\n\n\t\t\ttexture.addEventListener( 'dispose', onTextureDispose );\n\n\t\t}\n\n\t\t// create Source <-> WebGLTextures mapping if necessary\n\n\t\tconst source = texture.source;\n\t\tlet webglTextures = _sources.get( source );\n\n\t\tif ( webglTextures === undefined ) {\n\n\t\t\twebglTextures = {};\n\t\t\t_sources.set( source, webglTextures );\n\n\t\t}\n\n\t\t// check if there is already a WebGLTexture object for the given texture parameters\n\n\t\tconst textureCacheKey = getTextureCacheKey( texture );\n\n\t\tif ( textureCacheKey !== textureProperties.__cacheKey ) {\n\n\t\t\t// if not, create a new instance of WebGLTexture\n\n\t\t\tif ( webglTextures[ textureCacheKey ] === undefined ) {\n\n\t\t\t\t// create new entry\n\n\t\t\t\twebglTextures[ textureCacheKey ] = {\n\t\t\t\t\ttexture: _gl.createTexture(),\n\t\t\t\t\tusedTimes: 0\n\t\t\t\t};\n\n\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t// when a new instance of WebGLTexture was created, a texture upload is required\n\t\t\t\t// even if the image contents are identical\n\n\t\t\t\tforceUpload = true;\n\n\t\t\t}\n\n\t\t\twebglTextures[ textureCacheKey ].usedTimes ++;\n\n\t\t\t// every time the texture cache key changes, it's necessary to check if an instance of\n\t\t\t// WebGLTexture can be deleted in order to avoid a memory leak.\n\n\t\t\tconst webglTexture = webglTextures[ textureProperties.__cacheKey ];\n\n\t\t\tif ( webglTexture !== undefined ) {\n\n\t\t\t\twebglTextures[ textureProperties.__cacheKey ].usedTimes --;\n\n\t\t\t\tif ( webglTexture.usedTimes === 0 ) {\n\n\t\t\t\t\tdeleteTexture( texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// store references to cache key and WebGLTexture object\n\n\t\t\ttextureProperties.__cacheKey = textureCacheKey;\n\t\t\ttextureProperties.__webglTexture = webglTextures[ textureCacheKey ].texture;\n\n\t\t}\n\n\t\treturn forceUpload;\n\n\t}\n\n\tfunction getRow( index, rowLength, componentStride ) {\n\n\t\treturn Math.floor( Math.floor( index / componentStride ) / rowLength );\n\n\t}\n\n\tfunction updateTexture( texture, image, glFormat, glType ) {\n\n\t\tconst componentStride = 4; // only RGBA supported\n\n\t\tconst updateRanges = texture.updateRanges;\n\n\t\tif ( updateRanges.length === 0 ) {\n\n\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );\n\n\t\t} else {\n\n\t\t\t// Before applying update ranges, we merge any adjacent / overlapping\n\t\t\t// ranges to reduce load on `gl.texSubImage2D`. Empirically, this has led\n\t\t\t// to performance improvements for applications which make heavy use of\n\t\t\t// update ranges. Likely due to GPU command overhead.\n\t\t\t//\n\t\t\t// Note that to reduce garbage collection between frames, we merge the\n\t\t\t// update ranges in-place. This is safe because this method will clear the\n\t\t\t// update ranges once updated.\n\n\t\t\tupdateRanges.sort( ( a, b ) => a.start - b.start );\n\n\t\t\t// To merge the update ranges in-place, we work from left to right in the\n\t\t\t// existing updateRanges array, merging ranges. This may result in a final\n\t\t\t// array which is smaller than the original. This index tracks the last\n\t\t\t// index representing a merged range, any data after this index can be\n\t\t\t// trimmed once the merge algorithm is completed.\n\t\t\tlet mergeIndex = 0;\n\n\t\t\tfor ( let i = 1; i < updateRanges.length; i ++ ) {\n\n\t\t\t\tconst previousRange = updateRanges[ mergeIndex ];\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\t// Only merge if in the same row and overlapping/adjacent\n\t\t\t\tconst previousEnd = previousRange.start + previousRange.count;\n\t\t\t\tconst currentRow = getRow( range.start, image.width, componentStride );\n\t\t\t\tconst previousRow = getRow( previousRange.start, image.width, componentStride );\n\n\t\t\t\t// We add one here to merge adjacent ranges. This is safe because ranges\n\t\t\t\t// operate over positive integers.\n\t\t\t\tif (\n\t\t\t\t\trange.start <= previousEnd + 1 &&\n\t\t\t\t\tcurrentRow === previousRow &&\n\t\t\t\t\tgetRow( range.start + range.count - 1, image.width, componentStride ) === currentRow // ensure range doesn't spill\n\t\t\t\t) {\n\n\t\t\t\t\tpreviousRange.count = Math.max(\n\t\t\t\t\t\tpreviousRange.count,\n\t\t\t\t\t\trange.start + range.count - previousRange.start\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t++ mergeIndex;\n\t\t\t\t\tupdateRanges[ mergeIndex ] = range;\n\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t\t// Trim the array to only contain the merged ranges.\n\t\t\tupdateRanges.length = mergeIndex + 1;\n\n\t\t\tconst currentUnpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH );\n\t\t\tconst currentUnpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );\n\t\t\tconst currentUnpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );\n\n\t\t\tfor ( let i = 0, l = updateRanges.length; i < l; i ++ ) {\n\n\t\t\t\tconst range = updateRanges[ i ];\n\n\t\t\t\tconst pixelStart = Math.floor( range.start / componentStride );\n\t\t\t\tconst pixelCount = Math.ceil( range.count / componentStride );\n\n\t\t\t\tconst x = pixelStart % image.width;\n\t\t\t\tconst y = Math.floor( pixelStart / image.width );\n\n\t\t\t\t// Assumes update ranges refer to contiguous memory\n\t\t\t\tconst width = pixelCount;\n\t\t\t\tconst height = 1;\n\n\t\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, x );\n\t\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, y );\n\n\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, x, y, width, height, glFormat, glType, image.data );\n\n\t\t\t}\n\n\t\t\ttexture.clearUpdateRanges();\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );\n\n\t\t}\n\n\t}\n\n\tfunction uploadTexture( textureProperties, texture, slot ) {\n\n\t\tlet textureType = _gl.TEXTURE_2D;\n\n\t\tif ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = _gl.TEXTURE_2D_ARRAY;\n\t\tif ( texture.isData3DTexture ) textureType = _gl.TEXTURE_3D;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( textureType, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tlet image = resizeImage( texture.image, false, capabilities.maxTextureSize );\n\t\t\timage = verifyColorSpace( texture, image );\n\n\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\n\t\t\tconst glType = utils.convert( texture.type );\n\t\t\tlet glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, texture.isVideoTexture );\n\n\t\t\tsetTextureParameters( textureType, texture );\n\n\t\t\tlet mipmap;\n\t\t\tconst mipmaps = texture.mipmaps;\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tconst levels = getMipLevels( texture, image );\n\n\t\t\tif ( texture.isDepthTexture ) {\n\n\t\t\t\tglInternalFormat = getInternalDepthFormat( texture.format === DepthStencilFormat, texture.type );\n\n\t\t\t\t//\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, 1, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataTexture ) {\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tupdateTexture( texture, image, glFormat, glType );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isCompressedTexture ) {\n\n\t\t\t\tif ( texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tif ( texture.layerUpdates.size > 0 ) {\n\n\t\t\t\t\t\t\t\t\t\t\tconst layerByteLength = getByteLength( mipmap.width, mipmap.height, texture.format, texture.type );\n\n\t\t\t\t\t\t\t\t\t\t\tfor ( const layerIndex of texture.layerUpdates ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\tconst layerData = mipmap.data.subarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlayerIndex * layerByteLength / mipmap.data.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t( layerIndex + 1 ) * layerByteLength / mipmap.data.BYTES_PER_ELEMENT\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, layerIndex, mipmap.width, mipmap.height, 1, glFormat, layerData );\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\ttexture.clearLayerUpdates();\n\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isDataArrayTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_2D_ARRAY, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tif ( texture.layerUpdates.size > 0 ) {\n\n\t\t\t\t\t\t\tconst layerByteLength = getByteLength( image.width, image.height, texture.format, texture.type );\n\n\t\t\t\t\t\t\tfor ( const layerIndex of texture.layerUpdates ) {\n\n\t\t\t\t\t\t\t\tconst layerData = image.data.subarray(\n\t\t\t\t\t\t\t\t\tlayerIndex * layerByteLength / image.data.BYTES_PER_ELEMENT,\n\t\t\t\t\t\t\t\t\t( layerIndex + 1 ) * layerByteLength / image.data.BYTES_PER_ELEMENT\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, layerIndex, image.width, image.height, 1, glFormat, glType, layerData );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttexture.clearLayerUpdates();\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\tstate.texStorage3D( _gl.TEXTURE_3D, levels, glInternalFormat, image.width, image.height, image.depth );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\tstate.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.texImage3D( _gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data );\n\n\t\t\t\t}\n\n\t\t\t} else if ( texture.isFramebufferTexture ) {\n\n\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tlet width = image.width, height = image.height;\n\n\t\t\t\t\t\tfor ( let i = 0; i < levels; i ++ ) {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t\t\t\t\twidth >>= 1;\n\t\t\t\t\t\t\theight >>= 1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// regular Texture (image, video, canvas)\n\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\n\t\t\t\tif ( mipmaps.length > 0 ) {\n\n\t\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t\tconst dimensions = getDimensions( mipmaps[ 0 ] );\n\n\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = mipmaps.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tmipmap = mipmaps[ i ];\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\tif ( allocateMemory ) {\n\n\t\t\t\t\t\t\tconst dimensions = getDimensions( image );\n\n\t\t\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( textureType );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\tfunction uploadCubeTexture( textureProperties, texture, slot ) {\n\n\t\tif ( texture.image.length !== 6 ) return;\n\n\t\tconst forceUpload = initTexture( textureProperties, texture );\n\t\tconst source = texture.source;\n\n\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );\n\n\t\tconst sourceProperties = properties.get( source );\n\n\t\tif ( source.version !== sourceProperties.__version || forceUpload === true ) {\n\n\t\t\tstate.activeTexture( _gl.TEXTURE0 + slot );\n\n\t\t\tconst workingPrimaries = ColorManagement.getPrimaries( ColorManagement.workingColorSpace );\n\t\t\tconst texturePrimaries = texture.colorSpace === NoColorSpace ? null : ColorManagement.getPrimaries( texture.colorSpace );\n\t\t\tconst unpackConversion = texture.colorSpace === NoColorSpace || workingPrimaries === texturePrimaries ? _gl.NONE : _gl.BROWSER_DEFAULT_WEBGL;\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, texture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, texture.unpackAlignment );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, unpackConversion );\n\n\t\t\tconst isCompressed = ( texture.isCompressedTexture || texture.image[ 0 ].isCompressedTexture );\n\t\t\tconst isDataTexture = ( texture.image[ 0 ] && texture.image[ 0 ].isDataTexture );\n\n\t\t\tconst cubeImage = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( ! isCompressed && ! isDataTexture ) {\n\n\t\t\t\t\tcubeImage[ i ] = resizeImage( texture.image[ i ], true, capabilities.maxCubemapSize );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcubeImage[ i ] = isDataTexture ? texture.image[ i ].image : texture.image[ i ];\n\n\t\t\t\t}\n\n\t\t\t\tcubeImage[ i ] = verifyColorSpace( texture, cubeImage[ i ] );\n\n\t\t\t}\n\n\t\t\tconst image = cubeImage[ 0 ],\n\t\t\t\tglFormat = utils.convert( texture.format, texture.colorSpace ),\n\t\t\t\tglType = utils.convert( texture.type ),\n\t\t\t\tglInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\n\t\t\tconst useTexStorage = ( texture.isVideoTexture !== true );\n\t\t\tconst allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );\n\t\t\tconst dataReady = source.dataReady;\n\t\t\tlet levels = getMipLevels( texture, image );\n\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tlet mipmaps;\n\n\t\t\tif ( isCompressed ) {\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, image.width, image.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tmipmaps = cubeImage[ i ].mipmaps;\n\n\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\tif ( texture.format !== RGBAFormat ) {\n\n\t\t\t\t\t\t\tif ( glFormat !== null ) {\n\n\t\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\t\tstate.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tstate.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\t\tif ( useTexStorage && allocateMemory ) {\n\n\t\t\t\t\t// TODO: Uniformly handle mipmap definitions\n\t\t\t\t\t// Normal textures and compressed cube textures define base level + mips with their mipmap array\n\t\t\t\t\t// Uncompressed cube textures use their mipmap array only for mips (no base level)\n\n\t\t\t\t\tif ( mipmaps.length > 0 ) levels ++;\n\n\t\t\t\t\tconst dimensions = getDimensions( cubeImage[ 0 ] );\n\n\t\t\t\t\tstate.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tif ( isDataTexture ) {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\t\t\t\t\t\t\tconst mipmapImage = mipmap.image[ i ].image;\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ( let j = 0; j < mipmaps.length; j ++ ) {\n\n\t\t\t\t\t\t\tconst mipmap = mipmaps[ j ];\n\n\t\t\t\t\t\t\tif ( useTexStorage ) {\n\n\t\t\t\t\t\t\t\tif ( dataReady ) {\n\n\t\t\t\t\t\t\t\t\tstate.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tstate.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[ i ] );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\t// We assume images for cube map have the same size.\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tsourceProperties.__version = source.version;\n\n\t\t\tif ( texture.onUpdate ) texture.onUpdate( texture );\n\n\t\t}\n\n\t\ttextureProperties.__version = texture.version;\n\n\t}\n\n\t// Render targets\n\n\t// Setup storage for target texture and bind it to correct framebuffer\n\tfunction setupFrameBufferTexture( framebuffer, renderTarget, texture, attachment, textureTarget, level ) {\n\n\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\tconst glType = utils.convert( texture.type );\n\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\ttextureProperties.__renderTarget = renderTarget;\n\n\t\tif ( ! renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\tconst width = Math.max( 1, renderTarget.width >> level );\n\t\t\tconst height = Math.max( 1, renderTarget.height >> level );\n\n\t\t\tif ( textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY ) {\n\n\t\t\t\tstate.texImage3D( textureTarget, level, glInternalFormat, width, height, renderTarget.depth, 0, glFormat, glType, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.texImage2D( textureTarget, level, glInternalFormat, width, height, 0, glFormat, glType, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, 0, getRenderTargetSamples( renderTarget ) );\n\n\t\t} else if ( textureTarget === _gl.TEXTURE_2D || ( textureTarget >= _gl.TEXTURE_CUBE_MAP_POSITIVE_X && textureTarget <= _gl.TEXTURE_CUBE_MAP_NEGATIVE_Z ) ) { // see #24753\n\n\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, textureProperties.__webglTexture, level );\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\t// Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\tfunction setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t// retrieve the depth attachment types\n\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\tconst depthType = depthTexture && depthTexture.isDepthTexture ? depthTexture.type : null;\n\t\t\tconst glInternalFormat = getInternalDepthFormat( renderTarget.stencilBuffer, depthType );\n\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\n\t\t\t// set up the attachment\n\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\tconst isUseMultisampledRTT = useMultisampledRTT( renderTarget );\n\t\t\tif ( isUseMultisampledRTT ) {\n\n\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else if ( isMultisample ) {\n\n\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t} else {\n\n\t\t\tconst textures = renderTarget.textures;\n\n\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\tconst texture = textures[ i ];\n\n\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace );\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\tif ( isMultisample && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else if ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\t\tmultisampledRTTExt.renderbufferStorageMultisampleEXT( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t}\n\n\t// Setup resources for a Depth Texture for a FBO (needs an extension)\n\tfunction setupDepthTexture( framebuffer, renderTarget ) {\n\n\t\tconst isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget );\n\t\tif ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' );\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\tif ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\n\t\t\tthrow new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' );\n\n\t\t}\n\n\t\tconst textureProperties = properties.get( renderTarget.depthTexture );\n\t\ttextureProperties.__renderTarget = renderTarget;\n\n\t\t// upload an empty depth texture with framebuffer size\n\t\tif ( ! textureProperties.__webglTexture ||\n\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\n\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\n\t\t}\n\n\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n\t\tconst webglDepthTexture = textureProperties.__webglTexture;\n\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) ) {\n\n\t\t\t\tmultisampledRTTExt.framebufferTexture2DMultisampleEXT( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0, samples );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'Unknown depthTexture format' );\n\n\t\t}\n\n\t}\n\n\t// Setup GL resources for a non-texture depth buffer\n\tfunction setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\t// if the bound depth texture has changed\n\t\tif ( renderTargetProperties.__boundDepthTexture !== renderTarget.depthTexture ) {\n\n\t\t\t// fire the dispose event to get rid of stored state associated with the previously bound depth buffer\n\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\tif ( renderTargetProperties.__depthDisposeCallback ) {\n\n\t\t\t\trenderTargetProperties.__depthDisposeCallback();\n\n\t\t\t}\n\n\t\t\t// set up dispose listeners to track when the currently attached buffer is implicitly unbound\n\t\t\tif ( depthTexture ) {\n\n\t\t\t\tconst disposeEvent = () => {\n\n\t\t\t\t\tdelete renderTargetProperties.__boundDepthTexture;\n\t\t\t\t\tdelete renderTargetProperties.__depthDisposeCallback;\n\t\t\t\t\tdepthTexture.removeEventListener( 'dispose', disposeEvent );\n\n\t\t\t\t};\n\n\t\t\t\tdepthTexture.addEventListener( 'dispose', disposeEvent );\n\t\t\t\trenderTargetProperties.__depthDisposeCallback = disposeEvent;\n\n\t\t\t}\n\n\t\t\trenderTargetProperties.__boundDepthTexture = depthTexture;\n\n\t\t}\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tconst mipmaps = renderTarget.texture.mipmaps;\n\n\t\t\tif ( mipmaps && mipmaps.length > 0 ) {\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer[ 0 ], renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\n\t\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer[ i ] === undefined ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// attach buffer if it's been created already\n\t\t\t\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\t\t\tconst renderbuffer = renderTargetProperties.__webglDepthbuffer[ i ];\n\t\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst mipmaps = renderTarget.texture.mipmaps;\n\n\t\t\t\tif ( mipmaps && mipmaps.length > 0 ) {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ 0 ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetProperties.__webglDepthbuffer === undefined ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// attach buffer if it's been created already\n\t\t\t\t\tconst glAttachmentType = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\t\tconst renderbuffer = renderTargetProperties.__webglDepthbuffer;\n\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, glAttachmentType, _gl.RENDERBUFFER, renderbuffer );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}\n\n\t// rebind framebuffer with external textures\n\tfunction rebindTextures( renderTarget, colorTexture, depthTexture ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tif ( colorTexture !== undefined ) {\n\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, 0 );\n\n\t\t}\n\n\t\tif ( depthTexture !== undefined ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\t// Set up GL resources for the render target\n\tfunction setupRenderTarget( renderTarget ) {\n\n\t\tconst texture = renderTarget.texture;\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst textureProperties = properties.get( texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\tif ( ! isMultipleRenderTargets ) {\n\n\t\t\tif ( textureProperties.__webglTexture === undefined ) {\n\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tinfo.memory.textures ++;\n\n\t\t}\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = [];\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ][ level ] = _gl.createFramebuffer();\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ level ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst attachmentProperties = properties.get( textures[ i ] );\n\n\t\t\t\t\tif ( attachmentProperties.__webglTexture === undefined ) {\n\n\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t\t\t\tinfo.memory.textures ++;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( ( renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = [];\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tconst texture = textures[ i ];\n\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer[ i ] = _gl.createRenderbuffer();\n\n\t\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\tconst glFormat = utils.convert( texture.format, texture.colorSpace );\n\t\t\t\t\tconst glType = utils.convert( texture.type );\n\t\t\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.colorSpace, renderTarget.isXRRenderTarget === true );\n\t\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t_gl.renderbufferStorageMultisample( _gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\n\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, texture );\n\n\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ][ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, level );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( _gl.TEXTURE_CUBE_MAP );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else if ( isMultipleRenderTargets ) {\n\n\t\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\t\tconst attachment = textures[ i ];\n\t\t\t\tconst attachmentProperties = properties.get( attachment );\n\n\t\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\t\tif ( renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) {\n\n\t\t\t\t\tglTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( glTextureType, attachmentProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( glTextureType, attachment );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, glTextureType, 0 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( attachment ) ) {\n\n\t\t\t\t\tgenerateMipmap( glTextureType );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t} else {\n\n\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\tif ( renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget ) {\n\n\t\t\t\tglTextureType = renderTarget.isWebGL3DRenderTarget ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( glTextureType, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( glTextureType, texture );\n\n\t\t\tif ( texture.mipmaps && texture.mipmaps.length > 0 ) {\n\n\t\t\t\tfor ( let level = 0; level < texture.mipmaps.length; level ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ level ], renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, level );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType, 0 );\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tgenerateMipmap( glTextureType );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}\n\n\tfunction updateRenderTargetMipmap( renderTarget ) {\n\n\t\tconst textures = renderTarget.textures;\n\n\t\tfor ( let i = 0, il = textures.length; i < il; i ++ ) {\n\n\t\t\tconst texture = textures[ i ];\n\n\t\t\tif ( textureNeedsGenerateMipmaps( texture ) ) {\n\n\t\t\t\tconst targetType = getTargetType( renderTarget );\n\t\t\t\tconst webglTexture = properties.get( texture ).__webglTexture;\n\n\t\t\t\tstate.bindTexture( targetType, webglTexture );\n\t\t\t\tgenerateMipmap( targetType );\n\t\t\t\tstate.unbindTexture();\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tconst invalidationArrayRead = [];\n\tconst invalidationArrayDraw = [];\n\n\tfunction updateMultisampleRenderTarget( renderTarget ) {\n\n\t\tif ( renderTarget.samples > 0 ) {\n\n\t\t\tif ( useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\tconst textures = renderTarget.textures;\n\t\t\t\tconst width = renderTarget.width;\n\t\t\t\tconst height = renderTarget.height;\n\t\t\t\tlet mask = _gl.COLOR_BUFFER_BIT;\n\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\t\tconst isMultipleRenderTargets = ( textures.length > 1 );\n\n\t\t\t\t// If MRT we need to remove FBO attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, null );\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, null, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t\tconst mipmaps = renderTarget.texture.mipmaps;\n\n\t\t\t\tif ( mipmaps && mipmaps.length > 0 ) {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ 0 ] );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\tif ( renderTarget.resolveDepthBuffer ) {\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT;\n\n\t\t\t\t\t\t// resolving stencil is slow with a D3D backend. disable it for all transmission render targets (see #27799)\n\n\t\t\t\t\t\tif ( renderTarget.stencilBuffer && renderTarget.resolveStencilBuffer ) mask |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_gl.blitFramebuffer( 0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST );\n\n\t\t\t\t\tif ( supportsInvalidateFramebuffer === true ) {\n\n\t\t\t\t\t\tinvalidationArrayRead.length = 0;\n\t\t\t\t\t\tinvalidationArrayDraw.length = 0;\n\n\t\t\t\t\t\tinvalidationArrayRead.push( _gl.COLOR_ATTACHMENT0 + i );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false ) {\n\n\t\t\t\t\t\t\tinvalidationArrayRead.push( depthStyle );\n\t\t\t\t\t\t\tinvalidationArrayDraw.push( depthStyle );\n\n\t\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, invalidationArrayDraw );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.invalidateFramebuffer( _gl.READ_FRAMEBUFFER, invalidationArrayRead );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t\t// If MRT since pre-blit we removed the FBO we need to reconstruct the attachments\n\t\t\t\tif ( isMultipleRenderTargets ) {\n\n\t\t\t\t\tfor ( let i = 0; i < textures.length; i ++ ) {\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer[ i ] );\n\n\t\t\t\t\t\tconst webglTexture = properties.get( textures[ i ] ).__webglTexture;\n\n\t\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D, webglTexture, 0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer );\n\n\t\t\t} else {\n\n\t\t\t\tif ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false && supportsInvalidateFramebuffer ) {\n\n\t\t\t\t\tconst depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;\n\n\t\t\t\t\t_gl.invalidateFramebuffer( _gl.DRAW_FRAMEBUFFER, [ depthStyle ] );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction getRenderTargetSamples( renderTarget ) {\n\n\t\treturn Math.min( capabilities.maxSamples, renderTarget.samples );\n\n\t}\n\n\tfunction useMultisampledRTT( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\treturn renderTarget.samples > 0 && extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true && renderTargetProperties.__useRenderToTexture !== false;\n\n\t}\n\n\tfunction updateVideoTexture( texture ) {\n\n\t\tconst frame = info.render.frame;\n\n\t\t// Check the last frame we updated the VideoTexture\n\n\t\tif ( _videoTextures.get( texture ) !== frame ) {\n\n\t\t\t_videoTextures.set( texture, frame );\n\t\t\ttexture.update();\n\n\t\t}\n\n\t}\n\n\tfunction verifyColorSpace( texture, image ) {\n\n\t\tconst colorSpace = texture.colorSpace;\n\t\tconst format = texture.format;\n\t\tconst type = texture.type;\n\n\t\tif ( texture.isCompressedTexture === true || texture.isVideoTexture === true ) return image;\n\n\t\tif ( colorSpace !== LinearSRGBColorSpace && colorSpace !== NoColorSpace ) {\n\n\t\t\t// sRGB\n\n\t\t\tif ( ColorManagement.getTransfer( colorSpace ) === SRGBTransfer ) {\n\n\t\t\t\t// in WebGL 2 uncompressed textures can only be sRGB encoded if they have the RGBA8 format\n\n\t\t\t\tif ( format !== RGBAFormat || type !== UnsignedByteType ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.WebGLTextures: Unsupported texture color space:', colorSpace );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn image;\n\n\t}\n\n\tfunction getDimensions( image ) {\n\n\t\tif ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {\n\n\t\t\t// if intrinsic data are not available, fallback to width/height\n\n\t\t\t_imageDimensions.width = image.naturalWidth || image.width;\n\t\t\t_imageDimensions.height = image.naturalHeight || image.height;\n\n\t\t} else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {\n\n\t\t\t_imageDimensions.width = image.displayWidth;\n\t\t\t_imageDimensions.height = image.displayHeight;\n\n\t\t} else {\n\n\t\t\t_imageDimensions.width = image.width;\n\t\t\t_imageDimensions.height = image.height;\n\n\t\t}\n\n\t\treturn _imageDimensions;\n\n\t}\n\n\t//\n\n\tthis.allocateTextureUnit = allocateTextureUnit;\n\tthis.resetTextureUnits = resetTextureUnits;\n\n\tthis.setTexture2D = setTexture2D;\n\tthis.setTexture2DArray = setTexture2DArray;\n\tthis.setTexture3D = setTexture3D;\n\tthis.setTextureCube = setTextureCube;\n\tthis.rebindTextures = rebindTextures;\n\tthis.setupRenderTarget = setupRenderTarget;\n\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\tthis.setupDepthRenderbuffer = setupDepthRenderbuffer;\n\tthis.setupFrameBufferTexture = setupFrameBufferTexture;\n\tthis.useMultisampledRTT = useMultisampledRTT;\n\n}\n\nfunction WebGLUtils( gl, extensions ) {\n\n\tfunction convert( p, colorSpace = NoColorSpace ) {\n\n\t\tlet extension;\n\n\t\tconst transfer = ColorManagement.getTransfer( colorSpace );\n\n\t\tif ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;\n\t\tif ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;\n\t\tif ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;\n\t\tif ( p === UnsignedInt5999Type ) return gl.UNSIGNED_INT_5_9_9_9_REV;\n\n\t\tif ( p === ByteType ) return gl.BYTE;\n\t\tif ( p === ShortType ) return gl.SHORT;\n\t\tif ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT;\n\t\tif ( p === IntType ) return gl.INT;\n\t\tif ( p === UnsignedIntType ) return gl.UNSIGNED_INT;\n\t\tif ( p === FloatType ) return gl.FLOAT;\n\t\tif ( p === HalfFloatType ) return gl.HALF_FLOAT;\n\n\t\tif ( p === AlphaFormat ) return gl.ALPHA;\n\t\tif ( p === RGBFormat ) return gl.RGB;\n\t\tif ( p === RGBAFormat ) return gl.RGBA;\n\t\tif ( p === DepthFormat ) return gl.DEPTH_COMPONENT;\n\t\tif ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL;\n\n\t\t// WebGL2 formats.\n\n\t\tif ( p === RedFormat ) return gl.RED;\n\t\tif ( p === RedIntegerFormat ) return gl.RED_INTEGER;\n\t\tif ( p === RGFormat ) return gl.RG;\n\t\tif ( p === RGIntegerFormat ) return gl.RG_INTEGER;\n\t\tif ( p === RGBAIntegerFormat ) return gl.RGBA_INTEGER;\n\n\t\t// S3TC\n\n\t\tif ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {\n\n\t\t\tif ( transfer === SRGBTransfer ) {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc_srgb' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\textension = extensions.get( 'WEBGL_compressed_texture_s3tc' );\n\n\t\t\t\tif ( extension !== null ) {\n\n\t\t\t\t\tif ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// PVRTC\n\n\t\tif ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\tif ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ETC\n\n\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_etc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGB_ETC1_Format || p === RGB_ETC2_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\tif ( p === RGBA_ETC2_EAC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ASTC\n\n\t\tif ( p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format ||\n\t\t\tp === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format ||\n\t\t\tp === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format ||\n\t\t\tp === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format ||\n\t\t\tp === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format ) {\n\n\t\t\textension = extensions.get( 'WEBGL_compressed_texture_astc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_ASTC_4x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x4_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_5x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_6x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_8x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x5_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x6_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x8_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_10x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x10_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;\n\t\t\t\tif ( p === RGBA_ASTC_12x12_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// BPTC\n\n\t\tif ( p === RGBA_BPTC_Format || p === RGB_BPTC_SIGNED_Format || p === RGB_BPTC_UNSIGNED_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_bptc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return ( transfer === SRGBTransfer ) ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;\n\t\t\t\tif ( p === RGB_BPTC_SIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;\n\t\t\t\tif ( p === RGB_BPTC_UNSIGNED_Format ) return extension.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// RGTC\n\n\t\tif ( p === RED_RGTC1_Format || p === SIGNED_RED_RGTC1_Format || p === RED_GREEN_RGTC2_Format || p === SIGNED_RED_GREEN_RGTC2_Format ) {\n\n\t\t\textension = extensions.get( 'EXT_texture_compression_rgtc' );\n\n\t\t\tif ( extension !== null ) {\n\n\t\t\t\tif ( p === RGBA_BPTC_Format ) return extension.COMPRESSED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === SIGNED_RED_RGTC1_Format ) return extension.COMPRESSED_SIGNED_RED_RGTC1_EXT;\n\t\t\t\tif ( p === RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_RED_GREEN_RGTC2_EXT;\n\t\t\t\tif ( p === SIGNED_RED_GREEN_RGTC2_Format ) return extension.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tif ( p === UnsignedInt248Type ) return gl.UNSIGNED_INT_24_8;\n\n\t\t// if \"p\" can't be resolved, assume the user defines a WebGL constant as a string (fallback/workaround for packed RGB formats)\n\n\t\treturn ( gl[ p ] !== undefined ) ? gl[ p ] : null;\n\n\t}\n\n\treturn { convert: convert };\n\n}\n\n/**\n * Represents a texture created externally from the renderer context.\n *\n * This may be a texture from a protected media stream, device camera feed,\n * or other data feeds like a depth sensor.\n *\n * Note that this class is only supported in {@link WebGLRenderer} right now.\n *\n * @augments Texture\n */\nclass ExternalTexture extends Texture {\n\n\t/**\n\t * Creates a new raw texture.\n\t *\n\t * @param {?WebGLTexture} [sourceTexture=null] - The external texture.\n\t */\n\tconstructor( sourceTexture = null ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The external source texture.\n\t\t *\n\t\t * @type {?WebGLTexture}\n\t\t * @default null\n\t\t */\n\t\tthis.sourceTexture = sourceTexture;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isExternalTexture = true;\n\n\t}\n\n}\n\nconst _occlusion_vertex = `\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}`;\n\nconst _occlusion_fragment = `\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}`;\n\n/**\n * A XR module that manages the access to the Depth Sensing API.\n */\nclass WebXRDepthSensing {\n\n\t/**\n\t * Constructs a new depth sensing module.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * An opaque texture representing the depth of the user's environment.\n\t\t *\n\t\t * @type {?ExternalTexture}\n\t\t */\n\t\tthis.texture = null;\n\n\t\t/**\n\t\t * A plane mesh for visualizing the depth texture.\n\t\t *\n\t\t * @type {?Mesh}\n\t\t */\n\t\tthis.mesh = null;\n\n\t\t/**\n\t\t * The depth near value.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.depthNear = 0;\n\n\t\t/**\n\t\t * The depth near far.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.depthFar = 0;\n\n\t}\n\n\t/**\n\t * Inits the depth sensing module\n\t *\n\t * @param {XRWebGLDepthInformation} depthData - The XR depth data.\n\t * @param {XRRenderState} renderState - The XR render state.\n\t */\n\tinit( depthData, renderState ) {\n\n\t\tif ( this.texture === null ) {\n\n\t\t\tconst texture = new ExternalTexture( depthData.texture );\n\n\t\t\tif ( ( depthData.depthNear !== renderState.depthNear ) || ( depthData.depthFar !== renderState.depthFar ) ) {\n\n\t\t\t\tthis.depthNear = depthData.depthNear;\n\t\t\t\tthis.depthFar = depthData.depthFar;\n\n\t\t\t}\n\n\t\t\tthis.texture = texture;\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a plane mesh that visualizes the depth texture.\n\t *\n\t * @param {ArrayCamera} cameraXR - The XR camera.\n\t * @return {?Mesh} The plane mesh.\n\t */\n\tgetMesh( cameraXR ) {\n\n\t\tif ( this.texture !== null ) {\n\n\t\t\tif ( this.mesh === null ) {\n\n\t\t\t\tconst viewport = cameraXR.cameras[ 0 ].viewport;\n\t\t\t\tconst material = new ShaderMaterial( {\n\t\t\t\t\tvertexShader: _occlusion_vertex,\n\t\t\t\t\tfragmentShader: _occlusion_fragment,\n\t\t\t\t\tuniforms: {\n\t\t\t\t\t\tdepthColor: { value: this.texture },\n\t\t\t\t\t\tdepthWidth: { value: viewport.z },\n\t\t\t\t\t\tdepthHeight: { value: viewport.w }\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tthis.mesh = new Mesh( new PlaneGeometry( 20, 20 ), material );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn this.mesh;\n\n\t}\n\n\t/**\n\t * Resets the module\n\t */\n\treset() {\n\n\t\tthis.texture = null;\n\t\tthis.mesh = null;\n\n\t}\n\n\t/**\n\t * Returns a texture representing the depth of the user's environment.\n\t *\n\t * @return {?ExternalTexture} The depth texture.\n\t */\n\tgetDepthTexture() {\n\n\t\treturn this.texture;\n\n\t}\n\n}\n\n/**\n * This class represents an abstraction of the WebXR Device API and is\n * internally used by {@link WebGLRenderer}. `WebXRManager` also provides a public\n * interface that allows users to enable/disable XR and perform XR related\n * tasks like for instance retrieving controllers.\n *\n * @augments EventDispatcher\n * @hideconstructor\n */\nclass WebXRManager extends EventDispatcher {\n\n\t/**\n\t * Constructs a new WebGL renderer.\n\t *\n\t * @param {WebGLRenderer} renderer - The renderer.\n\t * @param {WebGL2RenderingContext} gl - The rendering context.\n\t */\n\tconstructor( renderer, gl ) {\n\n\t\tsuper();\n\n\t\tconst scope = this;\n\n\t\tlet session = null;\n\n\t\tlet framebufferScaleFactor = 1.0;\n\n\t\tlet referenceSpace = null;\n\t\tlet referenceSpaceType = 'local-floor';\n\t\t// Set default foveation to maximum.\n\t\tlet foveation = 1.0;\n\t\tlet customReferenceSpace = null;\n\n\t\tlet pose = null;\n\t\tlet glBinding = null;\n\t\tlet glProjLayer = null;\n\t\tlet glBaseLayer = null;\n\t\tlet xrFrame = null;\n\n\t\tconst depthSensing = new WebXRDepthSensing();\n\t\tconst cameraAccessTextures = {};\n\t\tconst attributes = gl.getContextAttributes();\n\n\t\tlet initialRenderTarget = null;\n\t\tlet newRenderTarget = null;\n\n\t\tconst controllers = [];\n\t\tconst controllerInputSources = [];\n\n\t\tconst currentSize = new Vector2();\n\t\tlet currentPixelRatio = null;\n\n\t\t//\n\n\t\tconst cameraL = new PerspectiveCamera();\n\t\tcameraL.viewport = new Vector4();\n\n\t\tconst cameraR = new PerspectiveCamera();\n\t\tcameraR.viewport = new Vector4();\n\n\t\tconst cameras = [ cameraL, cameraR ];\n\n\t\tconst cameraXR = new ArrayCamera();\n\n\t\tlet _currentDepthNear = null;\n\t\tlet _currentDepthFar = null;\n\n\t\t//\n\n\t\t/**\n\t\t * Whether the manager's XR camera should be automatically updated or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.cameraAutoUpdate = true;\n\n\t\t/**\n\t\t * This flag notifies the renderer to be ready for XR rendering. Set it to `true`\n\t\t * if you are going to use XR in your app.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.enabled = false;\n\n\t\t/**\n\t\t * Whether XR presentation is active or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default false\n\t\t */\n\t\tthis.isPresenting = false;\n\n\t\t/**\n\t\t * Returns a group representing the `target ray` space of the XR controller.\n\t\t * Use this space for visualizing 3D objects that support the user in pointing\n\t\t * tasks like UI interaction.\n\t\t *\n\t\t * @param {number} index - The index of the controller.\n\t\t * @return {Group} A group representing the `target ray` space.\n\t\t */\n\t\tthis.getController = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getTargetRaySpace();\n\n\t\t};\n\n\t\t/**\n\t\t * Returns a group representing the `grip` space of the XR controller.\n\t\t * Use this space for visualizing 3D objects that support the user in pointing\n\t\t * tasks like UI interaction.\n\t\t *\n\t\t * Note: If you want to show something in the user's hand AND offer a\n\t\t * pointing ray at the same time, you'll want to attached the handheld object\n\t\t * to the group returned by `getControllerGrip()` and the ray to the\n\t\t * group returned by `getController()`. The idea is to have two\n\t\t * different groups in two different coordinate spaces for the same WebXR\n\t\t * controller.\n\t\t *\n\t\t * @param {number} index - The index of the controller.\n\t\t * @return {Group} A group representing the `grip` space.\n\t\t */\n\t\tthis.getControllerGrip = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getGripSpace();\n\n\t\t};\n\n\t\t/**\n\t\t * Returns a group representing the `hand` space of the XR controller.\n\t\t * Use this space for visualizing 3D objects that support the user in pointing\n\t\t * tasks like UI interaction.\n\t\t *\n\t\t * @param {number} index - The index of the controller.\n\t\t * @return {Group} A group representing the `hand` space.\n\t\t */\n\t\tthis.getHand = function ( index ) {\n\n\t\t\tlet controller = controllers[ index ];\n\n\t\t\tif ( controller === undefined ) {\n\n\t\t\t\tcontroller = new WebXRController();\n\t\t\t\tcontrollers[ index ] = controller;\n\n\t\t\t}\n\n\t\t\treturn controller.getHandSpace();\n\n\t\t};\n\n\t\t//\n\n\t\tfunction onSessionEvent( event ) {\n\n\t\t\tconst controllerIndex = controllerInputSources.indexOf( event.inputSource );\n\n\t\t\tif ( controllerIndex === -1 ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\tif ( controller !== undefined ) {\n\n\t\t\t\tcontroller.update( event.inputSource, event.frame, customReferenceSpace || referenceSpace );\n\t\t\t\tcontroller.dispatchEvent( { type: event.type, data: event.inputSource } );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onSessionEnd() {\n\n\t\t\tsession.removeEventListener( 'select', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectstart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'selectend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeeze', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezestart', onSessionEvent );\n\t\t\tsession.removeEventListener( 'squeezeend', onSessionEvent );\n\t\t\tsession.removeEventListener( 'end', onSessionEnd );\n\t\t\tsession.removeEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\n\t\t\t\tif ( inputSource === null ) continue;\n\n\t\t\t\tcontrollerInputSources[ i ] = null;\n\n\t\t\t\tcontrollers[ i ].disconnect( inputSource );\n\n\t\t\t}\n\n\t\t\t_currentDepthNear = null;\n\t\t\t_currentDepthFar = null;\n\n\t\t\tdepthSensing.reset();\n\t\t\tfor ( const key in cameraAccessTextures ) {\n\n\t\t\t\tdelete cameraAccessTextures[ key ];\n\n\t\t\t}\n\n\t\t\t// restore framebuffer/rendering state\n\n\t\t\trenderer.setRenderTarget( initialRenderTarget );\n\n\t\t\tglBaseLayer = null;\n\t\t\tglProjLayer = null;\n\t\t\tglBinding = null;\n\t\t\tsession = null;\n\t\t\tnewRenderTarget = null;\n\n\t\t\t//\n\n\t\t\tanimation.stop();\n\n\t\t\tscope.isPresenting = false;\n\n\t\t\trenderer.setPixelRatio( currentPixelRatio );\n\t\t\trenderer.setSize( currentSize.width, currentSize.height, false );\n\n\t\t\tscope.dispatchEvent( { type: 'sessionend' } );\n\n\t\t}\n\n\t\t/**\n\t\t * Sets the framebuffer scale factor.\n\t\t *\n\t\t * This method can not be used during a XR session.\n\t\t *\n\t\t * @param {number} value - The framebuffer scale factor.\n\t\t */\n\t\tthis.setFramebufferScaleFactor = function ( value ) {\n\n\t\t\tframebufferScaleFactor = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the reference space type. Can be used to configure a spatial relationship with the user's physical\n\t\t * environment. Depending on how the user moves in 3D space, setting an appropriate reference space can\n\t\t * improve tracking. Default is `local-floor`. Valid values can be found here\n\t\t * https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpace#reference_space_types.\n\t\t *\n\t\t * This method can not be used during a XR session.\n\t\t *\n\t\t * @param {string} value - The reference space type.\n\t\t */\n\t\tthis.setReferenceSpaceType = function ( value ) {\n\n\t\t\treferenceSpaceType = value;\n\n\t\t\tif ( scope.isPresenting === true ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the XR reference space.\n\t\t *\n\t\t * @return {XRReferenceSpace} The XR reference space.\n\t\t */\n\t\tthis.getReferenceSpace = function () {\n\n\t\t\treturn customReferenceSpace || referenceSpace;\n\n\t\t};\n\n\t\t/**\n\t\t * Sets a custom XR reference space.\n\t\t *\n\t\t * @param {XRReferenceSpace} space - The XR reference space.\n\t\t */\n\t\tthis.setReferenceSpace = function ( space ) {\n\n\t\t\tcustomReferenceSpace = space;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current base layer.\n\t\t *\n\t\t * @return {?(XRWebGLLayer|XRProjectionLayer)} The XR base layer.\n\t\t */\n\t\tthis.getBaseLayer = function () {\n\n\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current XR binding.\n\t\t *\n\t\t * @return {?XRWebGLBinding} The XR binding.\n\t\t */\n\t\tthis.getBinding = function () {\n\n\t\t\treturn glBinding;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current XR frame.\n\t\t *\n\t\t * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session.\n\t\t */\n\t\tthis.getFrame = function () {\n\n\t\t\treturn xrFrame;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current XR session.\n\t\t *\n\t\t * @return {?XRSession} The XR session. Returns `null` when used outside a XR session.\n\t\t */\n\t\tthis.getSession = function () {\n\n\t\t\treturn session;\n\n\t\t};\n\n\t\t/**\n\t\t * After a XR session has been requested usually with one of the `*Button` modules, it\n\t\t * is injected into the renderer with this method. This method triggers the start of\n\t\t * the actual XR rendering.\n\t\t *\n\t\t * @async\n\t\t * @param {XRSession} value - The XR session to set.\n\t\t * @return {Promise} A Promise that resolves when the session has been set.\n\t\t */\n\t\tthis.setSession = async function ( value ) {\n\n\t\t\tsession = value;\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\tinitialRenderTarget = renderer.getRenderTarget();\n\n\t\t\t\tsession.addEventListener( 'select', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectstart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'selectend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeeze', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezestart', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'squeezeend', onSessionEvent );\n\t\t\t\tsession.addEventListener( 'end', onSessionEnd );\n\t\t\t\tsession.addEventListener( 'inputsourceschange', onInputSourcesChange );\n\n\t\t\t\tif ( attributes.xrCompatible !== true ) {\n\n\t\t\t\t\tawait gl.makeXRCompatible();\n\n\t\t\t\t}\n\n\t\t\t\tcurrentPixelRatio = renderer.getPixelRatio();\n\t\t\t\trenderer.getSize( currentSize );\n\n\t\t\t\tif ( typeof XRWebGLBinding !== 'undefined' ) {\n\n\t\t\t\t\tglBinding = new XRWebGLBinding( session, gl );\n\n\t\t\t\t}\n\n\t\t\t\t// Check that the browser implements the necessary APIs to use an\n\t\t\t\t// XRProjectionLayer rather than an XRWebGLLayer\n\t\t\t\tconst useLayers = glBinding !== null && 'createProjectionLayer' in XRWebGLBinding.prototype;\n\n\t\t\t\tif ( ! useLayers ) {\n\n\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\tantialias: attributes.antialias,\n\t\t\t\t\t\talpha: true,\n\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglBaseLayer = new XRWebGLLayer( session, gl, layerInit );\n\n\t\t\t\t\tsession.updateRenderState( { baseLayer: glBaseLayer } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglBaseLayer.framebufferWidth,\n\t\t\t\t\t\tglBaseLayer.framebufferHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\tresolveDepthBuffer: ( glBaseLayer.ignoreDepthValues === false ),\n\t\t\t\t\t\t\tresolveStencilBuffer: ( glBaseLayer.ignoreDepthValues === false )\n\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet depthFormat = null;\n\t\t\t\t\tlet depthType = null;\n\t\t\t\t\tlet glDepthFormat = null;\n\n\t\t\t\t\tif ( attributes.depth ) {\n\n\t\t\t\t\t\tglDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\tdepthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;\n\t\t\t\t\t\tdepthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\tcolorFormat: gl.RGBA8,\n\t\t\t\t\t\tdepthFormat: glDepthFormat,\n\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t};\n\n\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer( projectionlayerInit );\n\n\t\t\t\t\tsession.updateRenderState( { layers: [ glProjLayer ] } );\n\n\t\t\t\t\trenderer.setPixelRatio( 1 );\n\t\t\t\t\trenderer.setSize( glProjLayer.textureWidth, glProjLayer.textureHeight, false );\n\n\t\t\t\t\tnewRenderTarget = new WebGLRenderTarget(\n\t\t\t\t\t\tglProjLayer.textureWidth,\n\t\t\t\t\t\tglProjLayer.textureHeight,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tformat: RGBAFormat,\n\t\t\t\t\t\t\ttype: UnsignedByteType,\n\t\t\t\t\t\t\tdepthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),\n\t\t\t\t\t\t\tstencilBuffer: attributes.stencil,\n\t\t\t\t\t\t\tcolorSpace: renderer.outputColorSpace,\n\t\t\t\t\t\t\tsamples: attributes.antialias ? 4 : 0,\n\t\t\t\t\t\t\tresolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false ),\n\t\t\t\t\t\t\tresolveStencilBuffer: ( glProjLayer.ignoreDepthValues === false )\n\t\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tnewRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278\n\n\t\t\t\tthis.setFoveation( foveation );\n\n\t\t\t\tcustomReferenceSpace = null;\n\t\t\t\treferenceSpace = await session.requestReferenceSpace( referenceSpaceType );\n\n\t\t\t\tanimation.setContext( session );\n\t\t\t\tanimation.start();\n\n\t\t\t\tscope.isPresenting = true;\n\n\t\t\t\tscope.dispatchEvent( { type: 'sessionstart' } );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the environment blend mode from the current XR session.\n\t\t *\n\t\t * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session.\n\t\t */\n\t\tthis.getEnvironmentBlendMode = function () {\n\n\t\t\tif ( session !== null ) {\n\n\t\t\t\treturn session.environmentBlendMode;\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current depth texture computed via depth sensing.\n\t\t *\n\t\t * @return {?Texture} The depth texture.\n\t\t */\n\t\tthis.getDepthTexture = function () {\n\n\t\t\treturn depthSensing.getDepthTexture();\n\n\t\t};\n\n\t\tfunction onInputSourcesChange( event ) {\n\n\t\t\t// Notify disconnected\n\n\t\t\tfor ( let i = 0; i < event.removed.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.removed[ i ];\n\t\t\t\tconst index = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( index >= 0 ) {\n\n\t\t\t\t\tcontrollerInputSources[ index ] = null;\n\t\t\t\t\tcontrollers[ index ].disconnect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Notify connected\n\n\t\t\tfor ( let i = 0; i < event.added.length; i ++ ) {\n\n\t\t\t\tconst inputSource = event.added[ i ];\n\n\t\t\t\tlet controllerIndex = controllerInputSources.indexOf( inputSource );\n\n\t\t\t\tif ( controllerIndex === -1 ) {\n\n\t\t\t\t\t// Assign input source a controller that currently has no input source\n\n\t\t\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\t\t\tif ( i >= controllerInputSources.length ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources.push( inputSource );\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t} else if ( controllerInputSources[ i ] === null ) {\n\n\t\t\t\t\t\t\tcontrollerInputSources[ i ] = inputSource;\n\t\t\t\t\t\t\tcontrollerIndex = i;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// If all controllers do currently receive input we ignore new ones\n\n\t\t\t\t\tif ( controllerIndex === -1 ) break;\n\n\t\t\t\t}\n\n\t\t\t\tconst controller = controllers[ controllerIndex ];\n\n\t\t\t\tif ( controller ) {\n\n\t\t\t\t\tcontroller.connect( inputSource );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//\n\n\t\tconst cameraLPos = new Vector3();\n\t\tconst cameraRPos = new Vector3();\n\n\t\t/**\n\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t * the cameras' projection and world matrices have already been set.\n\t\t * And that near and far planes are identical for both cameras.\n\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t *\n\t\t * @param {ArrayCamera} camera - The camera to update.\n\t\t * @param {PerspectiveCamera} cameraL - The left camera.\n\t\t * @param {PerspectiveCamera} cameraR - The right camera.\n\t\t */\n\t\tfunction setProjectionFromUnion( camera, cameraL, cameraR ) {\n\n\t\t\tcameraLPos.setFromMatrixPosition( cameraL.matrixWorld );\n\t\t\tcameraRPos.setFromMatrixPosition( cameraR.matrixWorld );\n\n\t\t\tconst ipd = cameraLPos.distanceTo( cameraRPos );\n\n\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\tconst projR = cameraR.projectionMatrix.elements;\n\n\t\t\t// VR systems will have identical far and near planes, and\n\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t// Use the left camera for these values.\n\t\t\tconst near = projL[ 14 ] / ( projL[ 10 ] - 1 );\n\t\t\tconst far = projL[ 14 ] / ( projL[ 10 ] + 1 );\n\t\t\tconst topFov = ( projL[ 9 ] + 1 ) / projL[ 5 ];\n\t\t\tconst bottomFov = ( projL[ 9 ] - 1 ) / projL[ 5 ];\n\n\t\t\tconst leftFov = ( projL[ 8 ] - 1 ) / projL[ 0 ];\n\t\t\tconst rightFov = ( projR[ 8 ] + 1 ) / projR[ 0 ];\n\t\t\tconst left = near * leftFov;\n\t\t\tconst right = near * rightFov;\n\n\t\t\t// Calculate the new camera's position offset from the\n\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\t\t\tconst zOffset = ipd / ( - leftFov + rightFov );\n\t\t\tconst xOffset = zOffset * - leftFov;\n\n\t\t\t// TODO: Better way to apply this offset?\n\t\t\tcameraL.matrixWorld.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.translateX( xOffset );\n\t\t\tcamera.translateZ( zOffset );\n\t\t\tcamera.matrixWorld.compose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t\t// Check if the projection uses an infinite far plane.\n\t\t\tif ( projL[ 10 ] === -1 ) {\n\n\t\t\t\t// Use the projection matrix from the left eye.\n\t\t\t\t// The camera offset is sufficient to include the view volumes\n\t\t\t\t// of both eyes (assuming symmetric projections).\n\t\t\t\tcamera.projectionMatrix.copy( cameraL.projectionMatrix );\n\t\t\t\tcamera.projectionMatrixInverse.copy( cameraL.projectionMatrixInverse );\n\n\t\t\t} else {\n\n\t\t\t\t// Find the union of the frustum values of the cameras and scale\n\t\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t\t// although must now be relative to the new union camera.\n\t\t\t\tconst near2 = near + zOffset;\n\t\t\t\tconst far2 = far + zOffset;\n\t\t\t\tconst left2 = left - xOffset;\n\t\t\t\tconst right2 = right + ( ipd - xOffset );\n\t\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\n\t\t\t\tcamera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );\n\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction updateCamera( camera, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrixWorld.copy( camera.matrix );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );\n\n\t\t\t}\n\n\t\t\tcamera.matrixWorldInverse.copy( camera.matrixWorld ).invert();\n\n\t\t}\n\n\t\t/**\n\t\t * Updates the state of the XR camera. Use this method on app level if you\n\t\t * set cameraAutoUpdate` to `false`. The method requires the non-XR\n\t\t * camera of the scene as a parameter. The passed in camera's transformation\n\t\t * is automatically adjusted to the position of the XR camera when calling\n\t\t * this method.\n\t\t *\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.updateCamera = function ( camera ) {\n\n\t\t\tif ( session === null ) return;\n\n\t\t\tlet depthNear = camera.near;\n\t\t\tlet depthFar = camera.far;\n\n\t\t\tif ( depthSensing.texture !== null ) {\n\n\t\t\t\tif ( depthSensing.depthNear > 0 ) depthNear = depthSensing.depthNear;\n\t\t\t\tif ( depthSensing.depthFar > 0 ) depthFar = depthSensing.depthFar;\n\n\t\t\t}\n\n\t\t\tcameraXR.near = cameraR.near = cameraL.near = depthNear;\n\t\t\tcameraXR.far = cameraR.far = cameraL.far = depthFar;\n\n\t\t\tif ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {\n\n\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\n\t\t\t\tsession.updateRenderState( {\n\t\t\t\t\tdepthNear: cameraXR.near,\n\t\t\t\t\tdepthFar: cameraXR.far\n\t\t\t\t} );\n\n\t\t\t\t_currentDepthNear = cameraXR.near;\n\t\t\t\t_currentDepthFar = cameraXR.far;\n\n\t\t\t}\n\n\t\t\t// inherit camera layers and enable eye layers (1 = left, 2 = right)\n\t\t\tcameraXR.layers.mask = camera.layers.mask | 0b110;\n\t\t\tcameraL.layers.mask = cameraXR.layers.mask & 0b011;\n\t\t\tcameraR.layers.mask = cameraXR.layers.mask & 0b101;\n\n\t\t\tconst parent = camera.parent;\n\t\t\tconst cameras = cameraXR.cameras;\n\n\t\t\tupdateCamera( cameraXR, parent );\n\n\t\t\tfor ( let i = 0; i < cameras.length; i ++ ) {\n\n\t\t\t\tupdateCamera( cameras[ i ], parent );\n\n\t\t\t}\n\n\t\t\t// update projection matrix for proper view frustum culling\n\n\t\t\tif ( cameras.length === 2 ) {\n\n\t\t\t\tsetProjectionFromUnion( cameraXR, cameraL, cameraR );\n\n\t\t\t} else {\n\n\t\t\t\t// assume single camera setup (AR)\n\n\t\t\t\tcameraXR.projectionMatrix.copy( cameraL.projectionMatrix );\n\n\t\t\t}\n\n\t\t\t// update user camera and its children\n\n\t\t\tupdateUserCamera( camera, cameraXR, parent );\n\n\t\t};\n\n\t\tfunction updateUserCamera( camera, cameraXR, parent ) {\n\n\t\t\tif ( parent === null ) {\n\n\t\t\t\tcamera.matrix.copy( cameraXR.matrixWorld );\n\n\t\t\t} else {\n\n\t\t\t\tcamera.matrix.copy( parent.matrixWorld );\n\t\t\t\tcamera.matrix.invert();\n\t\t\t\tcamera.matrix.multiply( cameraXR.matrixWorld );\n\n\t\t\t}\n\n\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\tcamera.updateMatrixWorld( true );\n\n\t\t\tcamera.projectionMatrix.copy( cameraXR.projectionMatrix );\n\t\t\tcamera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );\n\n\t\t\tif ( camera.isPerspectiveCamera ) {\n\n\t\t\t\tcamera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );\n\t\t\t\tcamera.zoom = 1;\n\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Returns an instance of {@link ArrayCamera} which represents the XR camera\n\t\t * of the active XR session. For each view it holds a separate camera object.\n\t\t *\n\t\t * The camera's `fov` is currently not used and does not reflect the fov of\n\t\t * the XR camera. If you need the fov on app level, you have to compute in\n\t\t * manually from the XR camera's projection matrices.\n\t\t *\n\t\t * @return {ArrayCamera} The XR camera.\n\t\t */\n\t\tthis.getCamera = function () {\n\n\t\t\treturn cameraXR;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the amount of foveation used by the XR compositor for the projection layer.\n\t\t *\n\t\t * @return {number|undefined} The amount of foveation.\n\t\t */\n\t\tthis.getFoveation = function () {\n\n\t\t\tif ( glProjLayer === null && glBaseLayer === null ) {\n\n\t\t\t\treturn undefined;\n\n\t\t\t}\n\n\t\t\treturn foveation;\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the foveation value.\n\t\t *\n\t\t * @param {number} value - A number in the range `[0,1]` where `0` means no foveation (full resolution)\n\t\t * and `1` means maximum foveation (the edges render at lower resolution).\n\t\t */\n\t\tthis.setFoveation = function ( value ) {\n\n\t\t\t// 0 = no foveation = full resolution\n\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\n\t\t\tfoveation = value;\n\n\t\t\tif ( glProjLayer !== null ) {\n\n\t\t\t\tglProjLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t\tif ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) {\n\n\t\t\t\tglBaseLayer.fixedFoveation = value;\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Returns `true` if depth sensing is supported.\n\t\t *\n\t\t * @return {boolean} Whether depth sensing is supported or not.\n\t\t */\n\t\tthis.hasDepthSensing = function () {\n\n\t\t\treturn depthSensing.texture !== null;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the depth sensing mesh.\n\t\t *\n\t\t * @return {Mesh} The depth sensing mesh.\n\t\t */\n\t\tthis.getDepthSensingMesh = function () {\n\n\t\t\treturn depthSensing.getMesh( cameraXR );\n\n\t\t};\n\n\t\t/**\n\t\t * Retrieves an opaque texture from the view-aligned {@link XRCamera}.\n\t\t * Only available during the current animation loop.\n\t\t *\n\t\t * @param {XRCamera} xrCamera - The camera to query.\n\t\t * @return {?Texture} An opaque texture representing the current raw camera frame.\n\t\t */\n\t\tthis.getCameraTexture = function ( xrCamera ) {\n\n\t\t\treturn cameraAccessTextures[ xrCamera ];\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time, frame ) {\n\n\t\t\tpose = frame.getViewerPose( customReferenceSpace || referenceSpace );\n\t\t\txrFrame = frame;\n\n\t\t\tif ( pose !== null ) {\n\n\t\t\t\tconst views = pose.views;\n\n\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\trenderer.setRenderTargetFramebuffer( newRenderTarget, glBaseLayer.framebuffer );\n\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t\tlet cameraXRNeedsUpdate = false;\n\n\t\t\t\t// check if it's necessary to rebuild cameraXR's camera list\n\n\t\t\t\tif ( views.length !== cameraXR.cameras.length ) {\n\n\t\t\t\t\tcameraXR.cameras.length = 0;\n\t\t\t\t\tcameraXRNeedsUpdate = true;\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < views.length; i ++ ) {\n\n\t\t\t\t\tconst view = views[ i ];\n\n\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\tif ( glBaseLayer !== null ) {\n\n\t\t\t\t\t\tviewport = glBaseLayer.getViewport( view );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage( glProjLayer, view );\n\t\t\t\t\t\tviewport = glSubImage.viewport;\n\n\t\t\t\t\t\t// For side-by-side projection, we only produce a single texture for both eyes.\n\t\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\t\trenderer.setRenderTargetTextures(\n\t\t\t\t\t\t\t\tnewRenderTarget,\n\t\t\t\t\t\t\t\tglSubImage.colorTexture,\n\t\t\t\t\t\t\t\tglSubImage.depthStencilTexture );\n\n\t\t\t\t\t\t\trenderer.setRenderTarget( newRenderTarget );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet camera = cameras[ i ];\n\n\t\t\t\t\tif ( camera === undefined ) {\n\n\t\t\t\t\t\tcamera = new PerspectiveCamera();\n\t\t\t\t\t\tcamera.layers.enable( i );\n\t\t\t\t\t\tcamera.viewport = new Vector4();\n\t\t\t\t\t\tcameras[ i ] = camera;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcamera.matrix.fromArray( view.transform.matrix );\n\t\t\t\t\tcamera.matrix.decompose( camera.position, camera.quaternion, camera.scale );\n\t\t\t\t\tcamera.projectionMatrix.fromArray( view.projectionMatrix );\n\t\t\t\t\tcamera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();\n\t\t\t\t\tcamera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );\n\n\t\t\t\t\tif ( i === 0 ) {\n\n\t\t\t\t\t\tcameraXR.matrix.copy( camera.matrix );\n\t\t\t\t\t\tcameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( cameraXRNeedsUpdate === true ) {\n\n\t\t\t\t\t\tcameraXR.cameras.push( camera );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t//\n\n\t\t\t\tconst enabledFeatures = session.enabledFeatures;\n\t\t\t\tconst gpuDepthSensingEnabled = enabledFeatures &&\n\t\t\t\t\tenabledFeatures.includes( 'depth-sensing' ) &&\n\t\t\t\t\tsession.depthUsage == 'gpu-optimized';\n\n\t\t\t\tif ( gpuDepthSensingEnabled && glBinding ) {\n\n\t\t\t\t\tconst depthData = glBinding.getDepthInformation( views[ 0 ] );\n\n\t\t\t\t\tif ( depthData && depthData.isValid && depthData.texture ) {\n\n\t\t\t\t\t\tdepthSensing.init( depthData, session.renderState );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst cameraAccessEnabled = enabledFeatures &&\n\t\t\t\t    enabledFeatures.includes( 'camera-access' );\n\n\t\t\t\tif ( cameraAccessEnabled ) {\n\n\t\t\t\t\trenderer.state.unbindTexture();\n\n\t\t\t\t\tif ( glBinding ) {\n\n\t\t\t\t\t\tfor ( let i = 0; i < views.length; i ++ ) {\n\n\t\t\t\t\t\t\tconst camera = views[ i ].camera;\n\n\t\t\t\t\t\t\tif ( camera ) {\n\n\t\t\t\t\t\t\t\tlet cameraTex = cameraAccessTextures[ camera ];\n\n\t\t\t\t\t\t\t\tif ( ! cameraTex ) {\n\n\t\t\t\t\t\t\t\t\tcameraTex = new ExternalTexture();\n\t\t\t\t\t\t\t\t\tcameraAccessTextures[ camera ] = cameraTex;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst glTexture = glBinding.getCameraImage( camera );\n\t\t\t\t\t\t\t\tcameraTex.sourceTexture = glTexture;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tfor ( let i = 0; i < controllers.length; i ++ ) {\n\n\t\t\t\tconst inputSource = controllerInputSources[ i ];\n\t\t\t\tconst controller = controllers[ i ];\n\n\t\t\t\tif ( inputSource !== null && controller !== undefined ) {\n\n\t\t\t\t\tcontroller.update( inputSource, frame, customReferenceSpace || referenceSpace );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );\n\n\t\t\tif ( frame.detectedPlanes ) {\n\n\t\t\t\tscope.dispatchEvent( { type: 'planesdetected', data: frame } );\n\n\t\t\t}\n\n\t\t\txrFrame = null;\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\n\t\t};\n\n\t\tthis.dispose = function () {};\n\n\t}\n\n}\n\nconst _e1 = /*@__PURE__*/ new Euler();\nconst _m1 = /*@__PURE__*/ new Matrix4();\n\nfunction WebGLMaterials( renderer, properties ) {\n\n\tfunction refreshTransformUniform( map, uniform ) {\n\n\t\tif ( map.matrixAutoUpdate === true ) {\n\n\t\t\tmap.updateMatrix();\n\n\t\t}\n\n\t\tuniform.value.copy( map.matrix );\n\n\t}\n\n\tfunction refreshFogUniforms( uniforms, fog ) {\n\n\t\tfog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) );\n\n\t\tif ( fog.isFog ) {\n\n\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\tuniforms.fogFar.value = fog.far;\n\n\t\t} else if ( fog.isFogExp2 ) {\n\n\t\t\tuniforms.fogDensity.value = fog.density;\n\n\t\t}\n\n\t}\n\n\tfunction refreshMaterialUniforms( uniforms, material, pixelRatio, height, transmissionRenderTarget ) {\n\n\t\tif ( material.isMeshBasicMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshLambertMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshToonMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsToon( uniforms, material );\n\n\t\t} else if ( material.isMeshPhongMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsPhong( uniforms, material );\n\n\t\t} else if ( material.isMeshStandardMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsStandard( uniforms, material );\n\n\t\t\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\t\t\trefreshUniformsPhysical( uniforms, material, transmissionRenderTarget );\n\n\t\t\t}\n\n\t\t} else if ( material.isMeshMatcapMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsMatcap( uniforms, material );\n\n\t\t} else if ( material.isMeshDepthMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isMeshDistanceMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\t\t\trefreshUniformsDistance( uniforms, material );\n\n\t\t} else if ( material.isMeshNormalMaterial ) {\n\n\t\t\trefreshUniformsCommon( uniforms, material );\n\n\t\t} else if ( material.isLineBasicMaterial ) {\n\n\t\t\trefreshUniformsLine( uniforms, material );\n\n\t\t\tif ( material.isLineDashedMaterial ) {\n\n\t\t\t\trefreshUniformsDash( uniforms, material );\n\n\t\t\t}\n\n\t\t} else if ( material.isPointsMaterial ) {\n\n\t\t\trefreshUniformsPoints( uniforms, material, pixelRatio, height );\n\n\t\t} else if ( material.isSpriteMaterial ) {\n\n\t\t\trefreshUniformsSprites( uniforms, material );\n\n\t\t} else if ( material.isShadowMaterial ) {\n\n\t\t\tuniforms.color.value.copy( material.color );\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t} else if ( material.isShaderMaterial ) {\n\n\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsCommon( uniforms, material ) {\n\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.color ) {\n\n\t\t\tuniforms.diffuse.value.copy( material.color );\n\n\t\t}\n\n\t\tif ( material.emissive ) {\n\n\t\t\tuniforms.emissive.value.copy( material.emissive ).multiplyScalar( material.emissiveIntensity );\n\n\t\t}\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.bumpMap ) {\n\n\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\n\t\t\trefreshTransformUniform( material.bumpMap, uniforms.bumpMapTransform );\n\n\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.bumpScale.value *= -1;\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.normalMap ) {\n\n\t\t\tuniforms.normalMap.value = material.normalMap;\n\n\t\t\trefreshTransformUniform( material.normalMap, uniforms.normalMapTransform );\n\n\t\t\tuniforms.normalScale.value.copy( material.normalScale );\n\n\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\tuniforms.normalScale.value.negate();\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.displacementMap ) {\n\n\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\n\t\t\trefreshTransformUniform( material.displacementMap, uniforms.displacementMapTransform );\n\n\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\n\t\t}\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\n\t\t\trefreshTransformUniform( material.emissiveMap, uniforms.emissiveMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularMap ) {\n\n\t\t\tuniforms.specularMap.value = material.specularMap;\n\n\t\t\trefreshTransformUniform( material.specularMap, uniforms.specularMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t\tconst materialProperties = properties.get( material );\n\n\t\tconst envMap = materialProperties.envMap;\n\t\tconst envMapRotation = materialProperties.envMapRotation;\n\n\t\tif ( envMap ) {\n\n\t\t\tuniforms.envMap.value = envMap;\n\n\t\t\t_e1.copy( envMapRotation );\n\n\t\t\t// accommodate left-handed frame\n\t\t\t_e1.x *= -1; _e1.y *= -1; _e1.z *= -1;\n\n\t\t\tif ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {\n\n\t\t\t\t// environment maps which are not cube render targets or PMREMs follow a different convention\n\t\t\t\t_e1.y *= -1;\n\t\t\t\t_e1.z *= -1;\n\n\t\t\t}\n\n\t\t\tuniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );\n\n\t\t\tuniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -1 : 1;\n\n\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\tuniforms.ior.value = material.ior;\n\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t}\n\n\t\tif ( material.lightMap ) {\n\n\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\n\t\t\trefreshTransformUniform( material.lightMap, uniforms.lightMapTransform );\n\n\t\t}\n\n\t\tif ( material.aoMap ) {\n\n\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\n\t\t\trefreshTransformUniform( material.aoMap, uniforms.aoMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsLine( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDash( uniforms, material ) {\n\n\t\tuniforms.dashSize.value = material.dashSize;\n\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\tuniforms.scale.value = material.scale;\n\n\t}\n\n\tfunction refreshUniformsPoints( uniforms, material, pixelRatio, height ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.size.value = material.size * pixelRatio;\n\t\tuniforms.scale.value = height * 0.5;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.uvTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsSprites( uniforms, material ) {\n\n\t\tuniforms.diffuse.value.copy( material.color );\n\t\tuniforms.opacity.value = material.opacity;\n\t\tuniforms.rotation.value = material.rotation;\n\n\t\tif ( material.map ) {\n\n\t\t\tuniforms.map.value = material.map;\n\n\t\t\trefreshTransformUniform( material.map, uniforms.mapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaMap ) {\n\n\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\n\t\t\trefreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );\n\n\t\t}\n\n\t\tif ( material.alphaTest > 0 ) {\n\n\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhong( uniforms, material ) {\n\n\t\tuniforms.specular.value.copy( material.specular );\n\t\tuniforms.shininess.value = Math.max( material.shininess, 1e-4 ); // to prevent pow( 0.0, 0.0 )\n\n\t}\n\n\tfunction refreshUniformsToon( uniforms, material ) {\n\n\t\tif ( material.gradientMap ) {\n\n\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsStandard( uniforms, material ) {\n\n\t\tuniforms.metalness.value = material.metalness;\n\n\t\tif ( material.metalnessMap ) {\n\n\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\n\t\t\trefreshTransformUniform( material.metalnessMap, uniforms.metalnessMapTransform );\n\n\t\t}\n\n\t\tuniforms.roughness.value = material.roughness;\n\n\t\tif ( material.roughnessMap ) {\n\n\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\n\t\t\trefreshTransformUniform( material.roughnessMap, uniforms.roughnessMapTransform );\n\n\t\t}\n\n\t\tif ( material.envMap ) {\n\n\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\n\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsPhysical( uniforms, material, transmissionRenderTarget ) {\n\n\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\tif ( material.sheen > 0 ) {\n\n\t\t\tuniforms.sheenColor.value.copy( material.sheenColor ).multiplyScalar( material.sheen );\n\n\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\n\t\t\tif ( material.sheenColorMap ) {\n\n\t\t\t\tuniforms.sheenColorMap.value = material.sheenColorMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenColorMap, uniforms.sheenColorMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.sheenRoughnessMap ) {\n\n\t\t\t\tuniforms.sheenRoughnessMap.value = material.sheenRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.sheenRoughnessMap, uniforms.sheenRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.clearcoat > 0 ) {\n\n\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\tif ( material.clearcoatMap ) {\n\n\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatMap, uniforms.clearcoatMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatRoughnessMap ) {\n\n\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatRoughnessMap, uniforms.clearcoatRoughnessMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.clearcoatNormalMap ) {\n\n\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\trefreshTransformUniform( material.clearcoatNormalMap, uniforms.clearcoatNormalMapTransform );\n\n\t\t\t\tuniforms.clearcoatNormalScale.value.copy( material.clearcoatNormalScale );\n\n\t\t\t\tif ( material.side === BackSide ) {\n\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.dispersion > 0 ) {\n\n\t\t\tuniforms.dispersion.value = material.dispersion;\n\n\t\t}\n\n\t\tif ( material.iridescence > 0 ) {\n\n\t\t\tuniforms.iridescence.value = material.iridescence;\n\t\t\tuniforms.iridescenceIOR.value = material.iridescenceIOR;\n\t\t\tuniforms.iridescenceThicknessMinimum.value = material.iridescenceThicknessRange[ 0 ];\n\t\t\tuniforms.iridescenceThicknessMaximum.value = material.iridescenceThicknessRange[ 1 ];\n\n\t\t\tif ( material.iridescenceMap ) {\n\n\t\t\t\tuniforms.iridescenceMap.value = material.iridescenceMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceMap, uniforms.iridescenceMapTransform );\n\n\t\t\t}\n\n\t\t\tif ( material.iridescenceThicknessMap ) {\n\n\t\t\t\tuniforms.iridescenceThicknessMap.value = material.iridescenceThicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.iridescenceThicknessMap, uniforms.iridescenceThicknessMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( material.transmission > 0 ) {\n\n\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\tuniforms.transmissionSamplerSize.value.set( transmissionRenderTarget.width, transmissionRenderTarget.height );\n\n\t\t\tif ( material.transmissionMap ) {\n\n\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\n\t\t\t\trefreshTransformUniform( material.transmissionMap, uniforms.transmissionMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\tif ( material.thicknessMap ) {\n\n\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\n\t\t\t\trefreshTransformUniform( material.thicknessMap, uniforms.thicknessMapTransform );\n\n\t\t\t}\n\n\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\tuniforms.attenuationColor.value.copy( material.attenuationColor );\n\n\t\t}\n\n\t\tif ( material.anisotropy > 0 ) {\n\n\t\t\tuniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );\n\n\t\t\tif ( material.anisotropyMap ) {\n\n\t\t\t\tuniforms.anisotropyMap.value = material.anisotropyMap;\n\n\t\t\t\trefreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );\n\n\t\t\t}\n\n\t\t}\n\n\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\tuniforms.specularColor.value.copy( material.specularColor );\n\n\t\tif ( material.specularColorMap ) {\n\n\t\t\tuniforms.specularColorMap.value = material.specularColorMap;\n\n\t\t\trefreshTransformUniform( material.specularColorMap, uniforms.specularColorMapTransform );\n\n\t\t}\n\n\t\tif ( material.specularIntensityMap ) {\n\n\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\n\t\t\trefreshTransformUniform( material.specularIntensityMap, uniforms.specularIntensityMapTransform );\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsMatcap( uniforms, material ) {\n\n\t\tif ( material.matcap ) {\n\n\t\t\tuniforms.matcap.value = material.matcap;\n\n\t\t}\n\n\t}\n\n\tfunction refreshUniformsDistance( uniforms, material ) {\n\n\t\tconst light = properties.get( material ).light;\n\n\t\tuniforms.referencePosition.value.setFromMatrixPosition( light.matrixWorld );\n\t\tuniforms.nearDistance.value = light.shadow.camera.near;\n\t\tuniforms.farDistance.value = light.shadow.camera.far;\n\n\t}\n\n\treturn {\n\t\trefreshFogUniforms: refreshFogUniforms,\n\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t};\n\n}\n\nfunction WebGLUniformsGroups( gl, info, capabilities, state ) {\n\n\tlet buffers = {};\n\tlet updateList = {};\n\tlet allocatedBindingPoints = [];\n\n\tconst maxBindingPoints = gl.getParameter( gl.MAX_UNIFORM_BUFFER_BINDINGS ); // binding points are global whereas block indices are per shader program\n\n\tfunction bind( uniformsGroup, program ) {\n\n\t\tconst webglProgram = program.program;\n\t\tstate.uniformBlockBinding( uniformsGroup, webglProgram );\n\n\t}\n\n\tfunction update( uniformsGroup, program ) {\n\n\t\tlet buffer = buffers[ uniformsGroup.id ];\n\n\t\tif ( buffer === undefined ) {\n\n\t\t\tprepareUniformsGroup( uniformsGroup );\n\n\t\t\tbuffer = createBuffer( uniformsGroup );\n\t\t\tbuffers[ uniformsGroup.id ] = buffer;\n\n\t\t\tuniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\t}\n\n\t\t// ensure to update the binding points/block indices mapping for this program\n\n\t\tconst webglProgram = program.program;\n\t\tstate.updateUBOMapping( uniformsGroup, webglProgram );\n\n\t\t// update UBO once per frame\n\n\t\tconst frame = info.render.frame;\n\n\t\tif ( updateList[ uniformsGroup.id ] !== frame ) {\n\n\t\t\tupdateBufferData( uniformsGroup );\n\n\t\t\tupdateList[ uniformsGroup.id ] = frame;\n\n\t\t}\n\n\t}\n\n\tfunction createBuffer( uniformsGroup ) {\n\n\t\t// the setup of an UBO is independent of a particular shader program but global\n\n\t\tconst bindingPointIndex = allocateBindingPointIndex();\n\t\tuniformsGroup.__bindingPointIndex = bindingPointIndex;\n\n\t\tconst buffer = gl.createBuffer();\n\t\tconst size = uniformsGroup.__size;\n\t\tconst usage = uniformsGroup.usage;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\t\tgl.bufferData( gl.UNIFORM_BUFFER, size, usage );\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\t\tgl.bindBufferBase( gl.UNIFORM_BUFFER, bindingPointIndex, buffer );\n\n\t\treturn buffer;\n\n\t}\n\n\tfunction allocateBindingPointIndex() {\n\n\t\tfor ( let i = 0; i < maxBindingPoints; i ++ ) {\n\n\t\t\tif ( allocatedBindingPoints.indexOf( i ) === -1 ) {\n\n\t\t\t\tallocatedBindingPoints.push( i );\n\t\t\t\treturn i;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconsole.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );\n\n\t\treturn 0;\n\n\t}\n\n\tfunction updateBufferData( uniformsGroup ) {\n\n\t\tconst buffer = buffers[ uniformsGroup.id ];\n\t\tconst uniforms = uniformsGroup.uniforms;\n\t\tconst cache = uniformsGroup.__cache;\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, buffer );\n\n\t\tfor ( let i = 0, il = uniforms.length; i < il; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tif ( hasUniformChanged( uniform, i, j, cache ) === true ) {\n\n\t\t\t\t\tconst offset = uniform.__offset;\n\n\t\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\t\tlet arrayOffset = 0;\n\n\t\t\t\t\tfor ( let k = 0; k < values.length; k ++ ) {\n\n\t\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\t\t// TODO add integer and struct support\n\t\t\t\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value;\n\t\t\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset + arrayOffset, uniform.__data );\n\n\t\t\t\t\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t\t\t\t\t// manually converting 3x3 to 3x4\n\n\t\t\t\t\t\t\tuniform.__data[ 0 ] = value.elements[ 0 ];\n\t\t\t\t\t\t\tuniform.__data[ 1 ] = value.elements[ 1 ];\n\t\t\t\t\t\t\tuniform.__data[ 2 ] = value.elements[ 2 ];\n\t\t\t\t\t\t\tuniform.__data[ 3 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 4 ] = value.elements[ 3 ];\n\t\t\t\t\t\t\tuniform.__data[ 5 ] = value.elements[ 4 ];\n\t\t\t\t\t\t\tuniform.__data[ 6 ] = value.elements[ 5 ];\n\t\t\t\t\t\t\tuniform.__data[ 7 ] = 0;\n\t\t\t\t\t\t\tuniform.__data[ 8 ] = value.elements[ 6 ];\n\t\t\t\t\t\t\tuniform.__data[ 9 ] = value.elements[ 7 ];\n\t\t\t\t\t\t\tuniform.__data[ 10 ] = value.elements[ 8 ];\n\t\t\t\t\t\t\tuniform.__data[ 11 ] = 0;\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tvalue.toArray( uniform.__data, arrayOffset );\n\n\t\t\t\t\t\t\tarrayOffset += info.storage / Float32Array.BYTES_PER_ELEMENT;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl.bufferSubData( gl.UNIFORM_BUFFER, offset, uniform.__data );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tgl.bindBuffer( gl.UNIFORM_BUFFER, null );\n\n\t}\n\n\tfunction hasUniformChanged( uniform, index, indexArray, cache ) {\n\n\t\tconst value = uniform.value;\n\t\tconst indexString = index + '_' + indexArray;\n\n\t\tif ( cache[ indexString ] === undefined ) {\n\n\t\t\t// cache entry does not exist so far\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tcache[ indexString ] = value;\n\n\t\t\t} else {\n\n\t\t\t\tcache[ indexString ] = value.clone();\n\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\tconst cachedObject = cache[ indexString ];\n\n\t\t\t// compare current value with cached entry\n\n\t\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t\tif ( cachedObject !== value ) {\n\n\t\t\t\t\tcache[ indexString ] = value;\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( cachedObject.equals( value ) === false ) {\n\n\t\t\t\t\tcachedObject.copy( value );\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\tfunction prepareUniformsGroup( uniformsGroup ) {\n\n\t\t// determine total buffer size according to the STD140 layout\n\t\t// Hint: STD140 is the only supported layout in WebGL 2\n\n\t\tconst uniforms = uniformsGroup.uniforms;\n\n\t\tlet offset = 0; // global buffer offset in bytes\n\t\tconst chunkSize = 16; // size of a chunk in bytes\n\n\t\tfor ( let i = 0, l = uniforms.length; i < l; i ++ ) {\n\n\t\t\tconst uniformArray = Array.isArray( uniforms[ i ] ) ? uniforms[ i ] : [ uniforms[ i ] ];\n\n\t\t\tfor ( let j = 0, jl = uniformArray.length; j < jl; j ++ ) {\n\n\t\t\t\tconst uniform = uniformArray[ j ];\n\n\t\t\t\tconst values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];\n\n\t\t\t\tfor ( let k = 0, kl = values.length; k < kl; k ++ ) {\n\n\t\t\t\t\tconst value = values[ k ];\n\n\t\t\t\t\tconst info = getUniformSize( value );\n\n\t\t\t\t\tconst chunkOffset = offset % chunkSize; // offset in the current chunk\n\t\t\t\t\tconst chunkPadding = chunkOffset % info.boundary; // required padding to match boundary\n\t\t\t\t\tconst chunkStart = chunkOffset + chunkPadding; // the start position in the current chunk for the data\n\n\t\t\t\t\toffset += chunkPadding;\n\n\t\t\t\t\t// Check for chunk overflow\n\t\t\t\t\tif ( chunkStart !== 0 && ( chunkSize - chunkStart ) < info.storage ) {\n\n\t\t\t\t\t\t// Add padding and adjust offset\n\t\t\t\t\t\toffset += ( chunkSize - chunkStart );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following two properties will be used for partial buffer updates\n\t\t\t\t\tuniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );\n\t\t\t\t\tuniform.__offset = offset;\n\n\t\t\t\t\t// Update the global offset\n\t\t\t\t\toffset += info.storage;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// ensure correct final padding\n\n\t\tconst chunkOffset = offset % chunkSize;\n\n\t\tif ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset );\n\n\t\t//\n\n\t\tuniformsGroup.__size = offset;\n\t\tuniformsGroup.__cache = {};\n\n\t\treturn this;\n\n\t}\n\n\tfunction getUniformSize( value ) {\n\n\t\tconst info = {\n\t\t\tboundary: 0, // bytes\n\t\t\tstorage: 0 // bytes\n\t\t};\n\n\t\t// determine sizes according to STD140\n\n\t\tif ( typeof value === 'number' || typeof value === 'boolean' ) {\n\n\t\t\t// float/int/bool\n\n\t\t\tinfo.boundary = 4;\n\t\t\tinfo.storage = 4;\n\n\t\t} else if ( value.isVector2 ) {\n\n\t\t\t// vec2\n\n\t\t\tinfo.boundary = 8;\n\t\t\tinfo.storage = 8;\n\n\t\t} else if ( value.isVector3 || value.isColor ) {\n\n\t\t\t// vec3\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes\n\n\t\t} else if ( value.isVector4 ) {\n\n\t\t\t// vec4\n\n\t\t\tinfo.boundary = 16;\n\t\t\tinfo.storage = 16;\n\n\t\t} else if ( value.isMatrix3 ) {\n\n\t\t\t// mat3 (in STD140 a 3x3 matrix is represented as 3x4)\n\n\t\t\tinfo.boundary = 48;\n\t\t\tinfo.storage = 48;\n\n\t\t} else if ( value.isMatrix4 ) {\n\n\t\t\t// mat4\n\n\t\t\tinfo.boundary = 64;\n\t\t\tinfo.storage = 64;\n\n\t\t} else if ( value.isTexture ) {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );\n\n\t\t}\n\n\t\treturn info;\n\n\t}\n\n\tfunction onUniformsGroupsDispose( event ) {\n\n\t\tconst uniformsGroup = event.target;\n\n\t\tuniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose );\n\n\t\tconst index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex );\n\t\tallocatedBindingPoints.splice( index, 1 );\n\n\t\tgl.deleteBuffer( buffers[ uniformsGroup.id ] );\n\n\t\tdelete buffers[ uniformsGroup.id ];\n\t\tdelete updateList[ uniformsGroup.id ];\n\n\t}\n\n\tfunction dispose() {\n\n\t\tfor ( const id in buffers ) {\n\n\t\t\tgl.deleteBuffer( buffers[ id ] );\n\n\t\t}\n\n\t\tallocatedBindingPoints = [];\n\t\tbuffers = {};\n\t\tupdateList = {};\n\n\t}\n\n\treturn {\n\n\t\tbind: bind,\n\t\tupdate: update,\n\n\t\tdispose: dispose\n\n\t};\n\n}\n\n/**\n * This renderer uses WebGL 2 to display scenes.\n *\n * WebGL 1 is not supported since `r163`.\n */\nclass WebGLRenderer {\n\n\t/**\n\t * Constructs a new WebGL renderer.\n\t *\n\t * @param {WebGLRenderer~Options} [parameters] - The configuration parameter.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst {\n\t\t\tcanvas = createCanvasElement(),\n\t\t\tcontext = null,\n\t\t\tdepth = true,\n\t\t\tstencil = false,\n\t\t\talpha = false,\n\t\t\tantialias = false,\n\t\t\tpremultipliedAlpha = true,\n\t\t\tpreserveDrawingBuffer = false,\n\t\t\tpowerPreference = 'default',\n\t\t\tfailIfMajorPerformanceCaveat = false,\n\t\t\treversedDepthBuffer = false,\n\t\t} = parameters;\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isWebGLRenderer = true;\n\n\t\tlet _alpha;\n\n\t\tif ( context !== null ) {\n\n\t\t\tif ( typeof WebGLRenderingContext !== 'undefined' && context instanceof WebGLRenderingContext ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLRenderer: WebGL 1 is not supported since r163.' );\n\n\t\t\t}\n\n\t\t\t_alpha = context.getContextAttributes().alpha;\n\n\t\t} else {\n\n\t\t\t_alpha = alpha;\n\n\t\t}\n\n\t\tconst uintClearColor = new Uint32Array( 4 );\n\t\tconst intClearColor = new Int32Array( 4 );\n\n\t\tlet currentRenderList = null;\n\t\tlet currentRenderState = null;\n\n\t\t// render() can be called from within a callback triggered by another render.\n\t\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\t\tconst renderListStack = [];\n\t\tconst renderStateStack = [];\n\n\t\t// public properties\n\n\t\t/**\n\t\t * A canvas where the renderer draws its output.This is automatically created by the renderer\n\t\t * in the constructor (if not provided already); you just need to add it to your page like so:\n\t\t * ```js\n\t\t * document.body.appendChild( renderer.domElement );\n\t\t * ```\n\t\t *\n\t\t * @type {DOMElement}\n\t\t */\n\t\tthis.domElement = canvas;\n\n\t\t/**\n\t\t * A object with debug configuration settings.\n\t\t *\n\t\t * - `checkShaderErrors`: If it is `true`, defines whether material shader programs are\n\t\t * checked for errors during compilation and linkage process. It may be useful to disable\n\t\t * this check in production for performance gain. It is strongly recommended to keep these\n\t\t * checks enabled during development. If the shader does not compile and link - it will not\n\t\t * work and associated material will not render.\n\t\t * - `onShaderError(gl, program, glVertexShader,glFragmentShader)`: A callback function that\n\t\t * can be used for custom error reporting. The callback receives the WebGL context, an instance\n\t\t * of WebGLProgram as well two instances of WebGLShader representing the vertex and fragment shader.\n\t\t * Assigning a custom function disables the default error reporting.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.debug = {\n\n\t\t\t/**\n\t\t\t * Enables error checking and reporting when shader programs are being compiled.\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tcheckShaderErrors: true,\n\t\t\t/**\n\t\t\t * Callback for custom error reporting.\n\t\t\t * @type {?Function}\n\t\t\t */\n\t\t\tonShaderError: null\n\t\t};\n\n\t\t// clearing\n\n\t\t/**\n\t\t * Whether the renderer should automatically clear its output before rendering a frame or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoClear = true;\n\n\t\t/**\n\t\t * If {@link WebGLRenderer#autoClear} set to `true`, whether the renderer should clear\n\t\t * the color buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoClearColor = true;\n\n\t\t/**\n\t\t * If {@link WebGLRenderer#autoClear} set to `true`, whether the renderer should clear\n\t\t * the depth buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoClearDepth = true;\n\n\t\t/**\n\t\t * If {@link WebGLRenderer#autoClear} set to `true`, whether the renderer should clear\n\t\t * the stencil buffer or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.autoClearStencil = true;\n\n\t\t// scene graph\n\n\t\t/**\n\t\t * Whether the renderer should sort objects or not.\n\t\t *\n\t\t * Note: Sorting is used to attempt to properly render objects that have some\n\t\t * degree of transparency. By definition, sorting objects may not work in all\n\t\t * cases. Depending on the needs of application, it may be necessary to turn\n\t\t * off sorting and use other methods to deal with transparency rendering e.g.\n\t\t * manually determining each object's rendering order.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t// user-defined clipping\n\n\t\t/**\n\t\t * User-defined clipping planes specified in world space. These planes apply globally.\n\t\t * Points in space whose dot product with the plane is negative are cut away.\n\t\t *\n\t\t * @type {Array<Plane>}\n\t\t */\n\t\tthis.clippingPlanes = [];\n\n\t\t/**\n\t\t * Whether the renderer respects object-level clipping planes or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.localClippingEnabled = false;\n\n\t\t// tone mapping\n\n\t\t/**\n\t\t * The tone mapping technique of the renderer.\n\t\t *\n\t\t * @type {(NoToneMapping|LinearToneMapping|ReinhardToneMapping|CineonToneMapping|ACESFilmicToneMapping|CustomToneMapping|AgXToneMapping|NeutralToneMapping)}\n\t\t * @default NoToneMapping\n\t\t */\n\t\tthis.toneMapping = NoToneMapping;\n\n\t\t/**\n\t\t * Exposure level of tone mapping.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.toneMappingExposure = 1.0;\n\n\t\t// transmission\n\n\t\t/**\n\t\t * The normalized resolution scale for the transmission render target, measured in percentage\n\t\t * of viewport dimensions. Lowering this value can result in significant performance improvements\n\t\t * when using {@link MeshPhysicalMaterial#transmission}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.transmissionResolutionScale = 1.0;\n\n\t\t// internal properties\n\n\t\tconst _this = this;\n\n\t\tlet _isContextLost = false;\n\n\t\t// internal state cache\n\n\t\tthis._outputColorSpace = SRGBColorSpace;\n\n\t\tlet _currentActiveCubeFace = 0;\n\t\tlet _currentActiveMipmapLevel = 0;\n\t\tlet _currentRenderTarget = null;\n\t\tlet _currentMaterialId = -1;\n\n\t\tlet _currentCamera = null;\n\n\t\tconst _currentViewport = new Vector4();\n\t\tconst _currentScissor = new Vector4();\n\t\tlet _currentScissorTest = null;\n\n\t\tconst _currentClearColor = new Color( 0x000000 );\n\t\tlet _currentClearAlpha = 0;\n\n\t\t//\n\n\t\tlet _width = canvas.width;\n\t\tlet _height = canvas.height;\n\n\t\tlet _pixelRatio = 1;\n\t\tlet _opaqueSort = null;\n\t\tlet _transparentSort = null;\n\n\t\tconst _viewport = new Vector4( 0, 0, _width, _height );\n\t\tconst _scissor = new Vector4( 0, 0, _width, _height );\n\t\tlet _scissorTest = false;\n\n\t\t// frustum\n\n\t\tconst _frustum = new Frustum();\n\n\t\t// clipping\n\n\t\tlet _clippingEnabled = false;\n\t\tlet _localClippingEnabled = false;\n\n\t\t// camera matrices cache\n\n\t\tconst _projScreenMatrix = new Matrix4();\n\n\t\tconst _vector3 = new Vector3();\n\n\t\tconst _vector4 = new Vector4();\n\n\t\tconst _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };\n\n\t\tlet _renderBackground = false;\n\n\t\tfunction getTargetPixelRatio() {\n\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\n\t\t}\n\n\t\t// initialize\n\n\t\tlet _gl = context;\n\n\t\tfunction getContext( contextName, contextAttributes ) {\n\n\t\t\treturn canvas.getContext( contextName, contextAttributes );\n\n\t\t}\n\n\t\ttry {\n\n\t\t\tconst contextAttributes = {\n\t\t\t\talpha: true,\n\t\t\t\tdepth,\n\t\t\t\tstencil,\n\t\t\t\tantialias,\n\t\t\t\tpremultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer,\n\t\t\t\tpowerPreference,\n\t\t\t\tfailIfMajorPerformanceCaveat,\n\t\t\t};\n\n\t\t\t// OffscreenCanvas does not have setAttribute, see #22811\n\t\t\tif ( 'setAttribute' in canvas ) canvas.setAttribute( 'data-engine', `three.js r${REVISION}` );\n\n\t\t\t// event listeners must be registered before WebGL context is created, see #12753\n\t\t\tcanvas.addEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.addEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.addEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\tif ( _gl === null ) {\n\n\t\t\t\tconst contextName = 'webgl2';\n\n\t\t\t\t_gl = getContext( contextName, contextAttributes );\n\n\t\t\t\tif ( _gl === null ) {\n\n\t\t\t\t\tif ( getContext( contextName ) ) {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context with your selected attributes.' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( 'Error creating WebGL context.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} catch ( error ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: ' + error.message );\n\t\t\tthrow error;\n\n\t\t}\n\n\t\tlet extensions, capabilities, state, info;\n\t\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\t\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\n\t\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\n\t\tlet utils, bindingStates, uniformsGroups;\n\n\t\tfunction initGLContext() {\n\n\t\t\textensions = new WebGLExtensions( _gl );\n\t\t\textensions.init();\n\n\t\t\tutils = new WebGLUtils( _gl, extensions );\n\n\t\t\tcapabilities = new WebGLCapabilities( _gl, extensions, parameters, utils );\n\n\t\t\tstate = new WebGLState( _gl, extensions );\n\n\t\t\tif ( capabilities.reversedDepthBuffer && reversedDepthBuffer ) {\n\n\t\t\t\tstate.buffers.depth.setReversed( true );\n\n\t\t\t}\n\n\t\t\tinfo = new WebGLInfo( _gl );\n\t\t\tproperties = new WebGLProperties();\n\t\t\ttextures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );\n\t\t\tcubemaps = new WebGLCubeMaps( _this );\n\t\t\tcubeuvmaps = new WebGLCubeUVMaps( _this );\n\t\t\tattributes = new WebGLAttributes( _gl );\n\t\t\tbindingStates = new WebGLBindingStates( _gl, attributes );\n\t\t\tgeometries = new WebGLGeometries( _gl, attributes, info, bindingStates );\n\t\t\tobjects = new WebGLObjects( _gl, geometries, attributes, info );\n\t\t\tmorphtargets = new WebGLMorphtargets( _gl, capabilities, textures );\n\t\t\tclipping = new WebGLClipping( properties );\n\t\t\tprogramCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping );\n\t\t\tmaterials = new WebGLMaterials( _this, properties );\n\t\t\trenderLists = new WebGLRenderLists();\n\t\t\trenderStates = new WebGLRenderStates( extensions );\n\t\t\tbackground = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );\n\t\t\tshadowMap = new WebGLShadowMap( _this, objects, capabilities );\n\t\t\tuniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );\n\n\t\t\tbufferRenderer = new WebGLBufferRenderer( _gl, extensions, info );\n\t\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info );\n\n\t\t\tinfo.programs = programCache.programs;\n\n\t\t\t/**\n\t\t\t * Holds details about the capabilities of the current rendering context.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#capabilities\n\t\t\t * @type {WebGLRenderer~Capabilities}\n\t\t\t */\n\t\t\t_this.capabilities = capabilities;\n\n\t\t\t/**\n\t\t\t * Provides methods for retrieving and testing WebGL extensions.\n\t\t\t *\n\t\t\t * - `get(extensionName:string)`: Used to check whether a WebGL extension is supported\n\t\t\t * and return the extension object if available.\n\t\t\t * - `has(extensionName:string)`: returns `true` if the extension is supported.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#extensions\n\t\t\t * @type {Object}\n\t\t\t */\n\t\t\t_this.extensions = extensions;\n\n\t\t\t/**\n\t\t\t * Used to track properties of other objects like native WebGL objects.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#properties\n\t\t\t * @type {Object}\n\t\t\t */\n\t\t\t_this.properties = properties;\n\n\t\t\t/**\n\t\t\t * Manages the render lists of the renderer.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#renderLists\n\t\t\t * @type {Object}\n\t\t\t */\n\t\t\t_this.renderLists = renderLists;\n\n\n\n\t\t\t/**\n\t\t\t * Interface for managing shadows.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#shadowMap\n\t\t\t * @type {WebGLRenderer~ShadowMap}\n\t\t\t */\n\t\t\t_this.shadowMap = shadowMap;\n\n\t\t\t/**\n\t\t\t * Interface for managing the WebGL state.\n\t\t\t *\n\t\t\t * @name WebGLRenderer#state\n\t\t\t * @type {Object}\n\t\t\t */\n\t\t\t_this.state = state;\n\n\t\t\t/**\n\t\t\t * Holds a series of statistical information about the GPU memory\n\t\t\t * and the rendering process. Useful for debugging and monitoring.\n\t\t\t *\n\t\t\t * By default these data are reset at each render call but when having\n\t\t\t * multiple render passes per frame (e.g. when using post processing) it can\n\t\t\t * be preferred to reset with a custom pattern. First, set `autoReset` to\n\t\t\t * `false`.\n\t\t\t * ```js\n\t\t\t * renderer.info.autoReset = false;\n\t\t\t * ```\n\t\t\t * Call `reset()` whenever you have finished to render a single frame.\n\t\t\t * ```js\n\t\t\t * renderer.info.reset();\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @name WebGLRenderer#info\n\t\t\t * @type {WebGLRenderer~Info}\n\t\t\t */\n\t\t\t_this.info = info;\n\n\t\t}\n\n\t\tinitGLContext();\n\n\t\t// xr\n\n\t\tconst xr = new WebXRManager( _this, _gl );\n\n\t\t/**\n\t\t * A reference to the XR manager.\n\t\t *\n\t\t * @type {WebXRManager}\n\t\t */\n\t\tthis.xr = xr;\n\n\t\t/**\n\t\t * Returns the rendering context.\n\t\t *\n\t\t * @return {WebGL2RenderingContext} The rendering context.\n\t\t */\n\t\tthis.getContext = function () {\n\n\t\t\treturn _gl;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the rendering context attributes.\n\t\t *\n\t\t * @return {WebGLContextAttributes} The rendering context attributes.\n\t\t */\n\t\tthis.getContextAttributes = function () {\n\n\t\t\treturn _gl.getContextAttributes();\n\n\t\t};\n\n\t\t/**\n\t\t * Simulates a loss of the WebGL context. This requires support for the `WEBGL_lose_context` extension.\n\t\t */\n\t\tthis.forceContextLoss = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.loseContext();\n\n\t\t};\n\n\t\t/**\n\t\t * Simulates a restore of the WebGL context. This requires support for the `WEBGL_lose_context` extension.\n\t\t */\n\t\tthis.forceContextRestore = function () {\n\n\t\t\tconst extension = extensions.get( 'WEBGL_lose_context' );\n\t\t\tif ( extension ) extension.restoreContext();\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the pixel ratio.\n\t\t *\n\t\t * @return {number} The pixel ratio.\n\t\t */\n\t\tthis.getPixelRatio = function () {\n\n\t\t\treturn _pixelRatio;\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the given pixel ratio and resizes the canvas if necessary.\n\t\t *\n\t\t * @param {number} value - The pixel ratio.\n\t\t */\n\t\tthis.setPixelRatio = function ( value ) {\n\n\t\t\tif ( value === undefined ) return;\n\n\t\t\t_pixelRatio = value;\n\n\t\t\tthis.setSize( _width, _height, false );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio.\n\t\t *\n\t\t * @param {Vector2} target - The method writes the result in this target object.\n\t\t * @return {Vector2} The renderer's size in logical pixels.\n\t\t */\n\t\tthis.getSize = function ( target ) {\n\n\t\t\treturn target.set( _width, _height );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the output canvas to (width, height) with device pixel ratio taken\n\t\t * into account, and also sets the viewport to fit that size, starting in (0,\n\t\t * 0). Setting `updateStyle` to false prevents any style changes to the output canvas.\n\t\t *\n\t\t * @param {number} width - The width in logical pixels.\n\t\t * @param {number} height - The height in logical pixels.\n\t\t * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not.\n\t\t */\n\t\tthis.setSize = function ( width, height, updateStyle = true ) {\n\n\t\t\tif ( xr.isPresenting ) {\n\n\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\tcanvas.width = Math.floor( width * _pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * _pixelRatio );\n\n\t\t\tif ( updateStyle === true ) {\n\n\t\t\t\tcanvas.style.width = width + 'px';\n\t\t\t\tcanvas.style.height = height + 'px';\n\n\t\t\t}\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio.\n\t\t *\n\t\t * @param {Vector2} target - The method writes the result in this target object.\n\t\t * @return {Vector2} The drawing buffer size.\n\t\t */\n\t\tthis.getDrawingBufferSize = function ( target ) {\n\n\t\t\treturn target.set( _width * _pixelRatio, _height * _pixelRatio ).floor();\n\n\t\t};\n\n\t\t/**\n\t\t * This method allows to define the drawing buffer size by specifying\n\t\t * width, height and pixel ratio all at once. The size of the drawing\n\t\t * buffer is computed with this formula:\n\t\t * ```js\n\t\t * size.x = width * pixelRatio;\n\t\t * size.y = height * pixelRatio;\n\t\t * ```\n\t\t *\n\t\t * @param {number} width - The width in logical pixels.\n\t\t * @param {number} height - The height in logical pixels.\n\t\t * @param {number} pixelRatio - The pixel ratio.\n\t\t */\n\t\tthis.setDrawingBufferSize = function ( width, height, pixelRatio ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_pixelRatio = pixelRatio;\n\n\t\t\tcanvas.width = Math.floor( width * pixelRatio );\n\t\t\tcanvas.height = Math.floor( height * pixelRatio );\n\n\t\t\tthis.setViewport( 0, 0, width, height );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the current viewport definition.\n\t\t *\n\t\t * @param {Vector2} target - The method writes the result in this target object.\n\t\t * @return {Vector2} The current viewport definition.\n\t\t */\n\t\tthis.getCurrentViewport = function ( target ) {\n\n\t\t\treturn target.copy( _currentViewport );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the viewport definition.\n\t\t *\n\t\t * @param {Vector4} target - The method writes the result in this target object.\n\t\t * @return {Vector4} The viewport definition.\n\t\t */\n\t\tthis.getViewport = function ( target ) {\n\n\t\t\treturn target.copy( _viewport );\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the viewport to render from `(x, y)` to `(x + width, y + height)`.\n\t\t *\n\t\t * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.\n\t\t * Or alternatively a four-component vector specifying all the parameters of the viewport.\n\t\t * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin  in logical pixel unit.\n\t\t * @param {number} width - The width of the viewport in logical pixel unit.\n\t\t * @param {number} height - The height of the viewport in logical pixel unit.\n\t\t */\n\t\tthis.setViewport = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_viewport.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_viewport.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the scissor region.\n\t\t *\n\t\t * @param {Vector4} target - The method writes the result in this target object.\n\t\t * @return {Vector4} The scissor region.\n\t\t */\n\t\tthis.getScissor = function ( target ) {\n\n\t\t\treturn target.copy( _scissor );\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the scissor region to render from `(x, y)` to `(x + width, y + height)`.\n\t\t *\n\t\t * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the scissor region origin in logical pixel unit.\n\t\t * Or alternatively a four-component vector specifying all the parameters of the scissor region.\n\t\t * @param {number} y - The vertical coordinate for the lower left corner of the scissor region origin  in logical pixel unit.\n\t\t * @param {number} width - The width of the scissor region in logical pixel unit.\n\t\t * @param {number} height - The height of the scissor region in logical pixel unit.\n\t\t */\n\t\tthis.setScissor = function ( x, y, width, height ) {\n\n\t\t\tif ( x.isVector4 ) {\n\n\t\t\t\t_scissor.set( x.x, x.y, x.z, x.w );\n\n\t\t\t} else {\n\n\t\t\t\t_scissor.set( x, y, width, height );\n\n\t\t\t}\n\n\t\t\tstate.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns `true` if the scissor test is enabled.\n\t\t *\n\t\t * @return {boolean} Whether the scissor test is enabled or not.\n\t\t */\n\t\tthis.getScissorTest = function () {\n\n\t\t\treturn _scissorTest;\n\n\t\t};\n\n\t\t/**\n\t\t * Enable or disable the scissor test. When this is enabled, only the pixels\n\t\t * within the defined scissor area will be affected by further renderer\n\t\t * actions.\n\t\t *\n\t\t * @param {boolean} boolean - Whether the scissor test is enabled or not.\n\t\t */\n\t\tthis.setScissorTest = function ( boolean ) {\n\n\t\t\tstate.setScissorTest( _scissorTest = boolean );\n\n\t\t};\n\n\t\t/**\n\t\t * Sets a custom opaque sort function for the render lists. Pass `null`\n\t\t * to use the default `painterSortStable` function.\n\t\t *\n\t\t * @param {?Function} method - The opaque sort function.\n\t\t */\n\t\tthis.setOpaqueSort = function ( method ) {\n\n\t\t\t_opaqueSort = method;\n\n\t\t};\n\n\t\t/**\n\t\t * Sets a custom transparent sort function for the render lists. Pass `null`\n\t\t * to use the default `reversePainterSortStable` function.\n\t\t *\n\t\t * @param {?Function} method - The opaque sort function.\n\t\t */\n\t\tthis.setTransparentSort = function ( method ) {\n\n\t\t\t_transparentSort = method;\n\n\t\t};\n\n\t\t// Clearing\n\n\t\t/**\n\t\t * Returns the clear color.\n\t\t *\n\t\t * @param {Color} target - The method writes the result in this target object.\n\t\t * @return {Color} The clear color.\n\t\t */\n\t\tthis.getClearColor = function ( target ) {\n\n\t\t\treturn target.copy( background.getClearColor() );\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the clear color and alpha.\n\t\t *\n\t\t * @param {Color} color - The clear color.\n\t\t * @param {number} [alpha=1] - The clear alpha.\n\t\t */\n\t\tthis.setClearColor = function () {\n\n\t\t\tbackground.setClearColor( ...arguments );\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the clear alpha. Ranges within `[0,1]`.\n\t\t *\n\t\t * @return {number} The clear alpha.\n\t\t */\n\t\tthis.getClearAlpha = function () {\n\n\t\t\treturn background.getClearAlpha();\n\n\t\t};\n\n\t\t/**\n\t\t * Sets the clear alpha.\n\t\t *\n\t\t * @param {number} alpha - The clear alpha.\n\t\t */\n\t\tthis.setClearAlpha = function () {\n\n\t\t\tbackground.setClearAlpha( ...arguments );\n\n\t\t};\n\n\t\t/**\n\t\t * Tells the renderer to clear its color, depth or stencil drawing buffer(s).\n\t\t * This method initializes the buffers to the current clear color values.\n\t\t *\n\t\t * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.\n\t\t * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.\n\t\t * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.\n\t\t */\n\t\tthis.clear = function ( color = true, depth = true, stencil = true ) {\n\n\t\t\tlet bits = 0;\n\n\t\t\tif ( color ) {\n\n\t\t\t\t// check if we're trying to clear an integer target\n\t\t\t\tlet isIntegerFormat = false;\n\t\t\t\tif ( _currentRenderTarget !== null ) {\n\n\t\t\t\t\tconst targetFormat = _currentRenderTarget.texture.format;\n\t\t\t\t\tisIntegerFormat = targetFormat === RGBAIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RGIntegerFormat ||\n\t\t\t\t\t\ttargetFormat === RedIntegerFormat;\n\n\t\t\t\t}\n\n\t\t\t\t// use the appropriate clear functions to clear the target if it's a signed\n\t\t\t\t// or unsigned integer target\n\t\t\t\tif ( isIntegerFormat ) {\n\n\t\t\t\t\tconst targetType = _currentRenderTarget.texture.type;\n\t\t\t\t\tconst isUnsignedType = targetType === UnsignedByteType ||\n\t\t\t\t\t\ttargetType === UnsignedIntType ||\n\t\t\t\t\t\ttargetType === UnsignedShortType ||\n\t\t\t\t\t\ttargetType === UnsignedInt248Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort4444Type ||\n\t\t\t\t\t\ttargetType === UnsignedShort5551Type;\n\n\t\t\t\t\tconst clearColor = background.getClearColor();\n\t\t\t\t\tconst a = background.getClearAlpha();\n\t\t\t\t\tconst r = clearColor.r;\n\t\t\t\t\tconst g = clearColor.g;\n\t\t\t\t\tconst b = clearColor.b;\n\n\t\t\t\t\tif ( isUnsignedType ) {\n\n\t\t\t\t\t\tuintClearColor[ 0 ] = r;\n\t\t\t\t\t\tuintClearColor[ 1 ] = g;\n\t\t\t\t\t\tuintClearColor[ 2 ] = b;\n\t\t\t\t\t\tuintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tintClearColor[ 0 ] = r;\n\t\t\t\t\t\tintClearColor[ 1 ] = g;\n\t\t\t\t\t\tintClearColor[ 2 ] = b;\n\t\t\t\t\t\tintClearColor[ 3 ] = a;\n\t\t\t\t\t\t_gl.clearBufferiv( _gl.COLOR, 0, intClearColor );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tbits |= _gl.COLOR_BUFFER_BIT;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( depth ) {\n\n\t\t\t\tbits |= _gl.DEPTH_BUFFER_BIT;\n\n\t\t\t}\n\n\t\t\tif ( stencil ) {\n\n\t\t\t\tbits |= _gl.STENCIL_BUFFER_BIT;\n\t\t\t\tthis.state.buffers.stencil.setMask( 0xffffffff );\n\n\t\t\t}\n\n\t\t\t_gl.clear( bits );\n\n\t\t};\n\n\t\t/**\n\t\t * Clears the color buffer. Equivalent to calling `renderer.clear( true, false, false )`.\n\t\t */\n\t\tthis.clearColor = function () {\n\n\t\t\tthis.clear( true, false, false );\n\n\t\t};\n\n\t\t/**\n\t\t * Clears the depth buffer. Equivalent to calling `renderer.clear( false, true, false )`.\n\t\t */\n\t\tthis.clearDepth = function () {\n\n\t\t\tthis.clear( false, true, false );\n\n\t\t};\n\n\t\t/**\n\t\t * Clears the stencil buffer. Equivalent to calling `renderer.clear( false, false, true )`.\n\t\t */\n\t\tthis.clearStencil = function () {\n\n\t\t\tthis.clear( false, false, true );\n\n\t\t};\n\n\t\t/**\n\t\t * Frees the GPU-related resources allocated by this instance. Call this\n\t\t * method whenever this instance is no longer used in your app.\n\t\t */\n\t\tthis.dispose = function () {\n\n\t\t\tcanvas.removeEventListener( 'webglcontextlost', onContextLost, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );\n\t\t\tcanvas.removeEventListener( 'webglcontextcreationerror', onContextCreationError, false );\n\n\t\t\tbackground.dispose();\n\t\t\trenderLists.dispose();\n\t\t\trenderStates.dispose();\n\t\t\tproperties.dispose();\n\t\t\tcubemaps.dispose();\n\t\t\tcubeuvmaps.dispose();\n\t\t\tobjects.dispose();\n\t\t\tbindingStates.dispose();\n\t\t\tuniformsGroups.dispose();\n\t\t\tprogramCache.dispose();\n\n\t\t\txr.dispose();\n\n\t\t\txr.removeEventListener( 'sessionstart', onXRSessionStart );\n\t\t\txr.removeEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t\tanimation.stop();\n\n\t\t};\n\n\t\t// Events\n\n\t\tfunction onContextLost( event ) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Lost.' );\n\n\t\t\t_isContextLost = true;\n\n\t\t}\n\n\t\tfunction onContextRestore( /* event */ ) {\n\n\t\t\tconsole.log( 'THREE.WebGLRenderer: Context Restored.' );\n\n\t\t\t_isContextLost = false;\n\n\t\t\tconst infoAutoReset = info.autoReset;\n\t\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\t\tconst shadowMapType = shadowMap.type;\n\n\t\t\tinitGLContext();\n\n\t\t\tinfo.autoReset = infoAutoReset;\n\t\t\tshadowMap.enabled = shadowMapEnabled;\n\t\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\t\tshadowMap.type = shadowMapType;\n\n\t\t}\n\n\t\tfunction onContextCreationError( event ) {\n\n\t\t\tconsole.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );\n\n\t\t}\n\n\t\tfunction onMaterialDispose( event ) {\n\n\t\t\tconst material = event.target;\n\n\t\t\tmaterial.removeEventListener( 'dispose', onMaterialDispose );\n\n\t\t\tdeallocateMaterial( material );\n\n\t\t}\n\n\t\t// Buffer deallocation\n\n\t\tfunction deallocateMaterial( material ) {\n\n\t\t\treleaseMaterialProgramReferences( material );\n\n\t\t\tproperties.remove( material );\n\n\t\t}\n\n\n\t\tfunction releaseMaterialProgramReferences( material ) {\n\n\t\t\tconst programs = properties.get( material ).programs;\n\n\t\t\tif ( programs !== undefined ) {\n\n\t\t\t\tprograms.forEach( function ( program ) {\n\n\t\t\t\t\tprogramCache.releaseProgram( program );\n\n\t\t\t\t} );\n\n\t\t\t\tif ( material.isShaderMaterial ) {\n\n\t\t\t\t\tprogramCache.releaseShaderCache( material );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Buffer rendering\n\n\t\tthis.renderBufferDirect = function ( camera, scene, geometry, material, object, group ) {\n\n\t\t\tif ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\t\tconst frontFaceCW = ( object.isMesh && object.matrixWorld.determinant() < 0 );\n\n\t\t\tconst program = setProgram( camera, scene, geometry, material, object );\n\n\t\t\tstate.setMaterial( material, frontFaceCW );\n\n\t\t\t//\n\n\t\t\tlet index = geometry.index;\n\t\t\tlet rangeFactor = 1;\n\n\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\tindex = geometries.getWireframeAttribute( geometry );\n\n\t\t\t\tif ( index === undefined ) return;\n\n\t\t\t\trangeFactor = 2;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tconst drawRange = geometry.drawRange;\n\t\t\tconst position = geometry.attributes.position;\n\n\t\t\tlet drawStart = drawRange.start * rangeFactor;\n\t\t\tlet drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;\n\n\t\t\tif ( group !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, group.start * rangeFactor );\n\t\t\t\tdrawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );\n\n\t\t\t}\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, index.count );\n\n\t\t\t} else if ( position !== undefined && position !== null ) {\n\n\t\t\t\tdrawStart = Math.max( drawStart, 0 );\n\t\t\t\tdrawEnd = Math.min( drawEnd, position.count );\n\n\t\t\t}\n\n\t\t\tconst drawCount = drawEnd - drawStart;\n\n\t\t\tif ( drawCount < 0 || drawCount === Infinity ) return;\n\n\t\t\t//\n\n\t\t\tbindingStates.setup( object, material, program, geometry, index );\n\n\t\t\tlet attribute;\n\t\t\tlet renderer = bufferRenderer;\n\n\t\t\tif ( index !== null ) {\n\n\t\t\t\tattribute = attributes.get( index );\n\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex( attribute );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tif ( material.wireframe === true ) {\n\n\t\t\t\t\tstate.setLineWidth( material.wireframeLinewidth * getTargetPixelRatio() );\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isLine ) {\n\n\t\t\t\tlet lineWidth = material.linewidth;\n\n\t\t\t\tif ( lineWidth === undefined ) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth( lineWidth * getTargetPixelRatio() );\n\n\t\t\t\tif ( object.isLineSegments ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINES );\n\n\t\t\t\t} else if ( object.isLineLoop ) {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_LOOP );\n\n\t\t\t\t} else {\n\n\t\t\t\t\trenderer.setMode( _gl.LINE_STRIP );\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isPoints ) {\n\n\t\t\t\trenderer.setMode( _gl.POINTS );\n\n\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\trenderer.setMode( _gl.TRIANGLES );\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tif ( object._multiDrawInstances !== null ) {\n\n\t\t\t\t\t// @deprecated, r174\n\t\t\t\t\twarnOnce( 'THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );\n\t\t\t\t\trenderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( ! extensions.get( 'WEBGL_multi_draw' ) ) {\n\n\t\t\t\t\t\tconst starts = object._multiDrawStarts;\n\t\t\t\t\t\tconst counts = object._multiDrawCounts;\n\t\t\t\t\t\tconst drawCount = object._multiDrawCount;\n\t\t\t\t\t\tconst bytesPerElement = index ? attributes.get( index ).bytesPerElement : 1;\n\t\t\t\t\t\tconst uniforms = properties.get( material ).currentProgram.getUniforms();\n\t\t\t\t\t\tfor ( let i = 0; i < drawCount; i ++ ) {\n\n\t\t\t\t\t\t\tuniforms.setValue( _gl, '_gl_DrawID', i );\n\t\t\t\t\t\t\trenderer.render( starts[ i ] / bytesPerElement, counts[ i ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\trenderer.renderMultiDraw( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else if ( object.isInstancedMesh ) {\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, object.count );\n\n\t\t\t} else if ( geometry.isInstancedBufferGeometry ) {\n\n\t\t\t\tconst maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;\n\t\t\t\tconst instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );\n\n\t\t\t\trenderer.renderInstances( drawStart, drawCount, instanceCount );\n\n\t\t\t} else {\n\n\t\t\t\trenderer.render( drawStart, drawCount );\n\n\t\t\t}\n\n\t\t};\n\n\t\t// Compile\n\n\t\tfunction prepareMaterial( material, scene, object ) {\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\tgetProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * Compiles all materials in the scene with the camera. This is useful to precompile shaders\n\t\t * before the first rendering. If you want to add a 3D object to an existing scene, use the third\n\t\t * optional parameter for applying the target scene.\n\t\t *\n\t\t * Note that the (target) scene's lighting and environment must be configured before calling this method.\n\t\t *\n\t\t * @param {Object3D} scene - The scene or another type of 3D object to precompile.\n\t\t * @param {Camera} camera - The camera.\n\t\t * @param {?Scene} [targetScene=null] - The target scene.\n\t\t * @return {Set<Material>} The precompiled materials.\n\t\t */\n\t\tthis.compile = function ( scene, camera, targetScene = null ) {\n\n\t\t\tif ( targetScene === null ) targetScene = scene;\n\n\t\t\tcurrentRenderState = renderStates.get( targetScene );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t// gather lights from both the target scene and the new object that will be added to the scene.\n\n\t\t\ttargetScene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tif ( scene !== targetScene ) {\n\n\t\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\t\tif ( object.isLight && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tcurrentRenderState.setupLights();\n\n\t\t\t// Only initialize materials in the new scene, not the targetScene.\n\n\t\t\tconst materials = new Set();\n\n\t\t\tscene.traverse( function ( object ) {\n\n\t\t\t\tif ( ! ( object.isMesh || object.isPoints || object.isLine || object.isSprite ) ) {\n\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif ( material ) {\n\n\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\tfor ( let i = 0; i < material.length; i ++ ) {\n\n\t\t\t\t\t\t\tconst material2 = material[ i ];\n\n\t\t\t\t\t\t\tprepareMaterial( material2, targetScene, object );\n\t\t\t\t\t\t\tmaterials.add( material2 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tprepareMaterial( material, targetScene, object );\n\t\t\t\t\t\tmaterials.add( material );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tcurrentRenderState = renderStateStack.pop();\n\n\t\t\treturn materials;\n\n\t\t};\n\n\t\t// compileAsync\n\n\t\t/**\n\t\t * Asynchronous version of {@link WebGLRenderer#compile}.\n\t\t *\n\t\t * This method makes use of the `KHR_parallel_shader_compile` WebGL extension. Hence,\n\t\t * it is recommended to use this version of `compile()` whenever possible.\n\t\t *\n\t\t * @async\n\t\t * @param {Object3D} scene - The scene or another type of 3D object to precompile.\n\t\t * @param {Camera} camera - The camera.\n\t\t * @param {?Scene} [targetScene=null] - The target scene.\n\t\t * @return {Promise} A Promise that resolves when the given scene can be rendered without unnecessary stalling due to shader compilation.\n\t\t */\n\t\tthis.compileAsync = function ( scene, camera, targetScene = null ) {\n\n\t\t\tconst materials = this.compile( scene, camera, targetScene );\n\n\t\t\t// Wait for all the materials in the new object to indicate that they're\n\t\t\t// ready to be used before resolving the promise.\n\n\t\t\treturn new Promise( ( resolve ) => {\n\n\t\t\t\tfunction checkMaterialsReady() {\n\n\t\t\t\t\tmaterials.forEach( function ( material ) {\n\n\t\t\t\t\t\tconst materialProperties = properties.get( material );\n\t\t\t\t\t\tconst program = materialProperties.currentProgram;\n\n\t\t\t\t\t\tif ( program.isReady() ) {\n\n\t\t\t\t\t\t\t// remove any programs that report they're ready to use from the list\n\t\t\t\t\t\t\tmaterials.delete( material );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\t// once the list of compiling materials is empty, call the callback\n\n\t\t\t\t\tif ( materials.size === 0 ) {\n\n\t\t\t\t\t\tresolve( scene );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// if some materials are still not ready, wait a bit and check again\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t\tif ( extensions.get( 'KHR_parallel_shader_compile' ) !== null ) {\n\n\t\t\t\t\t// If we can check the compilation status of the materials without\n\t\t\t\t\t// blocking then do so right away.\n\n\t\t\t\t\tcheckMaterialsReady();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Otherwise start by waiting a bit to give the materials we just\n\t\t\t\t\t// initialized a chance to finish.\n\n\t\t\t\t\tsetTimeout( checkMaterialsReady, 10 );\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t};\n\n\t\t// Animation Loop\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame( time ) {\n\n\t\t\tif ( onAnimationFrameCallback ) onAnimationFrameCallback( time );\n\n\t\t}\n\n\t\tfunction onXRSessionStart() {\n\n\t\t\tanimation.stop();\n\n\t\t}\n\n\t\tfunction onXRSessionEnd() {\n\n\t\t\tanimation.start();\n\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\t\tanimation.setAnimationLoop( onAnimationFrame );\n\n\t\tif ( typeof self !== 'undefined' ) animation.setContext( self );\n\n\t\tthis.setAnimationLoop = function ( callback ) {\n\n\t\t\tonAnimationFrameCallback = callback;\n\t\t\txr.setAnimationLoop( callback );\n\n\t\t\t( callback === null ) ? animation.stop() : animation.start();\n\n\t\t};\n\n\t\txr.addEventListener( 'sessionstart', onXRSessionStart );\n\t\txr.addEventListener( 'sessionend', onXRSessionEnd );\n\n\t\t// Rendering\n\n\t\t/**\n\t\t * Renders the given scene (or other type of 3D object) using the given camera.\n\t\t *\n\t\t * The render is done to a previously specified render target set by calling {@link WebGLRenderer#setRenderTarget}\n\t\t * or to the canvas as usual.\n\t\t *\n\t\t * By default render buffers are cleared before rendering but you can prevent\n\t\t * this by setting the property `autoClear` to `false`. If you want to prevent\n\t\t * only certain buffers being cleared you can `autoClearColor`, `autoClearDepth`\n\t\t * or `autoClearStencil` to `false`. To force a clear, use {@link WebGLRenderer#clear}.\n\t\t *\n\t\t * @param {Object3D} scene - The scene to render.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( camera !== undefined && camera.isCamera !== true ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( _isContextLost === true ) return;\n\n\t\t\t// update scene graph\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\n\t\t\t// update camera matrices and frustum\n\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\t\tif ( xr.cameraAutoUpdate === true ) xr.updateCamera( camera );\n\n\t\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\n\t\t\t}\n\n\t\t\t//\n\t\t\tif ( scene.isScene === true ) scene.onBeforeRender( _this, scene, camera, _currentRenderTarget );\n\n\t\t\tcurrentRenderState = renderStates.get( scene, renderStateStack.length );\n\t\t\tcurrentRenderState.init( camera );\n\n\t\t\trenderStateStack.push( currentRenderState );\n\n\t\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\t\t_frustum.setFromProjectionMatrix( _projScreenMatrix, WebGLCoordinateSystem, camera.reversedDepth );\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = clipping.init( this.clippingPlanes, _localClippingEnabled );\n\n\t\t\tcurrentRenderList = renderLists.get( scene, renderListStack.length );\n\t\t\tcurrentRenderList.init();\n\n\t\t\trenderListStack.push( currentRenderList );\n\n\t\t\tif ( xr.enabled === true && xr.isPresenting === true ) {\n\n\t\t\t\tconst depthSensingMesh = _this.xr.getDepthSensingMesh();\n\n\t\t\t\tif ( depthSensingMesh !== null ) {\n\n\t\t\t\t\tprojectObject( depthSensingMesh, camera, - Infinity, _this.sortObjects );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tprojectObject( scene, camera, 0, _this.sortObjects );\n\n\t\t\tcurrentRenderList.finish();\n\n\t\t\tif ( _this.sortObjects === true ) {\n\n\t\t\t\tcurrentRenderList.sort( _opaqueSort, _transparentSort );\n\n\t\t\t}\n\n\t\t\t_renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false;\n\t\t\tif ( _renderBackground ) {\n\n\t\t\t\tbackground.addToRenderList( currentRenderList, scene );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tthis.info.render.frame ++;\n\n\t\t\tif ( _clippingEnabled === true ) clipping.beginShadows();\n\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tshadowMap.render( shadowsArray, scene, camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.endShadows();\n\n\t\t\t//\n\n\t\t\tif ( this.info.autoReset === true ) this.info.reset();\n\n\t\t\t// render scene\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\n\t\t\tcurrentRenderState.setupLights();\n\n\t\t\tif ( camera.isArrayCamera ) {\n\n\t\t\t\tconst cameras = camera.cameras;\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) {\n\n\t\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\t\trenderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst camera2 = cameras[ i ];\n\n\t\t\t\t\trenderScene( currentRenderList, scene, camera2, camera2.viewport );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif ( transmissiveObjects.length > 0 ) renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera );\n\n\t\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t\trenderScene( currentRenderList, scene, camera );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( _currentRenderTarget !== null && _currentActiveMipmapLevel === 0 ) {\n\n\t\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\n\t\t\t\ttextures.updateMultisampleRenderTarget( _currentRenderTarget );\n\n\t\t\t\t// Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\t\ttextures.updateRenderTargetMipmap( _currentRenderTarget );\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tif ( scene.isScene === true ) scene.onAfterRender( _this, scene, camera );\n\n\t\t\t// _gl.finish();\n\n\t\t\tbindingStates.resetDefaultState();\n\t\t\t_currentMaterialId = -1;\n\t\t\t_currentCamera = null;\n\n\t\t\trenderStateStack.pop();\n\n\t\t\tif ( renderStateStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderState = renderStateStack[ renderStateStack.length - 1 ];\n\n\t\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, currentRenderState.state.camera );\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderState = null;\n\n\t\t\t}\n\n\t\t\trenderListStack.pop();\n\n\t\t\tif ( renderListStack.length > 0 ) {\n\n\t\t\t\tcurrentRenderList = renderListStack[ renderListStack.length - 1 ];\n\n\t\t\t} else {\n\n\t\t\t\tcurrentRenderList = null;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction projectObject( object, camera, groupOrder, sortObjects ) {\n\n\t\t\tif ( object.visible === false ) return;\n\n\t\t\tconst visible = object.layers.test( camera.layers );\n\n\t\t\tif ( visible ) {\n\n\t\t\t\tif ( object.isGroup ) {\n\n\t\t\t\t\tgroupOrder = object.renderOrder;\n\n\t\t\t\t} else if ( object.isLOD ) {\n\n\t\t\t\t\tif ( object.autoUpdate === true ) object.update( camera );\n\n\t\t\t\t} else if ( object.isLight ) {\n\n\t\t\t\t\tcurrentRenderState.pushLight( object );\n\n\t\t\t\t\tif ( object.castShadow ) {\n\n\t\t\t\t\t\tcurrentRenderState.pushShadow( object );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isSprite ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\t_vector4.setFromMatrixPosition( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector4.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( object.isMesh || object.isLine || object.isPoints ) {\n\n\t\t\t\t\tif ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {\n\n\t\t\t\t\t\tconst geometry = objects.update( object );\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif ( sortObjects ) {\n\n\t\t\t\t\t\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\t\t\t\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector4.copy( object.boundingSphere.center );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\t\t\t\t\t\t\t\t_vector4.copy( geometry.boundingSphere.center );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_vector4\n\t\t\t\t\t\t\t\t.applyMatrix4( object.matrixWorld )\n\t\t\t\t\t\t\t\t.applyMatrix4( _projScreenMatrix );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\t\t\t\tif ( groupMaterial && groupMaterial.visible ) {\n\n\t\t\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, groupMaterial, groupOrder, _vector4.z, group );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( material.visible ) {\n\n\t\t\t\t\t\t\tcurrentRenderList.push( object, geometry, material, groupOrder, _vector4.z, null );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\n\n\t\t\t\tprojectObject( children[ i ], camera, groupOrder, sortObjects );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderScene( currentRenderList, scene, camera, viewport ) {\n\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\t\tconst transparentObjects = currentRenderList.transparent;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\tif ( viewport ) state.viewport( _currentViewport.copy( viewport ) );\n\n\t\t\tif ( opaqueObjects.length > 0 ) renderObjects( opaqueObjects, scene, camera );\n\t\t\tif ( transmissiveObjects.length > 0 ) renderObjects( transmissiveObjects, scene, camera );\n\t\t\tif ( transparentObjects.length > 0 ) renderObjects( transparentObjects, scene, camera );\n\n\t\t\t// Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.buffers.depth.setTest( true );\n\t\t\tstate.buffers.depth.setMask( true );\n\t\t\tstate.buffers.color.setMask( true );\n\n\t\t\tstate.setPolygonOffset( false );\n\n\t\t}\n\n\t\tfunction renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tif ( overrideMaterial !== null ) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( currentRenderState.state.transmissionRenderTarget[ camera.id ] === undefined ) {\n\n\t\t\t\tcurrentRenderState.state.transmissionRenderTarget[ camera.id ] = new WebGLRenderTarget( 1, 1, {\n\t\t\t\t\tgenerateMipmaps: true,\n\t\t\t\t\ttype: ( extensions.has( 'EXT_color_buffer_half_float' ) || extensions.has( 'EXT_color_buffer_float' ) ) ? HalfFloatType : UnsignedByteType,\n\t\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\t\tsamples: 4,\n\t\t\t\t\tstencilBuffer: stencil,\n\t\t\t\t\tresolveDepthBuffer: false,\n\t\t\t\t\tresolveStencilBuffer: false,\n\t\t\t\t\tcolorSpace: ColorManagement.workingColorSpace,\n\t\t\t\t} );\n\n\t\t\t\t// debug\n\n\t\t\t\t/*\n\t\t\t\tconst geometry = new PlaneGeometry();\n\t\t\t\tconst material = new MeshBasicMaterial( { map: _transmissionRenderTarget.texture } );\n\n\t\t\t\tconst mesh = new Mesh( geometry, material );\n\t\t\t\tscene.add( mesh );\n\t\t\t\t*/\n\n\t\t\t}\n\n\t\t\tconst transmissionRenderTarget = currentRenderState.state.transmissionRenderTarget[ camera.id ];\n\n\t\t\tconst activeViewport = camera.viewport || _currentViewport;\n\t\t\ttransmissionRenderTarget.setSize( activeViewport.z * _this.transmissionResolutionScale, activeViewport.w * _this.transmissionResolutionScale );\n\n\t\t\t//\n\n\t\t\tconst currentRenderTarget = _this.getRenderTarget();\n\t\t\tconst currentActiveCubeFace = _this.getActiveCubeFace();\n\t\t\tconst currentActiveMipmapLevel = _this.getActiveMipmapLevel();\n\n\t\t\t_this.setRenderTarget( transmissionRenderTarget );\n\n\t\t\t_this.getClearColor( _currentClearColor );\n\t\t\t_currentClearAlpha = _this.getClearAlpha();\n\t\t\tif ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );\n\n\t\t\t_this.clear();\n\n\t\t\tif ( _renderBackground ) background.render( scene );\n\n\t\t\t// Turn off the features which can affect the frag color for opaque objects pass.\n\t\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\t\t\tconst currentToneMapping = _this.toneMapping;\n\t\t\t_this.toneMapping = NoToneMapping;\n\n\t\t\t// Remove viewport from camera to avoid nested render calls resetting viewport to it (e.g Reflector).\n\t\t\t// Transmission render pass requires viewport to match the transmissionRenderTarget.\n\t\t\tconst currentCameraViewport = camera.viewport;\n\t\t\tif ( camera.viewport !== undefined ) camera.viewport = undefined;\n\n\t\t\tcurrentRenderState.setupLightsView( camera );\n\n\t\t\tif ( _clippingEnabled === true ) clipping.setGlobalState( _this.clippingPlanes, camera );\n\n\t\t\trenderObjects( opaqueObjects, scene, camera );\n\n\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\tif ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === false ) { // see #28131\n\n\t\t\t\tlet renderTargetNeedsUpdate = false;\n\n\t\t\t\tfor ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst renderItem = transmissiveObjects[ i ];\n\n\t\t\t\t\tconst object = renderItem.object;\n\t\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\t\tconst material = renderItem.material;\n\t\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\t\tif ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\t\tconst currentSide = material.side;\n\n\t\t\t\t\t\tmaterial.side = BackSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t\t\tmaterial.side = currentSide;\n\t\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t\trenderTargetNeedsUpdate = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTargetNeedsUpdate === true ) {\n\n\t\t\t\t\ttextures.updateMultisampleRenderTarget( transmissionRenderTarget );\n\t\t\t\t\ttextures.updateRenderTargetMipmap( transmissionRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_this.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );\n\n\t\t\t_this.setClearColor( _currentClearColor, _currentClearAlpha );\n\n\t\t\tif ( currentCameraViewport !== undefined ) camera.viewport = currentCameraViewport;\n\n\t\t\t_this.toneMapping = currentToneMapping;\n\n\t\t}\n\n\t\tfunction renderObjects( renderList, scene, camera ) {\n\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tfor ( let i = 0, l = renderList.length; i < l; i ++ ) {\n\n\t\t\t\tconst renderItem = renderList[ i ];\n\n\t\t\t\tconst object = renderItem.object;\n\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\tconst group = renderItem.group;\n\t\t\t\tlet material = renderItem.material;\n\n\t\t\t\tif ( material.allowOverride === true && overrideMaterial !== null ) {\n\n\t\t\t\t\tmaterial = overrideMaterial;\n\n\t\t\t\t}\n\n\t\t\t\tif ( object.layers.test( camera.layers ) ) {\n\n\t\t\t\t\trenderObject( object, scene, camera, geometry, material, group );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera, geometry, material, group ) {\n\n\t\t\tobject.onBeforeRender( _this, scene, camera, geometry, material, group );\n\n\t\t\tobject.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );\n\t\t\tobject.normalMatrix.getNormalMatrix( object.modelViewMatrix );\n\n\t\t\tmaterial.onBeforeRender( _this, scene, camera, geometry, object, group );\n\n\t\t\tif ( material.transparent === true && material.side === DoubleSide && material.forceSinglePass === false ) {\n\n\t\t\t\tmaterial.side = BackSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\tmaterial.needsUpdate = true;\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t\tmaterial.side = DoubleSide;\n\n\t\t\t} else {\n\n\t\t\t\t_this.renderBufferDirect( camera, scene, geometry, material, object, group );\n\n\t\t\t}\n\n\t\t\tobject.onAfterRender( _this, scene, camera, geometry, material, group );\n\n\t\t}\n\n\t\tfunction getProgram( material, scene, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tconst lights = currentRenderState.state.lights;\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\n\t\t\tconst lightsStateVersion = lights.state.version;\n\n\t\t\tconst parameters = programCache.getParameters( material, lights.state, shadowsArray, scene, object );\n\t\t\tconst programCacheKey = programCache.getProgramCacheKey( parameters );\n\n\t\t\tlet programs = materialProperties.programs;\n\n\t\t\t// always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tmaterialProperties.fog = scene.fog;\n\t\t\tmaterialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );\n\t\t\tmaterialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;\n\n\t\t\tif ( programs === undefined ) {\n\n\t\t\t\t// new material\n\n\t\t\t\tmaterial.addEventListener( 'dispose', onMaterialDispose );\n\n\t\t\t\tprograms = new Map();\n\t\t\t\tmaterialProperties.programs = programs;\n\n\t\t\t}\n\n\t\t\tlet program = programs.get( programCacheKey );\n\n\t\t\tif ( program !== undefined ) {\n\n\t\t\t\t// early out if program and light state is identical\n\n\t\t\t\tif ( materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion ) {\n\n\t\t\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t\t\treturn program;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tparameters.uniforms = programCache.getUniforms( material );\n\n\t\t\t\tmaterial.onBeforeCompile( parameters, _this );\n\n\t\t\t\tprogram = programCache.acquireProgram( parameters, programCacheKey );\n\t\t\t\tprograms.set( programCacheKey, program );\n\n\t\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\n\t\t\t}\n\n\t\t\tconst uniforms = materialProperties.uniforms;\n\n\t\t\tif ( ( ! material.isShaderMaterial && ! material.isRawShaderMaterial ) || material.clipping === true ) {\n\n\t\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\n\t\t\t}\n\n\t\t\tupdateCommonMaterialProperties( material, parameters );\n\n\t\t\t// store the light setup it was created for\n\n\t\t\tmaterialProperties.needsLights = materialNeedsLights( material );\n\t\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t// wire up the material to this renderer's lighting state\n\n\t\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\n\t\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\t\tuniforms.spotLightMatrix.value = lights.state.spotLightMatrix;\n\t\t\t\tuniforms.spotLightMap.value = lights.state.spotLightMap;\n\t\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;\n\t\t\t\t// TODO (abelnation): add area lights shadow info to uniforms\n\n\t\t\t}\n\n\t\t\tmaterialProperties.currentProgram = program;\n\t\t\tmaterialProperties.uniformsList = null;\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\tfunction getUniformList( materialProperties ) {\n\n\t\t\tif ( materialProperties.uniformsList === null ) {\n\n\t\t\t\tconst progUniforms = materialProperties.currentProgram.getUniforms();\n\t\t\t\tmaterialProperties.uniformsList = WebGLUniforms.seqWithValue( progUniforms.seq, materialProperties.uniforms );\n\n\t\t\t}\n\n\t\t\treturn materialProperties.uniformsList;\n\n\t\t}\n\n\t\tfunction updateCommonMaterialProperties( material, parameters ) {\n\n\t\t\tconst materialProperties = properties.get( material );\n\n\t\t\tmaterialProperties.outputColorSpace = parameters.outputColorSpace;\n\t\t\tmaterialProperties.batching = parameters.batching;\n\t\t\tmaterialProperties.batchingColor = parameters.batchingColor;\n\t\t\tmaterialProperties.instancing = parameters.instancing;\n\t\t\tmaterialProperties.instancingColor = parameters.instancingColor;\n\t\t\tmaterialProperties.instancingMorph = parameters.instancingMorph;\n\t\t\tmaterialProperties.skinning = parameters.skinning;\n\t\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\t\tmaterialProperties.morphColors = parameters.morphColors;\n\t\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\t\tmaterialProperties.toneMapping = parameters.toneMapping;\n\n\t\t}\n\n\t\tfunction setProgram( camera, scene, geometry, material, object ) {\n\n\t\t\tif ( scene.isScene !== true ) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\ttextures.resetTextureUnits();\n\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );\n\t\t\tconst envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );\n\t\t\tconst vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\t\tconst vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );\n\t\t\tconst morphTargets = !! geometry.morphAttributes.position;\n\t\t\tconst morphNormals = !! geometry.morphAttributes.normal;\n\t\t\tconst morphColors = !! geometry.morphAttributes.color;\n\n\t\t\tlet toneMapping = NoToneMapping;\n\n\t\t\tif ( material.toneMapped ) {\n\n\t\t\t\tif ( _currentRenderTarget === null || _currentRenderTarget.isXRRenderTarget === true ) {\n\n\t\t\t\t\ttoneMapping = _this.toneMapping;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;\n\t\t\tconst morphTargetsCount = ( morphAttribute !== undefined ) ? morphAttribute.length : 0;\n\n\t\t\tconst materialProperties = properties.get( material );\n\t\t\tconst lights = currentRenderState.state.lights;\n\n\t\t\tif ( _clippingEnabled === true ) {\n\n\t\t\t\tif ( _localClippingEnabled === true || camera !== _currentCamera ) {\n\n\t\t\t\t\tconst useCache =\n\t\t\t\t\t\tcamera === _currentCamera &&\n\t\t\t\t\t\tmaterial.id === _currentMaterialId;\n\n\t\t\t\t\t// we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\t\t\t\t\tclipping.setState( material, camera, useCache );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet needsProgramChange = false;\n\n\t\t\tif ( material.version === materialProperties.__version ) {\n\n\t\t\t\tif ( materialProperties.needsLights && ( materialProperties.lightsStateVersion !== lights.state.version ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.outputColorSpace !== colorSpace ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batching === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isBatchedMesh && materialProperties.batching === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batchingColor === true && object.colorTexture === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isBatchedMesh && materialProperties.batchingColor === false && object.colorTexture !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancing === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isInstancedMesh && materialProperties.instancing === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isSkinnedMesh && materialProperties.skinning === false ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === true && object.instanceColor === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingColor === false && object.instanceColor !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.envMap !== envMap ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( material.fog === true && materialProperties.fog !== fog ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.numClippingPlanes !== undefined &&\n\t\t\t\t\t( materialProperties.numClippingPlanes !== clipping.numPlanes ||\n\t\t\t\t\tmaterialProperties.numIntersection !== clipping.numIntersection ) ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexAlphas !== vertexAlphas ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.vertexTangents !== vertexTangents ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargets !== morphTargets ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphNormals !== morphNormals ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphColors !== morphColors ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.toneMapping !== toneMapping ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t} else if ( materialProperties.morphTargetsCount !== morphTargetsCount ) {\n\n\t\t\t\t\tneedsProgramChange = true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tneedsProgramChange = true;\n\t\t\t\tmaterialProperties.__version = material.version;\n\n\t\t\t}\n\n\t\t\t//\n\n\t\t\tlet program = materialProperties.currentProgram;\n\n\t\t\tif ( needsProgramChange === true ) {\n\n\t\t\t\tprogram = getProgram( material, scene, object );\n\n\t\t\t}\n\n\t\t\tlet refreshProgram = false;\n\t\t\tlet refreshMaterial = false;\n\t\t\tlet refreshLights = false;\n\n\t\t\tconst p_uniforms = program.getUniforms(),\n\t\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\t\tif ( state.useProgram( program.program ) ) {\n\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\n\t\t\t}\n\n\t\t\tif ( material.id !== _currentMaterialId ) {\n\n\t\t\t\t_currentMaterialId = material.id;\n\n\t\t\t\trefreshMaterial = true;\n\n\t\t\t}\n\n\t\t\tif ( refreshProgram || _currentCamera !== camera ) {\n\n\t\t\t\t// common camera uniforms\n\n\t\t\t\tconst reversedDepthBuffer = state.buffers.depth.getReversed();\n\n\t\t\t\tif ( reversedDepthBuffer && camera.reversedDepth !== true ) {\n\n\t\t\t\t\tcamera._reversedDepth = true;\n\t\t\t\t\tcamera.updateProjectionMatrix();\n\n\t\t\t\t}\n\n\t\t\t\tp_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix );\n\n\t\t\t\tp_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );\n\n\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\tif ( uCamPos !== undefined ) {\n\n\t\t\t\t\tuCamPos.setValue( _gl, _vector3.setFromMatrixPosition( camera.matrixWorld ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( capabilities.logarithmicDepthBuffer ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'logDepthBufFC',\n\t\t\t\t\t\t2.0 / ( Math.log( camera.far + 1.0 ) / Math.LN2 ) );\n\n\t\t\t\t}\n\n\t\t\t\t// consider moving isOrthographic to UniformLib and WebGLMaterials, see https://github.com/mrdoob/three.js/pull/26467#issuecomment-1645185067\n\n\t\t\t\tif ( material.isMeshPhongMaterial ||\n\t\t\t\t\tmaterial.isMeshToonMaterial ||\n\t\t\t\t\tmaterial.isMeshLambertMaterial ||\n\t\t\t\t\tmaterial.isMeshBasicMaterial ||\n\t\t\t\t\tmaterial.isMeshStandardMaterial ||\n\t\t\t\t\tmaterial.isShaderMaterial ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'isOrthographic', camera.isOrthographicCamera === true );\n\n\t\t\t\t}\n\n\t\t\t\tif ( _currentCamera !== camera ) {\n\n\t\t\t\t\t_currentCamera = camera;\n\n\t\t\t\t\t// lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true;\t\t// set to true on material change\n\t\t\t\t\trefreshLights = true;\t\t// remains set until update done\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// skinning and morph target uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrix' );\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );\n\n\t\t\t\tconst skeleton = object.skeleton;\n\n\t\t\t\tif ( skeleton ) {\n\n\t\t\t\t\tif ( skeleton.boneTexture === null ) skeleton.computeBoneTexture();\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( object.isBatchedMesh ) {\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingTexture' );\n\t\t\t\tp_uniforms.setValue( _gl, 'batchingTexture', object._matricesTexture, textures );\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingIdTexture' );\n\t\t\t\tp_uniforms.setValue( _gl, 'batchingIdTexture', object._indirectTexture, textures );\n\n\t\t\t\tp_uniforms.setOptional( _gl, object, 'batchingColorTexture' );\n\t\t\t\tif ( object._colorsTexture !== null ) {\n\n\t\t\t\t\tp_uniforms.setValue( _gl, 'batchingColorTexture', object._colorsTexture, textures );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\t\tif ( morphAttributes.position !== undefined || morphAttributes.normal !== undefined || ( morphAttributes.color !== undefined ) ) {\n\n\t\t\t\tmorphtargets.update( object, geometry, program );\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow ) {\n\n\t\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\t\tp_uniforms.setValue( _gl, 'receiveShadow', object.receiveShadow );\n\n\t\t\t}\n\n\t\t\t// https://github.com/mrdoob/three.js/pull/24467#issuecomment-1209031512\n\n\t\t\tif ( material.isMeshGouraudMaterial && material.envMap !== null ) {\n\n\t\t\t\tm_uniforms.envMap.value = envMap;\n\n\t\t\t\tm_uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? -1 : 1;\n\n\t\t\t}\n\n\t\t\tif ( material.isMeshStandardMaterial && material.envMap === null && scene.environment !== null ) {\n\n\t\t\t\tm_uniforms.envMapIntensity.value = scene.environmentIntensity;\n\n\t\t\t}\n\n\t\t\tif ( refreshMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );\n\n\t\t\t\tif ( materialProperties.needsLights ) {\n\n\t\t\t\t\t// the current material requires lighting info\n\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate( m_uniforms, refreshLights );\n\n\t\t\t\t}\n\n\t\t\t\t// refresh uniforms common to several materials\n\n\t\t\t\tif ( fog && material.fog === true ) {\n\n\t\t\t\t\tmaterials.refreshFogUniforms( m_uniforms, fog );\n\n\t\t\t\t}\n\n\t\t\t\tmaterials.refreshMaterialUniforms( m_uniforms, material, _pixelRatio, _height, currentRenderState.state.transmissionRenderTarget[ camera.id ] );\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\n\t\t\t}\n\n\t\t\tif ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) {\n\n\t\t\t\tWebGLUniforms.upload( _gl, getUniformList( materialProperties ), m_uniforms, textures );\n\t\t\t\tmaterial.uniformsNeedUpdate = false;\n\n\t\t\t}\n\n\t\t\tif ( material.isSpriteMaterial ) {\n\n\t\t\t\tp_uniforms.setValue( _gl, 'center', object.center );\n\n\t\t\t}\n\n\t\t\t// common matrices\n\n\t\t\tp_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );\n\t\t\tp_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );\n\n\t\t\t// UBOs\n\n\t\t\tif ( material.isShaderMaterial || material.isRawShaderMaterial ) {\n\n\t\t\t\tconst groups = material.uniformsGroups;\n\n\t\t\t\tfor ( let i = 0, l = groups.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\n\t\t\t\t\tuniformsGroups.update( group, program );\n\t\t\t\t\tuniformsGroups.bind( group, program );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn program;\n\n\t\t}\n\n\t\t// If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\t\tfunction markUniformsLightsNeedsUpdate( uniforms, value ) {\n\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\t\tuniforms.lightProbe.needsUpdate = value;\n\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\n\t\t}\n\n\t\tfunction materialNeedsLights( material ) {\n\n\t\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial ||\n\t\t\t\tmaterial.isMeshStandardMaterial || material.isShadowMaterial ||\n\t\t\t\t( material.isShaderMaterial && material.lights === true );\n\n\t\t}\n\n\t\t/**\n\t\t * Returns the active cube face.\n\t\t *\n\t\t * @return {number} The active cube face.\n\t\t */\n\t\tthis.getActiveCubeFace = function () {\n\n\t\t\treturn _currentActiveCubeFace;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the active mipmap level.\n\t\t *\n\t\t * @return {number} The active mipmap level.\n\t\t */\n\t\tthis.getActiveMipmapLevel = function () {\n\n\t\t\treturn _currentActiveMipmapLevel;\n\n\t\t};\n\n\t\t/**\n\t\t * Returns the active render target.\n\t\t *\n\t\t * @return {?WebGLRenderTarget} The active render target. Returns `null` if no render target\n\t\t * is currently set.\n\t\t */\n\t\tthis.getRenderTarget = function () {\n\n\t\t\treturn _currentRenderTarget;\n\n\t\t};\n\n\t\tthis.setRenderTargetTextures = function ( renderTarget, colorTexture, depthTexture ) {\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\trenderTargetProperties.__autoAllocateDepthBuffer = renderTarget.resolveDepthBuffer === false;\n\t\t\tif ( renderTargetProperties.__autoAllocateDepthBuffer === false ) {\n\n\t\t\t\t// The multisample_render_to_texture extension doesn't work properly if there\n\t\t\t\t// are midframe flushes and an external depth buffer. Disable use of the extension.\n\t\t\t\trenderTargetProperties.__useRenderToTexture = false;\n\n\t\t\t}\n\n\t\t\tproperties.get( renderTarget.texture ).__webglTexture = colorTexture;\n\t\t\tproperties.get( renderTarget.depthTexture ).__webglTexture = renderTargetProperties.__autoAllocateDepthBuffer ? undefined : depthTexture;\n\n\t\t\trenderTargetProperties.__hasExternalTextures = true;\n\n\t\t};\n\n\t\tthis.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {\n\n\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\t\trenderTargetProperties.__webglFramebuffer = defaultFramebuffer;\n\t\t\trenderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;\n\n\t\t};\n\n\t\tconst _scratchFrameBuffer = _gl.createFramebuffer();\n\n\t\t/**\n\t\t * Sets the active rendertarget.\n\t\t *\n\t\t * @param {?WebGLRenderTarget} renderTarget - The render target to set. When `null` is given,\n\t\t * the canvas is set as the active render target instead.\n\t\t * @param {number} [activeCubeFace=0] - The active cube face when using a cube render target.\n\t\t * Indicates the z layer to render in to when using 3D or array render targets.\n\t\t * @param {number} [activeMipmapLevel=0] - The active mipmap level.\n\t\t */\n\t\tthis.setRenderTarget = function ( renderTarget, activeCubeFace = 0, activeMipmapLevel = 0 ) {\n\n\t\t\t_currentRenderTarget = renderTarget;\n\t\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\n\t\t\tlet useDefaultFramebuffer = true;\n\t\t\tlet framebuffer = null;\n\t\t\tlet isCube = false;\n\t\t\tlet isRenderTarget3D = false;\n\n\t\t\tif ( renderTarget ) {\n\n\t\t\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\t\t\tif ( renderTargetProperties.__useDefaultFramebuffer !== undefined ) {\n\n\t\t\t\t\t// We need to make sure to rebind the framebuffer.\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\t\t\t\t\tuseDefaultFramebuffer = false;\n\n\t\t\t\t} else if ( renderTargetProperties.__webglFramebuffer === undefined ) {\n\n\t\t\t\t\ttextures.setupRenderTarget( renderTarget );\n\n\t\t\t\t} else if ( renderTargetProperties.__hasExternalTextures ) {\n\n\t\t\t\t\t// Color and depth texture must be rebound in order for the swapchain to update.\n\t\t\t\t\ttextures.rebindTextures( renderTarget, properties.get( renderTarget.texture ).__webglTexture, properties.get( renderTarget.depthTexture ).__webglTexture );\n\n\t\t\t\t} else if ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t// check if the depth texture is already bound to the frame buffer and that it's been initialized\n\t\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\t\t\t\t\tif ( renderTargetProperties.__boundDepthTexture !== depthTexture ) {\n\n\t\t\t\t\t\t// check if the depth texture is compatible\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdepthTexture !== null &&\n\t\t\t\t\t\t\tproperties.has( depthTexture ) &&\n\t\t\t\t\t\t\t( renderTarget.width !== depthTexture.image.width || renderTarget.height !== depthTexture.image.height )\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tthrow new Error( 'WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Swap the depth buffer to the currently attached one\n\t\t\t\t\t\ttextures.setupDepthRenderbuffer( renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst texture = renderTarget.texture;\n\n\t\t\t\tif ( texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\t\tisRenderTarget3D = true;\n\n\t\t\t\t}\n\n\t\t\t\tconst __webglFramebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\t\tif ( renderTarget.isWebGLCubeRenderTarget ) {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer[ activeCubeFace ] ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ][ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeCubeFace ];\n\n\t\t\t\t\t}\n\n\t\t\t\t\tisCube = true;\n\n\t\t\t\t} else if ( ( renderTarget.samples > 0 ) && textures.useMultisampledRTT( renderTarget ) === false ) {\n\n\t\t\t\t\tframebuffer = properties.get( renderTarget ).__webglMultisampledFramebuffer;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( Array.isArray( __webglFramebuffer ) ) {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer[ activeMipmapLevel ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tframebuffer = __webglFramebuffer;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_currentViewport.copy( renderTarget.viewport );\n\t\t\t\t_currentScissor.copy( renderTarget.scissor );\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\n\t\t\t} else {\n\n\t\t\t\t_currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor();\n\t\t\t\t_currentScissorTest = _scissorTest;\n\n\t\t\t}\n\n\t\t\t// Use a scratch frame buffer if rendering to a mip level to avoid depth buffers\n\t\t\t// being bound that are different sizes.\n\t\t\tif ( activeMipmapLevel !== 0 ) {\n\n\t\t\t\tframebuffer = _scratchFrameBuffer;\n\n\t\t\t}\n\n\t\t\tconst framebufferBound = state.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\tif ( framebufferBound && useDefaultFramebuffer ) {\n\n\t\t\t\tstate.drawBuffers( renderTarget, framebuffer );\n\n\t\t\t}\n\n\t\t\tstate.viewport( _currentViewport );\n\t\t\tstate.scissor( _currentScissor );\n\t\t\tstate.setScissorTest( _currentScissorTest );\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel );\n\n\t\t\t} else if ( isRenderTarget3D ) {\n\n\t\t\t\tconst layer = activeCubeFace;\n\n\t\t\t\tfor ( let i = 0; i < renderTarget.textures.length; i ++ ) {\n\n\t\t\t\t\tconst textureProperties = properties.get( renderTarget.textures[ i ] );\n\n\t\t\t\t\t_gl.framebufferTextureLayer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0 + i, textureProperties.__webglTexture, activeMipmapLevel, layer );\n\n\t\t\t\t}\n\n\t\t\t} else if ( renderTarget !== null && activeMipmapLevel !== 0 ) {\n\n\t\t\t\t// Only bind the frame buffer if we are using a scratch frame buffer to render to a mipmap.\n\t\t\t\t// If we rebind the texture when using a multi sample buffer then an error about inconsistent samples will be thrown.\n\t\t\t\tconst textureProperties = properties.get( renderTarget.texture );\n\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, textureProperties.__webglTexture, activeMipmapLevel );\n\n\t\t\t}\n\n\t\t\t_currentMaterialId = -1; // reset current material to ensure correct uniform bindings\n\n\t\t};\n\n\t\t/**\n\t\t * Reads the pixel data from the given render target into the given buffer.\n\t\t *\n\t\t * @param {WebGLRenderTarget} renderTarget - The render target to read from.\n\t\t * @param {number} x - The `x` coordinate of the copy region's origin.\n\t\t * @param {number} y - The `y` coordinate of the copy region's origin.\n\t\t * @param {number} width - The width of the copy region.\n\t\t * @param {number} height - The height of the copy region.\n\t\t * @param {TypedArray} buffer - The result buffer.\n\t\t * @param {number} [activeCubeFaceIndex] - The active cube face index.\n\t\t * @param {number} [textureIndex=0] - The texture index of an MRT render target.\n\t\t */\n\t\tthis.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex, textureIndex = 0 ) {\n\n\t\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t\t}\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\ttry {\n\n\t\t\t\t\tconst texture = renderTarget.textures[ textureIndex ];\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif ( ! capabilities.textureFormatReadable( textureFormat ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! capabilities.textureTypeReadable( textureType ) ) {\n\n\t\t\t\t\t\tconsole.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\n\t\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t\t// when using MRT, select the correct color buffer for the subsequent read command\n\n\t\t\t\t\t\tif ( renderTarget.textures.length > 1 ) _gl.readBuffer( _gl.COLOR_ATTACHMENT0 + textureIndex );\n\n\t\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), buffer );\n\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\t// restore framebuffer of current render target if necessary\n\n\t\t\t\t\tconst framebuffer = ( _currentRenderTarget !== null ) ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Asynchronous, non-blocking version of {@link WebGLRenderer#readRenderTargetPixels}.\n\t\t *\n\t\t * It is recommended to use this version of `readRenderTargetPixels()` whenever possible.\n\t\t *\n\t\t * @async\n\t\t * @param {WebGLRenderTarget} renderTarget - The render target to read from.\n\t\t * @param {number} x - The `x` coordinate of the copy region's origin.\n\t\t * @param {number} y - The `y` coordinate of the copy region's origin.\n\t\t * @param {number} width - The width of the copy region.\n\t\t * @param {number} height - The height of the copy region.\n\t\t * @param {TypedArray} buffer - The result buffer.\n\t\t * @param {number} [activeCubeFaceIndex] - The active cube face index.\n\t\t * @param {number} [textureIndex=0] - The texture index of an MRT render target.\n\t\t * @return {Promise<TypedArray>} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array.\n\t\t */\n\t\tthis.readRenderTargetPixelsAsync = async function ( renderTarget, x, y, width, height, buffer, activeCubeFaceIndex, textureIndex = 0 ) {\n\n\t\t\tif ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {\n\n\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );\n\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get( renderTarget ).__webglFramebuffer;\n\t\t\tif ( renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined ) {\n\n\t\t\t\tframebuffer = framebuffer[ activeCubeFaceIndex ];\n\n\t\t\t}\n\n\t\t\tif ( framebuffer ) {\n\n\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\t\t\t\tif ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {\n\n\t\t\t\t\t// set the active frame buffer to the one we want to read\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\n\t\t\t\t\tconst texture = renderTarget.textures[ textureIndex ];\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif ( ! capabilities.textureFormatReadable( textureFormat ) ) {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! capabilities.textureTypeReadable( textureType ) ) {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst glBuffer = _gl.createBuffer();\n\t\t\t\t\t_gl.bindBuffer( _gl.PIXEL_PACK_BUFFER, glBuffer );\n\t\t\t\t\t_gl.bufferData( _gl.PIXEL_PACK_BUFFER, buffer.byteLength, _gl.STREAM_READ );\n\n\t\t\t\t\t// when using MRT, select the correct color buffer for the subsequent read command\n\n\t\t\t\t\tif ( renderTarget.textures.length > 1 ) _gl.readBuffer( _gl.COLOR_ATTACHMENT0 + textureIndex );\n\n\t\t\t\t\t_gl.readPixels( x, y, width, height, utils.convert( textureFormat ), utils.convert( textureType ), 0 );\n\n\t\t\t\t\t// reset the frame buffer to the currently set buffer before waiting\n\t\t\t\t\tconst currFramebuffer = _currentRenderTarget !== null ? properties.get( _currentRenderTarget ).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer( _gl.FRAMEBUFFER, currFramebuffer );\n\n\t\t\t\t\t// check if the commands have finished every 8 ms\n\t\t\t\t\tconst sync = _gl.fenceSync( _gl.SYNC_GPU_COMMANDS_COMPLETE, 0 );\n\n\t\t\t\t\t_gl.flush();\n\n\t\t\t\t\tawait probeAsync( _gl, sync, 4 );\n\n\t\t\t\t\t// read the data and delete the buffer\n\t\t\t\t\t_gl.bindBuffer( _gl.PIXEL_PACK_BUFFER, glBuffer );\n\t\t\t\t\t_gl.getBufferSubData( _gl.PIXEL_PACK_BUFFER, 0, buffer );\n\t\t\t\t\t_gl.deleteBuffer( glBuffer );\n\t\t\t\t\t_gl.deleteSync( sync );\n\n\t\t\t\t\treturn buffer;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthrow new Error( 'THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Copies pixels from the current bound framebuffer into the given texture.\n\t\t *\n\t\t * @param {FramebufferTexture} texture - The texture.\n\t\t * @param {?Vector2} [position=null] - The start position of the copy operation.\n\t\t * @param {number} [level=0] - The mip level. The default represents the base mip.\n\t\t */\n\t\tthis.copyFramebufferToTexture = function ( texture, position = null, level = 0 ) {\n\n\t\t\tconst levelScale = Math.pow( 2, - level );\n\t\t\tconst width = Math.floor( texture.image.width * levelScale );\n\t\t\tconst height = Math.floor( texture.image.height * levelScale );\n\n\t\t\tconst x = position !== null ? position.x : 0;\n\t\t\tconst y = position !== null ? position.y : 0;\n\n\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t_gl.copyTexSubImage2D( _gl.TEXTURE_2D, level, 0, 0, x, y, width, height );\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tconst _srcFramebuffer = _gl.createFramebuffer();\n\t\tconst _dstFramebuffer = _gl.createFramebuffer();\n\n\t\t/**\n\t\t * Copies data of the given source texture into a destination texture.\n\t\t *\n\t\t * When using render target textures as `srcTexture` and `dstTexture`, you must make sure both render targets are initialized\n\t\t * {@link WebGLRenderer#initRenderTarget}.\n\t\t *\n\t\t * @param {Texture} srcTexture - The source texture.\n\t\t * @param {Texture} dstTexture - The destination texture.\n\t\t * @param {?(Box2|Box3)} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional.\n\t\t * @param {?(Vector2|Vector3)} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional.\n\t\t * @param {number} [srcLevel=0] - The source mipmap level to copy.\n\t\t * @param {?number} [dstLevel=null] - The destination mipmap level.\n\t\t */\n\t\tthis.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, srcLevel = 0, dstLevel = null ) {\n\n\t\t\t// support the previous signature with just a single dst mipmap level\n\t\t\tif ( dstLevel === null ) {\n\n\t\t\t\tif ( srcLevel !== 0 ) {\n\n\t\t\t\t\t// @deprecated, r171\n\t\t\t\t\twarnOnce( 'WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.' );\n\t\t\t\t\tdstLevel = srcLevel;\n\t\t\t\t\tsrcLevel = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdstLevel = 0;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// gather the necessary dimensions to copy\n\t\t\tlet width, height, depth, minX, minY, minZ;\n\t\t\tlet dstX, dstY, dstZ;\n\t\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[ dstLevel ] : srcTexture.image;\n\t\t\tif ( srcRegion !== null ) {\n\n\t\t\t\twidth = srcRegion.max.x - srcRegion.min.x;\n\t\t\t\theight = srcRegion.max.y - srcRegion.min.y;\n\t\t\t\tdepth = srcRegion.isBox3 ? srcRegion.max.z - srcRegion.min.z : 1;\n\t\t\t\tminX = srcRegion.min.x;\n\t\t\t\tminY = srcRegion.min.y;\n\t\t\t\tminZ = srcRegion.isBox3 ? srcRegion.min.z : 0;\n\n\t\t\t} else {\n\n\t\t\t\tconst levelScale = Math.pow( 2, - srcLevel );\n\t\t\t\twidth = Math.floor( image.width * levelScale );\n\t\t\t\theight = Math.floor( image.height * levelScale );\n\t\t\t\tif ( srcTexture.isDataArrayTexture ) {\n\n\t\t\t\t\tdepth = image.depth;\n\n\t\t\t\t} else if ( srcTexture.isData3DTexture ) {\n\n\t\t\t\t\tdepth = Math.floor( image.depth * levelScale );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tdepth = 1;\n\n\t\t\t\t}\n\n\t\t\t\tminX = 0;\n\t\t\t\tminY = 0;\n\t\t\t\tminZ = 0;\n\n\t\t\t}\n\n\t\t\tif ( dstPosition !== null ) {\n\n\t\t\t\tdstX = dstPosition.x;\n\t\t\t\tdstY = dstPosition.y;\n\t\t\t\tdstZ = dstPosition.z;\n\n\t\t\t} else {\n\n\t\t\t\tdstX = 0;\n\t\t\t\tdstY = 0;\n\t\t\t\tdstZ = 0;\n\n\t\t\t}\n\n\t\t\t// Set up the destination target\n\t\t\tconst glFormat = utils.convert( dstTexture.format );\n\t\t\tconst glType = utils.convert( dstTexture.type );\n\t\t\tlet glTarget;\n\n\t\t\tif ( dstTexture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_3D;\n\n\t\t\t} else if ( dstTexture.isDataArrayTexture || dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_2D_ARRAY;\n\n\t\t\t} else {\n\n\t\t\t\ttextures.setTexture2D( dstTexture, 0 );\n\t\t\t\tglTarget = _gl.TEXTURE_2D;\n\n\t\t\t}\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment );\n\n\t\t\t// used for copying data from cpu\n\t\t\tconst currentUnpackRowLen = _gl.getParameter( _gl.UNPACK_ROW_LENGTH );\n\t\t\tconst currentUnpackImageHeight = _gl.getParameter( _gl.UNPACK_IMAGE_HEIGHT );\n\t\t\tconst currentUnpackSkipPixels = _gl.getParameter( _gl.UNPACK_SKIP_PIXELS );\n\t\t\tconst currentUnpackSkipRows = _gl.getParameter( _gl.UNPACK_SKIP_ROWS );\n\t\t\tconst currentUnpackSkipImages = _gl.getParameter( _gl.UNPACK_SKIP_IMAGES );\n\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, image.width );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, image.height );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, minX );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, minY );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, minZ );\n\n\t\t\t// set up the src texture\n\t\t\tconst isSrc3D = srcTexture.isDataArrayTexture || srcTexture.isData3DTexture;\n\t\t\tconst isDst3D = dstTexture.isDataArrayTexture || dstTexture.isData3DTexture;\n\t\t\tif ( srcTexture.isDepthTexture ) {\n\n\t\t\t\tconst srcTextureProperties = properties.get( srcTexture );\n\t\t\t\tconst dstTextureProperties = properties.get( dstTexture );\n\t\t\t\tconst srcRenderTargetProperties = properties.get( srcTextureProperties.__renderTarget );\n\t\t\t\tconst dstRenderTargetProperties = properties.get( dstTextureProperties.__renderTarget );\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, srcRenderTargetProperties.__webglFramebuffer );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, dstRenderTargetProperties.__webglFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < depth; i ++ ) {\n\n\t\t\t\t\t// if the source or destination are a 3d target then a layer needs to be bound\n\t\t\t\t\tif ( isSrc3D ) {\n\n\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( srcTexture ).__webglTexture, srcLevel, minZ + i );\n\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, properties.get( dstTexture ).__webglTexture, dstLevel, dstZ + i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_gl.blitFramebuffer( minX, minY, width, height, dstX, dstY, width, height, _gl.DEPTH_BUFFER_BIT, _gl.NEAREST );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t} else if ( srcLevel !== 0 || srcTexture.isRenderTargetTexture || properties.has( srcTexture ) ) {\n\n\t\t\t\t// get the appropriate frame buffers\n\t\t\t\tconst srcTextureProperties = properties.get( srcTexture );\n\t\t\t\tconst dstTextureProperties = properties.get( dstTexture );\n\n\t\t\t\t// bind the frame buffer targets\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, _srcFramebuffer );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, _dstFramebuffer );\n\n\t\t\t\tfor ( let i = 0; i < depth; i ++ ) {\n\n\t\t\t\t\t// assign the correct layers and mip maps to the frame buffers\n\t\t\t\t\tif ( isSrc3D ) {\n\n\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, srcTextureProperties.__webglTexture, srcLevel, minZ + i );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.READ_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, srcTextureProperties.__webglTexture, srcLevel );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( isDst3D ) {\n\n\t\t\t\t\t\t_gl.framebufferTextureLayer( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, dstTextureProperties.__webglTexture, dstLevel, dstZ + i );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.framebufferTexture2D( _gl.DRAW_FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D, dstTextureProperties.__webglTexture, dstLevel );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// copy the data using the fastest function that can achieve the copy\n\t\t\t\t\tif ( srcLevel !== 0 ) {\n\n\t\t\t\t\t\t_gl.blitFramebuffer( minX, minY, width, height, dstX, dstY, width, height, _gl.COLOR_BUFFER_BIT, _gl.NEAREST );\n\n\t\t\t\t\t} else if ( isDst3D ) {\n\n\t\t\t\t\t\t_gl.copyTexSubImage3D( glTarget, dstLevel, dstX, dstY, dstZ + i, minX, minY, width, height );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.copyTexSubImage2D( glTarget, dstLevel, dstX, dstY, minX, minY, width, height );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// unbind read, draw buffers\n\t\t\t\tstate.bindFramebuffer( _gl.READ_FRAMEBUFFER, null );\n\t\t\t\tstate.bindFramebuffer( _gl.DRAW_FRAMEBUFFER, null );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isDst3D ) {\n\n\t\t\t\t\t// copy data into the 3d texture\n\t\t\t\t\tif ( srcTexture.isDataTexture || srcTexture.isData3DTexture ) {\n\n\t\t\t\t\t\t_gl.texSubImage3D( glTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image.data );\n\n\t\t\t\t\t} else if ( dstTexture.isCompressedArrayTexture ) {\n\n\t\t\t\t\t\t_gl.compressedTexSubImage3D( glTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, glFormat, image.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.texSubImage3D( glTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// copy data into the 2d texture\n\t\t\t\t\tif ( srcTexture.isDataTexture ) {\n\n\t\t\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, dstLevel, dstX, dstY, width, height, glFormat, glType, image.data );\n\n\t\t\t\t\t} else if ( srcTexture.isCompressedTexture ) {\n\n\t\t\t\t\t\t_gl.compressedTexSubImage2D( _gl.TEXTURE_2D, dstLevel, dstX, dstY, image.width, image.height, glFormat, image.data );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_gl.texSubImage2D( _gl.TEXTURE_2D, dstLevel, dstX, dstY, width, height, glFormat, glType, image );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// reset values\n\t\t\t_gl.pixelStorei( _gl.UNPACK_ROW_LENGTH, currentUnpackRowLen );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_IMAGE_HEIGHT, currentUnpackImageHeight );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_PIXELS, currentUnpackSkipPixels );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_ROWS, currentUnpackSkipRows );\n\t\t\t_gl.pixelStorei( _gl.UNPACK_SKIP_IMAGES, currentUnpackSkipImages );\n\n\t\t\t// Generate mipmaps only when copying level 0\n\t\t\tif ( dstLevel === 0 && dstTexture.generateMipmaps ) {\n\n\t\t\t\t_gl.generateMipmap( glTarget );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\tthis.copyTextureToTexture3D = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, level = 0 ) {\n\n\t\t\t// @deprecated, r170\n\t\t\twarnOnce( 'WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use \"copyTextureToTexture\" instead.' );\n\n\t\t\treturn this.copyTextureToTexture( srcTexture, dstTexture, srcRegion, dstPosition, level );\n\n\t\t};\n\n\t\t/**\n\t\t * Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data\n\t\t * can be copied into it using {@link WebGLRenderer#copyTextureToTexture} before it has been\n\t\t * rendered to.\n\t\t *\n\t\t * @param {WebGLRenderTarget} target - The render target.\n\t\t */\n\t\tthis.initRenderTarget = function ( target ) {\n\n\t\t\tif ( properties.get( target ).__webglFramebuffer === undefined ) {\n\n\t\t\t\ttextures.setupRenderTarget( target );\n\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * Initializes the given texture. Useful for preloading a texture rather than waiting until first\n\t\t * render (which can cause noticeable lags due to decode and GPU upload overhead).\n\t\t *\n\t\t * @param {Texture} texture - The texture.\n\t\t */\n\t\tthis.initTexture = function ( texture ) {\n\n\t\t\tif ( texture.isCubeTexture ) {\n\n\t\t\t\ttextures.setTextureCube( texture, 0 );\n\n\t\t\t} else if ( texture.isData3DTexture ) {\n\n\t\t\t\ttextures.setTexture3D( texture, 0 );\n\n\t\t\t} else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {\n\n\t\t\t\ttextures.setTexture2DArray( texture, 0 );\n\n\t\t\t} else {\n\n\t\t\t\ttextures.setTexture2D( texture, 0 );\n\n\t\t\t}\n\n\t\t\tstate.unbindTexture();\n\n\t\t};\n\n\t\t/**\n\t\t * Can be used to reset the internal WebGL state. This method is mostly\n\t\t * relevant for applications which share a single WebGL context across\n\t\t * multiple WebGL libraries.\n\t\t */\n\t\tthis.resetState = function () {\n\n\t\t\t_currentActiveCubeFace = 0;\n\t\t\t_currentActiveMipmapLevel = 0;\n\t\t\t_currentRenderTarget = null;\n\n\t\t\tstate.reset();\n\t\t\tbindingStates.reset();\n\n\t\t};\n\n\t\tif ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {\n\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Defines the coordinate system of the renderer.\n\t *\n\t * In `WebGLRenderer`, the value is always `WebGLCoordinateSystem`.\n\t *\n\t * @type {WebGLCoordinateSystem|WebGPUCoordinateSystem}\n\t * @default WebGLCoordinateSystem\n\t * @readonly\n\t */\n\tget coordinateSystem() {\n\n\t\treturn WebGLCoordinateSystem;\n\n\t}\n\n\t/**\n\t * Defines the output color space of the renderer.\n\t *\n\t * @type {SRGBColorSpace|LinearSRGBColorSpace}\n\t * @default SRGBColorSpace\n\t */\n\tget outputColorSpace() {\n\n\t\treturn this._outputColorSpace;\n\n\t}\n\n\tset outputColorSpace( colorSpace ) {\n\n\t\tthis._outputColorSpace = colorSpace;\n\n\t\tconst gl = this.getContext();\n\t\tgl.drawingBufferColorSpace = ColorManagement._getDrawingBufferColorSpace( colorSpace );\n\t\tgl.unpackColorSpace = ColorManagement._getUnpackColorSpace();\n\n\t}\n\n}\n\nexport { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, ArrayCamera, BackSide, BoxGeometry, BufferAttribute, BufferGeometry, ByteType, CineonToneMapping, ClampToEdgeWrapping, Color, ColorManagement, ConstantAlphaFactor, ConstantColorFactor, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeUVReflectionMapping, CullFaceBack, CullFaceFront, CullFaceNone, CustomBlending, CustomToneMapping, Data3DTexture, DataArrayTexture, DepthFormat, DepthStencilFormat, DepthTexture, DoubleSide, DstAlphaFactor, DstColorFactor, EqualCompare, EqualDepth, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, FloatType, FrontSide, Frustum, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, HalfFloatType, IntType, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LinearFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NoBlending, NoColorSpace, NoToneMapping, NormalBlending, NotEqualCompare, NotEqualDepth, ObjectSpaceNormalMap, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, PerspectiveCamera, Plane, PlaneGeometry, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReverseSubtractEquation, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, ShaderChunk, ShaderLib, ShaderMaterial, ShortType, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, SubtractEquation, SubtractiveBlending, TangentSpaceNormalMap, Texture, Uint16BufferAttribute, Uint32BufferAttribute, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebXRController, ZeroFactor, createCanvasElement };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"]}